aggresiveGobinvisiblecube5.lua 3.3 KB

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