• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Infinity Potion - Exhaustion

zielok

New Member
Joined
Mar 8, 2009
Messages
66
Reaction score
0
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local manaAdd = {
    ["Sorcerer"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Druid"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Paladin"]={math.random(75, 125), math.random(180, 220), math.random(180, 220)}, ["Knight"]={math.random(75, 125), math.random(75, 125), math.random(75, 125)}, 
    ["Master Sorcerer"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Elder Druid"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Royal Paladin"]={math.random(75, 125), math.random(180, 220), math.random(180, 220)}, ["Elite Knight"]={math.random(75, 125), math.random(75, 125), math.random(75, 125)}
    }
    if(isPlayer(itemEx.uid) == TRUE) then
        if(hasCondition(itemEx.uid, CONDITION_EXHAUST) == FALSE) then
            if(getPlayerLevel(itemEx.uid) < 50) then
              doCreatureAddMana(itemEx.uid, manaAdd[getPlayerVocationName(itemEx.uid)][1])
            elseif(getPlayerLevel(itemEx.uid) >= 50) and (getPlayerLevel(itemEx.uid) < 80) then
              doCreatureAddMana(itemEx.uid, manaAdd[getPlayerVocationName(itemEx.uid)][2])
            else
              doCreatureAddMana(itemEx.uid, manaAdd[getPlayerVocationName(itemEx.uid)][3])
            end
              doAddCondition(cid, exhaust)
              doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
              doSendAnimatedText(getCreaturePosition(itemEx.uid), "Aaaah...", TEXTCOLOR_DARKYELLOW)
        else
          doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
          return TRUE
        end
    else
      return FALSE
    end
end

Could any1 fix it? When some player uses on another player he can spam him with potion and he didnt get exhaust.
 
Moderator Message: Please create threads in the correct sections at this forum, if you need help with scripts like this, the "Request and Support" section seem to fit.

Thread moved.
 
Back
Top