9
3

asecondcircleinitiate.lua 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. --[[
  2. Script Name : SpawnScripts/BrawlersDojo/asecondcircleinitiate.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.12.18 04:12:46
  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,2)==0 then
  18. SetTempVariable(NPC,"Talking","true")
  19. FaceTarget(NPC, Spawn)
  20. Dialog.New(NPC, Spawn)
  21. Dialog.AddDialog("Ale may be the life's blood, but fighting is the soul my existence!")
  22. Dialog.AddVoiceover("voiceover/english/dwarf_eco_good_1/ft/dwarf/dwarf_eco_good_1_hail_gm_bd8ccf81.mp3",4220338619, 1417901850)
  23. PlayFlavor(NPC, "", "", "nod",0,0 , Spawn, 0)
  24. Dialog.AddOption("I wish to spar with you.","Dialog1")
  25. Dialog.Start()
  26. end
  27. end
  28. function Dialog1(NPC, Spawn)
  29. FaceTarget(NPC, Spawn)
  30. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn, 0)
  31. AddTimer(NPC,3000,"attack",1,Spawn)
  32. end
  33. function attack(NPC,Spawn)
  34. SpawnSet(NPC,"attackable",1)
  35. SpawnSet(NPC,"show_level",1)
  36. Attack(NPC,Spawn)
  37. PlayFlavor(NPC, "voiceover/english/dwarf_base_1/ft/dwarf/dwarf_base_1_1_aggro_gm_ab9057d3.mp3", "Look'n for me?", "",438949611, 3910736957, Spawn, 0)
  38. end
  39. function aggro(NPC,Spawn)
  40. if GetTempVariable(NPC,"Reset")== nil then
  41. else
  42. ClearHate(NPC, Spawn)
  43. SetInCombat(Spawn, false)
  44. SetInCombat(NPC, false)
  45. ClearEncounter(NPC)
  46. SetTarget(Spawn,nil)
  47. end
  48. end
  49. function healthchanged(NPC, Spawn)
  50. if GetHP(NPC) < GetMaxHP(NPC) * 0.26 then
  51. SpawnSet(NPC,"attackable",0)
  52. SpawnSet(NPC,"show_level",0)
  53. -- if IsInCombat(NPC,Spawn) then
  54. SetTempVariable(NPC,"Reset",1)
  55. ClearHate(NPC, Spawn)
  56. SetInCombat(Spawn, false)
  57. SetInCombat(NPC, false)
  58. ClearEncounter(NPC)
  59. SetTarget(Spawn,nil)
  60. -- end
  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. PlayFlavor(NPC, "", "", "bow", 0, 0, Spawn, 0)
  75. SetStepComplete(Spawn,5790,2)
  76. end
  77. function bow2(NPC,Spawn)
  78. Runback(NPC)
  79. SetTempVariable(NPC,"Talking","false")
  80. local zone = GetZone(NPC)
  81. local dummy = GetSpawnByLocationID(zone,133781317)
  82. FaceTarget(NPC,dummy)
  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 zone = GetZone(NPC)
  91. local dummy = GetSpawnByLocationID(zone,133781317)
  92. local choice = MakeRandomInt(1,3)
  93. if choice == 1 then
  94. PlayFlavor(NPC,"","","dual_wield_attack")
  95. elseif choice == 2 then
  96. PlayFlavor(NPC,"","","dual_wield_attack01")
  97. elseif choice == 3 then
  98. PlayFlavor(NPC,"","","dual_wield_attack02")
  99. end
  100. PlayFlavor(dummy,"","","result_dust_fall")
  101. SpawnSet(dummy, "visual_state", 2083)
  102. end
  103. AddTimer(NPC, 2550, "Idle")
  104. end
  105. function Idle(NPC)
  106. local zone = GetZone(NPC)
  107. local dummy = GetSpawnByLocationID(zone,133781317)
  108. if GetTempVariable(NPC,"Talking")== "false"then
  109. SpawnSet(NPC, "action_state", 267)
  110. PlayAnimation(NPC, 267)
  111. end
  112. AddTimer(NPC,1000,"resetdummy",1)
  113. local timer = MakeRandomInt(1500,3500)
  114. AddTimer(NPC, timer, "EmoteLoop")
  115. end
  116. function resetdummy(NPC)
  117. local zone = GetZone(NPC)
  118. local dummy = GetSpawnByLocationID(zone,133781317)
  119. SpawnSet(dummy, "visual_state", 0)
  120. end
  121. function death(NPC,Spawn)
  122. Despawn(NPC)
  123. end
  124. function victory(NPC)
  125. SetTempVariable(NPC,"Reset",nil)
  126. SetTempVariable(NPC,"Talking","false")
  127. end