Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 15:48

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[RELEASE]Fortuneteller(Scissor,rock & paper game)(AWSOME AND FUN)ALL NEED THIS :)!!!!

Discussion on [RELEASE]Fortuneteller(Scissor,rock & paper game)(AWSOME AND FUN)ALL NEED THIS :)!!!! within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2009
Posts: 149
Received Thanks: 22
[RELEASE]Fortuneteller(Scissor,rock & paper game)(AWSOME AND FUN)ALL NEED THIS :)!!!!

TESTED AND IT WORK

Hello there
This is for LOTF.
Here is the Fortuneteller NPC with the scissor, rock and paper game.
We need some fun NPC right?
Also you can loose or win.
Thats great huh?
Is build up like real scissor, rock and paper game.
Where you have:
33,33%Chance to win.
33,33%Chance to round draw (You will recieve your cps back then)
33,33%Chance to loose.
When win you get the couble amount of used cps, it will say
it cose 10000cps, if win you will recieve 20000cps.
Thats great, well here is the NPC.
This goes to Client.cs

Green = Winning
Orange = Draw
Red = Loose

NPC Talk:
Code:
if (CurrentNPC == 28944) //Fortuneteller
                            {
                                SendPacket(General.MyPackets.NPCSay("Hey there, Want to make a little gambling?"));
                                SendPacket(General.MyPackets.NPCLink("What kind of gambling?", 1));
                                SendPacket(General.MyPackets.NPCLink("No sorry, im not gonna gamble", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
NPC Control:
Code:
                              if (CurrentNPC == 28944) //Fortuneteller
                              {        
                                if (Control == 1)
                                {
                                    SendPacket(General.MyPackets.NPCSay("You give me 10000CP's and we make scissor,rock and paper, if you win i give you double back,if you loose I keep your cps"));
                                    SendPacket(General.MyPackets.NPCLink("Thats a good deal, lets go.", 2));
                                    SendPacket(General.MyPackets.NPCLink("Sorry i don't want to.", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                                if (Control == 2)
                                {
                                    if (MyChar.CPs >= 10000)
                                    {
                                    SendPacket(General.MyPackets.NPCSay("I see you have enough CP's, are you stills sure."));
                                    SendPacket(General.MyPackets.NPCLink("Yeah im sure, lets go.", 3));
                                    SendPacket(General.MyPackets.NPCLink("I have changed my mind.", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                              }
                                if (Control == 3)
                                    {
                                        MyChar.CPs -= 10000;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        Random FT = new Random();
                                        int Nr = FT.Next(1, 9);
                                        [COLOR="Orange"]if (Nr == 1) //Scissor vs scissor
                                        {
                                        MyChar.CPs += 10000;
                                        SendPacket(General.MyPackets.Vital((long)MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You got Scissor, Fortuneteller also got Scissor. No one wins.", 2000));
                                        }[/COLOR]
                                        [COLOR="Red"]if (Nr == 2) //Scissor vs rock
                                        {
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You got Scissor, Fortuneteller got Rock. Fortuneteller wins.", 2000));
                                        }[/COLOR]
                                        [COLOR="SeaGreen"]if (Nr == 3) //Scissor vs paper
                                        {
                                        MyChar.CPs += 20000;
                                        SendPacket(General.MyPackets.Vital((long)MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You got Scissor, Fortuneteller got Paper. You win.", 2000));
                                        }[/COLOR]
                                        [COLOR="SeaGreen"]if (Nr == 4) //Rock vs scissor
                                        {
                                        MyChar.CPs += 20000;
                                        SendPacket(General.MyPackets.Vital((long)MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You got Rock, Fortuneteller got Scissor. You win.", 2000));
                                        }[/COLOR]
                                        [COLOR="Orange"]if (Nr == 5) //Rock vs rock
                                        {
                                        MyChar.CPs += 10000;
                                        SendPacket(General.MyPackets.Vital((long)MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You got Rock, Fortuneteller also got Rock. No one wins.", 2000));
                                        }[/COLOR]
                                        [COLOR="Red"]if (Nr == 6) //Rock vs paper
                                        {
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You got Rock, Fortuneteller got Paper. Fortuneteller wins.", 2000));
                                        }[/COLOR]
                                        [COLOR="Red"]if (Nr == 7) //Paper vs scissor
                                        {
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You got Paper, Fortuneteller got Scissor. Fortuneteller wins.", 2000));
                                        }[/COLOR]
                                        [COLOR="SeaGreen"]if (Nr == 8) //Paper vs rock
                                        {
                                        MyChar.CPs += 20000;
                                        SendPacket(General.MyPackets.Vital((long)MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You got Paper, Fortuneteller got Rock. You win.", 2000));
                                        }[/COLOR]
                                        [COLOR="Orange"]if (Nr == 9) //Paper vs paper
                                        {
                                        MyChar.CPs += 10000;
                                        SendPacket(General.MyPackets.Vital((long)MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You got Paper, Fortuneteller also got Paper. No one wins.", 2000));
                                        }
                                }
                            }[/COLOR]
#*=DarkAngeL=*# is offline  
Thanks
5 Users
Old 11/14/2009, 06:01   #2
 
elite*gold: 0
Join Date: Oct 2009
Posts: 156
Received Thanks: 20
nice?
_legitimate_ is offline  
Old 11/14/2009, 06:02   #3
 
elite*gold: 0
Join Date: Jun 2009
Posts: 361
Received Thanks: 98
Wow bro this will be awesome if it works. Gonna test it out right now =p

#Edit
OH YEAH I FORGOT I CAN'T ADD ANY NPCS TO MY DATABASE FOR SOME ****** UP REASON :@ ******* ****** ME OFF SOO MUCH!!! Would you know why that might be happening by any chance? =\
Jay1029 is offline  
Old 11/14/2009, 06:15   #4
 
elite*gold: 0
Join Date: Nov 2009
Posts: 149
Received Thanks: 22
Hmmm you have the right name of SQL file?

Quote:
Originally Posted by _legitimate_ View Post
nice?
Huh?


#UPDATED
Had some wrong spelling XD
#*=DarkAngeL=*# is offline  
Thanks
1 User
Old 11/14/2009, 07:07   #5
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
good idea. I had a cash based lotto I coded back when I had my server. I'll code some game systems like this for coemu later if anyone wants one.

gimme some ideas for simple games/gambling people would like to see made and I'll find time to write them up later.
pro4never is offline  
Old 11/14/2009, 07:09   #6
 
elite*gold: 0
Join Date: Nov 2009
Posts: 149
Received Thanks: 22
Quote:
Originally Posted by pro4never View Post
good idea. I had a cash based lotto I coded back when I had my server. I'll code some game systems like this for coemu later if anyone wants one.

gimme some ideas for simple games/gambling people would like to see made and I'll find time to write them up later.
BlackJack XD
Im trying to work it out, but is hard, cause is not simple cause is based on many chances XD
1chance for eveycard + chance for that you take 1 more card and chances for that you hit over and lower and chaces for that the other get 21.
So is pretty hard to make
And i had the idea with fortuneteller from LastCo XD
#*=DarkAngeL=*# is offline  
Thanks
2 Users
Old 11/14/2009, 08:33   #7
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Wanna let me know how exactly black jack works?

Each turn the player is given a card with a value of 1-13 and if they go over 21 total score (accumulated) they loose. The player is trying to beat an npc? or other players? cause you could code a system where they are playing versus other players at the "table" and the person with the highest score w/o going over wins... or are you talking about having it versus an npc who is using AI to get the best possible score w/o going over?

For players I'd use a fixed cost for betting, announce to players in market that PlayerName has joined the BlackJack table, use a Hashtable to store current player scores, use a public int to store all money placed on a table (removed initially from characters so if they leave w/o completing game they WILL lose cash), use if statements to state if a player goes over 21 they are removed from the hash table (seeing as their money is added to a separate function, removing a player from the hashtable will not damage the betting).

How does BlackJack determine the ending? Is it when all players have decided not to be "hit" with another card? or is there a round limit associated with it also? (because you would have to use a timer to remove players who do not answer positive or negatively)

I may look into it a bit tomorrow but it doesn't seem like the most complicated thing ever.

Ps: if this post doesn't make much sense... I'm only slightly drunk. Was getting ready for bed and decided to write some stuff, not a good plan.
pro4never is offline  
Old 11/14/2009, 16:22   #8
 
elite*gold: 0
Join Date: Sep 2008
Posts: 348
Received Thanks: 141
Nice Idea..!!
!DeX! is offline  
Thanks
1 User
Old 11/14/2009, 16:36   #9
 
~*NewDuuDe*~'s Avatar
 
elite*gold: 111
Join Date: Feb 2008
Posts: 2,161
Received Thanks: 646
This wont work until you put in this packet, as now the cps wont show.

Code:
 SendPacket(General.MyPackets.Vital((long)MyChar.UID, 30, MyChar.CPs));
~*NewDuuDe*~ is offline  
Thanks
1 User
Old 11/14/2009, 18:33   #10
 
elite*gold: 0
Join Date: Oct 2006
Posts: 75
Received Thanks: 17
Code:
case npc nr: //Fortuneteller
                    {
                        if (LinkBack == 0)
                        {
                            Text("Hey there, Want to make a little gambling?", CSocket);
                            Link("What kind of gambling?", 1, CSocket);
                            Link("No sorry, im not gonna gamble", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        if (LinkBack == 1)
                        {
                            if (CSocket.Client.CPs >= 10000)
                            {
                                Text("You give me 10000CP's and we make scissor,rock and paper, if you win i give you double back,if you loose I keep your cps", CSocket);
                                Link("Thats a good deal, lets go.", 2, CSocket);
                                Link("Sorry i don't want to.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            else
                            {
                                Text("Sir you do not have enough CPs. Please come back when u have one!", CSocket);
                                Link("Sorry.", 255, CSocket);
                                End(CSocket);
                            }

                        }
                        if (LinkBack == 2)
                        {
                            if (CSocket.Client.CPs >= 10000)
                            {

                                Text("I see you have enough CP's, are you stills sure.", CSocket);
                                Link("Yeah im sure, lets go.", 3, CSocket);
                                Link("I have changed my mind.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            else
                            {
                                Text("Sir you do not have enough CPs. Please come back when u have one!", CSocket);
                                Link("Sorry.", 255, CSocket);
                                End(CSocket);
                            }
                        }
                        if (LinkBack == 3)
                        {
                            if (CSocket.Client.CPs >= 10000)
                            {                                
                                    CPs(-10000, CSocket);
                                    Random FT = new Random();
                                    int Nr = FT.Next(1, 9);
                                    if (Nr == 1) //Scissor vs scissor
                                    {
                                        CPs(+10000, CSocket);
                                        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You got Scissor, Fortuneteller also got Scissor. No one wins.", Struct.ChatType.Top));
                                    }
                                    if (Nr == 2) //Scissor vs rock
                                    {
                                        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You got Scissor, Fortuneteller got Rock. Fortuneteller wins.", Struct.ChatType.Top));
                                    }
                                    if (Nr == 3) //Scissor vs paper
                                    {
                                        CPs(+20000, CSocket);
                                        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You got Scissor, Fortuneteller got Paper. You win.", Struct.ChatType.Top));
                                    }
                                    if (Nr == 4) //Rock vs scissor
                                    {
                                        CPs(+20000, CSocket);
                                        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You got Rock, Fortuneteller got Scissor. You win.", Struct.ChatType.Top));
                                    }
                                    if (Nr == 5) //Rock vs rock
                                    {
                                        CPs(+10000, CSocket);
                                        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You got Rock, Fortuneteller also got Rock. No one wins.", Struct.ChatType.Top));
                                    }
                                    if (Nr == 6) //Rock vs paper
                                    {
                                        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You got Rock, Fortuneteller got Paper. Fortuneteller wins.", Struct.ChatType.Top));
                                    }
                                    if (Nr == 7) //Paper vs scissor
                                    {
                                        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You got Paper, Fortuneteller got Scissor. Fortuneteller wins.", Struct.ChatType.Top));
                                    }
                                    if (Nr == 8) //Paper vs rock
                                    {
                                        CPs(+20000, CSocket);
                                        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You got Paper, Fortuneteller got Rock. You win.", Struct.ChatType.Top));
                                    }
                                    if (Nr == 9) //Paper vs paper
                                    {
                                        CPs(+10000, CSocket);
                                        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You got Paper, Fortuneteller also got Paper. No one wins.", Struct.ChatType.Top));
                                    }

                                }
                            else
                                    {
                                        Text("Sir you do not have enough CPs. Please come back when u have one!", CSocket);
                                        Link("Sorry.", 255, CSocket);
                                        End(CSocket);
                                    }                                                                               
                        }
                        break;
                    }
took my time to convert to coemu v2 for those who dont have time, works 100%
gad-legion is offline  
Old 11/14/2009, 20:15   #11
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Quote:
Originally Posted by gad-legion View Post

took my time to convert to coemu v2 for those who dont have time, works 100%

Minor fixes should be done.


ALWAYS check cp in the same section where you are removing them. If not people can get past the dialogue to get to that point, then trade the cp off to another character and play for free (resulting in them having negative cp)
All you have to do is above where it says

CPs(-10000, CSocket);


put
if (CSocket.Client.CPs >= 10000)
{


then under that section of code put the closing bracket

}


then do

Code:
else
                            {
                                Text("Sir you do not have enough CPs. Please come back when u have one!", CSocket);
                                Link("Sorry.", 255, CSocket);
                                End(CSocket);
                            }

You can then change some of the earlier code.

Remember, whenever you are going to try to remove something from char (money, cp, items etc) Always check them in the same section of code where you are removing them! If not players can find the exploit and fuck up their character (negative cash/cp being one of the possibilities)
pro4never is offline  
Thanks
1 User
Old 11/14/2009, 22:15   #12
 
elite*gold: 0
Join Date: Oct 2006
Posts: 75
Received Thanks: 17
its nice some ppl realy care about the quality of the codes released on elitepvpers, thats a good example pro4never, fortuneteller for coemu updated whit pro4never guidence
gad-legion is offline  
Old 11/15/2009, 00:37   #13
 
elite*gold: 0
Join Date: Nov 2009
Posts: 149
Received Thanks: 22
Quote:
Originally Posted by pro4never View Post
Wanna let me know how exactly black jack works?

Each turn the player is given a card with a value of 1-13 and if they go over 21 total score (accumulated) they loose. The player is trying to beat an npc? or other players? cause you could code a system where they are playing versus other players at the "table" and the person with the highest score w/o going over wins... or are you talking about having it versus an npc who is using AI to get the best possible score w/o going over?

For players I'd use a fixed cost for betting, announce to players in market that PlayerName has joined the BlackJack table, use a Hashtable to store current player scores, use a public int to store all money placed on a table (removed initially from characters so if they leave w/o completing game they WILL lose cash), use if statements to state if a player goes over 21 they are removed from the hash table (seeing as their money is added to a separate function, removing a player from the hashtable will not damage the betting).

How does BlackJack determine the ending? Is it when all players have decided not to be "hit" with another card? or is there a round limit associated with it also? (because you would have to use a timer to remove players who do not answer positive or negatively)

I may look into it a bit tomorrow but it doesn't seem like the most complicated thing ever.

Ps: if this post doesn't make much sense... I'm only slightly drunk. Was getting ready for bed and decided to write some stuff, not a good plan.
Beat NPC, i dont think you can with other players XD

Quote:
Originally Posted by BERGHUIS1 View Post
This wont work until you put in this packet, as now the cps wont show.

Code:
 SendPacket(General.MyPackets.Vital((long)MyChar.UID, 30, MyChar.CPs));
Thanks man forgot that ill do it now
#*=DarkAngeL=*# is offline  
Old 11/15/2009, 02:49   #14
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Quote:
Originally Posted by #*=DarkAngeL=*# View Post
Beat NPC, i dont think you can with other players XD


Thanks man forgot that ill do it now
You could do it fairly easy. The game itself would requires lightly higher levels of coding then most npcs would but it could be done. Just use a hashtable to store player scores and use that to control who wins.

Would require a bit of interesting coding though. I may give it a shot sometime if I have time and am still interested in the concept.
pro4never is offline  
Old 11/15/2009, 03:28   #15
 
elite*gold: 0
Join Date: Nov 2009
Posts: 149
Received Thanks: 22
Quote:
Originally Posted by pro4never View Post
You could do it fairly easy. The game itself would requires lightly higher levels of coding then most npcs would but it could be done. Just use a hashtable to store player scores and use that to control who wins.

Would require a bit of interesting coding though. I may give it a shot sometime if I have time and am still interested in the concept.
Yeah it could be cool
I will also take a look on it, when i have time
#*=DarkAngeL=*# is offline  
Reply


Similar Threads Similar Threads
[ReRelease]Scissor,Rock & Paper Game
05/11/2010 - CO2 PServer Guides & Releases - 5 Replies
Okay im back to E.pvp. Well, i will repost my old npc for lotf 5017. Wich also include it for the: There is 33,33% Chance to win. NPC Talk: if (CurrentNPC == 28944) //Fortuneteller { SendPacket(General.MyPackets.NPCSay("Hey there, Want to make a little gambling?"));
Rock Paper Scissors Bot Request
02/15/2010 - GW Bots - 3 Replies
Would it be possible for someone to make a bot that automatically plays rock paper scissors for lunar tokens?
Rock, paper, scissors.
11/21/2007 - Off Topic - 7 Replies
Originally posted by Clyps. "Ok, I understand that Scissors can beat Paper, and I get how Rock can beat Scissors, but there's no fucking way Paper can beat Rock. Paper is supposed to magically wrap around Rock leaving it immobile? Why the hell cant paper do this to scissors? Screw scissors, why can't paper do this to people?" "Why isn't notebook paper constantly suffocating students while they take notes in class? I'll tell you why, because paper can't beat anybody, a rock would tear that...
1-Day; Halloween/Rock,Paper,Scissors
11/03/2005 - Guild Wars - 3 Replies
If King Thorn ask's you which weapon you would choose to defeat him's, always choose Scissors, I was taking the Event at 13 and 16 O'Clock and he always had Paper. This only counts for today, cuz tomorrow theres no halloween anymore.



All times are GMT +2. The time now is 15:48.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.