Very simple, just a few class checks.
Go to PKTournament.cs and search for
Code:
public static void BeginTournament()
Code:
public static void BeginNinja()
{
foreach (Character Char in World.H_Chars.Values)
{
if (Char.Job == 55)
{
Char.MyClient.DialogNPC = 666111;
PacketHandling.NPCDialog.Handle(Char.MyClient, null, 666111, 0);
Char.MyClient.EndSend();
}
}
Stage = PKTournamentStage.Inviting;
while (CountDown > 0)
{
if (CountDown == 20)
Broadcast("20 seconds until start", BroadCastLoc.World);
else if (CountDown == 10)
{
Stage = PKTournamentStage.Countdown;
if (PKTHash.Count < 2)
{
Broadcast("The tournament requires atleast 2 people to start, Tournament Cancelled.", BroadCastLoc.World);
Stage = PKTournamentStage.None;
PKTHash = null;
return;
}
Broadcast("10 seconds until start", BroadCastLoc.World);
}
else if (CountDown < 4)
Broadcast(CountDown + " seconds until start", BroadCastLoc.World);
CountDown--;
Thread.Sleep(1000);
}
Stage = PKTournamentStage.Fighting;
Broadcast("Fight!", BroadCastLoc.World);
WaitForWinner();
}
public static void BeginTrojan()
{
foreach (Character Char in World.H_Chars.Values)
{
if (Char.Job == 15)
{
Char.MyClient.DialogNPC = 666111;
PacketHandling.NPCDialog.Handle(Char.MyClient, null, 666111, 0);
Char.MyClient.EndSend();
}
}
Stage = PKTournamentStage.Inviting;
while (CountDown > 0)
{
if (CountDown == 20)
Broadcast("20 seconds until start", BroadCastLoc.World);
else if (CountDown == 10)
{
Stage = PKTournamentStage.Countdown;
if (PKTHash.Count < 2)
{
Broadcast("The tournament requires atleast 2 people to start, Tournament Cancelled.", BroadCastLoc.World);
Stage = PKTournamentStage.None;
PKTHash = null;
return;
}
Broadcast("10 seconds until start", BroadCastLoc.World);
}
else if (CountDown < 4)
Broadcast(CountDown + " seconds until start", BroadCastLoc.World);
CountDown--;
Thread.Sleep(1000);
}
Stage = PKTournamentStage.Fighting;
Broadcast("Fight!", BroadCastLoc.World);
WaitForWinner();
}
public static void BeginWarrior()
{
foreach (Character Char in World.H_Chars.Values)
{
if (Char.Job == 25)
{
Char.MyClient.DialogNPC = 666111;
PacketHandling.NPCDialog.Handle(Char.MyClient, null, 666111, 0);
Char.MyClient.EndSend();
}
}
Stage = PKTournamentStage.Inviting;
while (CountDown > 0)
{
if (CountDown == 20)
Broadcast("20 seconds until start", BroadCastLoc.World);
else if (CountDown == 10)
{
Stage = PKTournamentStage.Countdown;
if (PKTHash.Count < 2)
{
Broadcast("The tournament requires atleast 2 people to start, Tournament Cancelled.", BroadCastLoc.World);
Stage = PKTournamentStage.None;
PKTHash = null;
return;
}
Broadcast("10 seconds until start", BroadCastLoc.World);
}
else if (CountDown < 4)
Broadcast(CountDown + " seconds until start", BroadCastLoc.World);
CountDown--;
Thread.Sleep(1000);
}
Stage = PKTournamentStage.Fighting;
Broadcast("Fight!", BroadCastLoc.World);
WaitForWinner();
}
public static void BeginArcher()
{
foreach (Character Char in World.H_Chars.Values)
{
if (Char.Job == 45)
{
Char.MyClient.DialogNPC = 666111;
PacketHandling.NPCDialog.Handle(Char.MyClient, null, 666111, 0);
Char.MyClient.EndSend();
}
}
Stage = PKTournamentStage.Inviting;
while (CountDown > 0)
{
if (CountDown == 20)
Broadcast("20 seconds until start", BroadCastLoc.World);
else if (CountDown == 10)
{
Stage = PKTournamentStage.Countdown;
if (PKTHash.Count < 2)
{
Broadcast("The tournament requires atleast 2 people to start, Tournament Cancelled.", BroadCastLoc.World);
Stage = PKTournamentStage.None;
PKTHash = null;
return;
}
Broadcast("10 seconds until start", BroadCastLoc.World);
}
else if (CountDown < 4)
Broadcast(CountDown + " seconds until start", BroadCastLoc.World);
CountDown--;
Thread.Sleep(1000);
}
Stage = PKTournamentStage.Fighting;
Broadcast("Fight!", BroadCastLoc.World);
WaitForWinner();
}
public static void BeginFire()
{
foreach (Character Char in World.H_Chars.Values)
{
if (Char.Job == 145)
{
Char.MyClient.DialogNPC = 666111;
PacketHandling.NPCDialog.Handle(Char.MyClient, null, 666111, 0);
Char.MyClient.EndSend();
}
}
Stage = PKTournamentStage.Inviting;
while (CountDown > 0)
{
if (CountDown == 20)
Broadcast("20 seconds until start", BroadCastLoc.World);
else if (CountDown == 10)
{
Stage = PKTournamentStage.Countdown;
if (PKTHash.Count < 2)
{
Broadcast("The tournament requires atleast 2 people to start, Tournament Cancelled.", BroadCastLoc.World);
Stage = PKTournamentStage.None;
PKTHash = null;
return;
}
Broadcast("10 seconds until start", BroadCastLoc.World);
}
else if (CountDown < 4)
Broadcast(CountDown + " seconds until start", BroadCastLoc.World);
CountDown--;
Thread.Sleep(1000);
}
Stage = PKTournamentStage.Fighting;
Broadcast("Fight!", BroadCastLoc.World);
WaitForWinner();
}
public static void BeginWater()
{
foreach (Character Char in World.H_Chars.Values)
{
if (Char.Job == 135)
{
Char.MyClient.DialogNPC = 666111;
PacketHandling.NPCDialog.Handle(Char.MyClient, null, 666111, 0);
Char.MyClient.EndSend();
}
}
Stage = PKTournamentStage.Inviting;
while (CountDown > 0)
{
if (CountDown == 20)
Broadcast("20 seconds until start", BroadCastLoc.World);
else if (CountDown == 10)
{
Stage = PKTournamentStage.Countdown;
if (PKTHash.Count < 2)
{
Broadcast("The tournament requires atleast 2 people to start, Tournament Cancelled.", BroadCastLoc.World);
Stage = PKTournamentStage.None;
PKTHash = null;
return;
}
Broadcast("10 seconds until start", BroadCastLoc.World);
}
else if (CountDown < 4)
Broadcast(CountDown + " seconds until start", BroadCastLoc.World);
CountDown--;
Thread.Sleep(1000);
}
Stage = PKTournamentStage.Fighting;
Broadcast("Fight!", BroadCastLoc.World);
WaitForWinner();
}
Code:
private static void AwardWinner(Character Winner)
Code:
private static void AwardClass(Character Winner)
{
Broadcast(Winner.Name + " has won the tournament!", BroadCastLoc.World);
#region Ninja
if (Winner.Job == 55)
{
Winner.StatEff.Add(StatusEffectEn.TopNinja);
try
{
StreamWriter sw = new StreamWriter("C:\\OldCODB/TopNinja.txt");
sw.WriteLine("" + Winner.EntityID + "#8796093022208");
sw.Close();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
#endregion
#region Warrior
if (Winner.Job == 25)
{
Winner.StatEff.Add(StatusEffectEn.TopWarrior);
try
{
StreamWriter sw = new StreamWriter("C:\\OldCODB/TopWarrior.txt");
sw.WriteLine("" + Winner.EntityID + "#274877906944");
sw.Close();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
#endregion
#region Archer
if (Winner.Job == 45)
{
Winner.StatEff.Add(StatusEffectEn.TopArcher);
try
{
StreamWriter sw = new StreamWriter("C:\\OldCODB/TopWarrior.txt");
sw.WriteLine("" + Winner.EntityID + "#1099511627776");
sw.Close();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
#endregion
#region Archer
if (Winner.Job == 15)
{
Winner.StatEff.Add(StatusEffectEn.TopTrojan);
try
{
StreamWriter sw = new StreamWriter("C:\\OldCODB/TopTrojan.txt");
sw.WriteLine("" + Winner.EntityID + "#549755813888");
sw.Close();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
#endregion
#region Water
if (Winner.Job == 145)
{
Winner.StatEff.Add(StatusEffectEn.TopWaterTaoist);
try
{
StreamWriter sw = new StreamWriter("C:\\OldCODB/TopWater.txt");
sw.WriteLine("" + Winner.EntityID + "#2199023255552");
sw.Close();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
#endregion
#region Fire
if (Winner.Job == 135)
{
Winner.StatEff.Add(StatusEffectEn.TopFireTaoist);
try
{
StreamWriter sw = new StreamWriter("C:\\OldCODB/TopFire.txt");
sw.WriteLine("" + Winner.EntityID + "#4398046511104");
sw.Close();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
#endregion
Winner.CPs += 1500;
PKTournament.Stage = PKTournamentStage.None;
PkThread.Abort();
return;
}
Code:
public static void WaitForWinner()
Code:
public static void WaitForClass()
{
PKTournament.Stage = PKTournamentStage.Fighting;
uint Tick = (uint)Environment.TickCount;
int InMapAlive = PKTHash.Count;
while (true)
{
foreach (Main.GameClient _GC in PKTHash.Values)
{
if (_GC.MyChar.InPKT)
if (!_GC.MyChar.Alive)
{
InMapAlive--;
_GC.MyChar.InPKT = false;
}
else if (!World.H_Chars.ContainsKey(_GC.MyChar.EntityID))
{
InMapAlive--;
_GC.MyChar.InPKT = false;
}
}
foreach (Main.GameClient _GC in PKTHash.Values)
{
if (_GC.MyChar.InPKT)
if (_GC.MyChar.Alive && InMapAlive == 1)
{
_GC.MyChar.Teleport(1002, 438, 382);
AwardClass(_GC.MyChar);
Stage = PKTournamentStage.Over;
return;
}
}
if (InMapAlive != 1)
{
Broadcast("There are" + InMapAlive + "people left", BroadCastLoc.Map);
}
Thread.Sleep(1000);
}
}






