Help Me In This Npc Script

12/16/2010 12:26 sohaib#1
Hello, i added this npc to my 5165 source NewestCOServer RikardoUptades flatfile With Impulse's Sockets

so here's the Npc
PHP Code:
#region GWNPC
                            
case 951753:
                                {
                                    if (
Control == 0)
                                    {
                                        
GC.AddSend(Packets.NPCSay("Do you want enter TheGuildWar?"));
                                        
GC.AddSend(Packets.NPCLink("Yes."1));
                                        
GC.AddSend(Packets.NPCLink("I am the winning Guild Leader!"2));
                                        
GC.AddSend(Packets.NPCLink("I am the winning Deputy Leader!"3));
                                        
GC.AddSend(Packets.NPCLink("Just passing by."255));
                                        
GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        
GC.AddSend(Packets.NPCFinish());
                                    }
                                    else if (
Control == 1)
                                    {
                                        
GC.MyChar.Teleport(1038350350);
                                    }
                                    else if (
Control == 2)
                                    {
                                        if (
GC.MyChar.MyGuild == Features.GuildWars.LastWinner && (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader))
                                        {

                                            
GC.MyChar.CPs += 1000000;
                                            
World.SendMsgToAll("SYSTEM"GC.MyChar.Name " has claimed 1 Million CPs and the TopGuildLeader Halo for winning GuildWar!"20110);

                                            
GC.MyChar.StatEff.Add(StatusEffectEn.TopGuildLeader);
                                            try
                                            {
                                                
StreamWriter sw = new StreamWriter("C:\\OldCODB/Tops/TopLeader.txt");
                                                
sw.WriteLine("" GC.MyChar.EntityID "#17179869184");
                                                
sw.Close();
                                            }
                                            catch (
Exception e)
                                            {
                                                
Console.WriteLine(e.Message);
                                            }
                                        }
                                        else
                                        {
                                            
GC.AddSend(Packets.NPCSay("You already claimed your 1kk cps! Get out of here!"));
                                            
GC.AddSend(Packets.NPCLink("Sorry"255));
                                            
GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            
GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else
                                    {
                                        
GC.AddSend(Packets.NPCSay("You are not in the Top Guild!"));
                                        
GC.AddSend(Packets.NPCLink("Oh sorry"255));
                                        
GC.AddSend(Packets.NPCSetFace(30));
                                        
GC.AddSend(Packets.NPCFinish());
                                    }

                                    if (
Control == 3)
                                    {
                                        if (
GC.MyChar.MyGuild == Features.GuildWars.LastWinner && (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.DeputyManager))
                                        {
                                            
World.SendMsgToAll("SYSTEM"GC.MyChar.Name " has claimed the TopDeputyLeader Halo!"20110);
                                            
GC.MyChar.StatEff.Add(StatusEffectEn.TopDeputyLeader);
                                            try
                                            {
                                                
                                                
StreamWriter sw = new StreamWriter("C:\\OldCODB/Tops/TopDeputy.txt");
                                                
sw.WriteLine("" GC.MyChar.EntityID "#34359738368");
                                                
sw.Close();
                                            }
                                            catch (
Exception e)
                                            {
                                                
Console.WriteLine(e.Message);
                                            }
                                        }
                                        else
                                        {
                                            
GC.AddSend(Packets.NPCSay("You are not in the Top Guild!"));
                                            
GC.AddSend(Packets.NPCLink("Oh sorry"255));
                                            
GC.AddSend(Packets.NPCSetFace(30));
                                            
GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    break;
                                }


                            
#endregion 
But there is a problem in this Npc, if You Won GW, you can claim 1kkcps infinity times, How can i make it leave you claim it only one time (if you won Gw of course)

thanks
12/16/2010 13:22 Korvacs#2
Put a check in? Store a bool somewhere so that i can only be claimed if it hasnt be claimed before and then change the bool accordingly.