Well let me start off by saying.. Credits to Evil Hero.
But i just made these work with TFS
So paste this inside your global.lua
Example of use.
But i just made these work with TFS
So paste this inside your global.lua
Code:
--Remove health/mana by percentages: Evil Hero(Zeriikler:Changed few things)
function doPlayerAddManaPercent(cid, percent)
local mana = getPlayerMaxMana(cid)
doPlayerAddMana(cid, (mana / 100) * percent)
return TRUE
end
function doPlayerAddHealthPercent(cid, percent)
local health = getCreatureMaxHealth(cid)
doCreatureAddHealth(cid, (health / 100) * percent)
return TRUE
end
function doPlayerRemoveManaPercent(cid, percent)
local mana = getPlayerMaxMana(cid)
doPlayerRemoveMana(cid, (mana / 100) * percent)
return TRUE
end
function doPlayerRemoveHealthPercent(cid, percent)
local health = getCreatureMaxHealth(cid)
doPlayerRemoveHealth(cid, (health / 100) * percent)
return TRUE
end
--Remove HP/MANA
function doPlayerRemoveHealth(cid, hp)
doCreatureAddHealth(cid, -hp)
return TRUE
end
function doPlayerRemoveMana(cid, mana)
doPlayerAddMana(cid, -mana)
return TRUE
end
Example of use.
Code:
function onStepIn(cid, item, pos)
if item.actionid == 1029 then
doRemoveHealthPercent(cid,85)
doRemoveManaPercent(cid,85)
end
return 1
end