[RELEASE]Fixed GW :P

06/06/2010 12:36 .Summer#1
Hello ElitePvpers I will release my gw npc, wich should work, so peoples cant keep claim the prize.
This is for the 5165Source by Tanel.

First replace your GWNPC with this:
Code:
#region GWArenaNPC
                            case 380:
                                {
                                    if (Control == 0)
                                    {
                                        if (Features.GuildWars.GWW == true)
                                        {
                                            GC.AddSend(Packets.NPCSay("Do you want enter the guild arena?"));
                                            GC.AddSend(Packets.NPCLink("Yes.", 1));
                                            GC.AddSend(Packets.NPCLink("I have won GW and want my price.", 2));
                                            GC.AddSend(Packets.NPCLink("Just passing by.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("There is no GuildWar going on."));
                                            GC.AddSend(Packets.NPCLink("I have won GW and want my price.", 2));
                                            GC.AddSend(Packets.NPCLink("I see.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    if (Control == 1)
                                    {
                                        GC.MyChar.Teleport(1038, 350, 350);
                                    }
                                    if (Control == 2)
                                    {
                                        if (Features.GuildWars.LastWinner == GC.MyChar.MyGuild && Features.GuildWars.GWPRIZE == true && GC.MyChar.GuildRank == Features.GuildRank.GuildLeader)
                                        {
                                            foreach (Character Char in World.H_Chars.Values)
                                            {
                                                if (Char.GuildRank == Features.GuildRank.DeputyManager && Features.GuildWars.LastWinner == Char.MyGuild)
                                                {
                                                    Char.Nobility.Donation += 20;
                                                    Game.World.NewEmpire(Char);
                                                    Char.StatEff.Add(StatusEffectEn.TopDeputyLeader);
                                                    GC.Message(2005, Char.Name + " has got the TopDL for being DL in the winner Guild of last GuildWar.");
                                                }
                                                if (Char.GuildRank == Features.GuildRank.GuildLeader && Features.GuildWars.LastWinner == Char.MyGuild)
                                                {
                                                    Char.Nobility.Donation += 50;
                                                    Game.World.NewEmpire(Char);
                                                    Char.StatEff.Add(StatusEffectEn.TopGuildLeader);
                                                    GC.Message(2005, Char.Name + " has got the TopGL for being the leader in the winner Guild of last GuildWar.");
                                                }
                                                GC.MyChar.CPs += 1075;
                                                Features.GuildWars.GWPRIZE = false;
                                                GC.AddSend(Packets.NPCSay("Here is your CPs."));
                                                GC.AddSend(Packets.NPCLink("Thanks.", 255));
                                                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                GC.AddSend(Packets.NPCFinish());
                                            }
                                        }
                                        else if (Features.GuildWars.LastWinner == GC.MyChar.MyGuild && Features.GuildWars.GWPRIZE == true)
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not the GuildLeader."));
                                            GC.AddSend(Packets.NPCLink("I see.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You have not won the GuildWar."));
                                            GC.AddSend(Packets.NPCLink("I see.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    break;
                                }
                            #endregion
NOW GO TO GuildWars.cs
search for:
Code:
    public class GuildWars
under it put:
Code:
        public static bool GWW = false;
        public static bool GWPRIZE = false;
now search for:
Code:
        public static void EndWar()
replace the whole code with:
Code:
        public static void EndWar()
        {
            War = false;
            TheLeftGate.Opened = false;
            TheRightGate.Opened = false;
            
            TheLeftGate.CurHP = TheLeftGate.MaxHP;
            TheRightGate.CurHP = TheRightGate.MaxHP;
            TheLeftGate.ReSpawn();
            TheRightGate.ReSpawn();

            GWScore Highest = new GWScore();
            Highest.Score = 0;

            foreach (GWScore Score in Scores.Values)
            {
                if (Score.Score > Highest.Score)
                    Highest = Score;
            }

            if (Highest.TheGuild != null)
            {
                foreach (Character Charr in World.H_Chars.Values)
                {
                    if (Charr.Loc.Map == 1038)
                    {
                        GWW = false;
                        Charr.Teleport(1002, 400, 400);
                        LastWinner = Highest.TheGuild;
                        LastWinner.Wins++;
                        ThePole.ReSpawn();
                        GWPRIZE = true;
                        World.SendMsgToAll("SYSTEM", Highest.TheGuild.GuildName + " have won the GuildWars Congratulations!", 2011, 0);
                    }
                    else
                    {
                        GWW = false;
                        LastWinner = Highest.TheGuild;
                        LastWinner.Wins++;
                        ThePole.ReSpawn();
                        GWPRIZE = true;
                        World.SendMsgToAll("SYSTEM", Highest.TheGuild.GuildName + " have won the GuildWars Congratulations!", 2011, 0);
                    }
                }
            }

            SendScores();
            Scores = new Hashtable();
        }
    }
}
Now in your GW Command put:
Code:
Features.GuildWars.GWW = true;
Done :)
06/06/2010 12:44 kewell5454#2
hahaha nice work thx :) k+ repLy
06/06/2010 12:54 .Summer#3
Thanks :)
06/06/2010 21:27 t_dubble_uu#4
Nice Releases but i have 1 question does the gw system end when the pole hits 0hp or does it restart it self until the weekend is over?
06/06/2010 21:42 dragon89928#5
@summer
Um. I think people can claim again after a server restart x.x You probably have to write to file stating that it's claimed.

@t_dubble_uu
You need to add a timer and then you need to let end war check if guild war is over, if not call the GW method again. until guildwar is over. I think summer released a minute based code for start time for TDM you could look at that for your timer.
06/06/2010 22:56 .Summer#6
Quote:
Originally Posted by dragon89928 View Post
@summer
Um. I think people can claim again after a server restart x.x You probably have to write to file stating that it's claimed.

@t_dubble_uu
You need to add a timer and then you need to let end war check if guild war is over, if not call the GW method again. until guildwar is over. I think summer released a minute based code for start time for TDM you could look at that for your timer.
they cant claim after restart as the bool is set to false everytime server is starting :)
if want a timer, then PM me and I will give you one :)
But first tell me, when if you want every hour, day etc.
10/01/2010 02:39 BitzIn#7
dont work when i try it i o straight to the:
GC.AddSend(Packets.NPCSay("There is no GuildWar going on."));
GC.AddSend(Packets.NPCLink("I have won GW and want my price.", 2));
GC.AddSend(Packets.NPCLink("I see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
And NPC doesnt ask me if i wanna enter. Even when i start gw