Jump to content
Sign in to follow this  
Juan

[Guide]Add New Npc

Recommended Posts

How to add a new npc?

 

1.

 

[*] Go to resourse/MapName/MapNameNpc.txt

 

For example, this is my map npc: owlnpc.txt

 

//Each line is explained here
//Serial	NPC Name	NPC Type	Chrindex ID	Show Mini-map	Coordinates starting point	Coordination Goal	NPC placement	Region	Region ID	NPC Script	info manage	Test Status
0	Legendary Guide	1	778	13	15100,10100	15100,10100	180	Owl City	1	0	NewbieGuide	0

 

[*]Add a new npc:

 

//Each line is explained here
//Serial	NPC Name	NPC Type	Chrindex ID	Show Mini-map	Coordinates starting point	Coordination Goal	NPC placement	Region	Region ID	NPC Script	info manage	Test Status
0	Legendary Guide	1	778	13	15100,10100	15100,10100	180	Owl City	1	0	NewbieGuide	0
1	New Npc	1	YY	13	XXXX,XXXX	XXXX,XXXX	EEE	WWWW	1	0	NewNpc	0

 

YY = You can choose in characterinfo.txt ( resourse/characterinfo.txt )

 

Optional :

You can use &summon to see the character texture if you want to choose. For example: I want to my "New Npc" looks like Wu Xin, in my characterinfo Wu Xin = "733", lets &summon.

 

cap00002.jpg

 

So in this case YY = 733.

 

XXXX,XXXX = Coords to place npc. You can get them with &qcha "Your character name" . For example:

 

cap00003.jpg

 

So in this case XXXX,XXXX = 27125,38075

 

EE = Its where you want to your npc look. Play with it. For example: In this case i want to my npc look to the sea. In my case EE= 120

 

WWWW = Your map city name. You can find it in resourse/areaset.txt. In my case WWWW = Owl City

 

NewNpc = Npc function, you can add it in resourse/script/MisScript/NpcScript01.lua (you can add in any NpcScript0X.lua)

 

In this case:

function NewNpc ()

	Talk( 1, "Well Done!" )

end

 

Well, lets set the npc. resourse/MapName/MapNameNpc.txt

 

//Each line is explained here
//Serial	NPC Name	NPC Type	Chrindex ID	Show Mini-map	Coordinates starting point	Coordination Goal	NPC placement	Region	Region ID	NPC Script	info manage	Test Status
0	Legendary Guide	1	778	13	15100,10100	15100,10100	180	Owl City	1	0	NewbieGuide	0
1	New Npc	1	733	13	27125,38075	27125,38075	120	Owl City	1	0	NewNpc	0

 

 

And here is it!:

 

cap00008.jpg

 

cap00014.jpg

 

I made this guide because a @soilder12 request!

 

Good luck!.

  • Like 6

Share this post


Link to post
Share on other sites

If you want to make a trade npc:

function NewNpc ()
    Talk( 1, "Normal Seller" ) 
    Text( 1, "Trade", BuyPage) 
    Text( 1, "Nothing...",  CloseTalk)
    InitTrade()
	Weapon(	ItemID	)
	Defence(	ItemID	)
	Other(	ItemID	)

end

if you want to make a rep npc:

 

function NewRep()
	Talk( 1, "Exchanger Rep for Item!" )
	Text( 1, "Exchange Item", JumpPage, 2 )

	Talk(2,"Do you want to exchange YYYY REP for XXXX item?")
	InitTrigger()
	TriggerCondition( 1, HasCredit,YYYY )
	TriggerCondition( 1, HasLeaveBagGrid, 1 )
	TriggerCondition( 1, KitbagLock, 0 )
	TriggerAction( 1, DelRoleCredit,YYYY )
	TriggerAction( 1, GiveItem, XXXX,1,4 )
	TriggerFailure( 1, JumpPage, 3)
	Text(2,"XXXX Item for YYYY reputation points" ,MultiTrigger,GetMultiTrigger(),1)

	Talk( 3, "Sorry, you do not have the required Reputations Points. I cannot exchange it for you." )

end		

 

if you want to make a exchanger npc:

 

function NewExchanger()
	Talk( 1, "Exchanger" )
	Text( 1, "Exchange",SendExchangeData )
	Text( 2, "Close.", CloseTalk )
	InitExchange()
ExchangeData( XXX , YY , EEEE , LL , 1)

end	

 

now go to resourse/script/calculate/variable.lua and serch for: ChangeItemList = {}

and add the same items that u added 

ChangeItemList = {}
ChangeItemList[    1    ]=    {    XXXX    ,    YY    ,    EEEE    ,    LL    }

 

[*] XXXX = ItemID Requiered.
[*] YY= XXXX Requiered quantity
[*] EEEE = ItemID that player will get.
[*] LL = EEEE Requiered quantity.

 

Edited by Juan
  • Like 4

Share this post


Link to post
Share on other sites

 

On 7/20/2016 at 10:39 PM, Juan said:

[*] Go to resourse/MapName/MapNameNpc.txt

 

excuse me but i went to resourse on my server files i did not fined the (MapName) file or the MapNameNpc,txt 

or i miss understanding idk 

Share this post


Link to post
Share on other sites
On ٢١‏/٧‏/٢٠١٦ at 1:09 AM, Juan said:

If you want to make a trade npc:


function NewNpc ()
    Talk( 1, "Normal Seller" ) 
    Text( 1, "Trade", BuyPage) 
    Text( 1, "Nothing...",  CloseTalk)
    InitTrade()
	Weapon(	ItemID	)
	Defence(	ItemID	)
	Other(	ItemID	)

end

 

how i can another item id on the same page ?  i  opened another Parentheses not work ? 

 

Share this post


Link to post
Share on other sites
20 hours ago, AnaMutaz said:

 

how i can another item id on the same page ?  i  opened another Parentheses not work ? 

 

It is just the same script :

    InitTrade()

Weapon( ItemID )

Defence( ItemID )

Other( ItemID )

 

--Weapon/Defence/Other are the third pages of the npc

 

by duplicating the line you add a second,third etc.

 

it goes like this

Weapon( ItemID )

Weapon( ItemID )

Weapon( ItemID )

= three items on the weapon page.

 

GL and HF.

 

Share this post


Link to post
Share on other sites

i got some problem on making npc,
when i try to use  &qcha it worked once but when i tried it again nothing shows on system.
anyone got any idea on how to fix this?
thank you so much!! 😔

Edited by Tempest

Share this post


Link to post
Share on other sites
1 hour ago, nitrovski said:

Hi, do you know how to compile this TXT file with to bin? I changed NPC in my garnernpc.txt but I need to compile it to bin probably

no, you don't

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...