Jump to content

[patch] Implementing implicit target 49, 50.


Guest qsa
 Share

Recommended Posts

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

Implementing implicit target 49, 50 used in over 20 spells each, summons mostly.

For which repository revision was the patch created?

8526

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

maybe, too lazy checking for all involved spells.

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

Me

Patch:

http://github.com/abcxaos/mangos/commit/42789d75fcd6934dde35689f334e9fa5c74073b4

commit 42789d75fcd6934dde35689f334e9fa5c74073b4
Author: sixsixnine <[email protected]>
Date:   Wed Sep 23 21:46:52 2009 +0300

   + Implementing implicit target 49, 50.

   Signed-off-by: sixsixnine <[email protected]>

diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index 185541c..a8bc3b1 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -1041,8 +1041,10 @@ enum Targets
    TARGET_TOTEM_FIRE                  = 44,
    TARGET_CHAIN_HEAL                  = 45,
    TARGET_SCRIPT_COORDINATES          = 46,
-    TARGET_DYNAMIC_OBJECT              = 47,
+    TARGET_DYNAMIC_OBJECT_FRONT        = 47,
    TARGET_SUMMON                      = 48,
+    TARGET_DYNAMIC_OBJECT_LEFT_SIDE    = 49,
+    TARGET_DYNAMIC_OBJECT_RIGHT_SIDE   = 50,
    TARGET_AREAEFFECT_CUSTOM_2         = 52,
    TARGET_CURRENT_ENEMY_COORDINATES   = 53,                // set unit coordinates as dest, only 16 target B imlemented
    TARGET_ALL_RAID_AROUND_CASTER      = 56,
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index cceda46..e4eec28 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1421,7 +1421,6 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap)
        case TARGET_TOTEM_FIRE:
        case TARGET_SELF:
        case TARGET_SELF2:
-        case TARGET_DYNAMIC_OBJECT:
        case TARGET_AREAEFFECT_CUSTOM_2:
        case TARGET_SUMMON:
            TagUnitMap.push_back(m_caster);
@@ -2141,6 +2140,29 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap)
            if(DynamicObject* dynObj = m_caster->GetDynObject(m_triggeredByAuraSpell ? m_triggeredByAuraSpell->Id : m_spellInfo->Id))
                m_targets.setDestination(dynObj->GetPositionX(), dynObj->GetPositionY(), dynObj->GetPositionZ());
            break;
