|
You last visited: Today at 23:19
Advertisement
[Help] 5165 NPC Help
Discussion on [Help] 5165 NPC Help within the CO2 Private Server forum part of the Conquer Online 2 category.
01/13/2010, 22:41
|
#1
|
elite*gold: 0
Join Date: Nov 2009
Posts: 322
Received Thanks: 63
|
[Help] 5165 NPC Help
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.
|
|
|
01/13/2010, 22:43
|
#2
|
elite*gold: 0
Join Date: Dec 2009
Posts: 583
Received Thanks: 119
|
Quote:
Originally Posted by xScott
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
|
|
|
01/13/2010, 22:45
|
#3
|
elite*gold: 0
Join Date: Nov 2009
Posts: 322
Received Thanks: 63
|
Quote:
Originally Posted by .Fox
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
|
|
|
01/13/2010, 22:48
|
#4
|
elite*gold: 0
Join Date: Dec 2009
Posts: 583
Received Thanks: 119
|
Quote:
Originally Posted by xScott
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
|
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 ^^
|
|
|
01/13/2010, 22:51
|
#5
|
elite*gold: 0
Join Date: Nov 2009
Posts: 322
Received Thanks: 63
|
Quote:
Originally Posted by .Fox
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
|
|
|
01/13/2010, 22:53
|
#6
|
elite*gold: 0
Join Date: Dec 2009
Posts: 583
Received Thanks: 119
|
Quote:
Originally Posted by xScott
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
|
Well then it got mested up hold on ill see what i can do
|
|
|
01/13/2010, 22:54
|
#7
|
elite*gold: 0
Join Date: Nov 2009
Posts: 322
Received Thanks: 63
|
Quote:
Originally Posted by .Fox
Well then it got mested up hold on ill see what i can do
|
i think i realised what ive done wrong, ill post back if i fixed it or not
I placed the second link nested into the the first link
whereas i should've done else if i think...
|
|
|
01/13/2010, 22:56
|
#8
|
elite*gold: 0
Join Date: Dec 2009
Posts: 583
Received Thanks: 119
|
Quote:
Originally Posted by xScott
i think i realised what ive done wrong, ill post back if i fixed it or not
I played the second link nested into the the first link
whereas i should've done else if i think...
|
K if you need help lemme know =P
|
|
|
01/14/2010, 00:38
|
#9
|
elite*gold: 0
Join Date: Nov 2009
Posts: 322
Received Thanks: 63
|
ugh i just cant get it to work ><
|
|
|
01/14/2010, 11:35
|
#10
|
elite*gold: 0
Join Date: May 2006
Posts: 52
Received Thanks: 25
|
Quote:
Originally Posted by xScott
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.
|
Look at colors lines
your line is red my is blue
|
|
|
01/14/2010, 16:07
|
#11
|
elite*gold: 0
Join Date: Nov 2009
Posts: 322
Received Thanks: 63
|
Quote:
Originally Posted by intel_ro
Look at colors lines
your line is red my is blue
|
Yeah i tried that, it doesnt make a differance
|
|
|
01/14/2010, 16:14
|
#12
|
elite*gold: 20
Join Date: Oct 2009
Posts: 1,009
Received Thanks: 621
|
It has to be with two equal signs.
Code:
GC.MyChar.Agi == 275;
=p
|
|
|
01/14/2010, 16:15
|
#13
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
|
#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;
|
|
|
01/14/2010, 16:26
|
#14
|
elite*gold: 0
Join Date: May 2006
Posts: 52
Received Thanks: 25
|
Quote:
Originally Posted by xScott
Yeah i tried that, it doesnt make a differance 
|
Str is working ?
|
|
|
01/14/2010, 16:30
|
#15
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Your values are being changed server side, but you never send the updated values to the client.
So it looks like the value hasnt changed.
|
|
|
 |
|
Similar Threads
|
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?
|
All times are GMT +1. The time now is 23:20.
|
|