Add Aura::CheckTarget() to check Alterac Valley buff targets.

Merge from old TC-2.4.3 repository, original patch by krz.
Fixes issue #954.

--HG--
branch : trunk
This commit is contained in:
Tartalo
2010-04-11 19:04:39 +02:00
parent d5c1138a53
commit 626240ef91
2 changed files with 41 additions and 1 deletions
+40 -1
View File
@@ -532,7 +532,7 @@ void Aura::_ApplyEffectForTargets(uint8 effIndex)
UnitList targetList; UnitList targetList;
for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter) for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter)
{ {
if ((appIter->second->GetEffectsToApply() & (1<<effIndex)) && !appIter->second->HasEffect(effIndex)) if ((appIter->second->GetEffectsToApply() & (1<<effIndex)) && CheckTarget(appIter->second->GetTarget()) && !appIter->second->HasEffect(effIndex))
targetList.push_back(appIter->second->GetTarget()); targetList.push_back(appIter->second->GetTarget());
} }
@@ -626,6 +626,45 @@ void Aura::Update(uint32 diff, Unit * caster)
} }
} }
bool Aura::CheckTarget(Unit *target)
{
// some special cases
switch(GetId())
{
case 45828: // AV Marshal's HP/DMG auras
case 45829:
case 45830:
case 45821:
case 45822: // AV Warmaster's HP/DMG auras
case 45823:
case 45824:
case 45826:
switch(target->GetEntry())
{
// alliance
case 14762: // Dun Baldar North Marshal
case 14763: // Dun Baldar South Marshal
case 14764: // Icewing Marshal
case 14765: // Stonehearth Marshal
case 11948: // Vandar Stormspike
// horde
case 14772: // East Frostwolf Warmaster
case 14776: // Tower Point Warmaster
case 14773: // Iceblood Warmaster
case 14777: // West Frostwolf Warmaster
case 11946: // Drek'thar
return true;
default:
break;
}
return false;
break;
default:
break;
return true;
}
}
void Aura::SetDuration(int32 duration, bool withMods) void Aura::SetDuration(int32 duration, bool withMods)
{ {
if (withMods) if (withMods)
+1
View File
@@ -163,6 +163,7 @@ class Aura
void SetNeedClientUpdateForTargets() const; void SetNeedClientUpdateForTargets() const;
void HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, bool apply); void HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, bool apply);
bool CheckTarget(Unit *target);
private: private:
void _DeleteRemovedApplications(); void _DeleteRemovedApplications();
protected: protected: