[LUA] Help with make exhaust when use potion

lolu1133

New Member
Joined
Oct 31, 2018
Messages
10
Best answers
0
Reaction score
0
Hello. I want add an exhaust - It would be great if the time unit is a millisecond.

Can anyone tell me how to do it or rewrite a script for me? Script below:

Lua:
local greatHealthPot = 7591
local greatManaPot = 7590
local strongHealthPot = 7588
local strongManaPot = 7589
local healthPot = 7618
local manaPot = 7620
local greatEmptyPot = 7635
local strongEmptyPot = 7634
local emptyPot = 7636

function onUse(cid, item, frompos, item2, topos)
    if(item.itemid == healthPot) then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 340, 460, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
        doRemoveItem(item.uid, 1)
    elseif(item.itemid == manaPot) then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatMana(0, cid, 160, 300, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
        doRemoveItem(item.uid, 1)
    elseif(item.itemid == strongHealthPot) then
        if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 or getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
        if getPlayerLevel(cid) > 50 then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 700, 900, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
        doRemoveItem(item.uid, 1)
        else
        doPlayerSendTextMessage(cid, 21, "Your lvl is too low.")
        end
        else
        doPlayerSendTextMessage(cid, 21, "It's not for your vocation.")
        end
    elseif(item.itemid == strongManaPot) then
        if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 or getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
                if getPlayerLevel(cid) > 50 then
        doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatMana(0, cid, 300, 500, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
        doRemoveItem(item.uid, 1)
        else
        doPlayerSendTextMessage(cid, 21, "Your lvl is too low.")
        end
        else
        doPlayerSendTextMessage(cid, 21, "It's not for your vocation.")
        end
    elseif(item.itemid == greatHealthPot) then
        if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
        if getPlayerLevel(cid) > 80 then
                doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 1100, 1200, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
        doRemoveItem(item.uid, 1)
        else
        doPlayerSendTextMessage(cid, 21, "Your lvl is too low.")
        end
        else
        doPlayerSendTextMessage(cid, 21, "It's not for your vocation.")
        end
    elseif(item.itemid == greatManaPot) then
        if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then
                if getPlayerLevel(cid) > 80 then
        doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
        if(doTargetCombatMana(0, cid, 500, 700, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
            return FALSE
        end
        doRemoveItem(item.uid, 1)
        else
        doPlayerSendTextMessage(cid, 21, "Your lvl is too low.")
        end
        else
        doPlayerSendTextMessage(cid, 21, "It's not for your vocation.")
        end
    end

    return TRUE
end
Thanks in advance for help!
 
Top