Map = Lab1
Tournament start:
XX:45
Script:
General.cs
Search for Thetimer = new System.Timers.Timer();
under the code put:
Now search for public static void DoStuff()
above it put:
Now open World.cs
under public static Hashtable GWScores = new Hashtable();
put:
Now search for public static void PlayersOffLottery()
under put:
Now open client.cs and search for:
public void Drop()
find if (MyChar.LocMap == 700)
put this under:
Search for Thetimer = new System.Timers.Timer();
under the code put:
PHP Code:
//Race
System.Timers.Timer RaceATimer = new System.Timers.Timer(1000.0);
RaceATimer.Start();
RaceATimer.Elapsed += delegate { RaceSign(); };
System.Timers.Timer RaceBTimer = new System.Timers.Timer(1000.0);
RaceBTimer.Start();
RaceBTimer.Elapsed += delegate { RaceEnter(); };
above it put:
PHP Code:
public static void RaceSign()
{
if (DateTime.Now.Minute == 40)
{
World.RaceSign = true;
World.Tourny = true;
World.SendMsgToAll("Race Tournament is now open for sign up, hurry up to TwinCity. 1Minute to sign up.", "SYSTEM", 2011);
}
}
public static void RaceEnter()
{
foreach (DictionaryEntry DE in World.AllChars)
{
Character Char = (Character)DE.Value;
if (DateTime.Now.Minute == 41)
{
if (Char.LocMap == 1616)
{
World.RaceSign = false;
World.RaceEnter = true;
World.RaceOn = true;
World.Tourny = false;
Char.Teleport(1351, 016, 128);
Char.CurHP = Char.MaxHP;
General.MyPackets.GeneralData((long)Char.UID, 0, 0, 0, 92);
General.MyPackets.Vital((long)Char.UID, 0, Char.CurHP);
World.SendMsgToAll("RACE!!!!!!!!!!!!!!.", "SYSTEM", 2011);
}
}
}
}
under public static Hashtable GWScores = new Hashtable();
put:
PHP Code:
public static bool RaceSign = false;
public static bool RaceEnter = false;
public static bool RaceOn = false;
public static bool RSMSG1 = false;
under put:
PHP Code:
public static void PlayersOffRace()
{
try
{
foreach (DictionaryEntry DE in AllChars)
{
Character Charr = (Character)DE.Value;
if (Charr.LocMap == 1351)
{
Charr.Teleport(1002, 400, 400);
}
}
}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
}
public void Drop()
find if (MyChar.LocMap == 700)
put this under:
PHP Code:
if (MyChar.LocMap == 1351)//Race
{
MyChar.Teleport(1002, 400, 400);
}
Now the NPC's:
Dialog:
Control:
PHP Code:
#region RaceSignUp
if (CurrentNPC == 8100)
{
if (World.RaceSign == true)
{
SendPacket(General.MyPackets.NPCSay("Race Tournament is open, do you want to sign up?"));
SendPacket(General.MyPackets.NPCLink("Yes please", 1));
SendPacket(General.MyPackets.NPCLink("No thank you", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
else
{
SendPacket(General.MyPackets.NPCSay("When Race is open. I can sign you up. The tournament is closed right now."));
SendPacket(General.MyPackets.NPCLink("Okay Thanks.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
#endregion
#region RaceWait
if (CurrentNPC == 8200)
{
if (World.RaceEnter == true)
{
MyChar.Teleport(1351, 016, 128);
}
else
{
SendPacket(General.MyPackets.NPCSay("Please wait, untill the tournament opens. Im here, if peoples get bugged, when warped in."));
SendPacket(General.MyPackets.NPCLink("I will.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
#endregion
#region RaceEnd
if (CurrentNPC == 8300)
{
foreach (DictionaryEntry DE in World.AllChars)
{
Character Char = (Character)DE.Value;
if (World.RaceOn == true)
{
if (Char.LocMap == 1351)
{
MyChar.CPs += 10000;
SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
Char.CurHP = Char.MaxHP;
SendPacket(General.MyPackets.Vital((long)Char.UID, 0, Char.CurHP));
Char.Teleport(1002, 400, 400);
World.RaceOn = false;
World.RaceEnter = false;
World.RaceSign = false;
World.Tourny = false;
MyChar.CurHP = MyChar.MaxHP;
SendPacket(General.MyPackets.Vital((long)MyChar.UID, 0, MyChar.CurHP));
MyChar.Teleport(1002, 400, 400);
World.SendMsgToAll(MyChar.Name + " Has won the Race Tournament, congratulations for that. He/She have gained 10000CPs.", "SYSTEM", 2011);
}
}
}
}
#endregion
PHP Code:
#region RaceSign Up
if (CurrentNPC == 8100)
{
if (Control == 1)
{
if (World.RaceSign == true)
{
MyChar.Teleport(1616, 43, 36);
SendPacket(General.MyPackets.NPCSay("You have been signed up for the tournament. Please wait untill you can enter."));
SendPacket(General.MyPackets.NPCLink("Okay", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
}
#endregion
Thats it please press Thanks if you like the code or if i helped u <3