Esempio n. 1
0
        public static void GameMapMovementMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            GameMapMovementMessage msg = (GameMapMovementMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            List <uint> keys = new List <uint>();

            foreach (short s in msg.keyMovements)
            {
                keys.Add((uint)s);
            }
            MovementPath clientMovement = MapMovementAdapter.GetClientMovement(keys);

            BlueSheep.Core.Fight.Entity entity = null;
            foreach (BlueSheep.Core.Fight.Entity en in account.Map.Entities)
            {
                if (en.Id == msg.actorId)
                {
                    entity = en;
                }
            }
            if (entity != null)
            {
                (account.Map.Entities[account.Map.Entities.IndexOf(entity)]).CellId = clientMovement.CellEnd.CellId;
            }

            //GameRolePlayGroupMonsterInformations e = null;
            foreach (MonsterGroup en in account.Map.List)
            {
                if (en.m_contextualId == msg.actorId)
                {
                    en.m_cellId = clientMovement.CellEnd.CellId;
                }
            }
            //if (e != null)
            //{
            //    account.Map.List.RemoveAt(i);
            //    account.Map.List.Add(new GameRolePlayGroupMonsterInformations(msg.actorId, e.look, new EntityDispositionInformations((short)clientMovement.CellEnd.CellId, e.disposition.direction), e.keyRingBonus, e.hasHardcoreDrop, e.hasAVARewardToken, e.staticInfos, e.ageBonus, e.lootShare, e.alignmentSide));
            //}
            //if (msg.actorId == account.Map.Character.Id)
            //{
            //    account.Wait(100, 200);
            //    using (BigEndianWriter writer = new BigEndianWriter())
            //    {
            //        GameMapMovementConfirmMessage newmsg = new GameMapMovementConfirmMessage();
            //        newmsg.Serialize(writer);
            //        MessagePackaging pack = new MessagePackaging(writer);
            //        pack.Pack((int)newmsg.ProtocolID);
            //        account.SocketManager.Send(pack.Writer.Content);
            //    }
            //}
            //    if (account.Fight.flag != 0)
            //    {
            //        account.Fight.LaunchFight(account.Fight.flag);
            //    }
            //}
        }
Esempio n. 2
0
        public static void GameMapMovementMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            GameMapMovementMessage msg = (GameMapMovementMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            MovementPath clientMovement = MapMovementAdapter.GetClientMovement(msg.keyMovements.Select <short, uint>(k => (uint)k).ToList());

            if (account.state == Enums.Status.Fighting)
            {
                account.FightData.UpdateFighterCell(msg.actorId, clientMovement.CellEnd.CellId);
            }
        }
Esempio n. 3
0
        public static void GameMapMovementMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            GameMapMovementMessage msg = (GameMapMovementMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            MovementPath clientMovement = MapMovementAdapter.GetClientMovement(msg.keyMovements.Select <short, uint>(k => (uint)k).ToList());

            if (account.state == Enums.Status.Fighting)
            {
                BFighter fighter = account.Fight.GetFighter(msg.actorId);
                if (fighter != null)
                {
                    //account.Log(new BotTextInformation("GameMap Ancienne cellid of " + fighter.Id + " = " + fighter.CellId));
                    fighter.CellId = clientMovement.CellEnd.CellId;
                    //account.Log(new BotTextInformation("GameMap Nouvelle cellid of " + fighter.Id + " = " + fighter.CellId));
                }
            }
        }
Esempio n. 4
0
        public static void GameMapMovementMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            GameMapMovementMessage msg = (GameMapMovementMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            List <uint> keys = new List <uint>();

            foreach (short s in msg.keyMovements)
            {
                keys.Add((uint)s);
            }
            MovementPath clientMovement = MapMovementAdapter.GetClientMovement(keys);

            account.MapData.UpdateEntityCell(msg.actorId, clientMovement.CellEnd.CellId);
            if (account.Map.Moving && msg.actorId == account.MapData.Character.contextualId)
            {
                account.Map.ConfirmMove();
            }
        }