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

                        if (actor.Attributes[Net.GS.Message.GameAttribute.Gizmo_Has_Been_Operated])
                        {
                            world.Game.Quests.NotifyQuest(72095, QuestStepObjectiveType.InteractWithActor, -1);
                            foreach (var player in world.Players.Values)
                            {
                                player.Toon.ActiveQuest = 72095;
                                player.Toon.StepOfQuest = 2;
                            }
                            break;
                        }
                    }
                }
                catch { }
            }
            return(true);
        }
Ejemplo n.º 2
0
        //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

                while (true)
                {
                    if (actor.Attributes[Net.GS.Message.GameAttribute.Gizmo_Has_Been_Operated])
                    {
                        world.Game.Quests.Advance(72095);
                        foreach (var player in world.Players)
                        {
                            var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(player.Value.Toon.PersistentID);
                            dbQuestProgress.ActiveQuest = 72095;
                            dbQuestProgress.StepOfQuest = 2;
                            DBSessions.AccountSession.SaveOrUpdate(dbQuestProgress);
                            DBSessions.AccountSession.Flush();
                        }
                        break;
                    }
                }
            }
            return(true);
        }
Ejemplo n.º 3
0
 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
 }
Ejemplo n.º 4
0
        //just for the use of the portal
        private bool OnUseActorListener(uint actorDynID, Map.World world)
        {
            if (world.HasActor(actorDynID))
            {
                var actor = world.GetActorByDynamicId(actorDynID); // it is not null :p



                while (true)
                {
                    world.Game.Quests.NotifyQuest(87700, Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.EventReceived, -1);
                    //Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.KillMonster, 1);
                    break;
                }
            }
            return(true);
        }
Ejemplo n.º 5
0
        //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);
        }
Ejemplo n.º 6
0
        public override void Execute(Map.World world)
        {
            // Проверка на ненужную Лию
            if (world.HasActor(72))
            {
                world.GetActorByDynamicId(72).Destroy();
            }

            //Берем нужную Лию =)
            var LeahBrains = world.GetActorByDynamicId(83);

            //Берем путевую точку Нового Тристрама
            var NewTristramPortal = world.GetActorBySNO(223757);

            if (HadConversation)
            {
                HadConversation = false;
                Logger.Debug(" RESCUE CAIN QUEST STARTED ");
                world.Game.Quests.NotifyQuest(72095, QuestStepObjectiveType.EventReceived, -1);
            }

            #region Создаем Лею как подругу.
            Hireling LeahFriend = new LeahParty(world, LeahBrains.ActorSNO.Id, LeahBrains.Tags);
            //LeahFriend.Brain = new HirelingBrain(LeahFriend);
            foreach (var player in world.Players)
            {
                if (player.Value.PlayerIndex == 0)
                {
                    LeahFriend.GBHandle.Type = 4;
                    LeahFriend.GBHandle.GBID = 717705071;
                    LeahFriend.Attributes[GameAttribute.Pet_Creator]        = player.Value.PlayerIndex;
                    LeahFriend.Attributes[GameAttribute.Pet_Type]           = 0x8;
                    LeahFriend.Attributes[GameAttribute.Hitpoints_Max]      = 100f;
                    LeahFriend.Attributes[GameAttribute.Hitpoints_Cur]      = 80f;
                    LeahFriend.Attributes[GameAttribute.Attacks_Per_Second] = 1.6f;
                    LeahFriend.Attributes[GameAttribute.Pet_Owner]          = player.Value.PlayerIndex;
                    LeahFriend.Attributes[GameAttribute.Untargetable]       = false;
                    LeahFriend.Position     = RandomDirection(player.Value.Position, 3f, 8f);
                    LeahFriend.RotationW    = LeahBrains.RotationW;
                    LeahFriend.RotationAxis = LeahBrains.RotationAxis;
                    LeahFriend.EnterWorld(RandomDirection(player.Value.Position, 3f, 8f));
                    LeahFriend.Attributes[GameAttribute.Level]++;
                    player.Value.ActiveHireling = LeahFriend;
                    LeahFriend.Brain.Activate();
                    MasterPlayer = player.Value;
                }
                player.Value.Toon.ActiveQuest   = 72095;
                player.Value.Toon.StepOfQuest   = 1;
                player.Value.Toon.StepIDofQuest = 7;
            }
            #endregion
            // Убираем Лею NPC
            try { world.Leave(LeahBrains); }
            catch { }

            NewTristramPortal.Attributes[Net.GS.Message.GameAttribute.Gizmo_Has_Been_Operated] = false;
            var ListenerUsePortalTask = Task <bool> .Factory.StartNew(() => OnUseTeleporterListener(NewTristramPortal.DynamicID, world));

            ListenerUsePortalTask.ContinueWith(delegate                //Ждём использования телепорта:
            {
                Logger.Debug(" Waypoint_NewTristram Objective done "); // Waypoint_NewTristram
            });

            var ListenerEnterToOldTristram = Task <bool> .Factory.StartNew(() => OnListenerToEnter(MasterPlayer, world));

            ListenerEnterToOldTristram.ContinueWith(delegate //Once killed:
            {
                Logger.Debug("Enter to Road Objective done ");
                var ListenerEnterToAdriaEnter = Task <bool> .Factory.StartNew(() => OnListenerToAndriaEnter(MasterPlayer, world));
                ListenerEnterToAdriaEnter.ContinueWith(delegate //Once killed:
                {
                    Logger.Debug("Enter to Adria Objective done ");
                });
            });
        }
