#1 problem which I think you already corrected
Too much/incorrect indentation
#2 after reading through it... REALLLLYYY messed up indentation.
Note I do not use lotf so I can't correct any other coding errors but here is the correct indented version
Code:
#region Stats
case 55570:
{
if (Control == 0)
{
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());
}
if (Control == 1)
{
if ((GC.MyChar.Job >= 10 && GC.MyChar.Job <= 25) || ( GC.MyChar.Job >= 130 && GC.MyChar.Job <= 135) && GC.MyChar.CPs >= 1290 && GC.MyChar.Level >= 120 && GC.MyChar.Reborns >= 1) //checks if its a tro,war or water & has 1290 & level & reborn
{
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 trojan, warrior or water."));
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 && GC.MyChar.Level >= 120 && GC.MyChar.Reborns >= 1) //checks if ninja or archer & cps
{
GC.MyChar.CPs -= 1290;
GC.MyChar.Agi = 275;
GC.AddSend(Packets.NPCSay("There you go, You now have 275 Agility. 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 Ninja or Archer."));
GC.AddSend(Packets.NPCLink("Sorry.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
break;
}
#endregion
I removed some of the checks and combined others simply because I didn't want to have to re-write the entire script.
For future reference, structure of npcs should be
NpcCaseNumber blablabla
{
Control/linkback (same thing, wording changes with source)
{
options for THAT linkback including if statements
}
break;
}
Each Control statement should be COMPLETELY enclosed, no linking if statements off to the end of the script (you had the level check else'ing out to outside the options all together and some other funky stuff)
Just watch your indentation. I assume the stat setting code you have in there is correct as I've never used lotf... but just double check it is saving properly. If not you will have to update the character database/ini files (fairly sure new lotf uses .ini for character info right? Either way it's same thing)
Good luck with your coding! Good to see someone trying to learn
P4N
Quote:
Originally Posted by spare2
It has to be with two equal signs.
Code:
GC.MyChar.Agi == 275;
=p
|
Ummm... no it doesn't.
== is used for checking a value
if(GC.MyChar.Level == 130)
code;
= is used to assign a value
GC.MyChar.Agi = 270;