Beispiel #1
0
		public static void SendAllAuras(Unit owner)
		{
			using (var packet = CreateAllAuraPacket(owner))
			{
				owner.SendPacketToArea(packet);
			}
		}
Beispiel #2
0
 public static void SendAllAuras(Unit owner)
 {
     if (!owner.IsAreaActive) return;
     using (var packet = CreateAllAuraPacket(owner))
     {
         owner.SendPacketToArea(packet);
     }
 }
Beispiel #3
0
		public static void SendCombatStart(Unit unit, Unit opponent, bool includeSelf)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_ATTACKSTART, 16))
			{
				packet.Write(unit.EntityId);
				packet.Write(opponent.EntityId);

				unit.SendPacketToArea(packet, includeSelf);
			}
		}
Beispiel #4
0
		public static void SendAuraUpdate(Unit owner, Aura aura)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_AURA_UPDATE))
			{
				owner.EntityId.WritePacked(packet);

				WriteAura(aura, packet);

				owner.SendPacketToArea(packet);
			}
		}
Beispiel #5
0
        public static void SendCombatStop(Unit attacker, Unit opponent, int extraArg)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_ATTACKSTOP, 22))
            {
                attacker.EntityId.WritePacked(packet);

                if (opponent != null)
                {
                    opponent.EntityId.WritePacked(packet);
                }
                else
                {
                    packet.Write((byte)0); // null packed guid mask
                }

                packet.Write(extraArg);

                attacker.SendPacketToArea(packet, true);
            }
        }
Beispiel #6
0
		public static void SendWinner(DuelWin win, Unit winner, INamed loser)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_DUEL_WINNER))
			{
				packet.Write((byte)win);
				packet.Write(winner.Name);
				packet.Write(loser.Name);

				winner.SendPacketToArea(packet);
			}
		}
Beispiel #7
0
        public static void SendRemoveAura(Unit owner, Aura aura)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_AURA_UPDATE))
            {
                owner.EntityId.WritePacked(packet);
                packet.Write(aura.Index);

                // a spellid of 0 tells the client to remove the aura
                packet.Write(0);

                owner.SendPacketToArea(packet);
            }
        }
Beispiel #8
0
		public static void SendPowerUpdate(Unit unit, PowerType type, int value)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_POWER_UPDATE, 17))
			{
				unit.EntityId.WritePacked(packet);
				packet.Write((byte)type);
				packet.Write(value);

				unit.SendPacketToArea(packet, true);
			}
		}
Beispiel #9
0
		public static void SendHealthUpdate(Unit unit, int health)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_HEALTH_UPDATE, 13))
			{
				unit.EntityId.WritePacked(packet);
				packet.Write(health);

				unit.SendPacketToArea(packet, true);
			}
		}
Beispiel #10
0
		public static void SendHealLog(WorldObject caster, Unit target, uint spellId, int value, bool critical)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELLHEALLOG, 25))
			{
				target.EntityId.WritePacked(packet);
				caster.EntityId.WritePacked(packet);

				packet.Write(spellId);
				packet.Write(value);
				packet.Write((uint)0);		// overheal
				packet.Write((byte)(critical ? 1 : 0));
				packet.Write((byte)0);		// unused
				packet.Write(0);			// unknown wotlk

				target.SendPacketToArea(packet, true);
			}
		}