mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-17 02:40:28 +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:
@@ -9,6 +9,7 @@
|
||||
#include "Group.h"
|
||||
#include "ItemUsageValue.h"
|
||||
#include "LootAction.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
@@ -30,12 +31,24 @@ bool LootRollAction::Execute(Event event)
|
||||
ObjectGuid guid = roll->itemGUID;
|
||||
uint32 slot = roll->itemSlot;
|
||||
uint32 itemId = roll->itemid;
|
||||
int32 randomProperty = 0;
|
||||
if (roll->itemRandomPropId)
|
||||
randomProperty = roll->itemRandomPropId;
|
||||
else if (roll->itemRandomSuffix)
|
||||
randomProperty = -((int)roll->itemRandomSuffix);
|
||||
|
||||
RollVote vote = PASS;
|
||||
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId);
|
||||
if (!proto)
|
||||
continue;
|
||||
ItemUsage usage = AI_VALUE2(ItemUsage, "item usage", itemId);
|
||||
|
||||
std::string itemUsageParam;
|
||||
if (randomProperty != 0) {
|
||||
itemUsageParam = std::to_string(itemId) + "," + std::to_string(randomProperty);
|
||||
} else {
|
||||
itemUsageParam = std::to_string(itemId);
|
||||
}
|
||||
ItemUsage usage = AI_VALUE2(ItemUsage, "item usage", itemUsageParam);
|
||||
|
||||
// Armor Tokens are classed as MISC JUNK (Class 15, Subclass 0), luckily no other items I found have class bits and epic quality.
|
||||
if (proto->Class == ITEM_CLASS_MISC && proto->SubClass == ITEM_SUBCLASS_JUNK && proto->Quality == ITEM_QUALITY_EPIC)
|
||||
|
||||
Reference in New Issue
Block a user