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

Solved Oracle x/y/z on a custom map?

Muzzy

New Member
Joined
Jul 8, 2008
Messages
125
Reaction score
1
Hey, sorry if this is an elementary question, but I'm afraid I have not a shred of experience when it comes to scripting.

Here goes, how do I change the Oracle to send me to a custom town? I've looked through the xml but I can't find any simple x/y/z that I can change to make it send me to where I want, so I assume it goes a lot deeper than that.

Thanks in advance!

Also, does anyone know if there's a way to make monsters walk back to their spawn after being lured and losing their target? To prevent lurers, kind of.

Code:
<npc name="The Oracle" floorchange="0" walkinterval="2000">
	<health now="150" max="150"/>
	<look type="138" head="57" body="59" legs="40" feet="76" addons="0"/>
	<interaction range="3" idletime="30">
		<interact keywords="hi" focus="1">
			<!--These are the keywords will trigger this interaction-->
			<keywords>hello</keywords>
			<keywords>greet</keywords>

			<response>
				<action name="script">
					<![CDATA[
						if(getPlayerLevel(cid)) >= 8 then
							selfSay(getCreatureName(cid) .. ", ARE YOU PREPARED O FACE YOUR DESTINY?")
							_state.b1 = (isPremium(cid) == TRUE)
							_state.topic = 1
						else
							selfSay("CHILD! COME BACK WHEN YOU HAVE GROWN UP!")
							_state.isidle = true
						end
					]]>
				</action>
			</response>
		</interact>

		<interact keywords="yes" topic="1">
			<!--Premium account, b1 is set in above-->
			<response b1="1" text="IN WHICH TOWN DO YOU WANT TO LIVE: CARLIN, EDRON, THAIS, OR VENORE?">
				<action name="topic" value="2"/>
			</response>

			<!--Normal account-->
			<response text="IN WHICH TOWN DO YOU WANT TO LIVE: CARLIN, THAIS, OR VENORE?">
				<action name="topic" value="2"/>
			</response>
		</interact>

		<interact keywords="carlin" topic="2">
			<response text="IN CARLIN! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<![CDATA[
						_state.n1 = 1
						_state.topic = 3
					]]>
				</action>
			</response>
		</interact>

		<interact keywords="thais" topic="2">
			<response text="IN THAIS! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<![CDATA[
						_state.n1 = 2
						_state.topic = 3
					]]>
				</action>
			</response>
		</interact>

		<interact keywords="venore" topic="2">
			<response text="IN VENORE! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<![CDATA[
						_state.n1 = 3
						_state.topic = 3
					]]>
				</action>
			</response>
		</interact>

		<interact keywords="edron" topic="2">
			<response text="YOU NEED A PREMIUM ACCOUNT IN ORDER TO GO THERE!">
				<!--Set the topic back to 2, ie. choose a new town.-->
				<action name="topic" value="2"/>
			</response>
			<!--b1: premium account, see <interact keywords="hi" focus="1"> where _state.b1 is is set.-->
			<response b1="1" text="IN EDRON! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<![CDATA[
						_state.n1 = 3
						_state.topic = 3
					]]>
				</action>
			</response>
		</interact>

		<!--If the player does not say any city, repeat our question-->
		<interact keywords="|*|" topic="2">
			<response b1="1" text="CARLIN, EDRON, THAIS, OR VENORE?"/>
			<response text="CARLIN, EDRON, THAIS, OR VENORE?"/>
		</interact>

		<interact keywords="sorcerer" topic="3">
			<response text="A SORCERER! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<![CDATA[
						_state.n2 = 1
						_state.topic = 4
					]]>
				</action>
			</response>
		</interact>

		<interact keywords="druid" topic="3">
			<response text="A DRUID! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<![CDATA[
						_state.n2 = 2
						_state.topic = 4
					]]>
				</action>
			</response>
		</interact>

		<interact keywords="paladin" topic="3">
			<response text="A PALADIN! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<![CDATA[
						_state.n2 = 3
						_state.topic = 4
					]]>
				</action>
			</response>
		</interact>

		<interact keywords="knight" topic="3">
			<response text="A KNIGHT! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<![CDATA[
						_state.n2 = 4
						_state.topic = 4
					]]>
				</action>
			</response>
		</interact>

		<!--If the player does not say any profession, repeat our question-->
		<interact keywords="|*|" topic="3">
			<response text="KNIGHT, PALADIN, SORCERER, OR DRUID?"/>
		</interact>

		<interact keywords="yes" topic="4">
			<response>
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<!--n2: 1 = knight, 2 = paladin, 3 = sorcerer, 4 = druid-->
				<action name="script">
					<![CDATA[
						local pos = 0
						if(_state.n1 == 1) then
							pos = {x=180, y=233, z=7}
						elseif(_state.n1 == 2) then
							pos = {x=180, y=233, z=7}
						elseif(_state.n1 == 3) then
							pos = {x=180, y=233, z=7}
						elseif(_state.n1 == 4) then
							pos = {x=180, y=233, z=7}
						else
							selfSay("I DO NOT KNOW WHAT PROFESSION THAT IS, ASK THE GODS FOR GUIDANCE!")
							return
						end

						selfSay("SO BE IT!")
						doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)

						if(doTeleportThing(cid, pos) == 0) then
							doPlayerSetTown(cid, _state.n1)
							doPlayerSetVocation(cid, _state.n2)
							doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
						end
					]]>
				</action>
				<action name="idle" value="1"/>
			</response>
		</interact>

		<interact keywords="bye" focus="0">
			<keywords>farewell</keywords>
			<response text="Good bye. Recommend us, if you were satisfied with our service."/>
		</interact>

		<interact event="onBusy">
			<response text="WAIT UNTIL IT IS YOUR TURN!">
				<action name="addqueue" value="|PLAYER|"/>
			</response>
		</interact>

		<!--This event triggers if the player goes to far away from the npc/logout/idle timeout-->
		<interact event="onPlayerLeave" focus="0">
			<response text="COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!"/>
		</interact>
	</interaction>
