Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="chr"></param>
        /// <param name="target"></param>
        /// <param name="status">0 - stop;1-start;2 90% weight;3 cannot see target</param>
        public static void StartAtackResponse(Character chr, Unit target, byte status)
        {
            if (chr.IsMoving)
            {
                Asda2MovmentHandler.SendEndMoveByFastInstantRegularMoveResponse(chr);
            }
            var npc = target as NPC;

            using (var p = new RealmPacketOut(RealmServerOpCode.StartAtackResponse)) //4027
            {
                p.WriteByte(status);                                                 //{status}default value : 1 Len : 1
                p.WriteInt16(chr.SessionId);                                         //{sessId}default value : 13 Len : 2
                p.WriteInt16(npc == null?-1:npc.UniqIdOnMap);                        //{monstrMapId}default value : 123 Len : 2
                p.WriteInt16(0);
                p.WriteInt16(0);
                p.WriteInt32(npc == null?-1:npc.UniqWorldEntityId);   //{UniqMonstrId}default value : 40 Len : 4
                chr.SendPacketToArea(p, true, false);
            }
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="chr"></param>
        /// <param name="target"></param>
        /// <param name="status">0 - stop;1-start;2 90% weight;3 cannot see target</param>
        public static void StartAtackResponse(Character chr, Unit target, byte status)
        {
            if (chr.IsMoving)
            {
                Asda2MovmentHandler.SendEndMoveByFastInstantRegularMoveResponse(chr);
            }
            NPC npc = target as NPC;

            using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.StartAtackResponse))
            {
                packet.WriteByte(status);
                packet.WriteInt16(chr.SessionId);
                packet.WriteInt16(npc == null ? -1 : (int)npc.UniqIdOnMap);
                packet.WriteInt16(0);
                packet.WriteInt16(0);
                packet.WriteInt32(npc == null ? -1 : npc.UniqWorldEntityId);
                chr.SendPacketToArea(packet, true, false, Locale.Any, new float?());
            }
        }