mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
set ammo, fix enchantment
This commit is contained in:
@@ -4013,7 +4013,7 @@ void PlayerbotAI::ImbueItem(Item* item, uint32 targetFlag, ObjectGuid targetGUID
|
||||
void PlayerbotAI::EnchantItemT(uint32 spellid, uint8 slot)
|
||||
{
|
||||
Item* pItem = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, slot);
|
||||
if (!pItem)
|
||||
if (!pItem || !pItem->IsInWorld())
|
||||
return;
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
|
||||
|
||||
@@ -2154,18 +2154,15 @@ void PlayerbotFactory::InitAmmo()
|
||||
return;
|
||||
|
||||
uint32 entry = sRandomItemMgr->GetAmmo(level, subClass);
|
||||
uint32 count = bot->GetItemCount(entry) / 200;
|
||||
uint32 maxCount = 5 + level / 10;
|
||||
uint32 count = bot->GetItemCount(entry);
|
||||
uint32 maxCount = 10000;
|
||||
|
||||
if (count < maxCount)
|
||||
if (count < maxCount / 2)
|
||||
{
|
||||
for (uint32 i = 0; i < maxCount - count; i++)
|
||||
{
|
||||
if (Item* newItem = StoreNewItemInInventorySlot(bot, entry, 200))
|
||||
newItem->AddToUpdateQueueOf(bot);
|
||||
if (Item* newItem = StoreNewItemInInventorySlot(bot, entry, maxCount / 2)) {
|
||||
newItem->AddToUpdateQueueOf(bot);
|
||||
}
|
||||
}
|
||||
|
||||
bot->SetAmmo(entry);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user