aweaksparringpartner.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. --[[
  2. Script Name : SpawnScripts/OutpostOverlord/aweaksparringpartner.lua
  3. Script Author : Rylec, Premierio015, Emagi
  4. Script Date : 2021.07.19 04:07:25
  5. Script Purpose :
  6. :
  7. --]]
  8. local TheArtOfCombat = 363
  9. function spawn(NPC)
  10. end
  11. function healthchanged(NPC, Spawn, Damage)
  12. local npc_hp = GetHP(NPC)
  13. if Damage >= npc_hp then
  14. AddTimer(NPC, 1000, "stop_combat", 1, Spawn)
  15. Say(NPC, "Well Done.")
  16. Say(NPC, "Next!")
  17. if GetQuestStep(Spawn, TheArtOfCombat) == 2 then
  18. SetStepComplete(Spawn, TheArtOfCombat, 2)
  19. end
  20. SetHP(NPC, GetMaxHP(NPC))
  21. return -1 -- DIPLOMATIC immunity!!
  22. end
  23. return 0 -- use default Damage passed in
  24. end
  25. function stop_combat(NPC, Spawn)
  26. if IsInCombat(NPC) then
  27. ClearHate(NPC, Spawn)
  28. SetInCombat(NPC, false)
  29. SetInCombat(Spawn, false)
  30. ClearEncounter(NPC)
  31. end
  32. end
  33. function death(NPC, Spawn)
  34. if GetQuestStep(Spawn, TheArtOfCombat) == 2 then
  35. SetStepComplete(Spawn, TheArtOfCombat, 2)
  36. end
  37. end
  38. function hailed(NPC, Spawn)
  39. FaceTarget(NPC, Spawn)
  40. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_"..voice.."_1002.mp3", "You can attack me whenever you're ready. You can do that by double-clicking me, by right clicking me and selecting 'attack,' by using an offensive ability while you have me targeted, or by turning on auto attack by pressing the ~ key while you have me targeted.", "", 0, 0, Spawn)
  41. end
  42. function respawn(NPC)
  43. spawn(NPC)
  44. end