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

Help me

Stewie

Family Guy # ;3
Joined
May 3, 2010
Messages
786
Reaction score
12
Location
TV
Someone could add Health in this script,as spirit potion:

LUA:
local config = {
	mana = {200, 300},
	vocations = {1, 2, 5, 6},
	vocStr = "sorcerers and druids",
	level = 80,
	effect = {1, 50} -- number or a table with 2 numbers which will act as a random range
}

local exhaust = createConditionObject(CONDITION_EXHAUST or CONDITION_EXHAUST_HEAL)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions'))

function onUse(cid, item, fromPosition, itemEx, interval, lastexecution)
	local tid = itemEx.uid or cid
	if(isPlayer(tid) == FALSE) then
		return FALSE
	elseif(isInArray(config.vocations, getPlayerVocation(cid)) == FALSE or getPlayerLevel(cid) < config.level) then
		doCreatureSay(cid, "Only " .. config.vocStr .. " of level " .. config.level .. " or above can use this mana rune.", TALKTYPE_ORANGE_1)
		return TRUE
	elseif(doPlayerAddMana(tid, math.random(mana[1], mana[2])) == LUA_ERROR) then
		return FALSE
	end
	doAddCondition(cid, exhaust)
	doCreatureSay(tid, "Ahh, manarune rocks!", TALKTYPE_ORANGE_1) 
	doSendMagicEffect(toPosition, type(config.effect) == "table" and math.random(config.effect[1], config.effect[2]) or config.effect)
	return TRUE
end
 
Hey ;D

PHP:
  local config =  {
        mana = {200, 300},
		health = {200, 300},
        vocations = {1, 2, 5, 6},
        vocStr = "sorcerers and druids",
        level = 80,
        effect = {1, 50} -- number or a table with 2 numbers which will act as a random range
}

local exhaust = createConditionObject(CONDITION_EXHAUST or CONDITION_EXHAUST_HEAL)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions'))

function onUse(cid, item, fromPosition, itemEx, interval, lastexecution)
        local tid = itemEx.uid or cid
        if(isPlayer(tid) == FALSE) then
                return FALSE
        elseif(isInArray(config.vocations, getPlayerVocation(cid)) == FALSE or getPlayerLevel(cid) < config.level) then
                doCreatureSay(cid, "Only " .. config.vocStr .. " of level " .. config.level .. " or above can use this mana rune.", TALKTYPE_ORANGE_1)
                return TRUE
        elseif (doPlayerAddMana(tid, math.random(mana[1], mana[2])) == LUA_ERROR) or (doCreatureAddHealth(tid, math.random(mana[1], mana[2])) == LUA_ERROR) then
                return FALSE
        end
        doAddCondition(cid, exhaust)
        doCreatureSay(tid, "Ahh, manarune rocks!", TALKTYPE_ORANGE_1)
        doSendMagicEffect(toPosition, type(config.effect) == "table" and math.random(config.effect[1], config.effect[2]) or config.effect)
        return TRUE
end
 
LOL
You can configure health and mana in config..

PHP:
mana = {200, 300},
health = {200, 300},

First number is minimum value and second maximum. So in this case it is a random value between 200 and 300. K?
 
Back
Top