afirstcircleadept.lua 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. --[[
  2. Script Name : SpawnScripts/BrawlersDojo/afirstcircleadept.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.12.18 12:12:52
  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,3)==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("Glad you made it! Was the island as difficult as I remember?")
  25. Dialog.AddVoiceover("voiceover/english/human_eco_good_1/ft/human/human_eco_good_1_hail_gm_5ec5f221.mp3",3870261841, 3828605353)
  26. PlayFlavor(NPC, "", "", "",0,0 , Spawn, 0)
  27. Dialog.AddOption("The Isle of Refuge? I made it here, didn't I? Let's spar.","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. -- if IsInCombat(NPC,Spawn) then
  56. SetTempVariable(NPC,"Reset",1)
  57. ClearHate(NPC, Spawn)
  58. SetInCombat(Spawn, false)
  59. SetInCombat(NPC, false)
  60. ClearEncounter(NPC)
  61. SetTarget(Spawn,nil)
  62. -- end
  63. AddTimer(NPC,1500,"end2",1,Spawn)
  64. AddTimer(NPC,3000,"bow",1,Spawn)
  65. AddTimer(NPC,5000,"bow2",1,Spawn)
  66. end
  67. end
  68. function end2(NPC,Spawn)
  69. ClearHate(NPC, Spawn)
  70. SetInCombat(Spawn, false)
  71. SetInCombat(NPC, false)
  72. ClearEncounter(NPC)
  73. SetTarget(Spawn,nil)
  74. end
  75. function bow(NPC,Spawn)
  76. SetStepComplete(Spawn,5790,3)
  77. PlayFlavor(NPC, "", "","bow",0, 0)
  78. end
  79. function bow2(NPC,Spawn)
  80. Runback(NPC)
  81. SetTempVariable(NPC,"Talking","false")
  82. SpawnSet(NPC,"visual_state",11420)
  83. end
  84. function respawn(NPC)
  85. spawn(NPC)
  86. end
  87. function EmoteLoop(NPC)
  88. if GetTempVariable(NPC,"Talking")== "false"then
  89. SpawnSet(NPC, "action_state", 0)
  90. local choice = MakeRandomInt(1,10)
  91. if choice == 1 then
  92. PlayFlavor(NPC,"","","bostaff_attack")
  93. AddTimer(NPC, 2100, "Idle")
  94. elseif choice == 2 then
  95. PlayFlavor(NPC,"","","bostaff_attack01")
  96. AddTimer(NPC, 1700, "Idle")
  97. elseif choice == 3 then
  98. PlayFlavor(NPC,"","","bostaff_attack02")
  99. AddTimer(NPC, 2400, "Idle")
  100. elseif choice == 4 then
  101. PlayFlavor(NPC,"","","bostaff_attack03")
  102. AddTimer(NPC, 3200, "Idle")
  103. elseif choice == 5 then
  104. PlayFlavor(NPC,"","","bostaff_kick")
  105. AddTimer(NPC, 3700, "Idle")
  106. elseif choice == 6 then
  107. PlayFlavor(NPC,"","","bostaff_dodge_forehand")
  108. AddTimer(NPC, 1500, "Idle")
  109. else
  110. PlayFlavor(NPC,"","","bostaff_taunt_combat_art")
  111. AddTimer(NPC, 3500, "Idle")
  112. end
  113. else
  114. local timer = MakeRandomInt(1500,2500)
  115. AddTimer(NPC, timer, "EmoteLoop")
  116. end
  117. end
  118. function Idle(NPC)
  119. if GetTempVariable(NPC,"Talking")== "false"then
  120. PlayAnimation(NPC, 101)
  121. SpawnSet(NPC, "action_state", 101)
  122. end
  123. local timer = MakeRandomInt(1500,2500)
  124. AddTimer(NPC, timer, "EmoteLoop")
  125. end
  126. function death(NPC,Spawn)
  127. Despawn(NPC)
  128. end
  129. function victory(NPC)
  130. SetTempVariable(NPC,"Reset",nil)
  131. SetTempVariable(NPC,"Talking","false")
  132. end