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 21:29

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

Advertisement



[Release] Amazing 1v1 tournament (fb/ss)

Discussion on [Release] Amazing 1v1 tournament (fb/ss) within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
Smile [Release] Amazing 1v1 tournament (fb/ss) [5165]

Well, I see that this forum is really helping with the development of the source 5165. That is why I decided to put this wonderful code.

Here we go,

First of all, add the desired map to fight.

Go search for:
Code:
public static ArrayList FreePKMaps = new ArrayList()
There we will see the list of PK maps.

For in that list we add this:
Code:
, (ushort)1707
Now let's add a portal.

Go Portals.txt in OldCoDB and add the follow code:

Code:
1707 52 74 1707 52 70

Now go to GuildWars (Features folder) and search for:

Code:
public static bool War;

Then add the next code below:

Code:
public static bool Ocupado; // 1v1
Well, preparations are already.

Now let the good code:

In Character.cs search for:

Code:
public string TempPass = "";
And above add:

Code:
public string Enemigo = ""; // 1v1
public byte PkPuntos = 0; // 1v1
public bool Luchando = false; // 1v1
public byte Apuesta = 0; // 1v1
[Note] Is spanish methods


Now go to Skills.cs and search for:


Code:
if (User.MyClient.GM)
                        {
                            if (C.EntityID != User.EntityID)
                            {
                                continue;
                            }
                        }
[Note] If you do not find this roughly in line 721


Just below the code add:

Code:
if (User.Loc.Map == 1707 && Info.ID == 1045 || User.Loc.Map == 1707 && Info.ID == 1046)
                        {
                            if (User.Luchando == true)
                            {
                                Game.Character J = Game.World.CharacterFromName(User.Enemigo);
                                User.PkPuntos++;
                                User.MyClient.LocalMessage(2011, User.Name + ": " + User.PkPuntos + " points. " + J.Name + ": " + J.PkPuntos + " points");
                                J.MyClient.LocalMessage(2011, User.Name + ": " + User.PkPuntos + " points. " + J.Name + ": " + J.PkPuntos + " points");
                                {
                                    if (User.PkPuntos == 10)
                                    {
                                        Game.World.SendMsgToAll(User.Name, User.Name + " (" + User.PkPuntos + ")" + " has won " + User.Enemigo + " (" + J.PkPuntos + ")" + " in a battle of 1 v 1! The winner has won: " + User.Apuesta + " CPs", 2011, 0);
                                        J.Teleport(1002, 406, 400);
                                        User.Teleport(1002, 399, 400);
                                        User.Protection = false;
                                        J.Protection = false;
                                        User.Luchando = false;
                                        J.Luchando = false;
                                        User.PkPuntos = 0;
                                        J.PkPuntos = 0;
                                        User.Enemigo = "";
                                        J.Enemigo = "";
                                        User.CPs += User.Apuesta;
                                        J.CPs -= User.Apuesta;
                                        Features.GuildWars.Ocupado = false;
                                    }
                                }
                            }
                        }
Now go with the NPC:

In NPCDialog.cs add the next code:


