Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- By Godfather
- function onStatsChange(cid, attacker, type, combat, value)
- local porcentagem = 40
- local reset = 9235
- if getPlayerSlotItem(cid,2).itemid == 2218 then
- if isMonster(attacker) then
- if type == 1 or type == 3 then
- if getPlayerStorageValue(cid,reset) == 2 then
- setPlayerStorageValue(cid,reset,1)
- return true
- else
- local blocked = math.ceil((porcentagem/100)*value)
- setPlayerStorageValue(cid,reset,2)
- doPlayerSendTextMessage(cid,MESSAGE_STATUS_DEFAULT,"Protegeu "..porcentagem.."% de "..value.." ("..blocked..")")
- doPlayerSendCancel(cid,"Protegeu "..porcentagem.."% de "..value.." ("..blocked..")")
- doAreaCombatHealth(attacker, combat, getCreaturePosition(cid), 0, -blocked, -blocked, -1)
- return false
- end
- end
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement