*Set pvp flag for spells with SPELL_ATTR_EX3_NO_INITIAL_AGGRO if needed.
--HG-- branch : trunk
This commit is contained in:
+3
-5
@@ -1192,11 +1192,9 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
|||||||
|
|
||||||
if( !m_caster->IsFriendlyTo(unit) && !IsPositiveSpell(m_spellInfo->Id))
|
if( !m_caster->IsFriendlyTo(unit) && !IsPositiveSpell(m_spellInfo->Id))
|
||||||
{
|
{
|
||||||
if( !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO) )
|
m_caster->CombatStart(unit, !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO));
|
||||||
{
|
|
||||||
m_caster->CombatStart(unit);
|
if(m_customAttr & SPELL_ATTR_CU_AURA_CC)
|
||||||
}
|
|
||||||
else if(m_customAttr & SPELL_ATTR_CU_AURA_CC)
|
|
||||||
{
|
{
|
||||||
if(!unit->IsStandState())
|
if(!unit->IsStandState())
|
||||||
unit->SetStandState(UNIT_STAND_STATE_STAND);
|
unit->SetStandState(UNIT_STAND_STATE_STAND);
|
||||||
|
|||||||
+4
-2
@@ -10455,8 +10455,10 @@ void Unit::SetInCombatWith(Unit* enemy)
|
|||||||
SetInCombatState(false,enemy);
|
SetInCombatState(false,enemy);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::CombatStart(Unit* target)
|
void Unit::CombatStart(Unit* target, bool initialAggro)
|
||||||
{
|
{
|
||||||
|
if (initialAggro)
|
||||||
|
{
|
||||||
if(!target->IsStandState()/* && !target->hasUnitState(UNIT_STAT_STUNNED)*/)
|
if(!target->IsStandState()/* && !target->hasUnitState(UNIT_STAT_STUNNED)*/)
|
||||||
target->SetStandState(UNIT_STAND_STATE_STAND);
|
target->SetStandState(UNIT_STAND_STATE_STAND);
|
||||||
|
|
||||||
@@ -10468,7 +10470,7 @@ void Unit::CombatStart(Unit* target)
|
|||||||
|
|
||||||
SetInCombatWith(target);
|
SetInCombatWith(target);
|
||||||
target->SetInCombatWith(this);
|
target->SetInCombatWith(this);
|
||||||
|
}
|
||||||
Unit *who = target->GetCharmerOrOwnerOrSelf();
|
Unit *who = target->GetCharmerOrOwnerOrSelf();
|
||||||
if(who->GetTypeId() == TYPEID_PLAYER)
|
if(who->GetTypeId() == TYPEID_PLAYER)
|
||||||
SetContestedPvP((Player*)who);
|
SetContestedPvP((Player*)who);
|
||||||
|
|||||||
+1
-1
@@ -1275,7 +1275,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
|||||||
bool isInFlight() const { return hasUnitState(UNIT_STAT_IN_FLIGHT); }
|
bool isInFlight() const { return hasUnitState(UNIT_STAT_IN_FLIGHT); }
|
||||||
|
|
||||||
bool isInCombat() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); }
|
bool isInCombat() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); }
|
||||||
void CombatStart(Unit* target);
|
void CombatStart(Unit* target, bool initialAggro = true);
|
||||||
void SetInCombatState(bool PvP, Unit* enemy = NULL);
|
void SetInCombatState(bool PvP, Unit* enemy = NULL);
|
||||||
void SetInCombatWith(Unit* enemy);
|
void SetInCombatWith(Unit* enemy);
|
||||||
void ClearInCombat();
|
void ClearInCombat();
|
||||||
|
|||||||
Reference in New Issue
Block a user