Violet Hold: If the boss is not attackable, he can't attack.

--HG--
branch : trunk
This commit is contained in:
maanuel
2009-12-09 20:08:44 -03:00
parent f1abbdbecc
commit d076f51703
6 changed files with 102 additions and 4 deletions
@@ -74,6 +74,20 @@ struct TRINITY_DLL_DECL boss_erekemAI : public ScriptedAI
} }
} }
void AttackStart(Unit* pWho)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (m_creature->Attack(pWho, true))
{
m_creature->AddThreat(pWho, 0.0f);
m_creature->SetInCombatWith(pWho);
pWho->SetInCombatWith(m_creature);
DoStartMovement(pWho);
}
}
void EnterCombat(Unit* who) void EnterCombat(Unit* who)
{ {
DoScriptText(SAY_AGGRO, m_creature); DoScriptText(SAY_AGGRO, m_creature);
@@ -213,27 +227,41 @@ struct TRINITY_DLL_DECL mob_erekem_guardAI : public ScriptedAI
uiGushingWoundTimer = urand(1000,3000); uiGushingWoundTimer = urand(1000,3000);
} }
void AttackStart(Unit* pWho)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (m_creature->Attack(pWho, true))
{
m_creature->AddThreat(pWho, 0.0f);
m_creature->SetInCombatWith(pWho);
pWho->SetInCombatWith(m_creature);
DoStartMovement(pWho);
}
}
void MoveInLineOfSight(Unit* who) {} void MoveInLineOfSight(Unit* who) {}
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
{ {
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
if (uiStrikeTimer <= diff) if (uiStrikeTimer <= diff)
{ {
DoCast(m_creature->getVictim(), SPELL_STRIKE); DoCast(m_creature->getVictim(), SPELL_STRIKE);
uiStrikeTimer = urand(4000,8000); uiStrikeTimer = urand(4000,8000);
} else uiStrikeTimer -= diff; } else uiStrikeTimer -= diff;
if (uiHowlingScreechTimer <= diff) if (uiHowlingScreechTimer <= diff)
{ {
DoCast(m_creature->getVictim(), SPELL_HOWLING_SCREECH); DoCast(m_creature->getVictim(), SPELL_HOWLING_SCREECH);
uiHowlingScreechTimer = urand(8000,13000); uiHowlingScreechTimer = urand(8000,13000);
} else uiHowlingScreechTimer -= diff; } else uiHowlingScreechTimer -= diff;
if (uiGushingWoundTimer <= diff) if (uiGushingWoundTimer <= diff)
{ {
DoCast(m_creature->getVictim(), SPELL_GUSHING_WOUND); DoCast(m_creature->getVictim(), SPELL_GUSHING_WOUND);
@@ -128,6 +128,20 @@ struct TRINITY_DLL_DECL boss_ichoronAI : public ScriptedAI
} }
} }
void AttackStart(Unit* pWho)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (m_creature->Attack(pWho, true))
{
m_creature->AddThreat(pWho, 0.0f);
m_creature->SetInCombatWith(pWho);
pWho->SetInCombatWith(m_creature);
DoStartMovement(pWho);
}
}
void WaterElementHit() void WaterElementHit()
{ {
m_creature->SetHealth(m_creature->GetHealth() + m_creature->GetMaxHealth() * 0.01); m_creature->SetHealth(m_creature->GetHealth() + m_creature->GetMaxHealth() * 0.01);
@@ -63,6 +63,20 @@ struct TRINITY_DLL_DECL boss_lavanthorAI : public ScriptedAI
} }
} }
void AttackStart(Unit* pWho)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (m_creature->Attack(pWho, true))
{
m_creature->AddThreat(pWho, 0.0f);
m_creature->SetInCombatWith(pWho);
pWho->SetInCombatWith(m_creature);
DoStartMovement(pWho);
}
}
void MoveInLineOfSight(Unit* who) {} void MoveInLineOfSight(Unit* who) {}
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
@@ -56,6 +56,20 @@ struct TRINITY_DLL_DECL boss_moraggAI : public ScriptedAI
} }
} }
void AttackStart(Unit* pWho)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (m_creature->Attack(pWho, true))
{
m_creature->AddThreat(pWho, 0.0f);
m_creature->SetInCombatWith(pWho);
pWho->SetInCombatWith(m_creature);
DoStartMovement(pWho);
}
}
void MoveInLineOfSight(Unit* who) {} void MoveInLineOfSight(Unit* who) {}
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
@@ -121,6 +121,20 @@ struct TRINITY_DLL_DECL boss_xevozzAI : public ScriptedAI
} }
} }
void AttackStart(Unit* pWho)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (m_creature->Attack(pWho, true))
{
m_creature->AddThreat(pWho, 0.0f);
m_creature->SetInCombatWith(pWho);
pWho->SetInCombatWith(m_creature);
DoStartMovement(pWho);
}
}
void EnterCombat(Unit* pWho) void EnterCombat(Unit* pWho)
{ {
DoScriptText(SAY_AGGRO, m_creature); DoScriptText(SAY_AGGRO, m_creature);
@@ -66,6 +66,20 @@ struct TRINITY_DLL_DECL boss_zuramatAI : public ScriptedAI
SpellSummonVoidTimer = 12000; SpellSummonVoidTimer = 12000;
} }
void AttackStart(Unit* pWho)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (m_creature->Attack(pWho, true))
{
m_creature->AddThreat(pWho, 0.0f);
m_creature->SetInCombatWith(pWho);
pWho->SetInCombatWith(m_creature);
DoStartMovement(pWho);
}
}
void EnterCombat(Unit* who) void EnterCombat(Unit* who)
{ {
DoScriptText(SAY_AGGRO, m_creature); DoScriptText(SAY_AGGRO, m_creature);