• 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!

Strong Mana Potion

dualshock3

New Member
Joined
May 14, 2010
Messages
89
Reaction score
3
i need help with my smp cuz when i use it with a druid level 50 and ml 25 heals 50 of mana i want a script that if the player is druid or sorc it heals depending on the ml and if the playe is knight or pally it heals depending on the level.

here is my script if helps in something,
Code:
local MIN = 1.0
local MAX = 1.3
local EMPTY_POTION = 7634

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 1000))

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if isPlayer(itemEx.uid) == FALSE then
                return FALSE
        end

        if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
                doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
                return TRUE
        end

        if doPlayerAddMana(itemEx.uid, math.random((getPlayerLevel(cid) * MIN), (getPlayerLevel(cid) * MAX))) == LUA_ERROR 

then
                return FALSE
        end

        doAddCondition(cid, exhaust)
        doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
        doCreatureSay(itemEx.uid, "", TALKTYPE_ORANGE_1)
        return TRUE
end
 
LUA:
local MIN = 1.0
local MAX = 1.3

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 1000))

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) == FALSE then
		return FALSE
	end

	if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return TRUE
	end

	local v = (isSorcerer(cid) or isDruid(cid)) and getPlayerMagLevel(cid) or getPlayerLevel(cid)
	if doPlayerAddMana(itemEx.uid, math.random(v * MIN, v * MAX)) == LUA_ERROR then
		return FALSE
	end

	doAddCondition(cid, exhaust)
	doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
	return TRUE
end
 
cykotitan,
i want druid and sorcers heal by mag level
and knight and paladins heal by leves but different look my idea:
Code:
local MIN = 1.0
local MAX = 1.3
local LOW = 20.0
local HIGH = 26.0
 
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 750))
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if isPlayer(itemEx.uid) == FALSE then
        return FALSE
    end
 
    if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
        doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
        return TRUE
    end
 
    local v = (isSorcerer(cid) or isDruid(cid)) and getPlayerMagLevel(cid)
    if doPlayerAddMana(itemEx.uid, math.random(v * LOW, v * HIGH)) == LUA_ERROR then
        return FALSE
            
        local x = (isknight(cid) or ispaladin(cid)) and getPlayerLevel(cid)
    if doPlayerAddMana(itemEx.uid, math.random(v * MIN, v * MAX)) == LUA_ERROR then
        return FALSE
    end 

    doAddCondition(cid, exhaust)
    doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
    return TRUE
endend

LOW & HIGH is for sorcerers and druids
MIN & MAX is knights and paladins
 
Back
Top