brokenclockwork.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --[[
  2. Script Name : SpawnScripts/TempleStreet2/brokenclockwork.lua
  3. Script Author : Premierio015
  4. Script Date : 2020.08.16 04:08:56
  5. Script Purpose :
  6. :
  7. --]]
  8. QUEST = 574
  9. function spawn(NPC)
  10. AddSpawnAccess(NPC, NPC)
  11. SetPlayerProximityFunction(NPC, 20, "SpawnAccess", "SpawnAccess")
  12. end
  13. function casted_on(NPC, Spawn, Message)
  14. if HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) == 4 then
  15. if Message == "Examine Clockwork" then
  16. local con = CreateConversation()
  17. AddConversationOption(con, "Start fixing the clockwork.", "fixed")
  18. AddConversationOption(con, "This thing is junk anyway.")
  19. StartDialogConversation(con, 1, NPC, Spawn, "This clockwork appears to be badly damaged. From what you've learned, however, you should have little trouble fixing it.")
  20. end
  21. end
  22. end
  23. function SpawnAccess(NPC, Spawn)
  24. if HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) == 4 then
  25. AddSpawnAccess(NPC, Spawn)
  26. else
  27. RemoveSpawnAccess(NPC, Spawn)
  28. end
  29. end
  30. function fixed(NPC, Spawn)
  31. SetStepComplete(Spawn, QUEST, 4)
  32. end
  33. function respawn(NPC)
  34. end