本文整理汇总了C#中Aura.World.Network.WorldClient.GetCreatureOrNull方法的典型用法代码示例。如果您正苦于以下问题:C# WorldClient.GetCreatureOrNull方法的具体用法?C# WorldClient.GetCreatureOrNull怎么用?C# WorldClient.GetCreatureOrNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aura.World.Network.WorldClient
的用法示例。
在下文中一共展示了WorldClient.GetCreatureOrNull方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleMoonGateUse
private void HandleMoonGateUse(WorldClient client, MabiPacket packet)
{
var character = client.GetCreatureOrNull(packet.Id) as MabiPC;
if(character == null)
goto L_Fail;
var source = packet.GetString();
var target = packet.GetString();
// Check gates
MoonGate sGate, tGate;
_gates.TryGetValue(source, out sGate);
_gates.TryGetValue(target, out tGate);
if (sGate == null || tGate == null || sGate.Prop.State == "closed")
goto L_Fail;
// Check range to source
if (character.Region != sGate.Region || !WorldManager.InRange(character, sGate.X, sGate.Y, 1000))
goto L_Fail;
// Check if char has target
if (!character.Keywords.Contains(tGate.KeywordId) && !_freeRoaming && !character.Keywords.Contains(10142))
goto L_Fail;
client.Warp(tGate.Region, tGate.X, tGate.Y);
client.Send(new MabiPacket(Op.MoonGateUseR, client.Character.Id).PutByte(true));
return;
L_Fail:
client.Send(new MabiPacket(Op.MoonGateUseR, client.Character.Id).PutByte(false));
}