Beispiel #1
0
 public static void SendMostrDeadToAreaResponse(ICollection <IRealmClient> clients, short npcId, short x, short y)
 {
     using (RealmPacketOut monstrDeadPacket = Asda2CombatHandler.CreateMonstrDeadPacket(npcId, x, y))
     {
         foreach (IPacketReceiver client in (IEnumerable <IRealmClient>)clients)
         {
             client.Send(monstrDeadPacket, true);
         }
     }
 }
Beispiel #2
0
        public static void ContinueAtackRequest(IRealmClient client, RealmPacketIn packet)
        {
            Unit target = client.ActiveCharacter.Target;

            if (target == null || !client.ActiveCharacter.CanHarm((WorldObject)target))
            {
                Asda2CombatHandler.StartAtackResponse(client.ActiveCharacter, target, (byte)0);
            }
            client.ActiveCharacter.IsFighting = true;
        }
Beispiel #3
0
        public static void AtackCharacterRequest(IRealmClient client, RealmPacketIn packet)
        {
            Character characterBySessionId = World.GetCharacterBySessionId(packet.ReadUInt16());

            if (characterBySessionId == null || characterBySessionId == client.ActiveCharacter ||
                !client.ActiveCharacter.CanHarm((WorldObject)characterBySessionId))
            {
                Asda2CombatHandler.StartAtackResponse(client.ActiveCharacter, (Unit)characterBySessionId, (byte)0);
            }
            else
            {
                client.ActiveCharacter.IsFighting = true;
                Asda2SpellHandler.SendSetAtackStateGuiResponse(client.ActiveCharacter);
            }
        }
Beispiel #4
0
        public static void StartAtackRequest(IRealmClient client, RealmPacketIn packet)
        {
            Character activeCharacter = client.ActiveCharacter;
            ushort    id             = packet.ReadUInt16();
            NPC       npcByUniqMapId = client.ActiveCharacter.Map.GetNpcByUniqMapId(id);
            byte      status         = 3;

            if (npcByUniqMapId == null)
            {
                status = (byte)2;
            }
            if (npcByUniqMapId != null && activeCharacter.CanHarm((WorldObject)npcByUniqMapId) &&
                activeCharacter.CanSee((WorldObject)npcByUniqMapId))
            {
                status = (byte)1;
            }
            activeCharacter.Target = (Unit)npcByUniqMapId;
            activeCharacter.IsWaitingForAtackAnimation = true;
            Asda2CombatHandler.StartAtackResponse(activeCharacter, activeCharacter.Target, status);
        }
Beispiel #5
0
        public static void StartAtackCharacterRequest(IRealmClient client, RealmPacketIn packet)
        {
            Character characterBySessionId = World.GetCharacterBySessionId(packet.ReadUInt16());

            if (characterBySessionId == null || !characterBySessionId.IsAlive)
            {
                return;
            }
            if ((int)client.ActiveCharacter.Asda2FactionId == (int)characterBySessionId.Asda2FactionId &&
                characterBySessionId.IsAsda2BattlegroundInProgress &&
                client.ActiveCharacter.IsAsda2BattlegroundInProgress)
            {
                Asda2CombatHandler.SendStartAtackCharacterError(client.ActiveCharacter, characterBySessionId,
                                                                Asda2CharacterAtackStatus.Fail);
            }
            else
            {
                client.ActiveCharacter.Target = (Unit)characterBySessionId;
                Asda2CombatHandler.SendStartAtackCharacterResponseResponse(client.ActiveCharacter,
                                                                           characterBySessionId);
                Asda2SpellHandler.SendSetAtackStateGuiResponse(client.ActiveCharacter);
            }
        }