9
3

aweaksparringpartner1584827.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --[[
  2. Script Name : SpawnScripts/QueensColony/aweaksparringpartner1584827.lua
  3. Script Author : Rylec, premierio015, Emagi
  4. Script Date : 2020.11.14 12:11:50
  5. Script Purpose :
  6. Script Notes :
  7. --]]
  8. local TheArtOfCombat = 132
  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