本文整理汇总了C#中WCell.RealmServer.Entities.WorldObject.PushPacketToSurroundingArea方法的典型用法代码示例。如果您正苦于以下问题:C# WorldObject.PushPacketToSurroundingArea方法的具体用法?C# WorldObject.PushPacketToSurroundingArea怎么用?C# WorldObject.PushPacketToSurroundingArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WCell.RealmServer.Entities.WorldObject
的用法示例。
在下文中一共展示了WorldObject.PushPacketToSurroundingArea方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendMeleeDamage
/// <param name="swingFlag">usually 1</param>
/// <returns>The actual damage (all resistances subtracted)</returns>
public static uint SendMeleeDamage(WorldObject attacker, WorldObject target, DamageType type, HitInfo hitInfo,
uint totalAmount, uint absorbed, uint resisted, uint blocked, VictimState victimState)
{
uint amount = totalAmount - blocked - absorbed - resisted;
using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.SMSG_ATTACKERSTATEUPDATE, 70)) {
packet.WriteUInt((uint)hitInfo);
attacker.EntityId.WritePacked(packet);
target.EntityId.WritePacked(packet);
packet.WriteUInt(totalAmount);
packet.WriteByte(1);
packet.WriteByte((uint)type);
packet.WriteFloat(amount);
packet.WriteUInt(amount);
packet.WriteUInt(absorbed);
packet.WriteUInt(resisted);
packet.WriteUInt((uint)victimState);
packet.Write(absorbed == 0 ? 0 : -1);
packet.WriteUInt(0);
packet.WriteUInt(blocked);
target.PushPacketToSurroundingArea(packet, true, false);
}
return amount;
}
示例2: SendEnvironmentDamage
/// <summary>
/// Usually caused by jumping too high, diving too long, standing too close to fire etc
/// </summary>
public static void SendEnvironmentDamage(WorldObject target, EnviromentalDamageType type, uint totalDamage)
{
using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.SMSG_ENVIRONMENTALDAMAGELOG, 21)) {
target.EntityId.WritePacked(packet);
packet.WriteByte((byte)type);
packet.WriteUInt(totalDamage);
packet.WriteULong(0);
target.PushPacketToSurroundingArea(packet, true, false);
}
}
示例3: SendMagicDamage
/// <summary>
/// Any spell and ranged damage
/// </summary>
/// <param name="totalAmount">Total amount</param>
/// <returns>The actual amount, with all mali subtracted</returns>
public static void SendMagicDamage(EntityId caster, WorldObject target, uint spellId, uint amount, DamageType type,
uint absorbed, uint resisted, uint blocked, bool critical)
{
/*if (victimState == VICTIMSTATE.DEFLECT) // resist
return MagicResist(target,submitter,spellId);*/
// TODO: Magic miss, ranged dodge, etc.
using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELLNONMELEEDAMAGELOG, 40)) {
target.EntityId.WritePacked(packet);
caster.WritePacked(packet);
packet.Write(spellId);
packet.WriteUInt(amount);
packet.WriteByte((byte)type);
packet.WriteUInt(absorbed);
packet.WriteUInt(resisted);
packet.WriteByte(type == DamageType.Physical ? 1 : 0); // pyshical damage?
packet.WriteByte(0);
packet.WriteUInt(blocked);
packet.WriteByte(critical ? 7 : 6);
packet.Write(0);
target.PushPacketToSurroundingArea(packet, true, false);
}
}
示例4: SendPeriodicDamage
/// <summary>
/// Used for Periodic leech effects, mostly Cannibalism
/// </summary>
/// <param name="school">AuraTickFlags.PeriodicHeal</param>
/// <returns></returns>
public static void SendPeriodicDamage(WorldObject caster, WorldObject target, uint spellId, Spells.AuraTickFlags type,
uint amount)
{
using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.SMSG_PERIODICAURALOG, 32)) {
caster.EntityId.WritePacked(packet);
target.EntityId.WritePacked(packet);
packet.WriteUInt(spellId);
packet.WriteUInt(1); // count
packet.WriteUInt((uint)type);
packet.WriteUInt(amount);
target.PushPacketToSurroundingArea(packet, true, false);
}
}