I probably set it all up wrong, but anyways here's mine shitty coded (NOT LOTF PETE)
Quote:
public static Guild Team1;
public static Guild Team2;
public static void Start(Guild Team1, Guild Team2)
{
Team1.GuildMsg("SYSTEM", "ALL", "Capture The Flag has started! Kill FlagKeeper in the middle of the map to receive the flag!");
Team2.GuildMsg("SYSTEM", "ALL", "Capture The Flag has started! Kill FlagKeeper in the middle of the map to receive the flag!");
}
public static void GivePoints(Guild Guild)
{
Guild.CTFPoints += 5;
Guild.GuildMsg("SYSTEM", "ALL", "Your guild has gained 5 points from the CTF challange war!");
Guild.ClaimedFlag = DateTime.Now;
}
public static void End(Guild Team1, Guild Team2)
{
Guild Winner;
if (Team1.CTFPoints >= Team2.CTFPoints)
Winner = Team1;
else
Winner = Team2;
LiveManager.SendMsgToAll("[SYSTEM]", "Capture The Flag has ended! Winners are " + Winner.GuildName + " !", 2005);
foreach (DictionaryEntry DE in LiveManager.H_Chars)
{
Character Char = (Character)DE.Value;
if (Char.Loc.Map == 500)
Char.Teleport(1002, 350, 350);
}
}
|
Quote:
case (uint)NpcIds.CaptureTheFlag:
if (Type == 0)
{
C.NPCSay("Hello. If you are the guild leader of your guild, you can join the CTF war. Would you want to join");
C.NPCSay(" the challange?");
C.NPCOption("Yes, me and my guild is ready!", 1);
C.NPCOption("No thanks, we're not that good yet..", 255);
C.NPCDone(29);
}
if (Type == 1)
{
if (Quests.CaptureTheFlag.Team1 != null && Quests.CaptureTheFlag.Team2 != null)
{
if (C.MyChar.GRank == GuildRank.GuildLeader)
foreach (DictionaryEntry DE in LiveManager.H_Chars)
{
Character AllGuildMembers = (Character)DE.Value;
if (AllGuildMembers.MyGuild == C.MyChar.MyGuild)
AllGuildMembers.Teleport(500, 500, 500);
}
C.MyChar.Teleport(500, 500, 500);
if (Quests.CaptureTheFlag.Team1 == null)
Quests.CaptureTheFlag.Team1 = C.MyChar.MyGuild;
else
Quests.CaptureTheFlag.Team2 = C.MyChar.MyGuild;
LiveManager.SendMsgToAll("[SYSTEM]", C.MyChar.MyGuild + " has joined the CTF challange!", 2005);
}
}
break;
case (uint)NpcIds.CTFTeam1;
case (uint)NpcIds.CTFTeam2;
if (Type == 0)
{
if (C.MyChar.FlagKeeper && DateTime.Now.AddSeconds(45) >= C.MyChar.MyGuild.ClaimedFlag)
Quests.CaptureTheFlag.GivePoints(C.MyChar.MyGuild) ;
else
C.SendLocalMessage("Either you are not the flagkeeper, or you have to wait a little bit before claiming the flag", 2005);
}
break;
|
Quote:
foreach (DictionaryEntry DI in LiveManager.H_Chars)
{
Character Char = (Character)DI.Value;
if (Char.FlagKeeper && !Char.Alive)
{
Character C = (Character)Char.Blood.Attacker;
C.FlagKeeper = true;
Char.FlagKeeper = false;
LiveManager.SendMsgToAll("[SYSTEM]", Char.Name + " has lost the flag and " + C.Name + " has it!",2005);
}
}
|
Old, old old code, shitty code, but may improve your code.
Goodluck,
Emme