*Add the second part of the previous commit.

--HG--
branch : trunk
This commit is contained in:
Anubisss
2009-05-01 01:07:09 +02:00
parent 16913c63c3
commit f72cd39122
52 changed files with 388 additions and 215 deletions

View File

@@ -65,10 +65,10 @@ struct TRINITY_DLL_DECL boss_golemaggAI : public ScriptedAI
void JustDied(Unit* Killer)
{
if(pInstance)
pInstance->SetData(DATA_GOLEMAGG_DEATH, 0);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())

View File

@@ -224,8 +224,12 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI
for(int i = 0; i < 9;i++)
{
target = SelectUnit(SELECT_TARGET_RANDOM,0);
Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(target)
{
Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
}
}
HasSubmergedOnce = true;
@@ -241,8 +245,12 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI
for(int i = 0; i < 9;i++)
{
target = SelectUnit(SELECT_TARGET_RANDOM,0);
Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(target)
{
Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
}
}
WasBanished = true;

View File

@@ -106,7 +106,7 @@ struct TRINITY_DLL_DECL npc_kyle_frenziedAI : public ScriptedAI
{
Unit *plr = Unit::GetUnit((*m_creature),player);
if(plr)
m_creature->SetOrientation(m_creature->GetAngle(plr));
m_creature->SetOrientation(m_creature->GetAngle(plr));
m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING); //eat
WorldPacket data;
m_creature->BuildHeartBeatMsg(&data);

View File

@@ -157,6 +157,7 @@ struct TRINITY_DLL_DECL mob_lumpAI : public ScriptedAI
EnterEvadeMode();
bReset = false;
m_creature->setFaction(1711); //hostile
return;
}
else Reset_Timer -= diff;
}

View File

@@ -75,7 +75,8 @@ struct TRINITY_DLL_DECL mob_webwrapAI : public ScriptedAI
{
Unit* victim = NULL;
victim = Unit::GetUnit((*m_creature), victimGUID);
victim->RemoveAurasDueToSpell(SPELL_WEBTRAP);
if(victim)
victim->RemoveAurasDueToSpell(SPELL_WEBTRAP);
}
}
}

View File

@@ -115,9 +115,12 @@ struct TRINITY_DLL_DECL boss_amnennar_the_coldbringerAI : public ScriptedAI
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM,0);
SummonSpectrals(target);
SummonSpectrals(target);
SummonSpectrals(target);
if(target)
{
SummonSpectrals(target);
SummonSpectrals(target);
SummonSpectrals(target);
}
Spectrals = true;
}

View File

@@ -224,6 +224,7 @@ struct TRINITY_DLL_DECL mob_headAI : public ScriptedAI
DoScriptText(textEntry, m_creature, target);
//DoCast(m_creature,SPELL_HEAD_SPEAKS,true);
Creature *speaker = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1000);
if(speaker)
speaker->CastSpell(speaker,SPELL_HEAD_SPEAKS,false);
laugh += 3000;
}
@@ -295,6 +296,7 @@ struct TRINITY_DLL_DECL mob_headAI : public ScriptedAI
DoPlaySoundToSet(m_creature, RandomLaught[rand()%3]);
//DoCast(m_creature,SPELL_HEAD_SPEAKS,true); //this spell remove buff "head"
Creature *speaker = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1000);
if(speaker)
speaker->CastSpell(speaker,SPELL_HEAD_SPEAKS,false);
DoTextEmote("laughts",NULL);
} else laugh -= diff;
@@ -421,8 +423,9 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI
m_creature->SetVisibility(VISIBILITY_ON);break;
case 1: {
Creature *smoke = m_creature->SummonCreature(HELPER,Spawn[1].x,Spawn[1].y,Spawn[1].z,0,TEMPSUMMON_TIMED_DESPAWN,20000);
if(smoke)
((mob_wisp_invisAI*)smoke->AI())->SetType(3);
DoCast(m_creature,SPELL_RHYME_BIG);
DoCast(m_creature,SPELL_RHYME_BIG);
break;}
case 6:
if(pInstance)
@@ -515,8 +518,10 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI
//m_creature->GetMotionMaster()->MoveIdle(); test
SaySound(SAY_DEATH);
Creature *flame = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000);
if(flame)
flame->CastSpell(flame,SPELL_BODY_FLAME,false);
Creature *wisp = DoSpawnCreature(WISP_INVIS,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000);
if(wisp)
((mob_wisp_invisAI*)wisp->AI())->SetType(4);
if(pInstance)
pInstance->SetData(DATA_HORSEMAN_EVENT, DONE);
@@ -592,11 +597,15 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI
say_timer = 3000;
Player *plr = SelectRandomPlayer(100.0f,false);
if (count < 3)
plr->Say(Text[count].text,0);
if(plr)
plr->Say(Text[count].text,0);
else {
DoCast(m_creature,SPELL_RHYME_BIG);
plr->Say(Text[count].text,0);
plr->HandleEmoteCommand(ANIM_EMOTE_SHOUT);
if(plr)
{
plr->Say(Text[count].text,0);
plr->HandleEmoteCommand(ANIM_EMOTE_SHOUT);
}
wp_reached = true;
IsFlying = true;
count = 0;
@@ -618,8 +627,9 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI
if(burn < diff)
{
Creature *flame = m_creature->SummonCreature(HELPER,Spawn[0].x,Spawn[0].y,Spawn[0].z,0,TEMPSUMMON_TIMED_DESPAWN,17000);
if(flame)
((mob_wisp_invisAI*)flame->AI())->SetType(2);
burned = true;
burned = true;
}else burn -= diff;
break;
case 2:
@@ -727,10 +737,13 @@ struct TRINITY_DLL_DECL mob_pulsing_pumpkinAI : public ScriptedAI
m_creature->Relocate(x,y,z + 0.35f);
Despawn();
Creature *debuff = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,14500);
if(debuff)
{
debuff->SetDisplayId(m_creature->GetDisplayId());
debuff->CastSpell(debuff,SPELL_PUMPKIN_AURA_GREEN,false);
((mob_wisp_invisAI*)debuff->AI())->SetType(1);
debuffGUID = debuff->GetGUID();
}
sprouted = false;
DoCast(m_creature,SPELL_PUMPKIN_AURA,true);
DoCast(m_creature,SPELL_SPROUTING);
@@ -792,8 +805,11 @@ bool GOHello_go_loosely_turned_soil(Player *plr, GameObject* soil)
{ */
plr->AreaExploredOrEventHappens(11405);
Creature *horseman = soil->SummonCreature(HH_MOUNTED,FlightPoint[20].x,FlightPoint[20].y,FlightPoint[20].z,0,TEMPSUMMON_MANUAL_DESPAWN,0);
if(horseman)
{
((boss_headless_horsemanAI*)horseman->AI())->playerGUID = plr->GetGUID();
((boss_headless_horsemanAI*)horseman->AI())->FlyMode();
}
//}
return true;
}

