當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。