fix(Core/Spells): Fixed sending category cooldowns. (#15192)
This commit is contained in:
@@ -10798,7 +10798,6 @@ void Player::AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 ite
|
|||||||
// cooldown information stored in item prototype
|
// cooldown information stored in item prototype
|
||||||
// This used in same way in WorldSession::HandleItemQuerySingleOpcode data sending to client.
|
// This used in same way in WorldSession::HandleItemQuerySingleOpcode data sending to client.
|
||||||
|
|
||||||
bool useSpellCooldown = spellInfo->HasAttribute(SPELL_ATTR7_CAN_BE_MULTI_CAST);
|
|
||||||
if (itemId)
|
if (itemId)
|
||||||
{
|
{
|
||||||
if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId))
|
if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId))
|
||||||
@@ -10810,12 +10809,6 @@ void Player::AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 ite
|
|||||||
cat = proto->Spells[idx].SpellCategory;
|
cat = proto->Spells[idx].SpellCategory;
|
||||||
rec = proto->Spells[idx].SpellCooldown;
|
rec = proto->Spells[idx].SpellCooldown;
|
||||||
catrec = proto->Spells[idx].SpellCategoryCooldown;
|
catrec = proto->Spells[idx].SpellCategoryCooldown;
|
||||||
|
|
||||||
if (static_cast<int32>(cat) != catrec)
|
|
||||||
{
|
|
||||||
useSpellCooldown = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10852,14 +10845,7 @@ void Player::AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 ite
|
|||||||
|
|
||||||
// Now we have cooldown data (if found any), time to apply mods
|
// Now we have cooldown data (if found any), time to apply mods
|
||||||
if (rec > 0)
|
if (rec > 0)
|
||||||
{
|
|
||||||
int32 oldRec = rec;
|
|
||||||
ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, rec, spell);
|
ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, rec, spell);
|
||||||
if (oldRec != rec)
|
|
||||||
{
|
|
||||||
useSpellCooldown = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (catrec > 0 && !spellInfo->HasAttribute(SPELL_ATTR6_NO_CATEGORY_COOLDOWN_MODS))
|
if (catrec > 0 && !spellInfo->HasAttribute(SPELL_ATTR6_NO_CATEGORY_COOLDOWN_MODS))
|
||||||
{
|
{
|
||||||
@@ -10872,7 +10858,6 @@ void Player::AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 ite
|
|||||||
if (HasSpell(spellInfo->Id))
|
if (HasSpell(spellInfo->Id))
|
||||||
{
|
{
|
||||||
needsCooldownPacket = true;
|
needsCooldownPacket = true;
|
||||||
useSpellCooldown = true;
|
|
||||||
rec += cooldownMod * IN_MILLISECONDS; // SPELL_AURA_MOD_COOLDOWN does not affect category cooldows, verified with shaman shocks
|
rec += cooldownMod * IN_MILLISECONDS; // SPELL_AURA_MOD_COOLDOWN does not affect category cooldows, verified with shaman shocks
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10892,11 +10877,11 @@ void Player::AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 ite
|
|||||||
// category spells
|
// category spells
|
||||||
if (cat && catrec > 0)
|
if (cat && catrec > 0)
|
||||||
{
|
{
|
||||||
_AddSpellCooldown(spellInfo->Id, cat, itemId, useSpellCooldown ? recTime : catrecTime, true, true);
|
_AddSpellCooldown(spellInfo->Id, 0, itemId, recTime, true, true);
|
||||||
if (needsCooldownPacket)
|
if (needsCooldownPacket)
|
||||||
{
|
{
|
||||||
WorldPacket data;
|
WorldPacket data;
|
||||||
BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_NONE, spellInfo->Id, useSpellCooldown ? recTime : catrecTime);
|
BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_NONE, spellInfo->Id, recTime);
|
||||||
SendDirectMessage(&data);
|
SendDirectMessage(&data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user