Core/Spells: Rename SpellAttr1 to use official attribute names

* Implemented SPELL_ATTR1_NO_SKILL_INCREASE, SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT, SPELL_ATTR1_DISPEL_ALL_STACKS
This commit is contained in:
Shauren authored and Ovahlord committed 2022-09-12 09:15:31 +02:00
1 parent cbc2234f1b
commit ca7d36873f
15 files changed
+184 -143

No files matched your search

+21 -12
View File
@@ -1370,7 +1370,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype)
// we succeeded in creating at least one item, so a levelup is possible
if (bgType == 0)
player->UpdateCraftSkill(m_spellInfo->Id);
player->UpdateCraftSkill(m_spellInfo);
}
/*
@@ -1406,7 +1406,7 @@ void Spell::EffectCreateItem2(SpellEffIndex effIndex)
if (m_spellInfo->IsLootCrafting())
{
player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell, false);
player->UpdateCraftSkill(m_spellInfo->Id);
player->UpdateCraftSkill(m_spellInfo);
}
else // If there's no random loot entries for this spell, pick the item associated with this spell
{
@@ -2069,12 +2069,17 @@ void Spell::EffectDispel(SpellEffIndex effIndex)
return false;
});
uint8 dispelledCharges = 1;
if (itr->GetAura()->GetSpellInfo()->HasAttribute(SPELL_ATTR1_DISPEL_ALL_STACKS))
dispelledCharges = itr->GetDispelCharges();
if (successItr == successList.end())
successList.emplace_back(itr->GetAura(), 0, 1);
successList.emplace_back(itr->GetAura(), 0, dispelledCharges);
else
successItr->IncrementCharges();
if (!itr->DecrementCharge())
if (!itr->DecrementCharge(dispelledCharges))
{
--remaining;
std::swap(*itr, dispelList[remaining]);
@@ -2316,7 +2321,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex)
{
// do not increase skill if vellum used
if (!(m_CastItem && m_CastItem->GetTemplate()->GetFlags() & ITEM_FLAG_NO_REAGENT_COST))
player->UpdateCraftSkill(m_spellInfo->Id);
player->UpdateCraftSkill(m_spellInfo);
uint32 enchant_id = m_spellInfo->Effects[effIndex].MiscValue;
if (!enchant_id)
@@ -3976,7 +3981,7 @@ void Spell::EffectDisEnchant(SpellEffIndex /*effIndex*/)
if (Player* caster = m_caster->ToPlayer())
{
caster->UpdateCraftSkill(m_spellInfo->Id);
caster->UpdateCraftSkill(m_spellInfo);
caster->SendLoot(itemTarget->GetGUID(), LOOT_DISENCHANTING);
}
@@ -5135,7 +5140,7 @@ void Spell::EffectStealBeneficialBuff(SpellEffIndex effIndex)
// Ok if exist some buffs for dispel try dispel it
uint32 failCount = 0;
DispelList successList;
std::vector<std::tuple<uint32, ObjectGuid, int32>> successList;
successList.reserve(damage);
WorldPacket dataFail(SMSG_DISPEL_FAILED, 8 + 8 + 4 + 4 + damage * 4);
@@ -5148,8 +5153,12 @@ void Spell::EffectStealBeneficialBuff(SpellEffIndex effIndex)
if (itr->RollDispel())
{
successList.emplace_back(itr->GetAura()->GetId(), itr->GetAura()->GetCasterGUID());
if (!itr->DecrementCharge())
uint8 stolenCharges = 1;
if (itr->GetAura()->GetSpellInfo()->HasAttribute(SPELL_ATTR1_DISPEL_ALL_STACKS))
stolenCharges = itr->GetDispelCharges();
successList.emplace_back(itr->GetAura()->GetId(), itr->GetAura()->GetCasterGUID(), int32(stolenCharges));
if (!itr->DecrementCharge(stolenCharges))
{
--remaining;
std::swap(*itr, stealList[remaining]);
@@ -5182,11 +5191,11 @@ void Spell::EffectStealBeneficialBuff(SpellEffIndex effIndex)
dataSuccess << uint32(m_spellInfo->Id); // dispel spell id
dataSuccess << uint8(0); // not used
dataSuccess << uint32(successList.size()); // count
for (auto itr = successList.begin(); itr != successList.end(); ++itr)
for (auto const& [spellId, auraCaster, stolenCharges] : successList)
{
dataSuccess << uint32(itr->first); // Spell Id
dataSuccess << uint32(spellId); // Spell Id
dataSuccess << uint8(0); // 0 - steals !=0 transfers
unitTarget->RemoveAurasDueToSpellBySteal(itr->first, itr->second, m_caster);
unitTarget->RemoveAurasDueToSpellBySteal(spellId, auraCaster, m_caster, stolenCharges);
}
m_caster->SendMessageToSet(&dataSuccess, true);
}