*Fix the bug that gouge/scatter shot interrupt self.
*Fix the bug that spams setspeed errors. *Clean up scripts to delete all lines which may cause crash by removing stealth aura. --HG-- branch : trunk
This commit is contained in:
@@ -799,7 +799,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 s
|
|||||||
return pList;
|
return pList;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scripted_NoMovementAI::MoveInLineOfSight(Unit *who)
|
/*void Scripted_NoMovementAI::MoveInLineOfSight(Unit *who)
|
||||||
{
|
{
|
||||||
if( !m_creature->getVictim() && m_creature->canAttack(who) && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
if( !m_creature->getVictim() && m_creature->canAttack(who) && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
||||||
{
|
{
|
||||||
@@ -813,7 +813,7 @@ void Scripted_NoMovementAI::MoveInLineOfSight(Unit *who)
|
|||||||
AttackStart(who);
|
AttackStart(who);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
void Scripted_NoMovementAI::AttackStart(Unit* who)
|
void Scripted_NoMovementAI::AttackStart(Unit* who)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ struct TRINITY_DLL_DECL Scripted_NoMovementAI : public ScriptedAI
|
|||||||
Scripted_NoMovementAI(Creature* creature) : ScriptedAI(creature) {}
|
Scripted_NoMovementAI(Creature* creature) : ScriptedAI(creature) {}
|
||||||
|
|
||||||
//Called if IsVisible(Unit *who) is true at each *who move
|
//Called if IsVisible(Unit *who) is true at each *who move
|
||||||
void MoveInLineOfSight(Unit *);
|
//void MoveInLineOfSight(Unit *);
|
||||||
|
|
||||||
//Called at each attack of m_creature by any victim
|
//Called at each attack of m_creature by any victim
|
||||||
void AttackStart(Unit *);
|
void AttackStart(Unit *);
|
||||||
|
|||||||
@@ -60,35 +60,26 @@ void npc_escortAI::MoveInLineOfSight(Unit *who)
|
|||||||
if (IsBeingEscorted && !Attack)
|
if (IsBeingEscorted && !Attack)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
if(m_creature->getVictim() || !m_creature->canStartAttack(who))
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Begin attack
|
||||||
|
if ( m_creature->Attack(who, true) )
|
||||||
{
|
{
|
||||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
m_creature->GetMotionMaster()->MovementExpired();
|
||||||
return;
|
m_creature->GetMotionMaster()->MoveChase(who);
|
||||||
|
m_creature->AddThreat(who, 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
if (!InCombat)
|
||||||
if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
|
{
|
||||||
{
|
InCombat = true;
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
|
||||||
|
|
||||||
//Begin attack
|
//Store last position
|
||||||
if ( m_creature->Attack(who, true) )
|
m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);
|
||||||
{
|
debug_log("SD2: EscortAI has entered combat via LOS and stored last location");
|
||||||
m_creature->GetMotionMaster()->MovementExpired();
|
|
||||||
m_creature->GetMotionMaster()->MoveChase(who);
|
|
||||||
m_creature->AddThreat(who, 0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!InCombat)
|
Aggro(who);
|
||||||
{
|
|
||||||
InCombat = true;
|
|
||||||
|
|
||||||
//Store last position
|
|
||||||
m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z);
|
|
||||||
debug_log("SD2: EscortAI has entered combat via LOS and stored last location");
|
|
||||||
|
|
||||||
Aggro(who);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -186,7 +186,7 @@ struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI
|
|||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
float attackRadius = m_creature->GetAttackDistance(who);
|
||||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
|
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
|
||||||
{
|
{
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||||
AttackStart(who);
|
AttackStart(who);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -92,7 +92,7 @@ struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI
|
|||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
float attackRadius = m_creature->GetAttackDistance(who);
|
||||||
if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
|
if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
|
||||||
{
|
{
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||||
AttackStart(who);
|
AttackStart(who);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -102,7 +102,7 @@ struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI
|
|||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
float attackRadius = m_creature->GetAttackDistance(who);
|
||||||
if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
|
if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
|
||||||
{
|
{
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||||
AttackStart(who);
|
AttackStart(who);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -183,8 +183,8 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
|
|||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
float attackRadius = m_creature->GetAttackDistance(who);
|
||||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
|
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
|
||||||
{
|
{
|
||||||
if(who->HasStealthAura())
|
//if(who->HasStealthAura())
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
// who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||||
|
|
||||||
AttackStart(who);
|
AttackStart(who);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,29 +187,15 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI
|
|||||||
Timer = 0;
|
Timer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoveInLineOfSight(Unit *who)
|
void AttackStart(Unit* who)
|
||||||
{
|
{
|
||||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
if (!InCombat)
|
||||||
{
|
{
|
||||||
if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
Aggro(who);
|
||||||
return;
|
InCombat = true;
|
||||||
|
|
||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
|
||||||
if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
|
|
||||||
{
|
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
|
||||||
|
|
||||||
if (!InCombat)
|
|
||||||
{
|
|
||||||
Aggro(who);
|
|
||||||
InCombat = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttackStart(Unit*) {}
|
|
||||||
|
|
||||||
bool SummonSoul()
|
bool SummonSoul()
|
||||||
{
|
{
|
||||||
uint32 random = rand()%6;
|
uint32 random = rand()%6;
|
||||||
|
|||||||
@@ -168,8 +168,8 @@ struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI
|
|||||||
|
|
||||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
|
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
|
||||||
{
|
{
|
||||||
if(who->HasStealthAura())
|
//if(who->HasStealthAura())
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
// who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||||
|
|
||||||
m_creature->AddThreat(who, 1.0f);
|
m_creature->AddThreat(who, 1.0f);
|
||||||
}
|
}
|
||||||
@@ -282,8 +282,8 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
|
|||||||
|
|
||||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
|
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
|
||||||
{
|
{
|
||||||
if(who->HasStealthAura())
|
//if(who->HasStealthAura())
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
// who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||||
|
|
||||||
m_creature->AddThreat(who, 1.0f);
|
m_creature->AddThreat(who, 1.0f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -286,18 +286,7 @@ struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
ScriptedAI::MoveInLineOfSight(who);
|
||||||
{
|
|
||||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
|
||||||
return;
|
|
||||||
|
|
||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
|
||||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
|
|
||||||
{
|
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
|
||||||
AttackStart(who);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -48,18 +48,7 @@ struct TRINITY_DLL_DECL npc_ragged_johnAI : public ScriptedAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
ScriptedAI::MoveInLineOfSight(who);
|
||||||
{
|
|
||||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
|
||||||
return;
|
|
||||||
|
|
||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
|
||||||
if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
|
|
||||||
{
|
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
|
||||||
AttackStart(who);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Aggro(Unit *who) {}
|
void Aggro(Unit *who) {}
|
||||||
|
|||||||
@@ -88,18 +88,7 @@ struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
ScriptedAI::MoveInLineOfSight(who);
|
||||||
{
|
|
||||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
|
||||||
return;
|
|
||||||
|
|
||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
|
||||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
|
|
||||||
{
|
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
|
||||||
AttackStart(who);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
|
|||||||
+2
-2
@@ -283,8 +283,8 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
|
|||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
float attackRadius = m_creature->GetAttackDistance(who);
|
||||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
|
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
|
||||||
{
|
{
|
||||||
if(who->HasStealthAura())
|
//if(who->HasStealthAura())
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
// who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||||
|
|
||||||
if(Phase != 2)
|
if(Phase != 2)
|
||||||
AttackStart(who);
|
AttackStart(who);
|
||||||
|
|||||||
-6
@@ -248,12 +248,6 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
|
|||||||
if( m_creature->HasInArc(M_PI/2.0f, who) && m_creature->IsWithinLOSInMap(who) )
|
if( m_creature->HasInArc(M_PI/2.0f, who) && m_creature->IsWithinLOSInMap(who) )
|
||||||
{
|
{
|
||||||
AttackStart(who);
|
AttackStart(who);
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
|
||||||
if (!InCombat)
|
|
||||||
{
|
|
||||||
Aggro(who);
|
|
||||||
InCombat = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -306,7 +306,7 @@ struct TRINITY_DLL_DECL mob_water_globuleAI : public ScriptedAI
|
|||||||
if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||||
{
|
{
|
||||||
//no attack radius check - it attacks the first target that moves in his los
|
//no attack radius check - it attacks the first target that moves in his los
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||||
AttackStart(who);
|
AttackStart(who);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -450,32 +450,7 @@ struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI
|
|||||||
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void MoveInLineOfSight(Unit *who)
|
|
||||||
{
|
|
||||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
|
||||||
{
|
|
||||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
|
||||||
return;
|
|
||||||
|
|
||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
|
||||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
|
|
||||||
{
|
|
||||||
if(who->HasStealthAura())
|
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
|
||||||
|
|
||||||
if(!InCombat)
|
|
||||||
{
|
|
||||||
AttackStart(who);
|
|
||||||
if(pInstance)
|
|
||||||
{
|
|
||||||
pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
|
|
||||||
pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
{
|
{
|
||||||
//Only if not incombat check if the event is started
|
//Only if not incombat check if the event is started
|
||||||
@@ -580,33 +555,7 @@ struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoveInLineOfSight(Unit *who)
|
void UpdateAI(const uint32 diff)
|
||||||
{
|
|
||||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
|
||||||
{
|
|
||||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
|
||||||
return;
|
|
||||||
|
|
||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
|
||||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
|
|
||||||
{
|
|
||||||
if(who->HasStealthAura())
|
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
|
||||||
|
|
||||||
if(!InCombat)
|
|
||||||
{
|
|
||||||
AttackStart(who);
|
|
||||||
if(pInstance)
|
|
||||||
{
|
|
||||||
pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
|
|
||||||
pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
|
||||||
{
|
{
|
||||||
//Only if not incombat check if the event is started
|
//Only if not incombat check if the event is started
|
||||||
if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
|
if(!InCombat && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
|
||||||
@@ -694,31 +643,6 @@ struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI
|
|||||||
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void MoveInLineOfSight(Unit *who)
|
|
||||||
{
|
|
||||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
|
||||||
{
|
|
||||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
|
||||||
return;
|
|
||||||
|
|
||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
|
||||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
|
|
||||||
{
|
|
||||||
if(who->HasStealthAura())
|
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
|
||||||
|
|
||||||
if(!InCombat)
|
|
||||||
{
|
|
||||||
AttackStart(who);
|
|
||||||
if(pInstance)
|
|
||||||
{
|
|
||||||
pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
|
|
||||||
pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -85,7 +85,7 @@ struct TRINITY_DLL_DECL boss_watchkeeper_gargolmarAI : public ScriptedAI
|
|||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
float attackRadius = m_creature->GetAttackDistance(who);
|
||||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
|
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
|
||||||
{
|
{
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||||
AttackStart(who);
|
AttackStart(who);
|
||||||
}
|
}
|
||||||
else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
|
else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
|
||||||
|
|||||||
+1
-1
@@ -207,7 +207,7 @@ struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI
|
|||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
float attackRadius = m_creature->GetAttackDistance(who);
|
||||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
|
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
|
||||||
{
|
{
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||||
AttackStart(who);
|
AttackStart(who);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ struct TRINITY_DLL_DECL boss_anubrekhanAI : public ScriptedAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||||
AttackStart(who);
|
AttackStart(who);
|
||||||
}
|
}
|
||||||
else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
|
else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ struct TRINITY_DLL_DECL boss_faerlinaAI : public ScriptedAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||||
AttackStart(who);
|
AttackStart(who);
|
||||||
}
|
}
|
||||||
else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
|
else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
|
||||||
|
|||||||
@@ -42,28 +42,11 @@ struct TRINITY_DLL_DECL boss_timmy_the_cruelAI : public ScriptedAI
|
|||||||
|
|
||||||
void Aggro(Unit *who)
|
void Aggro(Unit *who)
|
||||||
{
|
{
|
||||||
}
|
|
||||||
|
|
||||||
void MoveInLineOfSight(Unit *who)
|
|
||||||
{
|
|
||||||
if (!who || m_creature->getVictim())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
|
||||||
{
|
|
||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
|
||||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
|
|
||||||
{
|
|
||||||
if (!HasYelled)
|
if (!HasYelled)
|
||||||
{
|
{
|
||||||
DoYell(SAY_SPAWN,LANG_UNIVERSAL,NULL);
|
DoYell(SAY_SPAWN,LANG_UNIVERSAL,NULL);
|
||||||
HasYelled = true;
|
HasYelled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
|
||||||
AttackStart(who);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
|
|||||||
@@ -427,9 +427,6 @@ struct TRINITY_DLL_DECL boss_alythessAI : public ScriptedAI
|
|||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
float attackRadius = m_creature->GetAttackDistance(who);
|
||||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
|
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
|
||||||
{
|
{
|
||||||
if(who->HasStealthAura())
|
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
|
||||||
|
|
||||||
if (!InCombat)
|
if (!InCombat)
|
||||||
{
|
{
|
||||||
DoStartNoMovement(who);
|
DoStartNoMovement(who);
|
||||||
|
|||||||
@@ -114,42 +114,14 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI
|
|||||||
|
|
||||||
void MoveInLineOfSight(Unit *who)
|
void MoveInLineOfSight(Unit *who)
|
||||||
{
|
{
|
||||||
if( !Intro )
|
if(Intro)
|
||||||
return;
|
ScriptedAI::MoveInLineOfSight(who);
|
||||||
|
|
||||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
|
||||||
{
|
|
||||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
|
||||||
return;
|
|
||||||
|
|
||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
|
||||||
if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
|
|
||||||
{
|
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
|
||||||
AttackStart(who);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttackStart(Unit* who)
|
void AttackStart(Unit* who)
|
||||||
{
|
{
|
||||||
if( !Intro )
|
if(!Intro)
|
||||||
return;
|
ScriptedAI::AttackStart(who);
|
||||||
|
|
||||||
if (m_creature->Attack(who, true))
|
|
||||||
{
|
|
||||||
m_creature->AddThreat(who, 0.0f);
|
|
||||||
m_creature->SetInCombatWith(who);
|
|
||||||
who->SetInCombatWith(m_creature);
|
|
||||||
|
|
||||||
if (!InCombat)
|
|
||||||
{
|
|
||||||
InCombat = true;
|
|
||||||
Aggro(who);
|
|
||||||
}
|
|
||||||
|
|
||||||
DoStartMovement(who);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Aggro(Unit *who)
|
void Aggro(Unit *who)
|
||||||
|
|||||||
@@ -202,39 +202,15 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI
|
|||||||
if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
ScriptedAI::MoveInLineOfSight(who);
|
||||||
{
|
|
||||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
|
||||||
return;
|
|
||||||
|
|
||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
|
||||||
if(m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
|
|
||||||
{
|
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
|
||||||
AttackStart(who);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttackStart(Unit* who)
|
void AttackStart(Unit* who)
|
||||||
{
|
{
|
||||||
if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_creature->Attack(who, true))
|
ScriptedAI::AttackStart(who);
|
||||||
{
|
|
||||||
m_creature->AddThreat(who, 0.0f);
|
|
||||||
m_creature->SetInCombatWith(who);
|
|
||||||
who->SetInCombatWith(m_creature);
|
|
||||||
|
|
||||||
if (!InCombat)
|
|
||||||
{
|
|
||||||
InCombat = true;
|
|
||||||
Aggro(who);
|
|
||||||
}
|
|
||||||
|
|
||||||
DoStartMovement(who);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reset()
|
void Reset()
|
||||||
@@ -503,7 +479,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
|
|||||||
float attackRadius = m_creature->GetAttackDistance(who);
|
float attackRadius = m_creature->GetAttackDistance(who);
|
||||||
if (Phase >= 4 && m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
|
if (Phase >= 4 && m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
|
||||||
{
|
{
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||||
AttackStart(who);
|
AttackStart(who);
|
||||||
}
|
}
|
||||||
else if(who->isAlive())
|
else if(who->isAlive())
|
||||||
|
|||||||
@@ -352,8 +352,8 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI
|
|||||||
attackRadius = PULL_RANGE;
|
attackRadius = PULL_RANGE;
|
||||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= /*CREATURE_Z_ATTACK_RANGE*/7 /*there are stairs*/)
|
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= /*CREATURE_Z_ATTACK_RANGE*/7 /*there are stairs*/)
|
||||||
{
|
{
|
||||||
if(who->HasStealthAura())
|
//if(who->HasStealthAura())
|
||||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
// who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||||
AttackStart(who);
|
AttackStart(who);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-6
@@ -477,7 +477,7 @@ void Unit::RemoveSpellsCausingAura(AuraType auraType)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::RemoveAurasWithInterruptFlags(uint32 flag)
|
void Unit::RemoveAurasWithInterruptFlags(uint32 flag, uint32 except)
|
||||||
{
|
{
|
||||||
if(!(m_interruptMask & flag))
|
if(!(m_interruptMask & flag))
|
||||||
return;
|
return;
|
||||||
@@ -494,7 +494,7 @@ void Unit::RemoveAurasWithInterruptFlags(uint32 flag)
|
|||||||
{
|
{
|
||||||
if((*iter)->IsInUse())
|
if((*iter)->IsInUse())
|
||||||
sLog.outError("Aura %u is trying to remove itself! Flag %u. May cause crash!", (*iter)->GetId(), flag);
|
sLog.outError("Aura %u is trying to remove itself! Flag %u. May cause crash!", (*iter)->GetId(), flag);
|
||||||
else
|
else if(!except || (*iter)->GetId() != except)
|
||||||
{
|
{
|
||||||
RemoveAurasDueToSpell((*iter)->GetId());
|
RemoveAurasDueToSpell((*iter)->GetId());
|
||||||
if (!m_interruptableAuras.empty())
|
if (!m_interruptableAuras.empty())
|
||||||
@@ -507,7 +507,9 @@ void Unit::RemoveAurasWithInterruptFlags(uint32 flag)
|
|||||||
|
|
||||||
// interrupt channeled spell
|
// interrupt channeled spell
|
||||||
if(Spell* spell = m_currentSpells[CURRENT_CHANNELED_SPELL])
|
if(Spell* spell = m_currentSpells[CURRENT_CHANNELED_SPELL])
|
||||||
if(spell->getState() == SPELL_STATE_CASTING && (spell->m_spellInfo->ChannelInterruptFlags & flag))
|
if(spell->getState() == SPELL_STATE_CASTING
|
||||||
|
&& (spell->m_spellInfo->ChannelInterruptFlags & flag)
|
||||||
|
&& spell->m_spellInfo->Id != except)
|
||||||
InterruptNonMeleeSpells(false);
|
InterruptNonMeleeSpells(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -919,7 +921,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
|||||||
|
|
||||||
if (damagetype != NODAMAGE && damage)// && pVictim->GetTypeId() == TYPEID_PLAYER)
|
if (damagetype != NODAMAGE && damage)// && pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
pVictim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_DAMAGE);
|
pVictim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_DAMAGE, spellProto ? spellProto->Id : 0);
|
||||||
pVictim->RemoveSpellbyDamageTaken(damage, spellProto ? spellProto->Id : 0);
|
pVictim->RemoveSpellbyDamageTaken(damage, spellProto ? spellProto->Id : 0);
|
||||||
|
|
||||||
/*const SpellEntry *se = i->second->GetSpellProto();
|
/*const SpellEntry *se = i->second->GetSpellProto();
|
||||||
@@ -9736,8 +9738,11 @@ void Unit::SetInCombatState(bool PvP)
|
|||||||
if(GetTypeId() == TYPEID_PLAYER && GetPetGUID())
|
if(GetTypeId() == TYPEID_PLAYER && GetPetGUID())
|
||||||
{
|
{
|
||||||
if(Pet *pet = GetPet())
|
if(Pet *pet = GetPet())
|
||||||
for(int i = 0; i < MAX_MOVE_TYPE; ++i)
|
{
|
||||||
pet->UpdateSpeed(UnitMoveType(i), true);
|
pet->UpdateSpeed(MOVE_RUN, true);
|
||||||
|
pet->UpdateSpeed(MOVE_SWIM, true);
|
||||||
|
pet->UpdateSpeed(MOVE_FLY, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1102,7 +1102,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
|||||||
void RemoveSpellsCausingAura(AuraType auraType);
|
void RemoveSpellsCausingAura(AuraType auraType);
|
||||||
void RemoveRankAurasDueToSpell(uint32 spellId);
|
void RemoveRankAurasDueToSpell(uint32 spellId);
|
||||||
bool RemoveNoStackAurasDueToAura(Aura *Aur);
|
bool RemoveNoStackAurasDueToAura(Aura *Aur);
|
||||||
void RemoveAurasWithInterruptFlags(uint32 flags);
|
void RemoveAurasWithInterruptFlags(uint32 flags, uint32 except = 0);
|
||||||
void RemoveAurasWithDispelType( DispelType type );
|
void RemoveAurasWithDispelType( DispelType type );
|
||||||
|
|
||||||
void RemoveAllAuras();
|
void RemoveAllAuras();
|
||||||
|
|||||||
Reference in New Issue
Block a user