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


C# WorldObject.SendPacketToArea方法代码示例

本文整理汇总了C#中WCell.RealmServer.Entities.WorldObject.SendPacketToArea方法的典型用法代码示例。如果您正苦于以下问题:C# WorldObject.SendPacketToArea方法的具体用法?C# WorldObject.SendPacketToArea怎么用?C# WorldObject.SendPacketToArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WCell.RealmServer.Entities.WorldObject的用法示例。


在下文中一共展示了WorldObject.SendPacketToArea方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendTextEmote

        // Client doesn't seem to be sending this
        //[ClientPacketHandler(RealmServerOpCode.CMSG_EMOTE)]
        //public static void HandleEmote(IRealmClient client, RealmPacketIn packet)
        //{
        //    var emote = (EmoteType)packet.ReadUInt32();

        //    if (emote != EmoteType.None)
        //    {
        //        var chr = client.ActiveCharacter;
        //        if (chr.CanMove && chr.CanInteract)
        //        {
        //            SendEmote(chr, emote);
        //        }
        //    }
        //}

        public static void SendTextEmote(WorldObject obj, TextEmote emote, INamed target)
        {
            var len = (target == null) ? 20 : target.Name.Length + 21;

            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_TEXT_EMOTE, len))
            {
                packet.Write(obj.EntityId);
                packet.WriteUInt((uint)emote);
                packet.WriteInt(-1);
                packet.WriteUIntPascalString(target != null ? target.Name : "");

                obj.SendPacketToArea(packet, true);
            }
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:30,代码来源:EmoteHandler.cs

示例2: SendSpellMiss

		/// <summary>
		/// Correct 3.0.9
		/// </summary>
		public static void SendSpellMiss(SpellId spell, WorldObject caster, bool doIt, ICollection<CastMiss> missedTargets)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELLLOGMISS, 34))
			{
				packet.Write((uint)spell);
				packet.Write(caster.EntityId);
				packet.Write(doIt);// TODO: test this value. Its a bool that seems to determine whether to display this packet in the combat log
				packet.Write(missedTargets.Count);
				foreach (var miss in missedTargets)
				{
					packet.Write(miss.Target.EntityId);
					packet.Write((byte)miss.Reason);
				}
				caster.SendPacketToArea(packet);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:19,代码来源:CombatLogHandler.cs

示例3: SendPeriodicDamage

		/// <summary>
		/// Used for Periodic leech effects, mostly Cannibalism
		/// </summary>
		/// <returns></returns>
		public static void SendPeriodicDamage(WorldObject caster, WorldObject target, uint spellId, AuraTickFlags type,
											  int amount)
		{
			using (var 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.SendPacketToArea(packet, true);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:20,代码来源:CombatLogHandler.cs

示例4: SendPeriodicAuraLog

		/// <summary>
		/// Used for any PeriodicAura (repeating ticks)
		/// </summary>
		/// <param name="extra">Always seems to be one</param>
		public static void SendPeriodicAuraLog(IPacketReceiver client, WorldObject caster, WorldObject target,
			uint spellId, uint extra, AuraTickFlags flags, int amount)
		{
			// TODO: Update struct for 3.0.2
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_PERIODICAURALOG, 32))
			{
				caster.EntityId.WritePacked(packet);
				target.EntityId.WritePacked(packet);
				packet.WriteUInt(spellId);
				packet.WriteUInt(extra);
				packet.WriteUInt((uint)flags);
				packet.WriteUInt(amount);

				target.SendPacketToArea(packet, true);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:20,代码来源:CombatLogHandler.cs

示例5: SendMonsterMessage

		/// <summary>
		/// Sends a monster message.
		/// </summary>
		/// <param name="obj">the monster the message is being sent from</param>
		/// <param name="chatType">the type of message</param>
		/// <param name="language">the language to send the message in</param>
		/// <param name="message">the message to send</param>
		/// <param name="radius">The radius or -1 to be heard by everyone in the Map</param>
		public static void SendMonsterMessage(WorldObject obj, ChatMsgType chatType, ChatLanguage language, string message, float radius)
		{
			if (obj == null || !obj.IsAreaActive)
				return;

			using (var packetOut = CreateObjectChatMessage(chatType, language, obj, message, obj is Unit ? ((Unit)obj).ChatTag : ChatTag.None))
			{
				obj.SendPacketToArea(packetOut, radius, true);
			}
		}
开发者ID:remixod,项目名称:netServer,代码行数:18,代码来源:ChatMgr.cs

示例6: SendImpact

		/// <summary>
		/// Shows a spell Impact animation
		/// </summary>
		public static void SendImpact(WorldObject target, uint visualId)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_PLAY_SPELL_IMPACT, 12))
			{
				//target.EntityId.WritePacked(packet);
				packet.Write(target.EntityId);
				packet.Write(visualId);

				target.SendPacketToArea(packet, true);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:14,代码来源:SpellHandler.cs

示例7: SendChannelUpdate

		/// <summary>
		/// Changes the time of the channel
		/// </summary>
		public static void SendChannelUpdate(WorldObject caster, uint delay)
		{
			if (caster == null) return;

			using (var packet = new RealmPacketOut(RealmServerOpCode.MSG_CHANNEL_UPDATE, 12))
			{
				caster.EntityId.WritePacked(packet);
				packet.Write(delay);

				caster.SendPacketToArea(packet, true);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:15,代码来源:SpellHandler.cs

示例8: SendChannelStart

		/// <summary>
		/// Starts Channeling
		/// </summary>
		public static void SendChannelStart(WorldObject caster, SpellId spellId, int duration)
		{
			if (caster == null) return;

			using (var packet = new RealmPacketOut(RealmServerOpCode.MSG_CHANNEL_START, 12))
			{
				caster.EntityId.WritePacked(packet);
				packet.Write((uint)spellId);
				packet.Write(duration);

				caster.SendPacketToArea(packet, true);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:16,代码来源:SpellHandler.cs

示例9: SendCastDelayed

		/// <summary>
		/// Delays the spell-cast
		/// </summary>
		public static void SendCastDelayed(WorldObject caster, int delay)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELL_DELAYED, 12))
			{
				caster.EntityId.WritePacked(packet);
				packet.Write(delay);

				caster.SendPacketToArea(packet, true);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:13,代码来源:SpellHandler.cs

示例10: SendPlayMusic

		public static void SendPlayMusic(WorldObject obj, uint sound, float range)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_PLAY_MUSIC, 4))
			{
				packet.WriteUInt(sound);
				obj.SendPacketToArea(packet, range != 0 ? range : WorldObject.BroadcastRange, true);
			}
		}
开发者ID:remixod,项目名称:netServer,代码行数:8,代码来源:MiscHandler.cs

示例11: SendPlayObjectSound

		public static void SendPlayObjectSound(WorldObject obj, uint sound)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_PLAY_OBJECT_SOUND, 13))
			{
				packet.Write(sound);
				packet.Write(obj.EntityId);

				obj.SendPacketToArea(packet, true);
			}
		}
