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 08:34

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

Advertisement



[release](lotf): PK Event [ Fail's Version ]

Discussion on [release](lotf): PK Event [ Fail's Version ] within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1,922
Received Thanks: 491
[release](lotf): PK Event [ Fail's Version ]

here my friend made this for LOTF , it works...

It also has luckytime event

This guide has been copied from

#credits to fail

__________________________________________________ ____________


As by request this is an event command and I will keep updating it as I am creating the events he has asked us to do.

What does this do?


- LuckyTime Event ( 2 Hours of LuckyTime for everyone online!)
- PK War Event ( 30 Minutes of PKing! )


About PK War
- Winners get DB
- If you DC you are out of map
- 5 Minutes to Join ( MUST JOIN WITH PKTICKET)
- PKTicket drop activates when its on
- Have Fun!


First off..Search for
Code:
 public static System.Timers.Timer Thetimer;
Under it add..
Code:
public static System.Timers.Timer PKTimer;
        public static System.Timers.Timer PKCanJoin;

        public static bool PKWarOn = false;
        public static bool PKCJoin = true;



(YOURS MAY BE DIFFERENT THEN MINE STILL Thetimer_Elapsed SHOULD BE THERE)
Now search for
Code:
               public static void Thetimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            World.SaveAllChars();
            World.SendMsgToAll("Your Character has been saved.", "SYSTEM", 2005);
        }
Under it add
Code:
       public static void PKTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            PKWarOn = false;
            World.SendMsgToAll("PK War has ended.", "SYSTEM", 2011);
            World.PKWarLeave();
            World.PKWarWinners();
            PKCJoin = true;
            PKTimer.Stop();

        }
        public static void PKCanJoin_Elapsed(object sender, ElapsedEventArgs e)
        {
            PKCJoin = false;
            World.SendMsgToAll("You can not join the PK War anymore!", "SYSTEM", 2011);
            PKCanJoin.Stop();
        }
Then search for
Code:
public static void SaveAllChars()
ABOVE it add
Code:
        public static void PKWarLeave()
        {
            try
            {
                foreach (DictionaryEntry DE in AllChars)
                {
                    Character Charr = (Character)DE.Value;
                    if (Charr.LocMap == 1005)
                    {
                        Charr.Teleport(1002, 431, 379);
                    }
                }
            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
        }
        public static void PKWarWinners()
        {
            try
            {
                foreach (DictionaryEntry DE in AllChars)
                {
                    Character Charr = (Character)DE.Value;
                    if (Charr.LocMap == 1005)
                    {
                        if (Charr.Alive == true)
                        {
                            Charr.AddItem("1088000-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
                            Charr.MyClient.SendPacket(General.MyPackets.SendMsg(Charr.MyClient.MessageId, "SYSTEM", Charr.Name, "You have won a dragonball for staying alive in the PK War!", 2005));
                        }
                    }
                }
            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
        }
then in
Code:
public void Drop()
You will find
Code:
DataBase.SaveChar(MyChar);
Under it add
Code:
World.PKWarLeave();
Then find where you put your drops ( entities.cs ) and add this drop
Code:
                    if (General.PKCJoin == true && General.PKWarOn == true) // PK War On
                    {
                        if (Name == "Pheasant") // Mob Name
                        {
                            if (Other.ChanceSuccess(10)) // PK Ticket
                            {
                                string Item = "710001-0-0-0-0-0";
                                DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                                World.ItemDrops(item);
                            }
                        }
                    }
Now search for
Code:
  if (Splitter[0] == "/level")
And above it add
Code:
 if (Splitter[0] == "/event") // Command In Progress
                                    {
                                        string EventName = "";
                                        string EventInfo = "";
                                        if (Splitter[1] == "lt")
                                        {
                                            foreach (DictionaryEntry DE in World.AllChars)
                                            {
                                                EventName = "Lucky Time";
                                                EventInfo = "Lucky Time has been activated for everyone for two hours!";
                                                Character Char = (Character)DE.Value;
                                                Char.LuckTime = 7200000;
                                                SendPacket(General.MyPackets.Vital(Char.UID, 29, Char.LuckTime));
                                                SendPacket(General.MyPackets.String(Char.UID, 10, "LuckyGuy"));
                                            }
                                        }
                                        if (Splitter[1] == "pk")
                                        {

                                            EventName = "PK War";
                                            EventInfo = "Pleaes visit Arena Guard in Twin City to enter! You have 5 minutes until you can not enter anymore!";
                                            
                                            General.PKCanJoin = new System.Timers.Timer();
                                            General.PKCanJoin.Interval = 300000; // 5 Minutes
                                            General.PKCanJoin.Elapsed += new ElapsedEventHandler(General.PKCanJoin_Elapsed);
                                            General.PKCanJoin.Start();
                                            General.PKWarOn = true;
                                            General.PKTimer = new System.Timers.Timer();
                                            General.PKTimer.Interval = 1800000; // 30 Minutes
                                            General.PKTimer.Elapsed += new ElapsedEventHandler(General.PKTimer_Elapsed);
                                            General.PKTimer.Start();
                                        }
                                        World.SendMsgToAll(EventName + " event has been started! " + EventInfo, "SYSTEM", 2011);
                                    }
Now for the PK Arena npc

WARNING: IF YOU ALREADY HAVE THE PK ARENA NPC REPLACE YOUR CODES WITH MINE!

search for
Code:
 if (CurrentNPC == 7500)
and above it add
Code:
if (CurrentNPC == 8004) // ArenaGuard
                            {
                                if (General.PKCJoin == true && General.PKWarOn == true)
                                {
                                    SendPacket(General.MyPackets.NPCSay("Would you like to enter the PK War for a PK Ticket?"));
                                    SendPacket(General.MyPackets.NPCLink("Yes", 1));
                                    SendPacket(General.MyPackets.NPCLink("Where can I get one?", 2));
                                    SendPacket(General.MyPackets.NPCLink("I don't have one!", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                                else
                                {
                                    SendPacket(General.MyPackets.NPCSay("Would you like to enter the PK Arena for 50 silvers?"));
                                    SendPacket(General.MyPackets.NPCLink("Yes", 1));
                                    SendPacket(General.MyPackets.NPCLink("No", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                            }
Now for the dialog search for if (CurrentNPc == 7500) again and above it add
Code:
if (CurrentNPC == 8004) // ArenaGuard
                            {
                                if (Control == 1)
                                {
                                    if (General.PKCJoin == true && General.PKWarOn == false)
                                    {
                                        if (MyChar.Silvers >= 50)
                                        {
                                            MyChar.Teleport(1005, 50, 50);
                                            MyChar.Silvers -= 50;
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 4, MyChar.Silvers));
                                        }
                                        else
                                        {
                                            SendPacket(General.MyPackets.NPCSay("You do not have enough silvers!"));
                                            SendPacket(General.MyPackets.NPCLink("Forgot.", 255));
                                            SendPacket(General.MyPackets.NPCSetFace(30));
                                            SendPacket(General.MyPackets.NPCFinish());
                                        }
                                    }
                                    else if (General.PKCJoin == true && General.PKWarOn == true)
                                    {
                                        if (MyChar.InventoryContains(710001, 1))
                                        {
                                            Random R = new Random();
                                            int Rs = R.Next(1, 11);
                                            ushort XTo = 50;
                                            ushort YTo = 50;

                                            if (Rs == 1)
                                            {
                                                XTo = 56;
                                                YTo = 69;
                                            }
                                            if (Rs == 2)
                                            {
                                                XTo = 45;
                                                YTo = 67;
                                            }
                                            if (Rs == 3)
                                            {
                                                XTo = 36;
                                                YTo = 59;
                                            }
                                            if (Rs == 4)
                                            {
                                                XTo = 44;
                                                YTo = 48;
                                            }
                                            if (Rs == 5)
                                            {
                                                XTo = 63;
                                                YTo = 53;
                                            }
                                            if (Rs == 6)
                                            {
                                                XTo = 34;
                                                YTo = 48;
                                            }
                                            if (Rs == 7)
                                            {
                                                XTo = 57;
                                                YTo = 50;
                                            }
                                            if (Rs == 8)
                                            {
                                                XTo = 68;
                                                YTo = 34;
                                            }
                                            if (Rs == 9)
                                            {
                                                XTo = 44;
                                                YTo = 34;
                                            }
                                            if (Rs == 10)
                                            {
                                                XTo = 41;
                                                YTo = 41;
                                            }
                                            MyChar.Teleport(1005, XTo, YTo);
                                            MyChar.RemoveItem(MyChar.ItemNext(710001));
                                        }
                                        else
                                        {
                                            SendPacket(General.MyPackets.NPCSay("You do not have a PKTicket!"));
                                            SendPacket(General.MyPackets.NPCLink("Oh Crap!", 255));
                                            SendPacket(General.MyPackets.NPCSetFace(30));
                                            SendPacket(General.MyPackets.NPCFinish());
                                        }
                                    }
                                    else if (General.PKCJoin == false && General.PKWarOn == true)
                                    {
                                        SendPacket(General.MyPackets.NPCSay("PK War is currently going on, You can not enter the PK Arena."));
                                        SendPacket(General.MyPackets.NPCLink("Darn. I Forgot.", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
                                if (Control == 2)
                                {
                                    SendPacket(General.MyPackets.NPCSay("Go kill Pheasants in Twin City to get one!"));
                                    SendPacket(General.MyPackets.NPCLink("Thanks!", 255));
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                            }
Now run this SQL Query in your Phpmyadmin or navicat and you should be done!

Code:
INSERT INTO `npcs` VALUES (8004, 260, 'ArenaGuard', 2, 0, 458, 291, 1002, 0);
WARNING DO THIS LAST PART ONLY IF YOU WANT PK IN ALL MAPS !! ( I RECOMMEND NO )
Lasty search for
Code:
public static ushort[] PKMaps = new ushort[] {
and replace the whole line with
Code:
        public static ushort[] PKMaps = new ushort[] { 1038, 1080, 1090, 1010, 500, 1004, 1002, 1039, 1005 };

WARNING!: THERE IS TWO PKTIMERS BUT THEY ARE IN DIFFERENT THINGS AND THEY DO NOT INTERTWINE IF YOU ACCIDENTALLY PLACE IT IN THE WRONG PLACE YOU WILL GAIN MAJOR ERRORS!


Quote:
Originally Posted by Admin
Soon to come: Boss Event!, Lucky Time BENEFITS!!!!!


PeTe Ninja is offline  
Thanks
2 Users
Old 07/09/2009, 14:06   #2
 
elite*gold: 0
Join Date: May 2009
Posts: 56
Received Thanks: 4
nice release btw who owns dexterity-co? is it yours?
pajar22 is offline  
Old 07/09/2009, 14:08   #3
 
elite*gold: 0
Join Date: Jul 2009
Posts: 548
Received Thanks: 52
@pajar22 Thx =] , I'm Fail as you see above ( Fail's Version )..

Also PeTe Ninja doesn't own dexterity-co , Pete1990 owns it.
f0am is offline  
Old 07/09/2009, 16:39   #4
 
elite*gold: 0
Join Date: May 2009
Posts: 56
Received Thanks: 4
ohh ok lol, nice code would be really helpful imma just change the prize and its alright lol ^^
pajar22 is offline  
Reply


Similar Threads Similar Threads
Fix Companions in Lotf 5165(or whatever version)
03/28/2012 - CO2 PServer Guides & Releases - 61 Replies
Change the SpawnEntity packet for Companions to the one listed below. public static COPacket SpawnEntity(Game.Companion Cmp) { byte Packet = new byte; COPacket P = new COPacket(Packet); P.WriteInt16((ushort)(Packet.Length - 8)); P.WriteInt16((ushort)10014); P.WriteInt32(Cmp.Mesh);
[Release]EasyMetin2(Lonely) DE Version Released!!!(Levelbot) NEUE VERSION
04/10/2010 - Metin2 Hacks, Bots, Cheats, Exploits & Macros - 12 Replies
poly was here
[REQUEST] Clean Version Of LOTF
09/18/2009 - CO2 Private Server - 10 Replies
Hello, I'm new around here i know, I was just wondering if anyone could point me to a clean version of LOTF, without all the eggys copy / paste in it. I'd appreciate no flaming please, I'm trying to learn here :x]
[release]my version of steals source aka lotf
06/28/2009 - CO2 PServer Guides & Releases - 5 Replies
Source here if u want to know wat works in it just download it and look at the progress.txt file i'd list it out but its been awhile since i've look at it i'm done with conquer online so i figure i'd release it maybe someone can make it better...this is for patch 5017 btw
[LOTF RELEASE] Ip Ban!!
05/18/2009 - CO2 PServer Guides & Releases - 22 Replies
Ip Ban! Credits to Ultimatum First...Search this ( It is in General.cs ) public static System.IO.StreamWriter sw = new System.IO.StreamWriter(Application.StartupPath + @"\ServerLog.txt", true);



All times are GMT +1. The time now is 08:35.


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