Hey there!
I found this script while looking for this but I'd love to have one modification to it: I don't want it to stack.
Atm spamming potions stacks the effect of each of them making it very difficult to balance.
Is it possible to make them non stackable with themselves but stackable with other stuff like normal healing or recovery spells?
Also, is it possible to have them for mana too?
Thanks in advance. Here's the script:
Edit:
The post has this:
But it doesn't work...
TFS 1.4.2 BTW
I found this script while looking for this but I'd love to have one modification to it: I don't want it to stack.
Atm spamming potions stacks the effect of each of them making it very difficult to balance.
Is it possible to make them non stackable with themselves but stackable with other stuff like normal healing or recovery spells?
Also, is it possible to have them for mana too?
Thanks in advance. Here's the script:
Lua:
local config = {
amount = 20, -- HPs by second
time = 10 -- seconds
}
local function doRegeneration(cid, amount, seconds)
if seconds <= 0 then
return FALSE
end
doCreatureAddHealth(cid, amount)
doSendAnimatedText(getThingPos(cid), "+" .. amount, COLOR_LIGHTBLUE)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
return addEvent(doRegeneration, 1000, cid, amount, seconds - 1)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
doRemoveItem(item.uid, 1)
doRegeneration(cid, config.amount, config.time)
return TRUE
end
Edit:
The post has this:
Lua:
local config = {
amount = 20, -- HPs by second
time = 5, -- seconds
exhaust = {
storage = 1000,
time = 10, -- Exhaust time seconds~
}
}
local function doRegeneration(cid, amount, seconds)
if seconds <= 0 then
return false
end
doCreatureAddHealth(cid, amount)
doSendAnimatedText(getThingPos(cid), "+" .. amount, COLOR_LIGHTBLUE)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
return addEvent(doRegeneration, 1000, cid, amount, seconds - 1)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if exhaustion.check(cid, config.exhaust.storage) then
return doPlayerSendCancel(cid, "You're exhausted.")
end
doRemoveItem(item.uid, 1)
doRegeneration(cid, config.amount, config.time)
exhaustion.set(cid, config.exhaust.storage, config.exhaust.time)
return true
end
But it doesn't work...
TFS 1.4.2 BTW
Last edited: