Charm.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. --[[
  2. Script Name : Spells/Mage/Enchanter/Coercer/Charm.lua
  3. Script Author : Jabantiz
  4. Script Date : 2014.03.14 05:03:40
  5. Script Purpose :
  6. :
  7. --]]
  8. -- Info from spell_display_effects (remove from script when done)
  9. -- Charms target
  10. -- Increases Out-of-Combat Power Regeneration of target by 2.0
  11. -- Increases Out-of-Combat Health Regeneration of target by 4.0
  12. -- Applies Disorientation on termination. Lasts for 3.0 seconds.
  13. -- Mesmerizes target
  14. -- Dispelled when target takes damage
  15. -- Epic targets gain an immunity to Mesmerize effects of 9.0 seconds and duration is reduced to 1.0 second.
  16. -- Applies Warning on termination. Lasts for 0.5 seconds.
  17. -- Grants Sonic Vision to caster
  18. -- Certain enemies cannot be charmed
  19. -- Only affects targets level 16 and below
  20. -- Does not affect Epic targets
  21. function cast(Caster, Target, PowerRegen, HealthRegen, MaxLevel)
  22. if not IsEpic(Target) and (MaxLevel == 0 or GetLevel(Target) <= MaxLevel) then
  23. Charm(Caster, Target)
  24. AddSpellBonus(Target, 601, PowerRegen)
  25. AddSpellBonus(Target, 600, HealthRegen)
  26. end
  27. end
  28. function remove(Caster, Target)
  29. local pet = GetCharmedPet(Caster)
  30. if pet ~= nil then
  31. RemoveSpellBonus(pet)
  32. DismissPet(pet)
  33. end
  34. end