Jump to content

[11387] [patch] Implement spell 45958 - Signal Alliance


Guest dpedroia15

Recommended Posts

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

Implements Script Effect and Dummy Effect for spell 45958

* For which repository revision was the patch created?

11346

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

No.

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

Me!

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 7e9697b..f0827d9 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -1459,6 +1459,11 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
                    m_caster->RemoveAurasDueToSpell(45683);
                    return;
                }
+                case 45958:                                 // Signal Alliance
+                {
+                    m_caster->CastSpell(m_caster, m_spellInfo->EffectBasePoints[eff_idx], true);
+                    return;
+                }
                case 45990:                                 // Collect Oil
                {
                    if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
@@ -6594,6 +6599,11 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)

                    return;
                }
+                case 45958:                                 // Signal Alliance
+                {
+                    m_caster->RemoveAurasDueToSpell(m_spellInfo->EffectBasePoints[eff_idx]);
+                    return;
+                }
                case 46203:                                 // Goblin Weather Machine
                {
                    if (!unitTarget)

Link to comment
Share on other sites

Not so sure this is correct.

1: Should use CalculateSimpleValue() not base points directly.

2: Searched google for video, and it show the aura from spell 45957 is present even after using the item. I suspect this aura only goes away when the summoned is no longer there (ref dummy aura from spell 45963 (from 45975)).

The script effect is probably a check for the presence of aura, a condition for something as this effect often have.

Link to comment
Share on other sites

Diff below is possibly more correct.

This will check if aura is present, and if it is, break; to let database process further by using spell_scripts table (summoned comes running, do some talking and complete quest).

 src/game/SpellEffects.cpp |   14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 6854496..698d66c 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -1434,6 +1434,11 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)

                    break;
                }
+                case 45958:                                 // Signal Alliance
+                {
+                    m_caster->CastSpell(m_caster, m_spellInfo->CalculateSimpleValue(eff_idx), true);
+                    return;
+                }
                case 45980:                                 // Re-Cursive Transmatter Injection
                {
                    if (m_caster->GetTypeId() == TYPEID_PLAYER && unitTarget)
@@ -6601,6 +6606,15 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
                    m_caster->SetDisplayId(display_id);
                    return;
                }
+                case 45958:                                 // Signal Alliance
+                {
+                    // "escort" aura not present, so let nothing happen
+                    if (!m_caster->HasAura(m_spellInfo->CalculateSimpleValue(eff_idx)))
+                        return;
+                    // "escort" aura is present so break; and let DB table spell_scripts be used and process further.
+                    else
+                        break;
+                }
                case 46203:                                 // Goblin Weather Machine
                {
                    if (!unitTarget)

If aura is not present, we must assume the minipet is not present either. The "escort" aura I think we can handle in this way:

 src/game/SpellAuras.cpp |   14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 6727fae..218e051 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -1973,6 +1973,14 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
                    case 43873:                             // Headless Horseman Laugh
                        target->PlayDistanceSound(11965);
                        return;
+                    case 45963:                             // Call Alliance Deserter
+                    {
+                        // Escorting Alliance Deserter
+                        if (target->GetMiniPet())
+                            target->CastSpell(target, 45957, true);
+
+                        return;
+                    }
                    case 46699:                             // Requires No Ammo
                        if (target->GetTypeId() == TYPEID_PLAYER)
                            // not use ammo and not allow use
@@ -2378,6 +2386,12 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
                    target->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
                return;
            }
+            case 45963:                                     // Call Alliance Deserter
+            {
+                // Escorting Alliance Deserter
+                target->RemoveAurasDueToSpell(45957);
+                return;
+            }
            case 46308:                                     // Burning Winds
            {
                // casted only at creatures at spawn

The minipet have duration 15 minutes, which makes sense (and then the dummy aura). "Escort" aura will then be removed when the minipet duration ends.

Link to comment
Share on other sites

Used wrapper hide differences in this part for diff client versions dbc. In past has been special field that used instead 1.

In 4.x as i remember no -1 and dbc recalculated use real value. If use CalculateSimpleValue() then we can update only this function and get for same code same results for diff client versions in expected for client formula.

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