Register for your free account! | Forgot your password?

You last visited: Today at 03:54

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

Advertisement



[Release]Pk Event

Discussion on [Release]Pk Event within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
~RapidBlade~'s Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 113
Received Thanks: 15
[Release]Pk Event

Okay, this is my first release for a LOTF PK event, so i hope you enjoy it! Any questions reply here or message me on msn at . Also Credits to EmmeTheCoder for his Start/stop npc codes used for this.
Remember to hit Thanks!

First:
Go to General.cs and add this somewhere:
Code:
        public static bool PKEvent = false;
Second:
Go to Character.cs and search for:
Code:
       public void TimerElapsed(object source, ElapsedEventArgs e) 
        {
Right below that {, add:
Code:
foreach (DictionaryEntry DE in World.AllChars)
{
Character Charr = (Character)DE.Value;



if (Charr.LocMap == 1082)
{
if (DateTime.Now > Charr.Death.AddSeconds(2))
{
if (!Charr.Alive)
{
Charr.Revive(true);
World.SpawnMeToOthers(Charr, true);
World.SpawnOthersToMe(Charr, true);
World.UpdateSpawn(Charr);
Charr.Teleport(1002, 438, 377);
Charr.MyClient.SendPacket(General.MyPackets.Vital( UID, 26, Charr.GetStat()));
Charr.MyClient.SendPacket(General.MyPackets.SendMsg(Charr.MyClient.MessageId, "Eliminator", Charr.Name, "You Were Eliminated!", 2011));
System.Threading.Thread.Sleep(100);
}
}
}
}
Third:
In client.cs find the commands all players can use: (usually /save or /coords)
and add this above one of them:
Code:
                            if (Message == "/joinpk")//coded by RapidBlade
                            {
                                if (General.PKEvent == true)
                                {
                                    MyChar.Teleport(1082, 224, 224);
                                }
                                else
                                {
                                    SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "The PK Event has started is already over, you cannot use the command anymore!", 2005));
                                }

                            }
Fourth:
Add the command to start and end it:
Code:
                                        if (Splitter[0] == "/announcepk")//Coded by RapidBlade
                                        {
                                            World.SendMsgToAll("PK Event is about to start! Type /joinpk to join!", "[SYSTEM]", 2011);
                                            General.PKEvent = true;
                                        }
                                        if (Splitter[0] == "/joinpkend")//Coded by RapidBlade
                                        {
                                             World.SendMsgToAll("You are too late! You cannot join the PK Event anymore!", "[SYSTEM]", 2011);
                                             General.PKEvent = false;
                                        }
