Esempio n. 1
0
        private bool OnListenerToAndriaEnter(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 == 90293)
                    {
                        foreach (var playerN in world.Players)
                        {
                            var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(playerN.Value.Toon.PersistentID);
                            dbQuestProgress.ActiveQuest = 72095;
                            dbQuestProgress.StepOfQuest = 5;
                            DBSessions.AccountSession.SaveOrUpdate(dbQuestProgress);
                            DBSessions.AccountSession.Flush();
                        }
                        world.Game.Quests.Advance(72095); world.Game.Quests.Advance(72095);
                        break;
                    }
                }
            }

            return(true);
        }
Esempio n. 2
0
        private bool OnKillListenerCain(List <uint> monstersAlive, Core.GS.Map.World world)
        {
            Int32 monstersKilled = 0;
            var   monsterCount   = monstersAlive.Count; //Since we are removing values while iterating, this is set at the first real read of the mob counting.

            while (monstersKilled != monsterCount)
            {
                //Iterate through monstersAlive List, if found dead we start to remove em till all of em are dead and removed.
                for (int i = monstersAlive.Count - 1; i >= 0; i--)
                {
                    if (world.HasMonster(monstersAlive[i]))
                    {
                        //Alive: Nothing.
                    }
                    else
                    {
                        //If dead we remove it from the list and keep iterating.
                        Logger.Debug(monstersAlive[i] + " has been killed");
                        monstersAlive.RemoveAt(i);
                        monstersKilled++;
                    }
                }
            }
            return(true);
        }
Esempio n. 3
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);
        }
Esempio n. 4
0
        //OnFoundCave
        private bool OnFoundCaveListener(Core.GS.Players.Player player, Core.GS.Map.World world)
        {
            var scene = player.CurrentScene;

            while (true)
            {
                try
                {
                    scene = player.CurrentScene;
                    if (scene.Subscenes.Count > 0)
                    {
                        if (scene.Subscenes[0].SceneSNO.Id == 118195)
                        {
                            world.Game.Quests.Advance(117779);
                            foreach (var playerN in world.Players)
                            {
                                var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(playerN.Value.Toon.PersistentID);
                                dbQuestProgress.ActiveQuest = 117779;
                                dbQuestProgress.StepOfQuest = 3;
                                DBSessions.AccountSession.SaveOrUpdate(dbQuestProgress);
                                DBSessions.AccountSession.Flush();
                            }
                            break;
                        }
                    }
                }
                catch { }
            }
            return(true);
        }
Esempio n. 5
0
        private bool OnListenerToAndriaEnter(Core.GS.Players.Player player, Core.GS.Map.World world)
        {
            while (true)
            {
                try
                {
                    if (player.World.WorldSNO.Id == 71150)
                    {
                        int sceneID = player.CurrentScene.SceneSNO.Id;
                        if (sceneID == 90293)
                        {
                            foreach (var playerN in world.Players.Values)
                            {
                                playerN.Toon.ActiveQuest = 72095;
                                playerN.Toon.StepOfQuest = 5;
                            }
                            world.Game.Quests.NotifyQuest(72095, NullD.Common.MPQ.FileFormats.QuestStepObjectiveType.EnterTrigger, -1);
                            break;
                        }
                    }
                }
                catch { }
            }

            return(true);
        }
Esempio n. 6
0
        //OnFieldsListener
        private bool OnFieldsListener(Core.GS.Players.Player player, Core.GS.Map.World world)
        {
            int sceneID = player.CurrentScene.SceneSNO.Id;

            while (true)
            {
                try
                {
                    sceneID = player.CurrentScene.SceneSNO.Id;
                    if (sceneID == 56593)
                    {
                        world.Game.Quests.Advance(117779);
                        foreach (var playerN in world.Players)
                        {
                            var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(playerN.Value.Toon.PersistentID);
                            dbQuestProgress.ActiveQuest = 117779;
                            dbQuestProgress.StepOfQuest = 2;
                            DBSessions.AccountSession.SaveOrUpdate(dbQuestProgress);
                            DBSessions.AccountSession.Flush();
                        }
                        break;
                    }
                }
                catch { }
            }
            return(true);
        }
