Soo i would like some help with two runes. Tfs 0.4 3887
The first one i need it to work in 2 ways so ek and mage dont act from the same min/max to make it easyer to tweek.
Second rune is the paladin rune that i got help to fix here on the forum.
On this one i would like to have it so mana and hp dont heal from the same min/max (want mana to heal 10-20% less)
The first one i need it to work in 2 ways so ek and mage dont act from the same min/max to make it easyer to tweek.
Lua:
local array_knight = {1, 2, 4, 5, 6, 8, 9, 10, 12}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local exhausted = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhausted, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
if not isPlayer(itemEx.uid) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
if hasCondition(cid, CONDITION_EXHAUST_HEAL) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
end
if not isInArray(array_knight, getPlayerVocation(cid)) then
return doPlayerSendCancel(cid, "Only mages and knights can use this.")
end
local min = getPlayerLevel(cid) * 1.2 + getPlayerMagLevel(cid) * 11.0
local max = getPlayerLevel(cid) * 1.2 + getPlayerMagLevel(cid) * 11.0
local rand = math.random(min, max)
if rand > 10000 then
rand = 10000
elseif rand < 100 then
rand = 0
end
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
doCreatureAddMana(itemEx.uid, rand)
doAddCondition(cid, exhausted)
doCreatureSay(itemEx.uid, "Holy Manarune", TALKTYPE_ORANGE_1)
return true
end
Second rune is the paladin rune that i got help to fix here on the forum.
On this one i would like to have it so mana and hp dont heal from the same min/max (want mana to heal 10-20% less)
Lua:
local vocations = {3, 7}
function onUse(cid, item, frompos, item2, topos)
local vocations = {3, 7}
if isInArray(vocations, getPlayerVocation(cid)) then
doSendMagicEffect(topos,1)
doCreatureSay(cid, "Holy Spiritrune", 19)
local mini = (getPlayerLevel(cid) * 2.3 + getPlayerMagLevel(cid) * 10.4)
local maxi = (getPlayerLevel(cid) * 2.8 + getPlayerMagLevel(cid) * 10.7)
local amount = math.random(mini, maxi)
addEvent(function() doSendAnimatedText(topos, "+"..amount.."", TEXTCOLOR_GREEN) end, 250)
if doCreatureAddHealth(cid, amount) == LUA_ERROR or doPlayerAddMana(cid, amount) == LUA_ERROR then
return false
end
else
doPlayerSendCancel(cid, 'This rune is only useable on Paladins.')
end
return true
end