+
+        case TARGET_DYNAMIC_OBJECT_FRONT:
+        case TARGET_DYNAMIC_OBJECT_LEFT_SIDE:
+        case TARGET_DYNAMIC_OBJECT_RIGHT_SIDE:
+        {
+            if (!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
+            {
+                float angle = m_caster->GetOrientation();
+                switch(targetMode)
+                {
+                    case TARGET_DYNAMIC_OBJECT_FRONT:                         break;
+                    case TARGET_DYNAMIC_OBJECT_LEFT_SIDE:  angle -= 3*M_PI/4; break;
+                    case TARGET_DYNAMIC_OBJECT_RIGHT_SIDE: angle += 3*M_PI/4; break;
+                }
+
+                float x,y;
+                m_caster->GetNearPoint2D(x,y,radius,angle);
+                m_targets.setDestination(x,y,m_caster->GetPositionZ());
+            }
+
+            TagUnitMap.push_back(m_caster);
+            break;
+        }
        case TARGET_POINT_AT_NORTH:
        case TARGET_POINT_AT_SOUTH:
        case TARGET_POINT_AT_EAST:

Link to comment
Share on other sites

Cant say is "fixed" all of listed below, but there's one bug less with them at the moment :)

PS: thanks for reviewing it so rapidly.

PSS: Can error output be added in default case of that switch in SetTargetMap()? it will sure make handling missig types and debugging much easier.

       id   spellname_0       21962   Force of Nature       21963   Force of Nature       24681   Summon Nightmare Illusions       24729   Summon Nightmare Illusions       24813   Seeping Fog       24814   Seeping Fog       24841   Summon Shade of Taerar       24842   Summon Shade of Taerar       25682   Summon Mana Fiend       25683   Summon Mana Fiend       28353   Raise Dead       29210   Blink       29211   Blink       29951   Blizzard       30684   Bleed Spice, Create cluster E (DND)       30685   Bleed Spice, Create cluster W (DND)       31981   Tainted Earthgrab Totem       32316   Summon Ethereal Wraith       32349   Summon Arcane Fiend       32353   Summon Arcane Fiend       32663   Summon Dark Vortex       32723   Summon Bonechewer Riding Wolf       33539   Summon Syth Frost Elemental       33540   Summon Syth Shadow Elemental       34067   Summon Worg       34247   Summon Lasher Beast       34368   Summon Riding Worg       34743   Summon Greater Sapling       34951   Summon Deathforge Felguard       35251   Summon Arcane Golem       35260   Summon Arcane Golem       35285   Summon Nether Wraith       35286   Summon Nether Wraith       35421   Summon Sporewind Frenzy       35422   Summon Sporewind Frenzy       35428   Summon Lasher Beast       35882   Summon Azurebeak       35968   Gravity Lapse       35974   Gravity Lapse       35975   Gravity Lapse       35981   Gravity Lapse       35985   Gravity Lapse       35989   Gravity Lapse       36477   Summon Mana Beast       36848   Mirror Image       37385   Spirit of Fire       37693   Force of Nature       37694   Force of Nature       39269   Summon Misha       39272   Summon Wrath Hound       39583   Change Facing, Left       39866   Summon Rizzle       39906   Summon Riding Warhound       40574   Picnic Umbrella       40698   Caged       40702   Caged       40781   Summon East Stun Rope       40782   Summon West Stun Rope       40797   Summon Cannon       40943   Mirror Image       41118   Summon Shadow Demon       41120   Summon Shadow Demon       41123   Summon Bronco       41175   Ashtongue Rogue       42035   Ashtongue Wave B       42181   Summon Amani'shi Sentries       42182   Summon Amani'shi Sentries       44219   Gravity Lapse       44223   Gravity Lapse       45093   Romantic Umbrella       45575   Magmoth Fire Totem       45756   Drop Warsong Land Mine       46002   Summon Dark Fiend       46006   Summon Dark Fiend       46154   Summon Pure Energy       46159   Summon Pure Energy       46657   Taunka'le Evacuee       46658   Taunka'le Evacuee       46972   Summon Summer Scorchling       47123   Summon Festival Scorchling       47404   Thor Modan Mole Machine (Alt)       47707   Summon Telestra Clone (Fire)       47709   Summon Telestra Clone (Frost)       47839   Warsong Land Mine       47955   Summon Crystal Spike       47957   Summon Crystal Spike       48587   Summon Avenging Spirit Summoner       48589   Summon Avenging Spirit Summoner       48631   Summon Ymirjar Warrior - W       48632   Summon Ymirjar Warrior - W       48633   Summon Ymirjar Harpooner - W       48634   Summon Ymirjar Harpooner - E       48635   Summon Ymirjar Witch Doctor - W       48636   Summon Ymirjar Witch Doctor - E       49114   Place Scourge Discombobulater       49859   Rune of Command       50584   Summon Frozen Spheres       50586   Summon Frozen Spheres       52123   Copy of Feral Spirit       52991   Duel Flag       55352   Summon Lo'Gosh       56080   Summon Nikita       56082   Summon Billie       57895   Dummy Gate       57899   Portal to the Valley of Echoes       57913   Summon Ghoul       58049   Summon Mason       58050   Summon Mason       58833   Mirror Image       58834   Mirror Image       62576   Blizzard       62602   Blizzard       63343   Focused Eyebeam Summon       63701   Focused Eyebeam Summon 2   

Link to comment
Share on other sites

PM me a patch with error output, I'll try to make smtn with it ^_^

Something as simple as attacked will do just fine I guess.

Thanks in advance.

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 4bd0a31..02b64a0 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2185,6 +2178,7 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap)
                    }
                    break;
                default:
+                    sLog.outError( "SPELL: Unknown implicit target (%u) for spell ID %u", targetMode, m_spellInfo->Id );
                    break;
            }
            break;

Link to comment
Share on other sites

It helps on version switches the most I guess, same as any other "missing data" related error.

I mean debugging spells at the moment isn't too nice, alot of things can go wrong.

Not that many un-implemented targets left after those additions.

4 - 4 npc spells

11 - 1 spell

29 - 20 spells

36 - 5 spells

40 - 193 spells - focus/specific game object

Always used with spell effect Activate Object (86)

If RequiresSpellFocus is set, it is our target.

Else, it is either selected or, we need to use spell_script_target table.

54 - 26 spells

58 - 5 spells

59 - 5 spells, somesort of cone effect

60 - 82 spells, somesort of cone effect (".. cone of water that douses .." , "..enemies in a cone in front of the caster every.." )

64 - 5 spells (Dancing Rune Weapon) front left?

66 - 3 spells

67 - 6 summons

68 - 1 spell

69 - 1 spell

70 - 1 spell

74 - 19 spells

75 - 9 spells

88 - 18 spells

91 - 17 spells

92 - 5 spells

94 - 10 spells - vehicle used by caster

95 - 2 spells - target's vehicle

96 - 1 spell

97 - 2 spells - vehicle passenger

I'll play with those bit longer, maybe something comes out of it.

Link to comment
Share on other sites

 Share

×
×
  • 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