apiratefirstmate.lua 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. --[[
  2. Script Name : SpawnScripts/FermentedGrape/apiratefirstmate.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.12.04 01:12:37
  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,"","","chuckle",0,0)
  25. elseif choice ==5 then
  26. PlayFlavor(NPC,"","","point",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. PlayFlavor(NPC, "voiceover/english/halfelf_eco_farsea_1/ft/service/guard/halfelf_guard_service_farsea_1_hail_gf_2b42c14f.mp3", "After twelve weeks at sea, bashing the head of a nosy landlubber sounds quite appealing!", "threaten", 1936614211, 2469553737, Spawn, 0)
  36. end
  37. function death(NPC,Spawn)
  38. local zone = GetZone(NPC)
  39. local Pirate1 = GetSpawnByLocationID(zone, 133781037) --FIRSTMATE
  40. local Pirate2 = GetSpawnByLocationID(zone, 133781036) --CUTTER
  41. local Pirate3 = GetSpawnByLocationID(zone, 133781038)
  42. local Pirate4 = GetSpawnByLocationID(zone, 133781039)
  43. local Pirate5 = GetSpawnByLocationID(zone, 133781035)
  44. local Pirate6 = GetSpawnByLocationID(zone, 133781034)
  45. local Captain = GetSpawnByLocationID(zone, 133781033)
  46. local Bartender = GetSpawnByLocationID(zone, 133781031)
  47. local Bard = GetSpawnByLocationID(zone, 133781032)
  48. local Bobick = GetSpawnByLocationID(zone, 133781027)
  49. 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
  50. if HasQuest(Spawn,5784) then
  51. SetStepComplete(Spawn,5784,1)
  52. end
  53. SpawnSet(Bartender,"name","a relieved bartender")
  54. SpawnSet(Bartender,"mood_state",0)
  55. SpawnSet(Bartender,"action_state",11214)
  56. SpawnSet(Bard,"name","a thankful bard")
  57. SpawnSet(Bard,"mood_state",11854)
  58. SpawnSet(Bard,"action_state",0)
  59. SpawnSet(Bobick,"action_state",11422)
  60. SpawnSet(Bobick,"name","a satisfied patron")
  61. end
  62. end