Afailedapplicant.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --[[
  2. Script Name : SpawnScripts/FreeportCitizenshipTrialChamber/Afailedapplicant.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.06.25 06:06:01
  5. Script Purpose :
  6. :
  7. --]]
  8. local CalloutCount = true
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  11. end
  12. function InRange(NPC, Spawn)
  13. if GetQuestStep(Spawn, 5718) >=4 or GetQuestStep(Spawn, 5719) >=4 or GetQuestStep(Spawn, 5720) >=4 or GetQuestStep(Spawn, 5721) >=4 or GetQuestStep(Spawn, 5722) >=4 or GetQuestStep(Spawn, 5723) >=4 then
  14. DoorCheck(NPC,Spawn)
  15. end
  16. end
  17. function DoorCheck(NPC,Spawn)
  18. Door = GetSpawn(NPC,1640023)
  19. if Door ~= nil then
  20. Despawn(Door)
  21. end
  22. local zone = GetZone(NPC)
  23. if GetSpawnByLocationID(zone,133785371) ~=nil then
  24. Despawn(GetSpawnByLocationID(zone,133785371))
  25. end
  26. end
  27. function hailed(NPC, Spawn)
  28. if CalloutCount == true then
  29. choice = MakeRandomInt(1,2)
  30. if choice == 1 then
  31. Say(NPC,"Qeynos...filth...")
  32. else
  33. Say(NPC,"Unghhh...")
  34. end
  35. CalloutCount = false
  36. else
  37. choice = MakeRandomInt(1,3)
  38. if choice == 1 then
  39. SendMessage(Spawn, "The applicant does not respond to your actions.")
  40. elseif choice == 2 then
  41. SendMessage(Spawn, "There is no indication the applicant is still breathing.")
  42. elseif choice == 3 then
  43. SendMessage(Spawn, "This applicant obviously failed due to weakness.")
  44. end
  45. end
  46. end
  47. function respawn(NPC)
  48. spawn(NPC)
  49. end