Jump to content

Lukyn

Members
  • Posts

    1
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by Lukyn

  1. What bug does the patch fix? What features does the patch add? Due to changes in Hunger for Blood spell in 3.1.3, it's application requires "bleeding effect" on the rogue target. "Bleeding effect" is represented by "AuraState = 18" enumerated as AURA_STATE_UNKNOWN18 in recent revision. First this patch modifies AuraState on rougue's target to expected value, when any aura with bleed mechanic is applied. Second it adds HasAuraMechanic(...) method to Unit class to recognize if there is an aura on unit with respective mechanic (bleed in this case). This feature is used for correct removal of AuraState::AURA_STATE_BLEEDING when there is nothing on unit causing bleeding. And finally it handles correct application of Hunger for Blood aura to the caster (while it is presented as Dummy effect, instead of Apply Aura: Mod Dmg % as in previous WoW versions). For which repository revision was the patch created? revision 8254 Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread. -- Who has been writing this patch? Please include either forum user names or email addresses. by myself diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index a1879af..bdb30ab 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -897,7 +897,7 @@ enum AuraState AURA_STATE_SWIFTMEND = 15, // T | AURA_STATE_DEADLY_POISON = 16, // T | AURA_STATE_ENRAGE = 17, // C | - //AURA_STATE_UNKNOWN18 = 18, // C t| + AURA_STATE_BLEEDING = 18, // T | //AURA_STATE_UNKNOWN19 = 19, // | not used //AURA_STATE_UNKNOWN20 = 20, // c | only (45317 Suicide) //AURA_STATE_UNKNOWN21 = 21, // | not used diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index b5c6d6f..eb61628 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1153,6 +1153,10 @@ void Aura::_RemoveAura() ((Player*)caster)->SendCooldownEvent(GetSpellProto()); } } + + //if target has bleeding flag, but aura removes bleeding efect and no other aura with mechanics: bleeding remains, then remove flag + if (m_spellProto->Mechanic == MECHANIC_BLEED && m_target->HasAuraState(AURA_STATE_BLEEDING) && !m_target->HasAuraMechanic(MECHANIC_BLEED)) + m_target->ModifyAuraState(AURA_STATE_BLEEDING, false); } void Aura::SendAuraUpdate(bool remove) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 7a6ed0c..a2f900f 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1478,6 +1478,29 @@ void Spell::EffectDummy(uint32 i) case SPELLFAMILY_ROGUE: switch(m_spellInfo->Id ) { + case 51662: //hunger for blood + { + //only for player + if (m_caster->GetTypeId() != TYPEID_PLAYER) + return; + + //new aura should be added to caster + Aura* aura = CreateAura(m_spellInfo, i, NULL, m_caster, m_caster); + if (aura) + { + //correct aura mod a values + aura->SetModifier(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, m_spellInfo->CalculateSimpleValue(i), 0, SPELL_SCHOOL_MASK_NORMAL); + aura->SetPositive(); + aura->SetIsSingleTarget(true); + aura->SetRemoveMode(AURA_REMOVE_BY_CANCEL); + //correct duration (3.1.3) + aura->SetAuraMaxDuration(60 * IN_MILISECONDS); + aura->SetAuraDuration(60 * IN_MILISECONDS); + //final add aura to caster + m_caster->AddAura(aura); + } + return; + } case 5938: // Shiv { if(m_caster->GetTypeId() != TYPEID_PLAYER) @@ -2392,6 +2415,11 @@ void Spell::EffectApplyAura(uint32 i) if(!Aur) return; + //bleeding effect has to be added for those spells with Mechanics: bleeding + //(purpose: Hunger for Blood fix - 3.1.3) + if (m_spellInfo->Mechanic == MECHANIC_BLEED) + unitTarget->ModifyAuraState(AURA_STATE_BLEEDING, true); + // Prayer of Mending (jump animation), we need formal caster instead original for correct animation if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x00002000000000))) m_caster->CastSpell(unitTarget, 41637, true, NULL, Aur, m_originalCasterGUID); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 9f37a13..0e4a122 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7457,6 +7457,21 @@ void Unit::CombatStopWithPets(bool includingCast) guardian->CombatStop(includingCast); } +bool Unit::HasAuraMechanic(Mechanics mechanic) const +{ + for (AuraMap::const_iterator it = m_Auras.begin(); it != m_Auras.end(); ++it) + { + Aura* aura = it->second; + if (aura) + { + const SpellEntry* spellEntry = aura->GetSpellProto(); + if (spellEntry && spellEntry->Mechanic == mechanic) + return true; + } + } + return false; +} + bool Unit::isAttackingPlayer() const { if(hasUnitState(UNIT_STAT_ATTACK_PLAYER)) diff --git a/src/game/Unit.h b/src/game/Unit.h index 386f518..15cbc23 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1195,6 +1195,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject Pet* CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id = 0); + bool HasAuraMechanic(Mechanics mechanic) const; + bool AddAura(Aura *aur); void RemoveAura(Aura* aura); download link for patch file
×
×
  • 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