</npc>
 
Last edited:
Search For This Line

Code:
if(doTeleportThing(cid, pos) == 0) then

And Replace it with
Code:
if(doTeleportThing(cid,{x=,y=,z=}))

this will work..if you said thais or venore or any other town
 
Thanks for the quick answer, but I can't seem to be able to greet her in any way. I assume this is because it's a custom map, how do I go from here? I've tried throwing in a fresh oracle from the zip file, but still no luck.

When I say hi nothing happens, and when I made her look like a normal human she looked at me when I said hi but didn't respond. I've tried this with both a level 1 and an 8.
 
Lua:
<npc name="The Oracle" floorchange="0" walkinterval="2000">
	<health now="150" max="150"/>
	<look type="138" head="57" body="59" legs="40" feet="76" addons="0"/>
	<interaction range="3" idletime="30">
		<interact keywords="hi" focus="1">
			<!--These are the keywords will trigger this interaction-->
			<keywords>hello</keywords>
			<keywords>greet</keywords>

			<response>
				<action name="script">
					<![CDATA[
						if(getPlayerLevel(cid)) >= 8 then
							selfSay(getCreatureName(cid) .. ", ARE YOU PREPARED O FACE YOUR DESTINY?")
							_state.b1 = (isPremium(cid) == TRUE)
							_state.topic = 1
						else
							selfSay("CHILD! COME BACK WHEN YOU HAVE GROWN UP!")
							_state.isidle = true
						end
					]]>
				</action>
			</response>
		</interact>

		<interact keywords="yes" topic="1">
			<!--Premium account, b1 is set in above-->
			<response b1="1" text="IN WHICH TOWN DO YOU WANT TO LIVE: CARLIN, EDRON, THAIS, OR VENORE?">
				<action name="topic" value="2"/>
			</response>

			<!--Normal account-->
			<response text="IN WHICH TOWN DO YOU WANT TO LIVE: CARLIN, THAIS, OR VENORE?">
				<action name="topic" value="2"/>
			</response>
		</interact>

		<interact keywords="carlin" topic="2">
			<response text="IN CARLIN! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<![CDATA[
						_state.n1 = 1
						_state.topic = 3
					]]>
				</action>
			</response>
		</interact>

		<interact keywords="thais" topic="2">
			<response text="IN THAIS! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<![CDATA[
						_state.n1 = 2
						_state.topic = 3
					]]>
				</action>
			</response>
		</interact>

		<interact keywords="venore" topic="2">
			<response text="IN VENORE! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<![CDATA[
						_state.n1 = 3
						_state.topic = 3
					]]>
				</action>
			</response>
		</interact>

		<interact keywords="edron" topic="2">
			<response text="YOU NEED A PREMIUM ACCOUNT IN ORDER TO GO THERE!">
				<!--Set the topic back to 2, ie. choose a new town.-->
				<action name="topic" value="2"/>
			</response>
			<!--b1: premium account, see <interact keywords="hi" focus="1"> where _state.b1 is is set.-->
			<response b1="1" text="IN EDRON! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<![CDATA[
						_state.n1 = 3
						_state.topic = 3
					]]>
				</action>
			</response>
		</interact>

		<!--If the player does not say any city, repeat our question-->
		<interact keywords="|*|" topic="2">
			<response b1="1" text="CARLIN, EDRON, THAIS, OR VENORE?"/>
			<response text="CARLIN, EDRON, THAIS, OR VENORE?"/>
		</interact>

		<interact keywords="sorcerer" topic="3">
			<response text="A SORCERER! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<![CDATA[
						_state.n2 = 1
						_state.topic = 4
					]]>
				</action>
			</response>
		</interact>

		<interact keywords="druid" topic="3">
			<response text="A DRUID! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<![CDATA[
						_state.n2 = 2
						_state.topic = 4
					]]>
				</action>
			</response>
		</interact>

		<interact keywords="paladin" topic="3">
			<response text="A PALADIN! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<![CDATA[
						_state.n2 = 3
						_state.topic = 4
					]]>
				</action>
			</response>
		</interact>

		<interact keywords="knight" topic="3">
			<response text="A KNIGHT! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<![CDATA[
						_state.n2 = 4
						_state.topic = 4
					]]>
				</action>
			</response>
		</interact>

		<!--If the player does not say any profession, repeat our question-->
		<interact keywords="|*|" topic="3">
			<response text="KNIGHT, PALADIN, SORCERER, OR DRUID?"/>
		</interact>

		<interact keywords="yes" topic="4">
			<response>
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<!--n2: 1 = knight, 2 = paladin, 3 = sorcerer, 4 = druid-->
				<action name="script">
					<![CDATA[
						local pos = 0
						if(_state.n1 == 1) then
							pos = {x=180, y=233, z=7}
						elseif(_state.n1 == 2) then
							pos = {x=180, y=233, z=7}
						elseif(_state.n1 == 3) then
							pos = {x=180, y=233, z=7}
						elseif(_state.n1 == 4) then
							pos = {x=180, y=233, z=7}
						else
							selfSay("I DO NOT KNOW WHAT PROFESSION THAT IS, ASK THE GODS FOR GUIDANCE!")
							return
						end
local po = {x=,y=,z=}
						selfSay("SO BE IT!")
                                                doTeleportThing(cid, po) 
						doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)

						if isPlayer(cid) then
							doPlayerSetTown(cid, _state.n1)
							doPlayerSetVocation(cid, _state.n2)
							doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
						end
					]]>
				</action>
				<action name="idle" value="1"/>
			</response>
		</interact>

		<interact keywords="bye" focus="0">
			<keywords>farewell</keywords>
			<response text="Good bye. Recommend us, if you were satisfied with our service."/>
		</interact>

		<interact event="onBusy">
			<response text="WAIT UNTIL IT IS YOUR TURN!">
				<action name="addqueue" value="|PLAYER|"/>
			</response>
		</interact>

		<!--This event triggers if the player goes to far away from the npc/logout/idle timeout-->
		<interact event="onPlayerLeave" focus="0">
			<response text="COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!"/>
		</interact>
	</interaction>
