Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. function onCastSpell(cid)
  2. local formula = getPlayerLevel(cid) * getPlayerMagLevel(cid)
  3. local target = getCreatureTarget(cid)
  4.  
  5. if target < 1 then
  6.  
  7. doPlayerSendCancel(cid, "Voce precisa de um target.")
  8. return false
  9. end
  10.  
  11. if isPlayer(target) then
  12.  
  13. formula = formula / getPlayerLevel(target)
  14. else
  15.  
  16. formula = formula / 10 -- Esta formula é de acordo com o magiclevel, quando maior o número, menor o dano!
  17. end
  18.  
  19. local stealPercent = formula / 100 * 50 -- No caso a spell está configurada para curar 50%
  20.  
  21. doCreatureAddHealth(cid, stealPercent)
  22. doSendAnimatedText(getThingPos(cid), "+" .. stealPercent, 25)
  23.  
  24. doSendDistanceShoot(getThingPos(cid), getThingPos(target), 15)
  25. doAreaCombatHealth(cid, COMBAT_PHYSICALDAMAGE, getThingPos(target), 0, - formula, - formula * 0.5, CONST_ME_MAGIC_RED)
  26. return true
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement