[Release]GuildWar Fix

01/19/2010 08:49 N¡ghtMare ?? WooT#1
For lotf

Hello, i will show you how to fix guildwar in lotf.
First open World.cs
Then under:
Code:
public static Hashtable GWScores = new Hashtable();
add this:
Code:
public static bool GW = false;
Now search for: (in World.cs)
Code:
public static void UsingSkill
under it paste:
Code:
        public static void GWOFF(Character User)
        {
            if (User.LocMap == 1038)
            {
                if (GW == false)
                {
                    User.Teleport(1002, 431, 379);
                }
            }
        }
Now open Client.cs
Search for:
Code:
public void Drop()
Then find
Code:
                        if (MyChar.LocMap == 700)
                        {
                            MyChar.CPs += 27;
                            SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                            MyChar.Teleport(1036, 200, 200);
                        }
under it add:
Code:
                        if (MyChar.LocMap == 1038)
                        {
                            if (World.GW == false)
                            {
                                MyChar.Teleport(1002, 431, 379);
                            }
                        }
Now open Entities.cs
and search for:
Code:
World.SendMsgToAll(Winner.GuildName + " has won!", "SYSTEM", 2011);
under it add:
Code:
World.GW = false;
Those codes makes so, when pole is dead all get teleported to twincity and if gw is off and you are in guildwar map when offline, you will be send to twincity.
Now the npc for guildwar
(Thanks to PeTe Ninja for the Random thing)
NPC Talk:
Code:
                            if (CurrentNPC == 600) //Guild Controller
                            {
                                if (World.GW == true)
                                {
                                    SendPacket(General.MyPackets.NPCSay("Would you like to enter Guild Wars?."));
                                    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));//This is only because if you take reward before a new winner comes
                                    SendPacket(General.MyPackets.NPCSetFace(30));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                                else
                                {
                                    SendPacket(General.MyPackets.NPCSay("GuildWar has not started, sorry. If you are GL you can claim your prize."));
                                    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());
                                }
                            }
NPC Control:
Code:
                            if (CurrentNPC == 600) // Guild Controller Do
                            {
                                if (Control == 1) // What it does for your Respond
                                {
                                    Random R = new Random(); // New Random
                                    int Nr = R.Next(1, 10); // "Randomally" Picks a number 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("720028-0-0-0-0-0", 0, (uint)General.Rand.Next(345636635));
                                        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 you need to add command for GuildWar.
Search for:
Code:
if (Status == 8)
Then add this commands under the other commands: (The command is for start gw)
Code:
                                            if (Splitter[0] == "/gwon")
                                            {
                                                World.GW = true;
                                                World.SendMsgToAll("GuildWar has open, hurry up to the area.", "SYSTEM", 2011);
                                            }
That was all =]
Hope you could use it
01/19/2010 09:32 N¡ghtMare ?? WooT#2
#REMOVED
01/19/2010 10:44 ramix#3
that is not for loft 5165 rigth? :S
01/19/2010 11:10 N¡ghtMare ?? WooT#4
Is for lotf =]
01/19/2010 11:15 ramix#5
ok :D
01/19/2010 11:18 N¡ghtMare ?? WooT#6
Quote:
Originally Posted by ramix View Post
ok :D
I would appriciate if you could hit the thanks button =]
01/19/2010 18:49 لعبة الحيا#7
the guild war fix 5165 yes or no
01/19/2010 18:57 .Ryu#8
Quote:
Originally Posted by لعبة الحيا View Post
the guild war fix 5165 yes or no
This is for LOTF 5017
01/19/2010 23:01 gulpi_de_gulat#9
this is easy to convert 5165 source i think
01/20/2010 02:03 -Shunsui-#10
Quote:
Originally Posted by gulpi_de_gulat View Post
this is easy to convert 5165 source i think
Yeah i used hes Random teleporting on the 5165
01/20/2010 03:18 N¡ghtMare ?? WooT#11
ya is easy to fix.
The things i did was
Quote:
-enter gw when is open only
-randomteleport made by PeTe Ninja
-if offline in map, send to tc
-when pole is down all teleport to tc
-command for start gw
01/20/2010 05:19 -Shunsui-#12
Well, Glad you released it, Your Random Picking helped me and so i coded MoonBox with it, :)

Code:
#region MoonBox
                    case 721084:
                        {
                            Random R = new Random(); // New Random
                            int Nr = R.Next(1, 6); // "Randomally" Picks a number 1-6 
                            if (Nr == 1) 
                            {
                                AddItem(111006);//Helm
                                RemoveItem(I);
                            }
                            if (Nr == 2) 
                            {
                                AddItem(112058);//Veil
                                RemoveItem(I);
                            }
                            if (Nr == 3) 
                            {
                                AddItem(720027);//MetScroll
                                RemoveItem(I);
                            }
                            if (Nr == 4)
                            {
                                AddItem(723711);//met Tear Pack
                                RemoveItem(I);
                            }
                            if (Nr == 5) 
                            {
                                AddItem(723700);//Exp Ball
                                RemoveItem(I);
                            }
                            if (Nr == 6) 
                            {
                                AddItem(723584);//Black Tulip
                                RemoveItem(I);
                            }
                            break;
                        }
                    #endregion
01/20/2010 23:43 N¡ghtMare ?? WooT#13
Quote:
Originally Posted by -Shunsui- View Post
Well, Glad you released it, Your Random Picking helped me and so i coded MoonBox with it, :)

Code:
#region MoonBox
                    case 721084:
                        {
                            Random R = new Random(); // New Random
                            int Nr = R.Next(1, 6); // "Randomally" Picks a number 1-6 
                            if (Nr == 1) 
                            {
                                AddItem(111006);//Helm
                                RemoveItem(I);
                            }
                            if (Nr == 2) 
                            {
                                AddItem(112058);//Veil
                                RemoveItem(I);
                            }
                            if (Nr == 3) 
                            {
                                AddItem(720027);//MetScroll
                                RemoveItem(I);
                            }
                            if (Nr == 4)
                            {
                                AddItem(723711);//met Tear Pack
                                RemoveItem(I);
                            }
                            if (Nr == 5) 
                            {
                                AddItem(723700);//Exp Ball
                                RemoveItem(I);
                            }
                            if (Nr == 6) 
                            {
                                AddItem(723584);//Black Tulip
                                RemoveItem(I);
                            }
                            break;
                        }
                    #endregion
Also thansk PeTe Ninja, is from his GuildController =]
01/21/2010 07:01 Arcо#14
Quote:
Originally Posted by N¡ghtMare ?? WooT View Post
Is for lotf =]

There are 3 different lotfs.
5017
5119
5165

Which one is this for?
01/22/2010 04:43 TheLeGend209#15
Nice Release +++

I used the Teleport INfo for my 5165 :P