Fifth:
Add the NPC to leave the area:
Code:
                            if (CurrentNPC == 61)//PK Event Exiter:By RapidBlade
                            {
                                SendPacket(General.MyPackets.NPCSay("Hi there! Would you like to leave the PK Event area?"));
                                SendPacket(General.MyPackets.NPCLink("Hell Yeah, getting owned is tiring!", 1));
                                SendPacket(General.MyPackets.NPCLink("Just passing by.", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
Control Part=
Code:
                          if (CurrentNPC == 61)
                            {
                                if (Control == 1)
                                {
                                        MyChar.Teleport(1002, 438, 377);
                                        MyChar.Action = 250;
                                    }
                                    MyChar.Ready = true;
                                }
Sixth:
The prize NPC- Credits to Emme for making the start and stop npc codes.
Search in General.cs:
Code:
        public static System.Timers.Timer Thetimer;
and UNDER that add:
Code:
        public static bool CanTalkToNPC = false;//credits to Emme
Add the commands (client.cs):
Code:
                                        if (Splitter[0] == "/stopnpc")
                                            if (!General.CanTalkToNPC)
                                            {
                                             string K = "Disabled!";
                                                General.CanTalkToNPC = true;
                                                {
                                                 World.SendMsgToAll("The Prize Npc For Find/PK Event Has Been Disabled." + K, "NPCHandeler", 2005);
                                        }
                                }
                            
                                        if (Splitter[0] == "/startnpc")//credits to EmmeTheCoder
                                        {
                                            string K = "Activated!";
                                            if (General.CanTalkToNPC)
                                            {
                                                K = "Activated!";
                                                General.CanTalkToNPC = false;
                                            }
                                             World.SendMsgToAll("The Prize Npc For Find/PK Event Has Been Activated." + K, "NPCHandeler", 2005);
                                        }
And Next add the NPC:
Code:
                            if (CurrentNPC == 63)
                            {
                                if (!General.CanTalkToNPC)
                                {
                                    SendPacket(General.MyPackets.NPCSay("Hello PK Master! You win 2 DragonBalls for dominating the tournament!"));
                                    SendPacket(General.MyPackets.NPCLink("Awesome! Give Me My Prize!", 1));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                                else
                                {
                                    SendPacket(General.MyPackets.NPCSay("The prize has been taken."));
                                    SendPacket(General.MyPackets.NPCLink("Okay.", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                            }
and the control part-
Code:
if (CurrentNPC == 63)
                            {
                                if (Control == 1)
                                {
                                    SendPacket(General.MyPackets.NPCSay("Here is your Prize."));
                                    SendPacket(General.MyPackets.NPCLink("Thank You.", 5));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                                if (Control == 5)
                                {
                                    MyChar.AddItem("720028-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));//ConquestArmor
                                    MyChar.AddItem("720028-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));//ConquestArmor
                                }
                            }
How to use these things:
Type /announcepk to start the tourny, and it also activates the /joinpk command for normal players. after like 2-3 mins use /joinpkend so after someone dies they can't come bak. use /stopnpc BEFORE the tourny so no prize can randomly b claimed.
I believe thats it, if i left out something post her and ill add it. And please no Flaming, this is only my first release as a noob coder lol.
~RapidBlade~ is offline  
Thanks
5 Users
Old 05/22/2009, 05:00   #2
 
elite*gold: 20
Join Date: May 2008
Posts: 1,103
Received Thanks: 254
Quote:
Originally Posted by ~RapidBlade~ View Post
Okay, this is my first release for a LOTF PK event, so i hope you enjoy it! Any questions reply here. Also Credits to EmmeTheCoder for his Start/stop npc codes used for this.
Remember to hit Thanks!

First:
Go to General.cs and add this somewhere:
Code:
        public static bool PKEvent = false;
Second:
Go to Character.cs and search for:
Code:
       public void TimerElapsed(object source, ElapsedEventArgs e) 
        {
Right below that {, add:
Code:
foreach (DictionaryEntry DE in World.AllChars)
{
Character Charr = (Character)DE.Value;



if (Charr.LocMap == 1082)
{
if (DateTime.Now > Charr.Death.AddSeconds(2))
{
if (!Charr.Alive)
{
Charr.Revive(true);
World.SpawnMeToOthers(Charr, true);
World.SpawnOthersToMe(Charr, true);
World.UpdateSpawn(Charr);
Charr.Teleport(1002, 438, 377);
Charr.MyClient.SendPacket(General.MyPackets.Vital( UID, 26, Charr.GetStat()));
Charr.MyClient.SendPacket(General.MyPackets.SendMsg(Charr.MyClient.MessageId, "Eliminator", Charr.Name, "You Were Eliminated!", 2011));
System.Threading.Thread.Sleep(100);
}
}
}
}
Third:
In client.cs find the commands all players can use: (usually /save or /coords)
and add this above one of them:
Code:
                            if (Message == "/joinpk")//coded by RapidBlade
                            {
                                if (General.PKEvent == true)
                                {
                                    MyChar.Teleport(1082, 224, 224);
                                }
                                else
                                {
                                    SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "The PK Event has started is already over, you cannot use the command anymore!", 2005));
                                }

                            }
Fourth:
Add the command to start and end it:
Code:
                                        if (Splitter[0] == "/announcepk")//Coded by RapidBlade
                                        {
                                            World.SendMsgToAll("PK Event is about to start! Type /joinpk to join!", "[SYSTEM]", 2011);
                                            General.PKEvent = true;
                                        }
                                        if (Splitter[0] == "/joinpkend")//Coded by RapidBlade
                                        {
                                             World.SendMsgToAll("You are too late! You cannot join the PK Event anymore!", "[SYSTEM]", 2011);
                                             General.PKEvent = false;
                                        }
Fifth:
Add the NPC to leave the area:
Code:
                            if (CurrentNPC == 61)//PK Event Exiter:By RapidBlade
                            {
                                SendPacket(General.MyPackets.NPCSay("Hi there! Would you like to leave the PK Event area?"));
                                SendPacket(General.MyPackets.NPCLink("Hell Yeah, getting owned is tiring!", 1));
                                SendPacket(General.MyPackets.NPCLink("Just passing by.", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
Control Part=
Code:
                          if (CurrentNPC == 61)
                            {
                                if (Control == 1)
                                {
                                        MyChar.Teleport(1002, 438, 377);
                                        MyChar.Action = 250;
                                    }
                                    MyChar.Ready = true;
                                }
Sixth:
The prize NPC- Credits to Emme for making the start and stop npc codes.
Search in General.cs:
Code:
        public static System.Timers.Timer Thetimer;
and UNDER that add:
Code:
        public static bool CanTalkToNPC = false;//credits to Emme
Add the commands (client.cs):
Code:
                                        if (Splitter[0] == "/stopnpc")
                                            if (!General.CanTalkToNPC)
                                            {
                                             string K = "Disabled!";
                                                General.CanTalkToNPC = true;
                                                {
                                                 World.SendMsgToAll("The Prize Npc For Find/PK Event Has Been Disabled." + K, "NPCHandeler", 2005);
                                        }
                                }
                            
                                        if (Splitter[0] == "/startnpc")//credits to EmmeTheCoder
                                        {
                                            string K = "Activated!";
                                            if (General.CanTalkToNPC)
                                            {
                                                K = "Activated!";
                                                General.CanTalkToNPC = false;
                                            }
                                             World.SendMsgToAll("The Prize Npc For Find/PK Event Has Been Activated." + K, "NPCHandeler", 2005);
                                        }
And Next add the NPC:
Code:
                            if (CurrentNPC == 63)
                            {
                                if (!General.CanTalkToNPC)
                                {
                                    SendPacket(General.MyPackets.NPCSay("Hello PK Master! You win 2 DragonBalls for dominating the tournament!"));
                                    SendPacket(General.MyPackets.NPCLink("Awesome! Give Me My Prize!", 1));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                                else
                                {
                                    SendPacket(General.MyPackets.NPCSay("The prize has been taken."));
                                    SendPacket(General.MyPackets.NPCLink("Okay.", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                            }
and the control part-
Code:
if (CurrentNPC == 63)
                            {
                                if (Control == 1)
                                {
                                    SendPacket(General.MyPackets.NPCSay("Here is your Prize."));
                                    SendPacket(General.MyPackets.NPCLink("Thank You.", 5));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                                if (Control == 5)
                                {
                                    MyChar.AddItem("720028-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));//ConquestArmor
                                    MyChar.AddItem("720028-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));//ConquestArmor
                                }
                            }
I believe thats it, if i left out something post her and ill add it. You have to make sure you type /joinpkend when every1 who wants to enter is there or else they can keep coming back to the tourny. When they die they rev in TC. Also remember to hit /stopnpc before starting the event to make sure the prize npc is turned off. And please no Flaming, this is only my first release as a noob coder lol.
Good job
Pete1990 is offline  
Old 05/22/2009, 05:01   #3
 
~RapidBlade~'s Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 113
Received Thanks: 15
Thanks Pete! lol
~RapidBlade~ is offline  
Old 05/22/2009, 05:25   #4
 
elite*gold: 20
Join Date: May 2008
Posts: 1,103
Received Thanks: 254
Should do one for Ctf
Pete1990 is offline  
Old 05/22/2009, 05:27   #5
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
Quote:
Originally Posted by Pete1990 View Post
Should do one for Ctf
I told you i can fix Ctf but u been in a pissy *** mood latley lol :P
hunterman01 is offline  
Old 05/22/2009, 05:29   #6
 
elite*gold: 20
Join Date: May 2008
Posts: 1,103
Received Thanks: 254
Yea very big one Problems in life.
Pete1990 is offline  
Old 05/22/2009, 05:31   #7
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
Its cool i understand
hunterman01 is offline  
Old 05/22/2009, 05:37   #8
 
~RapidBlade~'s Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 113
Received Thanks: 15
I haven't been able to figure out the flags for capture the flag yet, sorry. If i find it out i probably won't release it anyway tho, gotta keep some stuff for myself =)
~RapidBlade~ is offline  
Old 05/22/2009, 05:48   #9
 
elite*gold: 20
Join Date: May 2008
Posts: 1,103
Received Thanks: 254
Yea the npc i did was messed up lmao
Pete1990 is offline  
Old 05/22/2009, 08:16   #10
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1,922
Received Thanks: 491
ninja here...good release.. ill be on msn in a few
PeTe Ninja is offline  
Old 05/22/2009, 12:50   #11
 
Vortex.'s Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 275
Received Thanks: 22
Rapid Delet it please!
Vortex. is offline  
Old 05/22/2009, 14:39   #12
 
danielachraf's Avatar
 
elite*gold: 20
Join Date: Mar 2008
Posts: 958
Received Thanks: 494
Quote:
Originally Posted by Vortex. View Post
Rapid Delet it please!
why ?
danielachraf is offline  
Old 05/22/2009, 19:55   #13
 
~RapidBlade~'s Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 113
Received Thanks: 15
Vortex nice Sig lol, and I released it cause i'm starting trying to make a better version of this event, so this one was just a basic so people who want a PK event could have a fully working one.
~RapidBlade~ is offline  
Old 05/22/2009, 21:43   #14
 
Vortex.'s Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 275
Received Thanks: 22
Well I'm in.. See you on msn later.. The funny thing is.. How are you telling me this only now :O
Vortex. is offline  
Old 05/22/2009, 22:24   #15
 
AndreaCo's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 510
Received Thanks: 104
lol pete and filer... Capture the Flag is so easy to code in -_-... lol
AndreaCo is offline  
Reply


Similar Threads Similar Threads
[Release] Daily Event
10/24/2012 - EO PServer Guides & Releases - 46 Replies
Today i want to release my daily event.Hope u guys like it .. any problem.. just ask ;) Event Style Daily event for 1 hour Event map are non-pk , non revive Auto boot player out from map after 1 hour Screenshot
[Release] Flame Lit Event
03/30/2010 - CO2 PServer Guides & Releases - 23 Replies
hello ppl iam go post the quest Flame Lit Event for source 5165 loft... is quest GW the reward is expballexp this is my simple code any ppl can do this code :) lets start... First you need put this two npc's in npcdialog.cs Flame Toist
[RELEASE] NPC PK-Event Daily
01/28/2010 - CO2 PServer Guides & Releases - 20 Replies
Updated! Number2 NPC Bins Released Not Tested Finished Credits to My Self and Understanding my Mistake with help of friends. lol! #NPC-Text REPLACE cq_action VALUES (661777,661771,0000,101,0, 'Hello~%user_name,~this~is~the~Daily~Tournament~Fo r~FireTao.~Would~you~care~to~Enter?!.'); REPLACE cq_action VALUES (661771,661772,0000,102,0,"Yes,~Please~let~me ~Enter. 661773"); REPLACE cq_action VALUES (661772,15003,0000,102,0,"Just~passing~by. 0"); REPLACE cq_action VALUES...
[Release] How to make your own PK event
10/12/2009 - CO2 PServer Guides & Releases - 32 Replies
Sup sup. Sherwin was intrested of how this would look like, so yeah here it is, worked on it for about 3 minutes.. So, all it does it check if the day is thursday and if the time is 11.55. If it is, it will announce that the PK event is on, and everyone can use the /join command to get teleported to the PK Event map ( PK Arena, MapID 1005 ). After 12.00 the PKEvent is over and you cannot join anymore. Its not fully done yet ( rewards and such ) , you'll have to do that. Anyways here you go,...
[Release]Updated PK Event
07/30/2009 - CO2 PServer Guides & Releases - 18 Replies
Hey guys, a long time ago i released a very basic pk event, now ima release a much better one.this is for a LOTF SOURCE ONLY!!! Put this in WORLD.CS definitions (some of them mite b there already, just make sure you only have one definition of it.) public static bool CanEnterPK = true; public static bool StartPK = true; public static bool PKTournament = false; public static ushort PKCity = 0; public static ushort PKX = 0;



All times are GMT +1. The time now is 03:56.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.