WeaponCounter.lua 884 B

1234567891011121314151617181920212223242526272829
  1. --[[
  2. Script Name : Spells/Fighter/Warrior/Berserker/WeaponCounter.lua
  3. Script Author : neatz09
  4. Script Date : 2019.10.15 05:10:46
  5. Script Purpose :
  6. :
  7. --]]
  8. -- When damaged with a melee weapon this spell will cast Counterattack on target's attacker.
  9. -- Inflicts 43 - 72 melee damage on target
  10. -- Grants a total of 3 triggers of the spell.
  11. function cast(Caster, Target, DmgType, MinVal, MaxVal, Triggers)
  12. AddProc(Target, 15, 100)
  13. SetSpellTriggerCount(Triggers, 1)
  14. end
  15. function proc(Caster, Target, Type, DmgType, MinVal, MaxVal, Triggers)
  16. if Type == 15 then
  17. -- Inflicts 79 - 133 piercing damage on target
  18. ProcDamage(Caster, Target, "Counterattack", DmgType, MinVal, MaxVal)
  19. RemoveTriggerFromSpell(1)
  20. end
  21. end
  22. function remove(Caster, Target)
  23. RemoveProc(Target)
  24. end