Jump to content

[patch] kill command


pasdVn

Recommended Posts

Kill Command: http://www.wowhead.com/?spell=34026

One more of those crazy spells. Mechanic is working like that:

  • * owner gets a aura, applying a spell mod that increases pet special ability damage (pet uses owners spell mods)
    * pet gets dummy aura that triggers on a damage spell
    * both auras have full stack (that means 3 in this case, no charges as normal spellmods) at beginning
    * when pet dummy aura triggers we have to remove owners aura manually, so that that the stack gets smaller and so the amount of the spellmod

http://github.com/pasdVn/mangos/commit/eb55b0b3304b1a88bc12644999f8639f4a941e89

[added 2-20-2009]

Here just an additional fix concerning "Kill Command":

http://github.com/pasdVn/mangos/commit/e9855c55153d18815c9691455a634ddf3922e817

Just the second effect of "Focused Fire" (http://www.wowhead.com/?spell=35029).

Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...
  • 2 weeks later...
  • 4 months later...

Update rev 9542

Kill command

src/game/SpellAuras.cpp

@@ -1232,6 +1232,12 @@ bool Aura::modStackAmount(int32 num)
        return true; // need remove aura
    }

+    // reset charge when modding stack, update aura in SetStackamount
+    m_procCharges = m_spellProto->procCharges;
+    Player* modOwner = GetCaster() ? GetCaster()->GetSpellModOwner() : NULL;
+    if(modOwner)
+        modOwner->ApplySpellMod(GetId(), SPELLMOD_CHARGES, m_procCharges);
+
    // Update stack amount
    SetStackAmount(stackAmount);
    return false;
@@ -2102,6 +2108,21 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
                if(caster)
                    caster->CastSpell(caster, 13138, true, NULL, this);
                return;
+            case 34026:                                     // kill command
+            {
+                 Unit* caster = GetCaster();
+                if(!caster || caster->GetTypeId() != TYPEID_PLAYER || !caster->GetPet() )
+                    return;
+                caster->CastSpell(caster,34027,true,NULL,this);
+
+                // set 3 stacks
+                Aura* owner_aura  = caster->GetAura(34027,EFFECT_INDEX_0);
+                Aura* pet_aura  = caster->GetPet()->GetAura(58914,EFFECT_INDEX_0);
+                if( owner_aura )
+                    owner_aura->SetStackAmount(3);
+                if( pet_aura )
+                    pet_aura->SetStackAmount(3);
+                return;
+            }
            case 39850:                                     // Rocket Blast
                if(roll_chance_i(20))                       // backfire stun
                    m_target->CastSpell(m_target, 51581, true, NULL, this);
@@ -2207,6 +2228,17 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
                m_target->CastSpell(m_target, 47287, true, NULL, this);
                return;
            }
+            case 58914:
+            {
+                Unit* caster = GetCaster();
+                // kill command, just eye candy
+                if(!caster)
+                    return;
+                // the "casting" dummy aura
+                caster->RemoveAurasDueToSpell(34026);
+                // the spellmod aura (e.g. in case pet gets killed)
+                caster->RemoveAurasDueToSpell(34027);
+                return;
+            }
        }

        if (caster && m_removeMode == AURA_REMOVE_BY_DEATH)

src/game/Unit.cpp

@@ -1028,7 +1028,16 @@ void Unit::CalculateSpellDamage(SpellNonMeleeDamage *damageInfo, int32 damage, S
            // Physical Damage
            if ( damageSchoolMask & SPELL_SCHOOL_MASK_NORMAL )
            {
-                //Calculate armor mitigation
+                // FIX ME: physical school damage spells should also get affected from bonus damage
+                for (int j = 0; j < 3; j++)
+                    if( spellInfo->Effect[j] == SPELL_EFFECT_SCHOOL_DAMAGE )
+                        if( Player* modOwner = GetSpellModOwner() )
+                        {
+                            modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_DAMAGE, damage);
+                            break;
+                        }
+
+        //Calculate armor mitigation
                damage = CalcArmorReducedDamage(pVictim, damage);
                // Get blocked status
                blocked = isSpellBlocked(pVictim, spellInfo, attackType);
@@ -4834,6 +4843,16 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
                    target = this;
                    break;
                }
+                // kill command (pet aura proc)
+                case 58914:
+                {
+                    Unit* owner = GetOwner();
+                    if( !owner || owner->GetTypeId() != TYPEID_PLAYER )
+                        break;
+                    // reduce the owner's aura stack
+                    owner->RemoveSingleSpellAurasFromStack(34027);
+                    break;
+                }
                // Vampiric Touch (generic, used by some boss)
                case 52723:
                case 60501:
