anangrypatron.lua 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. --[[
  2. Script Name : SpawnScripts/WayfarersRest/anangrypatron.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.11.14 05:11:47
  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 angry patron")
  22. choice = MakeRandomInt(1,5)
  23. if choice ==1 then
  24. PlayFlavor(NPC,"","","scream",0,0)
  25. elseif choice ==2 then
  26. PlayFlavor(NPC,"","","kick",0,0)
  27. elseif choice ==3 then
  28. PlayFlavor(NPC,"","","grumble",0,0)
  29. elseif choice ==4 then
  30. PlayFlavor(NPC,"","","tantrum_short",0,0)
  31. elseif choice ==5 then
  32. PlayFlavor(NPC,"","","frustrated",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,"mood_state",0)
  40. SpawnSet(NPC,"name","a recovered patron")
  41. choice = MakeRandomInt(1,6)
  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. elseif choice ==6 then
  53. PlayFlavor(NPC,"","","doubletake",0,0)
  54. end
  55. end
  56. end
  57. end
  58. function respawn(NPC)
  59. spawn(NPC)
  60. end
  61. function aggro(NPC,Spawn)
  62. local zone = GetZone(NPC)
  63. local Darkelf = GetSpawnByLocationID(zone, 133780688)
  64. if IsAlive(Darkelf) then
  65. choice = MakeRandomInt(1,2)
  66. if choice == 1 then
  67. PlayFlavor(NPC, "voiceover/english/human_base_1/ft/human/human_base_1_1_aggro_gm_a203c9ec.mp3", "Prepare to face your doom, meddler.", "", 1496819882, 365167432, Spawn, 0)
  68. elseif choice ==2 then
  69. PlayFlavor(NPC, "voiceover/english/optional5/human_base_2/ft/human/human_base_2_2_aggro_gm_e61d307f.mp3", "Look alive! We have visitors!", "", 1273763229, 637796964, Spawn, 0)
  70. end
  71. end
  72. end
  73. function victory(NPC,Spawn)
  74. PlayFlavor(NPC, "voiceover/english/human_base_1/ft/human/human_base_1_1_halfhealth_gm_1babf022.mp3", "Is that all you have?", "", 170267964, 1158805306, Spawn, 0)
  75. end