当前位置: 首页>>代码示例>>C#>>正文


C# Map.GetActorByDynamicId方法代码示例

本文整理汇总了C#中Map.GetActorByDynamicId方法的典型用法代码示例。如果您正苦于以下问题:C# Map.GetActorByDynamicId方法的具体用法?C# Map.GetActorByDynamicId怎么用?C# Map.GetActorByDynamicId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Map的用法示例。


在下文中一共展示了Map.GetActorByDynamicId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

 public override void Execute(Map.World world)
 {
     // test kill leah
     if (world.HasActor(72))
     {
         world.GetActorByDynamicId(72).Destroy();
     }
     Logger.Debug(" RESCUE CAIN QUEST STARTED ");
     //Logger.Debug(" Quests.Advance(72095) ");
     //world.Game.Quests.Advance(72095);
     Logger.Debug(" Conversation(190404) ");
     StartConversation(world, 190404);
     Logger.Debug(" Conversation(166678) ");
     StartConversation(world, 166678); // "let me open the gate" need if in Old Ruins
 }
开发者ID:sergeev,项目名称:mooege,代码行数:15,代码来源:198541.cs

示例2: Execute

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


        }
开发者ID:sergeev,项目名称:mooege,代码行数:85,代码来源:SurviveTheWaves.cs

示例3: OnUseTeleporterListener

        //just for the use of the portal
        private bool OnUseTeleporterListener(uint actorDynID, Map.World world)
        {
            if (world.HasActor(actorDynID))
            {
                var actor = world.GetActorByDynamicId(actorDynID); // it is not null :p



                Logger.Debug(" supposed portal has type {3} has name {0} and state {1} , has gizmo  been operated ? {2} ", actor.NameSNOId, actor.Attributes[Net.GS.Message.GameAttribute.Gizmo_State], actor.Attributes[Net.GS.Message.GameAttribute.Gizmo_Has_Been_Operated], actor.GetType());
                
                while (true)
                {
                    if (actor.Attributes[Net.GS.Message.GameAttribute.Gizmo_Has_Been_Operated])
                    {
                        // for some obnoxious reason we should shoot the poor rumfeld here                       
                        //var actorToShoot = world.GetActorBySNO(3739);
                        //if ( (actorToShoot != null)) //  && (world.GetActorsBySNO(3739).Count > 1) )
                        //{
                        //    Logger.Debug("trying to shoot actor SNO {0}, world contains {1} such actors ", actorToShoot.ActorSNO, world.GetActorsBySNO(3739).Count);
                        //    world.Leave(actorToShoot); // or directly remove this shit
                        //}
                        //else
                        //{
                        //    Logger.Debug("No actor to shoot yet");
                        //}

                        //actorToShoot = world.GetActorBySNO(4580);
                        //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); // or directly remove this shit
                        //}
                        //else
                        //{
                        //    Logger.Debug("No actor to shoot yet");
                        //}


                        world.Game.Quests.NotifyQuest(87700, Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.InteractWithActor, portalAID);
                        break;
                    }                                        
                }
            }
            return true;
        }
开发者ID:erekos3,项目名称:mooege,代码行数:46,代码来源:198503.cs

示例4: OnUseTeleporterListener

        //just for the use of the portal
        private bool OnUseTeleporterListener(uint actorDynID, Map.World world)
        {
            if (world.HasActor(actorDynID))
            {
                var actor = world.GetActorByDynamicId(actorDynID); // it is not null :p



                Logger.Debug(" supposed portal has type {3} has name {0} and state {1} , has gizmo  been operated ? {2} ", actor.NameSNOId, actor.Attributes[Net.GS.Message.GameAttribute.Gizmo_State], actor.Attributes[Net.GS.Message.GameAttribute.Gizmo_Has_Been_Operated], actor.GetType());

                while (true)
                {
                    if (actor.Attributes[Net.GS.Message.GameAttribute.Gizmo_Has_Been_Operated])
                    {
                        world.Game.Quests.NotifyQuest(87700, Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.InteractWithActor, portalAID);
                        break;
                    }
                }
            }
            return true;
        }
开发者ID:sergeev,项目名称:mooege,代码行数:22,代码来源:198503.cs


注:本文中的Map.GetActorByDynamicId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。