9
3

Charm.lua 1005 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --[[
  2. Script Name : Spells/Mage/Enchanter/Charm.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.11.26 07:11:01
  5. Script Purpose :
  6. :
  7. --]]
  8. --[[ Info from spell_display_effects (remove from script when done)
  9. *Charms target
  10. *Increases Power Regen of target by 2.7
  11. *Increases Health Regen of target by 5.4
  12. *If outside an arena
  13. *Certain enemies cannot be charmed
  14. *Only affects targets level 24 and below
  15. *Does not affect Epic targets
  16. --]]
  17. function precast(Caster, Target)
  18. if GetLevel(Target) > 24 then
  19. return false
  20. end
  21. return true
  22. end
  23. function cast(Caster, Target, PRegen, HRegen)
  24. Charm(Caster, Target)
  25. AddSpellBonus(Target, 601, PRegen)
  26. AddSpellBonus(Target, 600, HRegen)
  27. class = GetClass(Target)
  28. end
  29. function remove(Caster, Target)
  30. local pet = GetCharmedPet(Caster)
  31. if pet ~= nil then
  32. RemoveSpellBonus(pet)
  33. DismissPet(pet)
  34. end
  35. end