Example #1
0
        public void onDelBagItem(UInt64 serialnum)
        {
            // cellCall("pickUpRequest", new object[] { id });
            Debug.LogWarning("del a item");
            KnapsakItem ki    = null;
            Byte        frame = 0;
            UInt16      index = 0;

            foreach (var v in KnapSackInfo.inst.allKanpItems)
            {
                foreach (var n in KnapSackInfo.inst.allKanpItems[v.Key])
                {
                    if (serialnum == n.Value.serialnum)
                    {
                        ki    = n.Value;
                        frame = v.Key;
                        index = n.Key;
                        break;
                    }
                }
            }
            KnapSackInfo.inst.allKanpItems[frame].Remove(index);
            Debug.LogWarning("del a item frame is " + frame + " index " + index);
            Event.fireOut("DelBagItem", new object[] { this, serialnum });
        }
Example #2
0
        public void onEquiptedItem(Dictionary <string, object> item)
        {
            Debug.LogWarning("get Equipted item " + item["name"] + " index is " + item["bagFrameIndex"] + " count " + item["count"] + " icon " + item["count"]);
            KnapsakItem bagItem = new KnapsakItem
            {
                serialnum     = (UInt64)item["serialnum"],
                tableId       = (UInt32)item["tableId"],
                name          = (string)item["name"],
                count         = (Byte)item["count"],
                altnasIndex   = (UInt32)item["altnasIndex"],
                bagFrameIndex = (Byte)item["bagFrameIndex"],
                bagItemIndex  = (UInt16)item["bagItemIndex"],
                icon          = (UInt32)item["icon"],
                modelId       = (UInt32)item["modelId"],
                stdMode       = (Byte)item["stdMode"],
                weight        = (Byte)item["weight"],
                func          = (Byte)item["func"],
                PA1           = (UInt16)item["PA1"],
                PA2           = (UInt16)item["PA2"],
                MA1           = (UInt16)item["MA1"],
                MA2           = (UInt16)item["MA2"],
                PD1           = (UInt16)item["PD1"],

                PD2       = (UInt16)item["PD2"],
                MD1       = (UInt16)item["MD1"],
                MD2       = (UInt16)item["MD2"],
                HP        = (UInt32)item["HP"],
                MP        = (UInt32)item["MP"],
                Accurate  = (Byte)item["Accurate"],
                lucky     = (Byte)item["lucky"],
                holiness  = (Byte)item["holiness"],
                HPgen     = (Byte)item["HPgen"],
                MPgen     = (Byte)item["MPgen"],
                crit      = (Byte)item["crit"],
                need      = (Byte)item["need"],
                needLevel = (Byte)item["needLevel"],
                price     = (UInt32)item["price"],
                stock     = (Byte)item["stock"],
                script    = (string)item["script"],
            };

            //KnapSackInfo.inst.allKanpItems.Add(bagItem.bagFrameIndex, )
            KnapSackInfo.inst.equipItems[bagItem.bagFrameIndex] = bagItem;
            Event.fireOut("EquiptedItem", new object[] { this, bagItem.bagFrameIndex });
        }