Core/Spells: Fix SPELL_AURA_MOD_CURRENCY_GAIN
This commit is contained in:
@@ -7356,7 +7356,7 @@ bool Player::HasCurrency(uint32 id, uint32 count) const
|
||||
return itr != _currencyStorage.end() && itr->second.totalCount >= count;
|
||||
}
|
||||
|
||||
void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/)
|
||||
void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bool ignoreMultipliers/* = false*/)
|
||||
{
|
||||
if (!count)
|
||||
return;
|
||||
@@ -7364,6 +7364,9 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/)
|
||||
CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(id);
|
||||
ASSERT(currency);
|
||||
|
||||
if (!ignoreMultipliers)
|
||||
count *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_CURRENCY_GAIN, id);
|
||||
|
||||
int32 precision = currency->Flags & CURRENCY_FLAG_HIGH_PRECISION ? 100 : 1;
|
||||
uint32 oldTotalCount = 0;
|
||||
uint32 oldWeekCount = 0;
|
||||
@@ -21118,7 +21121,7 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c
|
||||
for (int i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i)
|
||||
{
|
||||
if (iece->RequiredCurrency[i])
|
||||
ModifyCurrency(iece->RequiredCurrency[i], -int32(iece->RequiredCurrencyCount[i]));
|
||||
ModifyCurrency(iece->RequiredCurrency[i], -int32(iece->RequiredCurrencyCount[i]), true, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21252,7 +21255,7 @@ bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uin
|
||||
return false;
|
||||
}
|
||||
|
||||
ModifyCurrency(currency, crItem->maxcount);
|
||||
ModifyCurrency(currency, crItem->maxcount, true, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1454,8 +1454,9 @@ class Player : public Unit, public GridObject<Player>
|
||||
* @param id currency entry from CurrencyTypes.dbc
|
||||
* @param count integer value for adding/removing curent currency
|
||||
* @param printLog used on SMSG_UPDATE_CURRENCY
|
||||
* @param ignore gain multipliers
|
||||
*/
|
||||
void ModifyCurrency(uint32 id, int32 count, bool printLog = true);
|
||||
void ModifyCurrency(uint32 id, int32 count, bool printLog = true, bool ignoreMultipliers = false);
|
||||
|
||||
void ApplyEquipCooldown(Item* pItem);
|
||||
void QuickEquipItem(uint16 pos, Item* pItem);
|
||||
|
||||
@@ -408,7 +408,7 @@ enum AuraType
|
||||
SPELL_AURA_PROGRESS_BAR = 346, // NYI
|
||||
SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE = 347, // NYI
|
||||
SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT = 348, // NYI
|
||||
SPELL_AURA_MOD_CURRENCY_GAIN = 349, // NYI
|
||||
SPELL_AURA_MOD_CURRENCY_GAIN = 349,
|
||||
SPELL_AURA_MOD_GATHERING_ITEMS_GAINED_PERCENT = 350, // NYI
|
||||
SPELL_AURA_351 = 351,
|
||||
SPELL_AURA_352 = 352,
|
||||
|
||||
@@ -404,7 +404,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
|
||||
&AuraEffect::HandleNULL, //346 SPELL_AURA_PROGRESS_BAR
|
||||
&AuraEffect::HandleNULL, //347 SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE
|
||||
&AuraEffect::HandleNoImmediateEffect, //348 SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT
|
||||
&AuraEffect::HandleNULL, //349 SPELL_AURA_MOD_CURRENCY_GAIN
|
||||
&AuraEffect::HandleNoImmediateEffect, //349 SPELL_AURA_MOD_CURRENCY_GAIN
|
||||
&AuraEffect::HandleNULL, //350 SPELL_AURA_MOD_GATHERING_ITEMS_GAINED_PERCENT
|
||||
&AuraEffect::HandleNULL, //351 SPELL_AURA_351
|
||||
&AuraEffect::HandleNULL, //352 SPELL_AURA_352
|
||||
|
||||
@@ -1121,7 +1121,7 @@ public:
|
||||
|
||||
int32 amount = (uint32)atoi(args);
|
||||
|
||||
target->ModifyCurrency(CURRENCY_TYPE_HONOR_POINTS, amount);
|
||||
target->ModifyCurrency(CURRENCY_TYPE_HONOR_POINTS, amount, true, true);
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_HONOR_POINTS));
|
||||
|
||||
@@ -1311,7 +1311,7 @@ public:
|
||||
|
||||
int32 amount = (uint32)atoi(args);
|
||||
|
||||
target->ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, amount);
|
||||
target->ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, amount, true, true);
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user