Ir para conteúdo

Wakon

Héroi
  • Registro em

  • Última visita

Solutions

  1. Wakon's post in (Resolvido)ERROS: luaGetThingPosition E luaAddEvent was marked as the answer   
    @katumblo, o da sakura provavelmente está dando erro quando o alvo morre antes de terminar os hits, testa assim:

    O segundo erro acho que é nessa parte aqui:
     
    addEvent(onCastSpell2, 200, parameters) Está iniciando um evento chamando uma função que não existe(onCastSpell2), tenta remover ou trocar para onCastSpell1 para ver qual fica do jeito que você quer.
  2. Wakon's post in (Resolvido)Chance de aplicar Condition no Inimigo com item! was marked as the answer   
    @Maniaco, tenta o seguinte, coloca essa função:
    doTargetCombatHealth(nil, target, COMBAT_FIREDAMAGE, -minDmg, -maxDmg, 0xFF) No lugar dessa:
    doCreatureAddHealth(target, -dano) E remove essas linhas:
    local dano = math.ceil(math.random(minDmg, maxDmg)) doSendAnimatedText(getCreaturePos(target), "-"..dano, 180) Ai pra trocar o tipo é só alterar no lugar de COMBAT_FIREDAMAGE, geralmente você encontra os tipos em data/lib/000-constant.lua.
  3. Wakon's post in (Resolvido)(LuaInterface::luaDoPlayerSendChannelMessage) Player not found was marked as the answer   
    @katumblo, tenta assim:
     
    doPlayerSendChannelMessage(cid, "", "Mensagem...", TALKTYPE_CHANNEL_W, id_do_channel)  
  4. Wakon's post in (Resolvido)Ajuda com funçao ! was marked as the answer   
    E ai @deza, de boas? Aqui nessa linha:
     
    local position = getCreaturePosition(cid) Você está pegando a posição do parâmetro "cid", que geralmente indica o creature id de quem está usando a função, e logo em seguida você está usando essa posição para ambos os parâmetros de posições da função doSendDistanceShoot, por isso o efeito está indo no próprio personagem.
    Tente utilizar a função getCreatureTarget(cid) junto com a função getCreaturePosition para definir seu alvo no segundo parâmetro da função doSendDistanceShoot:
    local targetPosition = getCreaturePosition(getCreatureTarget(cid)) Ficando assim:
     
    doSendDistanceShoot(position, {x = targetPosition.x, y = targetPosition.y + 5, z = targetPosition.z}, 71) Para finalizar, uma checagem ao utilizar o getCreaturePosition junto ao getCreatureTarget caso ainda não tenha, para que o getCreaturePosition não gere erros, ficando assim:
     
    local position = getCreaturePosition(cid) if (isCreature(getCreatureTarget(cid))) then local targetPosition = getCreaturePosition(getCreatureTarget(cid)) doSendDistanceShoot(position, {x = targetPosition.x, y = targetPosition.y + 5, z = targetPosition.z}, 71) end Creio eu que seja isso, caso eu tenha esquecido ou errado algo, por favor me corrijam.
  5. Wakon's post in (Resolvido)nao dar trade se tiver tal storage was marked as the answer   
    Fiz na correria aq pra vc, se faltar algo, me avisa:
    creaturescripts/scripts/blocktrade.lua:
    local t = { storage = 6000, blockRequest = true, -- vai bloquear apenas o jogador com a storage de mandar trade pra outro jogador blockReceive = true -- esse vai bloquear de outro jogador dar trade caso o player tenha a storage } function onTradeRequest(cid, target, item) if (t.blockRequest and getPlayerStorageValue(cid, t.storage) > 0) then return doPlayerSendCancel(cid, "Trade blocked.") and doSendMagicEffect(cid, CONST_ME_POFF) and false elseif (t.blockReceive and getPlayerStorageValue(target, t.storage) > 0) then return doPlayerSendCancel(cid, "This player has trade blocked.") and doSendMagicEffect(cid, CONST_ME_POFF) and false end return true end creaturescripts.xml:
    <event type="traderequest" name="BlockTrade" event="script" value="blocktrade.lua"/> login.lua:
    registerCreatureEvent(cid, "BlockTrade")  
    @poko360
  6. Wakon's post in (Resolvido)[ACTION] OFFLINE TRAINING was marked as the answer   
    @baiakuda:
    local statue = { [1444] = SKILL_SWORD, [1449] = SKILL_AXE, [3705] = SKILL_CLUB, [3739] = SKILL_DISTANCE, [1448] = SKILL__MAGLEVEL } function onUse(cid, item, fromPosition, itemEx, toPosition) if isPlayerPzLocked(cid) then return false end if item.actionid == 1000 then doPlayerSetOfflineTrainingSkill(cid, statue[item.itemid]) doRemoveCreature(cid) end return true end  
  7. Wakon's post in (Resolvido)Creature not found Magia was marked as the answer   
    @Dragon Ball Hiper, você adicionou check nas funções onCastSpell e os addEvent estão chamando as funções "sew", e essas funções não tem o check, por isso está dando erro.
     
  8. Wakon's post in (Resolvido)TFS 0.4 Gaz'Haragoth (Heal + Magia + Teleport) ??? was marked as the answer   
    @ADM Mayk on BaiakME, testa assim:
    local config = { life_ative = 50000, life_add = 300000, seconds_ative = 5, gStorage = 90702, } function AddHealth(cid) setGlobalStorageValue(config.gStorage, 0) if not isCreature(cid) then return false end doCreatureAddHealth(cid, config.life_add) doCreatureSay(cid, "Gaz'haragoth HEALS himself!", TALKTYPE_MONSTER) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED) end function onStatsChange(cid, attacker, type, combat, value) if (getGlobalStorageValue(config.gStorage) < 1 and type == STATSCHANGE_HEALTHLOSS and getCreatureHealth(cid) < config.life_ative) then doCreatureSay(cid, "Gaz'haragoth beginns to draw on the nightmares to HEAL himself!", TALKTYPE_MONSTER) addEvent(AddHealth, config.seconds_ative * 1000, cid) setGlobalStorageValue(config.gStorage, 1) end return true end  
  9. Wakon's post in (Resolvido)[AJUDA] npc entrega storage varias vezes was marked as the answer   
    local cfg = { item = {5943, 15}, storage = 32100, hp_bonus = 1000, skills_bonus = { [SKILL__MAGLEVEL] = 10, [SKILL_FIST] = 10, } } 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 if (msgcontains(msg, 'yes')) then if (getPlayerStorageValue(cid, cfg.storage) < 1) then if (doPlayerRemoveItem(cid, cfg.item[1], cfg.item[2])) then for v, k in pairs (cfg.skills_bonus) do doPlayerAddSkill(cid, v, k) end setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + cfg.hp_bonus) doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) setPlayerStorageValue(cid, cfg.storage, 1) selfSay('Parabéns agora você faz parte da Akatsuki, utilize o comando !akatsuki.', cid) else selfSay('Não adianta me enganar, você não tem '.. cfg.item[2] ..' {'.. (cfg.item[2] == 1 and getItemNameById(cfg.item[1]) or getItemPluralNameById(cfg.item[1])) ..'}, vai atrás, e só volte com eles.', cid) end else selfSay('Você já faz parte da Akatsuki.', cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) @OinomedRellik
  10. Wakon's post in (Resolvido)function creatureSayCallback(cid, type, msg) [Dúvida] was marked as the answer   
    @peterson18, utilize a função isInArray, exemplo:
    if isInArray({'familia', 'parentes'}, msg) then  
  11. Wakon's post in (Resolvido)[PEDIDO] Npc troca item por item e da storage was marked as the answer   
    @Christinacsa, testa ai:
    local cfg = { need_item = {5785, 10}, reward_item = {13506, 1}, storage = 40531, } 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 msg = msg:lower() if msgcontains(msg, 'kefla') then if getPlayerStorageValue(cid, cfg.storage) < 1 then if doPlayerRemoveItem(cid, cfg.need_item[1], cfg.need_item[2]) then doPlayerAddItem(cid, cfg.reward_item[1], cfg.reward_item[2]) selfSay('You just swap '.. cfg.need_item[2] ..' '.. getItemNameById(cfg.need_item[1]) ..' for '.. cfg.reward_item[2] ..' '.. getItemNameById(cfg.reward_item[1]) ..'.', cid) setPlayerStorageValue(cid, cfg.storage, 1) else selfSay('You need '.. cfg.need_item[2] ..' '.. getItemNameById(cfg.need_item[1]) ..'.', cid) end else selfSay('...', cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())  
  12. Wakon's post in (Resolvido)time ring! icon do hur was marked as the answer   
    @Leomonti, é assim mesmo, apenas magias de velocidade fazem esse ícone aparecer.
  13. Wakon's post in (Resolvido)Modificação na Talk was marked as the answer   
    @JcA, "data\lib", arquivo 031-vocations.lua.
  14. Wakon's post in (Resolvido)Anihiri com problema was marked as the answer   
    @JcA, execute com essas modificações, faça as ações necessárias para entrar na annihi e veja o que irá printar no console.
     
     
  15. Wakon's post in (Resolvido)Efeito no jogador was marked as the answer   
    @Mikuo:
    local config = { storage = 31520, effects = { -- [id da vocation] = {effect = efeito}, time = ...} [0] = {effect = 45, time = 0.5}, [4] = {effect = 21, time = 0.5}, [5] = {effect = 22, time = 0.5}, [6] = {effect = 23, time = 0.5}, [7] = {effect = 25, time = 0.5}, [8] = {effect = 33, time = 0.5}, [9] = {effect = 45, time = 0.5}, [10] = {effect = 47, time = 0.5}, }, } function onThink(cid, interval) local v = config.effects[getPlayerVocation(cid)] if v and not exhaustion.check(cid, config.storage) then doSendMagicEffect(getCreaturePosition(cid), v.effect) exhaustion.set(cid, config.storage, v.time) end return true end  
  16. Wakon's post in (Resolvido)Erro Look.lua was marked as the answer   
    Testa assim, some functions.lua:
    https://pastebin.com/JXhwEfMs
  17. Wakon's post in (Resolvido)[Como configurar] Linha de Tempo was marked as the answer   
    O valor é em segundos, 3600 segundos = 1 hora, 1 minuto = 60 segundos.
    Então para retornar 2 minutos, multiplique por 60 (2 * 60 = 120 segundos). Na mensagem você divide a variável por 60, para retornar os minutos, já que você definiu que time = 120 segundos se você dividir por 60, (120/60 = 2).
     
    Não sei explicar nada muito bem, mas acho que deu pra entender, @Brunds.
  18. Wakon's post in (Resolvido)Script NPC "Oráculo" was marked as the answer   
    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 npcHandler:setMessage(MESSAGE_GREET, 'Cuidado, |PLAYERNAME|, isto não é lugar para crianças. Apenas um {guerreiro} deveria estar aqui.') 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 msg = msg:lower() local pos = getCreaturePosition(getNpcCid()) local summonPos = {x = pos.x-1,y = pos.y,z = pos.z} if msgcontains(msg, 'guerreiro') then selfSay('Você está interessado em se tornar um guerreiro? Uma vez iniciado, você não poderá voltar atrás.', cid) talkState[talkUser] = 1 elseif msgcontains(msg, 'sim') then if talkState[talkUser] == 1 then if getPlayerVocation(cid) == 0 then if getPlayerStorageValue(cid, 9500) < 0 then selfSay('Você deve antes provar seu valor de combate. Me mostre se é capaz de destruir isto...', cid) doSummonCreature('Training Target', summonPos) talkState[talkUser] = 0 else selfSay('Você parece levar jeito e será iniciado na classe de guerreiro. Veja, há um baú no posto logo acima. Tenho certeza que ali ainda deve haver algum equipamento básico de guerreiro para você.') doPlayerSetVocation(cid, 1) if getPlayerStorageValue(cid, 8415) == 1 then setPlayerStorageValue(cid, 8412, 1) setPlayerStorageValue(cid, 8415, 0) elseif getPlayerStorageValue(cid, 8410) == 1 then setPlayerStorageValue(cid, 8411, 1) setPlayerStorageValue(cid, 8410, 0) elseif getPlayerStorageValue(cid, 8416) == 1 then setPlayerStorageValue(cid, 8403, 1) setPlayerStorageValue(cid, 8416, 0) end talkState[talkUser] = 0 end else selfSay('Você já possui uma classe.', cid) talkState[talkUser] = 0 end end elseif isInArray({'não', 'nao'}, msg) then if talkState[talkUser] == 1 then selfSay('Então não tome nosso tempo. Estamos ocupados!', cid) talkState[talkUser] = 0 end elseif isInArray({'comprar', 'vender'}, msg) then selfSay('Não estou vendendo ou comprando coisa alguma. Minha função é preparar novos guerreiros.', cid) elseif isInArray({'mágica', 'magica'}, msg) then selfSay('Huh? A habilidade com uma espada ou um machado não se comparam com esses truques baratos.', cid) end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) @Tadelho
  19. Wakon's post in Pode isso no TK? was marked as the answer   
    Não, isso se encaixa na regra 2.12.
    2.12 - Comércio:
    É proibido realizar prática de comércio neste fórum, você não tem autorização para vender e nem comprar qualquer tipo de produto aqui, exceto produtos oferecido pela CipSoft, personagens no Tibia Global e Keys para Bots o mesmo deve ser anunciado e/ou pedido nas seções adequadas e nós da equipe do Tibia King não nos responsabilizamos por nada negociado!
    Regras: http://www.tibiaking.com/forum/forums/topic/1281-regras-gerais/
     
  20. Wakon's post in (Resolvido)Problema com Rank, remoção do acc manager was marked as the answer   
    Tente assim:
    local config = { MaxPlayer = 20, fight_skills = { ['fist'] = 0, ['club'] = 1, ['sword'] = 2, ['axe'] = 3, ['distance'] = 4, ['shielding'] = 5, ['fishing'] = 6, ['dist'] = 4, ['shield'] = 5, ['fish'] = 6, }, other_skills = { [''] = "level", ['level'] = "level", ['magic'] = "maglevel", ['health'] = "healthmax", ['reset'] = "reset", ['mana'] = "manamax" }, vocations = { ['sorcerer'] = {1,5}, ['druid'] = {2,6}, ['paladin'] = {3,7}, ['knight'] = {4,8} } } function onSay(cid, words, param) local managerID = '8' local store,exausted = 156201,0 local param,str = param:lower(),"" if not config.fight_skills[param] and not config.other_skills[param] and not config.vocations[param] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "this ranking does not exists.") return true elseif getPlayerStorageValue(cid, store) >= os.time() then doPlayerSendCancel(cid, "wait " .. getPlayerStorageValue(cid, store) - os.time() .. " seconds to use this command again.") return true end str = "--[ RANK "..(param == "" and "LEVEL" or string.upper(param)).." ]--\n\n" local query = config.fight_skills[param] and db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `skillid` = "..config.fight_skills[param].." AND `player_id` != ".. managerID .." ORDER BY `value` DESC;") or config.other_skills[param] and db.getResult("SELECT `name`, `"..config.other_skills[param].."` FROM `players` WHERE `id` > 6 AND `group_id` < 2 AND `id` != ".. managerID .." ORDER BY `"..config.other_skills[param].."` DESC, `name` ASC;") or db.getResult("SELECT `name`, `level` FROM `players` WHERE `group_id` <= 2 AND `id` != ".. managerID .." AND `vocation` = "..config.vocations[param][1].." or `vocation` = "..config.vocations[param][2].." ORDER BY `level` DESC;") if (query:getID() ~= -1) then k = 1 repeat str = str .. "\n " .. k .. ". "..(config.fight_skills[param] and getPlayerNameByGUID(query:getDataString("player_id")) or query:getDataString("name")).." - [" .. query:getDataInt((config.fight_skills[param] and "value" or config.vocations[param] and "level" or config.other_skills[param])) .. "]" k = k + 1 until not(query:next()) or k > config.MaxPlayer query:free() end doShowTextDialog(cid,6500, str) setPlayerStorageValue(cid, store, os.time()+exausted) return true end Em managerID, coloque o id do Account Manager, você pode encontra-lo na database na seção "players".
  21. Wakon's post in (Resolvido)AJUDA ERROR: Unable to load config.lua! was marked as the answer   
    @vbdbghdbhgh, tente assim:
     
  22. Wakon's post in (Resolvido)Item que teleporta player para determinada area was marked as the answer   
    local cfg = { area = {{x = 1018, y = 1015, z = 7}, {x = 1022, y = 1019, z = 7}}, -- canto superior esquerdo, canto inferior direito toPos = {x = 1020, y = 1017, z = 7}, -- posição caso dê certo battle = false, -- permitir uso em batalha remove = true, -- remover após uso } function onUse(cid, item, fromPos, itemEx, toPos) if isInArea({x = toPos.x, y = toPos.y, z = toPos.z}, cfg.area[1], cfg.area[2]) then if not cfg.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED) return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can't teleport in battle.") end doTeleportThing(cid, cfg.toPos) doSendMagicEffect(cfg.toPos, CONST_ME_TELEPORT) if cfg.remove then doRemoveItem(item.uid, 1) end else doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Wrong position.") end return true end TAG:
     
    <action itemid="555" event="script" value="script.lua"/> Coloquei comentários explicando a configuração, mas caso você tenha problemas, é só perguntar.
  23. Wakon's post in (Resolvido)Exhaust de magia UE interferindo no exhaust de runas was marked as the answer   
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_BIGCLOUDS) setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 8, 8, 10, 12) local area = createCombatArea(AREA_CROSS6X6) setCombatArea(combat, area) function onCastSpell(cid, var) if exhaustion.check(cid, 3200) then doPlayerSendCancel(cid, "You are exhausted.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return false end exhaustion.set(cid, 3200, 10) return doCombat(cid, combat, var) end  
  24. Wakon's post in (Resolvido)Script Alavanca rocha desparece e aparece was marked as the answer   
    local cfg = { stone = {ID = 1285, pos = {x = 1014, y = 1024, z = 7}}, -- ID da stone e posição dela time = 5 -- Tempo em segundos para criar a stone } function onUse(cid, item, fromPos, itemEx, toPos) if (item.itemid == 1946) then local stoneThing = getTileItemById(cfg.stone.pos, cfg.stone.ID).uid doCreatureSay(cid, "Passagem liberada.", TALKTYPE_MONSTER) doSendMagicEffect(cfg.stone.pos, CONST_ME_MAGIC_GREEN) doRemoveItem(stoneThing, 1) doTransformItem(item.uid, 1945) addEvent(function() local lever = getTileItemById(fromPos, 1945) doCreateItem(cfg.stone.ID, 1, cfg.stone.pos) doTransformItem(lever.uid, 1946) doSendMagicEffect(cfg.stone.pos, CONST_ME_MAGIC_GREEN) end, cfg.time * 1000) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "A passagem já está aberta.") doSendMagicEffect(fromPos, CONST_ME_POFF) end return true end Crie a alavanca com o ID 1946.
  25. Wakon's post in (Resolvido)[Autoloot] Erro - Killua/vodka was marked as the answer   
    @Yago Blind., testei aqui e o script está funcionando perfeitamente.
    O erro que você postou diz que não está encontrando evento "onKill" no script definido na tag, você tem certeza que colocou o script no "autoloot.lua"?

Informação Importante

Confirmação de Termo