[HELP]Guildwar Prize

02/05/2014 02:54 akosicamar2#1
Hey guys , I have another problem of mine.
Can anyone help me again ?
The NPC on game won't work. I already put the correct NPC ID. :(|
I wonder if there`s any problem in the code given below.

Code:
                            #region ClaimGuildPrize
                            case 4482114:
                                {
                                    switch (npcRequest.OptionID)
                                    {
                                        case 0:
                                            {
                                                dialog.Text("Hello there. Do you want to Claim GuildWar Prize you can only Claim it 1 Time if you won GW.");
                                                dialog.Option("Leme Claim.", 1);
                                                dialog.Option("Claim TopDeputyLeader.", 3);
                                                dialog.Option("Just Passing By!", 255);
                                                dialog.Send();
                                                break;
                                            }
                                        case 1:
                                            {
                                                if (client.Guild != null)
                                                {
                                                    if (client.Guild.PoleKeeper && client.Guild != null && client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
                                                    {
                                                        dialog.Text("Are you sure you want to Claim your Prize?");
                                                        dialog.Option("Yes.", 2);
                                                        dialog.Option("Ah, nevermind.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("Sorry only GuildLeader of the Winner Guild can Claim The Prize After GuildWar End.");
                                                        dialog.Option("Ahh.", 255);
                                                        dialog.Send();
                                                    }
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry You are not Member in any guild yet");
                                                    dialog.Option("Ahh.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 2:
                                            {
                                                if (DateTime.Now.Hour >= Game.SezaREvents.GWEEndHour && DateTime.Now.Hour < (Game.SezaREvents.GWEEndHour + 1) && DateTime.Now.DayOfWeek == DayOfWeek.Sunday && client.Guild.PoleKeeper && client.Guild != null && client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader && ClassPk.TopGlClaim == 0)
                                                {
                                                    client.Entity.ConquerPoints += Conquer_Online_Server.Database.rates.GuildWar;
                                                    ClassPk.AddGl();
                                                    client.Inventory.Add(723467, 0, 1);
                                                    Game.Flags.AddGuildLeader(client);
                                                    client.Entity.AddFlag(Update.Flags.TopGuildLeader);
                                                    Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " Leader of " + client.Guild.PoleKeeper + " The winner guild has Claimed Guild War Prize " + Conquer_Online_Server.Database.rates.GuildWar + " cps and LordToken!", System.Drawing.Color.White, Message.TopLeft), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry you dont have Any Prize to claim only GL of the winner guild can claim Prize After GW");
                                                    dialog.Option("Ahh.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 3:
                                            {
                                                if (client.Guild != null)
                                                {
                                                    if (client.Guild.PoleKeeper && client.Guild != null && client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
                                                    {
                                                        dialog.Text("Are you sure you want to Claim your Prize?");
                                                        dialog.Option("Yes.", 4);
                                                        dialog.Option("Ah, nevermind.", 255);
                                                        dialog.Send();
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("Sorry only DeputyLeader of the Winner Guild can Claim The Prize After GuildWar End.");
                                                        dialog.Option("Ahh.", 255);
                                                        dialog.Send();
                                                    }

                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry You are not Member in any guild yet");
                                                    dialog.Option("Ahh.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                        case 4:
                                            {
                                                if (!client.Entity.ContainsFlag(Update.Flags.TopDeputyLeader))
                                                {
                                                    if (DateTime.Now.Hour >= Game.SezaREvents.GWEEndHour && DateTime.Now.Hour < (Game.SezaREvents.GWEEndHour + 1) && DateTime.Now.DayOfWeek == DayOfWeek.Sunday && client.Guild.PoleKeeper && client.Guild != null && client.AsMember.Rank == Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader && ClassPk.TopDlClaim < 5)
                                                    {
                                                        ClassPk.AddDl();
                                                        client.Entity.AddFlag(Update.Flags.TopDeputyLeader);
                                                        Conquer_Online_Server.ServerBase.Kernel.SendWorldMessage(new Message("Congratulations! " + client.Entity.Name + " From " + client.Guild.PoleKeeper + " Has Claimed TopDeputyLeader Halo!", System.Drawing.Color.White, Message.TopLeft), Conquer_Online_Server.ServerBase.Kernel.GamePool.Values);
                                                        if (ClassPk.TopDlClaim == 1)
                                                        {
                                                            Game.Flags.AddGuildDeaputy(client);
                                                        }
                                                        if (ClassPk.TopDlClaim == 2)
                                                        {
                                                            Game.Flags.AddGuildDeaputy2(client);
                                                        }
                                                        if (ClassPk.TopDlClaim == 3)
                                                        {
                                                            Game.Flags.AddGuildDeaputy3(client);
                                                        }
                                                        if (ClassPk.TopDlClaim == 4)
                                                        {
                                                            Game.Flags.AddGuildDeaputy4(client);
                                                        }
                                                        if (ClassPk.TopDlClaim == 5)
                                                        {
                                                            Game.Flags.AddGuildDeaputy5(client);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        dialog.Text("Sorry you dont have Any Prize to claim only Dl of the Winner Guild Can claim the halo After GW end.");
                                                        dialog.Option("Ahh.", 255);
                                                        dialog.Send();
                                                    }
                                                    break;
                                                }
                                                else
                                                {
                                                    dialog.Text("Sorry you already have top DeaputyLeader come next time ;).");
                                                    dialog.Option("Ahh.", 255);
                                                    dialog.Send();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
02/05/2014 03:02 Aceking#2
Well for starters you are going to have to stop making a thread for every single problem you encounter.
Im sorry but our job is not to fix every little bug you come across.

Secondly, just saying "it doesnt work" doesn't really help us help you.
Do you get any error messages?
Does the server say anything?
Does the NPC say anything at all?

Have you compared this code to another NPCs code to make sure you aren't missing a function call?
Are you positive the NPC ID is exactly the same? (Its awfully long too).

Lastly, judging from the code, you can only claim the reward on a sunday one hour after GW has ended.
Also, your null checks should be the first thing you check for, not something in the middle. Otherwise if it is null, it will throw an exception before you even check for it.
02/05/2014 10:01 akosicamar2#3
Quote:
Originally Posted by Aceking View Post
Well for starters you are going to have to stop making a thread for every single problem you encounter.
Im sorry but our job is not to fix every little bug you come across.

Secondly, just saying "it doesnt work" doesn't really help us help you.
Do you get any error messages?
Does the server say anything?
Does the NPC say anything at all?

Have you compared this code to another NPCs code to make sure you aren't missing a function call?
Are you positive the NPC ID is exactly the same? (Its awfully long too).

Lastly, judging from the code, you can only claim the reward on a sunday one hour after GW has ended.
Also, your null checks should be the first thing you check for, not something in the middle. Otherwise if it is null, it will throw an exception before you even check for it.
No error Message even the NPC can't even talk I don't know why :( Please help me for the sake of my server. I will be really thankful to you if you help me.

bump ! :(

bump ! :(