mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Compare commits
15 Commits
hermensbas
...
hermensbas
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50103ed13d | ||
|
|
6e638cdf0c | ||
|
|
8d51092d42 | ||
|
|
3fff58df1a | ||
|
|
ca2e2ef0db | ||
|
|
4e3ac609bd | ||
|
|
c6b0424c29 | ||
|
|
2e0a161623 | ||
|
|
e4ea8e2694 | ||
|
|
ddfa919154 | ||
|
|
380312ffd2 | ||
|
|
872e417613 | ||
|
|
3d28a81508 | ||
|
|
bcd6f5bc06 | ||
|
|
15f138aab0 |
@@ -209,17 +209,31 @@ public:
|
||||
|
||||
void OnPlayerGiveXP(Player* player, uint32& amount, Unit* /*victim*/, uint8 /*xpSource*/) override
|
||||
{
|
||||
if (!player->GetSession()->IsBot())
|
||||
// early return
|
||||
if (sPlayerbotAIConfig->randomBotXPRate == 1.0 || !player)
|
||||
return;
|
||||
|
||||
if (!sRandomPlayerbotMgr->IsRandomBot(player))
|
||||
// no XP multiplier, when player is no bot.
|
||||
if (!player->GetSession()->IsBot() || !sRandomPlayerbotMgr->IsRandomBot(player))
|
||||
return;
|
||||
|
||||
if (sPlayerbotAIConfig->randomBotXPRate != 1.0)
|
||||
// no XP multiplier, when bot has group where leader is a real player.
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
amount = static_cast<uint32>(std::round(static_cast<float>(amount) * sPlayerbotAIConfig->randomBotXPRate));
|
||||
Player* leader = group->GetLeader();
|
||||
if (leader && leader != player)
|
||||
{
|
||||
if (PlayerbotAI* leaderBotAI = GET_PLAYERBOT_AI(leader))
|
||||
{
|
||||
if (leaderBotAI->HasRealPlayerMaster())
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise apply bot XP multiplier.
|
||||
amount = static_cast<uint32>(std::round(static_cast<float>(amount) * sPlayerbotAIConfig->randomBotXPRate));
|
||||
}
|
||||
};
|
||||
|
||||
class PlayerbotsMiscScript : public MiscScript
|
||||
|
||||
@@ -164,22 +164,33 @@ void PlayerbotFactory::Init()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(gemId);
|
||||
if (!proto)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (proto->ItemLevel < 60)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (proto->Flags & ITEM_FLAG_UNIQUE_EQUIPPABLE)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (sRandomItemMgr->IsTestItem(gemId))
|
||||
continue;
|
||||
|
||||
if (!proto || !sGemPropertiesStore.LookupEntry(proto->GemProperties))
|
||||
if (sRandomItemMgr->IsTestItem(gemId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!sGemPropertiesStore.LookupEntry(proto->GemProperties))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// LOG_INFO("playerbots", "Add {} to enchantment gems", gemId);
|
||||
enchantGemIdCache.push_back(gemId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user