當前位置: 首頁>>代碼示例>>C#>>正文


C# Player.setShopSession方法代碼示例

本文整理匯總了C#中RS2.Server.player.Player.setShopSession方法的典型用法代碼示例。如果您正苦於以下問題:C# Player.setShopSession方法的具體用法?C# Player.setShopSession怎麽用?C# Player.setShopSession使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在RS2.Server.player.Player的用法示例。


在下文中一共展示了Player.setShopSession方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: 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:ramatronics,項目名稱:rsps,代碼行數:26,代碼來源:HomeArea.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:ramatronics,項目名稱:rsps,代碼行數:21,代碼來源:OpenShop.cs

示例3: 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:ramatronics,項目名稱:rsps,代碼行數:44,代碼來源:TzHaar.cs

示例4: 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:ramatronics,項目名稱:rsps,代碼行數:28,代碼來源:BrokenBarrows.cs


注:本文中的RS2.Server.player.Player.setShopSession方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。