afrightenedbarmaid.lua 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. --[[
  2. Script Name : SpawnScripts/WayfarersRest/afrightenedbarmaid.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.11.14 05:11:39
  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 IsAlive(Darkelf) then
  17. SpawnSet(NPC,"mood_state",0)
  18. SpawnSet(NPC,"name","a relieved barmaid")
  19. choice = MakeRandomInt(1,5)
  20. if choice ==1 then
  21. PlayFlavor(NPC,"","","shame",0,0)
  22. elseif choice ==2 then
  23. PlayFlavor(NPC,"","","sigh",0,0)
  24. elseif choice ==3 then
  25. PlayFlavor(NPC,"","","agree",0,0)
  26. elseif choice ==4 then
  27. PlayFlavor(NPC,"","","thanks",0,0)
  28. elseif choice ==5 then
  29. PlayFlavor(NPC,"","","scold",0,0)
  30. end
  31. end
  32. AddTimer(NPC,7000,"EmoteLoop")
  33. end
  34. function respawn(NPC)
  35. spawn(NPC)
  36. end
  37. function hailed(NPC, Spawn)
  38. local zone = GetZone(NPC)
  39. local Darkelf = GetSpawnByLocationID(zone, 133780688)
  40. if IsAlive(Darkelf) then
  41. Dialog1(NPC, Spawn)
  42. else
  43. Dialog2(NPC, Spawn)
  44. end
  45. end
  46. function Dialog1(NPC,Spawn)
  47. FaceTarget(NPC,Spawn)
  48. choice = MakeRandomInt(1,6)
  49. if choice ==1 then
  50. PlayFlavor(NPC,"","Please! Don't hurt me!","squeal",0,0,Spawn)
  51. elseif choice ==2 then
  52. PlayFlavor(NPC,"","I don't know what happened! Everyone just started acting all crazy!","wince",0,0,Spawn)
  53. elseif choice ==3 then
  54. PlayFlavor(NPC,"","I hear strange laughing coming from the near supplies... and it's not from one of this lot!","listen",0,0,Spawn)
  55. elseif choice ==4 then
  56. PlayFlavor(NPC,"","Not in the face! Please!","cringe",0,0,Spawn)
  57. elseif choice ==5 then
  58. PlayFlavor(NPC,"","Save me from this madness!","beg",0,0,Spawn)
  59. elseif choice ==6 then
  60. PlayFlavor(NPC,"","I heard something from behind the crates a moment ago...","listen",0,0,Spawn)
  61. end
  62. end
  63. function Dialog2(NPC, Spawn)
  64. FaceTarget(NPC, Spawn)
  65. PlayFlavor(NPC,"","Thank the gods you came along! I thought I was destined for the grave.","thanks",0,0)
  66. end