View File

@@ -113,60 +113,80 @@ struct TRINITY_DLL_DECL boss_darkmaster_gandlingAI : public ScriptedAI
case 0:
DoTeleportPlayer(target, 250.0696,0.3921,84.8408,3.149);
Summoned = m_creature->SummonCreature(16119,254.2325,0.3417,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,257.7133,4.0226,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,258.6702,-2.60656,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
break;
case 1:
DoTeleportPlayer(target, 181.4220,-91.9481,84.8410,1.608);
Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
break;
case 2:
DoTeleportPlayer(target, 95.1547,-1.8173,85.2289,0.043);
Summoned = m_creature->SummonCreature(16119,100.9404,-1.8016,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,101.3729,0.4882,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,101.4596,-4.4740,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
break;
case 3:
DoTeleportPlayer(target, 250.0696,0.3921,72.6722,3.149);
Summoned = m_creature->SummonCreature(16119,240.34481,0.7368,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,240.3633,-2.9520,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,240.6702,3.34949,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
break;
case 4:
DoTeleportPlayer(target, 181.4220,-91.9481,70.7734,1.608);
Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
break;
case 5:
DoTeleportPlayer(target, 106.1541,-1.8994,75.3663,0.043);
Summoned = m_creature->SummonCreature(16119,115.3945,-1.5555,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,257.7133,1.8066,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,258.6702,-5.1001,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
((CreatureAI*)Summoned->AI())->AttackStart(target);
if(Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
break;
}
}

View File

@@ -122,7 +122,8 @@ struct TRINITY_DLL_DECL boss_jandicebarovAI : public ScriptedAI
for(int i = 0; i < 10;i++)
{
target = SelectUnit(SELECT_TARGET_RANDOM,0);
SummonIllusions(target);
if(target)
SummonIllusions(target);
}
Invisible = true;
Invisible_Timer = 3000;

View File

@@ -74,7 +74,8 @@ struct TRINITY_DLL_DECL boss_kormokAI : public ScriptedAI
}
Rand1 = 0;
SummonedMinions = DoSpawnCreature(16119, Rand1X, Rand1Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
((CreatureAI*)SummonedMinions->AI())->AttackStart(victim);
if(SummonedMinions)
((CreatureAI*)SummonedMinions->AI())->AttackStart(victim);
}
void SummonMages(Unit* victim)
@@ -94,7 +95,8 @@ struct TRINITY_DLL_DECL boss_kormokAI : public ScriptedAI
}
Rand2 = 0;
SummonedMages = DoSpawnCreature(16120, Rand2X, Rand2Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000);
((CreatureAI*)SummonedMages->AI())->AttackStart(victim);
if(SummonedMages)
((CreatureAI*)SummonedMages->AI())->AttackStart(victim);
}
void UpdateAI(const uint32 diff)

View File

@@ -140,8 +140,10 @@ struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI
if(Evade)
if(ResetTimer < diff)
{
EnterEvadeMode();
else ResetTimer -= diff;
return;
}else ResetTimer -= diff;
if(!UpdateVictim())
return;
@@ -695,12 +697,16 @@ struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0);
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
Unit* Illidan = m_creature->SummonCreature(C_ILLIDAN, -5107.83, 602.584, 85.2393, 4.92598, TEMPSUMMON_CORPSE_DESPAWN, 0);
IllidanGUID = Illidan->GetGUID();
Illidan->SetVisibility(VISIBILITY_OFF);
if(Illidan)
{
IllidanGUID = Illidan->GetGUID();
Illidan->SetVisibility(VISIBILITY_OFF);
}
if(PlayerGUID)
{
Player* player = Unit::GetPlayer(PlayerGUID);
DoScriptText(OVERLORD_SAY_1, m_creature, player);
if(player)
DoScriptText(OVERLORD_SAY_1, m_creature, player);
}
ConversationTimer = 4200;
Step = 0;

View File

@@ -77,6 +77,7 @@ struct TRINITY_DLL_DECL mob_yennikuAI : public ScriptedAI
EnterEvadeMode();
bReset = false;
m_creature->setFaction(28); //troll, bloodscalp
return;
}
else Reset_Timer -= diff;

