Fix mage spell

This commit is contained in:
luis
2026-09-27 12:43:09 -03:00
parent d82f8a6dac
commit b0dd96c15a
6 changed files with 26 additions and 38 deletions
+2 -2
View File
@@ -1423,11 +1423,11 @@ void WorldSession::HandleGetRemainingGameTime(WorldPackets::ClientConfig::GetRem
{
}
void WorldSession::HandleLatencyReport(WorldPackets::Misc::LatencyReport& packet)
void WorldSession::HandleLatencyReport(WorldPackets::Misc::LatencyReport& /*packet*/)
{
}
void WorldSession::HandleWarden3Data(WorldPackets::Misc::Warden3Data& packet)
void WorldSession::HandleWarden3Data(WorldPackets::Misc::Warden3Data& /*packet*/)
{
}
@@ -42,7 +42,7 @@ struct boss_amarth : public BossAI
{
boss_amarth(Creature* creature) : BossAI(creature, DATA_AMARTH)
{
Vehicle* vehicle = me->GetVehicleKit();
me->GetVehicleKit();
}
void Reset() override
@@ -38,7 +38,7 @@ struct boss_nalthor : public BossAI
{
boss_nalthor(Creature* creature) : BossAI(creature, DATA_AMARTH)
{
Vehicle* vehicle = me->GetVehicleKit();
me->GetVehicleKit();
}
void Reset() override
@@ -72,7 +72,7 @@ struct boss_surgeon_stitchflesh : public BossAI
events.ScheduleEvent(SPELL_ESCAPE, 3s);
}
void SpellHitTarget(WorldObject* target, SpellInfo const* spellInfo) override
void SpellHitTarget(WorldObject* /*target*/, SpellInfo const* spellInfo) override
{
Unit* ptarget = me->GetVictim();
@@ -28,7 +28,7 @@ struct npc_malfunctioning_goliath : public ScriptedAI
me->SetNpcFlag(UNIT_NPC_FLAG_SPELLCLICK);
}
void OnSpellClick(Unit* clicker, bool result) override
void OnSpellClick(Unit* clicker, bool /*result*/) override
{
me->RemoveNpcFlag(UNIT_NPC_FLAG_SPELLCLICK);
me->RemoveAura(SPELL_COLLAPSED_GOLIATH);
+20 -32
View File
@@ -3028,54 +3028,42 @@ class aura_mage_clearcasting_proc : public AuraScript
};
// 12654 - Ignite DOT
// Ignite keeps its damage in a pool that is dealt evenly across the DoT's ticks. Reapplying it
// adds the damage that has not been ticked yet to the new pool and restarts the full duration,
// so the total damage matches the Mastery: Ignite percentage of every triggering hit.
class spell_mage_ignite_periodic : public AuraScript
{
void CalculateRefreshedDot(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& canBeRecalculated)
void CalculateRefreshedDot(AuraEffect const* aurEff, SpellEffectValue& amount, bool& canBeRecalculated)
{
// the amount is a snapshot of the pool, allowing a recalculation would restore the flat
// basepoints and drop everything that was stored
canBeRecalculated = false;
int32 prevAmount = 0;
for (auto const& damageValuePair : _critDamageValues)
prevAmount += damageValuePair.second;
int32 newDamage = amount - prevAmount;
if (newDamage > 0)
_critDamageValues.emplace_back(std::make_pair(2, newDamage));
amount = 0;
for (auto const& damageValuePair : _critDamageValues)
amount += damageValuePair.second;
}
void HandlePeriodic(AuraEffect const* aurEff)
{
int32 newDotValue = 0;
bool changed = false;
for (auto itr = _critDamageValues.begin(); itr != _critDamageValues.end();)
// the first calculation happens inside AuraEffect's constructor while the aura is being
// created, there is no pending damage to carry over yet
if (!_initialized)
{
--itr->first;
newDotValue += itr->second;
if (itr->first == 0)
{
itr = _critDamageValues.erase(itr);
changed = true;
}
else
++itr;
_initialized = true;
return;
}
if (changed)
const_cast<AuraEffect*>(aurEff)->SetAmount(newDotValue);
uint32 totalTicks = aurEff->GetTotalTicks();
if (!totalTicks)
return;
// Aura::RefreshTimers resets the tick counter after this hook runs, so the ticks that are
// still pending here are exactly the ones whose damage has not been dealt yet
SpellEffectValue pendingDamage = aurEff->GetAmount() * aurEff->GetRemainingTicks();
amount = (pendingDamage + amount * totalTicks) / totalTicks;
}
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_ignite_periodic::CalculateRefreshedDot, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mage_ignite_periodic::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
private:
std::vector<std::pair<uint8, int32>> _critDamageValues;
bool _initialized = false;
};
// 55342 - Mirror Image: summons 3 copies of the caster (creature 31216) which attack enemies and reduce threat (aura effect 0 is handled by the core)