Well, This is from another forums and yes i did ask Catalin if I Can Release it Here, So this is a Team Death Match Game, Coded for v5165,
The NPC-
PHP Code:
#region Team Death Match case 8000: { if (Control == 0) { GC.AddSend(Packets.NPCSay("Hey there Do You Whant to Join the Team Death Match")); GC.AddSend(Packets.NPCLink("Yeah", 1)); GC.AddSend(Packets.NPCLink("What Team Am i In", 4)); GC.AddSend(Packets.NPCLink("No Thanx", 255)); GC.AddSend(Packets.NPCSetFace(N.Avatar)); GC.AddSend(Packets.NPCFinish()); } if (Control == 4) { if (GC.MyChar.dmred == 1) { GC.AddSend(Packets.NPCSay("You Are in the Read Team")); GC.AddSend(Packets.NPCLink("Ok", 255)); GC.AddSend(Packets.NPCSetFace(N.Avatar)); GC.AddSend(Packets.NPCFinish()); } else if (GC.MyChar.dmblack == 1) { GC.AddSend(Packets.NPCSay("You Are In the Black Team")); GC.AddSend(Packets.NPCLink("Ok", 255)); GC.AddSend(Packets.NPCSetFace(N.Avatar)); GC.AddSend(Packets.NPCFinish()); } else if (GC.MyChar.dmblue == 1) { GC.AddSend(Packets.NPCSay("You Are In the Blue Team")); GC.AddSend(Packets.NPCLink("OK i see", 255)); GC.AddSend(Packets.NPCSetFace(N.Avatar)); GC.AddSend(Packets.NPCFinish()); } else { GC.AddSend(Packets.NPCSay("You dont is in team")); GC.AddSend(Packets.NPCLink("Ok", 255)); GC.AddSend(Packets.NPCSetFace(N.Avatar)); GC.AddSend(Packets.NPCFinish()); } } if (Control == 1) { if (GC.MyChar.dmjoin == 0) { if (World.dm == true) { Random teams = new Random(); int team = teams.Next(1, 2); if (team == 1) {
} if (GC.MyChar.dmred == 1) { GC.AddSend(Packets.NPCSay("Your In RedTeam")); GC.AddSend(Packets.NPCLink("Cool", 255)); GC.AddSend(Packets.NPCSetFace(N.Avatar)); GC.AddSend(Packets.NPCFinish()); } else if (GC.MyChar.dmblack == 1) { GC.AddSend(Packets.NPCSay("Your In BlackTeam")); GC.AddSend(Packets.NPCLink("OK i see", 255)); GC.AddSend(Packets.NPCSetFace(N.Avatar)); GC.AddSend(Packets.NPCFinish()); } else if (GC.MyChar.dmblue == 1) { GC.AddSend(Packets.NPCSay("Your In Blue Team")); GC.AddSend(Packets.NPCLink("OK i see", 255)); GC.AddSend(Packets.NPCSetFace(N.Avatar)); GC.AddSend(Packets.NPCFinish()); }
} else { GC.AddSend(Packets.NPCSay("I'am Sorry but there is No DeathMatch Going On At the Moment")); GC.AddSend(Packets.NPCLink("Alrite", 255)); GC.AddSend(Packets.NPCSetFace(N.Avatar)); GC.AddSend(Packets.NPCFinish()); } } else { GC.AddSend(Packets.NPCSay("Iam Sorry But Your Already In A Team")); GC.AddSend(Packets.NPCLink("Oh Ok", 255)); GC.AddSend(Packets.NPCSetFace(N.Avatar)); GC.AddSend(Packets.NPCFinish()); } } break; } #endregion
This is the NPC in NPCs.txt
Code:
8000 310 2 0 1002 422 361
Go to World.cs Search for
Code:
public static void NewEmpire(Character C)
Above that Add,
PHP Code:
public static bool dm = false; public class DeathMatch { public static int teamred = 0; public static int teamblue = 0; public static int teamblack = 0; public static int teamwhite = 0;
} public class Dmscore { public static int redscore = 0; public static int bluescore = 0; public static int blackscore = 0; public static int whitescore = 0; }
Go to Character.cs Search for,
Code:
public byte OnlineTrainingPts = 0;
Above it add,
PHP Code:
public int dmjoin = 0; public int dmred = 0; public int dmblack = 0; public int dmblue = 0; public int dmwhite = 0;
In Character.cs Search for,
PHP Code:
if (BuffOf(SkillsClass.ExtraEffect.Fly).Eff== SkillsClass.ExtraEffect.Fly) return;
Below it add,
PHP Code:
if (dmblack == 1) { foreach (DictionaryEntry DE in Game.World.H_Chars) { Game.Character Chaar = (Game.Character)DE.Value; if (Chaar.Name != MyClient.MyChar.Name) { if (Chaar.dmblack == 1) { Damage = 0; return; }
} } } if (dmblue == 1) { foreach (DictionaryEntry DE in Game.World.H_Chars) { Game.Character Chaar = (Game.Character)DE.Value; if (Chaar.Name != MyClient.MyChar.Name) { if (Chaar.dmblue == 1) { Damage = 0; return; }
} } } if (dmred == 1) { foreach (DictionaryEntry DE in Game.World.H_Chars) { Game.Character Chaar = (Game.Character)DE.Value; if (Chaar.Name != MyClient.MyChar.Name) { if (Chaar.dmred == 1) { Damage = 0; return; }
} }
}
Go to Your Features folder and make a New Class Call it DMScore.cs
And add
PHP Code:
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Text; using NewestCOServer.Game;
In Chat.cs Add iN,
below using System.Text; ADd below using System.Threading;
PHP Code:
if (Cmd[0] == "/dmtrue") { Game.World.dm = true; Game.World.SendMsgToAll("Server", "DeathMatch start in 2 min!go TwinCity at 424 361 for join to tornament!", 2011, 0); new Thread(new ThreadStart(delegate() { Console.WriteLine("DeathMatch Activated (via Console).");
Thread.Sleep(30000); Game.World.SendMsgToAll("Server", "DeathMatch will start in 1 minutes and 30 Seconds! go TwinCity at 424 361 for join to tornament!", 2011, 0); Console.WriteLine("1 Minutes 30 seconds Left"); Thread.Sleep(30000); Game.World.SendMsgToAll("Server", "DeathMatch will start in 1 minutes! go TwinCity at 424 361 for join to tornament!", 2011, 0); Console.WriteLine("1 Minutes Left"); Thread.Sleep(30000); Game.World.SendMsgToAll("Server", "DeathMatch will start in 30 Seconds! go TwinCity at 424 361 for join to tornament!", 2011, 0); Console.WriteLine("30 seconds Left"); Thread.Sleep(30000); Game.World.SendMsgToAll("Server", "DeathMatch will start ", 2011, 0); Console.WriteLine("DeathMatch will start ");
foreach (DictionaryEntry DE in Game.World.H_Chars) { Game.Character Chaar = (Game.Character)DE.Value; if (Chaar.dmjoin == 1) { if (Chaar.dmblack == 1) { Chaar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopWarrior); Chaar.Teleport(1090, 121, 70); } else if (Chaar.dmblue == 1) { Chaar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopNinja); Chaar.Teleport(1090, 144, 152); // GC.MyChar.AddItemPos(181825);//181825 } else if (Chaar.dmred == 1) { Chaar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.WeeklyPKChampion); Chaar.Teleport(1090, 43, 67); // GC.MyChar.AddItemPos(181625);//181625 } } } Game.World.dm = false; Thread.Sleep(60000); Game.World.SendMsgToAll("Server", "DeathMatch will finish in 9 minutes", 2011, 0); Console.WriteLine("9 Minutes Left"); Thread.Sleep(60000); Game.World.SendMsgToAll("Server", "DeathMatch will finish in 8 minutes", 2011, 0); Console.WriteLine("8 Minutes Left"); Thread.Sleep(60000); Game.World.SendMsgToAll("Server", "DeathMatch will finish in 7 minutes", 2011, 0); Console.WriteLine("7 Minutes Left"); Thread.Sleep(60000); Game.World.SendMsgToAll("Server", "DeathMatch will finish in 6 minutes", 2011, 0); Console.WriteLine("6 Minutes Left"); Thread.Sleep(60000); Game.World.SendMsgToAll("Server", "DeathMatch will finish in 5 minutes", 2011, 0); Console.WriteLine("5 Minutes Left"); Thread.Sleep(60000); Game.World.SendMsgToAll("Server", "DeathMatch will finish in 4 minutes", 2011, 0); Console.WriteLine("4 Minutes Left"); Thread.Sleep(60000); Game.World.SendMsgToAll("Server", "DeathMatch will finish in 3 minutes", 2011, 0); Console.WriteLine("3 Minutes Left"); Thread.Sleep(60000); Game.World.SendMsgToAll("Server", "DeathMatch will finish in 2 minutes", 2011, 0); Console.WriteLine("2 Minutes Left"); Thread.Sleep(60000); Game.World.SendMsgToAll("Server", "DeathMatch will finish in 1 minutes", 2011, 0); Console.WriteLine("1 Minutes Left"); Thread.Sleep(30000); Game.World.SendMsgToAll("Server", "DeathMatch will finish in 30 seconds! ", 2011, 0); Console.WriteLine("DeathMatch will finish in 30 seconds!"); Thread.Sleep(30000); Game.World.SendMsgToAll("Server", "DeathMatch will finish! ", 2011, 0); Console.WriteLine("DeathMatch will finish"); #region wins if (Game.World.Dmscore.blackscore > Game.World.Dmscore.bluescore) { if (Game.World.Dmscore.blackscore > Game.World.Dmscore.redscore) { foreach (DictionaryEntry DE in Game.World.H_Chars) { Game.Character Chaar = (Game.Character)DE.Value; if (Chaar.Loc.Map == 1090) { Chaar.Teleport(1002, 390, 323); Game.World.DeathMatch.teamblack = 0; Game.World.DeathMatch.teamblue = 0; Game.World.DeathMatch.teamred = 0; Game.World.Dmscore.blackscore = 0; Game.World.Dmscore.bluescore = 0; Game.World.Dmscore.redscore = 0; Chaar.dmblue = 0; Chaar.dmjoin = 0; Chaar.dmred = 0; Chaar.StatEff.Remove(NewestCOServer.Game.StatusEffectEn.TopWarrior); Chaar.StatEff.Remove(NewestCOServer.Game.StatusEffectEn.WeeklyPKChampion); Chaar.StatEff.Remove(NewestCOServer.Game.StatusEffectEn.WeeklyPKChampion); if (Chaar.dmblack == 1) { Chaar.dmblack = 0; Chaar.CPs += 10000; Game.World.SendMsgToAll("Server", "Congration! black team win DeathMatch ,all members win 10.000CPs", 2011, 0);