Code:
local x = getCreatureHealth(cid)
local y = getPlayerStorageValue(uid, 8514)
local z = -(1/100)x
function onCastSpell(cid, var)
setPlayerStorageValue(uid, y, x)
if doCreatureAddHealth(cid, z)
setPlayerStorageValue(uid, y, x)
doAreaCombatHealth(cid, type, pos, AREA_CIRCLE2X2 , (1/2)x+z, x+z, CONST_ME_ENERGYAREA)
end
setPlayerStorageValue(uid, y, 0)
end
I know that i cant do luas and xmls but I try
Its script to return injury to somebody who attacks player.
1. The first is to set storage that saves how many player have health
2. Next checks if somebody attacks player.
3. Next - new storage saves health
4. Last - if somebody attacked player - id does damage to area.