当前位置: 首页>>代码示例>>C#>>正文


C# WorldObject.PushPacketToSurroundingArea方法代码示例

本文整理汇总了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;
		}
开发者ID:pallmall,项目名称:WCell,代码行数:29,代码来源:CombatMgr.cs

示例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);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:14,代码来源:CombatMgr.cs

示例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);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:30,代码来源:CombatMgr.cs

示例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);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:20,代码来源:CombatMgr.cs


注:本文中的WCell.RealmServer.Entities.WorldObject.PushPacketToSurroundingArea方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。