9
3

SingingShot.lua 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. --[[
  2. Script Name : Spells/Scout/Bard/Troubadour/SingingShot.lua
  3. Script Author : Zcoretri
  4. Script Date : 4.April.2014
  5. Script Purpose :
  6. :
  7. --]]
  8. function precast(Caster, Target)
  9. -- If weapon equipped in Ranged
  10. local item = GetEquippedItemBySlot(Caster, 16) -- (16) = Ranged Weapon slot
  11. if not item or GetItemType(item) ~= 2 then
  12. -- no item or item is not a ranged item (no way to determine different ranged items yet)
  13. return false, 68
  14. end
  15. return true
  16. end
  17. function cast(Caster, Target, DmgType, MinDmg, MaxDmg, DmgType2, MinDmg2, MaxDmg2)
  18. -- Inflicts mental damage on target x2 if first one hits
  19. SpellDamage(Target, DmgType, MinDmg, MaxDmg)
  20. if LastSpellAttackHit() then
  21. SpellDamage(Target, DmgType2, MinDmg2, MaxDmg2)
  22. end
  23. -- Stifles target
  24. -- If Target is not Epic
  25. if not IsEpic(Target) then
  26. AddControlEffect(Target, 2) -- Stifle
  27. end
  28. -- Resistibility increases against targets higher than level 29.
  29. end
  30. function remove(Caster, Target, DmgType, MinDmg, MaxDmg, DmgType2, MinDmg2, MaxDmg2)
  31. RemoveControlEffect(Target, 2)
  32. end