9
3

apiratesailor.lua 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. --[[
  2. Script Name : SpawnScripts/FermentedGrape/apiratesailor.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.12.04 05:12:45
  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. if not IsInCombat(NPC) then
  15. SpawnSet(NPC,"mood_state",11852)
  16. choice = MakeRandomInt(1,5)
  17. if choice ==1 then
  18. PlayFlavor(NPC,"","","threaten",0,0)
  19. elseif choice ==2 then
  20. PlayFlavor(NPC,"","","taunt",0,0)
  21. elseif choice ==3 then
  22. PlayFlavor(NPC,"","","grumble",0,0)
  23. elseif choice ==4 then
  24. PlayFlavor(NPC,"","","swear",0,0)
  25. elseif choice ==5 then
  26. PlayFlavor(NPC,"","","frustrated",0,0)
  27. end
  28. end
  29. AddTimer(NPC,6000,"EmoteLoop")
  30. end
  31. function respawn(NPC)
  32. spawn(NPC)
  33. end
  34. function aggro(NPC,Spawn)
  35. local zone = GetZone(NPC)
  36. local Pirate1 = GetSpawnByLocationID(zone, 133781037) --FIRSTMATE
  37. local Pirate2 = GetSpawnByLocationID(zone, 133781036) --CUTTER
  38. local Pirate3 = GetSpawnByLocationID(zone, 133781038)
  39. local Pirate4 = GetSpawnByLocationID(zone, 133781039)
  40. local Pirate5 = GetSpawnByLocationID(zone, 133781035)
  41. local Pirate6 = GetSpawnByLocationID(zone, 133781034)
  42. local Captain = GetSpawnByLocationID(zone, 133781033)
  43. Attack(Pirate1,Spawn)
  44. Attack(Pirate2,Spawn)
  45. Attack(Pirate3,Spawn)
  46. Attack(Pirate4,Spawn)
  47. Attack(Pirate5,Spawn)
  48. Attack(Pirate6,Spawn)
  49. Attack(Captain,Spawn)
  50. end
  51. function death(NPC,Spawn)
  52. local zone = GetZone(NPC)
  53. local Pirate1 = GetSpawnByLocationID(zone, 133781037) --FIRSTMATE
  54. local Pirate2 = GetSpawnByLocationID(zone, 133781036) --CUTTER
  55. local Pirate3 = GetSpawnByLocationID(zone, 133781038)
  56. local Pirate4 = GetSpawnByLocationID(zone, 133781039)
  57. local Pirate5 = GetSpawnByLocationID(zone, 133781035)
  58. local Pirate6 = GetSpawnByLocationID(zone, 133781034)
  59. local Captain = GetSpawnByLocationID(zone, 133781033)
  60. local Bartender = GetSpawnByLocationID(zone, 133781031)
  61. local Bard = GetSpawnByLocationID(zone, 133781032)
  62. local Bobick = GetSpawnByLocationID(zone, 133781027)
  63. if not IsAlive(Pirate1) and not IsAlive(Pirate2) and not IsAlive(Pirate3) and not IsAlive(Pirate4) and not IsAlive(Pirate5) and not IsAlive(Pirate6) and not IsAlive(Captain) then
  64. if HasQuest(Spawn,5784) then
  65. SetStepComplete(Spawn,5784,1)
  66. end
  67. SpawnSet(Bartender,"name","a relieved bartender")
  68. SpawnSet(Bartender,"mood_state",0)
  69. SpawnSet(Bartender,"action_state",11214)
  70. SpawnSet(Bard,"name","a thankful bard")
  71. SpawnSet(Bard,"mood_state",11854)
  72. SpawnSet(Bard,"action_state",0)
  73. SpawnSet(Bobick,"action_state",11422)
  74. SpawnSet(Bobick,"name","a satisfied patron")
  75. end
  76. end