Jump to content

[Patch] Spells Polarity Shift


Schmoozerd

Recommended Posts

* What bug does the patch fix? What features does the patch add?

Implements the Polarity Shift spells for Thaddius and Mechanolord Capacitus

* For which repository revision was the patch created?

11751

* Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

none afaik

* Who has been writing this patch? Please include either forum user names or email addresses.

me

Sorry for not having the different parts of this patch separated, this is due to historical implementing reasons :)

The mechanics between the two bosses is so similar, that I thought it would fit to treat them in one patch

I have tested an older version exhausively, but due to adding capacitus' spells I rearranged code and didn't retest carefully.

Patch: (untested)

http://paste2.org/p/1540034

Layout of these spells:

main-spell, [debuff-aura, buff-aura (added stacking exceptions by icon) dmg spell] x (positive, negative)

main-spell applies debuff aura onto random targets, according to Ntsc not random for every member, but split his target into two equally sized groups (*)

buff aura is applied for every player depending on number of nearby players with same debuff aura every 5s.

dmg spell hits only players, except they have same debuff aura

(*) Targeting of Main-Spell

As the main-spell affects _not_ every target independend, I moved the whole targeting of this effect into the last processed target.

The alternative (as I see it) would have been to change the way DoAllEffectsOnTargets work to be able to store information about already handled targets;

currently we only store a bool (processed or not), this could be extended

(**) Applying the buff Aura

The buff Aura is applied every 5s, however from my sources it rather looks like that:

the DMG-spell should only hit the players without right aura - but currently I used that the dmg spell hits _all_players to apply the buffs with them.

I think this is a sort of hack, but doing this part better doesn't feel natural - especially as we have no target filtering.

Link to comment
Share on other sites

  • 3 months later...

I have an other implementation for Polarity Shift (only for Thaddius)

take this link to paste: http://paste2.org/p/1530708

or this link to my git repo: https://github.com/Reamer/mangos/commit/51ec60eb0732761838fbacb8bd6a5430b72e9827

An explanation:

with this part, we remove the Damage-Buff-Aura, only the Aura NOT the Holder

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 745812c..3b278d2 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -2055,6 +2055,18 @@ void Aura::TriggerSpell()
                triggerTarget->CastCustomSpell(triggerTarget, trigger_spell_id, &m_modifier.m_amount, NULL, NULL, true, NULL, this);
                return;
            }
+            case 28084:                                     // Negative Charge
+            {
+                if (triggerTarget->HasAura(29660))
+                    triggerTarget->RemoveAura(29660, EFFECT_INDEX_0);
+                break;
+            }
+            case 28059:                                     // Positive Charge
+            {
+                if (triggerTarget->HasAura(29659))
+                    triggerTarget->RemoveAura(29659, EFFECT_INDEX_0);
+                break;
+            }
            case 33525:                                     // Ground Slam
                triggerTarget->CastSpell(triggerTarget, trigger_spell_id, true, NULL, this, casterGUID);
                return;

now the trigger Spell witch is called after the prev code. This Damage Effekt apply the Damage-Buff-Aura on targets, with equal Polarity and reduce damage to 0. targets witch has not to equal Polarity get damage.

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index aba86b5..79d85c2 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -377,6 +377,33 @@ void Spell::EffectSchoolDMG(SpellEffectIndex effect_idx)
                        damage = damage * unitTarget->GetMaxHealth() / 100;
                        break;
                    }
+                    // Thaddius' charges, don't deal dmg to units with the same charge but give them the buff:
+                    // Positive Charge
+                    case 28062:
+                    {
+                        // If target is not (+) charged, then just deal dmg
+                        if (!unitTarget->HasAura(28059))
+                            break;
+
+                        if (m_caster != unitTarget)
+                            m_caster->CastSpell(m_caster, 29659, true);
+
+                        damage = 0;
+                        break;
+                    }
+                    // Negative Charge
+                    case 28085:
+                    {
+                        // If target is not (-) charged, then just deal dmg
+                        if (!unitTarget->HasAura(28084))
+                            break;
+
+                        if (m_caster != unitTarget)
+                            m_caster->CastSpell(m_caster, 29660, true);
+
+                        damage = 0;
+                        break;
+                    }
                    // Cataclysmic Bolt
                    case 38441:
                    {

The Main Spell neutralize the targets and makes a 50:50 change for both Polaritys. I think we doesn't need an true split (10 -> 5:5

in the middle it is 5:5). Very important Thaddius (or the caster ) must be originalcaster, because if the trigger spell "trigger" the damage spell without thaddius as original caster, the player damage an other player. The effect this player are now in PvP.

@@ -1408,6 +1435,20 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)

                    return;
                }
+                case 28089:                                 // Polarity Shift (Thaddius - Naxxramas)
+                {
+                    if (!unitTarget)
+                        return;
+
+                    // neutralize the target
+                    if (unitTarget->HasAura(28059)) unitTarget->RemoveAurasDueToSpell(28059);
+                    if (unitTarget->HasAura(29659)) unitTarget->RemoveAurasDueToSpell(29659);
+                    if (unitTarget->HasAura(28084)) unitTarget->RemoveAurasDueToSpell(28084);
+                    if (unitTarget->HasAura(29660)) unitTarget->RemoveAurasDueToSpell(29660);
+
+                    unitTarget->CastSpell(unitTarget, roll_chance_i(50) ? 28059 : 28084, true, 0, 0, m_caster->GetObjectGuid());
+                    break;
+                }
                case 29200:                                 // Purify Helboar Meat
                {
                    if (m_caster->GetTypeId() != TYPEID_PLAYER)

at last cleanup, if the polarity ends, this must remove the damage-buff-aura too.

@@ -2716,6 +2728,18 @@ void Aura::HandleAuraDummy(bool apply, bool Real)

                return;
            }
+            case 28059:                                     // Positive Charge (Thaddius)
+            {
+                if (target->HasAura(29659))
+                    target->RemoveAurasDueToSpell(29659);
+                return;
+            }
+            case 28084:                                     // Negative Charge (Thaddius)
+            {
+                if (target->HasAura(29660))
+                    target->RemoveAurasDueToSpell(29660);
+                return;
+            }
            case 28169:                                     // Mutating Injection
            {
                // Mutagen Explosion

I hope you understand me way of logical. And don't know, who is the right author. The Patch is build on the base of michalpolko. Sorry for me english.

EDIT: How i can write the code part right? Thats looks ugly

Link to comment
Share on other sites

[ code=diff] work

well, yes it seems that the buff is actually applied every 5s, which is a mistake in my origininal work ...

however for the question if the group is split or the chance is .5 I trust Ntsc more than other sources.

Also I can confirum from my resources rather a split than .5 chance.

The idea that the dmg spell also applies the buff aura seems very bad to me, and is also not supported with my resources.

(the targets of the dmg spell are only the players that are hit)

Also maybe this spell should target only players, but for this I need more research (note: targeting is not affecting)

Link to comment
Share on other sites

The idea that the dmg spell also applies the buff aura seems very bad to me, and is also not supported with my resources.

(the targets of the dmg spell are only the players that are hit)

Also maybe this spell should target only players, but for this I need more research (note: targeting is not affecting)

I think, we have no other choice with the dmg spell. Only the damage buff has a periodic for damage and buff-stack-calculation.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use