Yaboihunna
New Member
- Joined
- Mar 27, 2019
- Messages
- 139
- Reaction score
- 3
Needing a mana rune script that heals health for knight mana/hp for paladins and mana for mage thanks
local t = {
-- [vocation, promotedvocation] = {mini = minimum heal, maxi = maximum heal}
[{1, 2, 5, 6}] = {mp={1050,1150},hp={100,150}},
[{3, 7}] = {mp={300,500}, hp={800,950}},
[{4, 8}] = {mp={150,300}, hp={2100,2450}},
[{9, 10}] = {mp={1200,1300},hp={200,250}},
[{11}] = {mp={350,650}, hp={900,1050}},
[{12}] = {mp={250,350}, hp={2200,2450}}
}
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, EXHAUST_HEALING)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not isPlayer(itemEx.uid) then...
local t = {
-- [vocation, promotedvocation] = {mini = minimum heal, maxi = maximum heal}
[{1, 2, 5, 6}] = {mp={1050,1150},hp={100,150}},
[{3, 7}] = {mp={300,500}, hp={800,950}},
[{4, 8}] = {mp={150,300}, hp={2100,2450}},
[{9, 10}] = {mp={1200,1300},hp={200,250}},
[{11}] = {mp={350,650}, hp={900,1050}},
[{12}] = {mp={250,350}, hp={2200,2450}}
}
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, EXHAUST_HEALING)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not isPlayer(itemEx.uid) then
return false
elseif hasCondition(cid, CONDITION_EXHAUST, EXHAUST_HEALING) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
end
local p = getPlayerVocation(cid)
for k, v in pairs(t) do
if isInArray(k, p) then
doAddCondition(cid, exhaust)
if v.mp then
doCreatureAddMana(cid, math.random(v.mp[1], v.mp[2]))
end
if v.hp then
doCreatureAddHealth(cid, math.random(v.hp[1], v.hp[2]))
end
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
return true
end
end
end
<action itemid="2284" event="script" value="healing rune.lua"/>
Nvmm I gotchu one question can you edit it to use /z 49
local t = {
-- [vocation, promotedvocation] = {mini = minimum heal, maxi = maximum heal}
[{1, 2, 5, 6}] = {mp={1050,1150},hp={100,150}},
[{3, 7}] = {mp={300,500}, hp={800,950}},
[{4, 8}] = {mp={150,300}, hp={2100,2450}},
[{9, 10}] = {mp={1200,1300},hp={200,250}},
[{11}] = {mp={350,650}, hp={900,1050}},
[{12}] = {mp={250,350}, hp={2200,2450}}
}
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, EXHAUST_HEALING)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not isPlayer(itemEx.uid) then
return false
elseif hasCondition(cid, CONDITION_EXHAUST, EXHAUST_HEALING) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
end
local p = getPlayerVocation(cid)
for k, v in pairs(t) do
if isInArray(k, p) then
doAddCondition(cid, exhaust)
if v.mp then
doCreatureAddMana(cid, math.random(v.mp[1], v.mp[2]))
end
if v.hp then
doCreatureAddHealth(cid, math.random(v.hp[1], v.hp[2]))
end
doSendMagicEffect(getThingPos(cid), 49)
return true
end
end
end
So it works when you use on yourself by hands but when adding to hotkey it doesn't work? only this rune or all other runes?When I add the rune to hotkey it does not use