本文整理汇总了C#中WCell.RealmServer.Entities.Unit.SendPacketToArea方法的典型用法代码示例。如果您正苦于以下问题:C# Unit.SendPacketToArea方法的具体用法?C# Unit.SendPacketToArea怎么用?C# Unit.SendPacketToArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WCell.RealmServer.Entities.Unit
的用法示例。
在下文中一共展示了Unit.SendPacketToArea方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendAllAuras
public static void SendAllAuras(Unit owner)
{
using (var packet = CreateAllAuraPacket(owner))
{
owner.SendPacketToArea(packet);
}
}
示例2: SendAllAuras
public static void SendAllAuras(Unit owner)
{
if (!owner.IsAreaActive) return;
using (var packet = CreateAllAuraPacket(owner))
{
owner.SendPacketToArea(packet);
}
}
示例3: SendCombatStart
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);
}
}
示例4: SendAuraUpdate
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);
}
}
示例5: SendCombatStop
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);
}
}
示例6: SendWinner
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);
}
}
示例7: SendRemoveAura
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);
}
}
示例8: SendPowerUpdate
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);
}
}
示例9: SendHealthUpdate
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);
}
}
示例10: SendHealLog
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);
}
}