Hi I got little Problems here at 5165 source(NPCDialog.cs)

09/15/2010 17:58 marlyandedsel#1
#region Gw Winner npc
case 8888:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hello if you win guild war you can recive good prizes!"));
GC.AddSend(Packets.NPCSay("I Can Give You 100k Cps For Wining!!"));
GC.AddSend(Packets.NPCLink("My guild won give me my reward please", 1));
GC.AddSend(Packets.NPCLink("Thats cool", 255));
GC.AddSend(Packets.NPCSetFace(30));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
{
if (GC.MyChar.MyGuild == Features.GuildWars.LastWinner && (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader))
{
GC.MyChar.StatEff.Add(StatusEffectEn.TopGuildLeade r);
GC.MyChar.CPs += 100000;
GC.Message(2005, GC.MyChar.Name + "Claimed 100000cps from GuildWar");

}
else
{
GC.AddSend(Packets.NPCLink("You Didn`t Won On GW !! or maybe you already claim it !!", 1));
GC.AddSend(Packets.NPCLink("Ok Thanks", 255));
}
}
break;
}
#endregion


My Problem: when my guild won a guildwar i should claim the reward 1 time only but in this case i can claim as many as i can, how can I code to claim only 1 time? or what is the code to make the record won of my guild turns to zero.
09/15/2010 20:35 pintser#2
i think it should be something like this:(just a quicky, im in a rush :p)
find:

Guildwar= False;
below that add:
GuildWarClaim= False;


Quote:
#region Gw Winner npc
case 8888:
{
if (Control == 0 && GC.Mychar.GuildWarClaim =True)
{
GC.AddSend(Packets.NPCSay("Hello if you win guild war you can recive good prizes!"));
GC.AddSend(Packets.NPCSay("I Can Give You 100k Cps For Wining!!"));
GC.AddSend(Packets.NPCLink("My guild won give me my reward please", 1));
GC.AddSend(Packets.NPCLink("Thats cool", 255));
GC.AddSend(Packets.NPCSetFace(30));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
{
if (GC.MyChar.MyGuild == Features.GuildWars.LastWinner && (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader))
{
GC.MyChar.StatEff.Add(StatusEffectEn.TopGuildLeade r);
GC.MyChar.CPs += 100000;
GC.Message(2005, GC.MyChar.Name + "Claimed 100000cps from GuildWar");

}
else
{
GC.AddSend(Packets.NPCLink("You Didn`t Won On GW !! or maybe you already claim it !!", 1));
GC.AddSend(Packets.NPCLink("Ok Thanks", 255));
}
}
break;
}
#endregion
should be something like this.
then add it so it will become treu, and if gw restarts let it all be false :)


GoodLuck
09/15/2010 23:40 dowhatuwant#3
if (Control == 0 && GC.Mychar.GuildWarClaim =True)

should be

if (Control == 0 && GC.Mychar.GuildWarClaim == True)


and the npc looks messy.
if claim = true u enter gw.
if is off u can get reward.
09/16/2010 03:41 marlyandedsel#4
Thank you guyz i will try that one.