• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

NPC Quest NPC xml only

Omen

New Member
Joined
Sep 11, 2008
Messages
70
Reaction score
0
PHP:
- <npc name="Jacks Friend" floorchange="0" walkinterval="2000">
  <health now="1" max="1" /> 
  <look type="131" head="114" body="114" legs="95" feet="58" addons="2" /> 
- <interaction range="3" idletime="30">
  local pos = 0 setPlayerStorageValue(cid, 2379, 1) 
- <interact keywords="hi" focus="1">
  <keywords>hello</keywords> 
  <keywords>greet</keywords> 
- <response>
- <action name="script">
- <![CDATA[     
                            if(getPlayerStorageValue(cid, 2379))  == 2 then
                                selfSay("You have already given me the knife!")
                            elseif(getPlayerItemCount(cid,2379)) == 1 then
                                selfSay("You have escaped! And you have my friends knife! Thank you so much for bringing it to me.")
                                doPlayerTakeItem(cid,2379,1)
                                doPlayerAddExp(cid,4200)
                                setPlayerStorageValue(cid, 2379, 2)
                            else
                                selfSay("Wheres my friends knife?")
                                _state.isidle = true
                                pos = {x=26, y=56, z=10}
                                doTeleportThing(cid, pos)
                                doSendMagicEffect(newPos, 10)
                            end
                        
  ]]> 
  </action>
  </response>
  </interact>
- <interact keywords="bye" focus="0">
  <keywords>farewell</keywords> 
  <response text="Good bye. Safe journey to you." /> 
  </interact>
- <interact event="onBusy">
- <response text="Please give me a moment!">
  <action name="addqueue" value="|PLAYER|" /> 
  </response>
  </interact>
- <interact event="onPlayerLeave" focus="0">
  <response text="Thanks for your help!" /> 
  </interact>
  </interaction>
  </npc>

Really easy to change as its short and consise. It checks to make sure you havnt done the quest, checks for the item, then if you dont have the item teleports you back to a zone where u can find the item. (or in the case of our server, back to the start of the zone to pick it up where they might have dropped it) he gives experience on quest completion, I spent 8 hours searching for a tutorial on how to do this, well here it is. Quest NPC that gives exp.
 
No problem, nice to see someone benefit from my hours of learning experience! xD
 
Back
Top