*Fix misdirection.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-12-17 20:07:25 -06:00
parent 5244d4986a
commit ac5bf63acd
6 changed files with 35 additions and 10 deletions
+1
View File
@@ -317,6 +317,7 @@ class Spell
void EffectTriggerRitualOfSummoning(uint32 i); void EffectTriggerRitualOfSummoning(uint32 i);
void EffectKillCredit(uint32 i); void EffectKillCredit(uint32 i);
void EffectQuestFail(uint32 i); void EffectQuestFail(uint32 i);
void EffectRedirectThreat(uint32 i);
Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID = 0, Spell** triggeringContainer = NULL ); Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID = 0, Spell** triggeringContainer = NULL );
~Spell(); ~Spell();
+7 -9
View File
@@ -1973,21 +1973,19 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
} }
// Dark Fiend
if(GetId()==45934)
{
// Kill target if dispelled
if (m_removeMode==AURA_REMOVE_BY_DISPEL)
m_target->DealDamage(m_target, m_target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return;
}
// Burning Winds // Burning Winds
if(GetId()==46308) // casted only at creatures at spawn if(GetId()==46308) // casted only at creatures at spawn
{ {
m_target->CastSpell(m_target,47287,true,NULL,this); m_target->CastSpell(m_target,47287,true,NULL,this);
return; return;
} }
// Misdirection
if(GetId()==34477)
{
m_target->SetReducedThreatPercent(0, 0);
return;
}
} }
// AT APPLY & REMOVE // AT APPLY & REMOVE
+7 -1
View File
@@ -191,7 +191,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectProspecting, //127 SPELL_EFFECT_PROSPECTING Prospecting spell &Spell::EffectProspecting, //127 SPELL_EFFECT_PROSPECTING Prospecting spell
&Spell::EffectApplyAreaAura, //128 SPELL_EFFECT_APPLY_AREA_AURA_FRIEND &Spell::EffectApplyAreaAura, //128 SPELL_EFFECT_APPLY_AREA_AURA_FRIEND
&Spell::EffectApplyAreaAura, //129 SPELL_EFFECT_APPLY_AREA_AURA_ENEMY &Spell::EffectApplyAreaAura, //129 SPELL_EFFECT_APPLY_AREA_AURA_ENEMY
&Spell::EffectNULL, //130 SPELL_EFFECT_REDIRECT_THREAT &Spell::EffectRedirectThreat, //130 SPELL_EFFECT_REDIRECT_THREAT
&Spell::EffectUnused, //131 SPELL_EFFECT_131 used in some test spells &Spell::EffectUnused, //131 SPELL_EFFECT_131 used in some test spells
&Spell::EffectNULL, //132 SPELL_EFFECT_PLAY_MUSIC sound id in misc value &Spell::EffectNULL, //132 SPELL_EFFECT_PLAY_MUSIC sound id in misc value
&Spell::EffectUnlearnSpecialization, //133 SPELL_EFFECT_UNLEARN_SPECIALIZATION unlearn profession specialization &Spell::EffectUnlearnSpecialization, //133 SPELL_EFFECT_UNLEARN_SPECIALIZATION unlearn profession specialization
@@ -6296,3 +6296,9 @@ void Spell::EffectQuestFail(uint32 i)
((Player*)unitTarget)->FailQuest(m_spellInfo->EffectMiscValue[i]); ((Player*)unitTarget)->FailQuest(m_spellInfo->EffectMiscValue[i]);
} }
void Spell::EffectRedirectThreat(uint32 /*i*/)
{
if(unitTarget)
m_caster->SetReducedThreatPercent((uint32)damage, unitTarget->GetGUID());
}
+8
View File
@@ -357,6 +357,14 @@ void ThreatManager::addThreat(Unit* pVictim, float pThreat, SpellSchoolMask scho
float threat = ThreatCalcHelper::calcThreat(pVictim, iOwner, pThreat, schoolMask, pThreatSpell); float threat = ThreatCalcHelper::calcThreat(pVictim, iOwner, pThreat, schoolMask, pThreatSpell);
if(pVictim->GetReducedThreatPercent())
{
float reducedThreat = threat * pVictim->GetReducedThreatPercent() / 100;
threat -= reducedThreat;
if(pVictim->GetMisdirectionTarget())
iThreatContainer.addThreat(pVictim->GetMisdirectionTarget(), reducedThreat);
}
HostilReference* ref = iThreatContainer.addThreat(pVictim, threat); HostilReference* ref = iThreatContainer.addThreat(pVictim, threat);
// Ref is not in the online refs, search the offline refs next // Ref is not in the online refs, search the offline refs next
if(!ref) if(!ref)
+2
View File
@@ -234,6 +234,8 @@ Unit::Unit()
m_charmInfo = NULL; m_charmInfo = NULL;
m_unit_movement_flags = 0; m_unit_movement_flags = 0;
m_isPossessed = false; m_isPossessed = false;
m_reducedThreatPercent = 0;
m_misdirectionTargetGUID = 0;
// remove aurastates allowing special moves // remove aurastates allowing special moves
for(int i=0; i < MAX_REACTIVE; ++i) for(int i=0; i < MAX_REACTIVE; ++i)
+10
View File
@@ -1393,6 +1393,13 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void SetToNotify(); void SetToNotify();
bool m_Notified, m_IsInNotifyList; bool m_Notified, m_IsInNotifyList;
void SetReducedThreatPercent(uint32 pct, uint64 guid)
{
m_reducedThreatPercent = pct;
m_misdirectionTargetGUID = guid;
}
uint32 GetReducedThreatPercent() { return m_reducedThreatPercent; }
Unit *GetMisdirectionTarget() { return m_misdirectionTargetGUID ? GetUnit(*this, m_misdirectionTargetGUID) : NULL; }
protected: protected:
explicit Unit (); explicit Unit ();
@@ -1470,5 +1477,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
FollowerRefManager m_FollowingRefManager; FollowerRefManager m_FollowingRefManager;
ComboPointHolderSet m_ComboPointHolders; ComboPointHolderSet m_ComboPointHolders;
uint32 m_reducedThreatPercent;
uint64 m_misdirectionTargetGUID;
}; };
#endif #endif