First i will release the npc and explain you alot of good things
The npc
Ok .. here is the npc jail in TwinCity (Enter the jail and go out the jail)
in Handlers / NpcTalk.cs Search for
and above it add :
- the npc is in TwinCity called ArenaGuardTang
For who wants to learn
This code you must write in each TalkNpc .. (The starter)
- case 435: is the npc ID
and after } we will add
what does it mean ?
After Sure why not .. 1, CSocket);
That's mean when you click on sure whynot something will happen
- under else if (LinkBack == 1) you must write {
now let's see when i click sure why not .. What i wanted to do ? i wanted to trade 5mill money for 5k cps ..
- under if { add if (CSocket.Client.Money >= 5000000)
that means that the character has more than 5mill money and under it add {
- and under { we will ad two lines to remove 5mill from my bag and put 5k cps
- Money -5000000 means will take from you 5mil and +5000 means will give you 5k cps
- after that you will write }
Now we need to add some lines to finish the npc, under }
- we use else to tell the char that he haven't money ...
and we will add a dialog again ...
Hmm ... if you want to make the char go to TC for example
After else if (LinkBack == 1) we will add the code to work the npc
under { add
Map id , xCord , yCored
- don't forget after coding to debug the project
- i hope i explained good because i am not good explainer ..
- It is easier than LOTF
- All who know this before help other one if they ask questions because i will go now ..
- Press thanks if you like this guide ..
The npc
Ok .. here is the npc jail in TwinCity (Enter the jail and go out the jail)
in Handlers / NpcTalk.cs Search for
Code:
default:
{
Text("NPC " + ID + "'s dialog is not coded.", CSocket);
Code:
case 435://CPs/money Trader
{
if (LinkBack == 0)
{
Text("Would you like To trade 5,000,000 Money for 5,000 CPs ?", CSocket);
Link("Sure Why not ?", 1, CSocket);
Link("No Thanks!", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if (CSocket.Client.Money >= 5000000)
{
Money(-5000000, CSocket);
CPs(+5000, CSocket);
}
else
{
Text("I'm sorry you do not have the required Money.", CSocket);
Link("Okay.", 255, CSocket);
End(CSocket);
}
}
break;
}
For who wants to learn
Code:
if (LinkBack == 0)
{
Text("Would you like To trade 5,000,000 Money for 5,000 CPs ?", CSocket);
Link("Sure Why not ?", 1, CSocket);
Link("No Thanks!", 255, CSocket);
End(CSocket);
}
- case 435: is the npc ID
and after } we will add
Code:
else if (LinkBack == 1)
After Sure why not .. 1, CSocket);
That's mean when you click on sure whynot something will happen
- under else if (LinkBack == 1) you must write {
now let's see when i click sure why not .. What i wanted to do ? i wanted to trade 5mill money for 5k cps ..
- under if { add if (CSocket.Client.Money >= 5000000)
that means that the character has more than 5mill money and under it add {
- and under { we will ad two lines to remove 5mill from my bag and put 5k cps
Code:
Money(-5000000, CSocket); CPs(+5000, CSocket);
- after that you will write }
Now we need to add some lines to finish the npc, under }
Code:
else
{
Text("I'm sorry you do not have the required Money.", CSocket);
Link("Okay.", 255, CSocket);
End(CSocket);
}
}
break;
}
and we will add a dialog again ...
Hmm ... if you want to make the char go to TC for example
After else if (LinkBack == 1) we will add the code to work the npc
under { add
Code:
Teleport([COLOR="Red"]1002[/COLOR], [COLOR="Magenta"]439[/COLOR], [COLOR="Pink"]390[/COLOR], 0, CSocket);
- don't forget after coding to debug the project
- i hope i explained good because i am not good explainer ..
- It is easier than LOTF
- All who know this before help other one if they ask questions because i will go now ..
- Press thanks if you like this guide ..