Ir para conteúdo

BrunoLeo

Membro
  • Registro em

  • Última visita

Tudo que BrunoLeo postou

  1. Infelizmente esta dando erro na hora de compilar. 1>C:\vcpkg\otservbr-global\src\webhook.cpp(5,10): fatal error C1083: Cannot open include file: 'curl/curl.h': No such file or directory 1>wildcardtree.cpp 1>xtea.cpp 1>Done building project "otservbr-global.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  2. Alguém sabe a versão do xampp pra usar?
  3. Esse mod aqui funcionou. Obrigado! show de mais.
  4. BrunoLeo postou uma resposta no tópico em Mapas de Tibia
    Gostaria desse conteúdo para colocar no meu novo projeto, alguém tem link alternativo?
  5. As funções não estão funcionando 100%
  6. BrunoLeo postou uma resposta no tópico em Suporte Tibia OTServer
    vinifariia, disponibiliza a sua distro por gentileza.
  7. BrunoLeo postou uma resposta no tópico em Suporte Tibia OTServer
    Alguém conseguiu copilar essas funções? poderia passa o executável. Preciso destas funções: doPlayerAddExperience doPlayerSetMaxCapacity setPlayerMaxHealth setPlayerMaxMana getPlayerHealth getPlayerExperience
  8. Olá galerinha, gostaria de pedir ajuda com um código do meu servidor de poketibia. Eu não consigo fazer funcionar a máquina de helds e o autoloot juntos, ou um funciona ou o outro, o cod esta meio que no msm script. Servidor\data\creaturescripts\scripts\opcodes Esse script funciona o autoloot 100%, mas o resto não funciona local op_crea = { OPCODE_SKILL_BAR = opcodes.OPCODE_SKILL_BAR, OPCODE_POKEMON_HEALTH = opcodes.OPCODE_POKEMON_HEALTH, OPCODE_BATTLE_POKEMON = opcodes.OPCODE_BATTLE_POKEMON, OPCODE_FIGHT_MODE = opcodes.OPCODE_FIGHT_MODE, OPCODE_WILD_POKEMON_STATS = opcodes.OPCODE_WILD_POKEMON_STATS, OPCODE_REQUEST_DUEL = opcodes.OPCODE_REQUEST_DUEL, OPCODE_ACCEPT_DUEL = opcodes.OPCODE_ACCEPT_DUEL, OPCODE_YOU_ARE_DEAD = opcodes.OPCODE_YOU_ARE_DEAD, OPCODE_DITTO_MEMORY = opcodes.OPCODE_DITTO_MEMORY, } function onExtendedOpcode(cid, opcode, buffer) if opcode == op_crea.OPCODE_SKILL_BAR then if buffer == "refresh" then doOTCSendPlayerSkills(cid) end elseif opcode == op_crea.OPCODE_POKEMON_HEALTH then if buffer == "refresh" then doOTCSendPokemonHealth(cid) end elseif opcode == op_crea.OPCODE_BATTLE_POKEMON then if buffer == "refresh" then if #getCreatureSummons(cid) >= 1 then doSendPlayerExtendedOpcode(cid, op_crea.OPCODE_BATTLE_POKEMON, tostring(getCreatureSummons(cid)[1])) end end elseif opcode == op_crea.OPCODE_FIGHT_MODE then setPlayerStorageValue(cid, storages.fightMode, tonumber(buffer)) elseif opcode == op_crea.OPCODE_WILD_POKEMON_STATS then doSendPlayerExtendedOpcode(cid, op_crea.OPCODE_WILD_POKEMON_STATS, pokeStatus.getVity(tonumber(buffer)).."|"..pokeStatus.getAtk(tonumber(buffer)).."|"..pokeStatus.getSpAtk(tonumber(buffer)).."|"..pokeStatus.getDef(tonumber(buffer)).."|"..pokeStatus.getSpDef(tonumber(buffer)).."|"..pokeStatus.getSpeed(tonumber(buffer))) --//Duel elseif opcode == opcodes.OPCODE_REQUEST_DUEL then --legenda: cid = player, sid = player convidado local cut = string.explode(buffer, "/") local pokeballsCount, sid = tonumber(cut[1]), getCreatureByName(cut[2]) if isCreature(sid) then doIniteDuel(cid, sid, pokeballsCount) end elseif opcode == opcodes.OPCODE_ACCEPT_DUEL then local p2 = getCreatureByName(buffer) if isInvitedDuel(p2, cid) then doPantinNoDuel(cid, p2, getPlayerStorageValue(p2, duelTable.infoBalls), 5) end elseif opcode == opcodes.OPCODE_DITTO_MEMORY then local item = getPlayerSlotItem(cid, 8) if item.uid == 0 then doSendMsg(cid, "Coloque seu shiny ditto no slot correto.") return true end local pokeName = getItemAttribute(item.uid, "poke") if pokeName ~= "Shiny Ditto" then return true end if isInArray({"saveMemory1", "saveMemory2", "saveMemory3"}, buffer) then local copyName = getItemAttribute(item.uid, "copyName") if pokeName == copyName then doSendMsg(cid, "Transforme seu ditto primeiro.") return true end if isPokeInSlots(getItemAttribute(item.uid, "memoryDitto"), doCorrectString(copyName)) then doSendMsg(cid, "Esta copia já está salva em um slot.") return true end if buffer == "saveMemory1" then doItemSetAttribute(item.uid, "memoryDitto", saveSlot(getItemAttribute(item.uid, "memoryDitto"), 1, getItemInfo(fotos[doCorrectString(copyName)]).clientId)) -- getPortraitClientID(doCorrectString(copyName)))) elseif buffer == "saveMemory2" then doItemSetAttribute(item.uid, "memoryDitto", saveSlot(getItemAttribute(item.uid, "memoryDitto"), 2, getItemInfo(fotos[doCorrectString(copyName)]).clientId)) elseif buffer == "saveMemory3" then doItemSetAttribute(item.uid, "memoryDitto", saveSlot(getItemAttribute(item.uid, "memoryDitto"), 3, getItemInfo(fotos[doCorrectString(copyName)]).clientId)) end elseif isInArray({"clearSlot1", "clearSlot2", "clearSlot3"}, buffer) then if buffer == "clearSlot1" then doItemSetAttribute(item.uid, "memoryDitto", saveSlot(getItemAttribute(item.uid, "memoryDitto"), 1, "?")) elseif buffer == "clearSlot2" then doItemSetAttribute(item.uid, "memoryDitto", saveSlot(getItemAttribute(item.uid, "memoryDitto"), 2, "?")) elseif buffer == "clearSlot3" then doItemSetAttribute(item.uid, "memoryDitto", saveSlot(getItemAttribute(item.uid, "memoryDitto"), 3, "?")) end elseif isInArray({"use1", "use2", "use3"}, buffer) then local summons = getCreatureSummons(cid) if #summons < 1 then doSendMsg(cid, "Coloque seu ditto para fora da pokeball.") return true end local pokeToTransform = getSlot(getItemAttribute(item.uid, "memoryDitto"), tonumber(buffer:explode("use")[1])) doCopyPokemon(summons[1], pokeToTransform, true) end local memory = getItemAttribute(item.uid, "memoryDitto") if not memory or memory == nil then doItemSetAttribute(item.uid, "memoryDitto", "?|?|?") memory = getItemAttribute(item.uid, "memoryDitto") end local memoryOne, memoryTwo, memoryTree = memory:explode("|")[1], memory:explode("|")[2], memory:explode("|")[3] local str = memoryOne .. "-".. memoryTwo .."-" .. memoryTree doSendPlayerExtendedOpcode(cid, opcodes.OPCODE_DITTO_MEMORY, str) elseif opcode == opcodes.OPCODE_TV_CAM then -- TVCam --doCreatePrivateChannel(cid) --doInviteToPrivateChannel(cid, playerName) --doRemoveIntoPrivateChannel(cid, playerName) if getGlobalStorageValue(globalsTV) == -1 then -- iniciar sistema setGlobalStorageValue(globalsTV, "") end local action = buffer:explode("/")[1] if action == "create" then createChannel(cid, buffer) elseif action == "close" then closeInClientChannmel(cid) elseif action == "watch" then local playerToWatch = getCreatureByName(buffer:explode("/")[2]) if isCreature(playerToWatch) then if getPlayerStorageValue(playerToWatch, storages.playerTVPass) ~= "" and getPlayerStorageValue(playerToWatch, storages.playerTVPass) ~= "notASSenha" then doSendPlayerExtendedOpcode(cid, opcodes.OPCODE_TV_CAM, "requestPass|" .. getPlayerStorageValue(playerToWatch, storages.playerTVPass) .. "|" .. buffer:explode("/")[2]) else doWatch(cid, playerToWatch) end else doSendMsg(cid, "Este player não está mais gravando.") end elseif action == "watchWithPass" then local playerToWatch = getCreatureByName(buffer:explode("/")[2]) if isCreature(playerToWatch) then doWatch(cid, playerToWatch) else doSendMsg(cid, "Este player não está mais gravando.") end elseif action == "errou" then doSendMsg(cid, "Senha do digitada incorreta.") end elseif opcode == opcodes.OPCODE_PLAYER_SHOW_AUTOLOOT then -- Autoloot if buffer:find("load/") then local itens = getAllItensAutoLoot() doSendPlayerExtendedOpcode(cid, opcodes.OPCODE_PLAYER_SHOW_AUTOLOOT, (isCollectAll(cid) and "yes" or "no") .. "|" .. itens .. "|" .. getAllItensInMyListToClient(cid)) elseif buffer:find("all") then doCollectAll(cid, true) doSendMsg(cid, "AutoLoot: Coletar tudo foi ativado.") elseif buffer:find("no") then doCollectAll(cid, false) doSendMsg(cid, "AutoLoot: Coletar tudo foi desativado.") else doSaveItems(cid, buffer) end elseif opcode == opcodes.OPCODE_PLAYER_SHOW_ONLINE then -- Janela de onlines do ADM doGetPlayersOnToADM(cid) end end function getSlot(strings, slot) local slot1, slot2, slot3 = strings:explode("|")[1], strings:explode("|")[2], strings:explode("|")[3] local ret, flag = "", false for a, b in pairs(fotos) do if getItemInfo(fotos[a]).clientId == tonumber(slot1) and slot == 1 then ret = doCorrectString(a) flag = true elseif getItemInfo(fotos[a]).clientId == tonumber(slot2) and slot == 2 then ret = doCorrectString(a) flag = true elseif getItemInfo(fotos[a]).clientId == tonumber(slot3) and slot == 3 then ret = doCorrectString(a) flag = true end if flag then break end end return ret end function saveSlot(strings, slot, poke) local slot1, slot2, slot3 = strings:explode("|")[1], strings:explode("|")[2], strings:explode("|")[3] local finalSlots = (slot == 1 and poke .. "|" or slot1 .. "|") .. (slot == 2 and poke .. "|" or slot2 .. "|") .. (slot == 3 and poke .. "|" or slot3) return finalSlots end function isPokeInSlots(strings, poke) poke = getItemInfo(fotos[poke]).clientId local slot1, slot2, slot3 = strings:explode("|")[1], strings:explode("|")[2], strings:explode("|")[3] if tonumber(slot1) == poke then return true elseif tonumber(slot2) == poke then return true elseif tonumber(slot3) == poke then return true end return false end E esse outro aqui funciona a máquina de helds, mas não funciona o resto. local op_crea = { OPCODE_SKILL_BAR = opcodes.OPCODE_SKILL_BAR, OPCODE_POKEMON_HEALTH = opcodes.OPCODE_POKEMON_HEALTH, OPCODE_BATTLE_POKEMON = opcodes.OPCODE_BATTLE_POKEMON, OPCODE_FIGHT_MODE = opcodes.OPCODE_FIGHT_MODE, OPCODE_WILD_POKEMON_STATS = opcodes.OPCODE_WILD_POKEMON_STATS, OPCODE_REQUEST_DUEL = opcodes.OPCODE_REQUEST_DUEL, OPCODE_ACCEPT_DUEL = opcodes.OPCODE_ACCEPT_DUEL, OPCODE_YOU_ARE_DEAD = opcodes.OPCODE_YOU_ARE_DEAD, OPCODE_DITTO_MEMORY = opcodes.OPCODE_DITTO_MEMORY, } function onExtendedOpcode(cid, opcode, buffer) if opcode == op_crea.OPCODE_SKILL_BAR then if buffer == "refresh" then doOTCSendPlayerSkills(cid) end elseif opcode == op_crea.OPCODE_POKEMON_HEALTH then if buffer == "refresh" then doOTCSendPokemonHealth(cid) end elseif opcode == op_crea.OPCODE_BATTLE_POKEMON then if buffer == "refresh" then if #getCreatureSummons(cid) >= 1 then doSendPlayerExtendedOpcode(cid, op_crea.OPCODE_BATTLE_POKEMON, tostring(getCreatureSummons(cid)[1])) end end elseif opcode == op_crea.OPCODE_FIGHT_MODE then setPlayerStorageValue(cid, storages.fightMode, tonumber(buffer)) elseif opcode == op_crea.OPCODE_WILD_POKEMON_STATS then doSendPlayerExtendedOpcode(cid, op_crea.OPCODE_WILD_POKEMON_STATS, pokeStatus.getVity(tonumber(buffer)).."|"..pokeStatus.getAtk(tonumber(buffer)).."|"..pokeStatus.getSpAtk(tonumber(buffer)).."|"..pokeStatus.getDef(tonumber(buffer)).."|"..pokeStatus.getSpDef(tonumber(buffer)).."|"..pokeStatus.getSpeed(tonumber(buffer))) --//Duel elseif opcode == opcodes.OPCODE_REQUEST_DUEL then --legenda: cid = player, sid = player convidado local cut = string.explode(buffer, "/") local pokeballsCount, sid = tonumber(cut[1]), getCreatureByName(cut[2]) if isCreature(sid) then doIniteDuel(cid, sid, pokeballsCount) end elseif opcode == opcodes.OPCODE_ACCEPT_DUEL then local p2 = getCreatureByName(buffer) if isInvitedDuel(p2, cid) then doPantinNoDuel(cid, p2, getPlayerStorageValue(p2, duelTable.infoBalls), 5) end elseif opcode == opcodes.OPCODE_DITTO_MEMORY then local item = getPlayerSlotItem(cid, 8) if item.uid == 0 then doSendMsg(cid, "Coloque seu shiny ditto no slot correto.") return true end local pokeName = getItemAttribute(item.uid, "poke") if pokeName ~= "Shiny Ditto" then return true end if isInArray({"saveMemory1", "saveMemory2", "saveMemory3"}, buffer) then local copyName = getItemAttribute(item.uid, "copyName") if pokeName == copyName then doSendMsg(cid, "Transforme seu ditto primeiro.") return true end if not fotos[doCorrectString(copyName)] then return true end if isPokeInSlots(getItemAttribute(item.uid, "memoryDitto"), doCorrectString(copyName)) then doSendMsg(cid, "Esta copia já está salva em um slot.") return true end if buffer == "saveMemory1" then doItemSetAttribute(item.uid, "memoryDitto", saveSlot(getItemAttribute(item.uid, "memoryDitto"), 1, getItemInfo(fotos[doCorrectString(copyName)]).clientId)) -- getPortraitClientID(doCorrectString(copyName)))) elseif buffer == "saveMemory2" then doItemSetAttribute(item.uid, "memoryDitto", saveSlot(getItemAttribute(item.uid, "memoryDitto"), 2, getItemInfo(fotos[doCorrectString(copyName)]).clientId)) elseif buffer == "saveMemory3" then doItemSetAttribute(item.uid, "memoryDitto", saveSlot(getItemAttribute(item.uid, "memoryDitto"), 3, getItemInfo(fotos[doCorrectString(copyName)]).clientId)) end elseif isInArray({"clearSlot1", "clearSlot2", "clearSlot3"}, buffer) then if buffer == "clearSlot1" then doItemSetAttribute(item.uid, "memoryDitto", saveSlot(getItemAttribute(item.uid, "memoryDitto"), 1, "?")) elseif buffer == "clearSlot2" then doItemSetAttribute(item.uid, "memoryDitto", saveSlot(getItemAttribute(item.uid, "memoryDitto"), 2, "?")) elseif buffer == "clearSlot3" then doItemSetAttribute(item.uid, "memoryDitto", saveSlot(getItemAttribute(item.uid, "memoryDitto"), 3, "?")) end elseif isInArray({"use1", "use2", "use3"}, buffer) then local summons = getCreatureSummons(cid) if #summons < 1 then doSendMsg(cid, "Coloque seu ditto para fora da pokeball.") return true end local pokeToTransform = getSlot(getItemAttribute(item.uid, "memoryDitto"), tonumber(buffer:explode("use")[1])) doCopyPokemon(summons[1], pokeToTransform, true) end local memory = getItemAttribute(item.uid, "memoryDitto") if not memory or memory == nil then doItemSetAttribute(item.uid, "memoryDitto", "?|?|?") memory = getItemAttribute(item.uid, "memoryDitto") end local memoryOne, memoryTwo, memoryTree = memory:explode("|")[1], memory:explode("|")[2], memory:explode("|")[3] local str = memoryOne .. "-".. memoryTwo .."-" .. memoryTree doSendPlayerExtendedOpcode(cid, opcodes.OPCODE_DITTO_MEMORY, str) elseif opcode == opcodes.OPCODE_TV_CAM then -- TVCam --doCreatePrivateChannel(cid) --doInviteToPrivateChannel(cid, playerName) --doRemoveIntoPrivateChannel(cid, playerName) if getGlobalStorageValue(globalsTV) == -1 then -- iniciar sistema setGlobalStorageValue(globalsTV, "") end local action = buffer:explode("/")[1] if action == "create" then createChannel(cid, buffer) elseif action == "close" then closeInClientChannmel(cid) elseif action == "watch" then local playerToWatch = getCreatureByName(buffer:explode("/")[2]) if isCreature(playerToWatch) then if getPlayerStorageValue(playerToWatch, storages.playerTVPass) ~= "" and getPlayerStorageValue(playerToWatch, storages.playerTVPass) ~= "notASSenha" then doSendPlayerExtendedOpcode(cid, opcodes.OPCODE_TV_CAM, "requestPass|" .. getPlayerStorageValue(playerToWatch, storages.playerTVPass) .. "|" .. buffer:explode("/")[2]) else doWatch(cid, playerToWatch) end else doSendMsg(cid, "Este player não está mais gravando.") end elseif action == "watchWithPass" then local playerToWatch = getCreatureByName(buffer:explode("/")[2]) if isCreature(playerToWatch) then doWatch(cid, playerToWatch) else doSendMsg(cid, "Este player não está mais gravando.") end elseif action == "errou" then doSendMsg(cid, "Senha do digitada incorreta.") end elseif opcode == opcodes.OPCODE_PLAYER_SHOW_ONLINE then -- Janela de onlines do ADM doGetPlayersOnToADM(cid) elseif opcode == opcodes.OPCODE_PLAYER_SHOW_TRADE_HELD then local op = tonumber(buffer:explode("-")[2]) local posP = getThingPos(cid) local posMachine = {{x = 222, y = 430, z = 7}, {x = 221, y = 430, z = 7}} if not doComparePositions(posMachine[1], posP) and not doComparePositions(posMachine[2], posP) then doSendMsg(cid, "Tienes que estar en frente de la maquina.") return true end if op == 1 then if doPlayerRemoveItem(cid, 15645, 15) then local tier = math.random(1, 2) doPlayerAddRandomHeld(cid, tier) else doSendMsg(cid, "Necesitas de 15 Devoted Tokens.") end return true elseif op == 2 then if doPlayerRemoveItem(cid, 15644, 50) then local tier = math.random(1, 3) doPlayerAddRandomHeld(cid, tier) else doSendMsg(cid, "Necesitas de 50 Mighty Tokens.") end return true elseif op == 3 then if doPlayerRemoveItem(cid, 15644, 80) then local tier = math.random(2, 4) doPlayerAddRandomHeld(cid, tier) else doSendMsg(cid, "Necesitas de 80 Mighty Tokens.") end return true elseif op == 4 then if doPlayerRemoveItem(cid, 15644, 150) then local tier = math.random(4, 6) doPlayerAddRandomHeld(cid, tier) else doSendMsg(cid, "Necesitas de 150 Mighty Tokens.") end return true elseif op == 5 then if doPlayerRemoveItem(cid, 15646, 10) then local tier = math.random(3, 3) doPlayerAddRandomHeld(cid, tier) else doSendMsg(cid, "Necesitas de 10 Hornored Tokens.") end return true elseif op == 6 then if doPlayerRemoveItem(cid, 15646, 30) then local tier = math.random(3, 5) doPlayerAddRandomHeld(cid, tier) else doSendMsg(cid, "Necesitas de 30 Hornored Tokens.") end return true elseif op == 7 then if doPlayerRemoveItem(cid, 15646, 300) then local tier = math.random(5, 7) doPlayerAddRandomHeld(cid, tier) else doSendMsg(cid, "Necesitas de 300 Hornored Tokens.") end return true elseif op == 8 then if doPlayerRemoveItem(cid, 15646, 100) then doPlayerAddItem(cid, 14188, 1) else doSendMsg(cid, "Necesitas de 100 Hornored Tokens.") end return true elseif op == 9 then if doPlayerRemoveItem(cid, 15644, 10) then doPlayerAddItem(cid, 12832, 1) else doSendMsg(cid, "Necesitas de 10 Mighty Tokens.") end return true elseif op == 10 then if doPlayerRemoveItem(cid, 15644, 1) then doPlayerAddItem(cid, 15677, 10) doPlayerAddItem(cid, 15676, 10) doPlayerAddItem(cid, 15678, 10) doPlayerAddItem(cid, 15680, 10) doPlayerAddItem(cid, 15673, 10) doPlayerAddItem(cid, 15674, 10) doPlayerAddItem(cid, 15675, 10) doPlayerAddItem(cid, 15679, 10) doPlayerAddItem(cid, 15681, 10) else doSendMsg(cid, "Necesitas de 1 Mighty Tokens.") end return true elseif op == 11 then if doPlayerRemoveItem(cid, 15644, 10) then doPlayerAddItem(cid, 15130, 1) else doSendMsg(cid, "Necesitas de 10 Mighty Tokens.") end return true elseif op == 12 then if doPlayerRemoveItem(cid, 15644, 120) then doPlayerAddItem(cid, 12227, 1) else doSendMsg(cid, "Necesitas de 120 Mighty Tokens.") end return true elseif op == 13 then if doPlayerRemoveItem(cid, 15644, 50) then setPlayerStorageValue(cid, 99990, 1) else doSendMsg(cid, "Necesitas de 50 Mighty Tokens.") end return true elseif op == 14 then if doPlayerRemoveItem(cid, 15644, 10) then doPlayerAddItem(cid, 11641, 1) else doSendMsg(cid, "Necesitas de 10 Mighty Tokens.") end return true elseif op == 15 then if doPlayerRemoveItem(cid, 15644, 1) then doPlayerAddItem(cid, 6569, 1) else doSendMsg(cid, "Necesitas de 1 Mighty Token.") end return true end end end function getSlot(strings, slot) local slot1, slot2, slot3 = strings:explode("|")[1], strings:explode("|")[2], strings:explode("|")[3] local ret, flag = "", false for a, b in pairs(fotos) do if getItemInfo(fotos[a]).clientId == tonumber(slot1) and slot == 1 then ret = doCorrectString(a) flag = true elseif getItemInfo(fotos[a]).clientId == tonumber(slot2) and slot == 2 then ret = doCorrectString(a) flag = true elseif getItemInfo(fotos[a]).clientId == tonumber(slot3) and slot == 3 then ret = doCorrectString(a) flag = true end if flag then break end end return ret end function saveSlot(strings, slot, poke) local slot1, slot2, slot3 = strings:explode("|")[1], strings:explode("|")[2], strings:explode("|")[3] local finalSlots = (slot == 1 and poke .. "|" or slot1 .. "|") .. (slot == 2 and poke .. "|" or slot2 .. "|") .. (slot == 3 and poke .. "|" or slot3) return finalSlots end function isPokeInSlots(strings, poke) if not fotos[poke] then return false end poke = getItemInfo(fotos[poke]).clientId local slot1, slot2, slot3 = strings:explode("|")[1], strings:explode("|")[2], strings:explode("|")[3] if tonumber(slot1) == poke then return true elseif tonumber(slot2) == poke then return true elseif tonumber(slot3) == poke then return true end return false end Tenho certeza que se alguém conseguir resolver isso vai ajudar muitas outras pessoas, o serv eu baixei aqui no Tibia King e era um dos mais baixados tbm.
  9. Pessoal preciso de ajuda, eu não manjo muito de code. preciso que este NPC resete a vida,mana,lvl,cap,skill,ml etc Alguém é da versão 7.92 pode me ajudar? if msgcontains(msg, 'valan') then if getPlayerLevel(cid) >= 500 then if getPlayerVocation(cid) <= 4 then if getPlayerItemCount(cid,13685) >= 10 then doPlayerMagicLevel(cid,10) doPlayerAddSkill(cid,0,10) doPlayerAddSkill(cid,1,10) doPlayerAddSkill(cid,2,10) doPlayerAddSkill(cid,3,10) doPlayerAddSkill(cid,4,10) doPlayerAddSkill(cid,5,10) doPlayerAddSkill(cid,6,10) doPlayerAddExp(cid,4200) doCreatureChangeMaxHealth(cid,185) doCreatureAddHealth(cid,185) doCreatureChangeMaxMana(cid,35) doPlayerAddMana(cid,35) doPlayerSetVocation(cid, getPlayerVocation(cid)+4) selfSay('Parabens, você foi promovido!') doPlayerTakeItem(cid,13685,10) talk_state = 0 else selfSay('Desculpe, você não tem 10kk para ser promovido.') talk_state = 0 end else selfSay('Desculpe, você não tem a vocação correta.') talk_state = 0 end else selfSay('Desculpe, você não é nivel 500 ainda.') talk_state = 0 end
  10. Olá Pessoal do TK venho pedir a ajuda novamente a os mestres do fórum. Tenho um Script de box rand itens funcionando 100%, porem eu gostaria que a box fosse aberta por uma key(item), eu já escolhi o item e tals. Vou postar o código do rand itens e vamos ver se alguém consegue me ajudar. function onUse(cid, item, fromPosition, itemEx, toPosition) local rewarditems = { {id = 11441, chance = 10, count = 1}, {id = 11442, chance = 10, count = 1}, {id = 11443, chance = 10, count = 1}, {id = 11444, chance = 10, count = 1}, {id = 11445, chance = 10, count = 1}, {id = 11446, chance = 10, count = 1}, {id = 11447, chance = 10, count = 1}, {id = 11448, chance = 10, count = 1}, {id = 11449, chance = 10, count = 1}, {id = 11450, chance = 10, count = 1}, {id = 11451, chance = 10, count = 1}, {id = 11452, chance = 10, count = 1} } local box = 13197 --ID da box. local chance = math.random(1,100) for i = 1, #rewarditems, 1 do if(chance < rewarditems[i].chance) then local info = getItemInfo(rewarditems[i].id) if(rewarditems[i].count > 1) then text = rewarditems[i].count .. " " .. info.plural else text = info.article .. " " .. info.name end if item.itemid == box then doPlayerAddItem(cid, rewarditems[i].id, rewarditems[i].count) doPlayerRemoveItem(cid, box, 1) doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) text = "You have received " .. text .. "." else text = "You have failed to open your mystery box. The item is to heavy or you have not enough space to take it." end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, text) return true else chance = chance - rewarditems[i].chance end end end Acredito que este script vai ajudar muita gente que gostaria de fazer eventos do tipo. Obrigado.
  11. Teria como colocar pra consumir os premdays ou premium_points ?
  12. Pessoal, eu consegui resolver. Basta troca de plain para sha1.
  13. Pessoal preciso de uma ajuda aqui O meu site não esta centralizado, eu não conheço muito mas já fiz minhas tentativos, sei que é algo simples como um parâmetro no inicio do cod pra ele e centralizar indiferente da resolução e tal. Olhe a foto a baixa e me fale qual o arquivo que eu devo postar aqui para ser corrigido. Meu WebSite Quem ajuda REP+
  14. BrunoLeo postou uma resposta no tópico em Suporte Tibia OTServer
    Bagon Esta dando Erro. Meu moviments : <!-- Vocation pass --> <movevent type="StepIn" actionid="60138" event="script" value="vocation pass/wizard.lua"/> <movevent type="StepIn" actionid="60238" event="script" value="vocation pass/druid.lua"/> <movevent type="StepIn" actionid="60338" event="script" value="vocation pass/hunter.lua"/> <movevent type="StepIn" actionid="60438" event="script" value="vocation pass/berserker.lua"/> <movevent type="StepIn" actionid="60538" event="script" value="vocation pass/master wizard.lua"/> <movevent type="StepIn" actionid="60638" event="script" value="vocation pass/elder druid.lua"/> <movevent type="StepIn" actionid="60738" event="script" value="vocation pass/royal hunter.lua"/> <movevent type="StepIn" actionid="60838" event="script" value="vocation pass/elite berserker.lua"/> <movevent type="StepIn" actionid="60938" event="script" value="vocation pass/epic wizard.lua"/> <movevent type="StepIn" actionid="61038" event="script" value="vocation pass/epic druid.lua"/> <movevent type="StepIn" actionid="61138" event="script" value="vocation pass/epic hunter.lua"/> <movevent type="StepIn" actionid="61238" event="script" value="vocation pass/epic berserker.lua"/> <movevent type="StepIn" actionid="61338" event="script" value="vocation pass/legendary wizard.lua"/> <movevent type="StepIn" actionid="61438" event="script" value="vocation pass/legendary druid.lua"/> <movevent type="StepIn" actionid="61538" event="script" value="vocation pass/legendary hunter.lua"/> <movevent type="StepIn" actionid="61638" event="script" value="vocation pass/legendary berserker.lua"/> Script das vocation de 1 a 16 : local vocation = 1 function onStepIn(cid, item, position, fromPosition) if getPlayerVocation(cid) ~= vocation then doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid, 18, 'You need to be a '.. getVocationInfo(vocation) ..' to pass.') doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) end return TRUE end Erro no executavel : Start Server Modo Que esta sendo usando no RME : Mapa Editor
  15. BrunoLeo postou uma resposta no tópico em Suporte Tibia OTServer
    Boa tarde galerinha do TK. Dei uma boa olhada no fórum para ver se eu encontrava um tutorial de como fazer um piso para passar apenas uma vocation, e infelizmente não encontrei. ate tem pessoa pedindo e tals, porem não te um tutorial para os mais leigos como eu. Então se alguém puder me passa um tutorial ou fazer um tutorial de como criar um piso que apenas uma vocation passa eu ficaria grato.(é apenas um piso X,Y,Z e não um tipo de piso).
  16. muito Obrigado Kemix, zipter98, LucasAyres. Consegui fazer funcionar, fico da seguinte maneira. Script do 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) 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 CITYID = 3 -- Townid da cidade! local CITYNAME = "castle king" -- Nome da Cidade! local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'}) node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, new_hometown = CITYID, cost = 0, level = 200, promotion = 1, text = 'Congratulations! You are now promoted.'}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true}) return 0 end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) E a parte do Modules fico assim: (eu tirei a parte do PA pra promoted). function StdModule.promotePlayer(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if npcHandler == nil then error("StdModule.promotePlayer called without any npcHandler instance.") end if not npcHandler:isFocused(cid) then return false end local player = Player(cid) if player:getStorageValue(Storage.Promotion) == 1 then npcHandler:say("You are already promoted!", cid) elseif player:getLevel() < parameters.level then npcHandler:say("I am sorry, but I can only promote you once you have reached level " .. parameters.level .. ".", cid) elseif not player:removeMoney(parameters.cost) then npcHandler:say("You do not have enough money!", cid) else if parameters.new_hometown then doPlayerSetTown(cid, parameters.new_hometown) doTeleportThing(cid, getTownTemplePosition(parameters.new_hometown)) end local promotion = player:getVocation():getPromotion() player:setVocation(Vocation(promotion and promotion:getId() or 0)) npcHandler:say(parameters.text, cid) end npcHandler:resetNpc(cid) return true end
  17. zipter98 Não tem este comando no meu modules. setPlayerPromotionLevel(cid, parameters.promotion) npcHandler:say(parameters.text, cid) Vou colocar todo o meu MODULES AQUI em baixo. -- Advanced NPC System by Jiddo if Modules == nil then -- default words for greeting and ungreeting the npc. Should be a table containing all such words. FOCUS_GREETWORDS = {"hi", "hello"} FOCUS_FAREWELLWORDS = {"bye", "farewell"} -- The words for requesting trade window. SHOP_TRADEREQUEST = {"trade"} -- The word for accepting/declining an offer. CAN ONLY CONTAIN ONE FIELD! Should be a table with a single string value. SHOP_YESWORD = {"yes"} SHOP_NOWORD = {"no"} -- Pattern used to get the amount of an item a player wants to buy/sell. PATTERN_COUNT = "%d+" -- Constants used to separate buying from selling. SHOPMODULE_SELL_ITEM = 1 SHOPMODULE_BUY_ITEM = 2 SHOPMODULE_BUY_ITEM_CONTAINER = 3 -- Constants used for shop mode. Notice: addBuyableItemContainer is working on all modes SHOPMODULE_MODE_TALK = 1 -- Old system used before client version 8.2: sell/buy item name SHOPMODULE_MODE_TRADE = 2 -- Trade window system introduced in client version 8.2 SHOPMODULE_MODE_BOTH = 3 -- Both working at one time -- Used shop mode SHOPMODULE_MODE = SHOPMODULE_MODE_BOTH Modules = { parseableModules = {} } StdModule = {} -- These callback function must be called with parameters.npcHandler = npcHandler in the parameters table or they will not work correctly. -- Notice: The members of StdModule have not yet been tested. If you find any bugs, please report them to me. -- Usage: -- keywordHandler:addKeyword({"offer"}, StdModule.say, {npcHandler = npcHandler, text = "I sell many powerful melee weapons."}) function StdModule.say(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if npcHandler == nil then error("StdModule.say called without any npcHandler instance.") end if parameters.onlyFocus == true and parameters.onlyUnfocus == true then error("StdModule.say conflicting parameters 'onlyFocus' and 'onlyUnfocus' both true") end local onlyFocus = (parameters.onlyFocus == nil and parameters.onlyUnfocus == nil or parameters.onlyFocus == true) if not npcHandler:isFocused(cid) and onlyFocus then return false end if npcHandler:isFocused(cid) and parameters.onlyUnfocus == true then return false end local parseInfo = {[TAG_PLAYERNAME] = Player(cid):getName()} npcHandler:say(npcHandler:parseMessage(parameters.text or parameters.message, parseInfo), cid, parameters.publicize and true) if parameters.reset then npcHandler:resetNpc(cid) elseif parameters.moveup ~= nil then npcHandler.keywordHandler:moveUp(parameters.moveup) end return true end --Usage: -- local node1 = keywordHandler:addKeyword({"promot"}, StdModule.say, {npcHandler = npcHandler, text = "I can promote you for 20000 gold coins. Do you want me to promote you?"}) -- node1:addChildKeyword({"yes"}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20}, text = "Congratulations! You are now promoted.") -- node1:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, text = "Allright then. Come back when you are ready."}, reset = true) function StdModule.promotePlayer(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if npcHandler == nil then error("StdModule.promotePlayer called without any npcHandler instance.") end if not npcHandler:isFocused(cid) then return false end local player = Player(cid) if player:getStorageValue(Storage.Promotion) == 1 then npcHandler:say("You are already promoted!", cid) elseif player:getLevel() < parameters.level then npcHandler:say("I am sorry, but I can only promote you once you have reached level " .. parameters.level .. ".", cid) elseif not player:removeMoney(parameters.cost) then npcHandler:say("You do not have enough money!", cid) else local promotion = player:getVocation():getPromotion() player:setVocation(Vocation(promotion and promotion:getId() or 0)) npcHandler:say(parameters.text, cid) end npcHandler:resetNpc(cid) return true end function StdModule.learnSpell(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if npcHandler == nil then error("StdModule.learnSpell called without any npcHandler instance.") end if not npcHandler:isFocused(cid) then return false end local player = Player(cid) if parameters.premium and player:isPremium() then if player:hasLearnedSpell(parameters.spellName) then npcHandler:say("You already know this spell.", cid) elseif player:getLevel() < parameters.level then npcHandler:say("You need to obtain a level of " .. parameters.level .. " or higher to be able to learn " .. parameters.spellName .. ".", cid) elseif player:getVocation():getId() ~= parameters.vocation and player:getVocation():getId() ~= parameters.vocation + 4 and vocation ~= 9 then npcHandler:say("This spell is not for your vocation", cid) elseif not player:removeMoney(parameters.price) then npcHandler:say("You do not have enough money, this spell costs " .. parameters.price .. " gold.", cid) else npcHandler:say("You have learned " .. parameters.spellName .. ".", cid) player:learnSpell(parameters.spellName) end else npcHandler:say("You need a premium account in order to buy " .. parameters.spellName .. ".", cid) end npcHandler:resetNpc(cid) return true end function StdModule.bless(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if npcHandler == nil then error("StdModule.bless called without any npcHandler instance.") end if not npcHandler:isFocused(cid) then return false end local player = Player(cid) if parameters.premium and player:isPremium() then if player:hasBlessing(parameters.bless) then npcHandler:say("Gods have already blessed you with this blessing!", cid) elseif not player:removeMoney(parameters.cost) then npcHandler:say("You don't have enough money for blessing.", cid) else npcHandler:say("You have been blessed by one of the five gods!", cid) player:addBlessing(parameters.bless) end else npcHandler:say("You need a premium account in order to be blessed.", cid) end npcHandler:resetNpc(cid) return true end function StdModule.travel(cid, message, keywords, parameters, node) local npcHandler = parameters.npcHandler if npcHandler == nil then error("StdModule.travel called without any npcHandler instance.") end if not npcHandler:isFocused(cid) then return false end local player = Player(cid) if parameters.premium and not player:isPremium() then npcHandler:say("I'm sorry, but you need a premium account in order to travel onboard our ships.", cid) elseif not player:removeMoney(parameters.cost) then npcHandler:say("You don't have enough money.", cid) elseif parameters.level ~= nil and player:getLevel() < parameters.level then npcHandler:say("You must reach level " .. parameters.level .. " before I can let you go there.", cid) elseif player:isPzLocked() then npcHandler:say("First get rid of those blood stains! You are not going to ruin my vehicle!", cid) else npcHandler:releaseFocus(cid) npcHandler:say(parameters.msg or "Set the sails!", cid) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:teleportTo(parameters.destination) Position(parameters.destination):sendMagicEffect(CONST_ME_TELEPORT) end npcHandler:resetNpc(cid) return true end FocusModule = { npcHandler = nil, greetWords = nil, farewellWords = nil, greetCallback = nil, farewellCallback = nil } -- Creates a new instance of FocusModule without an associated NpcHandler. function FocusModule:new() local obj = {} setmetatable(obj, self) self.__index = self return obj end -- Inits the module and associates handler to it. function FocusModule:init(handler) self.npcHandler = handler local greetWords = self.greetWords or FOCUS_GREETWORDS for i, word in pairs(greetWords) do local obj = {} obj[#obj + 1] = word obj.callback = self.greetCallback or FocusModule.messageMatcherDefault handler.keywordHandler:addKeyword(obj, FocusModule.onGreet, {module = self}) end local farewellWords = self.farewellWords or FOCUS_FAREWELLWORDS for i, word in pairs(farewellWords) do local obj = {} obj[#obj + 1] = word obj.callback = self.farewellCallback or FocusModule.messageMatcherDefault handler.keywordHandler:addKeyword(obj, FocusModule.onFarewell, {module = self}) end return true end -- Set custom greeting messages function FocusModule:addGreetMessage(message) if not self.greetWords then self.greetWords = {} end if type(message) == 'string' then table.insert(self.greetWords, message) else for i = 1, #message do table.insert(self.greetWords, message[i]) end end end -- Set custom farewell messages function FocusModule:addFarewellMessage(message) if not self.farewellWords then self.farewellWords = {} end if type(message) == 'string' then table.insert(self.farewellWords, message) else for i = 1, #message do table.insert(self.farewellWords, message[i]) end end end -- Set custom greeting callback function FocusModule:setGreetCallback(callback) self.greetCallback = callback end -- Set custom farewell callback function FocusModule:setFarewellCallback(callback) self.farewellCallback = callback end -- Greeting callback function. function FocusModule.onGreet(cid, message, keywords, parameters) parameters.module.npcHandler:onGreet(cid, message) return true end -- UnGreeting callback function. function FocusModule.onFarewell(cid, message, keywords, parameters) if parameters.module.npcHandler:isFocused(cid) then parameters.module.npcHandler:onFarewell(cid) return true else return false end end -- Custom message matching callback function for greeting messages. function FocusModule.messageMatcherDefault(keywords, message) for i, word in pairs(keywords) do if type(word) == "string" then if string.find(message, word) and not string.find(message, "[%w+]" .. word) and not string.find(message, word .. "[%w+]") then return true end end end return false end function FocusModule.messageMatcherStart(keywords, message) for i, word in pairs(keywords) do if type(word) == "string" then if string.starts(message, word) then return true end end end return false end KeywordModule = { npcHandler = nil } -- Add it to the parseable module list. Modules.parseableModules["module_keywords"] = KeywordModule function KeywordModule:new() local obj = {} setmetatable(obj, self) self.__index = self return obj end function KeywordModule:init(handler) self.npcHandler = handler return true end -- Parses all known parameters. function KeywordModule:parseParameters() local ret = NpcSystem.getParameter("keywords") if ret ~= nil then self:parseKeywords(ret) end end function KeywordModule:parseKeywords(data) local n = 1 for keys in string.gmatch(data, "[^;]+") do local i = 1 local keywords = {} for temp in string.gmatch(keys, "[^,]+") do keywords[#keywords + 1] = temp i = i + 1 end if i ~= 1 then local reply = NpcSystem.getParameter("keyword_reply" .. n) if reply ~= nil then self:addKeyword(keywords, reply) else print("[Warning : " .. Npc():getName() .. "] NpcSystem:", "Parameter '" .. "keyword_reply" .. n .. "' missing. Skipping...") end else print("[Warning : " .. Npc():getName() .. "] NpcSystem:", "No keywords found for keyword set #" .. n .. ". Skipping...") end n = n+1 end end function KeywordModule:addKeyword(keywords, reply) self.npcHandler.keywordHandler:addKeyword(keywords, StdModule.say, {npcHandler = self.npcHandler, onlyFocus = true, text = reply, reset = true}) end TravelModule = { npcHandler = nil, destinations = nil, yesNode = nil, noNode = nil, } -- Add it to the parseable module list. Modules.parseableModules["module_travel"] = TravelModule function TravelModule:new() local obj = {} setmetatable(obj, self) self.__index = self return obj end function TravelModule:init(handler) self.npcHandler = handler self.yesNode = KeywordNode:new(SHOP_YESWORD, TravelModule.onConfirm, {module = self}) self.noNode = KeywordNode:new(SHOP_NOWORD, TravelModule.onDecline, {module = self}) self.destinations = {} return true end -- Parses all known parameters. function TravelModule:parseParameters() local ret = NpcSystem.getParameter("travel_destinations") if ret ~= nil then self:parseDestinations(ret) self.npcHandler.keywordHandler:addKeyword({"destination"}, TravelModule.listDestinations, {module = self}) self.npcHandler.keywordHandler:addKeyword({"where"}, TravelModule.listDestinations, {module = self}) self.npcHandler.keywordHandler:addKeyword({"travel"}, TravelModule.listDestinations, {module = self}) end end function TravelModule:parseDestinations(data) for destination in string.gmatch(data, "[^;]+") do local i = 1 local name = nil local x = nil local y = nil local z = nil local cost = nil local premium = false for temp in string.gmatch(destination, "[^,]+") do if i == 1 then name = temp elseif i == 2 then x = tonumber(temp) elseif i == 3 then y = tonumber(temp) elseif i == 4 then z = tonumber(temp) elseif i == 5 then cost = tonumber(temp) elseif i == 6 then premium = temp == "true" else print("[Warning : " .. Npc():getName() .. "] NpcSystem:", "Unknown parameter found in travel destination parameter.", temp, destination) end i = i + 1 end if(name ~= nil and x ~= nil and y ~= nil and z ~= nil and cost ~= nil) then self:addDestination(name, {x=x, y=y, z=z}, cost, premium) else print("[Warning : " .. Npc():getName() .. "] NpcSystem:", "Parameter(s) missing for travel destination:", name, x, y, z, cost, premium) end end end function TravelModule:addDestination(name, position, price, premium) self.destinations[#self.destinations + 1] = name local parameters = { cost = price, destination = position, premium = premium, module = self } local keywords = {} keywords[#keywords + 1] = name local keywords2 = {} keywords2[#keywords2 + 1] = "bring me to " .. name local node = self.npcHandler.keywordHandler:addKeyword(keywords, TravelModule.travel, parameters) self.npcHandler.keywordHandler:addKeyword(keywords2, TravelModule.bringMeTo, parameters) node:addChildKeywordNode(self.yesNode) node:addChildKeywordNode(self.noNode) if npcs_loaded_travel[getNpcCid()] == nil then npcs_loaded_travel[getNpcCid()] = getNpcCid() self.npcHandler.keywordHandler:addKeyword({'yes'}, TravelModule.onConfirm, {module = self}) self.npcHandler.keywordHandler:addKeyword({'no'}, TravelModule.onDecline, {module = self}) end end function TravelModule.travel(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end local npcHandler = module.npcHandler shop_destination[cid] = parameters.destination shop_cost[cid] = parameters.cost shop_premium[cid] = parameters.premium shop_npcuid[cid] = getNpcCid() local cost = parameters.cost local destination = parameters.destination local premium = parameters.premium module.npcHandler:say("Do you want to travel to " .. keywords[1] .. " for " .. cost .. " gold coins?", cid) return true end function TravelModule.onConfirm(cid, message, keywords, parameters, node) local module = parameters.module if not module.npcHandler:isFocused(cid) then return false end if shop_npcuid[cid] ~= getNpcCid() then return false end local npcHandler = module.npcHandler local parentParameters = node:getParent():getParameters() local cost = shop_cost[cid] local destination = shop_destination[cid] local premium = shop_premium[cid] local player = Player(cid) if not isPlayerPremiumCallback or isPlayerPremiumCallback(player) or shop_premium[cid] ~= true then if player:removeMoney(cost) ~= TRUE then npcHandler:say("You do not have enough money!", cid) elseif player:isPzLocked() then npcHandler:say("Get out of there with this blood.", cid) else npcHandler:say("It was a pleasure doing business with you.", cid) npcHandler:releaseFocus(cid) -- Todo convert all destionation parameters to Position(x, y, z) instead of lua tables player:teleportTo(destination) Position(destination):sendMagicEffect(CONST_ME_TELEPORT) end else npcHandler:say("I can only allow premium players to travel there.", cid) end npcHandler:resetNpc(cid) return true end -- onDecline keyword callback function. Generally called when the player sais "no" after wanting to buy an item. function TravelModule.onDecline(cid, message, keywords, parameters, node) local module = parameters.module if not module.npcHandler:isFocused(cid) or shop_npcuid[cid] ~= getNpcCid() then return false end local parentParameters = node:getParent():getParameters() local parseInfo = { [TAG_PLAYERNAME] = Player(cid):getName() } local msg = module.npcHandler:parseMessage(module.npcHandler:getMessage(MESSAGE_DECLINE), parseInfo) module.npcHandler:say(msg, cid) module.npcHandler:resetNpc(cid) return true end function TravelModule.bringMeTo(cid, message, keywords, parameters, node) local module = parameters.module if not module.npcHandler:isFocused(cid) then return false end local cost = parameters.cost local destination = parameters.destination local premium = parameters.premium if(not isPlayerPremiumCallback or isPlayerPremiumCallback(cid) or parameters.premium ~= true) then local player = Player(cid) if player:removeMoney(cost) then player:teleportTo(destination) Position(destination):sendMagicEffect(CONST_ME_TELEPORT) end end return true end function TravelModule.listDestinations(cid, message, keywords, parameters, node) local module = parameters.module if not module.npcHandler:isFocused(cid) then return false end local msg = "I can bring you to " --local i = 1 local maxn = #module.destinations for i, destination in pairs(module.destinations) do msg = msg .. destination if i == maxn - 1 then msg = msg .. " and " elseif i == maxn then msg = msg .. "." else msg = msg .. ", " end i = i + 1 end module.npcHandler:say(msg, cid) module.npcHandler:resetNpc(cid) return true end ShopModule = { npcHandler = nil, yesNode = nil, noNode = nil, noText = "", maxCount = 100, amount = 0 } -- Add it to the parseable module list. Modules.parseableModules["module_shop"] = ShopModule -- Creates a new instance of ShopModule function ShopModule:new() local obj = {} setmetatable(obj, self) self.__index = self return obj end -- Parses all known parameters. function ShopModule:parseParameters() local ret = NpcSystem.getParameter("shop_buyable") if ret ~= nil then self:parseBuyable(ret) end local ret = NpcSystem.getParameter("shop_sellable") if ret ~= nil then self:parseSellable(ret) end local ret = NpcSystem.getParameter("shop_buyable_containers") if ret ~= nil then self:parseBuyableContainers(ret) end end -- Parse a string contaning a set of buyable items. function ShopModule:parseBuyable(data) for item in string.gmatch(data, "[^;]+") do local i = 1 local name = nil local itemid = nil local cost = nil local subType = nil local realName = nil for temp in string.gmatch(item, "[^,]+") do if i == 1 then name = temp elseif i == 2 then itemid = tonumber(temp) elseif i == 3 then cost = tonumber(temp) elseif i == 4 then subType = tonumber(temp) elseif i == 5 then realName = temp else print("[Warning : " .. Npc():getName() .. "] NpcSystem:", "Unknown parameter found in buyable items parameter.", temp, item) end i = i + 1 end if SHOPMODULE_MODE == SHOPMODULE_MODE_TRADE then if itemid ~= nil and cost ~= nil then if subType == nil and ItemType(itemid):isFluidContainer() then print("[Warning : " .. Npc():getName() .. "] NpcSystem:", "SubType missing for parameter item:", item) else self:addBuyableItem(nil, itemid, cost, subType, realName) end else print("[Warning : " .. Npc():getName() .. "] NpcSystem:", "Parameter(s) missing for item:", itemid, cost) end else if name ~= nil and itemid ~= nil and cost ~= nil then if subType == nil and ItemType(itemid):isFluidContainer() then print("[Warning : " .. Npc():getName() .. "] NpcSystem:", "SubType missing for parameter item:", item) else local names = {} names[#names + 1] = name self:addBuyableItem(names, itemid, cost, subType, realName) end else print("[Warning : " .. Npc():getName() .. "] NpcSystem:", "Parameter(s) missing for item:", name, itemid, cost) end end end end -- Parse a string contaning a set of sellable items. function ShopModule:parseSellable(data) for item in string.gmatch(data, "[^;]+") do local i = 1 local name = nil local itemid = nil local cost = nil local realName = nil local subType = nil for temp in string.gmatch(item, "[^,]+") do if i == 1 then name = temp elseif i == 2 then itemid = tonumber(temp) elseif i == 3 then cost = tonumber(temp) elseif i == 4 then realName = temp elseif i == 5 then subType = tonumber(temp) else print("[Warning : " .. Npc():getName() .. "] NpcSystem:", "Unknown parameter found in sellable items parameter.", temp, item) end i = i + 1 end if SHOPMODULE_MODE == SHOPMODULE_MODE_TRADE then if itemid ~= nil and cost ~= nil then self:addSellableItem(nil, itemid, cost, realName, subType) else print("[Warning : " .. Npc():getName() .. "] NpcSystem:", "Parameter(s) missing for item:", itemid, cost) end else if name ~= nil and itemid ~= nil and cost ~= nil then local names = {} names[#names + 1] = name self:addSellableItem(names, itemid, cost, realName, subType) else print("[Warning : " .. Npc():getName() .. "] NpcSystem:", "Parameter(s) missing for item:", name, itemid, cost) end end end end -- Parse a string contaning a set of buyable items. function ShopModule:parseBuyableContainers(data) for item in string.gmatch(data, "[^;]+") do local i = 1 local name = nil local container = nil local itemid = nil local cost = nil local subType = nil local realName = nil for temp in string.gmatch(item, "[^,]+") do if i == 1 then name = temp elseif i == 2 then itemid = tonumber(temp) elseif i == 3 then itemid = tonumber(temp) elseif i == 4 then cost = tonumber(temp) elseif i == 5 then subType = tonumber(temp) elseif i == 6 then realName = temp else print("[Warning : " .. Npc():getName() .. "] NpcSystem:", "Unknown parameter found in buyable items parameter.", temp, item) end i = i + 1 end if name ~= nil and container ~= nil and itemid ~= nil and cost ~= nil then if subType == nil and ItemType(itemid):isFluidContainer() then print("[Warning : " .. Npc():getName() .. "] NpcSystem:", "SubType missing for parameter item:", item) else local names = {} names[#names + 1] = name self:addBuyableItemContainer(names, container, itemid, cost, subType, realName) end else print("[Warning : " .. Npc():getName() .. "] NpcSystem:", "Parameter(s) missing for item:", name, container, itemid, cost) end end end -- Initializes the module and associates handler to it. function ShopModule:init(handler) self.npcHandler = handler self.yesNode = KeywordNode:new(SHOP_YESWORD, ShopModule.onConfirm, {module = self}) self.noNode = KeywordNode:new(SHOP_NOWORD, ShopModule.onDecline, {module = self}) self.noText = handler:getMessage(MESSAGE_DECLINE) if SHOPMODULE_MODE ~= SHOPMODULE_MODE_TALK then for i, word in pairs(SHOP_TRADEREQUEST) do local obj = {} obj[#obj + 1] = word obj.callback = SHOP_TRADEREQUEST.callback or ShopModule.messageMatcher handler.keywordHandler:addKeyword(obj, ShopModule.requestTrade, {module = self}) end end return true end -- Custom message matching callback function for requesting trade messages. function ShopModule.messageMatcher(keywords, message) for i, word in pairs(keywords) do if type(word) == "string" then if string.find(message, word) and not string.find(message, "[%w+]" .. word) and not string.find(message, word .. "[%w+]") then return true end end end return false end -- Resets the module-specific variables. function ShopModule:reset() self.amount = 0 end -- Function used to match a number value from a string. function ShopModule:getCount(message) local ret = 1 local b, e = string.find(message, PATTERN_COUNT) if b ~= nil and e ~= nil then ret = tonumber(string.sub(message, b, e)) end if ret <= 0 then ret = 1 elseif ret > self.maxCount then ret = self.maxCount end return ret end -- Adds a new buyable item. -- names = A table containing one or more strings of alternative names to this item. Used only for old buy/sell system. -- itemid = The itemid of the buyable item -- cost = The price of one single item -- subType - The subType of each rune or fluidcontainer item. Can be left out if it is not a rune/fluidcontainer. Default value is 1. -- realName - The real, full name for the item. Will be used as ITEMNAME in MESSAGE_ONBUY and MESSAGE_ONSELL if defined. Default value is nil (getName will be used) function ShopModule:addBuyableItem(names, itemid, cost, itemSubType, realName) if SHOPMODULE_MODE ~= SHOPMODULE_MODE_TALK then if itemSubType == nil then itemSubType = 1 end local shopItem = self:getShopItem(itemid, itemSubType) if shopItem == nil then self.npcHandler.shopItems[#self.npcHandler.shopItems + 1] = {id = itemid, buy = cost, sell = -1, subType = itemSubType, name = realName or ItemType(itemid):getName()} else shopItem.buy = cost end end if names ~= nil and SHOPMODULE_MODE ~= SHOPMODULE_MODE_TRADE then for i, name in pairs(names) do local parameters = { itemid = itemid, cost = cost, eventType = SHOPMODULE_BUY_ITEM, module = self, realName = realName or ItemType(itemid):getName(), subType = itemSubType or 1 } keywords = {} keywords[#keywords + 1] = "buy" keywords[#keywords + 1] = name local node = self.npcHandler.keywordHandler:addKeyword(keywords, ShopModule.tradeItem, parameters) node:addChildKeywordNode(self.yesNode) node:addChildKeywordNode(self.noNode) end end if npcs_loaded_shop[getNpcCid()] == nil then npcs_loaded_shop[getNpcCid()] = getNpcCid() self.npcHandler.keywordHandler:addKeyword({'yes'}, ShopModule.onConfirm, {module = self}) self.npcHandler.keywordHandler:addKeyword({'no'}, ShopModule.onDecline, {module = self}) end end function ShopModule:getShopItem(itemId, itemSubType) if ItemType(itemId):isFluidContainer() then for i = 1, #self.npcHandler.shopItems do local shopItem = self.npcHandler.shopItems[i] if shopItem.id == itemId and shopItem.subType == itemSubType then return shopItem end end else for i = 1, #self.npcHandler.shopItems do local shopItem = self.npcHandler.shopItems[i] if shopItem.id == itemId then return shopItem end end end return nil end -- Adds a new buyable container of items. -- names = A table containing one or more strings of alternative names to this item. -- container = Backpack, bag or any other itemid of container where bought items will be stored -- itemid = The itemid of the buyable item -- cost = The price of one single item -- subType - The subType of each rune or fluidcontainer item. Can be left out if it is not a rune/fluidcontainer. Default value is 1. -- realName - The real, full name for the item. Will be used as ITEMNAME in MESSAGE_ONBUY and MESSAGE_ONSELL if defined. Default value is nil (getName will be used) function ShopModule:addBuyableItemContainer(names, container, itemid, cost, subType, realName) if names ~= nil then for i, name in pairs(names) do local parameters = { container = container, itemid = itemid, cost = cost, eventType = SHOPMODULE_BUY_ITEM_CONTAINER, module = self, realName = realName or ItemType(itemid):getName(), subType = subType or 1 } keywords = {} keywords[#keywords + 1] = "buy" keywords[#keywords + 1] = name local node = self.npcHandler.keywordHandler:addKeyword(keywords, ShopModule.tradeItem, parameters) node:addChildKeywordNode(self.yesNode) node:addChildKeywordNode(self.noNode) end end end -- Adds a new sellable item. -- names = A table containing one or more strings of alternative names to this item. Used only by old buy/sell system. -- itemid = The itemid of the sellable item -- cost = The price of one single item -- realName - The real, full name for the item. Will be used as ITEMNAME in MESSAGE_ONBUY and MESSAGE_ONSELL if defined. Default value is nil (getName will be used) function ShopModule:addSellableItem(names, itemid, cost, realName, itemSubType) if SHOPMODULE_MODE ~= SHOPMODULE_MODE_TALK then if itemSubType == nil then itemSubType = 0 end local shopItem = self:getShopItem(itemid, itemSubType) if shopItem == nil then table.insert(self.npcHandler.shopItems, {id = itemid, buy = -1, sell = cost, subType = itemSubType, name = realName or ItemType(itemid):getName()}) else shopItem.sell = cost end end if(names ~= nil and SHOPMODULE_MODE ~= SHOPMODULE_MODE_TRADE) then for i, name in pairs(names) do local parameters = { itemid = itemid, cost = cost, eventType = SHOPMODULE_SELL_ITEM, module = self, realName = realName or ItemType(itemid):getName() } keywords = {} table.insert(keywords, "sell") table.insert(keywords, name) local node = self.npcHandler.keywordHandler:addKeyword(keywords, ShopModule.tradeItem, parameters) node:addChildKeywordNode(self.yesNode) node:addChildKeywordNode(self.noNode) end end end -- onModuleReset callback function. Calls ShopModule:reset() function ShopModule:callbackOnModuleReset() self:reset() return true end -- Callback onBuy() function. If you wish, you can change certain Npc to use your onBuy(). function ShopModule:callbackOnBuy(cid, itemid, subType, amount, ignoreCap, inBackpacks) local shopItem = self:getShopItem(itemid, subType) if shopItem == nil then error("[ShopModule.onBuy] shopItem == nil") return false end if shopItem.buy == -1 then error("[ShopModule.onSell] attempt to buy a non-buyable item") return false end local backpack = 1988 local totalCost = amount * shopItem.buy if inBackpacks then totalCost = ItemType(itemid):isStackable() and totalCost + 20 or totalCost + (math.max(1, math.floor(amount / ItemType(backpack):getCapacity())) * 20) end local player = Player(cid) local parseInfo = { [TAG_PLAYERNAME] = player:getName(), [TAG_ITEMCOUNT] = amount, [TAG_TOTALCOST] = totalCost, [TAG_ITEMNAME] = shopItem.name } if player:getMoney() < totalCost then local msg = self.npcHandler:getMessage(MESSAGE_NEEDMONEY) msg = self.npcHandler:parseMessage(msg, parseInfo) player:sendCancelMessage(msg) return false end local subType = shopItem.subType or 1 local a, b = doNpcSellItem(cid, itemid, amount, subType, ignoreCap, inBackpacks, backpack) if(a < amount) then local msgId = MESSAGE_NEEDMORESPACE if(a == 0) then msgId = MESSAGE_NEEDSPACE end local msg = self.npcHandler:getMessage(msgId) parseInfo[TAG_ITEMCOUNT] = a msg = self.npcHandler:parseMessage(msg, parseInfo) player:sendCancelMessage(msg) self.npcHandler.talkStart[cid] = os.time() if(a > 0) then player:removeMoney((a * shopItem.buy) + (b * 20)) return true end return false else local msg = self.npcHandler:getMessage(MESSAGE_BOUGHT) msg = self.npcHandler:parseMessage(msg, parseInfo) player:sendTextMessage(MESSAGE_INFO_DESCR, msg) player:removeMoney(totalCost) self.npcHandler.talkStart[cid] = os.time() return true end end -- Callback onSell() function. If you wish, you can change certain Npc to use your onSell(). function ShopModule:callbackOnSell(cid, itemid, subType, amount, ignoreEquipped, _) local shopItem = self:getShopItem(itemid, subType) if shopItem == nil then error("[ShopModule.onSell] items[itemid] == nil") return false end if shopItem.sell == -1 then error("[ShopModule.onSell] attempt to sell a non-sellable item") return false end local player = Player(cid) local parseInfo = { [TAG_PLAYERNAME] = player:getName(), [TAG_ITEMCOUNT] = amount, [TAG_TOTALCOST] = amount * shopItem.sell, [TAG_ITEMNAME] = shopItem.name } if not ItemType(itemid):isFluidContainer() then subType = -1 end if player:removeItem(itemid, amount, subType, ignoreEquipped) then local msg = self.npcHandler:getMessage(MESSAGE_SOLD) msg = self.npcHandler:parseMessage(msg, parseInfo) player:sendTextMessage(MESSAGE_INFO_DESCR, msg) player:addMoney(amount * shopItem.sell) self.npcHandler.talkStart[cid] = os.time() return true else local msg = self.npcHandler:getMessage(MESSAGE_NEEDITEM) msg = self.npcHandler:parseMessage(msg, parseInfo) player:sendCancelMessage(msg) self.npcHandler.talkStart[cid] = os.time() return false end end -- Callback for requesting a trade window with the NPC. function ShopModule.requestTrade(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end if(not module.npcHandler:onTradeRequest(cid)) then return false end local itemWindow = {} for i = 1, #module.npcHandler.shopItems do table.insert(itemWindow, module.npcHandler.shopItems[i]) end if(itemWindow[1] == nil) then local parseInfo = { [TAG_PLAYERNAME] = Player(cid):getName() } local msg = module.npcHandler:parseMessage(module.npcHandler:getMessage(MESSAGE_NOSHOP), parseInfo) module.npcHandler:say(msg, cid) return true end local parseInfo = { [TAG_PLAYERNAME] = Player(cid):getName() } local msg = module.npcHandler:parseMessage(module.npcHandler:getMessage(MESSAGE_SENDTRADE), parseInfo) openShopWindow(cid, itemWindow, function(cid, itemid, subType, amount, ignoreCap, inBackpacks) module.npcHandler:onBuy(cid, itemid, subType, amount, ignoreCap, inBackpacks) end, function(cid, itemid, subType, amount, ignoreCap, inBackpacks) module.npcHandler:onSell(cid, itemid, subType, amount, ignoreCap, inBackpacks) end) module.npcHandler:say(msg, cid) return true end -- onConfirm keyword callback function. Sells/buys the actual item. function ShopModule.onConfirm(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) or shop_npcuid[cid] ~= getNpcCid() then return false end shop_npcuid[cid] = 0 local parentParameters = node:getParent():getParameters() local parseInfo = { [TAG_PLAYERNAME] = Player(cid):getName(), [TAG_ITEMCOUNT] = shop_amount[cid], [TAG_TOTALCOST] = shop_cost[cid] * shop_amount[cid], [TAG_ITEMNAME] = shop_rlname[cid] } if(shop_eventtype[cid] == SHOPMODULE_SELL_ITEM) then local ret = doPlayerSellItem(cid, shop_itemid[cid], shop_amount[cid], shop_cost[cid] * shop_amount[cid]) if(ret == LUA_NO_ERROR) then local msg = module.npcHandler:getMessage(MESSAGE_ONSELL) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) else local msg = module.npcHandler:getMessage(MESSAGE_MISSINGITEM) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) end elseif(shop_eventtype[cid] == SHOPMODULE_BUY_ITEM) then local cost = shop_cost[cid] * shop_amount[cid] if Player(cid):getMoney() < cost then local msg = module.npcHandler:getMessage(MESSAGE_MISSINGMONEY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) return false end local a, b = doNpcSellItem(cid, shop_itemid[cid], shop_amount[cid], shop_subtype[cid], false, false, 1988) if(a < shop_amount[cid]) then local msgId = MESSAGE_NEEDMORESPACE if(a == 0) then msgId = MESSAGE_NEEDSPACE end local msg = module.npcHandler:getMessage(msgId) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) if(a > 0) then Player(cid):removeMoney(a * shop_cost[cid]) if shop_itemid[cid] == ITEM_PARCEL then doNpcSellItem(cid, ITEM_LABEL, shop_amount[cid], shop_subtype[cid], true, false, 1988) end return true end return false else local msg = module.npcHandler:getMessage(MESSAGE_ONBUY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) Player(cid):removeMoney(cost) if shop_itemid[cid] == ITEM_PARCEL then doNpcSellItem(cid, ITEM_LABEL, shop_amount[cid], shop_subtype[cid], true, false, 1988) end return true end elseif(shop_eventtype[cid] == SHOPMODULE_BUY_ITEM_CONTAINER) then local ret = doPlayerBuyItemContainer(cid, shop_container[cid], shop_itemid[cid], shop_amount[cid], shop_cost[cid] * shop_amount[cid], shop_subtype[cid]) if(ret == LUA_NO_ERROR) then local msg = module.npcHandler:getMessage(MESSAGE_ONBUY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) else local msg = module.npcHandler:getMessage(MESSAGE_MISSINGMONEY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) end end module.npcHandler:resetNpc(cid) return true end -- onDecline keyword callback function. Generally called when the player sais "no" after wanting to buy an item. function ShopModule.onDecline(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) or shop_npcuid[cid] ~= getNpcCid() then return false end shop_npcuid[cid] = 0 local parentParameters = node:getParent():getParameters() local parseInfo = { [TAG_PLAYERNAME] = Player(cid):getName(), [TAG_ITEMCOUNT] = shop_amount[cid], [TAG_TOTALCOST] = shop_cost[cid] * shop_amount[cid], [TAG_ITEMNAME] = shop_rlname[cid] } local msg = module.npcHandler:parseMessage(module.noText, parseInfo) module.npcHandler:say(msg, cid) module.npcHandler:resetNpc(cid) return true end -- tradeItem callback function. Makes the npc say the message defined by MESSAGE_BUY or MESSAGE_SELL function ShopModule.tradeItem(cid, message, keywords, parameters, node) local module = parameters.module if(not module.npcHandler:isFocused(cid)) then return false end if(not module.npcHandler:onTradeRequest(cid)) then return true end local count = module:getCount(message) module.amount = count shop_amount[cid] = module.amount shop_cost[cid] = parameters.cost shop_rlname[cid] = parameters.realName shop_itemid[cid] = parameters.itemid shop_container[cid] = parameters.container shop_npcuid[cid] = getNpcCid() shop_eventtype[cid] = parameters.eventType shop_subtype[cid] = parameters.subType local parseInfo = { [TAG_PLAYERNAME] = Player(cid):getName(), [TAG_ITEMCOUNT] = shop_amount[cid], [TAG_TOTALCOST] = shop_cost[cid] * shop_amount[cid], [TAG_ITEMNAME] = shop_rlname[cid] } if(shop_eventtype[cid] == SHOPMODULE_SELL_ITEM) then local msg = module.npcHandler:getMessage(MESSAGE_SELL) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) elseif(shop_eventtype[cid] == SHOPMODULE_BUY_ITEM) then local msg = module.npcHandler:getMessage(MESSAGE_BUY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) elseif(shop_eventtype[cid] == SHOPMODULE_BUY_ITEM_CONTAINER) then local msg = module.npcHandler:getMessage(MESSAGE_BUY) msg = module.npcHandler:parseMessage(msg, parseInfo) module.npcHandler:say(msg, cid) end return true end end
  18. LucasAyres Infelizmente isso não da certo, pq se a pessoa falar "no" ele tbm executa e função, precisa colocar dentro do escolha caso, ali no caso Node1 (YES). já tentei varias vezes mas da erro com isso aqui ")", acredito que eu não esteja sabendo colocar o cod dentro.
  19. Boa tarde pessoal, Estou a um bom tempo tentando fazer um cod funcionar e não consigo e é extremamente simples kkkk. Se alguém com conhecimento em programação puder me ajuda ganha em REP+. Eu preciso que esta parte do cod if (getPlayerTown(cid) ~= CITYID) then doPlayerSetTown(cid, CITYID) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) Fique dentro do Escolha 1 (Yes) deste script de 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) 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 CITYID = 3 -- Townid da cidade! local CITYNAME = "castle king" -- Nome da Cidade! local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'}) node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 0, level = 200, promotion = 1, text = 'Congratulations! You are now promoted.'}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true}) return 0 end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Este script vai trocar o ID Town do jogador e teleporta ele para o nova ID Town Obrigado
  20. ja ta no link
  21. Muito obrigado Wise porem esta dando erro. Erro
  22. É isso sim, se possível não comba e dar o aviso acho que é melhor Obrigado pela atenção galerinha.

Informação Importante

Confirmação de Termo