mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 17:09:08 +00:00
fix loot
This commit is contained in:
@@ -78,7 +78,7 @@ ItemUsage ItemUsageValue::Calculate()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (bot->GetGuildId() && sGuildTaskMgr->IsGuildTaskItem(itemId, bot->GetGuildId()))
|
||||
return ITEM_USAGE_GUILD_TASK;
|
||||
|
||||
@@ -202,13 +202,13 @@ ItemUsage ItemUsageValue::QueryItemUsageForEquip(ItemTemplate const* itemProto)
|
||||
return ITEM_USAGE_BAD_EQUIP;
|
||||
|
||||
ItemTemplate const* oldItemProto = oldItem->GetTemplate();
|
||||
float oldScore = PlayerbotFactory::CalculateItemScore(oldItemProto->ItemId, bot);
|
||||
if (oldItem)
|
||||
{
|
||||
// uint32 oldStatWeight = sRandomItemMgr->GetLiveStatWeight(bot, oldItemProto->ItemId);
|
||||
float oldScore = PlayerbotFactory::CalculateItemScore(oldItemProto->ItemId, bot);
|
||||
if (itemScore || oldScore)
|
||||
{
|
||||
shouldEquip = itemScore >= oldScore * 1.5;
|
||||
shouldEquip = itemScore > oldScore * 1.1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,17 +226,17 @@ ItemUsage ItemUsageValue::QueryItemUsageForEquip(ItemTemplate const* itemProto)
|
||||
if (oldItemProto->Class == ITEM_CLASS_ARMOR && !sRandomItemMgr->CanEquipArmor(bot->getClass(), bot->getLevel(), oldItemProto))
|
||||
existingShouldEquip = false;
|
||||
|
||||
uint32 oldItemPower = sRandomItemMgr->GetLiveStatWeight(bot, oldItemProto->ItemId);
|
||||
uint32 newItemPower = sRandomItemMgr->GetLiveStatWeight(bot, itemProto->ItemId);
|
||||
// uint32 oldItemPower = sRandomItemMgr->GetLiveStatWeight(bot, oldItemProto->ItemId);
|
||||
// uint32 newItemPower = sRandomItemMgr->GetLiveStatWeight(bot, itemProto->ItemId);
|
||||
|
||||
//Compare items based on item level, quality or itemId.
|
||||
bool isBetter = false;
|
||||
if (newItemPower > oldItemPower)
|
||||
isBetter = true;
|
||||
else if (newItemPower == oldItemPower && itemProto->Quality > oldItemProto->Quality)
|
||||
isBetter = true;
|
||||
else if (newItemPower == oldItemPower && itemProto->Quality == oldItemProto->Quality && itemProto->ItemId > oldItemProto->ItemId)
|
||||
if (itemScore > oldScore)
|
||||
isBetter = true;
|
||||
// else if (newItemPower == oldScore && itemProto->Quality > oldItemProto->Quality)
|
||||
// isBetter = true;
|
||||
// else if (newItemPower == oldScore && itemProto->Quality == oldItemProto->Quality && itemProto->ItemId > oldItemProto->ItemId)
|
||||
// isBetter = true;
|
||||
|
||||
Item* item = CurrentItem(itemProto);
|
||||
bool itemIsBroken = item && item->GetUInt32Value(ITEM_FIELD_DURABILITY) == 0 && item->GetUInt32Value(ITEM_FIELD_MAXDURABILITY) > 0;
|
||||
|
||||
Reference in New Issue
Block a user