public static void GuildWar() { if (DateTime.Now.Minute == 00) { World.GW = true; World.SendMsgToAll("There is GuildWar, hurry up to enter.", "SYSTEM", 2011); } }
public static void GuildWarEnd() { foreach (DictionaryEntry DE in World.AllChars) { Character Char = (Character)DE.Value;
if (DateTime.Now.Minute == 25 && World.Gw == true) { World.GW = false; World.SendMsgToAll("GuildWar has auto ended.", "SYSTEM", 2011); } } }
Now the NPC (Thanks to PeTe Ninja for the random thing)
Search for:
PHP Code:
if (CurrentNPC == 600)
Replace the whole code with:
PHP Code:
if (CurrentNPC == 600) //Guild Controller { if (World.GW == true) { SendPacket(General.MyPackets.NPCSay("Would you like to enter GuildWars?")); SendPacket(General.MyPackets.NPCLink("Oh Yes Please!", 1)); SendPacket(General.MyPackets.NPCLink("We have won and im GL, so i want the prize!", 2)); SendPacket(General.MyPackets.NPCLink("No No No, It's Too Scary!", 255)); SendPacket(General.MyPackets.NPCSetFace(30)); SendPacket(General.MyPackets.NPCFinish()); } else { SendPacket(General.MyPackets.NPCSay("GuildWar has not started, sorry or either is too late to join.")); SendPacket(General.MyPackets.NPCLink("We have won and im GL, so i want the prize!", 2)); SendPacket(General.MyPackets.NPCLink("Okay sorry.", 255)); SendPacket(General.MyPackets.NPCSetFace(30)); SendPacket(General.MyPackets.NPCFinish()); } }
Now the control
Search for:
PHP Code:
if (MyChar.MyGuild != null && MyChar.MyGuild == World.PoleHolder
Replace the whole NPC code with:
PHP Code:
if (CurrentNPC == 600) { if (Control == 1) { Random R = new Random(); int Nr = R.Next(1, 10); if (Nr == 1) //Random Spot 1 { MyChar.Teleport(1038, 351, 341); } if (Nr == 2) //Random Spot 2 { MyChar.Teleport(1038, 335, 345); } if (Nr == 3) //Random Spot 3 { MyChar.Teleport(1038, 309, 369); } if (Nr == 4) //Random Spot 4 { MyChar.Teleport(1038, 283, 340); } if (Nr == 5) //Random Spot 5 { MyChar.Teleport(1038, 310, 327); } if (Nr == 6) //Random Spot 6 { MyChar.Teleport(1038, 318, 297); } if (Nr == 7) //Random Spot 7 { MyChar.Teleport(1038, 347, 309); } if (Nr == 8) //Random Spot 8 { MyChar.Teleport(1038, 337, 320); } if (Nr == 9) //Random Spot 9 { MyChar.Teleport(1038, 309, 293); } if (Nr == 10) //Random Spot 10 { MyChar.Teleport(1038, 371, 300); } } if (Control == 2) { if (MyChar.MyGuild != null && MyChar.MyGuild == World.PoleHolder && MyChar.GuildPosition == 100 && !MyChar.MyGuild.ClaimedPrize && MyChar.ItemsInInventory < 40) { MyChar.AddItem("1088000-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472)); //LOL a dragonball MyChar.MyGuild.ClaimedPrize = true; } else { SendPacket(General.MyPackets.NPCSay("Either the prize has been taken already, your guild has not been victorious the last time or you are not a deputy leader nor guild leader.")); SendPacket(General.MyPackets.NPCLink("Ok.", 255)); SendPacket(General.MyPackets.NPCSetFace(30)); SendPacket(General.MyPackets.NPCFinish()); } } }
Now open Entities.cs
and search for:
PHP Code:
foreach (DictionaryEntry DE in Guilds.AllGuilds) { Guild AGuild = (Guild)DE.Value; AGuild.HoldingPole = false; AGuild.ClaimedPrize = false; if (AGuild.PoleDamaged > Highest)
Replace from
PHP Code:
foreach (DictionaryEntry DE in Guilds.AllGuilds)
to
PHP Code:
Attacker.Attacking = false; }
With this:
PHP Code:
foreach (DictionaryEntry DE in Guilds.AllGuilds) { Guild AGuild = (Guild)DE.Value; AGuild.HoldingPole = false; AGuild.ClaimedPrize = false; if (AGuild.PoleDamaged > Highest) { Highest = AGuild.PoleDamaged; Winner = AGuild; } AGuild.PoleDamaged = 0; } if (Winner != null && World.GW == true) { Winner.HoldingPole = true; World.GW = false; World.PoleHolder = Winner; World.SendMsgToAll(Winner.GuildName + " has won the guildwar! The GuildLeader can now go take his/hers Dragonball.", "SYSTEM", 2011); World.SendMsgToAll("GuildWar has ended. The pole can't be taken, either if you hit it down. No entry allowed to GW.", "SYSTEM", 2005); } World.GWScores.Clear(); Attacker.TGTarget = null; Attacker.Attacking = false; }
Thats it
Note:
Code:
The GuildWar Starts XX:00 Every Hour and AutoEnds XX:25
Also the GW Ends, if you hit down the pole :)
Press thansk if i helped :)
@Dont ask if i release my other tournaments ^^
This should be the fixed. Problem was at last part.
Please make sure somethings as Locmap etc. will make error.
I dont remember the exactly code.
Code:
foreach (DictionaryEntry DE in Guilds.AllGuilds)
{
Guild AGuild = (Guild)DE.Value;
AGuild.HoldingPole = false;
AGuild.ClaimedPrize = false;
if (AGuild.PoleDamaged > Highest)
{
Highest = AGuild.PoleDamaged;
Winner = AGuild;
}
AGuild.PoleDamaged = 0;
}
if (Winner != null && World.GW == true)
{
foreach (DictionaryEntry DE in World.AllChars)
{
Character Char = (Character)DE.Value;
if (Char.LocMap == 1038)
{
Char.Teleport(1002, 400, 400);
}
Winner.HoldingPole = true;
World.GW = false;
World.PoleHolder = Winner;
World.SendMsgToAll(Winner.GuildName + " has won the guildwar! The GuildLeader can now go take his/hers Dragonball.", "SYSTEM", 2011);
World.SendMsgToAll("GuildWar has ended. The pole can't be taken, either if you hit it down. No entry allowed to GW.", "SYSTEM", 2005);
}
}
World.GWScores.Clear();
Attacker.TGTarget = null;
Attacker.Attacking = false;
}
[Release]GuildWar Fix 09/19/2010 - CO2 PServer Guides & Releases - 23 Replies For lotf
Hello, i will show you how to fix guildwar in lotf.
First open World.cs
Then under:
public static Hashtable GWScores = new Hashtable();
add this:
[RELEASE] old 5017 lotf 03/20/2010 - CO2 PServer Guides & Releases - 8 Replies it works okay... this is my second draft because my first one got wiped so dont expect it to be as good... haven't spent much time on it.. its all urs..
do what you want..
LOTF v5017..
put the database in your C: and define it directly in the src.. it loads dmaps and npcs from there..
to do npcs just go to NPcSystem.cs ... yeah just put it in recently .. it works ifne , i have tested it.
[Release]XP Shield(LOTF) 07/31/2009 - CO2 PServer Guides & Releases - 16 Replies I haven't released anything in awhile, and I removed all my other releases so... I'll throw a random lotf release since a bunch of people are using lotf lately for practise. This is handy, and can be used as a reference when making skills of similar style.
First, add in database.cs
SkillAttributes = new ushort;
SkillAttributes = new ushort { 7, 0, 0, 0, 0, 0 };
SkillsDone.Add(1020, 0);
Now the rest goes into character.cs, just search the lines I...
[LOTF RELEASE] Ip Ban!! 05/18/2009 - CO2 PServer Guides & Releases - 22 Replies Ip Ban!
Credits to Ultimatum
First...Search this ( It is in General.cs )
public static System.IO.StreamWriter sw = new System.IO.StreamWriter(Application.StartupPath + @"\ServerLog.txt", true);
[Release] Those still using LOTF 04/17/2009 - CO2 PServer Guides & Releases - 23 Replies Help yourself be a better coder and listen to what the community is trying to say. One day you will understand why some are trying to encourage people still using LOTF to move to a more stable source and only use LOFT as a basis of learning and how you can improve (A LOT) on the LOTF coding.
There's a lot of GREAT coding examples in InfamousNoone's source which you can actually learn from and gain a greater understanding of how a PROPER server operates. After all why do you think...