mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[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
This commit is contained in:
parent
3251f39684
commit
26dc35f356
7 changed files with 20 additions and 24 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
};
|
||||
|
||||
//==============================================================
|
||||
|
|
|
|||
|
|
@ -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,8 +2477,6 @@ 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);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11081"
|
||||
#define REVISION_NR "11082"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue