TheOverlordsWill.lua 1012 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --[[
  2. Script Name : Spells/Commoner/TheOverlordsWill.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.09.26 03:09:36
  5. Script Purpose :
  6. :
  7. --]]
  8. --[[ Info from spell_display_effects (remove from script when done)
  9. --]]
  10. function cast(Caster, Target)
  11. if GetQuestStep(Target,5890)>=1 then
  12. SetStepComplete(Target,5890,1)
  13. local Alignment = GetAlignment(Target)
  14. if Alignment == 0 then
  15. SetAlignment(Target,2)
  16. end
  17. RemoveSpellBookEntry(Target, 2550019)
  18. local Freeport = GetFactionAmount(Target, 12)
  19. if Freeport >0 then
  20. ChangeFaction(Target, 12, -100000)
  21. end
  22. end
  23. local hp = GetHP(Target)
  24. local damage = GetMaxHP(Target) *1.5
  25. local damageToTake = damage * 1
  26. -- if we don't have enough HP make them die to pain and suffering not self...
  27. if hp <= damageToTake then
  28. KillSpawn(Target, null, 1)
  29. else
  30. DamageSpawn(Target, Target, 192, 3, damageToTake, damageToTake, "the Overlord's Banishment!", 0, 0, 1, 1)
  31. end
  32. end