Jump to content

[BUG] 2.4.3 Kill Command not working


Guest mercer

Recommended Posts

Mangos Branch 0.13 Build 9198

TBCUDB

SD2 1567

AHBOT 0.12

Current behavior:

Attempting to use "Kill Command" on any target produces the error "Invalid Target".

Proper behavior:

Giving your pet the "Kill Command" should execute the spell "kill command", which causes you pet to attack.

This worked previously in build 6539.

Link to comment
Share on other sites

  • 2 weeks later...

Confirmed, backport of 9358. Used to work in 8719, hunters are bugging me like crazy. Any fix?

//edit

To elaborate: when you try to cast it normally it fails, which is correct. However, after you or your pet lands a critical, you are still unable to cast Kill Command. Not sure how this was / should be implemented, but it's a rather neat skill not to have anymore. The skill does light up (as if available), but when you cast you get an (Invalid Target) error.

Link to comment
Share on other sites

Found the problem: it's the new part of if(non_caster_target) in Spell::CheckCast. I am guessing the problem is dat Kill Command (and a few other skills besides) have an implicit positive effect (such as give a buff to a friendly unit) while the target is negative - like an enemy. To fix this properly, this should be changed:

               if (IsExplicitPositiveTarget(m_spellInfo->EffectImplicitTargetA[k]))
               {
                   if (!target_hostile_checked)
                   {
                       target_hostile_checked = true;
                       target_hostile = m_caster->IsHostileTo( [EffectImplicitTarget] );
                   }

In other words, the target_hostile check should not check for 'main' target, but for the target of the specific effect. I have no idea how to do this, perhaps a mangos dev can look into it?

As a temporary hack you can disable the check alltogether:

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 45039fe..3231fc5 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -3464,7 +3464,7 @@ SpellCastResult Spell::CheckCast(bool strict)
            bool target_hostile_checked = false;
            bool target_friendly = false;
            bool target_friendly_checked = false;
-            for(int k = 0; k < 3;  ++k)
+ /*           for(int k = 0; k < 3;  ++k)
            {
                if (IsExplicitPositiveTarget(m_spellInfo->EffectImplicitTargetA[k]))
                {
@@ -3493,6 +3493,7 @@ SpellCastResult Spell::CheckCast(bool strict)
                    explicit_target_mode = true;
                }
            }
+*/
            // TODO: this check can be applied and for player to prevent cheating when IsPositiveSpell will return always correct result.
            // check target for pet/charmed casts (not self targeted), self targeted cast used for area effects and etc
            if (!explicit_target_mode && m_caster->GetTypeId() == TYPEID_UNIT && m_caster->GetCharmerOrOwnerGUID())
-- 
1.6.1.9.g97c34

Link to comment
Share on other sites

  • 3 months later...

As a temporary hack you can disable the check alltogether

More simple hack-way:

@@ -3790,7 +3790,7 @@ SpellCastResult Spell::CheckCast(bool strict)
                        target_friendly = m_caster->IsFriendlyTo(target);
                    }

-                    if(target_friendly)
+                    if(target_friendly && m_spellInfo->Id != 34026) //Kill Command
                        return SPELL_FAILED_BAD_TARGETS;

                    explicit_target_mode = true;

But problem still exist in general.

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