9
3

InquistrainingdummyNPC.lua 944 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --[[
  2. Script Name : SpawnScripts/qeynos_combined02/InquistrainingdummyNPC.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.10.03 02:10:24
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SetLuaBrain(NPC)
  10. SetBrainTick(NPC, 500)
  11. Think(NPC, Spawn)
  12. end
  13. function Think(NPC, Spawn) -- MAKES TRAINING DUMMY IS JUST A DUMMY (WON'T ATTACK BACK ANYMORE LOL)
  14. local mostHated = GetMostHated(NPC)
  15. if mostHated ~= nil then
  16. ClearHate(NPC)
  17. SetInCombat(NPC, false)
  18. ClearEncounter(NPC)
  19. end
  20. end
  21. function healthchanged(NPC, Spawn, Damage) -- MAKES TRAINING DUMMY UNDYING
  22. local npc_hp = GetHP(NPC)
  23. if Damage >= npc_hp then
  24. SetHP(NPC, GetMaxHP(NPC))
  25. return -1 -- DIPLOMATIC immunity!!
  26. end
  27. return 0 -- use default Damage passed in
  28. end
  29. function respawn(NPC)
  30. spawn(NPC)
  31. end