</npc>

add this script and Search for Local po you will find coorindations
 
Lua:
<npc name="The Oracle" floorchange="0" walkinterval="2000">
	<health now="150" max="150"/>
	<look type="138" head="57" body="59" legs="40" feet="76" addons="0"/>
	<interaction range="3" idletime="30">
		<interact keywords="hi" focus="1">
			<!--These are the keywords will trigger this interaction-->
			<keywords>hello</keywords>
			<keywords>greet</keywords>

			<response>
				<action name="script">
					<=!=[=C=D=A=T=A=[
						if(getPlayerLevel(cid)) >= 8 then
							selfSay(getCreatureName(cid) .. ", ARE YOU PREPARED O FACE YOUR DESTINY?")
							_state.b1 = (isPremium(cid) == TRUE)
							_state.topic = 1
						else
							selfSay("CHILD! COME BACK WHEN YOU HAVE GROWN UP!")
							_state.isidle = true
						end
					]=]=>
				</action>
			</response>
		</interact>

		<interact keywords="yes" topic="1">
			<!--Premium account, b1 is set in above-->
			<response b1="1" text="IN WHICH TOWN DO YOU WANT TO LIVE: CARLIN, EDRON, THAIS, OR VENORE?">
				<action name="topic" value="2"/>
			</response>

			<!--Normal account-->
			<response text="IN WHICH TOWN DO YOU WANT TO LIVE: CARLIN, THAIS, OR VENORE?">
				<action name="topic" value="2"/>
			</response>
		</interact>

		<interact keywords="carlin" topic="2">
			<response text="IN CARLIN! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n1 = 1
						_state.topic = 3
					]=]=>
				</action>
			</response>
		</interact>

		<interact keywords="thais" topic="2">
			<response text="IN THAIS! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n1 = 2
						_state.topic = 3
					]=]=>
				</action>
			</response>
		</interact>

		<interact keywords="venore" topic="2">
			<response text="IN VENORE! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n1 = 3
						_state.topic = 3
					]=]=>
				</action>
			</response>
		</interact>

		<interact keywords="edron" topic="2">
			<response text="YOU NEED A PREMIUM ACCOUNT IN ORDER TO GO THERE!">
				<!--Set the topic back to 2, ie. choose a new town.-->
				<action name="topic" value="2"/>
			</response>
			<!--b1: premium account, see <interact keywords="hi" focus="1"> where _state.b1 is is set.-->
			<response b1="1" text="IN EDRON! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n1 = 3
						_state.topic = 3
					]=]=>
				</action>
			</response>
		</interact>

		<!--If the player does not say any city, repeat our question-->
		<interact keywords="|*|" topic="2">
			<response b1="1" text="CARLIN, EDRON, THAIS, OR VENORE?"/>
			<response text="CARLIN, EDRON, THAIS, OR VENORE?"/>
		</interact>

		<interact keywords="sorcerer" topic="3">
			<response text="A SORCERER! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n2 = 1
						_state.topic = 4
					]=]=>
				</action>
			</response>
		</interact>

		<interact keywords="druid" topic="3">
			<response text="A DRUID! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n2 = 2
						_state.topic = 4
					]=]=>
				</action>
			</response>
		</interact>

		<interact keywords="paladin" topic="3">
			<response text="A PALADIN! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n2 = 3
						_state.topic = 4
					]=]=>
				</action>
			</response>
		</interact>

		<interact keywords="knight" topic="3">
			<response text="A KNIGHT! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n2 = 4
						_state.topic = 4
					]=]=>
				</action>
			</response>
		</interact>

		<!--If the player does not say any profession, repeat our question-->
		<interact keywords="|*|" topic="3">
			<response text="KNIGHT, PALADIN, SORCERER, OR DRUID?"/>
		</interact>

		<interact keywords="yes" topic="4">
			<response>
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<!--n2: 1 = knight, 2 = paladin, 3 = sorcerer, 4 = druid-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						local pos = 0
						if(_state.n1 == 1) then
							pos = {x=180, y=233, z=7}
						elseif(_state.n1 == 2) then
							pos = {x=180, y=233, z=7}
						elseif(_state.n1 == 3) then
							pos = {x=180, y=233, z=7}
						elseif(_state.n1 == 4) then
							pos = {x=180, y=233, z=7}
						else
							selfSay("I DO NOT KNOW WHAT PROFESSION THAT IS, ASK THE GODS FOR GUIDANCE!")
							return
						end
