public static void GetTendency(item_template item, item_stat_tendency tendency) { switch (item.stat_type1) { case 3: case 4: case 16: case 17: case 19: case 20: case 28: case 29: case 37: case 38: case 39: case 44: tendency.AttackPower += item.stat_value1; break; case 21: case 30: case 45: tendency.SpellDamage += item.stat_value1; tendency.SpellHeal += item.stat_value1; break; case 5: case 18: case 42: case 47: tendency.SpellDamage += item.stat_value1; break; case 6: case 41: case 43: tendency.SpellHeal += item.stat_value1; break; case 1: case 7: case 12: case 13: case 14: case 15: case 35: case 46: case 48: tendency.Defense += item.stat_value1; break; default: break; } switch (item.stat_type2) { case 3: case 4: case 16: case 17: case 19: case 20: case 28: case 29: case 37: case 38: case 39: case 44: tendency.AttackPower += item.stat_value2; break; case 21: case 30: case 45: tendency.SpellDamage += item.stat_value1; tendency.SpellHeal += item.stat_value1; break; case 5: case 18: case 42: case 47: tendency.SpellDamage += item.stat_value2; break; case 6: case 41: case 43: tendency.SpellHeal += item.stat_value2; break; case 1: case 7: case 12: case 13: case 14: case 15: case 35: case 46: case 48: tendency.Defense += item.stat_value2; break; default: break; } switch (item.stat_type3) { case 3: case 4: case 16: case 17: case 19: case 20: case 28: case 29: case 37: case 38: case 39: case 44: tendency.AttackPower += item.stat_value3; break; case 21: case 30: case 45: tendency.SpellDamage += item.stat_value1; tendency.SpellHeal += item.stat_value1; break; case 5: case 18: case 42: case 47: tendency.SpellDamage += item.stat_value3; break; case 6: case 41: case 43: tendency.SpellHeal += item.stat_value3; break; case 1: case 7: case 12: case 13: case 14: case 15: case 35: case 46: case 48: tendency.Defense += item.stat_value3; break; default: break; } switch (item.stat_type4) { case 3: case 4: case 16: case 17: case 19: case 20: case 28: case 29: case 37: case 38: case 39: case 44: tendency.AttackPower += item.stat_value4; break; case 21: case 30: case 45: tendency.SpellDamage += item.stat_value1; tendency.SpellHeal += item.stat_value1; break; case 5: case 18: case 42: case 47: tendency.SpellDamage += item.stat_value4; break; case 6: case 41: case 43: tendency.SpellHeal += item.stat_value4; break; case 1: case 7: case 12: case 13: case 14: case 15: case 35: case 46: case 48: tendency.Defense += item.stat_value4; break; default: break; } switch (item.stat_type5) { case 3: case 4: case 16: case 17: case 19: case 20: case 28: case 29: case 37: case 38: case 39: case 44: tendency.AttackPower += item.stat_value5; break; case 21: case 30: case 45: tendency.SpellDamage += item.stat_value1; tendency.SpellHeal += item.stat_value1; break; case 5: case 18: case 42: case 47: tendency.SpellDamage += item.stat_value5; break; case 6: case 41: case 43: tendency.SpellHeal += item.stat_value5; break; case 1: case 7: case 12: case 13: case 14: case 15: case 35: case 46: case 48: tendency.Defense += item.stat_value5; break; default: break; } switch (item.stat_type6) { case 3: case 4: case 16: case 17: case 19: case 20: case 28: case 29: case 37: case 38: case 39: case 44: tendency.AttackPower += item.stat_value6; break; case 21: case 30: case 45: tendency.SpellDamage += item.stat_value1; tendency.SpellHeal += item.stat_value1; break; case 5: case 18: case 42: case 47: tendency.SpellDamage += item.stat_value6; break; case 6: case 41: case 43: tendency.SpellHeal += item.stat_value6; break; case 1: case 7: case 12: case 13: case 14: case 15: case 35: case 46: case 48: tendency.Defense += item.stat_value6; break; default: break; } switch (item.stat_type7) { case 3: case 4: case 16: case 17: case 19: case 20: case 28: case 29: case 37: case 38: case 39: case 44: tendency.AttackPower += item.stat_value7; break; case 21: case 30: case 45: tendency.SpellDamage += item.stat_value1; tendency.SpellHeal += item.stat_value1; break; case 5: case 18: case 42: case 47: tendency.SpellDamage += item.stat_value7; break; case 6: case 41: case 43: tendency.SpellHeal += item.stat_value7; break; case 1: case 7: case 12: case 13: case 14: case 15: case 35: case 46: case 48: tendency.Defense += item.stat_value7; break; default: break; } switch (item.stat_type8) { case 3: case 4: case 16: case 17: case 19: case 20: case 28: case 29: case 37: case 38: case 39: case 44: tendency.AttackPower += item.stat_value8; break; case 21: case 30: case 45: tendency.SpellDamage += item.stat_value1; tendency.SpellHeal += item.stat_value1; break; case 5: case 18: case 42: case 47: tendency.SpellDamage += item.stat_value8; break; case 6: case 41: case 43: tendency.SpellHeal += item.stat_value8; break; case 1: case 7: case 12: case 13: case 14: case 15: case 35: case 46: case 48: tendency.Defense += item.stat_value8; break; default: break; } switch (item.stat_type9) { case 3: case 4: case 16: case 17: case 19: case 20: case 28: case 29: case 37: case 38: case 39: case 44: tendency.AttackPower += item.stat_value9; break; case 21: case 30: case 45: tendency.SpellDamage += item.stat_value1; tendency.SpellHeal += item.stat_value1; break; case 5: case 18: case 42: case 47: tendency.SpellDamage += item.stat_value9; break; case 6: case 41: case 43: tendency.SpellHeal += item.stat_value9; break; case 1: case 7: case 12: case 13: case 14: case 15: case 35: case 46: case 48: tendency.Defense += item.stat_value9; break; default: break; } switch (item.stat_type10) { case 3: case 4: case 16: case 17: case 19: case 20: case 28: case 29: case 37: case 38: case 39: case 44: tendency.AttackPower += item.stat_value10; break; case 21: case 30: case 45: tendency.SpellDamage += item.stat_value1; tendency.SpellHeal += item.stat_value1; break; case 5: case 18: case 42: case 47: tendency.SpellDamage += item.stat_value10; break; case 6: case 41: case 43: tendency.SpellHeal += item.stat_value10; break; case 1: case 7: case 12: case 13: case 14: case 15: case 35: case 46: case 48: tendency.Defense += item.stat_value10; break; default: break; } }
// generating method public static void CalculateAllItemTendency() { foreach (var item in LegacyToolBox.Data.ItemTemplate) { if ((item.@class == 2 || item.@class == 4) && item.StatsCount != 0 && item.Quality > 1 && item.Quality < 5) { LegacyToolBox.AppendMessage("Doing " + item.entry); item_stat_tendency tendency = new item_stat_tendency(); tendency.Entry = item.entry; tendency.AttackPower = 0; tendency.Defense = 0; tendency.SpellDamage = 0; tendency.SpellHeal = 0; tendency.SpellPower = 0; GetTendency(item, tendency); DB.LEGACY.item_stat_tendency.Add(tendency); DB.LSave(); } } LegacyToolBox.AppendMessage("Tendency Done."); }