Jump to content

[patch] Aoe Target Should Be Based On Caster, Not Original Caster


Guest megamage
 Share

Recommended Posts

Some spells make the target do AOE and damage its allies.

Example such as 39968 and 17739 have implicit_target = friendly target around the caster. If we use the original caster to check the target, the AOE will damage original caster's allies. The target check should be based on the caster, only the damage bonus is based on original caster.

Another example is 27285. This spell has implicit_target = enemy target in the area. Currently in core this spell is casted by the aura-bearer. That is wrong. This spell should be casted by the original caster, not the aura bearer.

The difference between 39968 and 27285 is: 39968 is a range = 0 spell, but 27285 is a range = 50000 spell

The correct cast sequence is:

39968: A casts 39835 to B, B triggers 39968, then B cast 39968 to itself and damage all B's friend around B.

27285: A casts 27243 to B, B triggers 27285, then A cast 27285 to B again and damage all A's enemy around B.

Index: Spell.h
===================================================================
--- Spell.h        (revision 6480)
+++ Spell.h        (working copy)
@@ -580,7 +580,7 @@
                        SpellTargets TargetType = SPELL_TARGETS_NOT_FRIENDLY)
                        : i_data(&data), i_spell(spell), i_push_type(type), i_radius(radius), i_TargetType(TargetType)
                {
-                        i_originalCaster = spell.GetOriginalCaster();
+                        i_originalCaster = spell.GetCaster();//spell.GetOriginalCaster();
                }

                template<class T> inline void Visit(GridRefManager<T>    &m)

Link to comment
Share on other sites

Tested on 6482 with patch. My raid with 25 mans start a gruul dragonkiller encounter, but when gruul cast a "Shatter" - raid wipes instantly, 10350 damage in two ticks (20700 at each player). I think damage to their allies based on proximity not work and on mangos that spell cause a fixed damage (10350).

Link to comment
Share on other sites

This is the patch for seed (actually it is the 27285 spell I was talking about).

Index: Unit.cpp
===================================================================
--- Unit.cpp        (revision 6483)
+++ Unit.cpp        (working copy)
@@ -4961,7 +4999,8 @@
                                        RemoveAurasDueToSpell(triggeredByAura->GetId());

                                        // Cast finish spell (triggeredByAura already not exist!)
-                                        CastSpell(this, 27285, true, castItem, NULL, casterGuid);
+                                        if(Unit* caster = GetUnit(*this, casterGuid))
+                                                caster->CastSpell(this, 27285, true, castItem);
                                        return;
                                }

@@ -4983,7 +5022,8 @@
                                        RemoveAurasDueToSpell(triggeredByAura->GetId());

                                        // Cast finish spell (triggeredByAura already not exist!)
-                                        CastSpell(this, 32865, true, castItem, NULL, casterGuid);
+                                        if(Unit* caster = GetUnit(*this, casterGuid))
+                                                caster->CastSpell(this, 32865, true, castItem);
                                        return;
                                }
                                // Damage counting

Link to comment
Share on other sites

Patch attempt fix problem in hack way. original caster _correctly_ used for selection as expected for this functions. If something not work correctly then SPELL_TARGETS_* value pprovided for _this_ specific target modes combination incorretly.

Correct way: implementing step by step 2-step targeting scheme with ImplicitTargetA provide data for ImplicitTargetB targeting. Work in this implementation only in beggining :/

Link to comment
Share on other sites

Why say it is a hack? You can .learn 27285 and will see it is a 50000-yard range spell. There is no proof that this spell should be casted by the m_target of the aura. Though there is also no proof that this shiould be casted by the caster, a 50000-yard range makes it more believable. If this should be casted by the m_target, why a 50000-yard range is needed?

For implicit target = 22/30 AOE damge spells, I know lots of boss spells are of this kind. Some of them are to give target an aura, to periodically trigger this AOE spell to damage its teammates. Others are triggered by one-shot spells, such as 41131. 41131 is also incorrently handled in core. Now it is:

unitTarget->CastSpell(unitTarget, 41131, true);

It should be:

unitTarget->CastSpell(unitTarget, 41131, true, 0, 0, originalCaster);

What should be questioned is the current way. There is no proof that we should use originalcaster to select target for some spells, while not use it for other spells. Target selection should totally be based on dbc.

Link to comment
Share on other sites

If you go to wowhead to search for spell 27285, you will see a link to youtube in the comments. That video shows how 27285 works in official (players learn it accidentally due to bug). It is like a blizzard or flamestrike spell.

I do not know if someone who play in official can test this spell. First cast seed of corruption to an enemy, then log out or teleport to another map or kill himself, then another player trigger the proc spell, and see if there is aoe damage.

Link to comment
Share on other sites

  • 1 month later...

I tested this patch and experienced the following problems (used shatter for testing):

When i casted shatter (.cast command), it not only hit the enemy but myself too. This should not happen. I am not sure of other such spells.

When i casted shatter once, it did damage. Second time onwards, it didn't affect the nearby friends at all. It just affected me. However, if I teleport to him (using .goname), the spell hits him again. It seems as if as soon as he gets damage, server assumes we are enemies and reloads this information when i teleport.

As for shatter's damage depending on distance, I tried a small patch in the place where meteor like spells are implemented to check the distance and change damage accordingly and it worked.

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