Banish!.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. --[[
  2. Script Name : Spells/Fighter/Banish!.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.11.06 03:11:17
  5. Script Purpose :
  6. :
  7. --]]
  8. --[[ Info from spell_display_effects (remove from script when done)
  9. *Banishes player from the immediate area.
  10. --]]
  11. function cast(Caster, Target)
  12. Qfaction = GetFactionAmount(Target,11)
  13. FPfaction = GetFactionAmount(Target,12)
  14. local zone = GetZone(Caster)
  15. if GetZoneID(zone) >= 220 and GetZoneID(zone) <= 238 then -- clarifies which zone is designated EVIL or GOOD
  16. GOOD = true
  17. elseif GetZoneID(zone) == 207 then
  18. GOOD = true
  19. elseif GetZoneID(zone) >= 195 and GetZoneID(zone) <= 198 then
  20. GOOD = true
  21. elseif GetZoneID(zone) == 589 or GetZoneID(zone) == 660 then
  22. GOOD = true
  23. elseif GetZoneID(zone) == 470 then
  24. GOOD = true
  25. elseif GetZoneID(zone) == 45 then
  26. NEUTRAL = true
  27. elseif GetZoneID(zone) >= 124 and GetZoneID(zone) <= 128 then
  28. EVIL = true
  29. elseif GetZoneID(zone) >= 134 and GetZoneID(zone)<= 168 then
  30. EVIL = true
  31. end
  32. if IsPlayer(Target) then
  33. if GOOD and Qfaction >0 then
  34. ExpeltoQHood(Caster,Target)
  35. elseif GOOD and Qfaction <0 then
  36. EvilExpel(Caster,Target)
  37. end
  38. end
  39. end
  40. function ExpeltoQHood(Caster,Target)
  41. local Race = GetRace(Target)
  42. -- Kerra
  43. if Race == 11 or Race == 9 then
  44. ZoneRef = GetZone("Nettleville")
  45. Zone(ZoneRef,Target)
  46. -- Erudite
  47. elseif Race == 3 or Race == 20 then
  48. ZoneRef = GetZone("Starcrest")
  49. Zone(ZoneRef,Target)
  50. -- Barbarian / Dwarf
  51. elseif Race == 0 or Race == 2 then
  52. ZoneRef = GetZone("Graystone")
  53. Zone(ZoneRef,Target)
  54. -- Froglok / High Elf
  55. elseif Race == 4 or Race == 8 then
  56. ZoneRef = GetZone("Castleview")
  57. Zone(ZoneRef,Target)
  58. -- Half Elf / Wood Elf
  59. elseif Race == 6 or Race == 15 then
  60. ZoneRef = GetZone("Willowwood")
  61. Zone(ZoneRef,Target)
  62. -- Gnome / Halfling
  63. elseif Race == 5 or Race == 7 then
  64. ZoneRef = GetZone("Baubbleshire")
  65. Zone(ZoneRef,Target)
  66. else
  67. ZoneRef = GetZone("Nettleville")
  68. Zone(ZoneRef,Target)
  69. end
  70. end
  71. function EvilExpel(Caster,Target)
  72. ZoneRef = GetZone("Antonica")
  73. Zone(ZoneRef,Target)
  74. end