本文整理汇总了C#中Aura.Shared.Network.Packet.Peek方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.Peek方法的具体用法?C# Packet.Peek怎么用?C# Packet.Peek使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aura.Shared.Network.Packet
的用法示例。
在下文中一共展示了Packet.Peek方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Use
/// <summary>
/// Handles usage of the skill, called once a part was selected.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="packet"></param>
public void Use(Creature creature, Skill skill, Packet packet)
{
var part = packet.GetInt();
if (packet.Peek() == PacketElementType.Short)
this.UseRegular(creature, skill, packet, part);
else if (packet.Peek() == PacketElementType.Byte)
this.UseFixed(creature, skill, packet, part);
}
示例2: Complete
public void Complete(Creature creature, Skill skill, Packet packet)
{
var part = packet.GetInt();
if (creature.Skills.ActiveSkill != skill) return;
if (creature.Temp.SkillItem1 == null || creature.Temp.SkillItem2 == null) return;
creature.Skills.ActiveSkill = null;
if (packet.Peek() == PacketElementType.Short)
this.CompleteRegular(creature, packet, skill, part);
else if (packet.Peek() == PacketElementType.Byte)
this.CompleteFixed(creature, packet, skill, part);
}
示例3: Use
/// <summary>
/// Handles usage of the skill, called once a part was selected.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="packet"></param>
public void Use(Creature creature, Skill skill, Packet packet)
{
var part = packet.GetInt();
switch (packet.Peek())
{
case PacketElementType.Short: this.UseRegular(creature, skill, packet, part); break;
case PacketElementType.Byte: this.UseFixed(creature, skill, packet, part); break;
}
}
示例4: Use
/// <summary>
/// Uses WM, attacking targets.
/// </summary>
/// <param name="attacker"></param>
/// <param name="skill"></param>
/// <param name="packet"></param>
public void Use(Creature attacker, Skill skill, Packet packet)
{
var targetAreaId = packet.GetLong();
// There exists a seemingly rare case where these parameters
// aren't sent.
var unkInt1 = (packet.Peek() != PacketElementType.None ? packet.GetInt() : 0);
var unkInt2 = (packet.Peek() != PacketElementType.None ? packet.GetInt() : 0);
this.Use(attacker, skill, targetAreaId, unkInt1, unkInt2);
}
示例5: Complete
/// <summary>
/// Completes skill usage, called once the dyeing is completed.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="packet"></param>
public void Complete(Creature creature, Skill skill, Packet packet)
{
var part = packet.GetInt();
if (creature.Skills.ActiveSkill != skill)
return;
if (creature.Temp.SkillItem1 == null || creature.Temp.SkillItem2 == null)
return;
switch (packet.Peek())
{
case PacketElementType.Short: this.CompleteRegular(creature, packet, skill, part); break;
case PacketElementType.Byte: this.CompleteFixed(creature, packet, skill, part); break;
}
}
示例6: Use
/// <summary>
/// Handles skill usage.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="packet"></param>
public void Use(Creature creature, Skill skill, Packet packet)
{
var targetEntityId = packet.GetLong();
// Similar to WM there is a case where these aren't sent.
// Apparently this can happen if you activate the skill while
// targetting an enemy.
var unk1 = (packet.Peek() != PacketElementType.None ? packet.GetInt() : 0);
var unk2 = (packet.Peek() != PacketElementType.None ? packet.GetInt() : 0);
if (_cm == null)
_cm = ChannelServer.Instance.SkillManager.GetHandler<CombatMastery>(SkillId.CombatMastery);
// TODO: Check duration
var attackResult = false;
var target = creature.Region.GetCreature(targetEntityId);
if (target != null && !creature.IsStunned && creature.CanTarget(target))
{
var pos = creature.GetPosition();
var targetPos = target.GetPosition();
var inRange = pos.InRange(targetPos, creature.AttackRangeFor(target));
if (!inRange)
{
var telePos = pos.GetRelative(targetPos, -creature.AttackRangeFor(target) + 100);
// Check teleport distance
if (pos.GetDistance(telePos) > skill.RankData.Var3 + 100)
{
Send.Notice(creature, "Out of range");
}
else
{
Send.Effect(creature, Effect.SilentMoveTeleport, targetEntityId, (byte)0);
creature.SetPosition(telePos.X, telePos.Y);
Send.SkillTeleport(creature, telePos.X, telePos.Y);
inRange = true;
}
}
if (inRange)
attackResult = (_cm.Use(creature, skill, targetEntityId) == CombatSkillResult.Okay);
}
Send.CombatAttackR(creature, attackResult);
Send.SkillUse(creature, skill.Info.Id, targetEntityId, unk1, unk2);
}