private void _showRequirements(Skill skill) { m_showingRequirements = true; ClearItemList(); List<string> drawStrings = new List<string>(15) { ((SpellRecord) World.Instance.ESF.Data[skill.ID]).Name + (skill.ClassReq > 0 ? " [" + ((ClassRecord) World.Instance.ECF.Data[skill.ClassReq]).Name + "]" : ""), " " }; if (skill.SkillReq.Any(x => x != 0)) { drawStrings.AddRange(from req in skill.SkillReq where req != 0 select World.GetString(DATCONST2.SKILLMASTER_WORD_SKILL) + ": " + ((SpellRecord) World.Instance.ESF.Data[req]).Name); drawStrings.Add(" "); } if(skill.StrReq > 0) drawStrings.Add(skill.StrReq + " " + World.GetString(DATCONST2.SKILLMASTER_WORD_STRENGTH)); if (skill.IntReq > 0) drawStrings.Add(skill.IntReq + " " + World.GetString(DATCONST2.SKILLMASTER_WORD_INTELLIGENCE)); if (skill.WisReq > 0) drawStrings.Add(skill.WisReq + " " + World.GetString(DATCONST2.SKILLMASTER_WORD_WISDOM)); if (skill.AgiReq > 0) drawStrings.Add(skill.AgiReq + " " + World.GetString(DATCONST2.SKILLMASTER_WORD_AGILITY)); if (skill.ConReq > 0) drawStrings.Add(skill.ConReq + " " + World.GetString(DATCONST2.SKILLMASTER_WORD_CONSTITUTION)); if (skill.ChaReq > 0) drawStrings.Add(skill.ChaReq + " " + World.GetString(DATCONST2.SKILLMASTER_WORD_CHARISMA)); drawStrings.Add(" "); drawStrings.Add(skill.LevelReq + " " + World.GetString(DATCONST2.SKILLMASTER_WORD_LEVEL)); drawStrings.Add(skill.GoldReq + " " + World.Instance.EIF.GetItemRecordByID(1).Name); foreach (string s in drawStrings) { ListDialogItem nextLine = new ListDialogItem(this, ListDialogItem.ListItemStyle.Small) { Text = s }; AddItemToList(nextLine, false); } }
private void _showRequirementsLabel(Skill skill) { string full = string.Format("{0} {1} LVL, ", ((SpellRecord)World.Instance.ESF.Data[skill.ID]).Name, skill.LevelReq); if (skill.StrReq > 0) full += string.Format("{0} STR, ", skill.StrReq); if (skill.IntReq > 0) full += string.Format("{0} INT, ", skill.IntReq); if (skill.WisReq > 0) full += string.Format("{0} WIS, ", skill.WisReq); if (skill.AgiReq > 0) full += string.Format("{0} AGI, ", skill.AgiReq); if (skill.ConReq > 0) full += string.Format("{0} CON, ", skill.ConReq); if (skill.ChaReq > 0) full += string.Format("{0} CHA, ", skill.ChaReq); if (skill.GoldReq > 0) full += string.Format("{0} Gold", skill.GoldReq); if (skill.ClassReq > 0) full += string.Format(", {0}", ((ClassRecord) World.Instance.ECF.Data[skill.ClassReq]).Name); ((EOGame)Game).Hud.SetStatusLabel(DATCONST2.STATUS_LABEL_TYPE_INFORMATION, full); }
private void _learn(Skill skill) { Character c = World.Instance.MainPlayer.ActiveCharacter; bool skillReqsMet = true; foreach(short x in skill.SkillReq) if (x != 0 && c.Spells.FindIndex(_sp => _sp.id == x) < 0) skillReqsMet = false; //check the requirements if (c.Stats.Str < skill.StrReq || c.Stats.Int < skill.IntReq || c.Stats.Wis < skill.WisReq || c.Stats.Agi < skill.AgiReq || c.Stats.Con < skill.ConReq || c.Stats.Cha < skill.ChaReq || c.Stats.Level < skill.LevelReq || c.Inventory.Find(_ii => _ii.id == 1).amount < skill.GoldReq || !skillReqsMet) { EOMessageBox.Show(DATCONST1.SKILL_LEARN_REQS_NOT_MET, XNADialogButtons.Ok, EOMessageBoxStyle.SmallDialogSmallHeader); return; } if (skill.ClassReq > 0 && c.Class != skill.ClassReq) { EOMessageBox.Show(DATCONST1.SKILL_LEARN_WRONG_CLASS, " " + ((ClassRecord)World.Instance.ECF.Data[skill.ClassReq]).Name + "!", XNADialogButtons.Ok, EOMessageBoxStyle.SmallDialogSmallHeader); return; } EOMessageBox.Show(DATCONST1.SKILL_LEARN_CONFIRMATION, " " + ((SpellRecord)World.Instance.ESF.Data[skill.ID]).Name + "?", XNADialogButtons.OkCancel, EOMessageBoxStyle.SmallDialogSmallHeader, (o, e) => { if (e.Result != XNADialogResult.OK) return; if (!m_api.LearnSpell(skill.ID)) { Close(); ((EOGame)Game).DoShowLostConnectionDialogAndReturnToMainMenu(); } }); }