Ir para conteúdo

joaohd

Visconde
  • Total de itens

    361
  • Registro em

  • Última visita

  • Dias Ganhos

    10

Tudo que joaohd postou

  1. Na hora de salvar o seu itens.xml, mude a codificação de "ANSI" para "uft-8". Você encontra isso abrindo o itens.xml com o bloco de notas. Depois coloca "Salvar como..." e abaixo do nome do arquivo, escolha a codificação correta. flw
  2. A magia está meio confusa... local distanceCombat = createCombatObject() setCombatParam(distanceCombat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE) setCombatParam(distanceCombat, COMBAT_PARAM_EFFECT, CONST_ME_GREEN_RINGS) setCombatParam(distanceCombat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISON) setCombatFormula(distanceCombat, COMBAT_FORMULA_LEVELMAGIC, -0.4, 0, -0.5, 0) local area = createCombatArea(AREA_CIRCLE3X3) setCombatArea(distanceCombat, area) function onCastSpell(cid, var) return doCombat(cid, distanceCombat, var) end flw
  3. Devilmoon, eu já havia feito a algum tempo: Introdução à programação LUA flw
  4. Tente: local config = { pos = {x = 180, y = 57, z = 7}, topos = {x = 181, y = 57, z = 7}, id = 2703 } function onUse(cid, item) if item.itemid == 1945 then if getTileItemById(config.pos, config.id) then doRemoveItem(getTileItemById(config.pos, config.id).uid, 1) doTransformItem(item.uid, item.itemid+1) doCreateItem(config.id, config.topos, 1) else doPlayerSendCancel(cid, "Sorry, not possible.") end elseif item.itemid == 1946 then if getTileItemById(config.topos, config.id) then doRemoveItem(getTileItemById(config.topos, config.id).uid, 1) doTransformItem(item.uid, item.itemid-1) doCreateItem(config.id, config.pos, 1) else doPlayerSendCancel(cid, "Sorry, not possible.") end end return TRUE end flw
  5. joaohd

    [Npc]

    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
  6. joaohd

    [Npc]

    Mostre o script do seu npc para que eu possa verificar. Ou procure por pzLocked = true flw
  7. joaohd

    [Npc]

    Isso são configurações no npc. Procure um npc de travel e verifique se está pz = true. flw
  8. Creio que não funcionará... Você declarou a variável "parede" dentro do escopo da função criar(). Como é uma função local, ao ser chamada pelo "if parede then", de duas uma: Ou retornará false e interromperá o script ou gerará erro de variável não declarada. flw
  9. Simplesmente coloque um unqueid na escada ou buraco e crie o script para ele. flw
  10. Tente usar um moveevent onStepIn. exemplo: function onStepIn(cid, item, pos, frompos) if frompos.x == 150 and frompos.y == 50 and frompos.z == 7 then doPlayerSendTextMessage(cid, 25, "Você veio da posição {x=150, y=50, z=7}") else doPlayerSendTextMessage(cid, 25, "Você não veio da posição {x=150, y=50, z=7}") doTeleportThing(cid, frompos) end return TRUE end flw
  11. Ahashashahsah eita comedinhasss, gostou desse botãozinho hein... Bom, como prometido, aqui está a versão não finalizada ainda: Quem quiser ajudar, informe =D. flw
  12. joaohd

    Como Fazer Quest?

    Eu prefiro usar este: local quests = { [8600] = {storageId = 8600, rewardId = 2439, count = 1}, } function doQuest(cid, quest, checkCap) if getPlayerStorageValue(cid, quest.storageId) == -1 then if checkCap and (getPlayerFreeCap(cid) < getItemWeight(quest.rewardId)*quest.count) then doPlayerSendCancel(cid, "You have found a " .. getItemNameById(quest.rewardId) .. "weighing " .. getItemWeight(reward.uid) .. " oz. It is too heavy.") end doPlayerAddItem(cid, quest.rewardId, quest.count) doPlayerSendTextMessage(cid, 25, "You have found " .. quest.count .. " " .. getItemNameById(quest.rewardId) ..".") setPlayerStorageValue(cid, quest.storageId, 1) else doPlayerSendCancel(cid, "It is empty.") end return TRUE end function onUse(cid, item) if quests[item.uid] ~= nil then doQuest(cid, quests[item.uid], true) end return TRUE end Somente adicionar mais quests na tabela "quests" e o uniqueid no actions.xml flw
  13. joaohd

    [Npc]

    Compare as estruturas: 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 local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid function msgCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if(msgcontains(msg, 'favor')) then npcHandler:say("I need you to pick 10 talons for me. You can do it?") talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then npcHandler:say("Oh... Thanks a lot. Just be sure you come with the talons ok? {bye}") setPlayerStorageValue(cid, 8791, 1) elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) then npcHandles:say("Come other time, when you're ready. Don't mess with me.") end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, msgCallback) npcHandler:addModule(FocusModule:new()) flw
  14. joaohd

    Erro Pvp Arena

    Tente: function onUse(cid, item) local config = { {x=32367, y=31780, z=9, stackpos=253} = {x=32346, y=31781, z=10}, {x=32367, y=31782, z=9, stackpos=253} = {x=32365, y=31782, z=10} } local arena ={ topLeftPos = {x = 32346, y = 32365, z = 10}, lowerRightPos = {x = 31778, y = 31783, z = 10 } if item.itemid == 1945 then for from, to in pairs(config) do if isPlayer(getThingfromPos(from).uid) then if getPlayerLevel(getThingfromPos(from).uid) >= 30 then for arX = arena.topLeftPos.x, arena.lowerRightPos.x do for arY = arena.topLeftPos.y, arena.lowerRightPos.y do areaArena = {x = arX, y = arY, z = arena.topLeftPos.z, stackpos = 253} if getThingfromPos(areaArena).uid ~= 0 then doPlayerSendCancel(cid, "Wait for current duel to end.") doTransformItem(item.uid, .item.itemid+1) else doTeleportThing(getThingfromPos(from).uid, to) doTransformItem(item.uid, .item.itemid+1) end end end else doPlayerSendCancel(cid, "Both players must be level 30 or higher.") doTransformItem(item.uid, .item.itemid+1) end else doPlayerSendCancel(cid, "Both fighters must to be players.") doTransformItem(item.uid, .item.itemid+1) end end elseif item.itemid == 1946 then doTransformItem(item.uid, .item.itemid-1) end return TRUE end Editado: Já foi resolvido... Reportado para moverem flw
  15. Ashashahsahshas ta todo mundo me pedindo isso já =x Dei uma desanimada mas vo ve se adianto o q falta. De tarde eu posto o q ja fiz, caso alguém queira me ajudar... flw
  16. joaohd

    Removedor De Frag

    Erro meu: if msgcontains(msg, 'hallowed axe') then npcHandler:say('Do you want to buy a Hallowed Axe from me?', cid) talk_state = 1 elseif msgcontains(msg, 'yes') and talk_state == 1 then local price = 100000 if getPlayerItemCount(cid, 2386) >= 1 and getPlayerMoney(cid) >= price then if doPlayerRemoveMoney(cid, price) == true then npcHandler:say('Here you are. You can now defeat the demon oak with this axe.', cid) doPlayerRemoveItem(cid, 2386, 1) doPlayerAddItem(cid, 8293, 1) talk_state = 0 end else npcHandler:say('I need an axe and ' .. price .. ' gold coins to make you a {hallowed axe}.', cid) talk_state = 0 end elseif msgcontains(msg, 'demon oak') then npcHandler:say('Did you defeat the demon oak?', cid) talk_state = 2 elseif msgcontains(msg, 'yes') and talk_state == 2 then if getPlayerStorageValue(cid, 35700) == 1 then if doPlayerRemoveItem(cid, 8293, 1) then npcHandler:say('Good job! Go take your recompense.', cid) doPlayerSetStorageValue(cid, 35700, 2) talk_state = 0 else npcHandler:say("Come back with an hallowed axe.", cid) talk_state = 0 end else npcHandler:say('Go defeat the demon oak first.', cid) talk_state = 0 end flw
  17. Tente: local mma = 20000 function onEquip(cid, item, slot) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sua mana almentou em + "..((mma - 1)*100).."%.") local maxMana = getCreatureMaxMana(cid) doPlayerAddMana(cid, maxMana) return true end flw
  18. joaohd

    Removedor De Frag

    O primeiro: 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 talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local percent = 50 -- porcentagem de ganha o premio local t = math.random(1, 100) -- n mecha if(msgcontains(msg, 'mission') or msgcontains(msg, 'MISSION')) then selfSay('olá você trouxe os items que eu pedi? {yes} ', cid) talkState[talkUser] = 1 elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then if (not getPlayerItemCount(cid, 7634) >= 1) and (not getPlayerItemCount(cid, 7635) >= 1) then selfSay("Você não tem nenhum dos itens.", cid) elseif (not getPlayerItemCount(cid, 7634) >= 1) and (getPlayerItemCount(cid, 7635) >= 1) then doPlayerRemoveItem(cid, 7635, 1) selfSay("Você tem um dos itens pedidos e este foi removido.", cid) elseif (getPlayerItemCount(cid, 7634) >= 1) and (not getPlayerItemCount(cid, 7635) >= 1) then doPlayerRemoveItem(cid, 7634, 1) selfSay("Você tem um dos itens pedidos e este foi removido.", cid) elseif (getPlayerItemCount(cid, 7634) >= 1) and (getPlayerItemCount(cid, 7635) >= 1) then doPlayerRemoveItem(cid, math.random(7634,7635), 1) selfSay("Você tinha ambos os itens e um deles foi removido.", cid) end if t >= 1 and t <= percent then doPlayerAddItem(cid,5958,1) selfSay('obrigado receba seu item !', cid) talkState[talkUser] = 0 else selfSay('Você não teve sorte,não ganhou o premio', cid) talkState[talkUser] = 0 end elseif msg == "no" and talkState[talkUser] == 1 then selfSay("Then not", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Demon oak: if msgcontains(msg, 'hallowed axe') then npcHandler:say('Do you want to buy a Hallowed Axe from me?', cid) talk_state = 1 elseif msgcontains(msg, 'yes') and talk_state == 1 then local price = 100000 if getPlayerItemCount(cid, 2386) >= 1 and getPlayerMoney(cid) >= price then if doPlayerRemoveMoney(cid, price) == true then npcHandler:say('Here you are. You can now defeat the demon oak with this axe.', cid) doPlayerRemoveItem(cid, 2386, 1) doPlayerAddItem(cid, 8293, 1) talk_state = 0 end else npcHandler:say('I need an axe and ' .. price .. ' gold coins to make you a {hallowed axe}.', cid) talk_state = 0 end elseif msgcontains(msg, 'demon oak') then npcHandler:say('Did you defeat the demon oak?', cid) talk_state = 2 elseif msgcontains(msg, 'yes') and talk_state == 2 then if getPlayerStorageValue(cid, 35700) == 1 then if doPlayerRemoveItem(cid, 8293) then npcHandler:say('Good job! Go take your recompense.', cid) doPlayerSetStorageValue(cid, 35700, 2) talk_state = 0 else npcHandler:say("Come back with an hallowed axe.", cid) talk_state = 0 end else npcHandler:say('Go defeat the demon oak first.', cid) talk_state = 0 end flw
  19. joaohd

    Efeitos De Magia

    Em data/lib/constant.lua ou data/lib/000-constant.lua, existem todos estes tipos de efeito. Os de distance estão identificados pelos nomes precedidos por: CONST_ANI Já os estáticos, estão precedidos por: CONST_ME flw
  20. joaohd

    Removedor De Frag

    Nussa, não achei jeito melhor de fazer (pelo menos não nas condições em q me encontro, sonolento): if (not getPlayerItemCount(cid, 7634) >= 1) and (not getPlayerItemCount(cid, 7635) >= 1 then doPlayerSendCancel(cid, "Você não tem nenhum dos itens.") elseif (not getPlayerItemCount(cid, 7634) >= 1) and (getPlayerItemCount(cid, 7635) >= 1) then doPlayerRemoveItem(cid, 7635, 1) doPlayerSendCancel(cid, "Você tem um dos itens pedidos e este foi removido.") elseif (getPlayerItemCount(cid, 7634) >= 1) and (not getPlayerItemCount(cid, 7635) >= 1) then doPlayerRemoveItem(cid, 7634, 1) doPlayerSendCancel(cid, "Você tem um dos itens pedidos e este foi removido.") elseif (getPlayerItemCount(cid, 7634) >= 1) and (getPlayerItemCount(cid, 7635) >= 1) then doPlayerRemoveItem(cid, math.random(7634,7635), 1) doPlayerSendCancel(cid, "Você tinha ambos os itens e um deles foi removido.") Tenta ae. flw
  21. O do set é mais complicado, requer as ferramentas das quais não disponho no momento. Já o tile, aqui está: function onStepIn(cid, item, pos, frompos) local cFig = { maxLv = 20 } if getPlayerLevel(cid) >= cFig.maxLv then doTeleportThing(cid, frompos) doPlayerSendCancel(cid, "Only players above level " .. cFig.maxLv .. " are able to pass.") end return TRUE end Talvez pela tarde consiga ajudar no outro pedido. flw
  22. joaohd

    Trem System

    Na seção de actions & movements, existe o sistema de trem. Chama-se Roller Coaster. flw
  23. Fiz um bem simples : function onUse(cid, item) local destiny = { [10010] = {to = {x = 160, y = 54, z = 7}, cost = 100, name = "Depot"}, [10011] = {to = {x = 161, y = 55, z = 7}, cost = 100, name = "Temple"}, [10012] = {to = {x = 200, y = 90, z = 7}, cost = 100, name = "Hunt's"} } if destiny[item.uid] then if getPlayerMoney(cid) >= destiny[item.uid].cost then doPlayerRemoveMoney(cid, destiny[item.uid].cost doTeleportThing(cid, destiny[item.uid].to) doPlayerSendTextMessage(cid, 25, "Welcome to ".. destiny[item.uid].name ..".") else doPlayerSendCancel(cid, "You must have ".. destiny[item.uid].cost .." to use.") end end return TRUE end O que está em destiny é as configurações. Entre colchetes, estão os uniqueid dos "carros". flw
  24. joaohd

    Runa De Summon

    Faltou somente um "end" : local c = { maxSummons = 1, removeOnUse = "yes" } local summon = { [{100, 200}] = "Dragon", [{201, 300}] = "Hydra" } function onUse(cid, item, fromPosition, itemEx, toPosition) for m, n in pairs(summon) do if(getPlayerLevel(cid) >= m[1] and getPlayerLevel(cid) <= m[2]) then if(table.maxn(getCreatureSummons(cid)) < c.maxSummons) then local monster = doCreateMonster(getThingPosition(cid), n) doConvinceCreature(cid, monster) if(c.removeOnUse == "yes") then doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You use your Elisios Card and it disappear") end else doPlayerSendCancel(cid, "You can\'t summon more monsters") end else doPlayerSendCancel(cid, "You don\'t have a monster to summon") end end return true end É o script do Oneshot. flw
  25. Coloque o script do seu serverinfo e a função localizada em data/lib/functions.lua, linha 432. flw
  • Quem Está Navegando   0 membros estão online

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