DoubleBlast.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --[[
  2. Script Name : Spells/Scout/Rogue/Brigand/DoubleBlast.lua
  3. Script Author : Zcoretri
  4. Script Date : 17.March.2014
  5. Script Purpose :
  6. :
  7. --]]
  8. function precast(Caster, Target)
  9. -- If weapon equipped in Ranged
  10. local item = GetEquippedItemBySlot(Caster, 16)
  11. if not item or GetItemType(item) ~= 2 then
  12. -- no item or item is not a ranged item (no way to determine different range items currently)
  13. return false, 68
  14. end
  15. return true
  16. end
  17. function cast(Caster, Target, MinDmg, MaxDmg, MinDmg2, MaxDmg2)
  18. -- Inflicts ranged damage on target x2 if first one hits
  19. SpellDamage(Target, MinDmg, MaxDmg)
  20. if LastSpellAttackHit() then
  21. SpellDamage(Target, MinDmg2, MaxDmg2)
  22. end
  23. -- Applies Knockdown on termination. Lasts for 2.5 seconds.
  24. -- Throws target back
  25. -- Blurs vision of target
  26. -- Stuns target
  27. -- Does not affect Epic targets
  28. if not IsEpic(Target) then
  29. AddControlEffect(Target, 4) -- Stun
  30. Knockback(Caster, Target, 2500)
  31. BlurVision(Target, 0.5)
  32. end
  33. end
  34. function remove(Caster, Target, MinDmg, MaxDmg, MinDmg2, MaxDmg2)
  35. RemoveControlEffect(Target, 4)
  36. BlurVision(Target, 0)
  37. end