widget_box.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --[[
  2. Script Name : SpawnScripts/SunkenCity/widget_box.lua
  3. Script Purpose : widget_box_*
  4. Script Author : Scatman
  5. Script Date : 2009.08.01
  6. Script Notes :
  7. --]]
  8. local QUEST_FROM_LUKUR = 276
  9. function spawn(NPC)
  10. --SetRequiredQuest(QUEST_FROM_LUKUR, 1)
  11. --SetRequiredQuest(QUEST_FROM_LUKUR, 2)
  12. --SetRequiredQuest(QUEST_FROM_LUKUR, 3)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function hailed(NPC, Spawn)
  18. end
  19. function casted_on(NPC, Spawn)
  20. if HasQuest(Spawn, QUEST_FROM_LUKUR) and (not QuestStepIsComplete(Spawn, QUEST_FROM_LUKUR, 1) or not QuestStepIsComplete(Spawn, QUEST_FROM_LUKUR, 2) or not QuestStepIsComplete(Spawn, QUEST_FROM_LUKUR, 3)) then
  21. local found = false
  22. -- Pick a random step is update and then update it if it's not already complete. Do this until we find a step that has not been
  23. -- completed yet.
  24. while found == false do
  25. local choice = math.random(1, 3)
  26. if not QuestStepIsComplete(Spawn, QUEST_FROM_LUKUR, choice) then
  27. SetStepComplete(Spawn, QUEST_FROM_LUKUR, choice)
  28. found = true
  29. SpawnSet(NPC, "show_command_icon", 0)
  30. AddTimer(NPC, 60000, "TurnOn")
  31. end
  32. end
  33. end
  34. end
  35. function TurnOn(NPC)
  36. SpawnSet(NPC, "show_command_icon", 1)
  37. end