本文整理匯總了C#中WCell.RealmServer.Entities.NPC.Delete方法的典型用法代碼示例。如果您正苦於以下問題:C# NPC.Delete方法的具體用法?C# NPC.Delete怎麽用?C# NPC.Delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WCell.RealmServer.Entities.NPC
的用法示例。
在下文中一共展示了NPC.Delete方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SeekForgiveness
/// <summary>
/// Move to the killer and pleed
/// </summary>
/// <param name="ambusher"></param>
/// <param name="killer"></param>
private static void SeekForgiveness(NPC ambusher, Character killer)
{
if (killer.IsInWorld &&
killer.IsAlive &&
killer.Map == ambusher.Map &&
killer.IsInRadius(ambusher, MaxForgivenessDistance))
{
// make sure we are using the right means of transportation
if (killer.IsFlying)
{
ambusher.Mount(MountId.FlyingBroom); // probably won't display correctly
ambusher.Movement.MoveType = AIMoveType.Fly;
}
else
{
ambusher.Dismount();
ambusher.Movement.MoveType = AIMoveType.Walk;
}
// go to killer
ambusher.MoveInFrontThenExecute(killer, mover => {
mover.StandState = StandState.Kneeling;
mover.Say("I beg thee for forgiveness!");
});
}
else
{
// killer is not in reach anymore
ambusher.Say("Sigh!");
ambusher.Delete();
}
}