Postado Junho 19, 2020 4 anos Salve galera, tudo certo? Queria ajuda para adicionar uma função no meu npc oracle, para quando o npc finalizar a conversa, aparecer a setinha azul (tutorial arrow), em cima da cave aonde o player deve ir. Procurei em diversos foruns e tópicos e não achei nada sobre...a maioria dos scripts são com "getthingpos" porém não quero que a setinha pingue em cima do player, mas em cima do buraco que leva a caverna. Vou deixar abaixo o script do NPC que estou usando. Citar local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local vocation = {} local town = {} local destination = {} 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 local function greetCallback(cid) local player = Player(cid) local level = player:getLevel() if player:getVocation():getId() > 0 then npcHandler:say("You already have a vocation!", cid) return false end return true end local function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end if msgcontains(msg, "yes") and npcHandler.topic[cid] == 0 then npcHandler:say("Great! Then... What profession have you chosen? {KNIGHT}, {PALADIN}, {SORCERER}, or {DRUID}?", cid) npcHandler.topic[cid] = 1 elseif npcHandler.topic[cid] == 1 then if msgcontains(msg, "sorcerer") then npcHandler:say("A SORCERER! Are you sure? this decision is irreversible!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 1 doPlayerAddItem(cid, 2461) doPlayerAddItem(cid, 2651) doPlayerAddItem(cid, 2649) doPlayerAddItem(cid, 2643) doPlayerAddItem(cid, 23771) doPlayerAddItem(cid, 23719) elseif msgcontains(msg, "druid") then npcHandler:say("A DRUID! Are you sure? this decision is irreversible!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 2 doPlayerAddItem(cid, 2461) doPlayerAddItem(cid, 2651) doPlayerAddItem(cid, 2649) doPlayerAddItem(cid, 2643) doPlayerAddItem(cid, 23771) doPlayerAddItem(cid, 23721) elseif msgcontains(msg, "paladin") then npcHandler:say("A PALADIN! Are you sure? this decision is irreversible!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 3 doPlayerAddItem(cid, 2461) doPlayerAddItem(cid, 2651) doPlayerAddItem(cid, 2649) doPlayerAddItem(cid, 2643) doPlayerAddItem(cid, 2456) doPlayerAddItem(cid, 23839, 100) elseif msgcontains(msg, "knight") then npcHandler:say("A KNIGHT! Are you sure? this decision is irreversible!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 4 doPlayerAddItem(cid, 2461) doPlayerAddItem(cid, 2651) doPlayerAddItem(cid, 2649) doPlayerAddItem(cid, 2643) doPlayerAddItem(cid, 2379) doPlayerAddItem(cid, 2512) else npcHandler:say("{KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid) end elseif npcHandler.topic[cid] == 3 then if msgcontains(msg, "yes") then local player = Player(cid) npcHandler:say("So be it, go out and prove your valor! I marked some places to hunt on your map. Go out and explore hero!", cid) player:setVocation(Vocation(vocation[cid])) player:setTown(Town(town[cid])) doAddMapMark(cid, {x=1037, y=1085, z=7}, MAPMARK_SKULL, "Troll Cave") doAddMapMark(cid, {x=1104, y=1058, z=7}, MAPMARK_SKULL, "Bug Sewer") doAddMapMark(cid, {x=1134, y=1092, z=7}, MAPMARK_SKULL, "Rotworm Cave") else npcHandler:say("THEN WHAT? {KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid) npcHandler.topic[cid] = 2 end end return true end local function onAddFocus(cid) town[cid] = 0 vocation[cid] = 0 destination[cid] = 0 end local function onReleaseFocus(cid) town[cid] = nil vocation[cid] = nil destination[cid] = nil end npcHandler:setCallback(CALLBACK_ONADDFOCUS, onAddFocus) npcHandler:setCallback(CALLBACK_ONRELEASEFOCUS, onReleaseFocus) npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Vou anexar com o post também uma imagem do local aonde gostaria que a setinha ficasse, pra ficar mais claro.... a position exata do local é {x = 1104, y = 1123, z = 7} ------------------------- Caso alguém puder me ajudar com um segundo problema, vou ficar grato também ... o NPC entrega os itens antes de definir a vocação do jogador, permitindo assim o jogador spawnar itens infinitos... gostaria que ele entregasse os itens só depois de dar a vocação. Muito obrigado, boa noite e se eu tiver postado no local errado mil perdões!
Postado Junho 19, 2020 4 anos Olá @karphatus, poderia me dizer qual versão está utilizando do TFS? Você quer que a tutorial arrow apareça junto com o que você definiu no código? doAddMapMark(cid, {x=1037, y=1085, z=7}, MAPMARK_SKULL, "Troll Cave") doAddMapMark(cid, {x=1104, y=1058, z=7}, MAPMARK_SKULL, "Bug Sewer") doAddMapMark(cid, {x=1134, y=1092, z=7}, MAPMARK_SKULL, "Rotworm Cave") A função que pode utilizar para fazer isso, pode ser doSendMagicEffect(pos, type). Se falar em que momento ela deve aparecer eu posso fazer para você.
Postado Junho 19, 2020 4 anos Autor 43 minutos atrás, Balkalima disse: Olá @karphatus, poderia me dizer qual versão está utilizando do TFS? Você quer que a tutorial arrow apareça junto com o que você definiu no código? doAddMapMark(cid, {x=1037, y=1085, z=7}, MAPMARK_SKULL, "Troll Cave") doAddMapMark(cid, {x=1104, y=1058, z=7}, MAPMARK_SKULL, "Bug Sewer") doAddMapMark(cid, {x=1134, y=1092, z=7}, MAPMARK_SKULL, "Rotworm Cave") A função que pode utilizar para fazer isso, pode ser doSendMagicEffect(pos, type). Se falar em que momento ela deve aparecer eu posso fazer para você. Não man, esses 3 marcadores ai estão certos, eles aparecem... queria que a setinha aparecesse somente em cima do hole do lado do templo mesmo, assim que o jogador finalizar a conversa com o npc, por uns 15 segundos... muito obrigado pela ajuda mano, sou mapper, to sofrendo pra fazer os codigo rsrsrs Aliás to usando o tfs 1.3, perdão tinha esquecido Editado Junho 19, 2020 4 anos por karphatus (veja o histórico de edições)
Postado Junho 19, 2020 4 anos Solução 12 horas atrás, karphatus disse: Não man, esses 3 marcadores ai estão certos, eles aparecem... queria que a setinha aparecesse somente em cima do hole do lado do templo mesmo, assim que o jogador finalizar a conversa com o npc, por uns 15 segundos... muito obrigado pela ajuda mano, sou mapper, to sofrendo pra fazer os codigo rsrsrs Aliás to usando o tfs 1.3, perdão tinha esquecido Cara eu não testei, mas se eu entendi bem o momento em que você quer que a TutorialArrow apareça o código fica assim: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local vocation = {} local town = {} local destination = {} local arrowCave = {x=1104, y=1123, z=7 } 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 local function greetCallback(cid) local player = Player(cid) local level = player:getLevel() if player:getVocation():getId() > 0 then npcHandler:say("You already have a vocation!", cid) return false end return true end local function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end if msgcontains(msg, "yes") and npcHandler.topic[cid] == 0 then npcHandler:say("Great! Then... What profession have you chosen? {KNIGHT}, {PALADIN}, {SORCERER}, or {DRUID}?", cid) npcHandler.topic[cid] = 1 elseif npcHandler.topic[cid] == 1 then if msgcontains(msg, "sorcerer") then npcHandler:say("A SORCERER! Are you sure? this decision is irreversible!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 1 doPlayerAddItem(cid, 2461) doPlayerAddItem(cid, 2651) doPlayerAddItem(cid, 2649) doPlayerAddItem(cid, 2643) doPlayerAddItem(cid, 23771) doPlayerAddItem(cid, 23719) elseif msgcontains(msg, "druid") then npcHandler:say("A DRUID! Are you sure? this decision is irreversible!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 2 doPlayerAddItem(cid, 2461) doPlayerAddItem(cid, 2651) doPlayerAddItem(cid, 2649) doPlayerAddItem(cid, 2643) doPlayerAddItem(cid, 23771) doPlayerAddItem(cid, 23721) elseif msgcontains(msg, "paladin") then npcHandler:say("A PALADIN! Are you sure? this decision is irreversible!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 3 doPlayerAddItem(cid, 2461) doPlayerAddItem(cid, 2651) doPlayerAddItem(cid, 2649) doPlayerAddItem(cid, 2643) doPlayerAddItem(cid, 2456) doPlayerAddItem(cid, 23839, 100) elseif msgcontains(msg, "knight") then npcHandler:say("A KNIGHT! Are you sure? this decision is irreversible!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 4 doPlayerAddItem(cid, 2461) doPlayerAddItem(cid, 2651) doPlayerAddItem(cid, 2649) doPlayerAddItem(cid, 2643) doPlayerAddItem(cid, 2379) doPlayerAddItem(cid, 2512) else npcHandler:say("{KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid) end elseif npcHandler.topic[cid] == 3 then if msgcontains(msg, "yes") then local player = Player(cid) npcHandler:say("So be it, go out and prove your valor! I marked some places to hunt on your map. Go out and explore hero!", cid) player:setVocation(Vocation(vocation[cid])) player:setTown(Town(town[cid])) doAddMapMark(cid, {x=1037, y=1085, z=7}, MAPMARK_SKULL, "Troll Cave") doAddMapMark(cid, {x=1104, y=1058, z=7}, MAPMARK_SKULL, "Bug Sewer") doAddMapMark(cid, {x=1134, y=1092, z=7}, MAPMARK_SKULL, "Rotworm Cave") else npcHandler:say("THEN WHAT? {KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid) npcHandler.topic[cid] = 2 end end doSendMagicEffect(arrowCave,55) return true end local function onAddFocus(cid) town[cid] = 0 vocation[cid] = 0 destination[cid] = 0 end local function onReleaseFocus(cid) town[cid] = nil vocation[cid] = nil destination[cid] = nil end npcHandler:setCallback(CALLBACK_ONADDFOCUS, onAddFocus) npcHandler:setCallback(CALLBACK_ONRELEASEFOCUS, onReleaseFocus) npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) *As mudanças se encontram na linha 8 e 93. Se não for nesse momento que deseja que apareça, apenas troque a linha 93 de lugar
Postado Junho 19, 2020 4 anos Autor não funcionou mano não aparece nada quando termino a conversa com o npc, e nem da nenhum erro no executavel EDIT: mosquei mano, funcionou sim HAUSHDUHASUDHSAU eu testei sem adicionar os script olha a cabeça... enfim... muito obrigado ? sou novo no forum, como faço pra te dar rep? Editado Junho 19, 2020 4 anos por karphatus (veja o histórico de edições)
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.