9
3

Ambush.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --[[
  2. Script Name : Spells/Scout/Ambush.lua
  3. Script Author : neatz09
  4. Script Date : 2020.11.03 03:11:37
  5. Script Purpose :
  6. :
  7. --]]
  8. -- Inflicts 12 - 20 melee damage on target
  9. -- You must be sneaking to use this ability.
  10. --[[function precast(Caster,Target)
  11. -- You must be sneaking to use this ability.
  12. if not IsStealthed(Caster) then
  13. SendMessage(Caster, "You must be sneaking to use this ability.", "yellow")
  14. return false
  15. end
  16. end
  17. function cast(Caster, Target, DmgType, MinVal, MaxVal)
  18. SpellDamage(Target, DmgType, MinVal, MaxVal)
  19. end--]]
  20. function precast(Caster, Target)
  21. -- You must be sneaking to use this ability.
  22. if IsStealthed(Caster) then
  23. return true
  24. end
  25. SendMessage(Caster, "You must be sneaking to use this ability.", "yellow")
  26. return false
  27. end
  28. function cast(Caster, Target, DmgType, MinVal, MaxVal)
  29. -- Inflicts 14 - 24 melee damage on target
  30. if MaxVal ~= nil and MinVal < MaxVal then
  31. SpellDamage(Target, DmgType, math.random(MinVal, MaxVal))
  32. else
  33. SpellDamage(Target, DmgType, MinVal)
  34. end
  35. end