zonetofprtnorth0.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. --[[
  2. Script Name : SpawnScripts/Longshadow/zonetofprtnorth0.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.06.29 12:06:51
  5. Script Purpose :
  6. :
  7. --]]
  8. function casted_on(NPC, Spawn,SpellName)
  9. local invul = IsInvulnerable(Spawn)
  10. if SpellName == 'Enter North Freeport' then
  11. if not HasCompletedQuest(Spawn,5866) and
  12. not HasCompletedQuest(Spawn,5867) and
  13. not HasCompletedQuest(Spawn,5868) and
  14. not HasCompletedQuest(Spawn,5869) and
  15. not HasCompletedQuest(Spawn,5870) and
  16. not HasCompletedQuest(Spawn,5871)
  17. and GetFactionAmount(Spawn,12)<50000 and
  18. invul == false then
  19. if HasQuest(Spawn,5862) and GetQuestStep(Spawn,5862)==10 then
  20. SetStepComplete(Spawn,5862,10)
  21. end
  22. PlaySound(Spawn,"sounds/ui/ui_warning.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  23. SendPopUpMessage(Spawn,"Only Freeport citizens may enter the city.",255,50,50)
  24. SendMessage(Spawn,"Only Freeport citizens may enter the city.","red")
  25. else
  26. if invul == true and GetFactionAmount(Spawn,12) < 30000 then
  27. SendMessage(Spawn,"Your GM invulnerability allows you to bypass citizenship.","white")
  28. end
  29. ZoneRef = GetZone("NorthFreeport")
  30. Zone(ZoneRef,Spawn,-79.65, -34.58, -369.01, 181.78)
  31. end
  32. end
  33. end