[Help] 5165 NPC Help

01/14/2010 16:36 pro4never#16
Ahh forgot about that. Also make sure you save the character to database/ini or else it might rollback on ppl if they dc before something else saves their character.
01/14/2010 22:41 xScott#17
Alright thanks for your help, maybe ill try fix it some other time when i learn abit more XD
01/17/2010 08:57 Arcо#18
Actually if you guys look at his code what he is doing wrong is placing {'s at the wrong places.
He has a control 1 inside of control 0 which it shouldn't be.
He has it like this;
if (Control == 0)
{
Stuff blahblah
if(Control == 1)
{

}
}
When it should be like
if (control == 0)
{
}
if (control == 1)
{
}


01/21/2010 03:10 vgcman1500#19
Quote:
Originally Posted by xScott View Post
ugh i just cant get it to work ><
Go to npc.txt in oldcodb and search the npc id and if there two delete one and might work
01/21/2010 08:56 Arcо#20
Quote:
Originally Posted by vgcman1500 View Post
Go to npc.txt in oldcodb and search the npc id and if there two delete one and might work
That's not it at all.
He isn't using brackets right.
05/11/2011 10:44 noblewarrior#21
@xScott
I think this: (could be wrong)
1) does the npc talk when you click on it? If yes, then good.
2) The npc won't make the attribute points change:
Now, I believe it should be: GC.MyChar.Agi += 275;
(you might be missing the '+' sign.), i'll test ur code right now to see whats wrong.

EDIT<<<<
Ok, i just tested your npc and you simply missed out on the + sign as stated above.
I also edited your npc to make run/look better but deleting some of the brackets you had.
So, here is the full working NPC (credits to xScott ofcourse, i just touched it up a bit)

Code:
#region Stats
                            case xxxx:
                                {
                                    if (Control == 0)
                                    {
                                        if (GC.MyChar.Level >= 120 && GC.MyChar.Reborns >= 1)
                                        {
                                            GC.AddSend(Packets.NPCSay("Hey, are you the type of person who Allots all your points to HP? "));
                                            GC.AddSend(Packets.NPCSay("If your sick of Realloting your points to weild seperate gear then i can help you. "));
                                            GC.AddSend(Packets.NPCSay("Remember, You have to be promoted to the highest promotion to do this! "));
                                            GC.AddSend(Packets.NPCSay("Required Statuses to Boost Attribute points, Strength Point classes: Trojan, Warrior, Water "));
                                            GC.AddSend(Packets.NPCSay("Required Statuses to Boost Attribute points, Aggility Point classes: Ninja, Archer "));
                                            GC.AddSend(Packets.NPCSay("This will cost 1290CPs"));
                                            GC.AddSend(Packets.NPCLink("Strength Attribute Points", 1));
                                            GC.AddSend(Packets.NPCLink("Aggility Attribute Points", 2));
                                            GC.AddSend(Packets.NPCLink("Just passing by.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else  //not right level
                                        {
                                            GC.AddSend(Packets.NPCSay("Im sorry but this option is only aloud for players that exceed level 120, Come back when your stronger!"));
                                            GC.AddSend(Packets.NPCLink("Oh, Sorry.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    if (Control == 1)
                                    {
                                        if (GC.MyChar.Job == 15 || GC.MyChar.Job == 25 || GC.MyChar.Job == 135 && GC.MyChar.CPs >= 1290) //checks if its a tro,war or water & has 1290
                                        {
                                            GC.MyChar.CPs -= 1290;
                                            GC.MyChar.Str += 175;
                                            GC.AddSend(Packets.NPCSay("There you go, You now have 176 Strength. Come back if you reallot your Attribute Points again!"));
                                            GC.AddSend(Packets.NPCLink("Thanks!", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());

                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("Im sorry, But you are not a TrojanMaster, WarriorMaster or WaterSaint."));
                                            GC.AddSend(Packets.NPCLink("Sorry.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    if (Control == 2)
                                    {
                                        if (GC.MyChar.Job == 55 || GC.MyChar.Job == 45 && GC.MyChar.CPs >= 1290) //checks if ninja or archer & cps
                                        {
                                            GC.MyChar.CPs -= 1290;
                                            GC.MyChar.Agi += 275;
                                            GC.AddSend(Packets.NPCSay("There you go, You now have 176 Strength. Come back if you reallot your Attribute Points again!"));
                                            GC.AddSend(Packets.NPCLink("Thanks!", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("Im sorry, But you are not a NinjaMaster or ArcherMaster."));
                                            GC.AddSend(Packets.NPCLink("Sorry.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    break;
                                }
                            #endregion