Im looking for a mana rune which gives different mana and health to different vocation.
The problem in my server is that people can stairhop, they cant cast spells due to the 2000 stair hop exhaust. I want them to have a one second exhaust when stairhopping.
This is the code i tried to make.. From other scripts though, no credits to me at all.
The problem in my server is that people can stairhop, they cant cast spells due to the 2000 stair hop exhaust. I want them to have a one second exhaust when stairhopping.
This is the code i tried to make.. From other scripts though, no credits to me at all.
Code:
local vocation = {
[{1,5}] = {manamin = 500,manamax = 600, healthmin = 0 , healthmax= 0}, -- [vocation,promotedvocation] = {mini = minimum heal, maxi = maximum heal}
[{2,6}] = {manamin = 500,manamax = 600, healthmin = 0 , healthmax= 0},
[{3,7}] = {manamin = 400,manamax = 500, healthmin = 100, healthmax= 150},
[{4,8}] = {manamin = 150,manamax = 200, healthmin = 0 , healthmax= 0},
[{9,10}] = {manamin = 1400,manamax = 1500, healthmin = 0 , healthmax= 0},
[{11}] = {manamin = 1000,manamax = 1100, healthmin = 500 , healthmax= 700},
[{12}] = {manamin = 350,manamax = 550, healthmin = 0 , healthmax= 0}
}
local exhaust = createConditionObject(CONDITION_EXHAUST);
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 10000));
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
for k,v in pairs(vocation) do
if isInArray(k,getPlayerVocation(cid)) then
doAddCondition(cid, exhaust)
doCreatureAddMana(cid,math.random(v.manamin,v.manamax))
doCreatureAddHealth(cid,math.random(v.healthmin,v.healthmax))
doSendMagicEffect(getThingPos(cid),12)
end
end
return true
end