View File

@@ -177,7 +177,6 @@ CreatureAI* GetAI_boss_baron_rivendare(Creature *_Creature)
return new boss_baron_rivendareAI (_Creature);
}
void AddSC_boss_baron_rivendare()
{
Script *newscript;

View File

@@ -116,7 +116,6 @@ CreatureAI* GetAI_boss_baroness_anastari(Creature *_Creature)
return new boss_baroness_anastariAI (_Creature);
}
void AddSC_boss_baroness_anastari()
{
Script *newscript;

View File

@@ -210,7 +210,6 @@ CreatureAI* GetAI_boss_cannon_master_willey(Creature *_Creature)
return new boss_cannon_master_willeyAI (_Creature);
}
void AddSC_boss_cannon_master_willey()
{
Script *newscript;

View File

@@ -122,7 +122,6 @@ CreatureAI* GetAI_boss_magistrate_barthilas(Creature *_Creature)
return new boss_magistrate_barthilasAI (_Creature);
}
void AddSC_boss_magistrate_barthilas()
{
Script *newscript;

View File

@@ -97,7 +97,6 @@ CreatureAI* GetAI_boss_maleki_the_pallid(Creature *_Creature)
return new boss_maleki_the_pallidAI (_Creature);
}
void AddSC_boss_maleki_the_pallid()
{
Script *newscript;

View File

@@ -52,7 +52,7 @@ struct TRINITY_DLL_DECL boss_nerubenkanAI : public ScriptedAI
CryptScarabs_Timer = 3000;
EncasingWebs_Timer = 7000;
PierceArmor_Timer = 19000;
RaiseUndeadScarab_Timer = 3000;
RaiseUndeadScarab_Timer = 3000;
}
void Aggro(Unit *who)
@@ -94,9 +94,7 @@ struct TRINITY_DLL_DECL boss_nerubenkanAI : public ScriptedAI
//EncasingWebs
if (EncasingWebs_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_ENCASINGWEBS);
EncasingWebs_Timer = 30000;
}else EncasingWebs_Timer -= diff;
@@ -105,7 +103,6 @@ struct TRINITY_DLL_DECL boss_nerubenkanAI : public ScriptedAI
{
if (rand()%100 < 75)
DoCast(m_creature->getVictim(),SPELL_PIERCEARMOR);
PierceArmor_Timer = 35000;
}else PierceArmor_Timer -= diff;
@@ -131,7 +128,6 @@ CreatureAI* GetAI_boss_nerubenkan(Creature *_Creature)
return new boss_nerubenkanAI (_Creature);
}
void AddSC_boss_nerubenkan()
{
Script *newscript;

View File

@@ -145,10 +145,6 @@ CreatureAI* GetAI_boss_silver_hand_bossesAI(Creature *_Creature)
return new boss_silver_hand_bossesAI (_Creature);
}
/*#####
#
#####*/
void AddSC_boss_order_of_silver_hand()
{
Script *newscript;

View File

@@ -133,7 +133,6 @@ CreatureAI* GetAI_boss_postmaster_malown(Creature *_Creature)
return new boss_postmaster_malownAI (_Creature);
}
void AddSC_boss_postmaster_malown()
{
Script *newscript;

View File

@@ -88,7 +88,6 @@ CreatureAI* GetAI_boss_ramstein_the_gorger(Creature *_Creature)
return new boss_ramstein_the_gorgerAI (_Creature);
}
void AddSC_boss_ramstein_the_gorger()
{
Script *newscript;

View File

@@ -42,11 +42,11 @@ struct TRINITY_DLL_DECL boss_timmy_the_cruelAI : public ScriptedAI
void Aggro(Unit *who)
{
if (!HasYelled)
{
DoYell(SAY_SPAWN,LANG_UNIVERSAL,NULL);
HasYelled = true;
}
if (!HasYelled)
{
DoYell(SAY_SPAWN,LANG_UNIVERSAL,NULL);
HasYelled = true;
}
}
void UpdateAI(const uint32 diff)
@@ -72,7 +72,6 @@ CreatureAI* GetAI_boss_timmy_the_cruel(Creature *_Creature)
return new boss_timmy_the_cruelAI (_Creature);
}
void AddSC_boss_timmy_the_cruel()
{
Script *newscript;

View File

@@ -262,7 +262,8 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
DoCast(target, SPELL_CONFLAGRATION);
if(target)
DoCast(target, SPELL_CONFLAGRATION);
ConflagrationTimer = 30000+(rand()%5000);
}
}else ConflagrationTimer -= diff;
@@ -275,11 +276,13 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
DoCast(target, SPELL_SHADOW_NOVA);
if(target)
DoCast(target, SPELL_SHADOW_NOVA);
if(!SisterDeath)
{
DoScriptText(EMOTE_SHADOW_NOVA, m_creature, target);
if(target)
DoScriptText(EMOTE_SHADOW_NOVA, m_creature, target);
DoScriptText(YELL_SHADOW_NOVA, m_creature);
}
ShadownovaTimer = 30000+(rand()%5000);
@@ -293,7 +296,8 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
DoCast(target, SPELL_CONFOUNDING_BLOW);
if(target)
DoCast(target, SPELL_CONFOUNDING_BLOW);
ConfoundingblowTimer = 20000 + (rand()%5000);
}
}else ConfoundingblowTimer -=diff;
@@ -306,7 +310,8 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
{
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
temp = DoSpawnCreature(MOB_SHADOW_IMAGE,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN,10000);
temp->AI()->AttackStart(target);
if(temp && target)
temp->AI()->AttackStart(target);
}
ShadowimageTimer = 20000;
}else ShadowimageTimer -=diff;
@@ -595,7 +600,8 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
DoCast(target, SPELL_SHADOW_NOVA);
if(target)
DoCast(target, SPELL_SHADOW_NOVA);
ShadownovaTimer= 30000+(rand()%5000);
}
}else ShadownovaTimer -=diff;
@@ -609,12 +615,14 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
DoCast(target, SPELL_CONFLAGRATION);
if(target)
DoCast(target, SPELL_CONFLAGRATION);
ConflagrationTimer = 30000+(rand()%5000);
if(!SisterDeath)
{
DoScriptText(EMOTE_CONFLAGRATION, m_creature, target);
if(target)
DoScriptText(EMOTE_CONFLAGRATION, m_creature, target);
DoScriptText(YELL_CANFLAGRATION, m_creature);
}

