mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-12-01 21:12:50 +08:00
[Initialization] Ammo init
This commit is contained in:
@@ -2502,8 +2502,7 @@ void PlayerbotFactory::InitAmmo()
|
||||
case ITEM_SUBCLASS_WEAPON_CROSSBOW:
|
||||
subClass = ITEM_SUBCLASS_ARROW;
|
||||
break;
|
||||
case ITEM_SUBCLASS_WEAPON_THROWN:
|
||||
subClass = ITEM_SUBCLASS_THROWN;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2516,7 +2515,7 @@ void PlayerbotFactory::InitAmmo()
|
||||
|
||||
if (count < maxCount / 2)
|
||||
{
|
||||
if (Item* newItem = StoreNewItemInInventorySlot(bot, entry, maxCount / 2)) {
|
||||
if (Item* newItem = StoreNewItemInInventorySlot(bot, entry, maxCount)) {
|
||||
newItem->AddToUpdateQueueOf(bot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ void PlayerbotHolder::OnBotLogin(Player* const bot)
|
||||
|
||||
if (isRandomAccount && sPlayerbotAIConfig->randomBotFixedLevel) {
|
||||
bot->SetPlayerFlag(PLAYER_FLAGS_NO_XP_GAIN);
|
||||
} else {
|
||||
} else if (isRandomAccount && !sPlayerbotAIConfig->randomBotFixedLevel) {
|
||||
bot->RemovePlayerFlag(PLAYER_FLAGS_NO_XP_GAIN);
|
||||
}
|
||||
|
||||
|
||||
@@ -2202,9 +2202,7 @@ RandomItemList RandomItemMgr::Query(uint32 level, uint8 clazz, uint8 slot, uint3
|
||||
|
||||
void RandomItemMgr::BuildAmmoCache()
|
||||
{
|
||||
uint32 maxLevel = sPlayerbotAIConfig->randomBotMaxLevel;
|
||||
if (maxLevel > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
uint32 maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
|
||||
LOG_INFO("server.loading", "Building ammo cache for {} levels", maxLevel);
|
||||
|
||||
@@ -2241,9 +2239,9 @@ uint32 RandomItemMgr::GetAmmo(uint32 level, uint32 subClass)
|
||||
|
||||
void RandomItemMgr::BuildPotionCache()
|
||||
{
|
||||
uint32 maxLevel = sPlayerbotAIConfig->randomBotMaxLevel;
|
||||
if (maxLevel > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
uint32 maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
// if (maxLevel > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
// maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
|
||||
LOG_INFO("server.loading", "Building potion cache for {} levels", maxLevel);
|
||||
|
||||
|
||||
@@ -1257,9 +1257,7 @@ void RandomPlayerbotMgr::RandomTeleport(Player* bot, std::vector<WorldLocation>&
|
||||
|
||||
void RandomPlayerbotMgr::PrepareTeleportCache()
|
||||
{
|
||||
uint8 maxLevel = sPlayerbotAIConfig->randomBotMaxLevel;
|
||||
if (maxLevel > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
uint32 maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
|
||||
LOG_INFO("playerbots", "Preparing random teleport caches for {} levels...", maxLevel);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user