[Feature] Add Data Bucket support for scaling of Heroic Stats. (#3058)

* [Feature] Add Data Bucket support for scaling of Heroic Stats.

* update

* fixes, still reworking logic

* fixes, still reworking logic

* logic done

* logic done

* fixes

* Cleanup

* Cleanup

* Cleanup naming, verify behaviors

* formatting

* formatting

* fix issue with endurance and mana.

* update rule desc

* cleanup

* DataBucket Struct

* Cleanup data_bucket.cpp and add constants

* cleanup

* changes

* formatting

* fix from merge

* escape keyword `key`

* Add `key` to generator, run repository-generator.pl

* fix for change to key

* cleanup

* formatting

* formatting

* typo
This commit is contained in:
Aeadoin
2023-03-23 21:42:13 -04:00
committed by GitHub
parent abc27ab423
commit 59ad91a140
28 changed files with 433 additions and 243 deletions
+4 -6
View File
@@ -845,18 +845,16 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
}
}
auto client_data_buckets = GetMerchantDataBuckets();
auto temporary_merchant_list = zone->tmpmerchanttable[npcid];
uint32 slot_id = 1;
uint8 handy_chance = 0;
for (auto ml : merchant_list) {
for (const auto& ml : merchant_list) {
if (slot_id > merchant_slots) {
break;
}
auto bucket_name = ml.bucket_name;
auto bucket_value = ml.bucket_value;
auto const& bucket_value = ml.bucket_value;
if (!bucket_name.empty() && !bucket_value.empty()) {
auto full_name = fmt::format(
"{}-{}",
@@ -864,12 +862,12 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
bucket_name
);
auto player_value = client_data_buckets[full_name];
auto const& player_value = DataBucket::CheckBucketKey(this, full_name);
if (player_value.empty()) {
continue;
}
if (!zone->CheckDataBucket(ml.bucket_comparison, bucket_value, player_value)) {
if (!zone->CompareDataBucket(ml.bucket_comparison, bucket_value, player_value)) {
continue;
}
}