public static void TryInsertScroll(ConsumeItemTemplate template) { var sRate = template.SuccessRate; if (template.TradeBlock) { return; } if (template.SuccessRate % 10 != 0 || sRate > 70 || sRate < 30) { return; } var nListIdx = GetIndexBySuccessRate(sRate); var nFlag = RouletteItemFlags.None; var nIdx = ItemConstants.GetEquipTypeScrollID(template.TemplateId); switch (nIdx) { case EquipType.CAP: nFlag |= RouletteItemFlags.Cap; break; case EquipType.SHIRT: nFlag |= RouletteItemFlags.Shirt; break; case EquipType.SHOES: nFlag |= RouletteItemFlags.Shoes; break; case EquipType.GLOVES: nFlag |= RouletteItemFlags.Gloves; break; default: { switch ((WeaponType)nIdx) { case WeaponType.WT_OH_SWORD: case WeaponType.WT_OH_MACE: case WeaponType.WT_OH_AXE: case WeaponType.WT_TH_AXE: case WeaponType.WT_TH_MACE: case WeaponType.WT_TH_SWORD: case WeaponType.WT_SPEAR: case WeaponType.WT_POLEARM: // poor warriors have so many weapon types :( nFlag |= RouletteItemFlags.Warrior; break; case WeaponType.WT_DAGGER: case WeaponType.WT_SUB_DAGGER: case WeaponType.WT_THROWINGGLOVE: nFlag |= RouletteItemFlags.Thief; break; case WeaponType.WT_WAND: case WeaponType.WT_STAFF: nFlag |= RouletteItemFlags.Magician; break; case WeaponType.WT_BOW: case WeaponType.WT_CROSSBOW: nFlag |= RouletteItemFlags.Archer; break; case WeaponType.WT_KNUCKLE: case WeaponType.WT_GUN: nFlag |= RouletteItemFlags.Pirate; break; default: // not a weapon return; } nFlag |= RouletteItemFlags.Weapon; Scrolls[nListIdx] .Add(new RouletteItem { ItemID = template.TemplateId, ItemFlag = nFlag }); } return; } if (template.IncDEX > 0) { nFlag |= RouletteItemFlags.Archer; nFlag |= RouletteItemFlags.Pirate; } else if (template.IncSTR > 0) { nFlag |= RouletteItemFlags.Warrior; } else if (template.IncINT > 0) { nFlag |= RouletteItemFlags.Magician; } else if (template.IncLUK > 0) { nFlag |= RouletteItemFlags.Thief; } else if (template.IncPAD > 0) { nFlag |= RouletteItemFlags.AllJobs; // add all job flags nFlag = (nFlag & ~RouletteItemFlags.Magician); // turn off magician flag } else if (template.IncMAD > 0) { nFlag |= RouletteItemFlags.Magician; } else if (template.IncACC > 0) { nFlag |= RouletteItemFlags.AllJobs; // add all job flags nFlag = (nFlag & ~RouletteItemFlags.Magician); // turn off magician flag } else if (template.IncEVA > 0) { nFlag |= RouletteItemFlags.AllJobs; // add all job flags nFlag = (nFlag & ~RouletteItemFlags.Magician); // turn off magician flag } else if (template.IncMHP > 0) { nFlag |= RouletteItemFlags.AllJobs; } else if (template.IncMMP > 0) { nFlag |= RouletteItemFlags.AllJobs; } else if (template.IncJump > 0) { nFlag |= RouletteItemFlags.AllJobs; } else if (template.IncSpeed > 0) { nFlag |= RouletteItemFlags.AllJobs; } else if (template.IncPDD > 0) { nFlag |= RouletteItemFlags.AllJobs; } else if (template.IncMDD > 0) { nFlag |= RouletteItemFlags.AllJobs; } if (nFlag == RouletteItemFlags.None) { return; } Scrolls[nListIdx] .Add(new RouletteItem { ItemID = template.TemplateId, ItemFlag = nFlag }); }