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;
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);
}
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();
}
Code:
public static void SaveAllChars()
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)); }
}
Code:
public void Drop()
Code:
DataBase.SaveChar(MyChar);
Code:
World.PKWarLeave();
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);
}
}
}
Code:
if (Splitter[0] == "/level")
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);
}
WARNING: IF YOU ALREADY HAVE THE PK ARENA NPC REPLACE YOUR CODES WITH MINE!
search for
Code:
if (CurrentNPC == 7500)
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());
}
}
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());
}
}
Code:
INSERT INTO `npcs` VALUES (8004, 260, 'ArenaGuard', 2, 0, 458, 291, 1002, 0);
Lasty search for
Code:
public static ushort[] PKMaps = new ushort[] {
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 AdminSoon to come: Boss Event!, Lucky Time BENEFITS!!!!!






