Ir para conteúdo
  • 0

[Npc]


darkanderson

Pergunta

8 respostass a esta questão

Posts Recomendados

  • 0

Ele é default

 

<npc name="Teleportador" script="data/npc/scripts/default.lua" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="151" head="114" body="12" legs="90" feet="115" addons="1" corpse="2212"/>
<parameters>
   	<parameter key="module_travel" value="1"/>
<parameter key="message_greet" value="Hello |PLAYERNAME|. Fale {tirar pz} para ser teleportado." />
   	<parameter key="travel_destinations" value="tirar pz,997,990,7,50000"/>
</parameters>
</npc>

Link para o comentário
Compartilhar em outros sites

  • 0

Use:

 

Teleport.lua

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)



-- OTServ event handling functions start
function onCreatureAppear(cid)				npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) 			npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) 	npcHandler:onCreatureSay(cid, type, msg) end
function onThink() 						npcHandler:onThink() end
-- OTServ event handling functions end



-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'Cidade'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to be teleported to cidade?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 50, cost = 50000, pzLocked = true, destination = {x = 997, y = 990, z = 7}})
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'So, bye.'})

npcHandler:addModule(FocusModule:new())

 

 

Teleporter.xml:

<npc name="Teleporter" script="data/npc/scripts/Teleport.lua" floorchange="0" access="5" level="1" maglevel="1">
       <health now="150" max="150"/>
       <look type="151" head="114" body="12" legs="90" feet="115" addons="1" corpse="2212"/>
</npc>

 

 

flw

Link para o comentário
Compartilhar em outros sites

  • 0

então põe

 

pzLocked = false

 

 

Ja tentei e não funcionou... :/ sempre aparece

 

Get out of there with this blood

 

 

EDIT

Tava fuçando aqui e achei isso elseif(not pzLocked and isPlayerPzLocked(cid)) em modules dos npc ;x

 

Resolvi problema, pode fechar o topico algum moderador!

Editado por darkanderson
Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...