void CItem::AlterToMagicItem() // Chance to drop enchanted items. - [MT2Dev Note] - 25/05/2023
{
int idx = GetAttributeSetIndex();
if (idx < 0)
{
return;
}
// Type Appeariance Second Third
// Weapon 50 20 5
// Armor 30 15 3
// Other 20 10 2
int iSecondPct; // Drop with 2 Bonus.
int iThirdPct; // Drop with 3 Bonus.
switch (GetType())
{
case ITEM_WEAPON: // Weapons.
iSecondPct = 20; // 2 Bonus drop chance %20.
iThirdPct = 5; // 3 Bonus drop chance %5.
break;
case ITEM_ARMOR:
case ITEM_COSTUME:
if (GetSubType() == ARMOR_BODY) // Armors.
{
iSecondPct = 15; // 2 Bonus drop chance %15.
iThirdPct = 3; // 3 Bonus drop chance %3.
}
else // Others.
{
iSecondPct = 10; // 2 Bonus drop chance %10.
iThirdPct = 2; // 3 Bonus drop chance %2.
}
break;
default:
return;
}
// %100 chance for one good attribute. - [Ymir Dev Note]
PutAttribute (aiItemMagicAttributePercentHigh);
// Info: Bonus 1 will always drop with PercentHigh, Bonus 2 and 3 will most likely come with PercentLow. - [MT2Dev Note] - 25/05/2023
if (number (1, 100) <= iSecondPct)
{
PutAttribute (aiItemMagicAttributePercentLow);
}
if (number (1, 100) <= iThirdPct)
{
PutAttribute (aiItemMagicAttributePercentLow);
}
}