Viscerate.lua 852 B

123456789101112131415161718192021222324252627282930313233
  1. --[[
  2. Script Name : Spells/Scout/Rogue/Swashbuckler/Viscerate.lua
  3. Script Author : Jabantiz
  4. Script Date : 2013.12.15 08:12:23
  5. Script Purpose :
  6. :
  7. --]]
  8. function precast(Caster, Target)
  9. -- Must be flanking or behind
  10. if not IsFlanking(Caster, Target) then
  11. SendMessage(Caster, "Must be flanking or behind", "yellow")
  12. return false
  13. end
  14. return true
  15. end
  16. function cast(Caster, Target, BonusAmt, DmgType, MinVal, MaxVal)
  17. -- Decreases AGI of target by 5.0
  18. AddSpellBonus(Target, 2, BonusAmt)
  19. -- Inflicts 16 - 27 melee damage on target
  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. end
  26. function remove(Caster, Target)
  27. RemoveSpellBonus(Target)
  28. end