local po = {x=,y=,z=}
						selfSay("SO BE IT!")
                                                doTeleportThing(cid, po) 
						doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)

						if isPlayer(cid) then
							doPlayerSetTown(cid, _state.n1)
							doPlayerSetVocation(cid, _state.n2)
							doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
						end
					]=]=>
				</action>
				<action name="idle" value="1"/>
			</response>
		</interact>

		<interact keywords="bye" focus="0">
			<keywords>farewell</keywords>
			<response text="Good bye. Recommend us, if you were satisfied with our service."/>
		</interact>

		<interact event="onBusy">
			<response text="WAIT UNTIL IT IS YOUR TURN!">
				<action name="addqueue" value="|PLAYER|"/>
			</response>
		</interact>

		<!--This event triggers if the player goes to far away from the npc/logout/idle timeout-->
		<interact event="onPlayerLeave" focus="0">
			<response text="COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!"/>
		</interact>
	</interaction>
</npc>

add this script and Search for Local po you will find coorindations

! Everything worked, but she didn't respond to "hi".

The conversation went like this:

06:20 New char [8]: hi
*she says nothing but looks at me*
06:20 New char [8]: yes
06:20 The Oracle: IN WHICH TOWN DO YOU WANT TO LIVE: CARLIN, EDRON, THAIS, OR VENORE?

