qstreturningtothedisturbance.lua 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. --[[
  2. Script Name : SpawnScripts/ForestRuins/qstreturningtothedisturbance.lua
  3. Script Author : Shatou
  4. Script Date : 2020.01.10 07:01:08
  5. Script Purpose :
  6. Modified date :5/28/2020
  7. Modified By : EmemJR
  8. --]]
  9. local NEWS_FOR_GERMAIN_QUEST_ID = 520
  10. local RETURNING_TO_THE_DISTURBANCE_QUEST_ID = 522
  11. local BUSH_PARTS = 475035
  12. local BUSH_SHOVEL = 1587510
  13. local BUSH_FIRE = 1587511
  14. local BUSH_PICKAXE = 1587512
  15. local TREE_TENT = 475041
  16. local TREE_INVIS_BOOK = 1587513
  17. local GNOLL_TENT_MODEL_ID = 2467
  18. local PARTS_MODEL_ID = 5211
  19. local SHOVEL_MODEL_ID = 2212
  20. local FIRE_MODEL_ID = 2019
  21. local PICKAXE_MODEL_ID = 2821
  22. local INVIS_MODEL_ID = 2306
  23. local BOOK_MODEL_ID = 848
  24. local BUSH_MODEL_ID = 3908
  25. function spawn(NPC)
  26. SetRequiredQuest(NPC, 522,1)
  27. end
  28. function hailed(NPC, Spawn)
  29. FaceTarget(NPC, Spawn)
  30. end
  31. function respawn(NPC)
  32. spawn(NPC)
  33. end
  34. function can_use_command(NPC, Spawn, Message)
  35. if Message == "Collect Leaf Sample" then
  36. if HasQuest(Spawn, NEWS_FOR_GERMAIN_QUEST_ID) then
  37. if GetQuestStep(Spawn, NEWS_FOR_GERMAIN_QUEST_ID) == 3 then
  38. return true
  39. end
  40. end
  41. elseif Message == "Sprinkle Nullification Powder" then
  42. --if HasQuest(Spawn, RETURNING_TO_THE_DISTURBANCE_QUEST_ID) then
  43. return true
  44. --end
  45. end
  46. end
  47. function casted_on(NPC, Spawn, Message)
  48. if Message == "Collect Leaf Sample" then
  49. if HasQuest(Spawn, NEWS_FOR_GERMAIN_QUEST_ID) then
  50. SetStepComplete(Spawn, NEWS_FOR_GERMAIN_QUEST_ID, 3)
  51. end
  52. elseif Message == "Sprinkle Nullification Powder" then
  53. if HasQuest(Spawn, RETURNING_TO_THE_DISTURBANCE_QUEST_ID) then
  54. Say(Spawn, "SS- Sprinkled")
  55. if GetQuestStep(Spawn, RETURNING_TO_THE_DISTURBANCE_QUEST_ID) == 1 then
  56. Say(Spawn, "SS- sprinked with On step 1")
  57. SetStepComplete(Spawn, RETURNING_TO_THE_DISTURBANCE_QUEST_ID, 1)
  58. Set_Spawns_to_Parts(NPC, Spawn)
  59. else
  60. Say(Spawn, "SS- sprinked with On step 2")
  61. Set_Spawns_to_Parts(NPC, Spawn)
  62. end
  63. end
  64. end
  65. end
  66. function Set_Spawns_to_Parts(NPC, Spawn)
  67. Say(Spawn, "SS- Set_Spawns_to_Parts called")
  68. local zone = GetZone(Spawn)
  69. local Parts_Bush = GetTempVariable(Spawn,"spawn1")
  70. local Shovel_Bush = GetTempVariable(Spawn,"spawn2")
  71. local Fire_Bush = GetTempVariable(Spawn,"spawn3")
  72. local Pickaxe_Bush = GetTempVariable(Spawn,"spawn4")
  73. local parts_bush = Parts_Bush
  74. local shovel_bush = Shovel_Bush
  75. local fire_bush = Fire_Bush
  76. local pickaxe_bush = Pickaxe_Bush
  77. local tent_tree = GetSpawnByLocationID(zone, TREE_TENT)
  78. local book_tree = GetSpawnByLocationID(zone, TREE_INVIS_BOOK)
  79. Say(Spawn, "SS- locals done")
  80. SetModelType(parts_bush, PARTS_MODEL_ID)
  81. --SpawnSet(parts_bush, "name","Parts step two")
  82. Say(Spawn, "SS- name set")
  83. SpawnSet(parts_bush, "show_command_icon", 0)
  84. SpawnSet(parts_bush, "display_hand_icon", 0)
  85. SpawnSet(parts_bush, "visual_state", "3752")
  86. Say(Spawn, "SS- parts set")
  87. SetModelType(shovel_bush, SHOVEL_MODEL_ID)
  88. SpawnSet(shovel_bush, "show_command_icon", 0)
  89. SpawnSet(shovel_bush, "display_hand_icon", 0)
  90. SpawnSet(shovel_bush, "visual_state", "3752")
  91. Say(Spawn, "SS- shovel set")
  92. SetModelType(fire_bush, FIRE_MODEL_ID)
  93. SpawnSet(fire_bush, "show_command_icon", 0)
  94. SpawnSet(fire_bush, "display_hand_icon", 0)
  95. SpawnSet(fire_bush, "visual_state", "3752")
  96. Say(Spawn, "SS- firebush set")
  97. SetModelType(pickaxe_bush, PICKAXE_MODEL_ID)
  98. SpawnSet(pickaxe_bush, "show_command_icon", 0)
  99. SpawnSet(pickaxe_bush, "display_hand_icon", 0)
  100. SpawnSet(pickaxe_bush, "visual_state", "3752")
  101. Say(Spawn, "SS- pickaxe set")
  102. SetModelType(tent_tree, GNOLL_TENT_MODEL_ID)
  103. SpawnSet(tent_tree, "show_command_icon", 0)
  104. SpawnSet(tent_tree, "display_hand_icon", 0)
  105. SetModelType(book_tree, BOOK_MODEL_ID)
  106. SpawnSet(book_tree, "visual_state", "3752")
  107. Say(Spawn, "SS- tree set")
  108. local BOOKSPAWN = SpawnMob(zone, 1960183, false, 1166.073, -21.8718, -741.387, 0)
  109. SetTempVariable(Spawn, "bookspawn", BOOKSPAWN)
  110. AddTimer(parts_bush, 60000, "Set_Spawns_to_Bushes", 1, Spawn)
  111. --AddTimer(shovel_bush, 60000, "Set_Spawns_to_Bushes", 1, Spawn)
  112. --AddTimer(fire_bush, 60000, "Set_Spawns_to_Bushes", 1, Spawn)
  113. --AddTimer(pickaxe_bush, 60000, "Set_Spawns_to_Bushes", 1, Spawn)
  114. end
  115. function Set_Spawns_to_Bushes(NPC, Spawn)
  116. Say(Spawn, "SS- Set_Spawns_to_Bushes called")
  117. local Parts_Bush = GetTempVariable(Spawn,"spawn1")
  118. local Shovel_Bush = GetTempVariable(Spawn,"spawn2")
  119. local Fire_Bush = GetTempVariable(Spawn,"spawn3")
  120. local Pickaxe_Bush = GetTempVariable(Spawn,"spawn4")
  121. local parts_bush = Parts_Bush
  122. local shovel_bush = Shovel_Bush
  123. local fire_bush = Fire_Bush
  124. local pickaxe_bush = Pickaxe_Bush
  125. local tent_tree = GetSpawnByLocationID(zone, TREE_TENT)
  126. local book_tree = GetSpawnByLocationID(zone, TREE_INVIS_BOOK)
  127. SetModelType(parts_bush, BUSH_MODEL_ID)
  128. --SpawnSet(parts_bush, "name","bush step 2")
  129. SpawnSet(parts_bush, "show_command_icon", 1)
  130. SpawnSet(parts_bush, "display_hand_icon", 1)
  131. SpawnSet(parts_bush, "visual_state", "0")
  132. SetModelType(shovel_bush, BUSH_MODEL_ID)
  133. SpawnSet(shovel_bush, "show_command_icon", 1)
  134. SpawnSet(shovel_bush, "display_hand_icon", 1)
  135. SpawnSet(shovel_bush, "visual_state", "0")
  136. SetModelType(fire_bush, BUSH_MODEL_ID)
  137. SpawnSet(fire_bush, "show_command_icon", 1)
  138. SpawnSet(fire_bush, "display_hand_icon", 1)
  139. SpawnSet(fire_bush, "visual_state", "0")
  140. SetModelType(pickaxe_bush, BUSH_MODEL_ID)
  141. SpawnSet(pickaxe_bush, "show_command_icon", 1)
  142. SpawnSet(pickaxe_bush, "display_hand_icon", 1)
  143. SpawnSet(pickaxe_bush, "visual_state", "0")
  144. local BOOKSPAWN = GetTempVariable(Spawn,"bookspawn")
  145. Despawn(BOOKSPAWN)
  146. end