• 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!

A npc doesn't work

christiandb

Member
Joined
Feb 5, 2008
Messages
2,469
Reaction score
5
Location
010
Code:
<?xml version="1.0"?>
<npc name="Daniel Steelsoul" walkinterval="2000" floorchange="0">
<health now="150" max="150"/>
  <look type="57" head="20" body="30" legs="40" feet="50" corpse="6080"/>

<interaction range="3" idletime="0" defaultpublic="0">

<interact keywords="hi" focus="1">
<!--These are the alternative keywords-->
<keywords>hello</keywords>

<response text="Hello |NAME|."/>
</interact>

<interact keywords="bye" focus="0">
<keywords>farewell</keywords>
<response text="Good job!">
<!--
<action name="script">
doRemoveCreature(getNpcCid());
</action>
-->
</response>
</interact>

<interact event="onPlayerLeave" focus="0">
<response text="It was a pleasure to help you |NAME|."/>
</interact>

<!--Example of using storage values, storageComp can be less/lessorequal/equal/greater/greaterorequal-->
<!--In this example it checks if the storage value of 5500 is less than 0-->
<!--Another way to write it would be storageValue="-1" storageComp="equal"-->
<!--Basically we check if the storage id of 5500 is -1, ie. not having any value yet.-->
<interact keywords="mission" storageId="1850" storageValue="0" storageComp="less">
<response text="Very good, we need heroes like you to go on a suici.....er....to earn respect of the authorities here AND in addition get a great reward for it. Are you interested in the job?">
<interact keywords="yes">
<response text="Very well, maybe you know that the orcs here in Edron learnt to raise giant spiders. It is going to become a serious threat. The mission is simple: go to the orcs and destroy all spider eggs that are hatched by the giant spider they have managed to catch. The orcs are located in the south of the western part of the island.">
<action name="storage" key="1850" value="1"/>
</response>
</interact>
</response>
</interact>

<interact keywords="demon;oak" storageId="21545" storageValue="1" storageComp="equal">
<response text="You already know my secret, now leave me alone!">
<action name="idle" value="1"/>
</response>
</interact>
<!-->End of example of using storage value-->

</interaction>

</npc>

Anyone knows why it doesn't work?
 
Well my NPC script looks pretty different, you could use this as standard perhaps and it may work better?

Code:
<npc name="Retronkx" script="data/npc/scripts/backpacks.lua" walkinterval="1500" floorchange="0" access="5" level="1" maglevel="1">
        <look type="57" head="78" body="61" legs="52" feet="114"/>
	<parameters>
		<parameter key="message_farewell" value="Have a nice day, |PLAYERNAME|." />
		<parameter key="message_greet " value= "I greet you, |PLAYERNAME|." />
		<parameter key="message_idletimeout" value= "Have a nice day, |PLAYERNAME|." />
		<parameter key="message_walkaway" value= "If you don't want to say goodbye, go your way."/>
		<parameter key="message_alreadyfocused" value="I am still listening to you."/>
		<parameter key="message_placedinqueue" value="Sorry, I am still talking to somebody else, |PLAYERNAME|."/>
		<parameter key="message_onsell" value="Thanks alot! Hope you come and visit me again!"/>
		<parameter key="message_nothaveitem" value="Stop trying to trick me and bring som backpacks!"/>

		<parameter key="module_shop" value="1" />
  		<parameter key="shop_sellable" value="brown,1988,150;purple,2001,150;blue,2002,150;gray,2003,150;white,2003,150;grey,2003,150;red,2000,150;yellow,2004,150;green,1998,150" />

		<parameter key="module_keywords" value="1" />
		<parameter key="keywords" value="offer;job;name"/>
		
		<parameter key="keyword_reply1" value="I don't got anything to offer, but if you got any backpacks I would love to buy them!" />
		<parameter key="keyword_reply2" value="I am a crazy dude from Thais." />
		<parameter key="keyword_reply3" value="My name is Retronkx." />
	</parameters>
</npc>

I see your NPC is playing with storage values, which mine ain't, so not sure what to do, but I think I would try to fix this in the lua part.
 
I don't know how to script NPC's and I can't find any tutorial for making scripted NPC's for quests :s. Could you PM me an example of a NPC that is adding/checking storage valueas?
 
Back
Top Bottom