Taunt.lua 932 B

12345678910111213141516171819202122232425262728293031323334
  1. --[[
  2. Script Name : Spells/Fighter/Taunt.lua
  3. Script Author : Dello
  4. Script Date : 19/07/2014
  5. Script Purpose :
  6. :
  7. --]]
  8. function cast(Caster, Target, DmgType, MinVal, MaxVal)
  9. local spell_name = GetSpellName()
  10. if spell_name ~= "Faith Strike I" and spell_name ~= "Faith Strike II" and spell_name ~= "Faith Strike III" then
  11. if MaxVal ~= nil and MinVal < MaxVal then
  12. SpellDamage(Target, DmgType, math.random(MinVal, MaxVal))
  13. else
  14. SpellDamage(Target, DmgType, MinVal)
  15. end
  16. local max_hp = GetMaxHP(Target)
  17. MinVal = (max_hp * (MinVal / 100))
  18. MaxVal = (max_hp * (MaxVal / 100))
  19. end
  20. if MaxVal ~= nil and MinVal < MaxVal then
  21. SpellDamage(Target, DmgType, math.random(MinVal, MaxVal))
  22. else
  23. SpellDamage(Target, DmgType, MinVal)
  24. end
  25. SpellHeal("Heal", MinVal, MaxVal, 0, 2, 1)
  26. end