コード例 #1
0
        public short   Unknown; //14 a 15 = 2

        public static void controller(Client client, P_27B p_27b)
        {
            SMob npc = Config.MobList.Where(a => a.Mob.ClientId == p_27b.npcID).FirstOrDefault().Mob;

            if (npc.Merchant == (short)NpcMerchant.Skill)
            {
                client.Send(P_17C.New(npc, ShopType.Skill));
            }
            else
            {
                client.Send(P_17C.New(npc, ShopType.Normal));
            }
        }
コード例 #2
0
        public int      Tax;            //231 a 235     = 4

        public static P_17C New(SMob mob, ShopType janela)
        {
            P_17C tmp = new P_17C
            {
                Header    = SHeader.New(0x017c, Marshal.SizeOf <P_17C>(), mob.ClientId),
                ShopType  = janela,
                Inventory = new SItem[27],
                Tax       = 5,
            };

            int count = 0;

            SItem[] inventario = mob.Inventory.Where(a => a.Id != 0).ToArray();
            if (janela == ShopType.Skill)
            {
                for (int i = 0; i < inventario.Length; i++)
                {
                    if (i == 8 || i == 16)
                    {
                        tmp.Inventory[i + count] = new SItem();
                        count = count + 1;
                        tmp.Inventory[i + count] = inventario[i];
                    }
                    else
                    {
                        tmp.Inventory[i + count] = inventario[i];
                    }
                }
            }
            else
            {
                for (int i = 0; i < inventario.Length; i++)
                {
                    tmp.Inventory[i] = inventario[i];
                }
            }

            return(tmp);
        }