• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    quiero que me den empty flask las potion

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1default quiero que me den empty flask las potion el Dom Oct 01, 2017 11:39 pm

    joe123123

    avatar
    Miembro
    Miembro
    buenas !

    mi server al usar las manas potions, strong y great al igual que las healths potions no dejan empty flasks y yo quiero que los den. esto es lo que esta en potions.lua:
    local config = {
    -- strong health potion
    [7588] = {health = {min = 250, max = 350}, vocations = {3, 4}, text = 'paladins and knights', level = 50, emptyId = 7634},
    -- strong mana potion
    [7589] = {mana = {min = 115, max = 185}, vocations = {1, 2, 3}, text = 'sorcerers, druids and paladins', level = 50, emptyId = 7634},
    -- great mana potion
    [7590] = {mana = {min = 150, max = 250}, vocations = {1, 2}, text = 'sorcerers and druids', level = 80, emptyId = 7635},
    -- great health potion
    [7591] = {health = {min = 425, max = 575}, vocations = {4}, text = 'knights', level = 80, emptyId = 7635},
    -- health potion
    [7618] = {health = {min = 125, max = 175}, emptyId = 7636},
    -- mana potion
    [7620] = {mana = {min = 75, max = 125}, emptyId = 7636},
    -- great spirit potion
    [8472] = {health = {min = 250, max = 350}, mana = {min = 100, max = 200}, vocations = {3}, text = 'paladins', level = 80, emptyId = 7635},
    -- ultimate health potion
    [8473] = {health = {min = 450, max = 600}, vocations = {4}, text = 'knights', level = 130, emptyId = 7635},

    -- POT NOVOS

    -- ultimate mana potion 26029
    [26029] = {mana = {min = 310, max = 320}, vocations = {1, 2}, text = 'sorcerers and druids', level = 130, emptyId = 7635},

    -- Supreme Health Potion 26031
    [26031] = {health = {min = 650, max = 780}, vocations = {4}, text = 'knights', level = 200, emptyId = 7635},

    -- Ultimate Spirit Potion 26030
    [26030] = {health = {min = 400, max = 430}, mana = {min = 140, max = 250}, vocations = {3}, text = 'paladins', level = 130, emptyId = 7635},


    -- antidote potion
    [8474] = {antidote = true, emptyId = 7636},
    -- small health potion
    [8704] = {health = {min = 60, max = 85}, emptyId = 7636}
    }

    local antidote = Combat()
    antidote:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
    antidote:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
    antidote:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
    antidote:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
    antidote:setParameter(COMBAT_PARAM_DISPEL, CONDITION_POISON)

    local exhaust = Condition(CONDITION_EXHAUST_HEAL)
    exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) - 1000))
    -- 1000 - 100 due to exact condition timing. -100 doesn't hurt us, and players don't have reminding ~50ms exhaustion.

    function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local potion = config[item.itemid]
    if not potion then
    return true
    end

    if target.itemid ~= 1 or target.type ~= THING_TYPE_PLAYER then
    return false
    end

    if player:getCondition(CONDITION_EXHAUST_HEAL) then
    player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
    return true
    end

    if potion.antidote and not antidote:execute(target, Variant(target.uid)) then
    return false
    end

    if (potion.level and player:getLevel() < potion.level)
    or (type(potion.vocations) == 'table' and not isInArray(potion.vocations, player:getVocation():getBase():getId()))
    and not (player:getGroup():getId() >= 2) then
    player:say(string.format('This potion can only be consumed by %s of level %d or higher.', potion.text, potion.level), TALKTYPE_MONSTER_SAY)
    return true
    end

    if type(potion.health) == 'table' and not doTargetCombatHealth(0, target, COMBAT_HEALING, potion.health.min, potion.health.max, CONST_ME_MAGIC_BLUE) then
    return false
    end

    if type(potion.mana) == 'table' and not doTargetCombatMana(0, target, potion.mana.min, potion.mana.max, CONST_ME_MAGIC_BLUE) then
    return false
    end

    player:addAchievementProgress('Potion Addict', 100000)

    player:addCondition(exhaust)
    doCreatureSayWithRadius(target, 'Aaaah...', TALKTYPE_MONSTER_SAY, 2, 2)

    local topParent = item:getTopParent()
    if topParent.isItem and (not topParent:isItem() or topParent.itemid ~= 460) then
    local parent = item:getParent()
    -- if not parent:isTile() and (parent:addItem(potion.emptyId, 1) or topParent:addItem(potion.emptyId, 1)) then
    item:remove(1)
    return true
    --end
    end

    Game.createItem(potion.emptyId, 0, item:getPosition())
    item:remove(0)

    return false
    end

    Ver perfil de usuario

    2default Re: quiero que me den empty flask las potion el Mar Oct 03, 2017 5:29 am

    creo que es asi, solo que no habias activado la funcion:
    Código:
    local config = {
    -- strong health potion
    [7588] = {health = {min = 250, max = 350}, vocations = {3, 4}, text = 'paladins and knights', level = 50, emptyId = 7634},
    -- strong mana potion
    [7589] = {mana = {min = 115, max = 185}, vocations = {1, 2, 3}, text = 'sorcerers, druids and paladins', level = 50, emptyId = 7634},
    -- great mana potion
    [7590] = {mana = {min = 150, max = 250}, vocations = {1, 2}, text = 'sorcerers and druids', level = 80, emptyId = 7635},
    -- great health potion
    [7591] = {health = {min = 425, max = 575}, vocations = {4}, text = 'knights', level = 80, emptyId = 7635},
    -- health potion
    [7618] = {health = {min = 125, max = 175}, emptyId = 7636},
    -- mana potion
    [7620] = {mana = {min = 75, max = 125}, emptyId = 7636},
    -- great spirit potion
    [8472] = {health = {min = 250, max = 350}, mana = {min = 100, max = 200}, vocations = {3}, text = 'paladins', level = 80, emptyId = 7635},
    -- ultimate health potion
    [8473] = {health = {min = 450, max = 600}, vocations = {4}, text = 'knights', level = 130, emptyId = 7635},

    -- ultimate mana potion 26029
    [26029] = {mana = {min = 310, max = 320}, vocations = {1, 2}, text = 'sorcerers and druids', level = 130, emptyId = 7635},

    -- Supreme Health Potion 26031
    [26031] = {health = {min = 650, max = 780}, vocations = {4}, text = 'knights', level = 200, emptyId = 7635},

    -- Ultimate Spirit Potion 26030
    [26030] = {health = {min = 400, max = 430}, mana = {min = 140, max = 250}, vocations = {3}, text = 'paladins', level = 130, emptyId = 7635},

    -- antidote potion
    [8474] = {antidote = true, emptyId = 7636},
    -- small health potion
    [8704] = {health = {min = 60, max = 85}, emptyId = 7636}
    }

    local antidote = Combat()
    antidote:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
    antidote:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
    antidote:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
    antidote:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
    antidote:setParameter(COMBAT_PARAM_DISPEL, CONDITION_POISON)

    local exhaust = Condition(CONDITION_EXHAUST_HEAL)
    exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) - 1000))

    function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local potion = config[item.itemid]
    if not potion then
    return true
    end

    if target.itemid ~= 1 or target.type ~= THING_TYPE_PLAYER then
    return false
    end

    if player:getCondition(CONDITION_EXHAUST_HEAL) then
    player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
    return true
    end

    if potion.antidote and not antidote:execute(target, Variant(target.uid)) then
    return false
    end

    if (potion.level and player:getLevel() < potion.level)
    or (type(potion.vocations) == 'table' and not isInArray(potion.vocations, player:getVocation():getBase():getId()))
    and not (player:getGroup():getId() >= 2) then
    player:say(string.format('This potion can only be consumed by %s of level %d or higher.', potion.text, potion.level), TALKTYPE_MONSTER_SAY)
    return true
    end

    if type(potion.health) == 'table' and not doTargetCombatHealth(0, target, COMBAT_HEALING, potion.health.min, potion.health.max, CONST_ME_MAGIC_BLUE) then
    return false
    end

    if type(potion.mana) == 'table' and not doTargetCombatMana(0, target, potion.mana.min, potion.mana.max, CONST_ME_MAGIC_BLUE) then
    return false
    end

    player:addAchievementProgress('Potion Addict', 100000)

    player:addCondition(exhaust)
    doCreatureSayWithRadius(target, 'Aaaah...', TALKTYPE_MONSTER_SAY, 2, 2)

    local topParent = item:getTopParent()
    if topParent.isItem and (not topParent:isItem() or topParent.itemid ~= 460) then
    local parent = item:getParent()
    if not parent:isTile() and (parent:addItem(potion.emptyId, 1) or topParent:addItem(potion.emptyId, 1)) then
    item:remove(1)
    return true
    end
    end

    return false
    end



    Si necesitas hospedaje para tu servidor usa este enlace y mira las buenos planes de Windows y Linux:

    SevuOT Online, Version:10 and Custom.

    Ver perfil de usuario

    3default teste el Miér Oct 11, 2017 8:01 pm

    joe123123

    avatar
    Miembro
    Miembro
    muchas gracias amigo problema resuelto !!!!!


    pain disculpa si me dio los empty flasks pero cuando pones la potions llena en el piso y la usas en ti no se acaban Sad ayuda que pasa ahi??

    Ver perfil de usuario

    4default Re: quiero que me den empty flask las potion el Jue Oct 12, 2017 9:58 am

    [Admin] God Maya

    avatar
    Administrador
    Administrador
    [Tienes que estar registrado y conectado para ver este vínculo] escribió:muchas gracias amigo problema resuelto !!!!!


    pain disculpa si me dio los empty flasks pero cuando pones la potions llena en el piso y la usas en ti no se acaban Sad ayuda que pasa ahi??



    aqui tiene lo desarrolle


    Código:
    local ultimateHealthPot = 8473
    local greatHealthPot = 7591
    local greatManaPot = 7590
    local greatSpiritPot = 8472
    local strongHealthPot = 7588
    local strongManaPot = 7589
    local healthPot = 7618
    local manaPot = 7620
    local smallHealthPot = 8704
    local antidotePot = 8474
    local greatEmptyPot = 7635
    local strongEmptyPot = 7634
    local emptyPot = 7636
    local ultimatemana = 26029
    local SupremeHealth = 26031
    local UltimateSpirit = 26030

    local antidote = Combat()
    antidote:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
    antidote:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
    antidote:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
    antidote:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
    antidote:setParameter(COMBAT_PARAM_DISPEL, CONDITION_POISON)

    local exhaust = Condition(CONDITION_EXHAUST_HEAL)
    exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) - 100))
    -- 1000 - 100 due to exact condition timing. -100 doesn't hurt us, and players don't have reminding ~50ms exhaustion.

    function onUse(player, item, fromPosition, target, toPosition, isHotkey)
       if target == nil or not target:isPlayer() then
          return true
       end

       if player:getCondition(CONDITION_EXHAUST_HEAL) then
          player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
          return true
       end

       local itemId = item:getId()
       if itemId == antidotePot then
          if not antidote:execute(target, numberToVariant(target:getId())) then
             return false
          end

          player:addCondition(exhaust)
          target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
          item:remove(1)
          player:addItem(emptyPot, 1)
       elseif itemId == smallHealthPot then
          if not doTargetCombatHealth(0, target, COMBAT_HEALING, 60, 90, CONST_ME_MAGIC_BLUE) then
             return false
          end

          player:addCondition(exhaust)
          target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
          item:remove(1)
          player:addItem(emptyPot, 1)
       elseif itemId == healthPot then
          if not doTargetCombatHealth(0, target, COMBAT_HEALING, 125, 175, CONST_ME_MAGIC_BLUE) then
             return false
          end

          player:addCondition(exhaust)
          target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
          item:remove(1)
          player:addItem(emptyPot, 1)
       elseif itemId == manaPot then
          if not doTargetCombatMana(0, target, 75, 125, CONST_ME_MAGIC_BLUE) then
             return false
          end

          player:addCondition(exhaust)
          target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
          item:remove(1)
          player:addItem(emptyPot, 1)
       elseif itemId == strongHealthPot then
          if (not isInArray({3, 4, 7, 8}, target:getVocation():getId()) or target:getLevel() < 50) and not getPlayerFlagValue(player, PlayerFlag_IgnoreSpellCheck) then
             player:say("This potion can only be consumed by paladins and knights of level 50 or higher.", TALKTYPE_MONSTER_SAY)
             return true
          end

          if not doTargetCombatHealth(0, target, COMBAT_HEALING, 250, 350, CONST_ME_MAGIC_BLUE) then
             return false
          end

          player:addCondition(exhaust)
          target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
          item:remove(1)
          player:addItem(strongEmptyPot, 1)
       elseif itemId == strongManaPot then
          if (not isInArray({1, 2, 3, 5, 6, 7}, target:getVocation():getId()) or target:getLevel() < 50) and not getPlayerFlagValue(player, PlayerFlag_IgnoreSpellCheck) then
             player:say("This potion can only be consumed by sorcerers, druids and paladins of level 50 or higher.", TALKTYPE_MONSTER_SAY)
             return true
          end

          if not doTargetCombatMana(0, target, 115, 185, CONST_ME_MAGIC_BLUE) then
             return false
          end

          player:addCondition(exhaust)
          target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
          item:remove(1)
          player:addItem(strongEmptyPot, 1)
       elseif itemId == greatSpiritPot then
          if (not isInArray({3, 7}, target:getVocation():getId()) or target:getLevel() < 80) and not getPlayerFlagValue(player, PlayerFlag_IgnoreSpellCheck) then
             player:say("This potion can only be consumed by paladins of level 80 or higher.", TALKTYPE_MONSTER_SAY)
             return true
          end

          if not doTargetCombatHealth(0, target, COMBAT_HEALING, 250, 350, CONST_ME_MAGIC_BLUE) or not doTargetCombatMana(0, target, 100, 200, CONST_ME_MAGIC_BLUE) then
             return false
          end

          player:addCondition(exhaust)
          target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
          item:remove(1)
          player:addItem(greatEmptyPot, 1)
       elseif itemId == greatHealthPot then
          if (not isInArray({4, 8}, target:getVocation():getId()) or target:getLevel() < 80) and not getPlayerFlagValue(player, PlayerFlag_IgnoreSpellCheck) then
             player:say("This potion can only be consumed by knights of level 80 or higher.", TALKTYPE_MONSTER_SAY)
             return true
          end

          if not doTargetCombatHealth(0, target, COMBAT_HEALING, 425, 575, CONST_ME_MAGIC_BLUE) then
             return false
          end

          player:addCondition(exhaust)
          target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
          item:remove(1)
          player:addItem(greatEmptyPot, 1)
          
          
       elseif itemId == ultimatemana then
          if (not isInArray({1, 2}, target:getVocation():getId()) or target:getLevel() < 130) and not getPlayerFlagValue(player, PlayerFlag_IgnoreSpellCheck) then
             player:say("This potion can only be consumed by sorcerers and druids of level 130 or higher.", TALKTYPE_MONSTER_SAY)
             return true
          end

          if not doTargetCombatHealth(0, target, COMBAT_HEALING, 310, 320, CONST_ME_MAGIC_BLUE) then
             return false
          end

          player:addCondition(exhaust)
          target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
          item:remove(1)
          player:addItem(greatEmptyPot, 1)
          
          
          elseif itemId == SupremeHealth then
          if (not isInArray({4}, target:getVocation():getId()) or target:getLevel() < 200) and not getPlayerFlagValue(player, PlayerFlag_IgnoreSpellCheck) then
             player:say("This potion can only be consumed by knights of level 200 or higher.", TALKTYPE_MONSTER_SAY)
             return true
          end

          if not doTargetCombatHealth(0, target, COMBAT_HEALING, 650, 780, CONST_ME_MAGIC_BLUE) then
             return false
          end

          player:addCondition(exhaust)
          target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
          item:remove(1)
          player:addItem(greatEmptyPot, 1)
          
          
          
          
          elseif itemId == UltimateSpirit then
          if (not isInArray({3}, target:getVocation():getId()) or target:getLevel() < 130) and not getPlayerFlagValue(player, PlayerFlag_IgnoreSpellCheck) then
             player:say("This potion can only be consumed by paladins of level 130 or higher.", TALKTYPE_MONSTER_SAY)
             return true
          end

          if not doTargetCombatHealth(0, target, COMBAT_HEALING, 400, 430, CONST_ME_MAGIC_BLUE) then
             return false
          end

          player:addCondition(exhaust)
          target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
          item:remove(1)
          player:addItem(greatEmptyPot, 1)
          
             
          
       elseif itemId == greatManaPot then
          if (not isInArray({1,2,5,6}, target:getVocation():getId()) or target:getLevel() < 80) and not getPlayerFlagValue(player, PlayerFlag_IgnoreSpellCheck) then
             player:say("This potion can only be consumed by sorcerers and druids of level 80 or higher.", TALKTYPE_MONSTER_SAY)
             return true
          end

          if not doTargetCombatMana(0, target, 150, 250, CONST_ME_MAGIC_BLUE) then
             return false
          end
          player:addCondition(exhaust)
          target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
          item:remove(1)
          player:addItem(greatEmptyPot, 1)
       elseif itemId == ultimateHealthPot then
          if (not isInArray({4, 8}, target:getVocation():getId()) or target:getLevel() < 130) and not getPlayerFlagValue(player, PlayerFlag_IgnoreSpellCheck) then
             player:say("This potion can only be consumed by knights of level 130 or higher.", TALKTYPE_MONSTER_SAY)
             return true
          end

          if not doTargetCombatHealth(0, target, COMBAT_HEALING, 650, 850, CONST_ME_MAGIC_BLUE) then
             return false
          end

          player:addCondition(exhaust)
          target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
          item:remove(1)
          player:addItem(greatEmptyPot, 1)
       end
       return true
    end



    Ver perfil de usuario http://www.tibiaface.com

    5default Re: quiero que me den empty flask las potion el Miér Oct 18, 2017 8:51 pm

    joe123123

    avatar
    Miembro
    Miembro
    Muchas gracias maya ! sirvio perfectamente !

    Ver perfil de usuario

    Contenido patrocinado


    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).