本文整理汇总了C#中MabiPacket.GetElementType方法的典型用法代码示例。如果您正苦于以下问题:C# MabiPacket.GetElementType方法的具体用法?C# MabiPacket.GetElementType怎么用?C# MabiPacket.GetElementType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MabiPacket
的用法示例。
在下文中一共展示了MabiPacket.GetElementType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Complete
public override SkillResults Complete(MabiCreature creature, MabiSkill skill, MabiPacket packet)
{
if (creature.Temp.SkillItem1 == null || creature.Temp.SkillItem2 == null)
return SkillResults.Failure;
var part = packet.GetInt();
if (packet.GetElementType() == ElementType.Short)
return this.CompleteRegular(creature, packet, skill.Id, part);
else if (packet.GetElementType() == ElementType.Byte)
return this.CompleteFixed(creature, packet, skill.Id, part);
return SkillResults.Failure;
}
示例2: Start
public override SkillResults Start(MabiCreature creature, MabiSkill skill, MabiPacket packet)
{
// Usually the second parameter is an empty string,
// but if it's not empty it seems to be tags.
var parameter = (packet != null && packet.GetElementType() == ElementType.String ? packet.GetString() : null);
var tags = new MabiTags(parameter);
var result = this.Start(creature, skill, tags);
Send.SkillStart(creature, skill.Id, parameter);
return result;
}
示例3: Stop
public override SkillResults Stop(MabiCreature creature, MabiSkill skill, MabiPacket packet)
{
var parameter = (packet != null && packet.GetElementType() == ElementType.String ? packet.GetString() : null);
var result = this.Stop(creature, skill);
if (parameter != null)
Send.SkillStop(creature, skill.Id, parameter);
else
Send.SkillStop(creature, skill.Id, 1);
return result;
}
示例4: Stop
public override SkillResults Stop(MabiCreature creature, MabiSkill skill, MabiPacket packet)
{
// Sometimes the second stop parameter is a byte,
// possibly when canceling by moving (eg Rest).
// The client doesn't really seem to care about what we send back though...
var parameter = (packet != null && packet.GetElementType() == ElementType.String ? packet.GetString() : null);
var tags = new MabiTags(parameter);
var result = this.Stop(creature, skill, tags);
if (parameter != null)
Send.SkillStop(creature, skill.Id, parameter);
else
Send.SkillStop(creature, skill.Id, 1);
return result;
}
示例5: Use
public override SkillResults Use(MabiCreature creature, MabiSkill skill, MabiPacket packet)
{
if (creature.Temp.SkillItem1 == null || creature.Temp.SkillItem2 == null)
return SkillResults.Failure;
var part = packet.GetInt();
// Regular
if (packet.GetElementType() == ElementType.Short)
{
var x = packet.GetShort();
var y = packet.GetShort();
Send.SkillUseDye(creature.Client, creature, skill.Id, part, x, y);
}
// Fixed
else if (packet.GetElementType() == ElementType.Byte)
{
var unk = packet.GetByte();
Send.SkillUseDye(creature.Client, creature, skill.Id, part, unk);
}
return SkillResults.Okay;
}