zonetoqeyelddar.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. --[[
  2. Script Name : SpawnScripts/Baubbleshire/zonetoqeyelddar.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.11.01 05:11:46
  5. Script Purpose :
  6. :
  7. --]]
  8. function casted_on(NPC, Spawn,SpellName)
  9. local invul = IsInvulnerable(Spawn)
  10. if SpellName == 'Enter The Elddar Grove' then
  11. if not HasCompletedQuest(Spawn,5718) and
  12. not HasCompletedQuest(Spawn,5719) and
  13. not HasCompletedQuest(Spawn,5720) and
  14. not HasCompletedQuest(Spawn,5721) and
  15. not HasCompletedQuest(Spawn,5722) and
  16. not HasCompletedQuest(Spawn,5723)
  17. and GetFactionAmount(Spawn,11)<50000 and
  18. invul == false then
  19. if HasQuest(Spawn,5760) and GetQuestStep(Spawn,5760)==10 then
  20. SetStepComplete(Spawn,5760,10)
  21. end
  22. PlaySound(Spawn,"sounds/ui/ui_warning.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  23. SendPopUpMessage(Spawn,"Only citizens may enter the city of Qeynos.",255,50,50)
  24. SendMessage(Spawn,"Only citizens may enter the city of Qeynos.","red")
  25. else
  26. if invul == true and GetFactionAmount(Spawn,11) < 30000 then
  27. SendMessage(Spawn,"Your GM invulnerability allows you to bypass citizenship.","white")
  28. end
  29. ZoneRef = GetZone("ElddarGrove")
  30. Zone(ZoneRef,Spawn,813.345, -20, -529.326, 60)
  31. end
  32. end
  33. end