diff --git a/src/Playerbots.cpp b/src/Playerbots.cpp index ed4e4826..83df732a 100644 --- a/src/Playerbots.cpp +++ b/src/Playerbots.cpp @@ -238,12 +238,22 @@ public: void OnPlayerGiveXP(Player* player, uint32& amount, Unit* /*victim*/, uint8 /*xpSource*/) override { - // early return - if (sPlayerbotAIConfig->randomBotXPRate == 1.0 || !player) + // no XP multiplier, when player is no bot. + if (!player || !player->GetSession()->IsBot()) return; - // no XP multiplier, when player is no bot. - if (!player->GetSession()->IsBot() || !sRandomPlayerbotMgr->IsRandomBot(player)) + // no XP gain, if master is not a bot and has xp gain disabled. + if (const Player* master = GET_PLAYERBOT_AI(player)->GetMaster()) + { + if (!master->GetSession()->IsBot() && master->HasPlayerFlag(PLAYER_FLAGS_NO_XP_GAIN)) + { + amount = 0; + return; + } + } + + // early return + if (sPlayerbotAIConfig->randomBotXPRate == 1.0 || !sRandomPlayerbotMgr->IsRandomBot(player)) return; // no XP multiplier, when bot is in a group with a real player.