public void MoveItem(int fromPanel, int toPanel, UInt64 uuId, UInt64 uuOtherId) { sdMainChar mc = sdGameLevel.instance.mainChar; sdGameItem itemFrom = getItem(uuId); sdGameItem itemTo = getItem(uuOtherId); if (itemFrom != null) { itemFrom.bagIndex = toPanel; if (toPanel == 0) { itemDB.Remove(uuId); } } if (itemTo != null) { itemTo.bagIndex = fromPanel; } if (fromPanel == (int)PanelType.Panel_Bag) { //从背包穿装备.. if (toPanel == (int)PanelType.Panel_Equip) { if (itemTo != null) { itemTo.takeOff(mc); } if (itemFrom != null) { itemFrom.takeOn(mc); } } //出售装备.. else if (toPanel == 0) { } } else if (fromPanel == (int)PanelType.Panel_Equip) { if (itemFrom != null) { itemFrom.takeOff(mc); } Hashtable info = sdConfDataMgr.Instance().GetItemById(itemFrom.templateID.ToString()); sdGameItem dummy = mc.getStartItem(int.Parse(info["Character"].ToString())); if (dummy != null) { dummy.takeOnNake(mc); } } int type = 0; type |= fromPanel; type |= toPanel; sdSlotMgr.Instance.Notify(type); }
// 从装备属性表初始化装备aa public void SetItemInfo(Hashtable table) { if (table != null) { foreach (DictionaryEntry entry in table) { UInt64 itemID = UInt64.Parse(entry.Key.ToString()); sdGameItem item = entry.Value as sdGameItem; item.takeOn(this); } } }