CripplingStrike.lua 943 B

123456789101112131415161718192021222324252627282930313233
  1. --[[
  2. Script Name : Spells/Scout/Predator/Assassin/CripplingStrike.lua
  3. Script Author : neatz09
  4. Script Date : 2019.09.23 03:09:37
  5. Script Purpose :
  6. :
  7. --]]
  8. -- Must be flanking or behind
  9. function precast(Caster, Target)
  10. -- Must be flanking or behind
  11. if not IsFlanking(Caster, Target) then
  12. SendMessage(Caster, "Must be flanking or behind", "yellow")
  13. return false
  14. end
  15. end
  16. -- Inflicts 386 - 643 melee damage on target
  17. function cast(Caster, Target, DmgType, MinVal, MaxVal, SkillAmt)
  18. if MaxVal ~= nil and MinVal < MaxVal then
  19. SpellDamage(Target, DmgType, math.random(MinVal, MaxVal))
  20. else
  21. SpellDamage(Target, DmgType, MinVal)
  22. end
  23. -- Decreases Defense of target by 23.5
  24. AddSkillBonus(Target, GetSkillIDByName("Defense"), SkillAmt)
  25. end
  26. function remove(Caster, Target, SkillAmt)
  27. RemoveSkillBonus(Target)
  28. end