9
3

awhiteheadbandinitiate.lua 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. --[[
  2. Script Name : SpawnScripts/BrawlersDojo/awhiteheadbandinitiate.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.12.17 08:12:25
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. require "SpawnScripts/Generic/CombatModule"
  10. function spawn(NPC, Spawn)
  11. combatModule(NPC, Spawn)
  12. AddTimer(NPC, math.random(2000,5000), "EmoteLoop")
  13. SetTempVariable(NPC,"Talking","false")
  14. SetTempVariable(NPC,"Reset",nil)
  15. end
  16. function hailed(NPC, Spawn)
  17. if HasQuest(Spawn,5790) and GetQuestStepProgress(Spawn,5790,4)==0 then
  18. SpawnSet(NPC,"mood_state",0)
  19. SpawnSet(NPC,"visual_state",0)
  20. -- PlayAnimation(NPC,10871)
  21. SetTempVariable(NPC,"Talking","true")
  22. FaceTarget(NPC, Spawn)
  23. Dialog.New(NPC, Spawn)
  24. Dialog.AddDialog("Tread softly and speak your purpose.")
  25. Dialog.AddVoiceover("voiceover/english/optional1/initiate_tara/qey_elddar/100_monk_initiate_tara_token1_9ac42d88.mp3",3516598133, 1750026138)
  26. PlayFlavor(NPC, "", "", "",0,0 , Spawn, 0)
  27. Dialog.AddOption("I'm looking to prove myself. Will you spar with me?","Dialog1")
  28. Dialog.Start()
  29. end
  30. end
  31. function Dialog1(NPC, Spawn)
  32. FaceTarget(NPC, Spawn)
  33. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn, 0)
  34. AddTimer(NPC,3000,"attack",1,Spawn)
  35. end
  36. function attack(NPC,Spawn)
  37. SpawnSet(NPC,"attackable",1)
  38. SpawnSet(NPC,"show_level",1)
  39. Attack(NPC,Spawn)
  40. end
  41. function aggro(NPC,Spawn)
  42. if GetTempVariable(NPC,"Reset")== nil then
  43. else
  44. ClearHate(NPC, Spawn)
  45. SetInCombat(Spawn, false)
  46. SetInCombat(NPC, false)
  47. ClearEncounter(NPC)
  48. SetTarget(Spawn,nil)
  49. end
  50. end
  51. function healthchanged(NPC, Spawn)
  52. if GetHP(NPC) < GetMaxHP(NPC) * 0.26 then
  53. SpawnSet(NPC,"attackable",0)
  54. SpawnSet(NPC,"show_level",0)
  55. SetTempVariable(NPC,"Reset",1)
  56. ClearHate(NPC, Spawn)
  57. SetInCombat(Spawn, false)
  58. SetInCombat(NPC, false)
  59. ClearEncounter(NPC)
  60. SetTarget(Spawn,nil)
  61. AddTimer(NPC,1500,"end2",1,Spawn)
  62. AddTimer(NPC,3000,"bow",1,Spawn)
  63. AddTimer(NPC,5000,"bow2",1,Spawn)
  64. end
  65. end
  66. function end2(NPC,Spawn)
  67. ClearHate(NPC, Spawn)
  68. SetInCombat(Spawn, false)
  69. SetInCombat(NPC, false)
  70. ClearEncounter(NPC)
  71. SetTarget(Spawn,nil)
  72. end
  73. function bow(NPC,Spawn)
  74. SetStepComplete(Spawn,5790,4)
  75. PlayFlavor(NPC, "voiceover/english/human_eco_good_1/ft/service/guard/human_guard_service_good_1_hail_gf_c865a827.mp3", "Duty above all else, citizen, except honor!","bow",373851625, 467562033)
  76. end
  77. function bow2(NPC,Spawn)
  78. Runback(NPC)
  79. SetTempVariable(NPC,"Talking","false")
  80. SpawnSet(NPC,"visual_state",11420)
  81. local zone = GetZone(NPC)
  82. local dummy = GetSpawnByLocationID(zone,133781308)
  83. FaceTarget(NPC,dummy)
  84. end
  85. function respawn(NPC)
  86. spawn(NPC)
  87. end
  88. function EmoteLoop(NPC)
  89. if GetTempVariable(NPC,"Talking")== "false"then
  90. SpawnSet(NPC, "action_state", 0)
  91. local choice = MakeRandomInt(1,8)
  92. local zone = GetZone(NPC)
  93. local dummy = GetSpawnByLocationID(zone,133781308)
  94. if choice == 1 then
  95. PlayFlavor(NPC,"","","pugilist_attack")
  96. PlayFlavor(dummy,"","","result_dust_fall")
  97. AddTimer(NPC, 2550, "Idle")
  98. elseif choice == 2 then
  99. PlayFlavor(NPC,"","","pugilist_attack02")
  100. PlayFlavor(dummy,"","","result_dust_fall")
  101. AddTimer(NPC, 3100, "Idle")
  102. elseif choice == 3 then
  103. PlayFlavor(NPC,"","","monk_attack02")
  104. PlayFlavor(dummy,"","","result_dust_fall")
  105. AddTimer(NPC, 3050, "Idle")
  106. elseif choice == 4 then
  107. PlayFlavor(NPC,"","","monk_wild_swing")
  108. PlayFlavor(dummy,"","","result_dust_fall")
  109. AddTimer(NPC, 3100, "Idle")
  110. elseif choice == 5 then
  111. PlayFlavor(NPC,"","","monk_attack01")
  112. PlayFlavor(dummy,"","","result_dust_fall")
  113. AddTimer(NPC, 2450, "Idle")
  114. elseif choice == 6 then
  115. PlayFlavor(NPC,"","","monk_attack")
  116. PlayFlavor(dummy,"","","result_dust_fall")
  117. AddTimer(NPC, 2550, "Idle")
  118. elseif choice == 7 then
  119. PlayFlavor(NPC,"","","monk_attack03")
  120. PlayFlavor(dummy,"","","result_dust_fall")
  121. AddTimer(NPC, 4400, "Idle")
  122. else
  123. PlayFlavor(NPC,"","","pugilist_wild_swing")
  124. PlayFlavor(dummy,"","","result_dust_fall")
  125. AddTimer(NPC, 3300, "Idle")
  126. end
  127. else
  128. local timer = MakeRandomInt(1500,2500)
  129. AddTimer(NPC, timer, "EmoteLoop")
  130. end
  131. end
  132. function Idle(NPC)
  133. local zone = GetZone(NPC)
  134. local dummy = GetSpawnByLocationID(zone,133781308)
  135. if GetTempVariable(NPC,"Talking")== "false"then
  136. PlayAnimation(NPC, 372)
  137. SpawnSet(dummy, "visual_state", 2083)
  138. end
  139. AddTimer(NPC,1000,"resetdummy",1)
  140. local timer = MakeRandomInt(500,2500)
  141. AddTimer(NPC, timer, "EmoteLoop")
  142. end
  143. function resetdummy(NPC)
  144. local zone = GetZone(NPC)
  145. local dummy = GetSpawnByLocationID(zone,133781308)
  146. SpawnSet(dummy, "visual_state", 0)
  147. end
  148. function death(NPC,Spawn)
  149. Despawn(NPC)
  150. end
  151. function victory(NPC)
  152. SetTempVariable(NPC,"Reset",nil)
  153. SetTempVariable(NPC,"Talking","false")
  154. end