np lol uhmmm btw you think if i used the exact same team death match from .Summer and recoded it with TeamPk would that work for it
okay grill mad time for you to fix meh errors :) this is what i got in a New Class called TeamPK.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.IO;
using NewestCOServer.Game;
namespace NewestCOServer.Features
{
public enum TeamPkStage
{
None,
Inviting,
Countdown,
Fighting,
Over
}
public enum BroadCast
{
World,
Map
}
public static class TeamPk
{
public static ushort Map;
public static ushort X, Y;
public static TeamPkStage Stage2 = TeamPkStage.None;
public static Dictionary<uint, Main.GameClient> TeamPkHash;
public static int CountDown;
private static Thread TeamPkThread;
public static void StartTeamPk(Character Started)
{
if (Started.MyClient.GM)
{
TeamPkHash = new Dictionary<uint, Main.GameClient>();
CountDown = 20;
Stage2 = TeamPkStage.Inviting;
Map = 1005;
X = 51;
Y = 71;
TeamPkThread = new Thread(new ThreadStart(BeginElimination));
TeamPkThread.IsBackground = true;
TeamPkThread.Start();
}
}
public static void StartTeamPk()
{
TeamPkHash = new Dictionary<uint, Main.GameClient>();
CountDown = 20;
Stage2 = TeamPkStage.Inviting;
Map = 1005;
X = 51;
Y = 71;
TeamPkThread = new Thread(new ThreadStart(BeginElimination));
TeamPkThread.IsBackground = true;
TeamPkThread.Start();
}
private static void Broadcast1(string msg, BroadCastLoc1 loc)
{
Console.WriteLine(msg);
if (loc == BroadCastLoc1.World)
{
foreach (Character Char in World.H_Chars.Values)
{
Char.MyClient.AddSend(Packets.ChatMessage(0, "[GM]", "All", msg, 2011, 0));
Char.MyClient.EndSend();
}
}
else if (loc == BroadCastLoc1.Map)
{
foreach (Main.GameClient Char in TeamPkHash.Values)
{
Char.AddSend(Packets.ChatMessage(0, "[GM]", "All", msg, 2011, 0));
Char.EndSend();
}
}
}
private static void TeamPkWinner(Character Winner1)
{
Broadcast1(Winner1.Name + " has won Elimination!", BroadCastLoc1.World);
Winner1.StatEff.Add(StatusEffectEn.WeeklyPKChampion);
Winner1.HonorPoints += 500;
TeamPk.Stage2 = TeamPkStage.None;
TeamPkThread.Abort();
return;
}
public static void WaitForWinner2()
{
TeamPk.Stage2 = TeamPkStage.Fighting;
uint Tick = (uint)Environment.TickCount;
int InMapAlive = TeamPkHash.Count;
while (true)
{
foreach (Main.GameClient _GC in TeamPkHash.Values)
{
if (_GC.MyChar.InElimination)
if (!_GC.MyChar.Alive)
{
InMapAlive--;
_GC.MyChar.InElimination = false;
}
else if (!World.H_Chars.ContainsKey(_GC.MyChar.EntityID))
{
InMapAlive--;
_GC.MyChar.InElimination = false;
}
}
foreach (Main.GameClient _GC in TeamPkHash.Values)
{
if (_GC.MyChar.InElimination)
if (_GC.MyChar.Alive && InMapAlive == 2)
{
_GC.MyChar.Teleport(1505, 154, 218);
TeamPkWinner(_GC.MyChar);
Stage2 = TeamPkStage.Over;
return;
}
}
if (InMapAlive != 2)
{
Broadcast1("There are" + InMapAlive + "people left, kill them before they kill you!", BroadCastLoc1.Map);
}
Thread.Sleep(1000);
}
}
public static void BeginElimination()
{
foreach (Character Char in World.H_Chars.Values)
{
Char.MyClient.DialogNPC = 665611;
PacketHandling.NPCDialog.Handle(Char.MyClient, null, 665611, 0);
Char.MyClient.EndSend();
}
Stage2 = TeamPkStage.Inviting;
while (CountDown > 0)
{
if (CountDown == 20)
Broadcast1("20 seconds until Elimination starts!", BroadCastLoc1.World);
else if (CountDown == 10)
{
Stage2 = TeamPkStage.Countdown;
if (TeamPkHash.Count < 2)
{
Broadcast1("Elimination requires atleast 2 people to start, Elimination Cancelled.", BroadCastLoc1.World);
Stage2 = TeamPkStage.None;
TeamPkHash = null;
return;
}
Broadcast1("10 seconds until Elimination starts!", BroadCastLoc1.World);
}
else if (CountDown < 10)
Broadcast1(CountDown + " seconds until Elimination starts, hurry your ass up!", BroadCastLoc1.World);
CountDown--;
Thread.Sleep(1000);
}
Stage2 = TeamPkStage.Fighting;
Broadcast1("Fight!", BroadCastLoc1.World);
WaitForWinner2();
}
}
}