I told her all the details and everything worked perfectly. How do I fix it so she responds to hi, though?

Also, this pops up in the server log:
[15/07/2013 06:20:39] Lua Script Error: [Npc interface]
[15/07/2013 06:20:39] loadBuffer
[15/07/2013 06:20:39] LuaScriptInterface::luaDoPlayerSetTown(). Not found townid
[15/07/2013 06:20:39] stack traceback:
[15/07/2013 06:20:39] [C]: in function 'doPlayerSetTown'
[15/07/2013 06:20:39] [string "loadBuffer"]:46: in main chunk

I've been expecting something like this to come up, how do I set an id to my town?
 
Last edited:
Lua:
<npc name="The Oracle" floorchange="0" walkinterval="2000">
	<health now="150" max="150"/>
	<look type="138" head="57" body="59" legs="40" feet="76" addons="0"/>
	<interaction range="3" idletime="30">
		<interact keywords="hi" focus="1">
			<!--These are the keywords will trigger this interaction-->
			<keywords>hello</keywords>
			<keywords>greet</keywords>
 
			<response>
				<action name="script">
					<=!=[=C=D=A=T=A=[
						if(getPlayerLevel(cid)) >= 8 then
							selfSay(getCreatureName(cid) .. ", ARE YOU PREPARED O FACE YOUR DESTINY?")
							_state.b1 = (isPremium(cid) == TRUE)
							_state.topic = 1
						else
							selfSay("CHILD! COME BACK WHEN YOU HAVE GROWN UP!")
							_state.isidle = true
						end
					]=]=>
				</action>
			</response>
		</interact>
 
		<interact keywords="yes" topic="1">
			<!--Premium account, b1 is set in above-->
			<response b1="1" text="IN WHICH TOWN DO YOU WANT TO LIVE: town?">
				<action name="topic" value="2"/>
			</response>
 
			<!--Normal account-->
			<response text="IN WHICH TOWN DO YOU WANT TO LIVE: town?">
				<action name="topic" value="2"/>
			</response>
		</interact>
 
		<interact keywords="town" topic="2">
			<response text="IN CARLIN! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n1 = 1
						_state.topic = 3
					]=]=>
				</action>
			</response>
		</interact>
 
		<interact keywords="town" topic="2">
			<response text="IN THAIS! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n1 = 2
						_state.topic = 3
					]=]=>
				</action>
			</response>
		</interact>
 
		<interact keywords="town" topic="2">
			<response text="IN VENORE! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n1 = 3
						_state.topic = 3
					]=]=>
				</action>
			</response>
		</interact>
 
		<interact keywords="town" topic="2">
			<response text="YOU NEED A PREMIUM ACCOUNT IN ORDER TO GO THERE!">
				<!--Set the topic back to 2, ie. choose a new town.-->
				<action name="topic" value="2"/>
			</response>
			<!--b1: premium account, see <interact keywords="hi" focus="1"> where _state.b1 is is set.-->
			<response b1="1" text="IN EDRON! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n1 = 3
						_state.topic = 3
					]=]=>
				</action>
			</response>
		</interact>
 
		<!--If the player does not say any city, repeat our question-->
		<interact keywords="|*|" topic="2">
			<response b1="1" text="town"/>
			<response text="town"/>
		</interact>
 
		<interact keywords="sorcerer" topic="3">
			<response text="A SORCERER! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n2 = 1
						_state.topic = 4
					]=]=>
				</action>
			</response>
		</interact>
 
		<interact keywords="druid" topic="3">
			<response text="A DRUID! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n2 = 2
						_state.topic = 4
					]=]=>
				</action>
			</response>
		</interact>
 
		<interact keywords="paladin" topic="3">
			<response text="A PALADIN! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n2 = 3
						_state.topic = 4
					]=]=>
				</action>
			</response>
		</interact>
 
		<interact keywords="knight" topic="3">
			<response text="A KNIGHT! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n2 = 4
						_state.topic = 4
					]=]=>
				</action>
			</response>
		</interact>
 
		<!--If the player does not say any profession, repeat our question-->
		<interact keywords="|*|" topic="3">
			<response text="KNIGHT, PALADIN, SORCERER, OR DRUID?"/>
		</interact>
 
		<interact keywords="yes" topic="4">
			<response>
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<!--n2: 1 = knight, 2 = paladin, 3 = sorcerer, 4 = druid-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						local pos = 0
						local po = {x=,y=,z=}
						if doTeleportThing(cid, po) then
						selfSay("SO BE IT!")
						doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
						return true
						end
						if isPlayer(cid) then
							doPlayerSetVocation(cid, _state.n2)
							doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
						end
					]=]=>
				</action>
				<action name="idle" value="1"/>
			</response>
		</interact>
 
		<interact keywords="bye" focus="0">
			<keywords>farewell</keywords>
			<response text="Good bye. Recommend us, if you were satisfied with our service."/>
		</interact>
 
		<interact event="onBusy">
			<response text="WAIT UNTIL IT IS YOUR TURN!">
				<action name="addqueue" value="|PLAYER|"/>
			</response>
		</interact>
 
		<!--This event triggers if the player goes to far away from the npc/logout/idle timeout-->
		<interact event="onPlayerLeave" focus="0">
			<response text="COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!"/>
		</interact>
	</interaction>
