9
3

ArcticBlast.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. --[[
  2. Script Name : Spells/Scout/Rogue/Swashbuckler/ArcticBlast.lua
  3. Script Author : Jabantiz
  4. Script Date : 2013.12.16 03:12:34
  5. Script Purpose :
  6. :
  7. --]]
  8. function precast(Caster, Target)
  9. -- If weapon equipped in Ranged
  10. local item = GetEquippedItemBySlot(Caster, 16)
  11. if item then
  12. if GetItemType(item) == 2 then
  13. return true
  14. end
  15. end
  16. return false, 68
  17. end
  18. function cast(Caster, Target, DmgType, MinVal, MaxVal, Snare)
  19. -- Inflicts 57 - 95 cold 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. -- Inflicts 57 - 95 cold damage on target
  26. if LastSpellAttackHit() then
  27. if MaxVal ~= nil and MinVal < MaxVal then
  28. SpellDamage(Target, DmgType, math.random(MinVal, MaxVal))
  29. else
  30. SpellDamage(Target, DmgType, MinVal)
  31. end
  32. end
  33. -- Applies Snare on termination. Lasts for 24.0 seconds.
  34. -- Slows target by 29.9%
  35. -- 5% chance to dispel when target receives hostile action
  36. -- 5% chance to dispel when target takes damage
  37. if LastSpellAttackHit() then
  38. SetSpeedMultiplier(Target, (100 - Snare) / 100)
  39. AddSpellTimer(24000, "RemoveSnare")
  40. end
  41. end
  42. function RemoveSnare(Caster, Target)
  43. SetSpeedMultiplier(Target, 1)
  44. end