Ir para conteúdo
Banner com Efeitos

Featured Replies

  • 3 years later...
  • Respostas 7
  • Visualizações 1.7k
  • Created
  • Última resposta

Top Posters In This Topic

  • 2 years later...
Postado

ACHEI UM NPC:

 

 

 

 

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)
	 posInicial = nil
	 posFinal = nil
	 npcHandler:onCreatureDisappear(cid)
end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
---------------------- CONFIGS --------------------------------------
local posis = {
--[pos do npc] = {pos inicial, pos final},
[{x = 1373, y = 1234, z = 15}] = {posIni = {x = 1210, y = 1077, z = 6}, posFinal = {x = 1210, y = 1068, z = 6}},
}
for npcPos, pos in pairs(posis) do
if isPosEqual(getThingPos(getNpcCid()), npcPos) then
   posInicial = pos.posIni  
   posFinal = pos.posFinal
   break
end
end
if not posInicial then selfSay("A error has occored!", cid) print("A error has occored, npc city aren't in the correct place!") return false end

local outfit = getPlayerSex(cid) == 0 and {lookType = 1476} or {lookType = 1476} --outfit q o player vai ganhar, a 1* eh female e a 2* eh male
local msg = msg:lower()
------------------------------------------------------------------------------
if msgcontains(msg, 'yes') then
  --------------------------------------------------------------------------------------------------------------------------
  selfSay("Tem certeza que quer ir {go}? | Are you sure do you want to {go}?", cid)
  talkState[talkUser] = 1
  return true
elseif (msgcontains(msg, 'go') or msgcontains(msg, 'Go') or msgcontains(msg, 'Go')) and talkState[talkUser] == 1 then
  selfSay("Ok então. | Ok, good trip.", cid)
  doTeleportThing(cid, posInicial, false)
  mayNotMove(cid, true)
  setPlayerStorageValue(cid, 75846, 1)
  doSetCreatureOutfit(cid, outfit, -1)
  moveTravel(cid, posFinal)
  local posis = {x = getPlayerPosition(cid).x + 3, y = getPlayerPosition(cid).y + 0, z = getPlayerPosition(cid).z}
  doSendMagicEffect(posis, 346)
   --doSendMagicEffect(getThingPos(cid), 346)
  talkState[talkUser] = 0
  return true
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

 

QUALQUER DUVIDA EU AJUDO A MONTAR!

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo