Super-Moderator
Staff member
Super-Moderator
- Joined
- Apr 28, 2007
- Messages
- 1,501
- Reaction score
- 759
Hello.
I made this guide because.. I want to make a guide, lol...
I think this works for all server sources. ( Especially Kryt's )
Ok, we're going to take Duey the packakge deliverer. ( You can allways change if you want )
Open TeleportNPCs.cpp ( I made it there, not sure if it will work if you make a own .cpp )
Go down, and put this code :
If you want more GM names, then add the code ( above npc->sendSimple(); )
Then add this :
The code before was with L5 instead of L6, if you want more then add a new text again, and call it L7, L8, L9, etc.
Ok now we're done with that
then add below
So the code will look like this now :
If you want more GM information ( If you added more GM's )
Now change
To
And add code ( this is the last one, I mean the last line, you can add more but then you need to do
Instead of
For line 6 put this code
Put that below the Line 5, above the code
Now open NPCsScripts.h
And find this code :
But below that code :
Now search for :
But below that code :
To change of NPC, then just change the npc_9010009 to a another ID ( npc_npcid ) at the Duey code, and the static void, and break
Need help? Just reply.
Credits :
Carter ( Biesmen ( me ) )
[/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE]
I made this guide because.. I want to make a guide, lol...
I think this works for all server sources. ( Especially Kryt's )
Ok, we're going to take Duey the packakge deliverer. ( You can allways change if you want )
Open TeleportNPCs.cpp ( I made it there, not sure if it will work if you make a own .cpp )
Go down, and put this code :
Code:
[SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][SIZE=2] NPCsScripts::npc_9010009(NPC* npc){
[/SIZE][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][SIZE=2] state = npc->getState();
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](state == 0){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"Hello, I am Duey. I can tell you who the GM's are. I allways follow them, so I collected some information"[/COLOR][/SIZE][SIZE=2]);
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]" Click on the names for information about them."[/COLOR][/SIZE][SIZE=2]);
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L0#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L1#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L2#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L3#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L4#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L5#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->sendSimple();
}
If you want more GM names, then add the code ( above npc->sendSimple(); )
Then add this :
Code:
npc->addText([SIZE=2][COLOR=#a31515]"\r\n#L6#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here[/SIZE]
Ok now we're done with that
then add below
Code:
[SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](state == 1){
type = npc->getSelected();
npc->setVariable([/SIZE][SIZE=2][COLOR=#a31515]"type"[/COLOR][/SIZE][SIZE=2], type);
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 0){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L0 ( Line 0 )[/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#000000][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 1){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L1
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 2){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L2
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 3){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L3[/SIZE][SIZE=2]
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 4){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE"[/COLOR][/SIZE][SIZE=2]); \\ This is L4
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 5){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L5
npc->sendOK();
}
}
[/SIZE][SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](state == 2){
npc->end();
}
}
So the code will look like this now :
Code:
[COLOR=#0000ff] [/COLOR]
void[SIZE=2] NPCsScripts::npc_9010009(NPC* npc){
[/SIZE][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][SIZE=2] state = npc->getState();
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](state == 0){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"Hello, I am Duey. I can tell you who the GM's are. I allways follow them, so I collected some information"[/COLOR][/SIZE][SIZE=2]);
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]" Click on the names for information about them."[/COLOR][/SIZE][SIZE=2]);
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L0#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L1#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L2#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L3#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L4#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"\r\n#L5#NAME#l"[/COLOR][/SIZE][SIZE=2]); \\ Add GM name here
npc->sendSimple();
}
[COLOR=#0000ff] [/COLOR]else[SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](state == 1){
type = npc->getSelected();
npc->setVariable([/SIZE][SIZE=2][COLOR=#a31515]"type"[/COLOR][/SIZE][SIZE=2], type);
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 0){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L0 ( Line 0 )[/SIZE] [SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#000000][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 1){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L1
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 2){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L2
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 3){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L3[/SIZE][SIZE=2]
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 4){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE"[/COLOR][/SIZE][SIZE=2]); \\ This is L4
npc->sendOK();
}
[/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 5){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L5
npc->sendOK();
}
}
[/SIZE][SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](state == 2){
npc->end();
}
}
If you want more GM information ( If you added more GM's )
Now change
Code:
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 5){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L5
npc->sendOK();
}
}
Code:
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 5){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L5
npc->sendOK();
}
And add code ( this is the last one, I mean the last line, you can add more but then you need to do
Code:
}
Code:
}
}
For line 6 put this code
Code:
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](type == 6){
npc->addText([/SIZE][SIZE=2][COLOR=#a31515]"GM INFORMATION HERE "[/COLOR][/SIZE][SIZE=2]); \\ This is L6
npc->sendOK();
}
}
Code:
[SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2](state == 2){
npc->end();
}
}
[/SIZE]
Now open NPCsScripts.h
And find this code :
Code:
case 9200000: npc_9200000(npc); break;
But below that code :
Code:
case 9010009: npc_9010009(npc); break;
Now search for :
Code:
static void npc_9200000(NPC* npc)
But below that code :
Code:
static void npc_9010009(NPC* npc);
To change of NPC, then just change the npc_9010009 to a another ID ( npc_npcid ) at the Duey code, and the static void, and break
Need help? Just reply.
Credits :
Carter ( Biesmen ( me ) )
[/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE]
Last edited: