示例#1
0
        private bool OnUseTeleporterListener(uint actorDynID, Core.GS.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.Advance(72095);
                        foreach (var playerN in world.Players)
                        {
                            var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(playerN.Value.Toon.PersistentID);
                            dbQuestProgress.ActiveQuest = 72095;
                            dbQuestProgress.StepOfQuest = 2;
                            DBSessions.AccountSession.SaveOrUpdate(dbQuestProgress);
                            DBSessions.AccountSession.Flush();
                        }
                        break;
                    }
                }
            }
            return(true);
        }
示例#2
0
        private bool OnUseTeleporterListener(uint actorDynID, Core.GS.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] == true)
                    {
                        world.Game.Quests.Advance(72095);
                        foreach (var playerN in world.Players.Values)
                        {
                            playerN.Toon.ActiveQuest = 72095;
                            //dbQuestProgress.StepIDofQuest = 28;
                        }
                        break;
                    }
                }
            }
            return(true);
        }
示例#3
0
        private bool OnListenerToEnter(Core.GS.Players.Player player, Core.GS.Map.World world)
        {
            int sceneID = player.CurrentScene.SceneSNO.Id;

            while (true)
            {
                if (player.World.WorldSNO.Id == 71150)
                {
                    sceneID = player.CurrentScene.SceneSNO.Id;
                    if (sceneID == 90196) //90923 - Adria House
                    {
                        bool ActivePortal = true;

                        foreach (var playerN in world.Players)
                        {
                            var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(playerN.Value.Toon.PersistentID);
                            if (dbQuestProgress.StepOfQuest < 2)
                            {
                                ActivePortal = false;
                            }
                            dbQuestProgress.ActiveQuest = 72095;
                            dbQuestProgress.StepOfQuest = 3;
                            DBSessions.AccountSession.SaveOrUpdate(dbQuestProgress);
                            DBSessions.AccountSession.Flush();
                        }
                        if (ActivePortal == true)
                        {
                            StartConversation(world, 166678);
                        }
                        else
                        {
                            world.Game.Quests.Advance(72095); StartConversation(world, 166678);
                        }
                        try
                        {
                            var Gate = world.GetActorBySNO(108466);
                            world.BroadcastIfRevealed(new Message.Definitions.Animation.PlayAnimationMessage
                            {
                                ActorID = Gate.DynamicID,
                                Field1  = 5,
                                Field2  = 0,
                                tAnim   = new Net.GS.Message.Fields.PlayAnimationMessageSpec[]
                                {
                                    new Net.GS.Message.Fields.PlayAnimationMessageSpec()
                                    {
                                        Duration         = 50,
                                        AnimationSNO     = Gate.AnimationSet.TagMapAnimDefault[Core.GS.Common.Types.TagMap.AnimationSetKeys.Opening],
                                        PermutationIndex = 0,
                                        Speed            = 1
                                    }
                                }
                            }, Gate);

                            world.BroadcastIfRevealed(new Message.Definitions.Animation.SetIdleAnimationMessage
                            {
                                ActorID      = Gate.DynamicID,
                                AnimationSNO = Core.GS.Common.Types.TagMap.AnimationSetKeys.Open.ID
                            }, Gate);
                            if (player.ActiveHireling != null)
                            {
                                var HirelingToLeave = player.ActiveHireling;
                                world.Leave(HirelingToLeave);
                                Vector3D OutDoor   = new Vector3D(1896.382f, 2782.988f, 32.85f);
                                Vector3D NearDoor  = new Vector3D(1935.697f, 2792.971f, 40.23627f);
                                var      Leah_Back = world.GetActorByDynamicId(83);
                                Leah_Back.EnterWorld(OutDoor);
                            }
                        } catch {}
                        break;
                    }
                }
            }

            return(true);
        }