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