本文整理汇总了C#中WCell.RealmServer.Spells.SpellCast.SendPacketToArea方法的典型用法代码示例。如果您正苦于以下问题:C# SpellCast.SendPacketToArea方法的具体用法?C# SpellCast.SendPacketToArea怎么用?C# SpellCast.SendPacketToArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WCell.RealmServer.Spells.SpellCast
的用法示例。
在下文中一共展示了SpellCast.SendPacketToArea方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendSpellMiss
/// <summary>
/// Correct 3.0.9
/// </summary>
public static void SendSpellMiss(SpellCast cast, bool display, ICollection<MissedTarget> missedTargets)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELLLOGMISS, 34))
{
packet.Write(cast.Spell.Id);
packet.Write(cast.CasterReference.EntityId);
packet.Write(display);// 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);
}
cast.SendPacketToArea(packet);
}
}
示例2: SendChannelUpdate
/// <summary>
/// Changes the time of the channel
/// </summary>
public static void SendChannelUpdate(SpellCast cast, uint delay)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.MSG_CHANNEL_UPDATE, 12))
{
cast.CasterReference.EntityId.WritePacked(packet);
packet.Write(delay);
cast.SendPacketToArea(packet);
}
}
示例3: SendChannelStart
/// <summary>
/// Starts Channeling
/// </summary>
public static void SendChannelStart(SpellCast cast, SpellId spellId, int duration)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.MSG_CHANNEL_START, 12))
{
cast.CasterReference.EntityId.WritePacked(packet);
packet.Write((uint)spellId);
packet.Write(duration);
cast.SendPacketToArea(packet);
}
}
示例4: SendCastDelayed
/// <summary>
/// Delays the spell-cast
/// </summary>
public static void SendCastDelayed(SpellCast cast, int delay)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELL_DELAYED, 12))
{
cast.CasterReference.EntityId.WritePacked(packet);
packet.Write(delay);
cast.SendPacketToArea(packet);
}
}
示例5: SendSpellFailedOther
internal static void SendSpellFailedOther(SpellCast spellCast, SpellFailedReason reason)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELL_FAILED_OTHER, 15))
{
spellCast.CasterReference.EntityId.WritePacked(packet);
packet.Write(spellCast.Id);
packet.Write(spellCast.Spell.Id);
packet.Write((byte)reason);
spellCast.SendPacketToArea(packet);
}
}
示例6: SendSpellGo
//.........这里部分代码省略.........
//int len = 200;
int len = 24 + (hitTargets != null ? hitTargets.Count * 8 : 0) + (missedTargets != null ? missedTargets.Count * 10 : 0);
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELL_GO, len))
{
//caster1.EntityId.WritePacked(packet);
cast.CasterReference.EntityId.WritePacked(packet);
caster2.EntityId.WritePacked(packet);
packet.Write(cast.Id);
packet.Write(cast.Spell.Id);
var castGoFlags = cast.GoFlags;
packet.Write((int)castGoFlags);
//packet.Write(Util.Utility.GetEpochTime());
packet.Write(Utility.GetEpochTime());
//packet.Write(cast.CastDelay);
packet.WriteByte(hitTargets != null ? hitTargets.Count : 0);
if (hitTargets != null && cast.CasterObject != null)
{
foreach (var target in hitTargets)
{
packet.Write(target.EntityId);
if (target is Character)
{
SendCastSuccess(cast.CasterObject, cast.Spell.Id, target as Character);
}
}
}
packet.WriteByte(missedTargets != null ? missedTargets.Count : 0);
if (missedTargets != null)
{
foreach (var miss in missedTargets)
{
packet.Write(miss.Target.EntityId);
packet.Write((byte)miss.Reason);
if (miss.Reason == CastMissReason.Reflect)
{
packet.Write((byte)0);// relfectreason
}
}
}
WriteTargets(packet, cast);
// runes
if (castGoFlags.HasFlag(CastFlags.RunicPowerGain))
{
packet.Write(0);
}
if (castGoFlags.HasFlag(CastFlags.RuneCooldownList))
{
var chr = cast.CasterChar;
var newRuneMask = chr.PlayerSpells.Runes.GetActiveRuneMask();
packet.Write(previousRuneMask);
packet.Write(newRuneMask);
for (int i = 0; i < SpellConstants.MaxRuneCount; i++)
{
var mask = (byte)(1 << i);
if ((mask & previousRuneMask) != 0)
{
if ((mask & newRuneMask) == 0)
{
packet.WriteByte(0);
}
}
}
}
if (castGoFlags.HasFlag(CastFlags.Flag_0x20000))
{
packet.WriteFloat(0);
packet.Write(0);
}
if (cast.StartFlags.HasFlag(CastFlags.Ranged))
{
WriteAmmoInfo(cast, packet);
}
if (castGoFlags.HasFlag(CastFlags.Flag_0x80000))
{
packet.Write(0);
packet.Write(0);
}
if (cast.TargetFlags.HasAnyFlag(SpellTargetFlags.DestinationLocation))
{
packet.Write((byte)0); // unk 3.3.x?
}
cast.SendPacketToArea(packet);
}
}
示例7: SendCastStart
public static void SendCastStart(SpellCast cast)
{
if (cast.CasterObject != null && !cast.CasterObject.IsAreaActive) return;
int len = 150;
var spell = cast.Spell;
if (spell == null) return;
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELL_START, len))
{
// Common to start and go packets
WriteCaster(cast, packet);
packet.Write(cast.Id);
packet.Write(spell.Id);
packet.Write((int)cast.StartFlags);
// start specific stuff
packet.Write(cast.CastDelay);
WriteTargets(packet, cast);
if (cast.StartFlags.HasFlag(CastFlags.RunicPowerGain))
{
packet.Write(0);
}
if (cast.StartFlags.HasFlag(CastFlags.RuneCooldownList))
{
byte b1 = 0;
byte b2 = 0;
packet.Write(b1);
packet.Write(b2);
for (int i = 0; i < 6; i++)
{
byte mask = (byte)(1 << i);
if ((mask & b1) != 0)
{
if ((mask & b2) == 0)
{
packet.WriteByte(0);
}
}
}
}
if (cast.StartFlags.HasFlag(CastFlags.Ranged))
{
WriteAmmoInfo(cast, packet);
}
if (cast.StartFlags.HasFlag(CastFlags.Flag_0x4000000))
{
// since 3.2.0
packet.Write(0);
packet.Write(0);
}
if (cast.TargetFlags.HasAnyFlag(SpellTargetFlags.DestinationLocation))
{
packet.Write((byte)0); // unk 3.3.x?
}
cast.SendPacketToArea(packet);
}
}