Esempio n. 7
0
        private bool OnEnterToParkListener(Core.GS.Players.Player player, Core.GS.Map.World world)
        {
            int sceneID = player.CurrentScene.SceneSNO.Id;

            while (true)
            {
                try
                {
                    sceneID = player.CurrentScene.SceneSNO.Id;
                    if (sceneID == 93992)
                    {
                        world.Game.Quests.NotifyQuest(72061, Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.EnterLevelArea, 19938);
                        world.Game.Quests.Advance(72061);
                        foreach (var playerN in world.Players)
                        {
                            var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(playerN.Value.Toon.PersistentID);
                            dbQuestProgress.ActiveQuest = 72061;
                            dbQuestProgress.StepOfQuest = 2;
                            DBSessions.AccountSession.SaveOrUpdate(dbQuestProgress);
                            DBSessions.AccountSession.Flush();
                        }
                        break;
                    }
                }
                catch { }
            }
            return(true);
        }
Esempio n. 8
0
 private bool StartConversation(Core.GS.Map.World world, Int32 conversationId)
 {
     foreach (var player in world.Players)
     {
         player.Value.Conversations.StartConversation(conversationId);
     }
     return(true);
 }
Esempio n. 9
0
 private bool OnListenerToEnterScene(Core.GS.Players.Player player, Core.GS.Map.World world, int SceneID)
 {
     while (true)
     {
         try
         {
             int NOWsceneID = player.CurrentScene.SceneSNO.Id;
             if (NOWsceneID == SceneID)
             {
                 break;
             }
         }
         catch { Logger.Debug("Приостановка скрипта, идёт загрузка."); }
     }
     return(true);
 }
Esempio n. 10
0
        private bool OnNierDoorsListener(Core.GS.Players.Player player, Core.GS.Map.World world)
        {
            int sceneID = player.CurrentScene.SceneSNO.Id;

            while (true)
            {
                try
                {
                    sceneID = player.CurrentScene.SceneSNO.Id;
                    if (sceneID == 74617)
                    {
                        break;
                    }
                }
                catch { }
            }
            return(true);
        }
Esempio n. 11
0
        private bool OnListenerToEnterGraveyard(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 == 74614) //trOut_wilderness_MainGraveyard_E02_S03
                    {
                        bool ActivePortal = true;

                        foreach (var playerN in world.Players)
                        {
                            var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(playerN.Value.Toon.PersistentID);
                            if (dbQuestProgress.StepOfQuest == 6)
                            {
                                ActivePortal = true;
                                dbQuestProgress.ActiveQuest = 72221;
                                dbQuestProgress.StepOfQuest = 7;
                            }
                            else
                            {
                                ActivePortal = false;
                            }
                            DBSessions.AccountSession.SaveOrUpdate(dbQuestProgress);
                        }

                        if (ActivePortal == true)
                        {
                            world.Game.Quests.Advance(72221);
                            DBSessions.AccountSession.Flush();
                        }
                        break;
                    }
                }
            }

            return(true);
        }
Esempio n. 12
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)
                        {
                            world.Game.Quests.Advance(72095);
                        }
                        else
                        {
                            world.Game.Quests.Advance(72095); world.Game.Quests.Advance(72095);
                        }
                        StartConversation(world, 166678);
                        break;
                    }
                }
            }

            return(true);
        }
Esempio n. 13
0
        private bool OnListenerToEnter(Core.GS.Players.Player player, Core.GS.Map.World world)
        {
            while (true)
            {
                try
                {
                    int sceneID = player.CurrentScene.SceneSNO.Id;
                    if (sceneID == 90196)
                    {
                        foreach (var playerN in world.Players.Values)
                        {
                            playerN.Toon.ActiveQuest = 72095;
                            playerN.Toon.StepOfQuest = 3;
                        }

                        try
                        {
                            if (player.ActiveHireling != null)
                            {
                                Vector3D NearDoor    = new Vector3D(1935.697f, 2792.971f, 40.23627f);
                                var      facingAngle = Core.GS.Actors.Movement.MovementHelpers.GetFacingAngle(player.ActiveHireling.Position, NearDoor);
                                player.ActiveHireling.Brain.DeActivate();
                                player.ActiveHireling.Move(NearDoor, facingAngle);

                                StartConversation(world, 166678);
                            }
                        }

                        catch { }
                        break;
                    }
                }
                catch { Logger.Debug("Приостановка скрипта, идёт загрузка."); }
            }
            return(true);
        }
Esempio n. 14
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);
        }
Esempio n. 15
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);
        }