Implement effect for aura #243 (temporary faction change)
--HG-- branch : trunk
This commit is contained in:
@@ -287,7 +287,7 @@ enum AuraType
|
|||||||
SPELL_AURA_MOD_EXPERTISE = 240,
|
SPELL_AURA_MOD_EXPERTISE = 240,
|
||||||
SPELL_AURA_FORCE_MOVE_FORWARD = 241,
|
SPELL_AURA_FORCE_MOVE_FORWARD = 241,
|
||||||
SPELL_AURA_MOD_SPELL_DAMAGE_FROM_HEALING = 242,
|
SPELL_AURA_MOD_SPELL_DAMAGE_FROM_HEALING = 242,
|
||||||
SPELL_AURA_243 = 243,
|
SPELL_AURA_MOD_FACTION = 243,
|
||||||
SPELL_AURA_COMPREHEND_LANGUAGE = 244,
|
SPELL_AURA_COMPREHEND_LANGUAGE = 244,
|
||||||
SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL = 245,
|
SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL = 245,
|
||||||
SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK = 246,
|
SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK = 246,
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
|
|||||||
&AuraEffect::HandleAuraModExpertise, //240 SPELL_AURA_MOD_EXPERTISE
|
&AuraEffect::HandleAuraModExpertise, //240 SPELL_AURA_MOD_EXPERTISE
|
||||||
&AuraEffect::HandleForceMoveForward, //241 SPELL_AURA_FORCE_MOVE_FORWARD Forces the player to move forward
|
&AuraEffect::HandleForceMoveForward, //241 SPELL_AURA_FORCE_MOVE_FORWARD Forces the player to move forward
|
||||||
&AuraEffect::HandleNULL, //242 SPELL_AURA_MOD_SPELL_DAMAGE_FROM_HEALING - 2 test spells: 44183 and 44182
|
&AuraEffect::HandleNULL, //242 SPELL_AURA_MOD_SPELL_DAMAGE_FROM_HEALING - 2 test spells: 44183 and 44182
|
||||||
&AuraEffect::HandleNULL, //243 faction reaction override spells
|
&AuraEffect::HandleAuraModFaction, //243 SPELL_AURA_MOD_FACTION
|
||||||
&AuraEffect::HandleComprehendLanguage, //244 SPELL_AURA_COMPREHEND_LANGUAGE
|
&AuraEffect::HandleComprehendLanguage, //244 SPELL_AURA_COMPREHEND_LANGUAGE
|
||||||
&AuraEffect::HandleNoImmediateEffect, //245 SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL
|
&AuraEffect::HandleNoImmediateEffect, //245 SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL
|
||||||
&AuraEffect::HandleNoImmediateEffect, //246 SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK implemented in Spell::EffectApplyAura
|
&AuraEffect::HandleNoImmediateEffect, //246 SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK implemented in Spell::EffectApplyAura
|
||||||
@@ -5997,6 +5997,28 @@ void AuraEffect::HandleAuraEmpathy(AuraApplication const * aurApp, uint8 mode, b
|
|||||||
target->ApplyModUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO, apply);
|
target->ApplyModUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO, apply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AuraEffect::HandleAuraModFaction(AuraApplication const * aurApp, uint8 mode, bool apply) const
|
||||||
|
{
|
||||||
|
if(!(mode & AURA_EFFECT_HANDLE_REAL))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Unit * target = aurApp->GetTarget();
|
||||||
|
|
||||||
|
if(apply)
|
||||||
|
{
|
||||||
|
target->setFaction(GetMiscValue());
|
||||||
|
if(target->GetTypeId()==TYPEID_PLAYER)
|
||||||
|
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
target->RestoreFaction();
|
||||||
|
if(target->GetTypeId()==TYPEID_PLAYER)
|
||||||
|
target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AuraEffect::HandleComprehendLanguage(AuraApplication const * aurApp, uint8 mode, bool apply) const
|
void AuraEffect::HandleComprehendLanguage(AuraApplication const * aurApp, uint8 mode, bool apply) const
|
||||||
{
|
{
|
||||||
if(!(mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK))
|
if(!(mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK))
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ class TRINITY_DLL_SPEC AuraEffect
|
|||||||
void HandleBindSight(AuraApplication const * aurApp, uint8 mode, bool apply) const;
|
void HandleBindSight(AuraApplication const * aurApp, uint8 mode, bool apply) const;
|
||||||
void HandleForceReaction(AuraApplication const * aurApp, uint8 mode, bool apply) const;
|
void HandleForceReaction(AuraApplication const * aurApp, uint8 mode, bool apply) const;
|
||||||
void HandleAuraEmpathy(AuraApplication const * aurApp, uint8 mode, bool apply) const;
|
void HandleAuraEmpathy(AuraApplication const * aurApp, uint8 mode, bool apply) const;
|
||||||
|
void HandleAuraModFaction(AuraApplication const * aurApp, uint8 mode, bool apply) const;
|
||||||
void HandleComprehendLanguage(AuraApplication const * aurApp, uint8 mode, bool apply) const;
|
void HandleComprehendLanguage(AuraApplication const * aurApp, uint8 mode, bool apply) const;
|
||||||
void HandleAuraConvertRune(AuraApplication const * aurApp, uint8 mode, bool apply) const;
|
void HandleAuraConvertRune(AuraApplication const * aurApp, uint8 mode, bool apply) const;
|
||||||
void HandleAuraLinked(AuraApplication const * aurApp, uint8 mode, bool apply) const;
|
void HandleAuraLinked(AuraApplication const * aurApp, uint8 mode, bool apply) const;
|
||||||
|
|||||||
+10
-4
@@ -8564,12 +8564,15 @@ bool Unit::IsHostileTo(Unit const* unit) const
|
|||||||
|
|
||||||
//= PvP states
|
//= PvP states
|
||||||
// Green/Blue (can't attack)
|
// Green/Blue (can't attack)
|
||||||
|
if (!pTester->HasAuraType(SPELL_AURA_MOD_FACTION) && !pTarget->HasAuraType(SPELL_AURA_MOD_FACTION))
|
||||||
|
{
|
||||||
if(pTester->GetTeam()==pTarget->GetTeam())
|
if(pTester->GetTeam()==pTarget->GetTeam())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Red (can attack) if true, Blue/Yellow (can't attack) in another case
|
// Red (can attack) if true, Blue/Yellow (can't attack) in another case
|
||||||
return pTester->IsPvP() && pTarget->IsPvP();
|
return pTester->IsPvP() && pTarget->IsPvP();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// faction base cases
|
// faction base cases
|
||||||
FactionTemplateEntry const*tester_faction = tester->getFactionTemplateEntry();
|
FactionTemplateEntry const*tester_faction = tester->getFactionTemplateEntry();
|
||||||
@@ -8581,7 +8584,7 @@ bool Unit::IsHostileTo(Unit const* unit) const
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
// PvC forced reaction and reputation case
|
// PvC forced reaction and reputation case
|
||||||
if(tester->GetTypeId() == TYPEID_PLAYER)
|
if(tester->GetTypeId() == TYPEID_PLAYER && !tester->HasAuraType(SPELL_AURA_MOD_FACTION))
|
||||||
{
|
{
|
||||||
// forced reaction
|
// forced reaction
|
||||||
if(target_faction->faction)
|
if(target_faction->faction)
|
||||||
@@ -8596,7 +8599,7 @@ bool Unit::IsHostileTo(Unit const* unit) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// CvP forced reaction and reputation case
|
// CvP forced reaction and reputation case
|
||||||
else if(target->GetTypeId() == TYPEID_PLAYER)
|
else if(target->GetTypeId() == TYPEID_PLAYER && !target->HasAuraType(SPELL_AURA_MOD_FACTION))
|
||||||
{
|
{
|
||||||
// forced reaction
|
// forced reaction
|
||||||
if(tester_faction->faction)
|
if(tester_faction->faction)
|
||||||
@@ -8676,12 +8679,15 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
|
|||||||
|
|
||||||
//= PvP states
|
//= PvP states
|
||||||
// Green/Blue (non-attackable)
|
// Green/Blue (non-attackable)
|
||||||
|
if (!pTester->HasAuraType(SPELL_AURA_MOD_FACTION) && !pTarget->HasAuraType(SPELL_AURA_MOD_FACTION))
|
||||||
|
{
|
||||||
if(pTester->GetTeam()==pTarget->GetTeam())
|
if(pTester->GetTeam()==pTarget->GetTeam())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Blue (friendly/non-attackable) if not PVP, or Yellow/Red in another case (attackable)
|
// Blue (friendly/non-attackable) if not PVP, or Yellow/Red in another case (attackable)
|
||||||
return !pTarget->IsPvP();
|
return !pTarget->IsPvP();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// faction base cases
|
// faction base cases
|
||||||
FactionTemplateEntry const *tester_faction = tester->getFactionTemplateEntry();
|
FactionTemplateEntry const *tester_faction = tester->getFactionTemplateEntry();
|
||||||
@@ -8693,7 +8699,7 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// PvC forced reaction and reputation case
|
// PvC forced reaction and reputation case
|
||||||
if (tester->GetTypeId() == TYPEID_PLAYER)
|
if (tester->GetTypeId() == TYPEID_PLAYER && !tester->HasAuraType(SPELL_AURA_MOD_FACTION))
|
||||||
{
|
{
|
||||||
// forced reaction
|
// forced reaction
|
||||||
if (target_faction->faction)
|
if (target_faction->faction)
|
||||||
@@ -8708,7 +8714,7 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// CvP forced reaction and reputation case
|
// CvP forced reaction and reputation case
|
||||||
else if (target->GetTypeId() == TYPEID_PLAYER)
|
else if (target->GetTypeId() == TYPEID_PLAYER && !target->HasAuraType(SPELL_AURA_MOD_FACTION))
|
||||||
{
|
{
|
||||||
// forced reaction
|
// forced reaction
|
||||||
if (tester_faction->faction)
|
if (tester_faction->faction)
|
||||||
|
|||||||
Reference in New Issue
Block a user