public rdOption(int index, bool remelt, eOptGrade grade, eOption option, float value) { Index = index; Remelt = remelt; Grade = grade; Kind = option; Value = value; }
public void GetItemWithBoss(fmDropItem fdi, eOption selecedOpt, out rdItem item) { int lv = fdi.Lv; eGrade grade = fdi.Grade; eParts parts = fdi.Parts; item = new rdItem(); item.Lv = lv; item.Grade = grade; item.Parts = parts; item.BaseOpt = new List <rdOption>(); item.AddOpts = new List <rdOption>(); GetBaseOpt(item); List <eOption> temp = GetList(eGrade.Normal, parts, lv); int cnt = GetOptionCount(grade); //Console.WriteLine(cnt); for (int i = 0; i < cnt; ++i) { int hit = m_random.Next(0, temp.Count); eOption kind = temp.ElementAt(hit); eOptGrade cc = (eOptGrade)((int)kind >> 8); rdOption option = new rdOption(i + 1, false, GetOptGrade(kind), kind, GetValue(lv, kind)); item.AddOpts.Add(option); temp.RemoveAt(hit); if (cc == eOptGrade.Normal) { eOption remove = (eOption)((int)kind + ((int)eOptGrade.Normal << 8)); temp.Remove(remove); } else if (cc == eOptGrade.Epic) { eOption remove = (eOption)((int)kind - ((int)eOptGrade.Normal << 8)); temp.Remove(remove); } // eOptCategory } if (eGrade.Legend <= grade) { eOptGrade optGrade = GetLegendSetOptGrade(grade); //Console.WriteLine(optGrade); eOption kind = selecedOpt; rdOption option = new rdOption(cnt + 1, false, optGrade, kind, GetValue(lv, kind)); item.AddOpts.Add(option); } }
private eOptGrade GetOptGrade(eOption opt) { // eOptCategory eOptGrade cc = (eOptGrade)((int)opt >> 8); return(cc); //if (cc == eOptGrade.Normal) return eGrade.Normal; //else if (cc == eOptGrade.Epic) return eGrade.Epic; //else if (cc == eOptGrade.Legend) return eGrade.Legend; //else if (cc == eOptGrade.Set) return eGrade.Set; //else return eGrade.Normal; }
public bool Load(fmDataTable table) { Dictionary <int, fmDataOption> dic = table.Find <fmDataOption>(eFmDataType.Option); if (null == dic) { return(false); } //m_optList.Add(eParts.Weapon, new List<eOption>()); //m_optList.Add(eParts.Necklace, new List<eOption>()); //m_optList.Add(eParts.Ring, new List<eOption>()); //m_optList.Add(eParts.Belt, new List<eOption>()); //m_optList.Add(eParts.Gloves, new List<eOption>()); //m_optList.Add(eParts.Pants, new List<eOption>()); //m_optList.Add(eParts.Armor, new List<eOption>()); //m_optList.Add(eParts.Head, new List<eOption>()); //m_optList.Add(eParts.Jewel, new List<eOption>()); foreach (var node in dic) { int lv = node.Value.m_nAppearLv; eOption opt = node.Value.m_eOption; eOptGrade optGrade = (eOptGrade)((int)opt >> 8); foreach (var beyond in node.Value.m_nArrBeyond) { if ((eBeyond)beyond == eBeyond.Mythic) { int cnt = node.Value.m_nArrParts.Length; for (int i = 0; i < cnt; ++i) { eParts parts = (eParts)node.Value.m_nArrParts[i]; if (false == m_optList.ContainsKey(parts)) { m_optList.Add(parts, new List <eOption>()); } m_optList[parts].Add(opt); } } } } return(true); }
public bool Load(fmDataTable table) { Dictionary <int, fmDataOption> dic = table.Find <fmDataOption>(eFmDataType.Option); if (null == dic) { return(false); } m_optList.Add(eGrade.Normal, new Dictionary <int, Dictionary <eParts, List <eOption> > >()); m_optList.Add(eGrade.Legend, new Dictionary <int, Dictionary <eParts, List <eOption> > >()); m_optList.Add(eGrade.Set, new Dictionary <int, Dictionary <eParts, List <eOption> > >()); foreach (var node in dic) { int lv = node.Value.m_nAppearLv; if (false == m_nLvRange.Contains(lv)) { m_nLvRange.Add(lv); } foreach (var item in m_optList) { if (false == item.Value.ContainsKey(lv)) { item.Value.Add(lv, new Dictionary <eParts, List <eOption> >()); item.Value[lv].Add(eParts.Weapon, new List <eOption>()); item.Value[lv].Add(eParts.Necklace, new List <eOption>()); item.Value[lv].Add(eParts.Ring, new List <eOption>()); item.Value[lv].Add(eParts.Belt, new List <eOption>()); item.Value[lv].Add(eParts.Gloves, new List <eOption>()); item.Value[lv].Add(eParts.Pants, new List <eOption>()); item.Value[lv].Add(eParts.Armor, new List <eOption>()); item.Value[lv].Add(eParts.Head, new List <eOption>()); item.Value[lv].Add(eParts.Jewel, new List <eOption>()); } } } foreach (var node in dic) { int lv = node.Value.m_nAppearLv; eOption opt = node.Value.m_eOption; eOptGrade optGrade = (eOptGrade)((int)opt >> 8); foreach (var beyond in node.Value.m_nArrBeyond) { if ((eBeyond)beyond == eBeyond.None) { int cnt = node.Value.m_nArrParts.Length; for (int i = 0; i < cnt; ++i) { eParts parts = (eParts)node.Value.m_nArrParts[i]; if (optGrade < eOptGrade.Legend) { foreach (var list in m_optList[eGrade.Normal]) { if (lv <= list.Key) { list.Value[parts].Add(opt); } } } else if (eOptGrade.Legend == optGrade) { foreach (var list in m_optList[eGrade.Legend]) { if (lv <= list.Key) { list.Value[parts].Add(opt); } } } else if (eOptGrade.Set == optGrade) { foreach (var list in m_optList[eGrade.Set]) { if (lv <= list.Key) { list.Value[parts].Add(opt); } } } } } } } m_nLvRange = m_nLvRange.OrderBy(x => x).ToList(); return(true); }
public eErrorCode Remelt(ref rdItem remeltItem, int optIndex, eOption selectedOpt) { if (null == remeltItem) { return(eErrorCode.Auth_PleaseLogin); } eOption kind = selectedOpt; eOptGrade cc = (eOptGrade)((int)kind >> 8); eOption normKind = eOption.None; eOption epicKind = eOption.None; if (cc == eOptGrade.Normal) { normKind = kind; epicKind = (eOption)((int)kind + ((int)eOptGrade.Normal << 8)); } else if (cc == eOptGrade.Epic) { normKind = (eOption)((int)kind - ((int)eOptGrade.Normal << 8)); epicKind = kind; } rdOption remeltOpt = null; foreach (var node in remeltItem.AddOpts) { if (node.Index == optIndex) { remeltOpt = node; } else { if (true == node.Remelt) { return(eErrorCode.Item_Remelt_AlreadyOther); } else { if (node.Kind == normKind) { return(eErrorCode.Item_AlreadySameOpt); } if (node.Kind == epicKind) { return(eErrorCode.Item_AlreadySameOpt); } } } } if (null == remeltOpt) { return(eErrorCode.Params_InvalidParam); } remeltOpt.Remelt = true; Logger.Debug("optIndex {0}", optIndex); Logger.Debug("remeltOpt.Grade {0}", remeltOpt.Grade); if (eOptGrade.Legend == remeltOpt.Grade || eOptGrade.Set == remeltOpt.Grade) { return(eErrorCode.Item_OutOfType); } remeltOpt.Kind = selectedOpt; remeltOpt.Grade = GetOptGrade(selectedOpt); if (eBeyond.None == remeltItem.Beyond) { remeltOpt.Value = GetValue(remeltItem.Lv, remeltOpt.Kind); } else { remeltOpt.Value = GetAncientValue(remeltItem.Lv, remeltOpt.Kind); } return(eErrorCode.Success); }
private void GetBaseOpt(rdItem item) { eOptGrade grade = eOptGrade.Normal; // 무기 if (item.Parts == eParts.Weapon) { //item.Code = GetWeaponCode(); float min = 0; float max = 0; float speed = 0; item.Code = GetWeapon(item.Lv, out min, out max, out speed); // 1. 무기 최소 공격력 { eOption select = eOption.BWDMin; //float value = 0; //GetBaseValue(item.Lv, select, out value); rdOption option = new rdOption(1, false, grade, select, min); item.BaseOpt.Add(option); } // 2. 무기 최대 공격력 { eOption select = eOption.BWDMax; //float value = 0; //GetBaseValue(item.Lv, select, out value); rdOption option = new rdOption(2, false, grade, select, max); item.BaseOpt.Add(option); } // 4. 공속 { eOption select = eOption.AS; //float value = 0; //GetBaseValue(item.Lv, select, out value); rdOption option = new rdOption(3, false, grade, select, speed); item.BaseOpt.Add(option); } // 3. 속성 { eOption select = eOption.Element; float value = 0f; { int b = (int)eElement.None; int e = 1 + (int)eElement.Nature; value = m_random.Next(b, e); } rdOption option = new rdOption(4, false, grade, select, value); item.BaseOpt.Add(option); } } else { // 기타 { eOption select = eOption.None; float value = 0; int code = 0; GetBaseValue(item.Lv, item.Parts, out select, out value, out code); rdOption option = new rdOption(1, false, grade, select, value); item.Code = code; item.BaseOpt.Add(option); } } }