本文整理汇总了C#中WorldServer.player.Player.setShopSession方法的典型用法代码示例。如果您正苦于以下问题:C# Player.setShopSession方法的具体用法?C# Player.setShopSession怎么用?C# Player.setShopSession使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorldServer.player.Player
的用法示例。
在下文中一共展示了Player.setShopSession方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: execute
public void execute(Player player, string[] arguments)
{
if (arguments.Length > 0)
{
int shopIndex = 0;
if (!int.TryParse(arguments[0], out shopIndex))
{
player.getPackets().sendMessage("[OpenShop command]: ::shop shop_number or just ::shop to open first one.");
return;
}
Shop shop = Server.getShopManager().getShop(shopIndex);
if (shop == null)
{
player.getPackets().sendMessage("[OpenShop command]: shop #" + shopIndex + " doesn't exist on server");
return;
}
player.setShopSession(new ShopSession(player, shopIndex));
}
player.setShopSession(new ShopSession(player, 1));
}
示例2: 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);
}