Jump to content

[Mangos one][Patch] Fix Lightwell


Guest FH3095

Recommended Posts

Fix: Lightwell doesn't spawn the gameobject. The reason: The TargetA1 and TargetB1 cause the Spell to search for a gameobject around the selected target. But for successfully finding a gameobject around the target, the spell at least needs to spawn a temporary gameobject and add appropriate information to spell_script_target.

Since every targetList is empty, and Spell::HandleEffects is only called when

a) There is a Item, Creature or Gameobject in on of the targetLists

b) the SpellEffect is SPELL_EFFECT_SEND_EVENT or SPELL_EFFECT_PERSISTENT_AREA_AURA

Spell::HandleEffects is never called because Lightwell uses SPELL_EFFECT_TRANS_DOOR.

To fix this we could handle SPELL_EFFECT_TRANS_DOOR like SPELL_EFFECT_SEND_EVENT.

This isn't the best way to fix that, but it is the only one I could imagine.

Revision: s0906

Author: Me

From 5aad07c6b3d807560bb532cd56b69e563a112abe Mon Sep 17 00:00:00 2001
From: FH <[email protected]>
Date: Fri, 4 Mar 2011 21:24:20 +0100
Subject: [PATCH] Fix lightwell by calling Spell::HandleEffects(0,0,0,...) when Effect==SPELL_EFFECT_TRANS_DOOR and !HaveTargetsForEffect

---
src/game/Spell.cpp |    6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 877194d..ded9c46 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2824,8 +2824,10 @@ void Spell::_handle_immediate_phase()
        if(m_spellInfo->Effect[j] == 0)
            continue;

-        // apply Send Event effect to ground in case empty target lists
-        if( m_spellInfo->Effect[j] == SPELL_EFFECT_SEND_EVENT && !HaveTargetsForEffect(SpellEffectIndex(j)) )
+        // apply Send Event and spawn gameobject effect to ground in case empty target lists
+        if ((m_spellInfo->Effect[j] == SPELL_EFFECT_SEND_EVENT ||
+            m_spellInfo->Effect[j] == SPELL_EFFECT_TRANS_DOOR) &&
+            !HaveTargetsForEffect(SpellEffectIndex(j)))
        {
            HandleEffects(NULL, NULL, NULL, SpellEffectIndex(j));
            continue;
-- 
1.7.3.1.msysgit.0

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