View File

@@ -318,7 +318,12 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI
m_creature->CastSpell(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug
Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true);
}
}else EnterEvadeMode();
}
else
{
EnterEvadeMode();
return;
}
Timer[EVENT_FLIGHT_SEQUENCE] = 10000;
break;}
case 3: {
@@ -339,7 +344,12 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI
m_creature->CastSpell(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug
Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true);
}
}else EnterEvadeMode();
}
else
{
EnterEvadeMode();
return;
}
Timer[EVENT_FLIGHT_SEQUENCE] = 10000;
break;}
case 4:
@@ -357,7 +367,11 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI
float x, y, z;
target->GetContactPoint(m_creature, x, y, z, 70);
m_creature->GetMotionMaster()->MovePoint(0, x, y, z+10);
}else EnterEvadeMode();
}else
{
EnterEvadeMode();
return;
}
Timer[EVENT_FLIGHT_SEQUENCE] = 0;
break;}
case 6:
@@ -391,7 +405,12 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI
float x, y, z;
target->GetContactPoint(m_creature, x, y, z);
m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
}else EnterEvadeMode();
}
else
{
EnterEvadeMode();
return;
}
Timer[EVENT_FLIGHT_SEQUENCE] = 0;
break;
case 10:

View File

@@ -396,6 +396,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
{
DoTextEmote("is unable to find Kalecgos", NULL);
EnterEvadeMode();
return;
}
}
CheckTimer = 1000;
@@ -594,6 +595,7 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff)
{
error_log("TSCR: Didn't find Shathrowar. Kalecgos event reseted.");
EnterEvadeMode();
return;
}
}
CheckTimer = 1000;
@@ -627,7 +629,7 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff)
{
//this is a hack. we need to find a victim without aura in core
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if( ( target != m_creature->getVictim() ) && target->isAlive() && !(target->HasAura(AURA_SPECTRAL_EXHAUSTION, 0)) )
if( ( target && target != m_creature->getVictim() ) && target->isAlive() && !(target->HasAura(AURA_SPECTRAL_EXHAUSTION, 0)) )
{
DoCast(target, SPELL_SPECTRAL_BLAST);
SpectralBlastTimer = 20000+(rand()%5000);

View File

@@ -545,7 +545,8 @@ struct TRINITY_DLL_DECL boss_kiljaedenAI : public Scripted_NoMovementAI
}
target->GetPosition(x,y,z);
Creature* SinisterReflection = m_creature->SummonCreature(CREATURE_SINISTER_REFLECTION, x,y,z,0, TEMPSUMMON_CORPSE_DESPAWN, 0);
SinisterReflection->AI()->AttackStart(target);
if(SinisterReflection)
SinisterReflection->AI()->AttackStart(target);
}
}

View File

@@ -407,7 +407,7 @@ struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI
DoScriptText(SAY_CHICKEN_AMB, m_creature);
{Unit* scoff = FindCreature(SPAWN_SECOND_2, 30, m_creature);
if(scoff)
DoScriptText(SAY_SCOFF, scoff);}break;
DoScriptText(SAY_SCOFF, scoff);}break;
break;
case 86:

View File

