Jump to content

[patch] [0.12] Shadow Embrace Debuff


Guest pelle

Recommended Posts

Hi at all, note that this is my first patch that i submit so if there's something wrong... tell it to me.

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

This patch fix the romove of old 2.4.3 debuff that decrease of x% the melee damage of a target. (taked as a talent on warlock affliction tree).

For which repository revision was the patch created?

Mine is working on 8067 of 0.12 but i think it will work on earlier too. not needed on other branch because talent change.

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

Probably, don't know.

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

Myself.

I'm not skilled on git so i can't do a patch, if someone will do it will be apprectiated.

this is the code on spellauras.cpp

@@ -5449,10 +5546,60 @@ void Aura::HandleSpiritOfRedemption( bool apply, bool Real )
        m_target->DealDamage(m_target, m_target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, GetSpellProto(), false);
}

void Aura::CleanupTriggeredSpells()
{
+	bool remove_aaura;     //random name to find a free one P_P
+	remove_aaura=true;
+
+//shadow embrace
+
+	Unit::AuraList const& auras = m_target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
+	for(Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
+	{
+		SpellEntry const* itr_spell = (*itr)->GetSpellProto();
+		if(itr_spell && itr_spell->SpellFamilyName==SPELLFAMILY_WARLOCK){
+		remove_aaura=false;
+		break;
+		}
+	}
+
+
+	if(remove_aaura)
+	{
+		m_target->RemoveAurasDueToSpell(32391);  //remove debuff from higher
+		m_target->RemoveAurasDueToSpell(32390);
+		m_target->RemoveAurasDueToSpell(32389);
+		m_target->RemoveAurasDueToSpell(32388);
+		m_target->RemoveAurasDueToSpell(32387);
+     }
+
+
+
+
+
   uint32 tSpellId = m_spellProto->EffectTriggerSpell[GetEffIndex()];  //post bug, wtf is  should be EffectTriggerSpell[GetEffIndex()];
    if(!tSpellId)
        return;

    SpellEntry const* tProto = sSpellStore.LookupEntry(tSpellId);

all improvements on this are very usefull :lol:

Link to comment
Share on other sites

This is not nice in generla use full list explcit spell ids for like remove.

probably a little for cycle?

But your patch not work also correctly: what if 2 warlock casted spell that triggred this debuff applied? With your code it will remove debuf at first removed effect of any from warlocks.

yes i thought on it, probably a check if the player hasn't the talent? so if there aren't dot of a player with the talent it remove..? and if there are dot of player that hasn't the talent remove?

what pointer i got to use to the HasSpell function? caster-> or what?

Link to comment
Share on other sites

Look at Unit::RemoveAurasByCasterSpell. You not need know what caster know, you need be sure that if aura applied at some aura add then at remove by same aura remove. Related spell is single target, so one caster will have not more single aura at target. And you can removed aura base at main aura caster.

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