fix for #271 - Issues with gems added to randomised bot gear

This commit is contained in:
Fuzz
2024-06-12 13:28:44 +10:00
parent 7ffb188a98
commit d070adc308

View File

@@ -3466,8 +3466,19 @@ void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destoryOld)
if (!socketColor) { if (!socketColor) {
continue; continue;
} }
int32 gemId;
if (1 == socketColor)//meta
gemId = bestGemEnchantId[0];
else if (2 == socketColor)//red
gemId = bestGemEnchantId[1];
else if (4 == socketColor)//yellow
gemId = bestGemEnchantId[2];
else if (8 == socketColor)//blue
gemId = bestGemEnchantId[3];
else
continue;
bot->ApplyEnchantment(item, EnchantmentSlot(enchant_slot), false); bot->ApplyEnchantment(item, EnchantmentSlot(enchant_slot), false);
item->SetEnchantment(EnchantmentSlot(enchant_slot), bestGemEnchantId[socketColor], 0, 0, bot->GetGUID()); item->SetEnchantment(EnchantmentSlot(enchant_slot), gemId, 0, 0, bot->GetGUID());
bot->ApplyEnchantment(item, EnchantmentSlot(enchant_slot), true); bot->ApplyEnchantment(item, EnchantmentSlot(enchant_slot), true);
} }
} }