function onStatsChange(cid, attacker, type, combat, value)
local percent = 5
if combat == 128 then
return true
end
if attacker ~= cid and isPlayer(attacker) then
if getPlayerParty(cid) ~= getPlayerParty(attacker) or (getPlayerParty(attacker) == nil or getPlayerParty(cid) == nil) then
return true
end
local damage = math.ceil((value * percent / 100))
doTargetCombatHealth(attacker, cid, 128, -damage, -damage, CONST_ME_POFF)
return false
end
return true
end
Something like this:
But the effect won't work right..PHP:function onStatsChange(cid, attacker, type, combat, value) local percent = 5 if combat == 128 then return true end if attacker ~= cid and isPlayer(attacker) then if getPlayerParty(cid) ~= getPlayerParty(attacker) or (getPlayerParty(attacker) == nil or getPlayerParty(cid) == nil) then return true end local damage = math.ceil((value * percent / 100)) doTargetCombatHealth(attacker, cid, 128, -damage, -damage, CONST_ME_POFF) return false end return true end
function onStatsChange(cid, attacker, type, combat, value)
if combat == 128 then
return true
end
if attacker ~= cid and isPlayer(attacker) then
if getPlayerParty(cid) ~= getPlayerParty(attacker) or (getPlayerParty(attacker) == nil or getPlayerParty(cid) == nil) then
return true
end
local damage = math.ceil(value/20)
doTargetCombatHealth(attacker, cid, 128, -damage, -damage, CONST_ME_POFF)
doSendAnimatedText(getCreaturePosition(cid),damage,27)
return false
end
return true
end