@@ -276,8 +276,12 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI
m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
m_creature->StopMoving();
WaitEvent = WE_LAND;
}else EnterEvadeMode();
return;
}
else
{
EnterEvadeMode();
return;
}
case WE_LAND:
WaitEvent = WE_SUMMON;
WaitTimer = 2000;
@@ -349,7 +353,8 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI
if(Charge_Timer < diff)
{
Unit *target= SelectUnit(SELECT_TARGET_RANDOM, 1, GetSpellMaxRange(SPELL_CHARGE), true);
DoCast(target, SPELL_CHARGE);
if(target)
DoCast(target, SPELL_CHARGE);
Charge_Timer = 30000;
}else Charge_Timer -= diff;
@@ -405,7 +410,7 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI
else
{
Unit *target = NULL;
if(Phase1 && (target = m_creature->SelectNearestTarget(5)))
if(Phase1 && target && (target = m_creature->SelectNearestTarget(5)))
m_creature->AI()->AttackStart(target);
else
{

View File

@@ -233,38 +233,38 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
Wrath_Timer = 20000+rand()%5000;
}else Wrath_Timer -= diff;
if (ArcaneMissiles_Timer < diff)
{
if(BlindingLight)
{
DoCast(m_creature->getVictim(), SPELL_BLINDING_LIGHT);
BlindingLight = false;
}else{
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (ArcaneMissiles_Timer < diff)
{
if(BlindingLight)
{
DoCast(m_creature->getVictim(), SPELL_BLINDING_LIGHT);
BlindingLight = false;
}else{
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if(!m_creature->HasInArc(2.5f, target))
target = m_creature->getVictim();
if(!m_creature->HasInArc(2.5f, target))
target = m_creature->getVictim();
if(target)
DoCast(target, SPELL_ARCANE_MISSILES);
}
ArcaneMissiles_Timer = 3000;
}else ArcaneMissiles_Timer -= diff;
if (MarkOfTheSolarian_Timer < diff)
{
DoCast(m_creature->getVictim(), MARK_OF_SOLARIAN);
MarkOfTheSolarian_Timer = 45000;
}else MarkOfTheSolarian_Timer -= diff;
if (MarkOfTheAstromancer_Timer < diff) //A debuff that lasts for 5 seconds, cast several times each phase on a random raid member, but not the main tank
{
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1, 100, true);
if(target)
DoCast(target, SPELL_ARCANE_MISSILES);
}
ArcaneMissiles_Timer = 3000;
}else ArcaneMissiles_Timer -= diff;
if (MarkOfTheSolarian_Timer < diff)
{
DoCast(m_creature->getVictim(), MARK_OF_SOLARIAN);
MarkOfTheSolarian_Timer = 45000;
}else MarkOfTheSolarian_Timer -= diff;
if (MarkOfTheAstromancer_Timer < diff) //A debuff that lasts for 5 seconds, cast several times each phase on a random raid member, but not the main tank
{
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1, 100, true);
if(target)
DoCast(target, SPELL_MARK_OF_THE_ASTROMANCER);
else DoCast(m_creature->getVictim(), SPELL_MARK_OF_THE_ASTROMANCER);
MarkOfTheAstromancer_Timer = 15000;
}else MarkOfTheAstromancer_Timer -= diff;
DoCast(target, SPELL_MARK_OF_THE_ASTROMANCER);
else DoCast(m_creature->getVictim(), SPELL_MARK_OF_THE_ASTROMANCER);
MarkOfTheAstromancer_Timer = 15000;
}else MarkOfTheAstromancer_Timer -= diff;
//Phase1_Timer
if (Phase1_Timer < diff)
@@ -383,6 +383,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_VOIDWALKER);
m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f);
}
DoMeleeAttackIfReady();
}
};

View File

@@ -258,6 +258,8 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI
if (!Target)
Target = m_creature->getVictim();
DoResetThreat();
if(!Target)
return;
AttackStart(Target);
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveChase(Target);
@@ -325,7 +327,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
i_pl->DestroyItemCount(30318, 1, true);
i_pl->DestroyItemCount(30319, 1, true);
i_pl->DestroyItemCount(30320, 1, true);
}
}
}
void Reset()
@@ -436,7 +438,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
{
summoned->setFaction(m_creature->getFaction());
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
summoned->AI()->AttackStart(target);
if(target)
summoned->AI()->AttackStart(target);
}
summons.Summon(summoned);
}
@@ -498,12 +501,12 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(pInstance && Phase)
{
if(pInstance->GetData(DATA_KAELTHASEVENT) == IN_PROGRESS && m_creature->getThreatManager().getThreatList().empty())
{
EnterEvadeMode();
EnterEvadeMode();
return;
}
}
@@ -730,7 +733,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[i]));
if (!Advisor)
error_log("TSCR: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i);
else ((advisorbase_ai*)Advisor->AI())->Revive(Target);
else if(Target)
((advisorbase_ai*)Advisor->AI())->Revive(Target);
}
PhaseSubphase = 1;
@@ -815,7 +819,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
Unit* target =SelectUnit(SELECT_TARGET_RANDOM, 1, 70, true);
if(!target) target = m_creature->getVictim();
debug_log("TSCR: Kael'Thas mind control not supported.");
DoCast(target, SPELL_MIND_CONTROL);
if(target)
DoCast(target, SPELL_MIND_CONTROL);
}
MindControl_Timer = 60000;
@@ -1078,8 +1083,11 @@ struct TRINITY_DLL_DECL boss_thaladred_the_darkenerAI : public advisorbase_ai
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoResetThreat();
m_creature->AddThreat(target, 5000000.0f);
DoScriptText(EMOTE_THALADRED_GAZE, m_creature, target);
if(target)
{
m_creature->AddThreat(target, 5000000.0f);
DoScriptText(EMOTE_THALADRED_GAZE, m_creature, target);
}
Gaze_Timer = 8500;
}
}else Gaze_Timer -= diff;
@@ -1398,7 +1406,7 @@ struct TRINITY_DLL_DECL mob_kael_flamestrikeAI : public ScriptedAI
//Phoenix AI
struct TRINITY_DLL_DECL mob_phoenix_tkAI : public ScriptedAI
{
mob_phoenix_tkAI(Creature *c) : ScriptedAI(c)
mob_phoenix_tkAI(Creature *c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
}
@@ -1408,7 +1416,7 @@ struct TRINITY_DLL_DECL mob_phoenix_tkAI : public ScriptedAI
bool egg;
void JustDied(Unit *victim)
{
{
if(egg)
{
float x,y,z;
@@ -1438,7 +1446,7 @@ struct TRINITY_DLL_DECL mob_phoenix_tkAI : public ScriptedAI
}
void UpdateAI(const uint32 diff)
{
{
if (Cycle_Timer < diff)
{
if(pInstance)//check for boss reset
@@ -1447,7 +1455,7 @@ struct TRINITY_DLL_DECL mob_phoenix_tkAI : public ScriptedAI
if (Kael && Kael->getThreatManager().getThreatList().empty())
{
egg = false;
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
Cycle_Timer = 2000;
return;
}
@@ -1460,7 +1468,7 @@ struct TRINITY_DLL_DECL mob_phoenix_tkAI : public ScriptedAI
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
Cycle_Timer = 2000;
}else Cycle_Timer -= diff;
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();

View File

@@ -100,7 +100,6 @@ struct TRINITY_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim() )
return;
@@ -151,7 +150,6 @@ struct TRINITY_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI
}else solarburn_Timer -= diff;
DoMeleeAttackIfReady();
}
};

View File

@@ -216,7 +216,6 @@ struct TRINITY_DLL_DECL mob_nether_wraithAI : public ScriptedAI
DoCast(m_creature,SPELL_DETONATION);
Detonation = true;
}else Detonation_Timer -= diff;
}
if (Detonation)
@@ -228,7 +227,6 @@ struct TRINITY_DLL_DECL mob_nether_wraithAI : public ScriptedAI
}else Die_Timer -= diff;
}
DoMeleeAttackIfReady();
}

