9
3

anunrulypatron.lua 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. --[[
  2. Script Name : SpawnScripts/WayfarersRest/anunrulypatron.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.11.14 05:11:11
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/CombatModule"
  9. function spawn(NPC, Spawn)
  10. combatModule(NPC, Spawn)
  11. AddTimer(NPC,MakeRandomInt(2000,5000),"EmoteLoop")
  12. end
  13. function EmoteLoop(NPC)
  14. local zone = GetZone(NPC)
  15. local Darkelf = GetSpawnByLocationID(zone, 133780688)
  16. if not IsInCombat(NPC) and IsAlive(NPC)then
  17. if IsAlive(Darkelf) then
  18. SpawnSet(NPC, "attackable", 1)
  19. SpawnSet(NPC, "show_level", 1)
  20. SpawnSet(NPC,"mood_state",11852)
  21. SpawnSet(NPC,"name","an unrly patron")
  22. choice = MakeRandomInt(1,5)
  23. if choice ==1 then
  24. PlayFlavor(NPC,"","","kick",0,0)
  25. elseif choice ==2 then
  26. PlayFlavor(NPC,"","","attack",0,0)
  27. elseif choice ==3 then
  28. PlayFlavor(NPC,"","","howl",0,0)
  29. elseif choice ==4 then
  30. PlayFlavor(NPC,"","","shakefist",0,0)
  31. elseif choice ==5 then
  32. PlayFlavor(NPC,"","","cackle",0,0)
  33. end
  34. AddTimer(NPC,4000,"EmoteLoop")
  35. elseif not IsAlive(Darkelf) then
  36. SpawnSet(NPC, "attackable", 0)
  37. SpawnSet(NPC, "show_level", 0)
  38. AddTimer(NPC,7000,"EmoteLoop")
  39. SpawnSet(NPC,"name","a recovered patron")
  40. SpawnSet(NPC,"mood_state",0)
  41. choice = MakeRandomInt(1,5)
  42. if choice ==1 then
  43. PlayFlavor(NPC,"","","confused",0,0)
  44. elseif choice ==2 then
  45. PlayFlavor(NPC,"","","doh",0,0)
  46. elseif choice ==3 then
  47. PlayFlavor(NPC,"","","sigh",0,0)
  48. elseif choice ==4 then
  49. PlayFlavor(NPC,"","","wince",0,0)
  50. elseif choice ==5 then
  51. PlayFlavor(NPC,"","","whome",0,0)
  52. end
  53. end
  54. end
  55. end
  56. function respawn(NPC)
  57. spawn(NPC)
  58. end
  59. function aggro(NPC,Spawn)
  60. local zone = GetZone(NPC)
  61. local Darkelf = GetSpawnByLocationID(zone, 133780688)
  62. if IsAlive(Darkelf) and not HasLanguage(Spawn,1) then
  63. PlayFlavor(NPC, "voiceover/english/barbarian_eco_good_1/ft/barbarian/barbarian_eco_good_1_garbled_gf_f8c9923f.mp3", "Try not to screw up my fist with your face.", "", 653161975, 3035939203, Spawn,1)
  64. else
  65. PlayFlavor(NPC, "voiceover/english/barbarian_base_1/ft/barbarian/barbarian_base_1_1_aggro_gf_d2336620.mp3", "Your overconfidence will be your undoing!", "",2263836674, 942538899, Spawn, 1)
  66. end
  67. end
  68. function victory(NPC,Spawn)
  69. PlayFlavor(NPC, "voiceover/english/barbarian_base_1/ft/barbarian/barbarian_base_1_1_victory_gf_f87005b5.mp3", "Now you will have peace!", "", 2974774059, 665726799, Spawn)
  70. end