本文整理汇总了C#中WorldServer.player.Player.setEntityFocus方法的典型用法代码示例。如果您正苦于以下问题:C# Player.setEntityFocus方法的具体用法?C# Player.setEntityFocus怎么用?C# Player.setEntityFocus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorldServer.player.Player
的用法示例。
在下文中一共展示了Player.setEntityFocus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: interactWithAliMorissaae
public static void interactWithAliMorissaae(Player p, Npc n)
{
p.setEntityFocus(n.getClientIndex());
AreaEvent interactWithAliMorissaaeAreaEvent = new AreaEvent(p, n.getLocation().getX() - 1, n.getLocation().getY() - 1, n.getLocation().getX() + 1, n.getLocation().getY() + 1);
interactWithAliMorissaaeAreaEvent.setAction(() => {
n.setFaceLocation(p.getLocation());
p.setFaceLocation(n.getLocation());
p.setEntityFocus(65535);
showAliDialogue(p, 205);
});
Server.registerCoordinateEvent(interactWithAliMorissaaeAreaEvent);
}
示例2: interactWithBoatNPC
public static bool interactWithBoatNPC(Player p, Npc n)
{
int id = n.getId();
if (id != 4540 && id != 1304 && id != 2436 && id != 3781 && id != 1361 && id != 4962) {
return false;
}
p.setEntityFocus(n.getClientIndex());
AreaEvent interactWithBoatNPCAreaEvent = new AreaEvent(p, n.getLocation().getX() - 1, n.getLocation().getY() - 1, n.getLocation().getX() + 1, n.getLocation().getY() + 1);
interactWithBoatNPCAreaEvent.setAction(() => {
n.setFaceLocation(p.getLocation());
p.setFaceLocation(n.getLocation());
p.setEntityFocus(65535);
switch(n.getId()) {
case 4540: // Home boat
showBentleyDialogue(p, 240);
break;
case 1304: // Canifis sailor
showCanifisSailorDialogue(p, 280);
break;
case 2436: // Waterbirth isle
showJarvaldDialogue(p, 300);
break;
case 3781: // Pest control squire
showSquireDialogue(p, 340);
break;
case 1361: // Warrior guild
showArnorDialogue(p, 370);
break;
case 4962: // fremmenik shore
showCaptainBarnabyDialogue(p, 410);
break;
}
});
Server.registerCoordinateEvent(interactWithBoatNPCAreaEvent);
return true;
}
示例3: talkToBob
public static void talkToBob(Player p, Npc npc, int item, int option)
{
p.setEntityFocus(npc.getClientIndex());
AreaEvent talkToBobAreaEvent = new AreaEvent(p, npc.getLocation().getX() - 1, npc.getLocation().getY() - 1, npc.getLocation().getX() + 1, npc.getLocation().getY() + 1);
talkToBobAreaEvent.setAction(() => {
npc.setFaceLocation(p.getLocation());
p.setFaceLocation(npc.getLocation());
p.setEntityFocus(65535);
if (option == 0) { // use item on bob
if (item > 0) {
p.setTemporaryAttribute("bobsAxesBarrowItem", item);
showBobDialogue(p, 101);
}
} else if (option == 1) { // talk
showBobDialogue(p, 107);
} else if (option == 2) { // trade
p.setShopSession(new ShopSession(p, 4));
}
});
Server.registerCoordinateEvent(talkToBobAreaEvent);
}