From fb590ff8d4abd71462928f85846b236bdc9e869f Mon Sep 17 00:00:00 2001 From: zergtmn Date: Sat, 29 Jan 2011 21:57:25 +0500 Subject: [PATCH] [11082] Correct meaning of two threat/aggro related spell attributes - SPELL_ATTR_EX_NO_INITIAL_AGGRO renamed to SPELL_ATTR_EX_NO_THREAT - SPELL_ATTR_EX3_UNK17 renamed to SPELL_ATTR_EX3_NO_INITIAL_AGGRO - Remove custom spell modifier from talent 30675 and ranks handler --- src/game/SharedDefines.h | 4 ++-- src/game/Spell.cpp | 4 ++-- src/game/SpellAuras.cpp | 2 +- src/game/ThreatManager.cpp | 17 ++++++++++------- src/game/ThreatManager.h | 2 +- src/game/UnitAuraProcHandler.cpp | 11 ++--------- src/shared/revision_nr.h | 2 +- 7 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 23b51bdcbcd..ee96ecf92a8 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -274,7 +274,7 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = { #define SPELL_ATTR_EX_NEGATIVE 0x00000080 // 7 #define SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET 0x00000100 // 8 Spell req target not to be in combat state #define SPELL_ATTR_EX_UNK9 0x00000200 // 9 -#define SPELL_ATTR_EX_NO_INITIAL_AGGRO 0x00000400 // 10 no generates threat on cast 100% +#define SPELL_ATTR_EX_NO_THREAT 0x00000400 // 10 no generates threat on cast 100% #define SPELL_ATTR_EX_UNK11 0x00000800 // 11 #define SPELL_ATTR_EX_UNK12 0x00001000 // 12 #define SPELL_ATTR_EX_UNK13 0x00002000 // 13 @@ -347,7 +347,7 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = { #define SPELL_ATTR_EX3_UNK14 0x00004000 // 14 "Honorless Target" only this spells have this flag #define SPELL_ATTR_EX3_UNK15 0x00008000 // 15 Auto Shoot, Shoot, Throw, - this is autoshot flag #define SPELL_ATTR_EX3_UNK16 0x00010000 // 16 no triggers effects that trigger on casting a spell?? -#define SPELL_ATTR_EX3_UNK17 0x00020000 // 17 no triggers effects that trigger on casting a spell?? +#define SPELL_ATTR_EX3_NO_INITIAL_AGGRO 0x00020000 // 17 Causes no aggro if not missed #define SPELL_ATTR_EX3_UNK18 0x00040000 // 18 #define SPELL_ATTR_EX3_UNK19 0x00080000 // 19 #define SPELL_ATTR_EX3_DEATH_PERSISTENT 0x00100000 // 20 Death persistent spells diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 0a7f4327766..19eeef8941e 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1173,7 +1173,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) unit->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); // can cause back attack (if detected), stealth removed at Spell::cast if spell break it - if (!(m_spellInfo->AttributesEx & SPELL_ATTR_EX_NO_INITIAL_AGGRO) && !IsPositiveSpell(m_spellInfo->Id) && + if (!(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO) && !IsPositiveSpell(m_spellInfo->Id) && m_caster->isVisibleForOrDetect(unit, unit, false)) { // use speedup check to avoid re-remove after above lines @@ -1211,7 +1211,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) if (unit->hasUnitState(UNIT_STAT_ATTACK_PLAYER)) realCaster->SetContestedPvP(); - if (unit->isInCombat() && !(m_spellInfo->AttributesEx & SPELL_ATTR_EX_NO_INITIAL_AGGRO)) + if (unit->isInCombat() && !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO)) { realCaster->SetInCombatState(unit->GetCombatTimer() > 0); unit->getHostileRefManager().threatAssist(realCaster, 0.0f, m_spellInfo); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 0bab25f0548..c3af05fff6d 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -233,7 +233,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleNoImmediateEffect, //180 SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS implemented in Unit::SpellDamageBonusDone &Aura::HandleUnused, //181 unused (3.0.8a-3.2.2a) old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS &Aura::HandleAuraModResistenceOfStatPercent, //182 SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT - &Aura::HandleNoImmediateEffect, //183 SPELL_AURA_MOD_CRITICAL_THREAT only used in 28746, implemented in ThreatCalcHelper::calcThreat + &Aura::HandleNoImmediateEffect, //183 SPELL_AURA_MOD_CRITICAL_THREAT only used in 28746, implemented in ThreatCalcHelper::CalcThreat &Aura::HandleNoImmediateEffect, //184 SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst &Aura::HandleNoImmediateEffect, //185 SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst &Aura::HandleNoImmediateEffect, //186 SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE implemented in Unit::MagicSpellHitResult diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp index d8145522621..606cd93b793 100644 --- a/src/game/ThreatManager.cpp +++ b/src/game/ThreatManager.cpp @@ -30,22 +30,25 @@ //============================================================== // The pHatingUnit is not used yet -float ThreatCalcHelper::calcThreat(Unit* pHatedUnit, Unit* /*pHatingUnit*/, float pThreat, bool crit, SpellSchoolMask schoolMask, SpellEntry const *pThreatSpell) +float ThreatCalcHelper::CalcThreat(Unit* pHatedUnit, Unit* /*pHatingUnit*/, float threat, bool crit, SpellSchoolMask schoolMask, SpellEntry const *pThreatSpell) { // all flat mods applied early - if(!pThreat) + if (!threat) return 0.0f; if (pThreatSpell) { + if (pThreatSpell->AttributesEx & SPELL_ATTR_EX_NO_THREAT) + return 0.0f; + if (Player* modOwner = pHatedUnit->GetSpellModOwner()) - modOwner->ApplySpellMod(pThreatSpell->Id, SPELLMOD_THREAT, pThreat); + modOwner->ApplySpellMod(pThreatSpell->Id, SPELLMOD_THREAT, threat); - if(crit) - pThreat *= pHatedUnit->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CRITICAL_THREAT,schoolMask); + if (crit) + threat *= pHatedUnit->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CRITICAL_THREAT, schoolMask); } - float threat = pHatedUnit->ApplyTotalThreatModifier(pThreat, schoolMask); + threat = pHatedUnit->ApplyTotalThreatModifier(threat, schoolMask); return threat; } @@ -390,7 +393,7 @@ void ThreatManager::addThreat(Unit* pVictim, float pThreat, bool crit, SpellScho MANGOS_ASSERT(getOwner()->GetTypeId()== TYPEID_UNIT); - float threat = ThreatCalcHelper::calcThreat(pVictim, iOwner, pThreat, crit, schoolMask, pThreatSpell); + float threat = ThreatCalcHelper::CalcThreat(pVictim, iOwner, pThreat, crit, schoolMask, pThreatSpell); if (threat > 0.0f) { diff --git a/src/game/ThreatManager.h b/src/game/ThreatManager.h index 20a18cb9d38..09b1ed5f515 100644 --- a/src/game/ThreatManager.h +++ b/src/game/ThreatManager.h @@ -41,7 +41,7 @@ struct SpellEntry; class ThreatCalcHelper { public: - static float calcThreat(Unit* pHatedUnit, Unit* pHatingUnit, float threat, bool crit, SpellSchoolMask schoolMask, SpellEntry const *threatSpell); + static float CalcThreat(Unit* pHatedUnit, Unit* pHatingUnit, float threat, bool crit, SpellSchoolMask schoolMask, SpellEntry const *threatSpell); }; //============================================================== diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp index 91ef3ba7ee5..a54d4b125f6 100644 --- a/src/game/UnitAuraProcHandler.cpp +++ b/src/game/UnitAuraProcHandler.cpp @@ -2470,11 +2470,6 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura sLog.outError("Unit::HandleDummyAuraProc: non handled spell id: %u (LO)", procSpell->Id); return SPELL_AURA_PROC_FAILED; } - // No thread generated mod - // TODO: exist special flag in spell attributes for this, need found and use! - SpellModifier *mod = new SpellModifier(SPELLMOD_THREAT,SPELLMOD_PCT,-100,triggeredByAura); - - ((Player*)this)->AddSpellMod(mod, true); // Remove cooldown (Chain Lightning - have Category Recovery time) if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000002)) @@ -2482,10 +2477,8 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura CastSpell(pVictim, spellId, true, castItem, triggeredByAura); - ((Player*)this)->AddSpellMod(mod, false); - - if( cooldown && GetTypeId()==TYPEID_PLAYER ) - ((Player*)this)->AddSpellCooldown(dummySpell->Id,0,time(NULL) + cooldown); + if (cooldown && GetTypeId() == TYPEID_PLAYER) + ((Player*)this)->AddSpellCooldown(dummySpell->Id, 0, time(NULL) + cooldown); return SPELL_AURA_PROC_OK; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 2e0dbecf5b3..19e9774941b 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11081" + #define REVISION_NR "11082" #endif // __REVISION_NR_H__