Пример #1
0
        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);
                    });
                });
            }
        }
Пример #2
0
        List<uint> monstersAlive = new List<uint> { }; //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)
                {
                    actor.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);
            });
        }
Пример #3
0
        List<Vector3D> ActorsVector3D = new List<Vector3D> { }; //We fill this with the vectors of the actors

        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

            //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");
                    // 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 !");
            //}


        }