• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Npc help!

knightxd

Member
Joined
Feb 21, 2009
Messages
211
Reaction score
16
Location
Rio de Janeiro
Look, how can i change the words to one npc greet,
like the queen on carlin or king in thais that only responds HAIL instead of hi or hello..

anyone know the code?

thank you for reading!
 
You can set it in parameters (.xml file):
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="King Xxxxx" script="data/npc/scripts/promotion.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="132" head="20" body="39" legs="45" feet="7"/>
	<parameters>
		<parameter key="message_greet" value="HAIL |PLAYERNAME|!"/>
		<parameter key="message_walkaway" value="See you later!"/>
		<parameter key="module_keywords" value="1" />
		<parameter key="keywords" value="job;offer" />
		<parameter key="keyword_reply1" value="I'm king of Thais." />
		<parameter key="keyword_reply2" value="I give promotion to players with 20 lvl." />
	</parameters>
</npc>
or only add line:
PHP:
<parameter key="message_greet" value="HAIL!"/>
You can set it in script (.lua file):
Add before:
PHP:
npcHandler:addModule(FocusModule:new())
Code:
PHP:
npcHandler:setMessage(MESSAGE_GREET, 'Hail |PLAYERNAME|!')
or:
PHP:
npcHandler:setMessage(MESSAGE_GREET, 'HAIL!')
 
I think he meant how to set those without modifying modules.lua..
Code:
	-- default words for greeting and ungreeting the npc. Should be a table containing all such words.
	[B]FOCUS_GREETWORDS = {'hi', 'hello', 'hey'}[/B]
	FOCUS_FAREWELLWORDS = {'bye', 'farewell', 'cya'}
I have no idea :f
 
I think he meant how to set those without modifying modules.lua..
Code:
	-- default words for greeting and ungreeting the npc. Should be a table containing all such words.
	[B]FOCUS_GREETWORDS = {'hi', 'hello', 'hey'}[/B]
	FOCUS_FAREWELLWORDS = {'bye', 'farewell', 'cya'}
I have no idea :f

If he did that, it would be for all NPC's.
Gesior was correct. :thumbup:
 
You can set it in parameters (.xml file):
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="King Xxxxx" script="data/npc/scripts/promotion.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="132" head="20" body="39" legs="45" feet="7"/>
	<parameters>
		<parameter key="message_greet" value="HAIL |PLAYERNAME|!"/>
		<parameter key="message_walkaway" value="See you later!"/>
		<parameter key="module_keywords" value="1" />
		<parameter key="keywords" value="job;offer" />
		<parameter key="keyword_reply1" value="I'm king of Thais." />
		<parameter key="keyword_reply2" value="I give promotion to players with 20 lvl." />
	</parameters>
</npc>
or only add line:
PHP:
<parameter key="message_greet" value="HAIL!"/>
You can set it in script (.lua file):
Add before:
PHP:
npcHandler:addModule(FocusModule:new())
Code:
PHP:
npcHandler:setMessage(MESSAGE_GREET, 'Hail |PLAYERNAME|!')
or:
PHP:
npcHandler:setMessage(MESSAGE_GREET, 'HAIL!')


this will make the npc responds HAIL PLAYER, thats easy haha
but i want the player call a npc with HAIL

when he sais hi or hello the npc still walking with no action, and then when he sais HAIL the npc start module... like

Code:
Player: hello/hi
-- nothing happens
Player: Hail king/queen
NPC: HAIL |PLAYERNAME|.

are there anyway to script it? ;)
 
Back
Top