EgoShock.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --[[
  2. Script Name : Spells/Mage/Enchanter/EgoShock.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.11.27 05:11:18
  5. Script Purpose :
  6. :
  7. --]]
  8. --[[ Info from spell_display_effects (remove from script when done)
  9. *Inflicts 42 - 51 mental damage on target
  10. *Roots target
  11. *5% chance to dispel when target takes damage
  12. *5% chance to dispel when target receives hostile action
  13. *Epic targets gain an immunity to Root and Ability attacks will hit for their maximum damage. effects of 27.0 seconds and duration is reduced to 3.0 seconds.
  14. *Resistibility increases against targets higher than level 29.
  15. --]]
  16. function cast(Caster, Target, DmgType, MinVal, MaxVal)
  17. Level = GetLevel(Caster)
  18. SpellLevel = 11
  19. Mastery = SpellLevel + 10
  20. StatBonus = GetInt(Caster) / 10
  21. if Level < Mastery then
  22. LvlBonus = Level - SpellLevel
  23. else LvlBonus = Mastery - SpellLevel
  24. end
  25. DmgBonus = LvlBonus + StatBonus
  26. MinDmg = math.floor(DmgBonus) * 2 + MinVal
  27. MaxDmg = math.floor(DmgBonus) * 2 + MaxVal
  28. SpellDamage(Target, DmgType, MinDmg, MaxDmg)
  29. -- Roots target
  30. AddControlEffect(Target, 5)
  31. -- 5% chance to dispel when target takes damage
  32. AddProc(Target, 2, 5.0)
  33. end
  34. function proc(Caster, Target, Type)
  35. if Type == 2 then
  36. CancelSpell()
  37. end
  38. end
  39. function remove(Caster, Target)
  40. RemoveControlEffect(Target, 5)
  41. end