Ejemplo n.º 7
0
        public override void Execute(Map.World world)
        {
            // test kill leah
            if (world.HasActor(72))
            {
                world.GetActorByDynamicId(72).Destroy();
            }
            //Get Leah
            var LeahBrains = world.GetActorByDynamicId(83);

            //Get Portal
            var NewTristramPortal = world.GetActorByDynamicId(34);

            portalAID = NewTristramPortal.ActorSNO.Id;
            if (HadConversation)
            {
                HadConversation = false;
                Logger.Debug(" RESCUE CAIN QUEST STARTED ");
                Logger.Debug(" Quests.Advance(72095) ");
                world.Game.Quests.HasCurrentQuest(72095, -1);
                world.Game.Quests.Advance(72095);
            }
            // Away Leah
            try { world.Leave(LeahBrains); }
            catch { }

            //LeahBrains.OnLeave(world);
            // Create Friend Leah for Party
            Hireling LeahFriend = new Hireling(world, LeahBrains.ActorSNO.Id, LeahBrains.Tags);

            LeahFriend.Brain = new MinionBrain(LeahFriend);


            // Point to spawn Leah
            var NewPoint = new Vector3D(LeahBrains.Position.X, LeahBrains.Position.Y + 5, LeahBrains.Position.Z);

            //LeahBrains.EnterWorld(NewPoint);
            foreach (var player in world.Players)
            {
                if (player.Value.PlayerIndex == 0)
                {
                    LeahFriend.GBHandle.Type = 4;
                    LeahFriend.GBHandle.GBID = 717705071;
                    LeahFriend.Attributes[GameAttribute.Pet_Creator]        = player.Value.PlayerIndex;
                    LeahFriend.Attributes[GameAttribute.Pet_Type]           = 0x8;
                    LeahFriend.Attributes[GameAttribute.Hitpoints_Max]      = 100f;
                    LeahFriend.Attributes[GameAttribute.Hitpoints_Cur]      = 80f;
                    LeahFriend.Attributes[GameAttribute.Attacks_Per_Second] = 1.6f;
                    LeahFriend.Attributes[GameAttribute.Pet_Owner]          = player.Value.PlayerIndex;
                    LeahFriend.Attributes[GameAttribute.Untargetable]       = false;
                    LeahFriend.Position     = RandomDirection(player.Value.Position, 3f, 8f);
                    LeahFriend.RotationW    = LeahBrains.RotationW;
                    LeahFriend.RotationAxis = LeahBrains.RotationAxis;
                    LeahFriend.EnterWorld(NewPoint);
                    LeahFriend.Attributes[GameAttribute.Level]++;
                    player.Value.ActiveHireling = LeahFriend;
                    player.Value.SelectedNPC    = null;
                    LeahFriend.Brain.Activate();
                    MasterPlayer = player.Value;
                }

                var dbQuestProgress = DBSessions.AccountSession.Get <DBProgressToon>(player.Value.Toon.PersistentID);

                dbQuestProgress.ActiveQuest = 72095;
                dbQuestProgress.StepOfQuest = 1;
                DBSessions.AccountSession.SaveOrUpdate(dbQuestProgress);
                DBSessions.AccountSession.Flush();
            }

            LeahBrains.OnLeave(world);
            var ListenerUsePortalTask = Task <bool> .Factory.StartNew(() => OnUseTeleporterListener(NewTristramPortal.DynamicID, world));

            //Wait for portal to be used .
            ListenerUsePortalTask.ContinueWith(delegate                //Once killed:
            {
                Logger.Debug(" Waypoint_NewTristram Objective done "); // Waypoint_NewTristram
            });

            var ListenerEnterToOldTristram = Task <bool> .Factory.StartNew(() => OnListenerToEnter(MasterPlayer, world));

            ListenerEnterToOldTristram.ContinueWith(delegate //Once killed:
            {
                Logger.Debug("Enter to Road Objective done ");
                var ListenerEnterToAdriaEnter = Task <bool> .Factory.StartNew(() => OnListenerToAndriaEnter(MasterPlayer, world));
                ListenerEnterToAdriaEnter.ContinueWith(delegate //Once killed:
                {
                    Logger.Debug("Enter to Adria Objective done ");
                    world.Game.Quests.Advance(72095);
                });
            });
        }