9
3

SneakAttack.lua 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. --[[
  2. Script Name : Spells/Scout/Predator/Ranger/SneakAttack.lua
  3. Script Author : Jabantiz
  4. Script Date : 2014.03.10 07:03:05
  5. Script Purpose :
  6. :
  7. --]]
  8. function precast(Caster, Target)
  9. -- Must be flanking or behind
  10. if not IsFlanking(Caster, Target) or not IsBehind(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, DmgType, MinVal, MaxVal)
  17. -- Inflicts 27 - 45 melee damage on target
  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. -- Applies Shroud on termination. Lasts for 36.0 seconds.
  24. -- Grants stealth to caster
  25. -- Suspends caster's movement speed enhancements
  26. -- Stelath component will probably need to be a new spell cast from here
  27. Say(Caster, "Not implemented yet: Put caster in stealth")
  28. end