Beispiel #1
0
        private static async Task TransmitMovement(RealmServerSession session, MsgMoveInfo handler, RealmCMD code)
        {
            session.Character.MapX = handler.MapX;
            session.Character.MapY = handler.MapY;
            session.Character.MapZ = handler.MapZ;
            session.Character.MapO = handler.MapR;

            await MainForm.Database.UpdateMovement(session.Character);

            // If character is falling below the world

            // Boarding transport

            // Unmount when boarding

            // Unboarding transport

            // Checking Explore System

            // Fire quest event to check for if this area is used in explore area quest

            // If character is moving
            // - Stop emotes if moving
            session.Entity.SetUpdateField((int)UnitFields.UNIT_NPC_EMOTESTATE, 0);
            // - Stop casting

            // If character is turning

            // Movement time calculation

            // Send to nearby players

            // They may slow the movement down so let's do them after the packet is sent

            // Remove auras that requires you to not move

            // Remove auras that requires you to not turn

            //MSG_MOVE_HEARTBEAT
            //Check for out of continent - coordinates from WorldMapContinent.dbc
            //Duel check
            //Aggro range
            //Creatures that are following you will have a more smooth movement

            session.Entity.KnownPlayers.ForEach(s => s.Session.SendPacket(new PsMovement(session, handler, code)));

            // Gambi para nao mostrar o char andando sozinho para os demais
            if (code == RealmCMD.MSG_MOVE_JUMP)
            {
                session.Entity.Caindo = true;
            }
        }
Beispiel #2
0
        internal static void OnMoveFallLand(RealmServerSession session, MsgMoveInfo handler)
        {
            // If FallTime > 1100 and not Dead

            // Caluclate fall damage

            // Prevent the fall damage to be more than your maximum health

            // Deal the damage

            // Initialize packet

            session.Entity.Caindo = false;
        }
Beispiel #3
0
        public PsMovement(RealmServerSession session, MsgMoveInfo handler, RealmCMD opcode) : base(opcode)
        {
            if (session.Entity.Caindo)
            {
                return;
            }

            byte[] packedGuid = UpdateObject.GenerateGuidBytes((ulong)session.Character.Id);
            UpdateObject.WriteBytes(this, packedGuid);
            UpdateObject.WriteBytes(this, (handler.BaseStream as MemoryStream)?.ToArray());

            // We then overwrite the original moveTime (sent from the client) with ours
            ((MemoryStream)BaseStream).Position = 4 + packedGuid.Length;
            UpdateObject.WriteBytes(this, BitConverter.GetBytes((uint)Environment.TickCount));
        }