当前位置: 首页>>代码示例>>C#>>正文


C# Player.setShopSession方法代码示例

本文整理汇总了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;
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:35,代码来源:TzHaar.cs

示例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));
        }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:21,代码来源:OpenShop.cs

示例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);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:20,代码来源:BrokenBarrows.cs

示例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);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:23,代码来源:HomeArea.cs


注:本文中的RunescapeServer.player.Player.setShopSession方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。