aggresiveGobinvisiblecube6.lua 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. --[[
  2. Script Name : SpawnScripts/IsleRefuge1/aggresiveGobinvisiblecube6.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.08 08:09:24
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. Cage6(NPC, Spawn)end
  10. function respawn(NPC)
  11. spawn(NPC)
  12. end
  13. function Cage6(NPC, Spawn)
  14. local zone = GetZone(NPC)
  15. local Goblin1 = SpawnByLocationID(zone, 133775216) --Goblin1
  16. AddTimer(NPC,3500,"GobLiveCheck")
  17. end
  18. function GobLiveCheck(NPC, Spawn)
  19. local zone = GetZone(NPC)
  20. local Goblin1 = GetSpawnByLocationID(zone, 133775216) --Goblin1
  21. local Refugee = GetSpawnByLocationID(zone, 133775267) --Refugee
  22. if IsAlive(Goblin1) ==false then
  23. if Refugee~=nil then
  24. waypoints(NPC,Spawn)
  25. SpawnSet(Refugee,"mood_state",0)
  26. SpawnSet(Refugee,"initial_state",16512)
  27. AddTimer(NPC,2000,"ThankYou")
  28. AddTimer(NPC,15000,"DespawnTimer")
  29. end
  30. else
  31. AddTimer(NPC,6000,"GobLiveCheck")
  32. choice = MakeRandomInt(1,10)
  33. if choice == 1 then
  34. PlayFlavor(Refugee, "", "", "cringe",0,0)
  35. elseif choice == 2 then
  36. PlayFlavor(Refugee, "", "", "tantrum_short",0,0)
  37. elseif choice == 3 then
  38. PlayFlavor(Refugee, "", "", "sigh",0,0)
  39. elseif choice == 4 then
  40. PlayFlavor(Refugee, "", "", "squeal",0,0)
  41. elseif choice == 5 then
  42. PlayFlavor(Refugee, "", "", "threten",0,0)
  43. elseif choice == 6 then
  44. PlayFlavor(Refugee, "", "", "wince",0,0)
  45. elseif choice == 7 then
  46. PlayFlavor(Refugee, "", "", "crazy",0,0)
  47. elseif choice == 8 then
  48. PlayFlavor(Refugee, "", "", "pout",0,0)
  49. elseif choice == 9 then
  50. PlayFlavor(Refugee, "", "", "frustrated",0,0)
  51. elseif choice == 10 then
  52. PlayFlavor(Refugee, "", "", "sulk",0,0)
  53. end
  54. end
  55. end
  56. function waypoints(NPC,Spawn)
  57. local zone = GetZone(NPC)
  58. local Refugee = GetSpawnByLocationID(zone, 133775267) --Refugee
  59. local x=GetX(NPC)
  60. local y=GetY(NPC)
  61. local z=GetZ(NPC)
  62. PlaySound(NPC, "sounds/widgets/doors/door_metal_slam001.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  63. MovementLoopAddLocation(Refugee, x, y, z, 4, 1)
  64. MovementLoopAddLocation(Refugee, x, y, z, 4, 6,"ThankYou")
  65. MovementLoopAddLocation(Refugee, x, y, z, 4, 0)
  66. MovementLoopAddLocation(Refugee, 261.68, -4.09, 1.95, 4, 0)
  67. MovementLoopAddLocation(Refugee, 259.68, -3.95, 2.40, 4, 0,"DespawnTimer")
  68. MovementLoopAddLocation(Refugee, 252.05, -3.92, 1.43, 4, 15)
  69. end
  70. function ThankYou(NPC,Spawn)
  71. PlaySound(NPC, "sounds/widgets/doors/door_gate_close001.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
  72. local zone = GetZone(NPC)
  73. local Refugee = GetSpawnByLocationID(zone, 133775267) --Refugee
  74. FaceTarget(Refugee,Spawn)
  75. choice = MakeRandomInt(1,4)
  76. if choice == 1 then
  77. PlayFlavor(Refugee, "", "", "thanks",0,0)
  78. elseif choice == 2 then
  79. PlayFlavor(Refugee, "", "", "bow",0,0)
  80. elseif choice == 3 then
  81. PlayFlavor(Refugee, "", "", "notworthy",0,0)
  82. elseif choice == 4 then
  83. PlayFlavor(Refugee, "", "", "cheer",0,0)
  84. end
  85. end
  86. function DespawnTimer(NPC,Spawn)
  87. local zone = GetZone(NPC)
  88. local Refugee = GetSpawnByLocationID(zone, 133775267) --Refugee
  89. if GetSpawnByLocationID(zone, 133775267) ~=nil then
  90. Despawn(Refugee)
  91. end
  92. Despawn(NPC)
  93. end