本文整理汇总了C#中RunescapeServer.player.Player.setShopSession方法的典型用法代码示例。如果您正苦于以下问题:C# Player.setShopSession方法的具体用法?C# Player.setShopSession怎么用?C# Player.setShopSession使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RunescapeServer.player.Player
的用法示例。
在下文中一共展示了Player.setShopSession方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: interactTzhaarNPC
public static bool interactTzhaarNPC(Player p, Npc n, int option) {
if (n.getId() != 2622 && n.getId() != 2620 && n.getId() != 2623 && n.getId() != 2619 && n.getId() != 2617 && n.getId() != 2618) {
return false;
}
p.setEntityFocus(n.getClientIndex());
int npcX = n.getLocation().getX();
int npcY = n.getLocation().getY();
AreaEvent interactTzhaarNpcAreaEvent = new AreaEvent(p, npcX-1, npcY-1, npcX+1, npcY+1);
interactTzhaarNpcAreaEvent.setAction(() => {
p.setFaceLocation(n.getLocation());
p.setEntityFocus(65535);
switch(n.getId()) {
case 2619: // Bankers
if (option == 1) { // Talk
} else if (option == 2) { // Bank
p.getBank().openBank();
} else if (option == 3) { // Collect
}
break;
//TODO tzhaar stores
case 2622: // Ore shop
if (option == 1) { // Speak
} else if (option == 2) { // Trade
p.setShopSession(new ShopSession(p, 3));
}
break;
}
});
Server.registerCoordinateEvent(interactTzhaarNpcAreaEvent);
return true;
}
示例2: 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));
}
示例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);
}
示例4: interactWithAubury
public static void interactWithAubury(Player p, Npc n, int option) {
p.setEntityFocus(n.getClientIndex());
AreaEvent interactWithAuburyAreaEvent = new AreaEvent(p, n.getLocation().getX() - 1, n.getLocation().getY() - 1, n.getLocation().getX() + 1, n.getLocation().getY() + 1);
interactWithAuburyAreaEvent.setAction(() => {
n.setFaceLocation(p.getLocation());
p.setFaceLocation(n.getLocation());
p.setEntityFocus(65535);
switch(option) {
case 1: // talk to
break;
case 2: // trade
p.setShopSession(new ShopSession(p, 3));
break;
case 3: // teleport
RuneCraft.teleportToEssMine(p, n);
break;
}
});
Server.registerCoordinateEvent(interactWithAuburyAreaEvent);
}