Shanghai.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. --[[
  2. Script Name : Spells/Scout/Rogue/Swashbuckler/Shanghai.lua
  3. Script Author : Jabantiz
  4. Script Date : 2013.12.15 08:12:20
  5. Script Purpose :
  6. :
  7. --]]
  8. function precast(Caster, Target)
  9. -- You must be sneaking to use this ability.
  10. return IsStealthed(Caster)
  11. end
  12. function cast(Caster, Target, DmgType, MinVal, MaxVal)
  13. -- Inflicts 13 - 21 melee damage on target
  14. if MaxVal ~= nil and MinVal < MaxVal then
  15. SpellDamage(Target, DmgType, math.random(MinVal, MaxVal))
  16. else
  17. SpellDamage(Target, DmgType, MinVal)
  18. end
  19. -- Applies Knockdown on termination. Lasts for 2.5 seconds.
  20. -- Blurs vision of target
  21. -- Throws target back
  22. -- Stuns target
  23. -- Does not affect Epic targets
  24. if not IsEpic(Target) then
  25. Knockdown(Target, Caster, 2500)
  26. AddControlEffect(Target, 4)
  27. BlurVision(Target, 1.0)
  28. AddSpellTimer(2500, "RemoveEffects")
  29. end
  30. end
  31. function RemoveEffects(Caster, Target)
  32. RemoveControlEffect(Target, 4)
  33. BlurVision(Target, 0)
  34. end