</npc>

Talk to Him and say town
 
Lua:
<npc name="The Oracle" floorchange="0" walkinterval="2000">
	<health now="150" max="150"/>
	<look type="138" head="57" body="59" legs="40" feet="76" addons="0"/>
	<interaction range="3" idletime="30">
		<interact keywords="hi" focus="1">
			<!--These are the keywords will trigger this interaction-->
			<keywords>hello</keywords>
			<keywords>greet</keywords>
 
			<response>
				<action name="script">
					<=!=[=C=D=A=T=A=[
						if(getPlayerLevel(cid)) >= 8 then
							selfSay(getCreatureName(cid) .. ", ARE YOU PREPARED O FACE YOUR DESTINY?")
							_state.b1 = (isPremium(cid) == TRUE)
							_state.topic = 1
						else
							selfSay("CHILD! COME BACK WHEN YOU HAVE GROWN UP!")
							_state.isidle = true
						end
					]=]=>
				</action>
			</response>
		</interact>
 
		<interact keywords="yes" topic="1">
			<!--Premium account, b1 is set in above-->
			<response b1="1" text="IN WHICH TOWN DO YOU WANT TO LIVE: town?">
				<action name="topic" value="2"/>
			</response>
 
			<!--Normal account-->
			<response text="IN WHICH TOWN DO YOU WANT TO LIVE: town?">
				<action name="topic" value="2"/>
			</response>
		</interact>
 
		<interact keywords="town" topic="2">
			<response text="IN CARLIN! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n1 = 1
						_state.topic = 3
					]=]=>
				</action>
			</response>
		</interact>
 
		<interact keywords="town" topic="2">
			<response text="IN THAIS! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n1 = 2
						_state.topic = 3
					]=]=>
				</action>
			</response>
		</interact>
 
		<interact keywords="town" topic="2">
			<response text="IN VENORE! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n1 = 3
						_state.topic = 3
					]=]=>
				</action>
			</response>
		</interact>
 
		<interact keywords="town" topic="2">
			<response text="YOU NEED A PREMIUM ACCOUNT IN ORDER TO GO THERE!">
				<!--Set the topic back to 2, ie. choose a new town.-->
				<action name="topic" value="2"/>
			</response>
			<!--b1: premium account, see <interact keywords="hi" focus="1"> where _state.b1 is is set.-->
			<response b1="1" text="IN EDRON! AND WHAT PROFESSION HAVE YOU CHOSEN: KNIGHT, PALADIN, SORCERER, OR DRUID?">
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n1 = 3
						_state.topic = 3
					]=]=>
				</action>
			</response>
		</interact>
 
		<!--If the player does not say any city, repeat our question-->
		<interact keywords="|*|" topic="2">
			<response b1="1" text="town"/>
			<response text="town"/>
		</interact>
 
		<interact keywords="sorcerer" topic="3">
			<response text="A SORCERER! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n2 = 1
						_state.topic = 4
					]=]=>
				</action>
			</response>
		</interact>
 
		<interact keywords="druid" topic="3">
			<response text="A DRUID! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n2 = 2
						_state.topic = 4
					]=]=>
				</action>
			</response>
		</interact>
 
		<interact keywords="paladin" topic="3">
			<response text="A PALADIN! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n2 = 3
						_state.topic = 4
					]=]=>
				</action>
			</response>
		</interact>
 
		<interact keywords="knight" topic="3">
			<response text="A KNIGHT! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
				<!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						_state.n2 = 4
						_state.topic = 4
					]=]=>
				</action>
			</response>
		</interact>
 
		<!--If the player does not say any profession, repeat our question-->
		<interact keywords="|*|" topic="3">
			<response text="KNIGHT, PALADIN, SORCERER, OR DRUID?"/>
		</interact>
 
		<interact keywords="yes" topic="4">
			<response>
				<!--n1: 1 = carlin, 2 = edron, 3 = thais, 4 = venore-->
				<!--n2: 1 = knight, 2 = paladin, 3 = sorcerer, 4 = druid-->
				<action name="script">
					<=!=[=C=D=A=T=A=[
						local pos = 0
						local po = {x=,y=,z=}
						if doTeleportThing(cid, po) then
						selfSay("SO BE IT!")
						doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
						return true
						end
						if isPlayer(cid) then
							doPlayerSetVocation(cid, _state.n2)
							doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
						end
					]=]=>
				</action>
				<action name="idle" value="1"/>
			</response>
		</interact>
 
		<interact keywords="bye" focus="0">
			<keywords>farewell</keywords>
			<response text="Good bye. Recommend us, if you were satisfied with our service."/>
		</interact>
 
		<interact event="onBusy">
			<response text="WAIT UNTIL IT IS YOUR TURN!">
				<action name="addqueue" value="|PLAYER|"/>
			</response>
		</interact>
 
		<!--This event triggers if the player goes to far away from the npc/logout/idle timeout-->
		<interact event="onPlayerLeave" focus="0">
			<response text="COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!"/>
		</interact>
	</interaction>
</npc>

Talk to Him and say town

Oh, nono that already works. What you said worked perfectly, but she just doesn't respond to me when I say "hi".

Like, this happens:

I say hi
She says nothing
I say yes
She tells me to pick town
I pick a town
She tells me to choose a vocation
I choose a vocation
She asks me if my decision is final
I say yes
She sends me to the exact spot I want to be sent

So the only problem is that she doesn't respond to the initial "hi". Everything else works. Any ideas?
 
Back
Top