What is wrong with this code?

02/20/2010 04:02 Decker_#1
Hey
I'm making a custom quest but when it comes to the part to get the reward, it don't show and it don't give me the reward.
Please tell me how to fix this code or what's wrong with it.

Code:
#region Killer
                            case 67436:
                                {
                                    if (Control == 0)
                                    {

                                        if (GC.MyChar.InventoryContains(710854, 1))
                                        {
                                            GC.AddSend(Packets.NPCSay("Hello.  A letter huh.  Well, I accidently killed ghost a while back.  Tell him his apology is accepted."));
                                            GC.AddSend(Packets.NPCLink("Sure Thing", 1));
                                            GC.AddSend(Packets.NPCLink("No", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        if (Control == 1)
                                        {
                                            GC.MyChar.CPs += 10000000;
                                            GC.AddSend(Packets.NPCSay("Here is your reward.!"));
                                            GC.AddSend(Packets.NPCLink("Thank you", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                }
                                break;
                            #endregion
02/20/2010 04:03 hunterman01#2
Your break is in the wrong part needs to be before that last bracket
02/20/2010 04:03 Arcо#3
Code:
#region Killer
                            case 67436:
                                {
                                    if (Control == 0)
                                    {

                                        if (GC.MyChar.InventoryContains(710854, 1))
                                        {
                                            GC.AddSend(Packets.NPCSay("Hello.  A letter huh.  Well, I accidently killed ghost a while back.  Tell him his apology is accepted."));
                                            GC.AddSend(Packets.NPCLink("Sure Thing", 1));
                                            GC.AddSend(Packets.NPCLink("No", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You don't have the required item.));
                                            GC.AddSend(Packets.NPCLink("Sorry", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
}
                                        if (Control == 1)
                                        {
                                            GC.MyChar.CPs += 10000000;
                                            GC.AddSend(Packets.NPCSay("Here is your reward.!"));
                                            GC.AddSend(Packets.NPCLink("Thank you", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
}
break;
                                    }
                                
                                
                            #endregion
You need to learn where breaks go and how to use brackets.
02/20/2010 04:11 Decker_#4
I get 308 errors :S
with arcos code
02/20/2010 04:13 hunterman01#5
Quote:
Originally Posted by Decker_ View Post
I get 308 errors :S
with arcos code
Not sure why there is nothing wrong with it
02/20/2010 04:14 Arcо#6
#updated it
Try now.
02/20/2010 04:16 Decker_#7
Nope, still 308 errors
02/20/2010 04:16 -Shunsui-#8
This Should Work,

Code:
                            #region Killer
                            case 67436:
                                {
                                    if (Control == 0)
                                    {

                                        if (GC.MyChar.InventoryContains(710854, 1))
                                        {
                                            GC.AddSend(Packets.NPCSay("Hello.  A letter huh.  Well, I accidently killed ghost a while back.  Tell him his apology is accepted."));
                                            GC.AddSend(Packets.NPCLink("Sure Thing", 1));
                                            GC.AddSend(Packets.NPCLink("No", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You don't have the required item"));
                                            GC.AddSend(Packets.NPCLink("Sorry", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        if (Control == 1)
                                        {
                                            GC.MyChar.CPs += 10000000;
                                            GC.AddSend(Packets.NPCSay("Here is your reward.!"));
                                            GC.AddSend(Packets.NPCLink("Thank you", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    break;
                                }
                            #endregion
@ Arco Your MIssing the " at the End of the Text, In

Code:
GC.AddSend(Packets.NPCSay("You don't have the required item.[COLOR="Red"]"[/COLOR]));
02/20/2010 04:17 Decker_#9
ya that works, thanks jose!
02/20/2010 04:19 Arcо#10
Quote:
Originally Posted by -Shunsui- View Post
This Should Work,

Code:
                            #region Killer
                            case 67436:
                                {
                                    if (Control == 0)
                                    {

                                        if (GC.MyChar.InventoryContains(710854, 1))
                                        {
                                            GC.AddSend(Packets.NPCSay("Hello.  A letter huh.  Well, I accidently killed ghost a while back.  Tell him his apology is accepted."));
                                            GC.AddSend(Packets.NPCLink("Sure Thing", 1));
                                            GC.AddSend(Packets.NPCLink("No", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You don't have the required item"));
                                            GC.AddSend(Packets.NPCLink("Sorry", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        if (Control == 1)
                                        {
                                            GC.MyChar.CPs += 10000000;
                                            GC.AddSend(Packets.NPCSay("Here is your reward.!"));
                                            GC.AddSend(Packets.NPCLink("Thank you", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    break;
                                }
                            #endregion
@ Arco Your MIssing the " at the End of the Text, In

Code:
GC.AddSend(Packets.NPCSay("You don't have the required item.[COLOR="Red"]"[/COLOR]));
Not only that, but I h ad the brackets misplaced.
Oh well, lol that's what happens when you try to do a code without using C#.
02/20/2010 04:21 Decker_#11
Well the code works, but the same problem occurs.
It don't give me the cp's and it don't tell me I have the reward, as soon as he asks me to tell ghost his apology is accepted and i say sure thing, it goes off.
02/20/2010 04:24 -Shunsui-#12
Then try

Code:
 
                            #region Killer
                            case 67436:
                                {
                                    if (Control == 0)
                                    {

                                        if (GC.MyChar.InventoryContains(710854, 1))
                                        {
                                            GC.AddSend(Packets.NPCSay("Hello.  A letter huh.  Well, I accidently killed ghost a while back.  Tell him his apology is accepted."));
                                            GC.AddSend(Packets.NPCLink("Sure Thing", 1));
                                            GC.AddSend(Packets.NPCLink("No", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You don't have the required item"));
                                            GC.AddSend(Packets.NPCLink("Sorry", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if (Control == 1)
                                    {
                                        GC.MyChar.CPs += 10000000;
                                        GC.AddSend(Packets.NPCSay("Here is your reward.!"));
                                        GC.AddSend(Packets.NPCLink("Thank you", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    break;
                                }
                            #endregion
02/20/2010 05:37 LetterX#13
Quote:
Originally Posted by -Shunsui- View Post
Then try

Code:
 
                            #region Killer
                            case 67436:
                                {
                                    if (Control == 0)
                                    {

                                        if (GC.MyChar.InventoryContains(710854, 1))
                                        {
                                            GC.AddSend(Packets.NPCSay("Hello.  A letter huh.  Well, I accidently killed ghost a while back.  Tell him his apology is accepted."));
                                            GC.AddSend(Packets.NPCLink("Sure Thing", 1));
                                            GC.AddSend(Packets.NPCLink("No", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You don't have the required item"));
                                            GC.AddSend(Packets.NPCLink("Sorry", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if (Control == 1)
                                    {
                                        GC.MyChar.CPs += 10000000;
                                        GC.AddSend(Packets.NPCSay("Here is your reward.!"));
                                        GC.AddSend(Packets.NPCLink("Thank you", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    break;
                                }
                            #endregion
Wouldn't you need to send the client a string packet to update the CPs amount the client shows? o.o
02/20/2010 05:40 Arcо#14
Quote:
Originally Posted by LetterX View Post
Wouldn't you need to send the client a string packet to update the CPs amount the client shows? o.o
Not with the 5165.
02/20/2010 09:59 Korvacs#15
Quote:
Originally Posted by LetterX View Post
Wouldn't you need to send the client a string packet to update the CPs amount the client shows? o.o
As i descovered in a previous thread, the source does this durring the set{} method of the variable.