Jump to content

[patch] Support For Spell 25648

Guest darwolia

Recommended Posts

What does this patch fix: GameObjects summoned by spell 25648 (Sand Trap) should be summoned at target-location, not at location of caster

For Rev: r6324

link in Bug-Section: no

written by: Darwolia

Probably there could be a better solution - but some gameobjects summoned by SPELL_EFFECT_SUMMON_OBJECT_WILD should be summoned at location of target and not at location of caster. Example: sand trap (25648)

Code is tested and works:

Index: SpellEffects.cpp
--- SpellEffects.cpp        (revision 6324)
+++ SpellEffects.cpp        (working copy)
@@ -4320,6 +4320,16 @@

+        // Sand Trap should be summoned at target, not at caster
+        if (m_spellInfo->Id == 25648)
+        {        
+                if(!unitTarget)
+                        return;
+                if(!unitTarget->isAlive())
+                        return;
+                unitTarget->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
+        }
        Map *map = target->GetMap();

        if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, map,

Link to comment
Share on other sites

Unfortunately he seems to be right! There is no other way then to make some exceptions, since there ´s no targetype set in DBC and the range of spells isn ´t enough to determine a good targettype.

Darwo, i really tried to proove you as a fool but i failed :)

Just two things:

+ if(!unitTarget)

+ return;

+ if(!unitTarget->isAlive())

+ return;

could be: if(!unitTarget || !unitTarget->isAlive()) return;

and instead unitTarget->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);

unitTarget->GetPosition(x,y,z); faster and i think more heavy snowstorm like

i would have written that in icq, but you ´re away

+1 for svn ! :)

Link to comment
Share on other sites

TargetA[1-3] and TargetB[1-3] are all zero in dbc-file - looked them up via

error_log("TargetA[1]=%i, 2=%i, 3=%i", m_spellInfo->EffectImplicitTargetA[1], m_spellInfo->EffectImplicitTargetA[2], m_spellInfo->EffectImplicitTargetA[3]);
               error_log("TargetB[1]=%i, 2=%i, 3=%i", m_spellInfo->EffectImplicitTargetB[1], m_spellInfo->EffectImplicitTargetB[2], m_spellInfo->EffectImplicitTargetB[3]);

What do u mean? Set TargetA or TargetB? i don't have that much insight into server-code, so i don't know how to handle those.

A little explanation would be useful

Link to comment
Share on other sites

For summon object effect, we have UnitTarget but in spelleffect.cpp the unit target is not checked. If there is no dest then ClosePoint of caster is used. I think we should change the coordinate selection for gobject as the same as that for summoning creatures.

Link to comment
Share on other sites

  • 3 years later...
  • 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