private void UpdateView() { fDisciplinesList.Items.BeginUpdate(); fDisciplinesList.Items.Clear(); NWCreature clt = fCollocutor; Player p = GlobalVars.nwrGame.Player; for (int i = 0; i < StaticData.dbTeachable.Length; i++) { int id = StaticData.dbTeachable[i].Id; bool res = false; TeachableKind kind = StaticData.dbTeachable[i].Kind; string s = ""; int imageIndex = -1; int curLev = 0; switch (kind) { case TeachableKind.Ability: AbilityRec abRec = StaticData.dbAbilities[id]; AbilityID ab = (AbilityID)id; if (clt.GetAbility(ab) > 0) { s = BaseLocale.GetStr(abRec.Name); imageIndex = -1; curLev = p.GetAbility(ab); res = (curLev < clt.GetAbility(ab)); } break; case TeachableKind.Skill: SkillRec skRec = StaticData.dbSkills[id]; SkillID sk = (SkillID)id; if (clt.GetSkill(sk) >= 0) { s = BaseLocale.GetStr(skRec.Name); imageIndex = skRec.ImageIndex; curLev = p.GetSkill(sk); res = (curLev < clt.GetSkill(sk)); } break; } int price = (int)GlobalVars.nwrGame.GetTeachablePrice(i, curLev); if (res) { string st = " ( " + Convert.ToString(curLev) + " -> " + Convert.ToString(curLev + 1) + " )"; LBItem listItem = fDisciplinesList.Items.Add(s + st, new TeachItem(i, curLev, price)); if (price > p.Money) { listItem.Color = Colors.Red; } else { listItem.Color = Colors.Gold; } listItem.ImageIndex = imageIndex; listItem.SubItems.Add(Convert.ToString(price), null); } } fDisciplinesList.Items.EndUpdate(); }