public ItemEquipment(ItemEquipmentInstance _instanceData) { try { this.instanceData = _instanceData; equipmentInstanceData = _instanceData; //Debug.Log("ItemEquipment(id=" + _instanceData.templeId+")"); if (!ItemEquipmentData.dataMap.ContainsKey(_instanceData.templeId)) { Debug.Log("OMG!!!!"); } templateData = ItemEquipmentData.dataMap[_instanceData.templeId]; //templateData = new ItemEquipmentData(); equipmentTemplateData = (ItemEquipmentData)templateData; //Debug.Log("quality:" + quality + ",vocation:" + vocation + ",type:" + type + "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); level = levelNeed; } catch (System.Exception e) { Debug.Log(e); } }
ItemEquipment GetItemEquipmentByInstance(ItemInstance instance) { ItemEquipmentInstance equipInstance = new ItemEquipmentInstance() { id = instance.id, bagType = instance.bagType, bindingType = instance.bindingType, stack = instance.stack, templeId = instance.templeId, gridIndex = instance.gridIndex, sourceKey = instance.sourceKey, sourceValue = instance.sourceValue, }; if (instance.extendInfo != null) { //Mogo.Util.LoggerHelper.Debug("instance.extendInfo:" + instance.extendInfo); if (instance.extendInfo.ContainsKey(0)) { //Mogo.Util.LoggerHelper.Debug("instance.extendInfo:" + instance.extendInfo["lock"]); equipInstance.locked = (instance.extendInfo[0] == 0 ? false : true); } if (instance.extendInfo.ContainsKey(1)) { //Mogo.Util.LoggerHelper.Debug("instance.extendInfo:" + instance.extendInfo["lock"]); equipInstance.isActive = (instance.extendInfo[1] == 0 ? false : true); } } //slot表示格式转换,dic->list equipInstance.jewelSlots = new List<int>(); LoggerHelper.Debug("instance.templeId:" + instance.templeId); ItemEquipmentData equip = ItemEquipmentData.dataMap[instance.templeId]; if (equip.jewelSlot != null && equip.jewelSlot.Count > 0) { if (equip.jewelSlot[0] != -1) { for (int i = 0; i < equip.jewelSlot.Count; i++) { equipInstance.jewelSlots.Add(-1); } } } if (instance.jewelSlots != null) { foreach (KeyValuePair<int, int> pair in instance.jewelSlots) { equipInstance.jewelSlots[pair.Key - 1] = pair.Value; } } return new ItemEquipment(equipInstance); }
private void InitData() { //通知服务器,客户端需要初始化数据 List<ItemParentInstance> list = new List<ItemParentInstance>(); if (ServerProxy.Instance.GetType() == typeof(LocalProxy)) { //4个宝石,2个已插,2个放背包 ItemParentInstance item7 = new ItemJewelInstance() { templeId = 1411031, gridIndex = 0, stack = 2, bagType = ITEM_TYPE_JEWEL }; ItemParentInstance item8 = new ItemJewelInstance() { templeId = 1411041, gridIndex = 3, stack = 3, bagType = ITEM_TYPE_JEWEL }; List<int> jewelSlots = new List<int>(); jewelSlots.Add(-1); ItemParentInstance item1; ItemParentInstance item2; // 为去除警告暂时屏蔽以下代码 //ItemParentInstance item3; //ItemParentInstance item4; ItemParentInstance item5; //4个装备 switch (myself.vocation) { case Vocation.Warrior: item1 = new ItemEquipmentInstance() { templeId = 1311015, gridIndex = 0, jewelSlots = jewelSlots, bagType = ITEM_TYPE_EQUIPMENT }; //item2 = new ItemEquipmentInstance() { templeId = 12101102, gridIndex = 1, bagType = ITEM_TYPE_EQUIPMENT }; //item3 = new ItemEquipmentInstance() { templeId = 12101103, gridIndex = 2, bagType = ITEM_TYPE_EQUIPMENT }; //item4 = new ItemEquipmentInstance() { templeId = 12101104, gridIndex = 3, bagType = ITEM_TYPE_EQUIPMENT }; item5 = new ItemEquipmentInstance() { templeId = 1321015, gridIndex = 4, bagType = ITEM_TYPE_EQUIPMENT }; list.Add(item1); //list.Add(item2); //list.Add(item3); //list.Add(item4); list.Add(item5); break; case Vocation.Assassin: item1 = new ItemEquipmentInstance() { templeId = 1331015, gridIndex = 0, jewelSlots = jewelSlots, bagType = ITEM_TYPE_EQUIPMENT }; item2 = new ItemEquipmentInstance() { templeId = 1341015, gridIndex = 1, bagType = ITEM_TYPE_EQUIPMENT }; list.Add(item1); list.Add(item2); break; case Vocation.Archer: item1 = new ItemEquipmentInstance() { templeId = 1371015, gridIndex = 0, jewelSlots = jewelSlots, bagType = ITEM_TYPE_EQUIPMENT }; item2 = new ItemEquipmentInstance() { templeId = 1381015, gridIndex = 1, jewelSlots = jewelSlots, bagType = ITEM_TYPE_EQUIPMENT }; list.Add(item1); list.Add(item2); break; } list.Add(item7); list.Add(item8); } _InitData(list); LoggerHelper.Debug("InventoryReq"); myself.RpcCall("InventoryReq"); }
public ItemEquipment(ItemEquipmentInstance _instanceData) { try { this.instanceData = _instanceData; equipmentInstanceData = _instanceData; LoggerHelper.Debug("id:" + _instanceData.templeId); if (!ItemEquipmentData.dataMap.ContainsKey(_instanceData.templeId)) LoggerHelper.Debug("OMG!!!!"); templateData = ItemEquipmentData.dataMap[_instanceData.templeId]; //templateData = new ItemEquipmentData(); equipmentTemplateData = (ItemEquipmentData)templateData; //LoggerHelper.Debug("quality:" + quality + ",vocation:" + vocation + ",type:" + type + "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); level = levelNeed; } catch (System.Exception e) { LoggerHelper.Debug(e); } }