mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-18 03:05:43 +00:00
Calculation of the power of items with random properties (#1312)
* Score calculation of item random property * Equip auto repair on repop * Item random property calculation * Random Property calculation
This commit is contained in:
@@ -140,17 +140,16 @@ bool TellEstimatedDpsAction::Execute(Event event)
|
||||
bool TellCalculateItemAction::Execute(Event event)
|
||||
{
|
||||
std::string const text = event.getParam();
|
||||
ItemIds ids = chat->parseItems(text);
|
||||
ItemWithRandomProperty item = chat->parseItemWithRandomProperty(text);
|
||||
StatsWeightCalculator calculator(bot);
|
||||
for (const uint32 &id : ids)
|
||||
{
|
||||
const ItemTemplate* proto = sObjectMgr->GetItemTemplate(id);
|
||||
if (!proto)
|
||||
continue;
|
||||
float score = calculator.CalculateItem(id);
|
||||
std::ostringstream out;
|
||||
out << "Calculated score of " << chat->FormatItem(proto) << " : " << score;
|
||||
botAI->TellMasterNoFacing(out.str());
|
||||
}
|
||||
|
||||
const ItemTemplate* proto = sObjectMgr->GetItemTemplate(item.itemId);
|
||||
if (!proto)
|
||||
return false;
|
||||
float score = calculator.CalculateItem(item.itemId, item.randomPropertyId);
|
||||
|
||||
std::ostringstream out;
|
||||
out << "Calculated score of " << chat->FormatItem(proto) << " : " << score;
|
||||
botAI->TellMasterNoFacing(out.str());
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user