开发者ID:remixod,项目名称:netServer,代码行数:10,代码来源:MiscHandler.cs

示例12: SendEmote

        public static void SendEmote(WorldObject obj, EmoteType emote)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_EMOTE, 12))
            {
                packet.WriteUInt((uint)emote);
                packet.Write(obj.EntityId);

                obj.SendPacketToArea(packet, true);
            }
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:10,代码来源:EmoteHandler.cs

示例13: SendMagicDamage

		public static void SendMagicDamage(WorldObject victim, IEntity attacker,
			SpellId spell, uint damage, uint overkill, DamageSchoolMask schools,
			uint absorbed, uint resisted, uint blocked, 
			bool unkBool, SpellLogFlags  flags)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELLNONMELEEDAMAGELOG, 40))
			{
				victim.EntityId.WritePacked(packet);
				if (attacker != null)
				{
					attacker.EntityId.WritePacked(packet);
				}
				else
				{
					packet.Write((byte)0);
				}
				packet.Write((uint)spell);

				packet.Write(damage);
				packet.Write(overkill);
				packet.Write((byte)schools);
				packet.Write(absorbed);
				packet.Write(resisted);
				packet.Write(0);				// apparently always 0
				packet.Write(unkBool);			// 0 or 1
				packet.Write(blocked);
				// also flags 0x8, 0x10, 
				packet.Write((uint)flags);
				packet.Write((byte)0);// unused by client

				victim.SendPacketToArea(packet, true);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:33,代码来源:CombatLogHandler.cs

示例14: SendEnvironmentalDamage

		/// <summary>
		/// Usually caused by jumping too high, diving too long, standing too close to fire etc
		/// </summary>
		public static void SendEnvironmentalDamage(WorldObject target, EnviromentalDamageType type, uint totalDamage)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_ENVIRONMENTALDAMAGELOG, 21))
			{
				target.EntityId.WritePacked(packet);

				packet.WriteByte((byte)type);
				packet.WriteUInt(totalDamage);
				packet.WriteULong(0);

				target.SendPacketToArea(packet, true);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:16,代码来源:CombatLogHandler.cs

示例15: SendEnergizeLog

		/// <summary>
		/// Correct for 3.0.9
		/// </summary>
		/// <param name="caster"></param>
		/// <param name="target"></param>
		/// <param name="spellId"></param>
		/// <param name="powerType"></param>
		/// <param name="value"></param>
		public static void SendEnergizeLog(WorldObject caster, Unit target, uint spellId, PowerType powerType, int value)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELLENERGIZELOG, 25))
			{
				target.EntityId.WritePacked(packet);
				caster.EntityId.WritePacked(packet);
				packet.Write(spellId);
				packet.Write(value);
				packet.Write((int)powerType);
				caster.SendPacketToArea(packet, true);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:20,代码来源:CombatLogHandler.cs


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