Code:
#region Tourny 1v1
                            case 600565:
                                {
                                    GC.MyChar.PkPuntos = 0;
                                    GC.MyChar.Luchando = false;
                                    {
                                        if (Control == 0)
                                        {
                                            GC.AddSend(Packets.NPCSay("Hello, you want to participate in the 1v1 tournament against the opponent that you want?"));
                                            GC.AddSend(Packets.NPCLink("Yes, i want!", 20));
                                            GC.AddSend(Packets.NPCLink("More information", 10));
                                            GC.AddSend(Packets.NPCLink("No thanks...", 255));
                                            GC.AddSend(Packets.NPCSetFace(50));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else if (Control == 10)
                                        {
                                            GC.AddSend(Packets.NPCSay("The battle is simple, choose the player you want, and then you will be transported to a map. There you will have to fight to fb and / or ss. Life does not matter, not hos sacareis nothing. A 10 touches."));
                                            GC.AddSend(Packets.NPCLink("I accept", 20));
                                            GC.AddSend(Packets.NPCLink("Ok, bye..", 255));
                                            GC.AddSend(Packets.NPCSetFace(50));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else if (Control == 20)
                                        {
                                            if (Features.GuildWars.Ocupado == false)
                                            {
                                                if ((GC.MyChar.Equips.RightHand.ID >= 410003 && GC.MyChar.Equips.RightHand.ID <= 421339) || (GC.MyChar.Equips.LeftHand.ID >= 410003 && GC.MyChar.Equips.LeftHand.ID <= 421339))
                                                {
                                                    GC.AddSend(Packets.NPCSay("Enter the bet you want to do with your enemy. For example, if you bet and win 50 fps, 50 fps you rob the opponent. If you lose, the opponent to stay with your CPs."));
                                                    GC.AddSend(Packets.NPCLink("10 CPs", 21));
                                                    GC.AddSend(Packets.NPCLink("20 CPs", 22));
                                                    GC.AddSend(Packets.NPCLink("30 CPs", 23));
                                                    GC.AddSend(Packets.NPCLink("50 CPs", 24));
                                                    GC.AddSend(Packets.NPCLink("100 CPs", 25));
                                                    GC.AddSend(Packets.NPCLink("200 CPs", 26));
                                                    GC.AddSend(Packets.NPCLink("250 CPs", 27));
                                                    GC.AddSend(Packets.NPCLink("Good bye..", 255));
                                                    GC.AddSend(Packets.NPCSetFace(50));
                                                    GC.AddSend(Packets.NPCFinish());
                                                }
                                                else
                                                {
                                                    GC.AddSend(Packets.NPCSay("Sorry, you need Blade, sword or backsword for figt."));
                                                    GC.AddSend(Packets.NPCLink("Oh.. i see..", 255));
                                                    GC.AddSend(Packets.NPCSetFace(50));
                                                    GC.AddSend(Packets.NPCFinish());
                                                }
                                            }
                                            else
                                            {
                                                GC.AddSend(Packets.NPCSay("Sorry, the map is occupied again later!"));
                                                GC.AddSend(Packets.NPCLink("Ok, i wait", 255));
                                                GC.AddSend(Packets.NPCSetFace(50));
                                                GC.AddSend(Packets.NPCFinish());
                                            }
                                        }
                                        else if (Control == 21)
                                        {
                                            GC.MyChar.Apuesta = 10;
                                            GC.AddSend(Packets.NPCSay("Okay, well written enter the opponent's name in the text box. Struggling with he for " + GC.MyChar.Apuesta + " CPs"));
                                            GC.AddSend(Packets.NPCLink2("Name", 2));
                                            GC.AddSend(Packets.NPCLink("Bye guy...", 255));
                                            GC.AddSend(Packets.NPCSetFace(50));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else if (Control == 22)
                                        {
                                            GC.MyChar.Apuesta = 20;
                                            GC.AddSend(Packets.NPCSay("Okay, well written enter the opponent's name in the text box. Struggling with he for " + GC.MyChar.Apuesta + " CPs"));
                                            GC.AddSend(Packets.NPCLink2("Name", 2));
                                            GC.AddSend(Packets.NPCLink("Bye guy...", 255));
                                            GC.AddSend(Packets.NPCSetFace(50));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else if (Control == 23)
                                        {
                                            GC.MyChar.Apuesta = 30;
                                            GC.AddSend(Packets.NPCSay("Okay, well written enter the opponent's name in the text box. Struggling with he for " + GC.MyChar.Apuesta + " CPs"));
                                            GC.AddSend(Packets.NPCLink2("Name", 2));
                                            GC.AddSend(Packets.NPCLink("Bye guy...", 255));
                                            GC.AddSend(Packets.NPCSetFace(50));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else if (Control == 24)
                                        {
                                            GC.MyChar.Apuesta = 50;
                                            GC.AddSend(Packets.NPCSay("Okay, well written enter the opponent's name in the text box. Struggling with he for " + GC.MyChar.Apuesta + " CPs"));
                                            GC.AddSend(Packets.NPCLink2("Name", 2));
                                            GC.AddSend(Packets.NPCLink("Bye guy...", 255));
                                            GC.AddSend(Packets.NPCSetFace(50));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else if (Control == 25)
                                        {
                                            GC.MyChar.Apuesta = 100;
                                            GC.AddSend(Packets.NPCSay("Okay, well written enter the opponent's name in the text box. Struggling with he for " + GC.MyChar.Apuesta + " CPs"));
                                            GC.AddSend(Packets.NPCLink2("Name", 2));
                                            GC.AddSend(Packets.NPCLink("Bye guy...", 255));
                                            GC.AddSend(Packets.NPCSetFace(50));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else if (Control == 26)
                                        {
                                            GC.MyChar.Apuesta = 200;
                                            GC.AddSend(Packets.NPCSay("Okay, well written enter the opponent's name in the text box. Struggling with he for " + GC.MyChar.Apuesta + " CPs"));
                                            GC.AddSend(Packets.NPCLink2("Name", 2));
                                            GC.AddSend(Packets.NPCLink("Bye guy...", 255));
                                            GC.AddSend(Packets.NPCSetFace(50));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else if (Control == 27)
                                        {
                                            GC.MyChar.Apuesta = 250;
                                            GC.AddSend(Packets.NPCSay("Okay, well written enter the opponent's name in the text box. Struggling with he for " + GC.MyChar.Apuesta + " CPs"));
                                            GC.AddSend(Packets.NPCLink2("Name", 2));
                                            GC.AddSend(Packets.NPCLink("Bye guy...", 255));
                                            GC.AddSend(Packets.NPCSetFace(50));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else if (Control == 1)
                                        {
                                            GC.AddSend(Packets.NPCSay("Okay, well written enter the opponent's name in the text box. Struggling with he for " + GC.MyChar.Apuesta + " CPs"));
                                            GC.AddSend(Packets.NPCLink2("Name", 2));
                                            GC.AddSend(Packets.NPCLink("Bye guy...", 255));
                                            GC.AddSend(Packets.NPCSetFace(50));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else if (Control == 2)
                                        {

                                            GC.MyChar.Enemigo = ReadString(Data);
                                            {
                                                Game.Character C = Game.World.CharacterFromName(GC.MyChar.Enemigo);
                                                if (C != null && C != GC.MyChar)
                                                {
                                                    if (C.CPs >= GC.MyChar.Apuesta)
                                                    {
                                                        if (C.Loc.Map == 1002)
                                                        {
                                                            GC.AddSend(Packets.NPCSay("Really you want to invite " + GC.MyChar.Enemigo + " ?"));
                                                            GC.AddSend(Packets.NPCLink("Yes!", 3));
                                                            GC.AddSend(Packets.NPCLink("No thanks..", 255));
                                                            GC.AddSend(Packets.NPCSetFace(50));
                                                            GC.AddSend(Packets.NPCFinish());
                                                        }
                                                        else
                                                        {
                                                            GC.AddSend(Packets.NPCSay("The character has to be in Twin City."));
                                                            GC.AddSend(Packets.NPCLink("Uhh ... Let me provide another", 10));
                                                            GC.AddSend(Packets.NPCLink("Ok, then, bye.", 255));
                                                            GC.AddSend(Packets.NPCSetFace(50));
                                                            GC.AddSend(Packets.NPCFinish());
                                                        }
                                                    }
                                                    else
                                                    {
                                                        GC.AddSend(Packets.NPCSay("Elected opponent does not have enough CPs. Choose a better one ..."));
                                                        GC.AddSend(Packets.NPCLink("Uhh ... Let me provide another", 20));
                                                        GC.AddSend(Packets.NPCLink("Ok, bye.", 255));
                                                        GC.AddSend(Packets.NPCSetFace(50));
                                                        GC.AddSend(Packets.NPCFinish());
                                                    }
                                                }
                                                else
                                                {
                                                    GC.AddSend(Packets.NPCSay("I feel the character is not connected or does not exist. Or did you choose yourself as a contender .."));
                                                    GC.AddSend(Packets.NPCLink("Uhh ... Let me provide another", 1));
                                                    GC.AddSend(Packets.NPCLink("Oh, sorry.", 255));
                                                    GC.AddSend(Packets.NPCSetFace(50));
                                                    GC.AddSend(Packets.NPCFinish());
                                                }
                                            }
                                        }
                                        else if (Control == 3)
                                        {
                                            Game.Character C = Game.World.CharacterFromName(GC.MyChar.Enemigo);
                                            {
                                                if ((C.Equips.RightHand.ID >= 410003 && C.Equips.RightHand.ID <= 421339) || (C.Equips.LeftHand.ID >= 410003 && C.Equips.LeftHand.ID <= 421339))
                                                {
                                                    if (C != null && C != GC.MyChar)
                                                    {
                                                        C.Apuesta = GC.MyChar.Apuesta;
                                                        C.Enemigo = GC.MyChar.Name;
                                                        C.MyClient.DialogNPC = 600566;
                                                        PacketHandling.NPCDialog.Handle(C.MyClient, null, 600566, 0);
                                                        C.MyClient.EndSend();
                                                    }
                                                }
                                                else
                                                {
                                                    GC.AddSend(Packets.NPCSay("The opponent who has asked not to have sword or blade, you can not fight with he!"));
                                                    GC.AddSend(Packets.NPCLink("Uhh, let me choise another", 1));
                                                    GC.AddSend(Packets.NPCLink("Oh, bye", 255));
                                                    GC.AddSend(Packets.NPCSetFace(50));
                                                    GC.AddSend(Packets.NPCFinish());
                                                }
                                            }
                                        }
                                    }
                                }
                                break;
                            #endregion
                            #region Tourny 1v1 Checkout
                            case 600566:
                                {
                                    if (Control == 0)
                                    {
                                        Game.Character C = Game.World.CharacterFromName(GC.MyChar.Enemigo);
                                        {
                                            GC.AddSend(Packets.NPCSay(GC.MyChar.Enemigo + " has invited you to play for " + GC.MyChar.Apuesta + " CPs in a 1v1 battle, accept?"));
                                            GC.AddSend(Packets.NPCLink("Yes, i want figth.", 1));
                                            GC.AddSend(Packets.NPCLink("More information of my enemy.", 3));
                                            GC.AddSend(Packets.NPCLink("No thanks", 2));
                                            GC.AddSend(Packets.NPCSetFace(50));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if (Control == 1)
                                    {
                                        Game.Character C = Game.World.CharacterFromName(GC.MyChar.Enemigo);
                                        {
                                            GC.MyChar.PkPuntos = 0;
                                            GC.MyChar.Teleport(1707, 52, 43);
                                            Features.GuildWars.Ocupado = true;
                                            Game.World.SendMsgToAll(GC.MyChar.Name, GC.MyChar.Name + " and " + GC.MyChar.Enemigo + " going to fight a battle for " + GC.MyChar.Apuesta + " CPs!", 2011, 0);
                                            C.Teleport(1707, 52, 57);
                                            GC.MyChar.Luchando = true;
                                            C.Luchando = true;
                                            GC.MyChar.Protection = true;
                                            C.Protection = true;
                                        }
                                    }
                                    else if (Control == 2)
                                    {
                                        Game.Character C = Game.World.CharacterFromName(GC.MyChar.Enemigo);
                                        {
                                            GC.MyChar.Enemigo = "";
                                            C.MyClient.DialogNPC = 600567;
                                            PacketHandling.NPCDialog.Handle(C.MyClient, null, 600567, 0);
                                            C.MyClient.EndSend();
                                        }
                                    }
                                    else if (Control == 3)
                                    {
                                        Game.Character C = Game.World.CharacterFromName(GC.MyChar.Enemigo);
                                        {
                                            GC.AddSend(Packets.NPCSay("Información of: " + C.Name + " | Level: " + C.Level + " | Potency: " + C.Potency + " | "));
                                            GC.AddSend(Packets.NPCSay("Max HP: " + C.MaxHP + " | MahMP: " + C.MaxMP + " | Job: " + C.Job + "."));
                                            GC.AddSend(Packets.NPCLink("Ok, i want figth!", 1));
                                            GC.AddSend(Packets.NPCLink("No guy.. bye", 2));
                                            GC.AddSend(Packets.NPCSetFace(50));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                }
                                break;

                            #endregion
                            #region Tourny 1v1 rejected
                            case 600567:
                                {
                                    if (Control == 0)
                                    {
                                        GC.MyChar.Enemigo = "";
                                        GC.AddSend(Packets.NPCSay("Your enemy has rejected you"));
                                        GC.AddSend(Packets.NPCLink("Uhh... Ok thanks...", 255));
                                        GC.AddSend(Packets.NPCSetFace(50));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                }
                                break;

                            #endregion

And add this to NPCs.txt in your OldCoDB:

Code:
600565 6520 2 63 1002 429 388
600566 6520 2 63 5000 90 90
600567 6520 2 63 5000 90 90
Good luck to all! =)
.Kob is offline  
Thanks
16 Users
Old 02/22/2010, 12:37   #2
 
elite*gold: 0
Join Date: Feb 2010
Posts: 480
Received Thanks: 207
Is there a command to start this tourney or is it on a time limit by NPC?
Decker_ is offline  
Old 02/22/2010, 12:45   #3
 
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
You no need commands... is 24/7 this challenge >.<
.Kob is offline  
Thanks
1 User
Old 02/22/2010, 12:49   #4
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
Quote:
Originally Posted by Decker_ View Post
Is there a command to start this tourney or is it on a time limit by NPC?
It's not a tourny, its just a 1v1 system.
Arcо is offline  
Thanks
1 User
Old 02/22/2010, 14:25   #5
 
elite*gold: 0
Join Date: Sep 2007
Posts: 188
Received Thanks: 8
i want acommand to start it
koko425 is offline  
Old 02/22/2010, 14:57   #6
 
elite*gold: 0
Join Date: Dec 2007
Posts: 1,326
Received Thanks: 539
it only teleports the target and don't teleport me and says error in line 12152
which is

C.Teleport(1707, 52, 57);

so what is wrong?

#edit now it works dude u should say its only for normal chars not [PM] / [GM]

and how can i increase the amount of CPs just like 100k not 500 etc.
[GM] is offline  
Old 02/22/2010, 15:25   #7
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Interesting, similar idea to the dueling system on my server.

Assuming this one works for 5165 and you made this yourself then good work!

Couple questions though...

#1: Why have a linkback for each betting amount? Why not use an input box to enter a custom amount? Then check both clients to see if they have enough cp and then send a challenge request to the second player with the info entered (Eg: Number of hits to win and amount bet on match)

#2: Why let them challange everyone on the server? It can make for some annoying spam if you get people spamming requests to people who don't want to fight. Personally I used a team system so only the team leader can send a challenge request and only to members of his/her own team.
pro4never is offline  
Thanks
1 User
Old 02/22/2010, 15:30   #8
 
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
Quote:
Originally Posted by pro4never View Post
Interesting, similar idea to the dueling system on my server.

Assuming this one works for 5165 and you made this yourself then good work!

Couple questions though...

#1: Why have a linkback for each betting amount? Why not use an input box to enter a custom amount? Then check both clients to see if they have enough cp and then send a challenge request to the second player with the info entered (Eg: Number of hits to win and amount bet on match)

#2: Why let them challange everyone on the server? It can make for some annoying spam if you get people spamming requests to people who don't want to fight. Personally I used a team system so only the team leader can send a challenge request and only to members of his/her own team.

#1: Faster maker >.<'

#2: This can be added :P
.Kob is offline  
Old 02/22/2010, 16:26   #9
 
elite*gold: 0
Join Date: Sep 2007
Posts: 188
Received Thanks: 8
its not work see

koko425 is offline  
Old 02/22/2010, 16:35   #10
 
elite*gold: 0
Join Date: Dec 2007
Posts: 1,326
Received Thanks: 539
Quote:
Originally Posted by koko425 View Post
its not work see

it works korolos
don't forget to add[PM]/[GM] or whatever in the player's name
[GM] is offline  
Old 02/22/2010, 16:37   #11
 
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
=o Not tested but maybe not work with player's status :S. I think yes :S
.Kob is offline  
Old 02/22/2010, 17:14   #12
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
isn't working how a 1v1 system is suppose to.. p4n's is the best.
copz1337 is offline  
Old 02/22/2010, 17:14   #13
 
elite*gold: 0
Join Date: Feb 2010
Posts: 480
Received Thanks: 207
Well when I invite the player he gets teleported and I don't.
How can I fix this?
Decker_ is offline  
Old 02/22/2010, 17:17   #14
 
elite*gold: 0
Join Date: Dec 2007
Posts: 1,326
Received Thanks: 539
Quote:
Originally Posted by Decker_ View Post
Well when I invite the player he gets teleported and I don't.
How can I fix this?
look in my post in the first page
[GM] is offline  
Old 02/22/2010, 17:20   #15
 
elite*gold: 0
Join Date: Feb 2010
Posts: 480
Received Thanks: 207
What did you do to fix it?
Decker_ is offline  
Reply


Similar Threads Similar Threads
[Release]5165 PK Tournament
04/11/2011 - CO2 PServer Guides & Releases - 84 Replies
Ok, decided i would release my version of Arco's PkTournament, hopefully it should be bug free, although it hasnt been tested. Heres the NPC Dialog: #region JoinPKTDialog case 666111: { if (Control == 0) { if (Features.PKTournament.Stage == Features.PKTournamentStage.Inviting)
[HELP] PK Tournament
09/02/2010 - EO PServer Hosting - 4 Replies
I am using the revo-DB at the moment and have found that there is a bug with the weekly and monthly pk tournaments. There is never a winner because the final map transition never happens. The people who compete are simply stuck in pkt map. I'm not sure whether I did this by accident or whether its just another bug in the Revo-DB but does anyone know the problem? If not could you point in me in the right direction (cq_action wise) so that I can solve the problem myself.
Muntinlupa SF Tournament
11/27/2009 - Soldier Front Philippines - 2 Replies
http://img101.photolava.com/2009/11/25/e2_na12-hyj 8vt9h.jpg Attention to all SF player's



All times are GMT +2. The time now is 21:29.


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.