@@ -11061,9 +11080,9 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
        // Sort spells and remove dublicates
        removedSpells.sort();
        removedSpells.unique();
-        // Remove auras from removedAuras
+        // Remove auras (one stack) from removedAuras
        for(RemoveSpellList::const_iterator i = removedSpells.begin(); i != removedSpells.end();++i)
-            RemoveAurasDueToSpell(*i);
+            RemoveSingleSpellAurasFromStack(*i);
    }
}

focused fire

src/game/SpellAuras.cpp

@@ -2239,8 +2239,15 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
                caster->RemoveAurasDueToSpell(34027);
                return;
            }
+            case 34026:
+            {
+                Unit* caster = GetCaster();
+                // kill command, remove focused fire bonus
+                if(!caster)
+                    return;
+                caster->RemoveAurasDueToSpell(60110);
+                caster->RemoveAurasDueToSpell(60113);
+                 return;
+            }
        }
-
        if (caster && m_removeMode == AURA_REMOVE_BY_DEATH)
        {
            // Stop caster Arcane Missle chanelling on death

src/game/Unit.cpp

@@ -5505,7 +5505,14 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
                target = this;
                break;
            }
-            break;
+            // Focused Fire, kill command proc
+      if ( dummySpell->Id == 35029 || dummySpell->Id == 35030 )
+      {
+        triggered_spell_id = dummySpell->Id == 35029 ? 60110 : 60113;
+        target = this;
+        break;
+      }
+      break;
        }
        case SPELLFAMILY_PALADIN:
        {

Is it correct?

Work in compile but if i use spell 34026 nothing

each special attack of pet spell 34027 disappear, normally "30 seconds remaining"

Link to comment
Share on other sites

- //Calculate armor mitigation

+ // FIX ME: physical school damage spells should also get affected from bonus damage

+ for (int j = 0; j < 3; j++)

+ if( spellInfo->Effect[j] == SPELL_EFFECT_SCHOOL_DAMAGE )

+ if( Player* modOwner = GetSpellModOwner() )

+ {

+ modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_DAMAGE, damage);

+ break;

+ }

I'm not sure if this part isn't already implemented in mangos in more generic way
Link to comment
Share on other sites

As this patch seems to be quite popular currently, I updated/rewrote it a bit.

What I noticed, is that the pet's dummy aura can also proc from hot's (Spirit Bonde) the proc flag (PROC_FLAG_ON_DO_PERIODIC) does not differentiate bewteen damage or healing :-/. Using SpellFamilyFlags is also not possible here, because than we would get procs from Growl.... But anyway it's no problem, as we can check everything during the dummy proc. I just wondered, how this is done with other procs...

Edit: przemratajczak, you are right. This hack is not needed anymore :)

Link to comment
Share on other sites

1) thanks for your great job :P pasdVn does it still requires spell_proc_event records?

2)

                   if( !p_caster->GetPet() )
                   {
                       Spell::SendCastResult((Player*)p_caster, m_spellProto, 0, SPELL_FAILED_NO_PET);
                       ((Player*)p_caster)->RemoveSpellCooldown(m_spellProto->Id, true);
                       SetAuraDuration(0);
                       return;
                   }

looks like not the best approach, didn't tested it yet but I met similar solution with removing cooldown on spell when cast failed in some other patch. This leads to exploit with another auras procing from spell cast (for example one of metagems restoring mana). ofc this could be considered as a core issue.

Link to comment
Share on other sites

1) No, sql's are not needed anymore. I decided to make it directly, and not give focused fire any artificial proc flags.

2) Probably you are right. Maybe it's better to add any hardcoded check in checkcast? I just thought I could include it there, if hI ave to hack around in HandleDummyAura^^

Link to comment
Share on other sites

  • 9 months later...
  • 1 month later...

kero99 said: "http://pastebin.com/14W4e01y Become from spell http://www.wowhead.com/spell=34026 ( Kill Command, Mangos Commit 11013) interaction with some other Pet spells, until we found the problem.. if you disable spell, crash dissapear =)"

Link: https://github.com/rsa/scriptdev2/commit/08a0b178914ebd060ac5bfc4ea13825d66fe5665#comments

It generates crash, is it possible?

greetings.

Link to comment
Share on other sites

may be, although I have not found one possible cause (I have not used these spells, nor depend on them, and in general the mechanisms are different). unfortunately, the crash occurs only when the load from 500-1000 players, but servers, like this, works on a clean corel, I do not know ...

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