123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- --[[
- Script Name : SpawnScripts/IsleRefuge1/aggresiveGobinvisiblecube5.lua
- Script Author : Dorbin
- Script Date : 2022.09.08 08:09:37
- Script Purpose :
- :
- --]]
- function spawn(NPC)
- Cage4(NPC, Spawn)end
- function respawn(NPC)
- spawn(NPC)
- end
- function Cage4(NPC, Spawn)
- local zone = GetZone(NPC)
- local Goblin1 = GetSpawnByLocationID(zone, 133775215) --Goblin1
- if IsAlive(Goblin1)== false or Goblin1 == nil then
- SpawnByLocationID(zone, 133775215) --Goblin1
- end
- AddTimer(NPC,3500,"GobLiveCheck")
- end
- function GobLiveCheck(NPC, Spawn)
- local zone = GetZone(NPC)
- local Goblin1 = GetSpawnByLocationID(zone, 133775215) --Goblin1
- local Refugee = GetSpawnByLocationID(zone, 133775242) --Refugee
- if IsAlive(Goblin1) ==false then
- if Refugee~=nil then
- waypoints(NPC,Spawn)
- SpawnSet(Refugee,"mood_state",0)
- SpawnSet(Refugee,"initial_state",16512)
- AddTimer(NPC,2000,"ThankYou")
- AddTimer(NPC,15000,"DespawnTimer",1,Refugee)
- end
- else
- AddTimer(NPC,6000,"GobLiveCheck")
- choice = MakeRandomInt(1,10)
- if choice == 1 then
- PlayFlavor(Refugee, "", "", "cringe",0,0)
- elseif choice == 2 then
- PlayFlavor(Refugee, "", "", "tantrum_short",0,0)
- elseif choice == 3 then
- PlayFlavor(Refugee, "", "", "sigh",0,0)
- elseif choice == 4 then
- PlayFlavor(Refugee, "", "", "squeal",0,0)
- elseif choice == 5 then
- PlayFlavor(Refugee, "", "", "threten",0,0)
- elseif choice == 6 then
- PlayFlavor(Refugee, "", "", "wince",0,0)
- elseif choice == 7 then
- PlayFlavor(Refugee, "", "", "crazy",0,0)
- elseif choice == 8 then
- PlayFlavor(Refugee, "", "", "pout",0,0)
- elseif choice == 9 then
- PlayFlavor(Refugee, "", "", "frustrated",0,0)
- elseif choice == 10 then
- PlayFlavor(Refugee, "", "", "sulk",0,0)
- end
-
- end
- end
- function waypoints(NPC,Spawn)
- local zone = GetZone(NPC)
- local Refugee = GetSpawnByLocationID(zone, 133775242) --Refugee
- local x=GetX(NPC)
- local y=GetY(NPC)
- local z=GetZ(NPC)
- PlaySound(NPC, "sounds/widgets/doors/door_metal_slam001.wav", GetX(NPC), GetY(NPC), GetZ(NPC))
- MovementLoopAddLocation(Refugee, x, y, z, 4, 1)
- MovementLoopAddLocation(Refugee, x, y, z, 4, 6,"ThankYou")
- MovementLoopAddLocation(Refugee, x, y, z, 4, 0)
- MovementLoopAddLocation(Refugee, 258.38, -4.60, -5.26, 4, 0)
- MovementLoopAddLocation(Refugee, 258.38, -4.60, -5.26, 4, 0,"DespawnTimer")
- MovementLoopAddLocation(Refugee, 252.05, -3.92, 1.43, 4, 0)
- MovementLoopAddLocation(Refugee, 246.79, -3.91, 0.80, 4, 15)
- MovementLoopAddLocation(Refugee, 246.79, -3.91, 0.80, 4, 0)
- end
- function ThankYou(NPC,Spawn)
- local zone = GetZone(NPC)
- local Refugee = GetSpawnByLocationID(zone, 133775242) --Refugee
- FaceTarget(Refugee,Spawn)
- choice = MakeRandomInt(1,4)
- if choice == 1 then
- PlayFlavor(Refugee, "", "", "thanks",0,0)
- elseif choice == 2 then
- PlayFlavor(Refugee, "", "", "bow",0,0)
- elseif choice == 3 then
- PlayFlavor(Refugee, "", "", "notworthy",0,0)
- elseif choice == 3 then
- PlayFlavor(Refugee, "", "", "cheer",0,0)
- end
- end
- function DespawnTimer(NPC,Spawn)
- local zone = GetZone(NPC)
- local Refugee = GetSpawnByLocationID(zone, 133775242) --Refugee
- Despawn(Refugee)
- Despawn(NPC)
- end
|