fix(Scripts/Spells): warlock seed of corruption (#19322)

* remove seed of corruption handling in unit.cpp

* add generic and warlock aurascript

add warlock  aurascript

add enum

add generic aurascript

add OnRemove

2ff855054f (diff-ea612aafadff90005e88b243eb000369be9e5cb6f8dc85a008d31e42b156e0ec)

detonation threshold scaling added in: df5afca278

Co-authored-by: ariel- <ariel-@users.noreply.github.com>

* add LoS check to generic damage

* refactor 2 scripts to 1 with args

refactor const_cast to GetAura()->GetEffect(

refactor reduce a line

* fix detonation threshold scaling

changed SPELL_DIRECT_DAMAGE to DOT

* remove not needed IsExpired() check

removal upon expiration is notified by AURA_REMOVE_BY_EXPIRE

* update comment

* refactor script with args to single spellscript, fix detonate by evade

* refactor

detonation to Detonate()
rename amount to remainingDamage
remove no tneeded HealthBelowPctDamaged

* refactor to 2 spell scripts again

* rename detonation spell from seed_of_corruption to seed_of_corruption_damage

avoids confusion with seed of corruption (with dot effect)

---------

Co-authored-by: ariel- <ariel-@users.noreply.github.com>
This commit is contained in:
Jelle Meeus
2024-07-17 01:50:38 +02:00
committed by GitHub
parent 416e53df0b
commit e8af1aaffc
4 changed files with 143 additions and 87 deletions

View File

@@ -7131,60 +7131,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
}
case SPELLFAMILY_WARLOCK:
{
// Seed of Corruption
if (dummySpell->SpellFamilyFlags[1] & 0x00000010)
{
if (procSpell && procSpell->SpellFamilyFlags[1] & 0x8000)
return false;
// if damage is more than need or target die from damage deal finish spell
if (triggeredByAura->GetAmount() <= int32(damage) || GetHealth() <= damage)
{
// remember guid before aura delete
ObjectGuid casterGuid = triggeredByAura->GetCasterGUID();
// Remove aura (before cast for prevent infinite loop handlers)
RemoveAurasDueToSpell(triggeredByAura->GetId());
uint32 spell = sSpellMgr->GetSpellWithRank(27285, dummySpell->GetRank());
// Cast finish spell (triggeredByAura already not exist!)
if (Unit* caster = ObjectAccessor::GetUnit(*this, casterGuid))
{
this->CastSpell(this, 37826, true); // VISUAL!
caster->CastSpell(this, spell, true, castItem);
}
return true; // no hidden cooldown
}
// Damage counting
triggeredByAura->SetAmount(triggeredByAura->GetAmount() - damage);
return true;
}
// Seed of Corruption (Mobs cast) - no die req
if (dummySpell->SpellFamilyFlags.IsEqual(0, 0, 0) && dummySpell->SpellIconID == 1932)
{
// if damage is more than need deal finish spell
if (triggeredByAura->GetAmount() <= int32(damage))
{
// remember guid before aura delete
ObjectGuid casterGuid = triggeredByAura->GetCasterGUID();
// Remove aura (before cast for prevent infinite loop handlers)
RemoveAurasDueToSpell(triggeredByAura->GetId());
// Cast finish spell (triggeredByAura already not exist!)
if (Unit* caster = ObjectAccessor::GetUnit(*this, casterGuid))
{
this->CastSpell(this, 37826, true); // VISUAL!
caster->CastSpell(this, 32865, true, castItem);
}
return true; // no hidden cooldown
}
// Damage counting
triggeredByAura->SetAmount(triggeredByAura->GetAmount() - damage);
return true;
}
switch (dummySpell->Id)
{
// Nightfall