DauntingGaze.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --[[
  2. Script Name : Spells/Mage/Enchanter/DauntingGaze.lua
  3. Script Author : LordPazuzu
  4. Script Date : 11/4/2023
  5. Script Purpose :
  6. :
  7. --]]
  8. -- Decreases power of target by 79 - 97
  9. -- Stuns target
  10. -- If Target is not Epic
  11. -- Resistibility increases against targets higher than level 29.
  12. function precast(Caster, Target)
  13. -- Does not affect Epic targets
  14. if IsEpic(Target) then
  15. return false, 43
  16. end
  17. return true
  18. end
  19. function cast(Caster, Target, MaxVal, MinVal)
  20. Level = GetLevel(Caster)
  21. SpellLevel = 13
  22. Mastery = SpellLevel + 10
  23. StatBonus = GetInt(Caster) / 10
  24. if Level < Mastery then
  25. LvlBonus = Level - SpellLevel
  26. else LvlBonus = Mastery - SpellLevel
  27. end
  28. TotalBonus = math.floor(LvlBonus + StatBonus)
  29. DrainLow = MinVal - TotalBonus
  30. DrainHigh = MaxVal - TotalBonus
  31. TotalDrain = math.random(DrainLow, DrainHigh)
  32. Say(Caster, "Resistability not implemented")
  33. AddControlEffect(Target, 4)
  34. ModifyPower(Target, TotalDrain)
  35. end
  36. function remove(Caster, Target)
  37. RemoveControlEffect(Target, 4)
  38. end