Coding CTF

05/18/2009 00:00 -Shunsui-#1
Does Anyone Knows Where the Npcs For Capture that Flag Spawn At?!
if so can be kind to Post It here
05/18/2009 00:03 Pete1990#2
Grrr u typed it wrong lmao. Inside 1018 i know that but cords and what npc where:D
05/18/2009 00:26 AndreaCo#3
i know.. because i was the one that coded it.. no im not helping.. -_-
05/18/2009 00:51 TheLeGend209#4
Quote:
Originally Posted by flako27 View Post
Does Anyone Knows Where the Npcs For Capture that Flag Spawn At?!
if so can be kind to Post It here

Like andrea said she coded it and u dont need it

#Request Close Noob Post
05/18/2009 01:17 PeTe Ninja#5
Quote:
Originally Posted by TheLeGend209 View Post
Like andrea said she coded it and u dont need it

#Request Close Noob Post
you released it...so stop flaming him...

flako just put all npcs in a city or something :D
05/18/2009 07:38 AndreaCo#6
thanks so much pete!!!!! <3...
05/18/2009 17:06 adz06676#7
Quote:
Originally Posted by AndreaCo View Post
i know.. because i was the one that coded it.. no im not helping.. -_-
your not the only one who's coded CTF, it isn't exactly hard.
05/18/2009 19:20 AndreaCo#8
yes i know it wasent hard.. and kinshi also coded it in but i didint want mine to be released -_-... because my server was the only one to have it and now most of the servers have it
05/18/2009 20:45 _Emme_#9
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
05/18/2009 21:23 PeTe Ninja#10
Quote:
Originally Posted by EmmeTheCoder View Post
I probably set it all up wrong, but anyways here's mine shitty coded (NOT LOTF PETE)









Old, old old code, shitty code, but may improve your code.

Goodluck,
Emme
xD, why you said NOT LOTF PETE? pete me or other pete?