Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local percent_limit = 500
- function onStatsChange(cid, attacker, type, combat, value)
- if isSummon(attacker) and isPlayer(getCreatureMaster(attacker)) then
- if type == STATSCHANGE_HEALTHLOSS and value >= 1 then
- local overflow_protection = {}
- if overflow_protection[attacker] then
- overflow_protection[attacker] = nil
- return true
- end
- ownSummon = getCreatureMaster(attacker)
- getML = getPlayerMagLevel(ownSummon)
- getLvL = getPlayerLevel(ownSummon)
- addDMG = getML + getLvL -- Percent
- if addDMG < percent_limit then
- newValue = (value*(addDMG/100))
- else
- newValue = (value*(500/100))
- end
- local dmg = math.floor(value + newValue)
- overflow_protection[attacker] = true
- doPlayerSendTextMessage(ownSummon, MESSAGE_STATUS_DEFAULT, "Your "..getCreatureName(attacker).." deals "..value.." [+"..dmg.." boost damage] to "..(getMonsterInfo(getCreatureName(cid)).description)..".")
- doTargetCombatHealth(attacker, cid, combat, -dmg, -dmg, CONST_ME_NONE)
- return false
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement