Por wesleykun, 02 de mai. de 2011 em NPCs, monsters e raids
info
Grupo: Campones
Registrado: 22/09/10
Posts: 23
Reputação: +1
Char no Tibia: PoYsoneR
Vamos separar o NPC em grupos.
I-Apresentação
II-Script
III-Como editalo
IV-Créditos
Apresentando.
Bem,assim que resolvi criar um ot que comessase sem vocação,tiver que correr atrás da the oracle.Meu ot não tem somente as 4 vocações então tive que implementar mais 10.Isso vou explicar alem de outras coisas que consegui editar.
Meu ot não tem somente as 4 vocações então tive que implementar mais 10.Isso vou explicar alem de outras coisas que consegui editar.
O Script
<?xml version="1.0"?><npc name="The Oracle" floorchange="0" walkinterval="0"> <health now="100" max="100"/> <look typeex="1448"/> <interaction range="3" idletime="86400"> <interact keywords="oi" 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) .. ", voce esta preparado?") _state.b1 = (isPremium(cid) == TRUE) _state.topic = 1 else selfSay("Voce nao tem nivel suficiente,va upar!") _state.isidle = true end ]]> </action> </response> </interact> <interact keywords="sim" topic="1"> <!--Premium account, b1 is set in above--> <response b1="1" text="IN WHICH TOWN DO YOU WANT TO LIVE: Halgan?"> <action name="topic" value="2"/> </response> <!--Normal account--> <response text="IN WHICH TOWN DO YOU WANT TO LIVE: Halgan?"> <action name="topic" value="2"/> </response> </interact> <interact keywords="halgan" topic="2"> <response text="IN Halgan AND WHAT PROFESSION HAVE YOU CHOSEN:SORCERER,DRUID,PALADIN OR KNIGHT? <!--n1: 1 = Halgan--> <action name="script"> <![CDATA[ _state.n1 = 1 _state.topic = 1 ]]> </action> </response> </interact> <!--If the player does not say any city, repeat our question--> <interact keywords="|*|" topic="2"> <response b1="1" text="halgan"/> <response text="halgan"/> </interact> <interact keywords="sorcerer" topic="3"> <response text="A sorcerer! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!"> <!--n2: <!--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: <!--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: <!--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="> </interact> <interact keywords="yes" topic="4"> <response> <!--n1: 1 = Halgan--> <!--n2: <!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight--> <action name="script"> <![CDATA[ local pos = 0 if(_state.n1 == 1) then pos = {x=1088, y=1072, z=7} elseif(_state.n1 == 2) then pos = {x=1088, y=1072, z=7} elseif(_state.n1 == 3) then pos = {x=1088, y=1072, z=7} elseif(_state.n1 == 4) then pos = {x=1088, y=1072, 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="ate nunca mais."/> </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="voce esta preparado para encarar o seu destino."/> </interact> </interaction> </npc>
<npc name="The Oracle" floorchange="0" walkinterval="0">
<health now="100" max="100"/>
<look typeex="1448"/>
<interaction range="3" idletime="86400">
<interact keywords="oi" 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) .. ", voce esta preparado?")
_state.b1 = (isPremium(cid) == TRUE)
_state.topic = 1
else
selfSay("Voce nao tem nivel suficiente,va upar!")
_state.isidle = true
end
]]>
</action>
</response>
</interact>
<interact keywords="sim" topic="1">
<!--Premium account, b1 is set in above-->
<response b1="1" text="IN WHICH TOWN DO YOU WANT TO LIVE: Halgan?">
<action name="topic" value="2"/>
<!--Normal account-->
<response text="IN WHICH TOWN DO YOU WANT TO LIVE: Halgan?">
<interact keywords="halgan" topic="2">
<response text="IN Halgan AND WHAT PROFESSION HAVE YOU CHOSEN:SORCERER,DRUID,PALADIN OR KNIGHT? <!--n1: 1 = Halgan-->
_state.n1 = 1
<!--If the player does not say any city, repeat our question-->
<interact keywords="|*|" topic="2">
<response b1="1" text="halgan"/>
<response text="halgan"/>
<interact keywords="sorcerer" topic="3">
<response text="A sorcerer! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
<!--n2: <!--n2: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight-->
-->
_state.n2 = 1
_state.topic = 4
<interact keywords="druid" topic="3">
<response text="A druid! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
_state.n2 = 2
<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-->
_state.n2 = 3
<interact keywords="knight" topic="3">
<response text="A knight! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!">
_state.n2 = 4
<!--If the player does not say any profession, repeat our question-->
<interact keywords="|*|" topic="3">
<response text=">
<interact keywords="yes" topic="4">
<!--n1: 1 = Halgan-->
local pos = 0
if(_state.n1 == 1) then
pos = {x=1088, y=1072, z=7}
elseif(_state.n1 == 2) then
elseif(_state.n1 == 3) then
elseif(_state.n1 == 4) then
selfSay("I DO NOT KNOW WHAT PROFESSION THAT IS, ASK THE GODS FOR GUIDANCE!")
return
selfSay("SO BE IT!")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
if(doTeleportThing(cid, pos) == 0) then
doPlayerSetTown(cid, _state.n1)
doPlayerSetVocation(cid, _state.n2)
<action name="idle" value="1"/>
<interact keywords="bye" focus="0">
<keywords>farewell</keywords>
<response text="ate nunca mais."/>
<interact event="onBusy">
<response text="WAIT UNTIL IT IS YOUR TURN!">
<action name="addqueue" value="|PLAYER|"/>
<!--This event triggers if the player goes to far away from the npc/logout/idle timeout-->
<interact event="onPlayerLeave" focus="0">
<response text="voce esta preparado para encarar o seu destino."/>
</interaction>
</npc>
Legendas Para como editalo.
Vermelho: palavra para inicarse a conversa
No meu caso "oi".
Amarelo: Resposta do NPC.
No meu caso."Voce esta preparado?"
Alaranjado: Caso voce não tenha nivel ele responderá...
No meu caso."voce nao tem nivel suficiente,va upar."
Preto:Sua resposta terá que ser "sim" dps so responder em ingles.
Verde:[...] Halgan.(halgan e a cidade e o que vc terá de falar para ir para ela.)
Azul Claro:Vocações.qual voce falar será indispensavel.
Azul: o que vc deverá falar para receber tal vocação.Não Mude.so se tiver vocações diferentes.
Roxo: Local do templo onde o player nascerá dps de ter pegado sua vocação.
Créditos
50% Meu por ter editado o script.50% ao criador cujo nome não lembro.
50% ao criador cujo nome não lembro.
Editado Maio 2 por LordXD2010
info
Grupo: Campones
Registrado: 22/09/10
Posts: 23
Reputação: +1
Char no Tibia: PoYsoneR
Vamos separar o NPC em grupos.
I-Apresentação
II-Script
III-Como editalo
IV-Créditos
Apresentando.
O Script
Legendas Para como editalo.
Vermelho: palavra para inicarse a conversa
No meu caso "oi".
Amarelo: Resposta do NPC.
No meu caso."Voce esta preparado?"
Alaranjado: Caso voce não tenha nivel ele responderá...
No meu caso."voce nao tem nivel suficiente,va upar."
Preto:Sua resposta terá que ser "sim" dps so responder em ingles.
Verde:[...] Halgan.(halgan e a cidade e o que vc terá de falar para ir para ela.)
Azul Claro:Vocações.qual voce falar será indispensavel.
Azul: o que vc deverá falar para receber tal vocação.Não Mude.so se tiver vocações diferentes.
Roxo: Local do templo onde o player nascerá dps de ter pegado sua vocação.
Créditos
Editado Maio 2 por LordXD2010