zonetofpcity.lua 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. --[[
  2. Script Name : SpawnScripts/FreeportCitizenshipTrialChamber/zonetofpcity.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.06.27 12:06:01
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. end
  10. function respawn(NPC)
  11. spawn(NPC)
  12. end
  13. function casted_on(NPC, Player,SpellName)
  14. if SpellName == 'Enter Freeport' then
  15. local con = CreateConversation()
  16. if not HasCompletedQuest(Player,5866) and
  17. not HasCompletedQuest(Player,5867) and
  18. not HasCompletedQuest(Player,5868) and
  19. not HasCompletedQuest(Player,5869) and
  20. not HasCompletedQuest(Player,5870) and
  21. not HasCompletedQuest(Player,5871) then
  22. SendMessage(Player,"You must be a citizen to enter the city.")
  23. SendPopUpMessage(Player,"You must be a citizen to enter the city.",255,255,255)
  24. PlaySound(Spawn,"sounds/ui/ui_warning.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  25. else
  26. AddConversationOption(con, "Yes", "Leave")
  27. AddConversationOption(con, "No","CloseConversation")
  28. StartDialogConversation(con, 1, NPC, Player, "Do you wish to enter the City of Freeport?")
  29. end
  30. end
  31. end
  32. function Leave(NPC,Spawn)
  33. CloseConversation(NPC,Spawn)
  34. Race = GetRace(Spawn)
  35. -- Erudite / Kerra
  36. if Race == 3 or Race == 11 then
  37. ZoneRef = GetZone("NorthFreeport")
  38. Zone(ZoneRef,Spawn,-5.33, -20.05, -307.49, 173.11)
  39. -- Ratonga / Gnome
  40. elseif Race == 5 or Race == 13 then
  41. ZoneRef = GetZone("SouthFreeport")
  42. Zone(ZoneRef,Spawn,-174.13, -36.65, 325.36, 30.57)
  43. -- Human / Half Elf
  44. elseif Race == 9 or Race == 6 then
  45. ZoneRef = GetZone("NorthFreeport")
  46. Zone(ZoneRef,Spawn,-146.95, -50.60, -376.78, 183.34)
  47. -- Orge / Troll
  48. elseif Race == 12 or Race == 14 then
  49. ZoneRef = GetZone("SouthFreeport")
  50. Zone(ZoneRef,Spawn,61.09, -12.09, 247.55, 4.3)
  51. -- Dark Elf
  52. elseif Race == 1 or Race == 19 or Race == 17 then
  53. ZoneRef = GetZone("NorthFreeport")
  54. Zone(ZoneRef,Spawn,-80.29, -34.58, -369.26, 178.10)
  55. -- Barbarian / Iksar / Sarnak
  56. elseif Race == 0 or Race == 10 or Race == 18 then
  57. ZoneRef = GetZone("SouthFreeport")
  58. Zone(ZoneRef,Spawn,-62.26, -25.02, 282.78, 19.45)
  59. else
  60. ZoneRef = GetZone("NorthFreeport")
  61. Zone(ZoneRef,Spawn,-146.95, -50.60, -376.78, 183.34)
  62. end
  63. end