public void RefreshItem(int bagType, Item _item) { X_GUID _tempData = new X_GUID(); _tempData.GUID_value = _item.key; BaseItem pData = FindItem(bagType, _tempData); if (pData != null) { pData.SetItemTableID(_item.id); pData.SetItemCount(_item.number); /*pData.SetItemTimesCount(_item.timer);*/ RefreshItemTimesCount(bagType, _item.id, _item.timer); if (pData.GetItemType() == (int)EM_ITEM_TYPE.EM_ITEM_TYPE_RUNE) { ItemEquip equip = pData as ItemEquip; EquipItemData Itemdata = new EquipItemData(); Itemdata.unmarshal(OctetsStream.wrap(_item.extdata)); equip.InitRuneData(Itemdata); } } else { AddItem(bagType, _item); m_NewGetItems.Add(_tempData); } _tempData = null; }
public void AddItem(int bagType, Item _item) { BaseItem item = CreateItem(_item.id); if (item != null) { item.SetItemTableID(_item.id); item.SetItemGuid(_item.key); item.SetItemCount(_item.number); item.SetItemTimesCount(_item.timer); if (m_ItemMapList.ContainsKey(bagType)) { m_ItemMapList[bagType].Add(item); //LogManager.Log("New Item Add:" + _item.id); if (item.GetItemType() == (int)EM_ITEM_TYPE.EM_ITEM_TYPE_RUNE) { ItemEquip equip = item as ItemEquip; equip.ResetEquipState(); EquipItemData Itemdata = new EquipItemData(); Itemdata.unmarshal(OctetsStream.wrap(_item.extdata)); equip.InitRuneData(Itemdata); } } else { LogManager.LogError(false); LogManager.LogToFile("Error:Try AddItem,But Nonexistent BagType Key" + bagType); } } }
public void RefreshData(EquipItemData _data) { m_BaseAttributeID[0] = _data.init1; m_BaseAttributeID[1] = _data.init2; m_BaseAttributeID[2] = _data.init3; m_AppendAttribute[0] = _data.attr1; m_AppendAttribute[1] = _data.attr2; m_AppendAttribute[2] = _data.attr3; m_AppendAttribute[3] = _data.attr4; }
public EquipItemData GetEquipItemData(uint id) { if (equipItemTable == null) { return(null); } EquipItemData equipItemData = equipItemTable.Get(id); if (equipItemData == null) { Log.TableError(this, id); equipItemData = new EquipItemData(); equipItemData.name = Log.NON_DATA_NAME; } return(equipItemData); }
public EquipItemData GetRootEquipTable() { EquipItemData equipItemData = GetBaseEquipTable(); if (equipItemData != null) { while (true) { EquipItemData baseEquipTable = equipItemData.GetBaseEquipTable(); if (baseEquipTable.id == equipItemData.id) { break; } equipItemData = baseEquipTable; } return(equipItemData); } return(null); }
public void InitRuneData(EquipItemData _data) { m_RuneData.RefreshData(_data); SetStrenghLevel(); }
public static bool cb(CSVReader csv_reader, EquipItemData data, ref uint key) { //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) data.id = key; csv_reader.Pop(ref data.appVer); csv_reader.Pop(ref data.type); csv_reader.Pop(ref data.getType); csv_reader.Pop(ref data.eventId); csv_reader.Pop(ref data.name); csv_reader.Pop(ref data.rarity); csv_reader.Pop(ref data.modelID0); data.modelID1 = data.modelID0; csv_reader.Pop(ref data.modelID1); string value = string.Empty; int num = -1; csv_reader.Pop(ref value); if (value.Length > 1) { num = (int)Enum.Parse(typeof(ELEMENT_TYPE), value); } if (!(bool)csv_reader.PopColor24(ref data.modelColor0)) { if (num != -1) { data.modelColor0 = NGUIMath.ColorToInt(MonoBehaviourSingleton <GlobalSettingsManager> .I.playerVisual.GetModelElementColor(num)); } else { data.modelColor0 = NGUIMath.ColorToInt(MonoBehaviourSingleton <GlobalSettingsManager> .I.playerVisual.modelBaseColor); } } csv_reader.PopColor24(ref data.modelColor1); if (!(bool)csv_reader.PopColor24(ref data.modelColor2)) { if (num != -1) { data.modelColor2 = NGUIMath.ColorToInt(MonoBehaviourSingleton <GlobalSettingsManager> .I.playerVisual.GetModelElementColor2(num)); } else { data.modelColor2 = NGUIMath.ColorToInt(MonoBehaviourSingleton <GlobalSettingsManager> .I.playerVisual.modelBaseColor2); } } csv_reader.Pop(ref data.effectID); data.effectParam = 1f; csv_reader.Pop(ref data.effectParam); if (!(bool)csv_reader.PopColor24(ref data.effectColor)) { if (num != -1) { data.effectColor = NGUIMath.ColorToInt(MonoBehaviourSingleton <GlobalSettingsManager> .I.playerVisual.GetModelElementColor(num)); } else { data.effectColor = NGUIMath.ColorToInt(MonoBehaviourSingleton <GlobalSettingsManager> .I.playerVisual.modelBaseColor); } } csv_reader.Pop(ref data.__iconID); csv_reader.Pop(ref data.maxLv); csv_reader.Pop(ref data.growID); csv_reader.Pop(ref data.needId); csv_reader.Pop(ref data.needUniqueId); csv_reader.Pop(ref data.exceedID); csv_reader.Pop(ref data.shadowEvolveEquipItemId); csv_reader.Pop(ref data.baseAtk); csv_reader.Pop(ref data.baseDef); csv_reader.Pop(ref data.baseHp); data.atkElement = new int[6]; data.defElement = new int[6]; for (int i = 0; i < 6; i++) { csv_reader.Pop(ref data.atkElement[i]); } for (int j = 0; j < 6; j++) { csv_reader.Pop(ref data.defElement[j]); } List <SkillItemTable.SkillSlotData> list = new List <SkillItemTable.SkillSlotData>(); int num2 = 0; int num3 = 0; for (int k = 0; k < 9; k++) { string value2 = string.Empty; uint value3 = 0u; csv_reader.Pop(ref value2); csv_reader.Pop(ref value3); if (!string.IsNullOrEmpty(value2)) { SkillItemTable.SkillSlotData skillSlotData = new SkillItemTable.SkillSlotData(); skillSlotData.slotType = (SKILL_SLOT_TYPE)(int)Enum.Parse(typeof(SKILL_SLOT_TYPE), value2); if (skillSlotData.slotType != 0) { skillSlotData.skill_id = value3; list.Add(skillSlotData); num3++; if (value3 != 0) { num2++; } } } } data._skillSlot = list.ToArray(); data.fixedSkillLength = num2; data.maxSlot = num3; int[] array = new int[3]; int[] array2 = new int[3]; int[] array3 = new int[3]; int num4 = 0; for (int l = 0; l < 3; l++) { csv_reader.Pop(ref array[l]); csv_reader.Pop(ref array2[l]); csv_reader.Pop(ref array3[l]); if (array[l] != 0 && array2[l] != 0) { num4++; } } data.fixedAbility = new EquipItem.Ability[num4]; for (int m = 0; m < num4; m++) { data.fixedAbility[m] = new EquipItem.Ability(); data.fixedAbility[m].id = array[m]; data.fixedAbility[m].pt = array2[m]; data.fixedAbility[m].vr = (0 < array3[m]); } csv_reader.Pop(ref data.sale); csv_reader.Pop(ref data.listId); string value4 = string.Empty; csv_reader.Pop(ref value4); data.obtained = new Obtained(value4); if (!(bool)csv_reader.Pop(ref data.damageDistanceId)) { if (data.type == EQUIPMENT_TYPE.ARROW) { data.damageDistanceId = 0; } else { data.damageDistanceId = -1; } } csv_reader.PopEnum(ref data.atkElementType, ELEMENT_TYPE.MAX); csv_reader.PopEnum(ref data.defElementType, ELEMENT_TYPE.MAX); csv_reader.Pop(ref data.isFormer); csv_reader.PopEnum(ref data.spAttackType, SP_ATTACK_TYPE.NONE); csv_reader.Pop(ref data.spAttackRate); csv_reader.Pop(ref data.evolveId); return(true); }