Hey i cant seem to get my NPC to make the character get a given amount of Aggility
Heres the code.
Code:
GC.MyChar.CPs -= 1290;
GC.MyChar.Agi =275;
GC.AddSend(Packets.NPCSay("There you go, You now have 275 Aggility. 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());
After i click the link that does this code, it doesnt change the aggility i said in the code.
Hey i cant seem to get my NPC to make the character get a given amount of Aggility
Heres the code.
Code:
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());
After i click the link that does this code, it doesnt change the aggility i said in the code.
Maybe because the NPC is not complete lol
Post the full code and ill see what i can do =P
Maybe because the NPC is not complete lol
Post the full code and ill see what i can do =P
Code:
#region Stats
case 55570:
{
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());
}
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());
}
}
}
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());
}
}
break;
}
#endregion
Its probably a silly mistake. i just cant find it xD
#region Stats
case 55570:
{
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());
}
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());
}
}
}
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());
}
}
break;
}
#endregion
Its probably a silly mistake. i just cant find it xD
Do you get errors cause i dont have the 5165 source... and if you can show me a screen shot of the error it would be allot easier for me ^^
Do you get errors cause i dont have the 5165 source... and if you can show me a screen shot of the error it would be allot easier for me ^^
Nah there isnt an error,
after i click the link which checks for cps & what jobs they are and preforms the code. it doesnt show the dialog i coded once its done
Like this part
Code:
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());
idunno what the error is. it just doesnt do anything after i click the links. :S
after i click the link which checks for cps & what jobs they are and preforms the code. it doesnt show the dialog i coded once its done
Like this part
Code:
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());
idunno what the error is. it just doesnt do anything after i click the links. :S
Well then it got mested up hold on ill see what i can do
Hey i cant seem to get my NPC to make the character get a given amount of Aggility
Heres the code.
Code:
GC.MyChar.CPs -= 1290;
[COLOR="Red"]GC.MyChar.Agi =275;[/COLOR]
[COLOR="MediumTurquoise"]GC.MyChar.Agi = 275;[/COLOR]
GC.AddSend(Packets.NPCSay("There you go, You now have 275 Aggility. 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());
After i click the link that does this code, it doesnt change the aggility i said in the code.
#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
Hi I need 5165 source act like Real Co 5165 09/15/2010 - CO2 Private Server - 4 Replies I need a A source 5165 that all skills is available specially rb char like nin-nin-nin counterKill and nin-war-nin reflect and more, and also the attack rates should be fair not like +8 set can 1 hit +12 set, and also maybe the client, I need to study to make it in 5200+ source. I love to trade it with my cofarmer account VIP i have use it for 5 days only. PM or contact me in skype :marlyandedsel
need help 5165 03/07/2010 - CO2 Private Server - 3 Replies i need code alex 2 rb full plz
for 5165:)
[Help]5165 02/08/2010 - CO2 Private Server - 0 Replies Okay I know I know, I am a noob at coding and crap. So my problems are...
1. Invalid jump -.- so gay, it wont let me disconnect
2. i have all packets and shiz for breeder or whateva and the npcs still say "i dont have anything coded or whateva, my id is 1234"
3. How do i change npc names that are already made. For example, Say i want to change an npc i just made called Warehouseman to ChingChong.
4. I have no clue whatsoever on how to start my website. i have gone to http://(myipaddress)/...
about 5165 02/07/2010 - CO2 Private Server - 2 Replies i need leveling is normal not fast i take level 137 in 20 mint only
IP Ban in 5165 12/21/2009 - CO2 Private Server - 3 Replies I cannot for the life of me get it implemented
Any help?