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


C# Player.setShopSession方法代碼示例

本文整理匯總了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));
        }
開發者ID:Krill156,項目名稱:SharpEMU,代碼行數:21,代碼來源:OpenShop.cs

示例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);
 }
開發者ID:Krill156,項目名稱:SharpEMU,代碼行數:21,代碼來源:BrokenBarrows.cs


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