*Some changes in Kalecgos script - by darktabbit
--HG-- branch : trunk
This commit is contained in:
@@ -108,7 +108,17 @@ void hyjalAI::Reset()
|
|||||||
else error_log(ERROR_INST_DATA);
|
else error_log(ERROR_INST_DATA);
|
||||||
|
|
||||||
//Visibility
|
//Visibility
|
||||||
m_creature->SetVisibility(VISIBILITY_ON);
|
switch(m_creature->GetEntry())
|
||||||
|
{
|
||||||
|
case 17772: if(pInstance->GetData(DATA_ANETHERONEVENT) == DONE)
|
||||||
|
m_creature->SetVisibility(VISIBILITY_OFF);
|
||||||
|
else m_creature->SetVisibility(VISIBILITY_ON);
|
||||||
|
break;
|
||||||
|
case 17852: if(pInstance->GetData(DATA_AZGALOREVENT) == DONE)
|
||||||
|
m_creature->SetVisibility(VISIBILITY_OFF);
|
||||||
|
else m_creature->SetVisibility(VISIBILITY_ON);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//If Jaina evades, reset the visibility of all other creatures in the grid.
|
//If Jaina evades, reset the visibility of all other creatures in the grid.
|
||||||
if(CreatureList.empty())
|
if(CreatureList.empty())
|
||||||
|
|||||||
@@ -16,8 +16,9 @@
|
|||||||
|
|
||||||
/* ScriptData
|
/* ScriptData
|
||||||
SDName: Boss_Kalecgos
|
SDName: Boss_Kalecgos
|
||||||
SD%Complete: 0
|
SD%Complete: 95
|
||||||
SDComment: VERIFY SCRIPT
|
SDComment:
|
||||||
|
SDCategory: Sunwell_Plateau
|
||||||
EndScriptData */
|
EndScriptData */
|
||||||
|
|
||||||
#include "precompiled.h"
|
#include "precompiled.h"
|
||||||
@@ -68,7 +69,7 @@ EndScriptData */
|
|||||||
|
|
||||||
#define SPELL_BANISH 44836
|
#define SPELL_BANISH 44836
|
||||||
#define SPELL_TRANSFORM_KALEC 44670
|
#define SPELL_TRANSFORM_KALEC 44670
|
||||||
#define SPELL_ENRAGE 44807
|
#define SPELL_ENRAGE 44806
|
||||||
|
|
||||||
#define SPELL_CORRUPTION_STRIKE 45029
|
#define SPELL_CORRUPTION_STRIKE 45029
|
||||||
#define SPELL_AGONY_CURSE 45032
|
#define SPELL_AGONY_CURSE 45032
|
||||||
@@ -119,8 +120,8 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
if(pInstance)
|
if(pInstance)
|
||||||
{
|
{
|
||||||
uint64 SathGUID = pInstance->GetData64(DATA_SATHROVARR);
|
SathGUID = pInstance->GetData64(DATA_SATHROVARR);
|
||||||
uint64 DoorGUID = pInstance->GetData64(DATA_GO_FORCEFIELD);
|
DoorGUID = pInstance->GetData64(DATA_GO_FORCEFIELD);
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit *Sath = Unit::GetUnit(*m_creature,SathGUID);
|
Unit *Sath = Unit::GetUnit(*m_creature,SathGUID);
|
||||||
@@ -146,8 +147,7 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI
|
|||||||
TalkSequence = 0;
|
TalkSequence = 0;
|
||||||
isFriendly = false;
|
isFriendly = false;
|
||||||
isEnraged = false;
|
isEnraged = false;
|
||||||
isBanished = false;
|
isBanished = false;
|
||||||
//m_creature->CastSpell(m_creature, AURA_SUNWELL_RADIANCE, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DamageTaken(Unit *done_by, uint32 &damage)
|
void DamageTaken(Unit *done_by, uint32 &damage)
|
||||||
@@ -191,8 +191,7 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI
|
|||||||
switch(TalkSequence)
|
switch(TalkSequence)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
m_creature->setFaction(35);
|
m_creature->setFaction(35);
|
||||||
DoCast(m_creature, SPELL_TRANSFORM_KALEC);
|
|
||||||
TalkTimer = 1000;
|
TalkTimer = 1000;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
@@ -251,6 +250,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
|
|||||||
uint32 AgonyCurseTimer;
|
uint32 AgonyCurseTimer;
|
||||||
uint32 ShadowBoltTimer;
|
uint32 ShadowBoltTimer;
|
||||||
uint32 CheckTimer;
|
uint32 CheckTimer;
|
||||||
|
uint32 ResetThreat;
|
||||||
|
|
||||||
uint64 KalecGUID;
|
uint64 KalecGUID;
|
||||||
uint64 KalecgosGUID;
|
uint64 KalecgosGUID;
|
||||||
@@ -274,11 +274,9 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
|
|||||||
AgonyCurseTimer = 20000;
|
AgonyCurseTimer = 20000;
|
||||||
CorruptionStrikeTimer = 13000;
|
CorruptionStrikeTimer = 13000;
|
||||||
CheckTimer = 1000;
|
CheckTimer = 1000;
|
||||||
|
ResetThreat = 1000;
|
||||||
isEnraged = false;
|
isEnraged = false;
|
||||||
isBanished = false;
|
isBanished = false;
|
||||||
//m_creature->CastSpell(m_creature, AURA_SPECTRAL_INVISIBILITY, true);
|
|
||||||
//m_creature->CastSpell(m_creature, AURA_SUNWELL_RADIANCE, true);
|
|
||||||
//m_creature->CastSpell(m_creature, AURA_DEMONIC_VISUAL, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Aggro(Unit* who)
|
void Aggro(Unit* who)
|
||||||
@@ -341,9 +339,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
|
|||||||
if(Player* i_pl = i->getSource())
|
if(Player* i_pl = i->getSource())
|
||||||
if(i_pl->HasAura(AURA_SPECTRAL_REALM,0))
|
if(i_pl->HasAura(AURA_SPECTRAL_REALM,0))
|
||||||
i_pl->RemoveAurasDueToSpell(AURA_SPECTRAL_REALM);
|
i_pl->RemoveAurasDueToSpell(AURA_SPECTRAL_REALM);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Enrage(); // demon and dragon should enrage at the same time
|
|
||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
{
|
{
|
||||||
@@ -352,8 +348,14 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
|
|||||||
|
|
||||||
if(CheckTimer < diff)
|
if(CheckTimer < diff)
|
||||||
{
|
{
|
||||||
if(!isEnraged && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 10)
|
if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !isEnraged)
|
||||||
Enrage();
|
{
|
||||||
|
Unit* Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID);
|
||||||
|
if (Kalecgos)
|
||||||
|
Kalecgos->CastSpell(Kalecgos, SPELL_ENRAGE, true);
|
||||||
|
DoCast(m_creature, SPELL_ENRAGE, true);
|
||||||
|
isEnraged = true;
|
||||||
|
}
|
||||||
|
|
||||||
if(!isBanished && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1)
|
if(!isBanished && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1)
|
||||||
{
|
{
|
||||||
@@ -366,7 +368,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_creature->CastSpell(m_creature, SPELL_BANISH, true);
|
DoCast(m_creature, SPELL_BANISH);
|
||||||
isBanished = true;
|
isBanished = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -379,6 +381,22 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
|
|||||||
CheckTimer = 1000;
|
CheckTimer = 1000;
|
||||||
}else CheckTimer -= diff;
|
}else CheckTimer -= diff;
|
||||||
|
|
||||||
|
if(ResetThreat < diff)
|
||||||
|
{
|
||||||
|
if ( ( m_creature->getVictim()->HasAura(AURA_SPECTRAL_EXHAUSTION,0)) && (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER) )
|
||||||
|
{
|
||||||
|
for(std::list<HostilReference*>::iterator itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
|
||||||
|
{
|
||||||
|
if(((*itr)->getUnitGuid()) == (m_creature->getVictim()->GetGUID()))
|
||||||
|
{
|
||||||
|
(*itr)->removeReference();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ResetThreat = 1000;
|
||||||
|
}else ResetThreat -= diff;
|
||||||
|
|
||||||
if(ShadowBoltTimer < diff)
|
if(ShadowBoltTimer < diff)
|
||||||
{
|
{
|
||||||
DoScriptText(SAY_SATH_SPELL1, m_creature);
|
DoScriptText(SAY_SATH_SPELL1, m_creature);
|
||||||
@@ -435,9 +453,6 @@ struct TRINITY_DLL_DECL boss_kalecAI : public ScriptedAI
|
|||||||
YellSequence = 0;
|
YellSequence = 0;
|
||||||
|
|
||||||
isEnraged = false;
|
isEnraged = false;
|
||||||
|
|
||||||
//m_creature->CastSpell(m_creature, AURA_SPECTRAL_INVISIBILITY, true);
|
|
||||||
//m_creature->CastSpell(m_creature, AURA_SUNWELL_RADIANCE, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Aggro(Unit* who) {}
|
void Aggro(Unit* who) {}
|
||||||
@@ -452,11 +467,8 @@ struct TRINITY_DLL_DECL boss_kalecAI : public ScriptedAI
|
|||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
{
|
{
|
||||||
if(!m_creature->getVictim()) // only victim is Sath
|
if (!UpdateVictim())
|
||||||
{
|
return;
|
||||||
EnterEvadeMode();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(YellTimer < diff)
|
if(YellTimer < diff)
|
||||||
{
|
{
|
||||||
@@ -532,35 +544,38 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(CheckTimer < diff)
|
if(CheckTimer < diff)
|
||||||
{
|
{
|
||||||
if(!isEnraged && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 10)
|
if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !isEnraged)
|
||||||
{
|
{
|
||||||
if(Unit *Sath = Unit::GetUnit(*m_creature, SathGUID))
|
Unit* Sath = Unit::GetUnit(*m_creature, SathGUID);
|
||||||
((boss_sathrovarrAI*)((Creature*)Sath)->AI())->Enrage();
|
if (Sath)
|
||||||
}
|
Sath->CastSpell(Sath, SPELL_ENRAGE, true);
|
||||||
|
DoCast(m_creature, SPELL_ENRAGE, true);
|
||||||
if(!isBanished && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1)
|
isEnraged = true;
|
||||||
{
|
}
|
||||||
if(Unit *Sath = Unit::GetUnit(*m_creature, SathGUID))
|
|
||||||
{
|
if(!isBanished && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1)
|
||||||
if(((boss_sathrovarrAI*)((Creature*)Sath)->AI())->isBanished)
|
{
|
||||||
{
|
if(Unit *Sath = Unit::GetUnit(*m_creature, SathGUID))
|
||||||
Sath->DealDamage(Sath, Sath->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
{
|
||||||
return;
|
if(((boss_sathrovarrAI*)((Creature*)Sath)->AI())->isBanished)
|
||||||
}
|
{
|
||||||
else
|
Sath->DealDamage(Sath, Sath->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||||
{
|
return;
|
||||||
m_creature->CastSpell(m_creature, SPELL_BANISH, true);
|
}
|
||||||
isBanished = true;
|
else
|
||||||
}
|
{
|
||||||
}
|
DoCast(m_creature, SPELL_BANISH);
|
||||||
else
|
isBanished = true;
|
||||||
{
|
}
|
||||||
DoTextEmote("is unable to find Sath", NULL);
|
}
|
||||||
EnterEvadeMode();
|
else
|
||||||
}
|
{
|
||||||
}
|
error_log("TSCR: Didn't find Shathrowar. Kalecgos event reseted.");
|
||||||
CheckTimer = 1000; //every 1 sec we check this
|
EnterEvadeMode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CheckTimer = 1000;
|
||||||
}else CheckTimer -= diff;
|
}else CheckTimer -= diff;
|
||||||
|
|
||||||
if(ArcaneBuffetTimer < diff)
|
if(ArcaneBuffetTimer < diff)
|
||||||
@@ -583,42 +598,30 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff)
|
|||||||
|
|
||||||
if(WildMagicTimer < diff)
|
if(WildMagicTimer < diff)
|
||||||
{
|
{
|
||||||
DoCast(m_creature, WildMagic[rand()%6]);
|
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||||
|
if(target && target->isAlive())
|
||||||
|
DoCast(target, WildMagic[rand()%6]);
|
||||||
WildMagicTimer = 20000;
|
WildMagicTimer = 20000;
|
||||||
}else WildMagicTimer -= diff;
|
}else WildMagicTimer -= diff;
|
||||||
|
|
||||||
if(SpectralBlastTimer < diff)
|
if(SpectralBlastTimer < diff)
|
||||||
{
|
{
|
||||||
m_creature->CastSpell(m_creature, SPELL_SPECTRAL_BLAST, true);
|
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||||
SpectralBlastTimer = 20000+(rand()%5000);
|
if( ( target != m_creature->getVictim() ) && target->isAlive() && !(target->HasAura(AURA_SPECTRAL_EXHAUSTION, 0)) )
|
||||||
|
{
|
||||||
|
DoCast(target, SPELL_SPECTRAL_BLAST);
|
||||||
|
SpectralBlastTimer = 20000+(rand()%5000);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SpectralBlastTimer = 1000;
|
||||||
|
}
|
||||||
}else SpectralBlastTimer -= diff;
|
}else SpectralBlastTimer -= diff;
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void boss_sathrovarrAI::Enrage()
|
|
||||||
{
|
|
||||||
Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID);
|
|
||||||
Unit *Kalec = Unit::GetUnit(*m_creature, KalecGUID);
|
|
||||||
if(!Kalecgos)
|
|
||||||
{
|
|
||||||
error_log("SD2 ERROR: unable to find Kalecgos");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(!Kalec)
|
|
||||||
{
|
|
||||||
error_log("SD2 ERROR: unable to find Kalec");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
DoScriptText(SAY_SATH_ENRAGE, m_creature);
|
|
||||||
m_creature->CastSpell(m_creature, SPELL_ENRAGE, true);
|
|
||||||
Kalecgos->CastSpell(Kalecgos, SPELL_ENRAGE, true);
|
|
||||||
isEnraged = true;
|
|
||||||
((boss_kalecgosAI*)((Creature*)Kalecgos)->AI())->isEnraged = true;
|
|
||||||
((boss_kalecAI*)((Creature*)Kalec)->AI())->isEnraged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GOkalocegos_teleporter(Player *player, GameObject* _GO)
|
bool GOkalocegos_teleporter(Player *player, GameObject* _GO)
|
||||||
{
|
{
|
||||||
if(player->HasAura(AURA_SPECTRAL_EXHAUSTION, 0))
|
if(player->HasAura(AURA_SPECTRAL_EXHAUSTION, 0))
|
||||||
|
|||||||
Reference in New Issue
Block a user