[Guide]Adding a NPC and editing his direction

Joined
Jun 1, 2009
Messages
4
Reaction score
0
Hi to everybody.Today I decided to make a guide about how to add your NPCs into the city you wish.
Lets start:
Lets say you have a script like this:
function lol_telep()

--MAP teleporter
local ReSelectTalk = "I need to reconsider"
local ReSelectPage = 1

--cancel talk
local CancelSelectTalk = "Forget it, I will stay here"
local CancelSelectPage = 2

--maps
local CurMapName1 = "garner"
local CurMapName2 = "magicsea"
local CurMapName3 = "eastgoaf"
local CurMapName4 = "lonetower"
local CurMapName5 = "darkblue"
local CurMapName6 = "abandonedcity"
local CurMapName7 = "puzzleworld"
local CurMapName9 = "hell"
etc...
And you want to put your NPC into a city,but you don't know how!
I will explain it for you.
So,as you see,the script starts with this
function lol_telep()
That is the function you MUST put in every NPC line.
So,a default line will be like this:
0 npc name 1 11 7 xxxx00,yyyy00 xxxx00,yyyy00 180 Argent City 1 0 function 0
As you can see,I bolded two things:
11
and function
Ok.Now I will explain what are that supposed to mean:
The 11 is the NPC look.
For changing a look,go to your characterinfo.txt from your server files,and find the ID of wich NPC you want to look like.
Lets say you take the Lance look.
Lance code is like this
1 Long Haired Guy Long Haired Guy 1 1 0 0 100 2000 0255 0464 0640 0816 0 0 0 0 0 0 1 1 100 182 -1 -1 0 0 0 1,2,3,4,7,8 1.051 1.369 2.599 40 1,5 0 399 398 0 0 0 1 1 0 0 25,28,29,30,31,34,35,38 100 0 0 0 0 0 0 0 1 1 1000 0 0 1 0 1 40 0 18 0 4 5 0 3 2 1 1 0 1 1 1442 0 1500 480 0 5 5 5 5 5 5 20 0 0 0 0 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
The thing I bolded is 1
Ok.Now as I sayd up,At the NPC line:
As you can see,I bolded two things:
11
and function
So,the 11 is the NPC look,if you change it into 1,it will look differently.So,if you changed it into 1 it will look like this:
0 npc name 1 1 7 xxxx00,yyyy600 xxxx00,yyyy00 180 Argent City 1 0 function 0
Ok.Done,now the function thing.
As I told you,every script begins with a function.
In my case,my script begins with
function lol_telep()
Ok.Now the thing I function in the NPC line,must BE PLACED EXACTLY WITH THE FUNCTION IN THE SCRIPT.
Ok,understood?
Now,the xxxx00 and yyyy00 explanation:
xxxx00 and yyyy00 are the coords you get in game,lets say you want to place your npc at 2738,2837.
Ok,so you must replace xxxx with the first coord,wich in our case is 2738,and yyyy with the other coords,in our case 2837.
BUT,make sure after the xxxx and yyyy coords you put 00,its NECESARELLY.
So,if you changed how I say,it will look like this
278300,283700
You must replace the xxxx00 and yyyy00 in the NPC line with the coords you want,REMEMBER,DO NOT DELETE THE 00.
OK,another important thing.As you noticed,I wrote there Argent City.
Question:Why?
Answer:Because,you need to put the full name of the map,or it won't work.
Example:If you want to put in icicle,you must replace Argent City with Icicle Castle,
Its a MUST.
Ok,so after you've done all those changes your NPC line should look like this:
npc name 1 1 7 278300,283700 278300,283700 180 Icicle Castle 1 0 lol_telep 0
But the 0 MUST be there.
NOTICE:The "()" from the functions mustn't be in the npc line or it won't work!

This is all.More guides coming soon.
Credits:To me.
Hope it helped ;)
 
Short guide for the noobs(Don't take it as a insult)
__________________________________________
Yet,I made another guide,but this is about changing a NPC direction look,it's short but may be helpfull!
So,lets start:
You NPC line is like this:
0 Argent Teleporter And More 1 11 7 218700,277600 218700,277600 180 Argent City 1 0 lol_telep 0
So,if you want to change a NPC look watch this 180.
Ok,so,we take 180 as 180 degrees.
It's like at geometry.At 180 degrees is facing down,at 90 is facing up,at 45 is facing right and at 135 is facing left.
So try to change 180 into,lest say 90.
Your NPC line should look like this after you changed it:
0 Argent Teleporter And More 1 11 7 218700,277600 218700,277600 90 Argent City 1 0 lol_telep 0
Ok,SHORT:
The 6th column from a NPC line is the NPC facing direction,it's degrees based,so think a little at geometry where you are making triangles :P
Hope it helped.
Credits:To me.
 
Back