View File

@@ -56,7 +56,7 @@ struct TRINITY_DLL_DECL instance_mechanar : public ScriptedInstance
{
switch(type)
{
case DATA_NETHERMANCER_EVENT: return Encounters[0];
case DATA_NETHERMANCER_EVENT: return Encounters[0];
}
return false;

View File

@@ -239,7 +239,7 @@ struct TRINITY_DLL_DECL boss_yaujAI : public ScriptedAI
{
Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
Creature* Summoned = m_creature->SummonCreature(15621,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,90000);
if(Summoned)
if(Summoned && target)
((CreatureAI*)Summoned->AI())->AttackStart(target);
}
}

View File

@@ -58,6 +58,9 @@ struct TRINITY_DLL_DECL boss_fankrissAI : public ScriptedAI
void SummonSpawn(Unit* victim)
{
if(!victim)
return;
Rand = 10 + (rand()%10);
switch (rand()%2)
{
@@ -135,35 +138,47 @@ struct TRINITY_DLL_DECL boss_fankrissAI : public ScriptedAI
case 0:
DoTeleportPlayer(target, -8106.0142,1289.2900,-74.419533,5.112);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
((CreatureAI*)Hatchling->AI())->AttackStart(target);
if(Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
((CreatureAI*)Hatchling->AI())->AttackStart(target);
if(Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
((CreatureAI*)Hatchling->AI())->AttackStart(target);
if(Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
((CreatureAI*)Hatchling->AI())->AttackStart(target);
if(Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
break;
case 1:
DoTeleportPlayer(target, -7990.135354,1155.1907,-78.849319,2.608);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
((CreatureAI*)Hatchling->AI())->AttackStart(target);
if(Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
((CreatureAI*)Hatchling->AI())->AttackStart(target);
if(Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
((CreatureAI*)Hatchling->AI())->AttackStart(target);
if(Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
((CreatureAI*)Hatchling->AI())->AttackStart(target);
if(Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
break;
case 2:
DoTeleportPlayer(target,-8159.7753,1127.9064,-76.868660,0.675);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
((CreatureAI*)Hatchling->AI())->AttackStart(target);
if(Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
((CreatureAI*)Hatchling->AI())->AttackStart(target);
if(Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
((CreatureAI*)Hatchling->AI())->AttackStart(target);
if(Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
((CreatureAI*)Hatchling->AI())->AttackStart(target);
if(Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
break;
}
}

View File

@@ -103,7 +103,8 @@ struct TRINITY_DLL_DECL boss_ouroAI : public ScriptedAI
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM,0);
DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
if(target)
DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
ChangeTarget_Timer = 10000 + rand()%10000;
}else ChangeTarget_Timer -= diff;

View File

@@ -161,7 +161,6 @@ struct TRINITY_DLL_DECL boss_sarturaAI : public ScriptedAI
}
};
struct TRINITY_DLL_DECL mob_sartura_royal_guardAI : public ScriptedAI
{
mob_sartura_royal_guardAI(Creature *c) : ScriptedAI(c) {}
@@ -187,7 +186,6 @@ struct TRINITY_DLL_DECL mob_sartura_royal_guardAI : public ScriptedAI
WhirlWind = false;
AggroReset = false;
}
void Aggro(Unit *who)

View File

@@ -274,16 +274,20 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI
Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
Image1 = m_creature->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
if(!Image1)
return;
Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5);
Image1->SetHealth(m_creature->GetHealth() / 5);
if (target)
Image1->AI()->AttackStart(target);
Image1->AI()->AttackStart(target);
Image2 = m_creature->SummonCreature(15263,i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
if(!Image2)
return;
Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5);
Image2->SetHealth(m_creature->GetHealth() / 5);
if (target)
Image2->AI()->AttackStart(target);
Image2->AI()->AttackStart(target);
((boss_skeramAI*)Image1->AI())->IsImage = true;
((boss_skeramAI*)Image2->AI())->IsImage = true;

View File

@@ -266,8 +266,11 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI
m_creature->clearUnitState(UNIT_STAT_STUNNED);
Unit *nearu = m_creature->SelectNearestTarget(100);
//DoYell(nearu->GetName(), LANG_UNIVERSAL, 0);
AttackStart(nearu);
m_creature->getThreatManager().addThreat(nearu, 10000);
if(nearu)
{
AttackStart(nearu);
m_creature->getThreatManager().addThreat(nearu, 10000);
}
return true;
}
else
@@ -346,7 +349,7 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI
for(std::list<Creature*>::iterator iter = unitList.begin(); iter != unitList.end(); ++iter)
{
Creature *c = (Creature *)(*iter);
if (c->isDead())
if (c && c->isDead())
{
c->Respawn();
c->setFaction(7);

View File

@@ -120,6 +120,7 @@ struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI
if( UnkorUnfriendly_Timer < diff )
{
EnterEvadeMode();
return;
}else UnkorUnfriendly_Timer -= diff;
}
}

View File

@@ -120,6 +120,8 @@ struct TRINITY_DLL_DECL boss_archaedasAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(!pInstance)
return;
// we're still doing awaken animation
if (wakingUp && Awaken_Timer >= 0) {
Awaken_Timer -= diff;
@@ -180,8 +182,11 @@ struct TRINITY_DLL_DECL boss_archaedasAI : public ScriptedAI
}
void JustDied (Unit *killer) {
pInstance->SetData(NULL,3); // open the vault door
pInstance->SetData(NULL,4); // deactivate his minions
if(pInstance)
{
pInstance->SetData(NULL,3); // open the vault door
pInstance->SetData(NULL,4); // deactivate his minions
}
}
};
@@ -389,7 +394,8 @@ struct TRINITY_DLL_DECL mob_stonekeepersAI : public ScriptedAI
void DamageTaken (Unit *attacker, uint32 &damage) {
if (damage > m_creature->GetHealth()) {
DoCast (m_creature, SPELL_SELF_DESTRUCT,true);
pInstance->SetData(NULL, 1); // activate next stonekeeper
if(pInstance)
pInstance->SetData(NULL, 1); // activate next stonekeeper
}
}

View File

@@ -189,7 +189,10 @@ struct TRINITY_DLL_DECL boss_hexlord_addAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(pInstance && pInstance->GetData(DATA_HEXLORDEVENT) != IN_PROGRESS)
{
EnterEvadeMode();
return;
}
DoMeleeAttackIfReady();
}
@@ -383,7 +386,11 @@ struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI
{
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 70, true);
Unit *trigger = DoSpawnCreature(MOB_TEMP_TRIGGER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
if(!target || !trigger) EnterEvadeMode();
if(!target || !trigger)
{
EnterEvadeMode();
return;
}
else
{
trigger->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);

View File

@@ -397,7 +397,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI
m_creature->AttackStop();
m_creature->GetMotionMaster()->Clear();
DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]);
DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]);
m_creature->StopMoving();
m_creature->CastSpell(m_creature, SPELL_HATCH_ALL, false);
HatchAllEggs(2);

View File

@@ -407,7 +407,8 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI
DoYell(YELL_SURGE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(m_creature, SOUND_YELL_SURGE);
Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1, GetSpellMaxRange(SPELL_SURGE), true);
DoCast(target, SPELL_SURGE);
if(target)
DoCast(target, SPELL_SURGE);
Surge_Timer = 15000 + rand()%5000;
}else Surge_Timer -= diff;
}

View File

@@ -487,7 +487,12 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI
else
Claw_Loop_Timer = 500;
}
}else EnterEvadeMode(); // if(target)
}
else
{
EnterEvadeMode(); // if(target)
return;
}
}else Claw_Loop_Timer -= diff;
} //if(TankGUID)
}else Claw_Rage_Timer -= diff;
@@ -529,7 +534,12 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI
else
AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
}
}else EnterEvadeMode(); // if(target)
}
else
{
EnterEvadeMode(); // if(target)
return;
}
} //if(TankGUID)
}else Lynx_Rush_Timer -= diff;

View File

@@ -125,13 +125,13 @@ struct TRINITY_DLL_DECL boss_arlokkAI : public ScriptedAI
{
DoScriptText(SAY_FEAST_PANTHER, m_creature, markedTarget);
Panther ->AI()->AttackStart(markedTarget);
}else Panther ->AI()->AttackStart(target);
}else if(Panther && target) Panther ->AI()->AttackStart(target);
Panther = m_creature->SummonCreature(15101,-11532.9970,-1606.4840,41.2979,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if(markedTarget && Panther )
Panther ->AI()->AttackStart(markedTarget);
else
else if(Panther && target)
Panther ->AI()->AttackStart(target);
Counter++;
@@ -164,7 +164,8 @@ struct TRINITY_DLL_DECL boss_arlokkAI : public ScriptedAI
m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
m_creature->UpdateDamagePhysical(BASE_ATTACK);
AttackStart(target);
if(target)
AttackStart(target);
//The Panther Model
m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15215);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);

View File

@@ -75,8 +75,12 @@ struct TRINITY_DLL_DECL boss_hazzarahAI : public ScriptedAI
for(int i = 0; i < 3;i++)
{
target = SelectUnit(SELECT_TARGET_RANDOM,0);
if(!target)
return;
Illusion = m_creature->SummonCreature(15163,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000);
((CreatureAI*)Illusion->AI())->AttackStart(target);
if(Illusion)
((CreatureAI*)Illusion->AI())->AttackStart(target);
}
Illusions_Timer = 15000 + rand()%10000;

View File

@@ -184,13 +184,12 @@ struct TRINITY_DLL_DECL boss_jeklikAI : public ScriptedAI
if(SpawnFlyingBats_Timer < diff)
{
Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if(!target)
return;
Creature* FlyingBat = m_creature->SummonCreature(14965, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if(FlyingBat)
{
if(target)
FlyingBat->AI()->AttackStart(target);
}
FlyingBat->AI()->AttackStart(target);
SpawnFlyingBats_Timer = 10000 + rand()%5000;
}else SpawnFlyingBats_Timer -=diff;

View File

@@ -108,10 +108,11 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
{
DoCast(target, SPELL_DELUSIONSOFJINDO);
DoCast(target, SPELL_DELUSIONSOFJINDO);
Shade = m_creature->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Shade->AI()->AttackStart(target);
Shade = m_creature->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if(Shade)
Shade->AI()->AttackStart(target);
}
Delusions_Timer = 4000 + rand()%8000;
@@ -130,23 +131,32 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI
DoModifyThreatPercent(target,-100);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
if(Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
if(Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
if(Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
if(Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
if(Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
if(Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
if(Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
if(Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+3, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
if(Skeletons)
Skeletons->AI()->AttackStart(target);
}
Teleport_Timer = 15000 + rand()%8000;
@@ -185,7 +195,8 @@ struct TRINITY_DLL_DECL mob_healing_wardAI : public ScriptedAI
if(pInstance)
{
Unit *pJindo = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JINDO));
DoCast(pJindo, SPELL_HEAL);
if(pJindo)
DoCast(pJindo, SPELL_HEAL);
}
Heal_Timer = 3000;
}else Heal_Timer -= diff;

View File

@@ -112,15 +112,21 @@ struct TRINITY_DLL_DECL boss_marliAI : public ScriptedAI
DoScriptText(SAY_SPIDER_SPAWN, m_creature);
Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
if(!target)
return;
Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if(target && Spider ) Spider ->AI()->AttackStart(target);
if(Spider)
Spider->AI()->AttackStart(target);
Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if(target && Spider ) Spider ->AI()->AttackStart(target);
if(Spider)
Spider->AI()->AttackStart(target);
Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if(target && Spider ) Spider ->AI()->AttackStart(target);
if(Spider)
Spider->AI()->AttackStart(target);
Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if(target && Spider ) Spider ->AI()->AttackStart(target);
if(Spider)
Spider->AI()->AttackStart(target);
Spawned = true;
}else SpawnStartSpiders_Timer -= diff;
@@ -128,10 +134,12 @@ struct TRINITY_DLL_DECL boss_marliAI : public ScriptedAI
if (SpawnSpider_Timer < diff)
{
Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
if(!target)
return;
Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (target && Spider )
Spider ->AI()->AttackStart(target);
if(Spider)
Spider->AI()->AttackStart(target);
SpawnSpider_Timer = 12000 + rand()%5000;
}else SpawnSpider_Timer -= diff;

View File

@@ -118,20 +118,26 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI
{
//Resurrect LorKhan
Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN));
pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pLorKhan->setFaction(14);
pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0));
if(pLorKhan)
{
pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pLorKhan->setFaction(14);
pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0));
}
}
if(pInstance->GetData(DATA_ZATHISDEAD))
{
//Resurrect Zath
Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH));
pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pZath->setFaction(14);
pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pZath->SetHealth(int(pZath->GetMaxHealth()*1.0));
if(pZath)
{
pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pZath->setFaction(14);
pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pZath->SetHealth(int(pZath->GetMaxHealth()*1.0));
}
}
}
@@ -192,9 +198,9 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
{
DoCast(target,SPELL_CHARGE);
DoResetThreat();
AttackStart(target);
DoCast(target,SPELL_CHARGE);
DoResetThreat();
AttackStart(target);
}
Charge_Timer = 15000 + rand()%7000;
@@ -296,6 +302,9 @@ struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI
Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL));
Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH));
if(!pThekal || !pZath)
return;
switch(rand()%2)
{
case 0:
@@ -328,20 +337,26 @@ struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI
{
//Resurrect Thekal
Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL));
pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pThekal->setFaction(14);
pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0));
if(pThekal)
{
pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pThekal->setFaction(14);
pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0));
}
}
if(pInstance->GetData(DATA_ZATHISDEAD))
{
//Resurrect Zath
Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH));
pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pZath->setFaction(14);
pZath->SetHealth(int(pZath->GetMaxHealth()*1.0));
if(pZath)
{
pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pZath->setFaction(14);
pZath->SetHealth(int(pZath->GetMaxHealth()*1.0));
}
}
}
@@ -459,20 +474,26 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI
{
//Resurrect LorKhan
Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN));
pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pLorKhan->setFaction(14);
pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0));
if(pLorKhan)
{
pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pLorKhan->setFaction(14);
pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0));
}
}
if(pInstance->GetData(DATA_THEKALISFAKEDEAD))
{
//Resurrect Thekal
Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL));
pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pThekal->setFaction(14);
pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0));
if(pThekal)
{
pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pThekal->setFaction(14);
pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0));
}
}
}

View File

@@ -134,7 +134,7 @@ struct TRINITY_DLL_DECL boss_venoxisAI : public ScriptedAI
if (HolyFire_Timer < diff && TargetInRange < 3)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target, SPELL_HOLY_FIRE);
DoCast(target, SPELL_HOLY_FIRE);
HolyFire_Timer = 8000;
}else HolyFire_Timer -= diff;
@@ -164,7 +164,7 @@ struct TRINITY_DLL_DECL boss_venoxisAI : public ScriptedAI
if (PhaseTwo && VenomSpit_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target, SPELL_VENOMSPIT);
DoCast(target, SPELL_VENOMSPIT);
VenomSpit_Timer = 15000 + rand()%5000;
}else VenomSpit_Timer -= diff;