Advertisement
adrianoswatt

Boost System - Incompleto

Aug 17th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1. local percent_limit = 500
  2.  
  3. function onStatsChange(cid, attacker, type, combat, value)
  4.     if isSummon(attacker) and isPlayer(getCreatureMaster(attacker)) then
  5.         if type == STATSCHANGE_HEALTHLOSS and value >= 1 then
  6.             local overflow_protection = {}
  7.             if overflow_protection[attacker] then
  8.                 overflow_protection[attacker] = nil
  9.                 return true
  10.             end
  11.             ownSummon = getCreatureMaster(attacker)
  12.             getML = getPlayerMagLevel(ownSummon)
  13.             getLvL = getPlayerLevel(ownSummon)
  14.             addDMG = getML + getLvL -- Percent
  15.             if addDMG < percent_limit then
  16.                 newValue = (value*(addDMG/100))
  17.             else
  18.                 newValue = (value*(500/100))
  19.             end
  20.             local dmg = math.floor(value + newValue)
  21.             overflow_protection[attacker] = true
  22.             doPlayerSendTextMessage(ownSummon, MESSAGE_STATUS_DEFAULT, "Your "..getCreatureName(attacker).." deals "..value.." [+"..dmg.." boost damage] to "..(getMonsterInfo(getCreatureName(cid)).description)..".")
  23.             doTargetCombatHealth(attacker, cid, combat, -dmg, -dmg, CONST_ME_NONE)
  24.             return false
  25.         end
  26.     end
  27. return true
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement