4 horas atrás, Olan trein disse:Esse NCP iria transportar para um local,e ao falar com um outro ncp ele traria a pessoa de volta ao local anterior.
EXEMPLO:O ncp AGOSTINHO,no OTpokemon.
Vamos lá:
em data/npc/scripts crie o arquivo npctele.lua e cole dentro...
local DESTINO = {x = 160, y = 54, z = 7} -- POSIÇÃO DE DESTINO local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg:lower()) end function onThink() npcHandler:onThink() end local talkState = {} function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, "sim") or msgcontains(msg, "yes") then selfSay("Aí está!", cid) doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, DESTINO) doSendMagicEffect(DESTINO, 10) elseif msgcontains(msg, "nao") or msgcontains(msg, "no") then selfSay("Entao tá!", cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Agora volte e crie um arquivo xml com o nome do npc... Zure.XML e cole dentro...
<?xml version="1.0" encoding="UTF-8"?> <npc name="Zure" script="npctele.lua" walkinterval="2000"> <health now="100" max="100" /> <look type="131" head="58" body="43" legs="38" feet="76" addons="0" /> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME| voce deseja ir para...?" /> <parameter key="message_farewell" value="So I am alone again." /> <parameter key="message_walkaway" value="So I am alone again." /> </parameters> </npc>
Blz agora vamos para o 2 npc o da volta...
data/npc/scripts crie um arquivo Lua chamado... npctele2 e cole dentro...
local DESTINO = {x = 160, y = 54, z = 7} -- POSIÇÃO DE DESTINO DA VOLTA, EDITE! local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg:lower()) end function onThink() npcHandler:onThink() end local talkState = {} function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, "sim") or msgcontains(msg, "yes") then selfSay("Aí está!", cid) doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, DESTINO) doSendMagicEffect(DESTINO, 10) elseif msgcontains(msg, "nao") or msgcontains(msg, "no") then selfSay("Entao tá!", cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Volte e crie um XML com o nome Zepo e dentro cole...
<?xml version="1.0" encoding="UTF-8"?> <npc name="Zepo" script="npctele2.lua" walkinterval="2000"> <health now="100" max="100" /> <look type="131" head="58" body="43" legs="38" feet="76" addons="0" /> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME| voce deseja ir para...?" /> <parameter key="message_farewell" value="So I am alone again." /> <parameter key="message_walkaway" value="So I am alone again." /> </parameters> </npc>
Agora é só editar as coordenadas de destino. Espero ter ajudado, Abraço.





info
Grupo: Artesão
Registrado: 18/07/17
Posts: 103
Reputação: 0
Gênero: Masculino
Esse NCP iria transportar para um local,e ao falar com um outro ncp ele traria a pessoa de volta ao local anterior.
EXEMPLO:O ncp AGOSTINHO,no OTpokemon.