}; //We use this for the killeventlistener. public override void Execute(Map.World world) { //var WaitConversationTask = Task<bool>.Factory.StartNew(() => WaitConversation(world)); ////Disable RumFord so he doesn't offer the quest. Somehow, hes supposed to mark it as readed and not offer it while theres no other quest available but he does, ////so you can trigger the event multiple times while the event is already running, therefor, we disable his interaction till the event is done.-Wesko //setActorOperable(world, 3739, false); //WaitConversationTask.ContinueWith(delegate //{ // //Start the conversation between RumFord & Guard. // StartConversation(world, 198199); // var WaitConversationTask2 = Task<bool>.Factory.StartNew(() => WaitConversation(world)); // //After Conversations ends!. // WaitConversationTask2.ContinueWith(delegate // { // var wave1Actors = world.GetActorsInGroup("GizmoGroup1"); // foreach (var actor in wave1Actors) // { // actor.Spawn(); // } // }); //}); ////Run Kill Event Listener //var ListenerFirstWaveTask = Task<bool>.Factory.StartNew(() => OnKillListener(world, "GizmoGroup1")); //ListenerFirstWaveTask.ContinueWith(delegate //Once killed: //{ // //Wave three: Skinnies + RumFord conversation #2 "They Keep Comming!". // StartConversation(world, 80088); var wave2Actors = world.GetActorsInGroup("GizmoGroup2"); foreach (var actor in wave2Actors) { if (actor is Spawner) { (actor as Spawner).Spawn(); } } // var ListenerThirdWaveTask = Task<bool>.Factory.StartNew(() => OnKillListener(world, "GizmoGroup2")); // ListenerThirdWaveTask.Wait(); // Task.WaitAll(); // //Event done we advance the quest and play last conversation #3. // world.Game.Quests.Advance(87700); // Logger.Debug("Event finished"); // StartConversation(world, 151102); // setActorOperable(world, 3739, true); //}); }
}; //We fill this with the vectors of the actors //bool started = false; public override void Execute(Map.World world) { ////Disable RumFord so he doesn't offer the quest. Somehow, hes supposed to mark it as readed and not offer it while theres no other quest available but he does, ////so you can trigger the event multiple times while the event is already running, therefor, we disable his interaction till the event is done.-Wesko setActorOperable(world, 3739, false); // no need for it now the update conversation list is laucnhed once the conversation is marked as read :p StartConversation(world, 198199); var wave1Actors = world.GetActorsInGroup("GizmoGroup1"); monstersId.Clear(); ActorsVector3D.Clear(); foreach (var actor in wave1Actors) { if (actor.ActorSNO.Id == 76857) { monstersId.Add(6632); } else { monstersId.Add(6644); } ActorsVector3D.Add(new Vector3D(actor.Position.X, actor.Position.Y, actor.Position.Z)); } var zombieWave1 = Task <bool> .Factory.StartNew(() => LaunchWave(ActorsVector3D, world, monstersId)); zombieWave1.Wait(); var ListenerZombie1 = Task <bool> .Factory.StartNew(() => OnKillListener(monstersAlive, world)); ListenerZombie1.ContinueWith(delegate //Once killed: { //Wave three: Skinnies + RumFord conversation #2 "They Keep Comming!". StartConversation(world, 80088); var wave2Actors = world.GetActorsInGroup("GizmoGroup2"); monstersId.Clear(); ActorsVector3D.Clear(); foreach (var actor in wave2Actors) { if (actor.ActorSNO.Id == 76857) { monstersId.Add(6632); } else { monstersId.Add(6644); } ActorsVector3D.Add(new Vector3D(actor.Position.X, actor.Position.Y, actor.Position.Z)); } var zombieWave2 = Task <bool> .Factory.StartNew(() => LaunchWave(ActorsVector3D, world, monstersId)); zombieWave2.Wait(); var ListenerZombie2 = Task <bool> .Factory.StartNew(() => OnKillListener(monstersAlive, world)); ListenerZombie2.ContinueWith(delegate //Once killed: { StartConversation(world, 151102); world.Game.Quests.Advance(87700); Logger.Debug("Event finished"); // wyjebanie leah var actorToShoot = world.GetActorByDynamicId(72); if (actorToShoot != null) { Logger.Debug("trying to shoot actor SNO {0}, world contains {1} such actors ", actorToShoot.ActorSNO, world.GetActorsBySNO(3739).Count); world.Leave(actorToShoot); } else { Logger.Debug("No actor to shoot yet"); } setActorOperable(world, 3739, true); }); }); // check rumford state :p var rumfordActor = world.GetActorBySNO(3739); // display real type for rumford actor Logger.Debug(" Rumford has type {0}", rumfordActor.GetType()); //var rumfordBrain = (rumfordActor as Living).Brain; //try //{ // Logger.Debug(" Rumford as a brain {0}, activating now ! ", (rumfordActor as CaptainRumford).Brain); // (rumfordActor as CaptainRumford).Brain.Activate(); //} //catch (System.NullReferenceException e) //{ // Logger.Debug(" brain in rumford has a lots of problems !"); //} }
public override void Execute(Map.World world) { ////Disable RumFord so he doesn't offer the quest. Somehow, hes supposed to mark it as readed and not offer it while theres no other quest available but he does, ////so you can trigger the event multiple times while the event is already running, therefor, we disable his interaction till the event is done.-Wesko if (HadConversation) { HadConversation = false; setActorOperable(world, 3739, false); //Start the conversation between RumFord & Guard. StartConversation(world, 198199); //After Conversations ends!. var wave1Actors = world.GetActorsInGroup("GizmoGroup1"); monstersId.Clear(); ActorsVector3D.Clear(); foreach (var actor in wave1Actors) { if (actor.ActorSNO.Id == 76857) { monstersId.Add(6632); } else { monstersId.Add(6644); } ActorsVector3D.Add(new Vector3D(actor.Position.X, actor.Position.Y, actor.Position.Z)); } var zombieWave1 = Task <bool> .Factory.StartNew(() => LaunchWave(ActorsVector3D, world, monstersId)); zombieWave1.Wait(); var ListenerZombie1 = Task <bool> .Factory.StartNew(() => OnKillListener(monstersAlive, world)); ListenerZombie1.ContinueWith(delegate //Once killed: { //Wave three: Skinnies + RumFord conversation #2 "They Keep Comming!". StartConversation(world, 80088); var wave2Actors = world.GetActorsInGroup("GizmoGroup2"); monstersId.Clear(); ActorsVector3D.Clear(); foreach (var actor in wave2Actors) { if (actor.ActorSNO.Id == 76857) { monstersId.Add(6632); } else { monstersId.Add(6644); } ActorsVector3D.Add(new Vector3D(actor.Position.X, actor.Position.Y, actor.Position.Z)); } var zombieWave2 = Task <bool> .Factory.StartNew(() => LaunchWave(ActorsVector3D, world, monstersId)); zombieWave2.Wait(); var ListenerZombie2 = Task <bool> .Factory.StartNew(() => OnKillListener(monstersAlive, world)); ListenerZombie2.ContinueWith(delegate //Once killed: { StartConversation(world, 151102); world.Game.Quests.Advance(87700); Logger.Debug("Event finished"); setActorOperable(world, 3739, true); }); }); } }
}; //We fill this with the vectors of the actors //bool started = false; public override void Execute(Map.World world) { setActorOperable(world, 3739, false); StartConversation(world, 198199); var wave1Actors = world.GetActorsInGroup("GizmoGroup1"); monstersId.Clear(); ActorsVector3D.Clear(); foreach (var actor in wave1Actors) { if (actor.ActorSNO.Id == 76857) { monstersId.Add(6632); } else { monstersId.Add(6644); } ActorsVector3D.Add(new Vector3D(actor.Position.X, actor.Position.Y, actor.Position.Z)); } var zombieWave1 = Task <bool> .Factory.StartNew(() => LaunchWave(ActorsVector3D, world, monstersId)); zombieWave1.Wait(); var ListenerZombie1 = Task <bool> .Factory.StartNew(() => OnKillListener(monstersAlive, world)); ListenerZombie1.ContinueWith(delegate { StartConversation(world, 80088); var wave2Actors = world.GetActorsInGroup("GizmoGroup2"); monstersId.Clear(); ActorsVector3D.Clear(); foreach (var actor in wave2Actors) { if (actor.ActorSNO.Id == 76857) { monstersId.Add(6632); } else { monstersId.Add(6644); } ActorsVector3D.Add(new Vector3D(actor.Position.X, actor.Position.Y, actor.Position.Z)); } var zombieWave2 = Task <bool> .Factory.StartNew(() => LaunchWave(ActorsVector3D, world, monstersId)); zombieWave2.Wait(); var ListenerZombie2 = Task <bool> .Factory.StartNew(() => OnKillListener(monstersAlive, world)); ListenerZombie2.ContinueWith(delegate { StartConversation(world, 151102); world.Game.Quests.NotifyQuest(87700, QuestStepObjectiveType.KillGroup, -1); foreach (var plr in world.Players.Values) { plr.Toon.ActiveQuest = 87700; plr.Toon.StepOfQuest = 2; plr.Toon.StepIDofQuest = 42; } ; #region Открываем ворота var OldGate = world.GetActorBySNO(90419); var NoDownGate = new Door(world, 90419, world.GetActorBySNO(90419).Tags); NoDownGate.Field2 = 16; NoDownGate.RotationAxis = world.GetActorBySNO(90419).RotationAxis; NoDownGate.RotationW = world.GetActorBySNO(90419).RotationW; NoDownGate.Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true; NoDownGate.Attributes[GameAttribute.Gizmo_State] = 1; NoDownGate.Attributes[GameAttribute.Untargetable] = true; NoDownGate.Attributes.BroadcastChangedIfRevealed(); NoDownGate.EnterWorld(world.GetActorBySNO(90419).Position); OldGate.Destroy(); world.BroadcastIfRevealed(new PlayAnimationMessage { ActorID = NoDownGate.DynamicID, Field1 = 5, Field2 = 0, tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] { new Net.GS.Message.Fields.PlayAnimationMessageSpec() { Duration = 100, AnimationSNO = NoDownGate.AnimationSet.TagMapAnimDefault[AnimationSetKeys.Opening], PermutationIndex = 0, Speed = 0.5f } } }, NoDownGate); world.BroadcastIfRevealed(new SetIdleAnimationMessage { ActorID = NoDownGate.DynamicID, AnimationSNO = Core.GS.Common.Types.TagMap.AnimationSetKeys.Open.ID, }, NoDownGate); NoDownGate.Field2 = 16; NoDownGate.Attributes[Net.GS.Message.GameAttribute.Operatable] = false; #endregion #region Убираем ненужню Лею var actorToShoot = world.GetActorByDynamicId(72); if (actorToShoot != null) { world.Leave(actorToShoot); } else { Logger.Debug("No actor to shoot yet"); } #endregion setActorOperable(world, 3739, true); }); }); var rumfordActor = world.GetActorBySNO(3739); Logger.Debug(" Rumford has type {0}", rumfordActor.GetType()); }