From d070adc3084d3dce4d87d20bc353dd4b18a52636 Mon Sep 17 00:00:00 2001 From: Fuzz Date: Wed, 12 Jun 2024 13:28:44 +1000 Subject: [PATCH] fix for #271 - Issues with gems added to randomised bot gear --- src/PlayerbotFactory.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index 34d600ae..b32fa397 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -3466,8 +3466,19 @@ void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destoryOld) if (!socketColor) { 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); - 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); } }