9
3

aWindstalkerCitizen2.lua 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. --[[
  2. Script Name : SpawnScripts/Antonica/aWindstalkerCitizen2.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.08.16 08:08:43
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/MonsterCallouts/Windstalkers.lua")
  9. require "SpawnScripts/Generic/NPCModule"
  10. local LichaDancingQueen = 5342
  11. function spawn(NPC, Spawn)
  12. NPCModule(NPC, Spawn)
  13. ChooseRace(NPC)
  14. SetTempVariable(NPC, "QUEST_HAILED", "false")
  15. end
  16. function hailed(NPC, Spawn)
  17. FaceTarget(NPC, Spawn)
  18. if HasQuest(Spawn, LichaDancingQueen) and GetTempVariable(NPC, "QUEST_HAILED") == "false" then
  19. local conversation = CreateConversation()
  20. AddConversationOption(conversation, "Licha asked me to tell the villagers that she is going to dance.", "Option3")
  21. AddConversationOption(conversation, "Never mind.")
  22. StartConversation(conversation, NPC, Spawn, "What can I do for you?")
  23. elseif GetTempVariable(NPC, "QUEST_HAILED") == "true" or HasCompletedQuest(Spawn, LichaDancingQueen) then
  24. local choice = MakeRandomInt(1, 2)
  25. if choice == 1 then
  26. PlayFlavor(NPC, "", "I heard you the first time.", "", 0, 0, Spawn)
  27. elseif choice == 2 then
  28. PlayFlavor(NPC, "", "I know, I know. You already told me.", "", 0, 0, Spawn)
  29. end
  30. else
  31. if GetClass(Spawn) >= 15 and GetClass(Spawn) <= 17 or GetClass(Spawn)==39 then
  32. local choice = MakeRandomInt(1, 2)
  33. if choice == 1 then
  34. SendMessage(Spawn,"The Windstalker Citizen eyes you approvingly.","white")
  35. elseif choice == 2 then
  36. SendMessage(Spawn,"The Windstalker Citizen gives you a friendly nod of acknowledgement.","white")
  37. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  38. end
  39. else
  40. local choice = MakeRandomInt(1, 3)
  41. if choice == 1 then
  42. SendMessage(Spawn,"The Windstalker Citizen eyes closely in a disapproving manner.","white")
  43. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  44. elseif choice == 2 then
  45. SendMessage(Spawn,"The Windstalker Citizen does not want to engage with you.","white")
  46. PlayFlavor(NPC, "", "", "sniff", 0, 0, Spawn)
  47. elseif choice == 3 then
  48. SendMessage(Spawn,"The Windstalker Citizen stares sniffs the air around you.","white")
  49. PlayFlavor(NPC, "", "", "peer", 0, 0, Spawn)
  50. end
  51. end
  52. end
  53. end
  54. function Option3(NPC, Spawn) -- we don't use easy ways to sort.
  55. SetTempVariable(NPC, "QUEST_HAILED", "true")
  56. if QuestStepIsComplete(Spawn, LichaDancingQueen, 1) and QuestStepIsComplete(Spawn, LichaDancingQueen, 2) then
  57. SetStepComplete(Spawn, LichaDancingQueen, 3)
  58. elseif QuestStepIsComplete(Spawn, LichaDancingQueen, 2) and QuestStepIsComplete(Spawn, LichaDancingQueen, 3) then
  59. SetStepComplete(Spawn, LichaDancingQueen, 1)
  60. elseif QuestStepIsComplete(Spawn, LichaDancingQueen, 3) and QuestStepIsComplete(Spawn, LichaDancingQueen, 1) then
  61. SetStepComplete(Spawn, LichaDancingQueen, 2)
  62. elseif not QuestStepIsComplete(Spawn, LichaDancingQueen, 1) and not QuestStepIsComplete(Spawn, LichaDancingQueen, 2) and not QuestStepIsComplete(Spawn, LichaDancingQueen, 3) then
  63. SetStepComplete(Spawn, LichaDancingQueen, 1)
  64. elseif QuestStepIsComplete(Spawn, LichaDancingQueen, 1) and not QuestStepIsComplete(Spawn, LichaDancingQueen, 2) and not QuestStepIsComplete(Spawn, LichaDancingQueen, 3) then
  65. local random_step = MakeRandomInt(1, 2)
  66. if random_step == 1 then
  67. SetStepComplete(Spawn, LichaDancingQueen, 2)
  68. elseif random_step == 2 then
  69. SetStepComplete(Spawn, LichaDancingQueen, 3)
  70. end
  71. elseif QuestStepIsComplete(Spawn, LichaDancingQueen, 2) and not QuestStepIsComplete(Spawn, LichaDancingQueen, 1) and not QuestStepIsComplete(Spawn, LichaDancingQueen, 3) then
  72. local random_step = MakeRandomInt(1, 2)
  73. if random_step == 1 then
  74. SetStepComplete(Spawn, LichaDancingQueen, 1)
  75. elseif random_step == 2 then
  76. SetStepComplete(Spawn, LichaDancingQueen, 3)
  77. end
  78. elseif QuestStepIsComplete(Spawn, LichaDancingQueen, 3) and not QuestStepIsComplete(Spawn, LichaDancingQueen, 1) and not QuestStepIsComplete(Spawn, LichaDancingQueen, 2) then
  79. local random_step = MakeRandomInt(1, 2)
  80. if random_step == 1 then
  81. SetStepComplete(Spawn, LichaDancingQueen, 2)
  82. elseif random_step == 2 then
  83. SetStepComplete(Spawn, LichaDancingQueen, 1)
  84. end
  85. end
  86. FaceTarget(NPC, Spawn)
  87. local conversation = CreateConversation()
  88. AddConversationOption(conversation, "Good to know.")
  89. StartConversation(conversation, NPC, Spawn, "Great, I haven't had a good laugh all day.")
  90. AddTimer(NPC, 600000, "reset")
  91. end
  92. function reset(NPC, Spawn)
  93. if GetTempVariable(NPC, "QUEST_HAILED") == "true" then
  94. SetTempVariable(NPC, "QUEST_HAILED", "false")
  95. end
  96. end
  97. function respawn(NPC)
  98. spawn(NPC)
  99. end
  100. function ChooseRace(NPC)
  101. SetRace = MakeRandomInt(1,2)
  102. if SetRace == 1 then
  103. human(NPC)
  104. elseif SetRace == 2 then
  105. halfelf(NPC)
  106. end
  107. end