diff options
50 files changed, 437 insertions, 364 deletions
diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index dadb2d76985..96e672f376b 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -67,19 +67,19 @@ SET(trinityscript_LIB_SRCS scripts/zone/black_temple/def_black_temple.h scripts/zone/black_temple/illidari_council.cpp scripts/zone/black_temple/instance_black_temple.cpp - scripts/zone/blackrock_depths/blackrock_depths.cpp - scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp - scripts/zone/blackrock_depths/boss_anubshiah.cpp - scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp - scripts/zone/blackrock_depths/boss_general_angerforge.cpp + scripts/zone/blackrock_depths/blackrock_depths.cpp + scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp + scripts/zone/blackrock_depths/boss_anubshiah.cpp + scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp + scripts/zone/blackrock_depths/boss_general_angerforge.cpp scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp - scripts/zone/blackrock_depths/boss_grizzle.cpp - scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp - scripts/zone/blackrock_depths/boss_magmus.cpp - scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp - scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp - scripts/zone/blackrock_depths/def_blackrock_depths.h - scripts/zone/blackrock_depths/instance_blackrock_depths.cpp + scripts/zone/blackrock_depths/boss_grizzle.cpp + scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp + scripts/zone/blackrock_depths/boss_magmus.cpp + scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp + scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp + scripts/zone/blackrock_depths/def_blackrock_depths.h + scripts/zone/blackrock_depths/instance_blackrock_depths.cpp scripts/zone/blackrock_spire/boss_drakkisath.cpp scripts/zone/blackrock_spire/boss_gyth.cpp scripts/zone/blackrock_spire/boss_halycon.cpp @@ -242,7 +242,7 @@ SET(trinityscript_LIB_SRCS scripts/zone/onyxias_lair/boss_onyxia.cpp scripts/zone/orgrimmar/orgrimmar.cpp scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp - scripts/zone/razorfen_kraul/razorfen_kraul.cpp + scripts/zone/razorfen_kraul/razorfen_kraul.cpp scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp diff --git a/src/bindings/scripts/scripts/boss/boss_taerar.cpp b/src/bindings/scripts/scripts/boss/boss_taerar.cpp index 57184aa4b98..7e7a2bd1363 100644 --- a/src/bindings/scripts/scripts/boss/boss_taerar.cpp +++ b/src/bindings/scripts/scripts/boss/boss_taerar.cpp @@ -79,6 +79,9 @@ struct TRINITY_DLL_DECL boss_taerarAI : public ScriptedAI void SummonShades(Unit* victim) { + if(!victim) + return; + Rand = rand()%15; switch (rand()%2) { diff --git a/src/bindings/scripts/scripts/boss/boss_ysondre.cpp b/src/bindings/scripts/scripts/boss/boss_ysondre.cpp index fca9bc4b15b..8738ce3eb88 100644 --- a/src/bindings/scripts/scripts/boss/boss_ysondre.cpp +++ b/src/bindings/scripts/scripts/boss/boss_ysondre.cpp @@ -69,6 +69,9 @@ struct TRINITY_DLL_DECL boss_ysondreAI : public ScriptedAI void SummonDruids(Unit* victim) { + if(!victim) + return; + Rand = rand()%10; switch (rand()%2) { diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp index 5ae059f0a30..d43b863300d 100644 --- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp +++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp @@ -1426,7 +1426,7 @@ CreatureAI* GetAI_Mob_EventAI(Creature *pCreature) } } else - { + { if (EAI_ErrorLevel > 1) error_db_log("TSCR: EventMap for Creature %u is empty but creature is using Mob_EventAI.", pCreature->GetEntry()); } diff --git a/src/bindings/scripts/scripts/custom/test.cpp b/src/bindings/scripts/scripts/custom/test.cpp index 9d847223940..ff3de65f599 100644 --- a/src/bindings/scripts/scripts/custom/test.cpp +++ b/src/bindings/scripts/scripts/custom/test.cpp @@ -47,8 +47,8 @@ struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI { m_creature->Say("Wild Felboar attack!", LANG_UNIVERSAL, 0); Creature* temp = m_creature->SummonCreature(21878, m_creature->GetPositionX()+5, m_creature->GetPositionY()+7, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000); - - temp->AI()->AttackStart(m_creature); + if(temp) + temp->AI()->AttackStart(m_creature); } break; diff --git a/src/bindings/scripts/scripts/go/go_scripts.cpp b/src/bindings/scripts/scripts/go/go_scripts.cpp index cc64074b6bc..0dc6427cc5e 100644 --- a/src/bindings/scripts/scripts/go/go_scripts.cpp +++ b/src/bindings/scripts/scripts/go/go_scripts.cpp @@ -173,7 +173,7 @@ bool GOHello_go_jump_a_tron(Player *player, GameObject* _GO) /*###### ## go_ethereum_prison ######*/ - + float ethereum_NPC[2][7] = { {20785,20790,20789,20784,20786,20783,20788}, // hostile npc @@ -184,7 +184,7 @@ bool GOHello_go_ethereum_prison(Player *player, GameObject* _GO) { _GO->SetGoState(0); switch(rand()%2){ - case 0: + case 0: _GO->SummonCreature(ethereum_NPC[0][rand()%6],_GO->GetPositionX(),_GO->GetPositionY(),_GO->GetPositionZ()+0.3, 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); break; case 1: diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp index 252ca107031..c5269eb0973 100644 --- a/src/bindings/scripts/scripts/npc/npcs_special.cpp +++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp @@ -69,8 +69,10 @@ struct TRINITY_DLL_DECL npc_chicken_cluckAI : public ScriptedAI if(m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER)) { if(ResetFlagTimer < diff) + { EnterEvadeMode(); - else ResetFlagTimer -= diff; + return; + }else ResetFlagTimer -= diff; } if(UpdateVictim()) diff --git a/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp b/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp index 72dda8dd835..c095666fb97 100644 --- a/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp +++ b/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp @@ -46,6 +46,7 @@ struct TRINITY_DLL_DECL npc_ravenholdtAI : public ScriptedAI void Aggro(Unit* who) { } }; + CreatureAI* GetAI_npc_ravenholdt(Creature *_Creature) { return new npc_ravenholdtAI (_Creature); diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp index 325b5aeb8dd..72d9030bca6 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp @@ -261,7 +261,10 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI }else Apprentice_Timer -= diff; if( CanEvade ) + { EnterEvadeMode(); + return; + } DoMeleeAttackIfReady(); } diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp index e1d1e98206e..ebf2dd46a44 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp @@ -154,7 +154,8 @@ struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI { //second top aggro target in normal, random target in heroic correct? Unit *target = NULL; - if (HeroicMode ? target = SelectUnit(SELECT_TARGET_RANDOM,0) : target = SelectUnit(SELECT_TARGET_TOPAGGRO,1)) + target = HeroicMode ? SelectUnit(SELECT_TARGET_RANDOM,0) : SelectUnit(SELECT_TARGET_TOPAGGRO,1); + if (target) DoCast(target,HeroicMode ? H_SPELL_POLYMORPH : SPELL_POLYMORPH); Sheep_Timer = 15000+rand()%2500; }else Sheep_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp index 1154f71cb64..8aac9412a79 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp @@ -77,7 +77,6 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI IsBanished = true; } else pInstance->SetData(TYPE_HELLMAW,FAIL); - if (pInstance->GetData(TYPE_OVERSEER) == DONE) { if (m_creature->HasAura(SPELL_BANISH,0)) @@ -148,7 +147,7 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI { if (EventCheck_Timer < diff) { - if (pInstance) + if(pInstance) { if (pInstance->GetData(TYPE_OVERSEER) == DONE) DoIntro(); diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp index 32aa9c3e844..2a070f2fc84 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp @@ -156,6 +156,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI banish_Timer = 17000; HelpYell = false; destroyPortals(); + if(pInstance) pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED); } @@ -168,8 +169,11 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI { Creature *Portal = NULL; Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000); - PortalsGuid[i] = Portal->GetGUID(); - Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); + if(Portal) + { + PortalsGuid[i] = Portal->GetGUID(); + Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); + } } sumportals = true; summonTraveler_Timer = 5000; @@ -221,6 +225,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI { DoScriptText(SAY_DEATH, m_creature); destroyPortals(); + if(pInstance) pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); } @@ -234,6 +239,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI case 2: DoScriptText(SAY_AGGRO3, m_creature); break; } summonPortals(); + if(pInstance) pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS); } @@ -251,7 +257,6 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if (!UpdateVictim()) return; diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp index aae194de9b8..0ac15f31f40 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp @@ -88,7 +88,7 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI } if (SonicBoom_Timer < diff) { - DoScriptText(EMOTE_SONIC_BOOM, m_creature); + DoScriptText(EMOTE_SONIC_BOOM, m_creature); DoCast(m_creature, SPELL_SONIC_BOOM_CAST); SonicBoom_Timer = 30000; SonicBoom = true; diff --git a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp index a94d3e003b7..b92017bf394 100644 --- a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp +++ b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp @@ -71,6 +71,7 @@ struct TRINITY_DLL_DECL mobs_spitelashesAI : public ScriptedAI m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); m_creature->RemoveCorpse(); //you don't see any corpse on off. EnterEvadeMode(); //spellhit will be set to false + return; } // walk 5 seconds before summoning if( spellhit && morphtimer<5000 ) diff --git a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp index d87cf571baf..8af01b16c14 100644 --- a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp +++ b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp @@ -162,7 +162,7 @@ struct TRINITY_DLL_DECL npc_draenei_survivorAI : public ScriptedAI EnterEvadeMode(); //set creature health m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1)); - + return; }else UnSpawnTimer -= diff; } @@ -512,11 +512,14 @@ struct TRINITY_DLL_DECL npc_geezleAI : public ScriptedAI Step = 1; EventStarted = true; Creature* Spark = m_creature->SummonCreature(MOB_SPARK, SparkPos[0], SparkPos[1], SparkPos[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000); - SparkGUID = Spark->GetGUID(); - Spark->setActive(true); - Spark->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + if(Spark) + { + SparkGUID = Spark->GetGUID(); + Spark->setActive(true); + Spark->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + Spark->GetMotionMaster()->MovePoint(0, -5080.70, -11253.61, 0.56); + } m_creature->GetMotionMaster()->MovePoint(0, -5092.26, -11252, 0.71); - Spark->GetMotionMaster()->MovePoint(0, -5080.70, -11253.61, 0.56); SayTimer = 23000; } @@ -533,8 +536,11 @@ struct TRINITY_DLL_DECL npc_geezleAI : public ScriptedAI return 1000; case 2: DoScriptText(GEEZLE_SAY_1, m_creature, Spark); - Spark->SetInFront(m_creature); - m_creature->SetInFront(Spark); + if(Spark) + { + Spark->SetInFront(m_creature); + m_creature->SetInFront(Spark); + } return 5000; case 3: DoScriptText(SPARK_SAY_2, Spark); return 7000; case 4: DoScriptText(SPARK_SAY_3, Spark); return 8000; @@ -544,10 +550,12 @@ struct TRINITY_DLL_DECL npc_geezleAI : public ScriptedAI case 8: DoScriptText(GEEZLE_SAY_7, m_creature, Spark); return 2000; case 9: m_creature->GetMotionMaster()->MoveTargetedHome(); - Spark->GetMotionMaster()->MovePoint(0, -5030.95, -11291.99, 7.97); + if(Spark) + Spark->GetMotionMaster()->MovePoint(0, -5030.95, -11291.99, 7.97); return 20000; case 10: - Spark->DealDamage(Spark,Spark->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + if(Spark) + Spark->DealDamage(Spark,Spark->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); //DespawnNagaFlag(false); m_creature->SetVisibility(VISIBILITY_OFF); default: return 99999999; diff --git a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp index 37d0ee089f5..23b2676314a 100644 --- a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp +++ b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp @@ -145,6 +145,7 @@ struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI if( Reset_Timer < diff ) { EnterEvadeMode(); + return; } else Reset_Timer -= diff; } diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp index 4b0190c1dd5..bd0cb3e2e23 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp @@ -1067,7 +1067,8 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI void BeginTalk() { - pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, IN_PROGRESS); + if(pInstance) + pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, IN_PROGRESS); for(uint8 i = 0; i < 2; i++) if(GETGO(Door, DoorGUID[i])) @@ -1670,7 +1671,8 @@ bool GOHello_cage_trap(Player* plr, GameObject* go) CellLock<GridReadGuard> cell_lock(cell, pair); cell_lock->Visit(cell_lock, cSearcher, *(plr->GetMap())); - ((cage_trap_triggerAI*)trigger->AI())->Active = true; + if(trigger) + ((cage_trap_triggerAI*)trigger->AI())->Active = true; go->SetUInt32Value(GAMEOBJECT_STATE, 0); return true; } diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp index fb4d97780ed..35bff456074 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp @@ -398,7 +398,8 @@ struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI targets.sort(TargetDistanceOrder(m_creature)); // Sort players by distance. targets.resize(1); // Only need closest target. Unit* target = targets.front(); // Get the first target. - target->CastSpell(m_creature, SPELL_FIXATE_TAUNT, true); + if(target) + target->CastSpell(m_creature, SPELL_FIXATE_TAUNT, true); DoResetThreat(); m_creature->AddThreat(target,1000000); } diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp index 8dc8ca344dd..5d82affcacf 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp @@ -466,7 +466,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI if(HasKilledAkama) { if(!HasKilledAkamaAndReseting)//do not let players kill Shade if Akama is dead and Shade is waiting for ResetTimer!! event would bug - { + { HasKilledAkamaAndReseting = true; m_creature->RemoveAllAuras(); m_creature->DeleteThreatList(); @@ -476,8 +476,10 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI m_creature->GetMotionMaster()->MoveTargetedHome(); } if(ResetTimer < diff) + { EnterEvadeMode();// Reset a little while after killing Akama, evade and respawn Akama - else ResetTimer -= diff; + return; + }else ResetTimer -= diff; } DoMeleeAttackIfReady(); @@ -517,7 +519,7 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI EndingTalkCount = 0; WayPointId = 0; BrokenSummonIndex = 0; - BrokenList.clear(); + BrokenList.clear(); HasYelledOnce = false; } @@ -547,7 +549,7 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI DestructivePoisonTimer = 15000; LightningBoltTimer = 10000; CheckTimer = 2000; - + if(!EventBegun) { m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values @@ -617,7 +619,7 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI EndingTalkCount = 0; WayPointId = 0; BrokenSummonIndex = 0; - BrokenList.clear(); + BrokenList.clear(); HasYelledOnce = false; Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); if(Shade && Shade->isAlive()) diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp index 994f3d500ad..44fbeaadad1 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp @@ -195,9 +195,6 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI { if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true)) { - if(!target) - target = m_creature->getVictim(); - DoCast(target, SPELL_VOLCANIC_SUMMON); DoScriptText(EMOTE_GROUND_CRACK, m_creature); SummonVolcanoTimer = 10000; @@ -269,14 +266,15 @@ struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI { uint64 SupremusGUID = pInstance->GetData64(DATA_SUPREMUS); Creature* Supremus = (Unit::GetCreature((*m_creature), SupremusGUID)); - if(!Eruption && !((boss_supremusAI*)Supremus->AI())->Phase1) + if(!Eruption && Supremus && !((boss_supremusAI*)Supremus->AI())->Phase1) { Eruption = true; DoCast(m_creature, SPELL_VOLCANIC_ERUPTION); } - else if(Eruption && ((boss_supremusAI*)Supremus->AI())->Phase1) + else if((Eruption && Supremus && ((boss_supremusAI*)Supremus->AI())->Phase1) || !Supremus) { - m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION, 0); + if(m_creature->HasAura(SPELL_VOLCANIC_ERUPTION, 0)) + m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION, 0); } CheckTimer = 1500; }else CheckTimer -= diff; diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp index a1800a4a951..492860fd4f4 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp @@ -90,7 +90,7 @@ struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI Despawn(); CheckTeronTimer = 5000; - }else CheckTeronTimer -= diff; + }else CheckTeronTimer -= diff; if(ShadowBoltTimer < diff && InCombat) { @@ -382,8 +382,12 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI AttackStart(pUnit); DoZoneInCombat(); - }else EnterEvadeMode(); - + } + else + { + EnterEvadeMode(); + return; + } }else AggroTimer -= diff; } diff --git a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp index bbf1c600f59..266c84bd09e 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp @@ -372,6 +372,7 @@ struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI { error_log(ERROR_INST_DATA); EnterEvadeMode(); + return; } DoZoneInCombat(); // Load GUIDs on first aggro because the creature guids are only set as the creatures are created in world- diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp index cae3a17ff02..3b51b941d1f 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp @@ -41,7 +41,7 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI boss_anetheronAI(Creature *c) : hyjal_trashAI(c) { pInstance = ((ScriptedInstance*)c->GetInstanceData()); - go = false; + go = false; pos = 0; SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SLEEP); if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) @@ -71,7 +71,7 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI } void Aggro(Unit *who) - { + { if(pInstance && IsEvent) pInstance->SetData(DATA_ANETHERONEVENT, IN_PROGRESS); DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); @@ -89,12 +89,12 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI case 1: DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); DoYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); - break; + break; case 2: DoPlaySoundToSet(m_creature, SOUND_ONSLAY3); DoYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL); - break; - } + break; + } } void WaypointReached(uint32 i) @@ -105,7 +105,7 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) m_creature->AddThreat(target,0.0); - } + } } void JustDied(Unit *victim) @@ -138,7 +138,7 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(7, 5067.23, -1789.95, 1321.17); ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); - } + } } } @@ -162,8 +162,8 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI case 1: DoPlaySoundToSet(m_creature, SOUND_SWARM2); DoYell(SAY_SWARM2, LANG_UNIVERSAL, NULL); - break; - } + break; + } }else SwarmTimer -= diff; if(SleepTimer < diff) @@ -184,13 +184,13 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI case 1: DoPlaySoundToSet(m_creature, SOUND_SLEEP2); DoYell(SAY_SLEEP2, LANG_UNIVERSAL, NULL); - break; - } - }else SleepTimer -= diff; + break; + } + }else SleepTimer -= diff; if(AuraTimer < diff) { DoCast(m_creature, SPELL_VAMPIRIC_AURA,true); - AuraTimer = 10000+rand()%10000; + AuraTimer = 10000+rand()%10000; }else AuraTimer -= diff; if(InfernoTimer < diff) { @@ -205,8 +205,8 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI case 1: DoPlaySoundToSet(m_creature, SOUND_INFERNO2); DoYell(SAY_INFERNO2, LANG_UNIVERSAL, NULL); - break; - } + break; + } }else InfernoTimer -= diff; DoMeleeAttackIfReady(); @@ -243,18 +243,18 @@ struct TRINITY_DLL_DECL mob_towering_infernalAI : public ScriptedAI } void Aggro(Unit *who) - { - + { + } void KilledUnit(Unit *victim) { - + } void JustDied(Unit *victim) { - + } void MoveInLineOfSight(Unit *who) @@ -289,7 +289,7 @@ struct TRINITY_DLL_DECL mob_towering_infernalAI : public ScriptedAI if(ImmolationTimer < diff) { - DoCast(m_creature, SPELL_IMMOLATION); + DoCast(m_creature, SPELL_IMMOLATION); ImmolationTimer = 5000; }else ImmolationTimer -= diff; @@ -313,5 +313,5 @@ void AddSC_boss_anetheron() newscript = new Script; newscript->Name="mob_towering_infernal"; newscript->GetAI = &GetAI_mob_towering_infernal; - newscript->RegisterSelf(); + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp index 9bdee9887e5..c8d9c403a29 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp @@ -32,7 +32,7 @@ struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI boss_azgalorAI(Creature *c) : hyjal_trashAI(c) { pInstance = ((ScriptedInstance*)c->GetInstanceData()); - go = false; + go = false; pos = 0; SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_HOWL_OF_AZGALOR); if(TempSpell) @@ -64,7 +64,7 @@ struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI } void Aggro(Unit *who) - { + { if(pInstance && IsEvent) pInstance->SetData(DATA_AZGALOREVENT, IN_PROGRESS); DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); @@ -82,12 +82,12 @@ struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI case 1: DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); DoYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); - break; + break; case 2: DoPlaySoundToSet(m_creature, SOUND_ONSLAY3); DoYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL); - break; - } + break; + } } void WaypointReached(uint32 i) @@ -98,7 +98,7 @@ struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); if (target && target->isAlive()) m_creature->AddThreat(target,0.0); - } + } } void JustDied(Unit *victim) @@ -130,7 +130,7 @@ struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(7, 5457.04, -2726.26, 1485.10); ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); - } + } } } @@ -159,7 +159,7 @@ struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI if(CleaveTimer < diff) { DoCast(m_creature->getVictim(), SPELL_CLEAVE); - CleaveTimer = 10000+rand()%5000; + CleaveTimer = 10000+rand()%5000; }else CleaveTimer -= diff; if(EnrageTimer < diff && !enraged) @@ -207,17 +207,17 @@ struct TRINITY_DLL_DECL mob_lesser_doomguardAI : public hyjal_trashAI } void Aggro(Unit *who) - { + { } void KilledUnit(Unit *victim) { - + } void WaypointReached(uint32 i) { - + } void MoveInLineOfSight(Unit *who) @@ -231,7 +231,7 @@ struct TRINITY_DLL_DECL mob_lesser_doomguardAI : public hyjal_trashAI void JustDied(Unit *victim) { - + } void UpdateAI(const uint32 diff) @@ -265,7 +265,7 @@ struct TRINITY_DLL_DECL mob_lesser_doomguardAI : public hyjal_trashAI { DoCast(SelectUnit(SELECT_TARGET_RANDOM,0,100,true), SPELL_CRIPPLE); CrippleTimer = 25000+rand()%5000; - }else CrippleTimer -= diff; + }else CrippleTimer -= diff; DoMeleeAttackIfReady(); } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp index 33c6ec44cf9..2d8eb508ce4 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp @@ -29,7 +29,7 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI boss_kazrogalAI(Creature *c) : hyjal_trashAI(c) { pInstance = ((ScriptedInstance*)c->GetInstanceData()); - go = false; + go = false; pos = 0; SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_MARK); if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) @@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI } void Aggro(Unit *who) - { + { if(pInstance && IsEvent) pInstance->SetData(DATA_KAZROGALEVENT, IN_PROGRESS); DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); @@ -77,12 +77,12 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI case 1: DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); DoYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); - break; + break; case 2: DoPlaySoundToSet(m_creature, SOUND_ONSLAY3); DoYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL); - break; - } + break; + } } void WaypointReached(uint32 i) @@ -93,7 +93,7 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); if (target && target->isAlive()) m_creature->AddThreat(target,0.0); - } + } } void JustDied(Unit *victim) @@ -125,7 +125,7 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(7, 5457.04, -2726.26, 1485.10); ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); - } + } } } @@ -136,7 +136,7 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI if(CleaveTimer < diff) { DoCast(m_creature, SPELL_CLEAVE); - CleaveTimer = 6000+rand()%15000; + CleaveTimer = 6000+rand()%15000; }else CleaveTimer -= diff; if(WarStompTimer < diff) @@ -150,8 +150,8 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI if(MarkTimer < diff) { //cast dummy, useful for bos addons - m_creature->CastCustomSpell(m_creature, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); - + m_creature->CastCustomSpell(m_creature, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); + std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList(); for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) { @@ -160,11 +160,11 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI { target->CastSpell(target, SPELL_MARK,true);//only cast on mana users } - } + } MarkTimerBase -= 5000; if(MarkTimerBase < 5500) MarkTimerBase = 5500; - MarkTimer = MarkTimerBase; + MarkTimer = MarkTimerBase; switch(rand()%3) { case 0: @@ -174,7 +174,7 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI case 1: DoPlaySoundToSet(m_creature, SOUND_MARK2); DoYell(SAY_MARK2, LANG_UNIVERSAL, NULL); - break; + break; } }else MarkTimer -= diff; diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp index ddf5e0ad715..809aa9c7690 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp @@ -35,7 +35,7 @@ struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI boss_rage_winterchillAI(Creature *c) : hyjal_trashAI(c) { pInstance = ((ScriptedInstance*)c->GetInstanceData()); - go = false; + go = false; pos = 0; } @@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI } void Aggro(Unit *who) - { + { if(pInstance && IsEvent) pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, IN_PROGRESS); DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); @@ -77,8 +77,8 @@ struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI case 1: DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); DoYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); - break; - } + break; + } } void WaypointReached(uint32 i) @@ -89,7 +89,7 @@ struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) m_creature->AddThreat(target,0.0); - } + } } void JustDied(Unit *victim) @@ -122,7 +122,7 @@ struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI ((npc_escortAI*)(m_creature->AI()))->AddWaypoint(7, 5067.23, -1789.95, 1321.17); ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); - } + } } } @@ -148,8 +148,8 @@ struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI case 1: DoPlaySoundToSet(m_creature, SOUND_DECAY2); DoYell(SAY_DECAY2, LANG_UNIVERSAL, NULL); - break; - } + break; + } }else DecayTimer -= diff; if(NovaTimer < diff) { @@ -164,7 +164,7 @@ struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI case 1: DoPlaySoundToSet(m_creature, SOUND_NOVA2); DoYell(SAY_NOVA2, LANG_UNIVERSAL, NULL); - break; + break; } }else NovaTimer -= diff; if(IceboltTimer < diff) diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp index ad8206dce3e..386a7ec8216 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp @@ -202,7 +202,7 @@ bool GossipHello_npc_tyrande_whisperwind(Player* player, Creature* _Creature) bool GossipSelect_npc_tyrande_whisperwind(Player *player, Creature *_Creature, uint32 sender, uint32 action) { - if (action == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { ItemPosCountVec dest; uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1); diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp index 1c561140bec..6003e927d5c 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp @@ -34,7 +34,7 @@ EndScriptData */ #define SPAWN_NEAR_TOWER 2 // Locations for summoning gargoyls and frost wyrms in special cases float SpawnPointSpecial[3][3]= -{ +{ {5497.08, -2493.23, 1535.72}, //spawn point for the gargoyles near the horde gate {5624.53, -2548.12, 1551.54}, //spawn point for the frost wyrm near the horde gate {5604.41, -2811.98, 1547.77} //spawn point for the gargoyles and wyrms near the horde tower @@ -57,7 +57,7 @@ float JainaDummySpawn[2][4]= // Locations for summoning waves in Horde base -float HordeBase[4][3]= +float HordeBase[4][3]= { {5458.01, -2340.27, 1459.60}, {5466.01, -2334.69, 1460.06}, @@ -66,7 +66,7 @@ float HordeBase[4][3]= }; // Lady Jaina's waypoints when retreathing -float JainaWPs[2][3]= +float JainaWPs[2][3]= { {5078.56, -1789.79, 1320.73},//next to the small stairs {5037.38, -1778.39, 1322.61},//center of alliance base @@ -239,70 +239,70 @@ float AllianceFirePos[92][8]=//spawn points for the fire visuals (GO) in the all float HordeFirePos[65][8]=//spawn points for the fire visuals (GO) in the horde base { - {5524.11, -2612.73, 1483.38, 1.96198, 0, 0, 0.831047, 0.556202}, - {5514.42, -2617.19, 1505.77, 1.82453, 0, 0, 0.790892, 0.611956}, - {5510.21, -2624.77, 1485.34, 1.71065, 0, 0, 0.754783, 0.655974}, - {5570.72, -2619.04, 1487.62, 0.728898, 0, 0, 0.356435, 0.93432}, - {5570.29, -2639.37, 1487.31, 1.49308, 0, 0, 0.679104, 0.734042}, - {5583.56, -2637.2, 1503.78, 1.46559, 0, 0, 0.668951, 0.743307}, - {5571.53, -2626.81, 1510.99, 0.362107, 0, 0, 0.180066, 0.983654}, - {5545.97, -2659.62, 1489.64, 5.07055, 0, 0, 0.569845, -0.821752}, - {5557.44, -2675.91, 1482.58, 1.70118, 0, 0, 0.751671, 0.659539}, - {5594.98, -2742.31, 1495.51, 4.5993, 0, 0, 0.74594, -0.666013}, - {5599.65, -2755.6, 1505.05, 1.66896, 0, 0, 0.740947, 0.671564}, - {5565.95, -2774.75, 1499.48, 6.22425, 0, 0, 0.0294611, -0.999566}, - {5567.1, -2769.7, 1511.17, 5.99257, 0, 0, 0.144799, -0.989461}, - {5572.84, -2774.16, 1527.06, 0.836428, 0, 0, 0.406129, 0.913816}, - {5538.32, -2805.94, 1498.87, 4.30082, 0, 0, 0.836674, -0.547701}, - {5515.66, -2801.74, 1503.53, 5.57316, 0, 0, 0.347602, -0.937642}, - {5516.76, -2827.14, 1501.15, 0.35026, 0, 0, 0.174236, 0.984704}, - {5536.13, -2813.51, 1537.21, 4.51681, 0, 0, 0.772765, -0.634692}, - {5525.05, -2825.16, 1538.53, 0.489275, 0, 0, 0.242205, 0.970225}, - {5534.42, -2815.45, 1562.84, 4.62834, 0, 0, 0.736191, -0.676774}, - {5519.64, -2831.12, 1526.46, 0.611008, 0, 0, 0.300774, 0.953696}, - {5551.04, -2827.55, 1523.5, 3.35206, 0, 0, 0.994468, -0.10504}, - {5469.22, -2802.87, 1503.5, 4.99509, 0, 0, 0.600436, -0.799673}, - {5427.8, -2737.26, 1487.12, 1.78673, 0, 0, 0.779186, 0.626793}, - {5454.1, -2709.1, 1485.92, 3.03552, 0, 0, 0.998594, 0.0530137}, - {5436.3, -2718.2, 1506.02, 2.7567, 0, 0, 0.981539, 0.191261}, - {5412.6, -2740.55, 1510.79, 2.98446, 0, 0, 0.996915, 0.0784832}, - {5406.12, -2752.48, 1521.01, 2.05769, 0, 0, 0.856705, 0.515807}, - {5445.24, -2676.35, 1521.89, 2.91378, 0, 0, 0.99352, 0.113661}, - {5481.4, -2665.08, 1482.23, 4.30001, 0, 0, 0.836895, -0.547363}, - {5443.51, -2675.44, 1487.12, 2.90986, 0, 0, 0.993295, 0.115606}, - {5391.72, -2647.3, 1528.9, 3.76987, 0, 0, 0.951063, -0.308997}, - {5421.09, -2734.12, 1521.01, 2.70567, 0, 0, 0.97634, 0.216242}, - {5405.39, -2710.33, 1533.77, 2.51324, 0, 0, 0.951052, 0.309032}, - {5423.96, -2703.76, 1516.34, 2.79206, 0, 0, 0.984767, 0.173879}, - {5444.75, -2735.23, 1486.37, 2.22657, 0, 0, 0.897155, 0.441715}, - {5570.98, -2747.91, 1495.7, 5.14433, 0, 0, 0.53915, -0.84221}, - {5567.79, -2673.9, 1484.66, 2.72529, 0, 0, 0.978415, 0.20665}, - {5600.71, -2696.8, 1500.42, 0.443704, 0, 0, 0.220036, 0.975492}, - {5600.7, -2693.04, 1515.2, 5.16003, 0, 0, 0.532522, -0.846416}, - {5627.56, -2839.66, 1510.53, 5.41527, 0, 0, 0.420463, -0.907309}, - {5622.02, -2868.71, 1516.22, 2.25482, 0, 0, 0.903303, 0.429002}, - {5586.61, -2878.97, 1510.34, 4.55604, 0, 0, 0.76017, -0.649724}, - {5583.78, -2843.71, 1509.54, 5.35715, 0, 0, 0.44665, -0.894709}, - {5580.95, -2811.3, 1513.3, 3.57587, 0, 0, 0.976518, -0.215434}, - {5542.52, -2869.31, 1523.13, 5.23304, 0, 0, 0.501275, -0.865288}, - {5557.35, -2866.36, 1518.76, 4.48299, 0, 0, 0.783388, -0.621533}, - {5380.91, -2849.36, 1512.81, 3.90962, 0, 0, 0.927168, -0.374646}, - {5395.76, -2881.41, 1521.11, 4.28426, 0, 0, 0.84118, -0.540755}, - {5374.87, -2859.63, 1528.98, 3.30252, 0, 0, 0.996765, -0.0803745}, - {5356.07, -2854.66, 1520.34, 5.83933, 0, 0, 0.220108, -0.975475}, - {5363.01, -2975.72, 1539.02, 4.13738, 0, 0, 0.87859, -0.477576}, - {5336.85, -2980.74, 1561.24, 5.11126, 0, 0, 0.553001, -0.83318}, - {5335.23, -2974.62, 1540.05, 5.04451, 0, 0, 0.580496, -0.814263}, - {5422.37, -2998.87, 1549.98, 4.51831, 0, 0, 0.772288, -0.635272}, - {5405.54, -3014.6, 1562.16, 5.86761, 0, 0, 0.206298, -0.978489}, - {5427.96, -3019.4, 1561.58, 3.53498, 0, 0, 0.980718, -0.19543}, - {5348.12, -2977.84, 1582.47, 3.94025, 0, 0, 0.921323, -0.388799}, - {5331.12, -2993.71, 1576.14, 0.0642734, 0, 0, 0.0321311, 0.999484}, - {5321.63, -2986.55, 1552.2, 5.29503, 0, 0, 0.474219, -0.880407}, - {5292.1, -2914.36, 1529.52, 2.9742, 0, 0, 0.996499, 0.083601}, - {5281.77, -2926.5, 1530.62, 1.67829, 0, 0, 0.744071, 0.6681}, - {5287.19, -2909.94, 1543.49, 3.31192, 0, 0, 0.996376, -0.0850591}, - {5534.15, -2679.35, 1483.61, 0.428685, 0, 0, 0.212705, 0.977116}, + {5524.11, -2612.73, 1483.38, 1.96198, 0, 0, 0.831047, 0.556202}, + {5514.42, -2617.19, 1505.77, 1.82453, 0, 0, 0.790892, 0.611956}, + {5510.21, -2624.77, 1485.34, 1.71065, 0, 0, 0.754783, 0.655974}, + {5570.72, -2619.04, 1487.62, 0.728898, 0, 0, 0.356435, 0.93432}, + {5570.29, -2639.37, 1487.31, 1.49308, 0, 0, 0.679104, 0.734042}, + {5583.56, -2637.2, 1503.78, 1.46559, 0, 0, 0.668951, 0.743307}, + {5571.53, -2626.81, 1510.99, 0.362107, 0, 0, 0.180066, 0.983654}, + {5545.97, -2659.62, 1489.64, 5.07055, 0, 0, 0.569845, -0.821752}, + {5557.44, -2675.91, 1482.58, 1.70118, 0, 0, 0.751671, 0.659539}, + {5594.98, -2742.31, 1495.51, 4.5993, 0, 0, 0.74594, -0.666013}, + {5599.65, -2755.6, 1505.05, 1.66896, 0, 0, 0.740947, 0.671564}, + {5565.95, -2774.75, 1499.48, 6.22425, 0, 0, 0.0294611, -0.999566}, + {5567.1, -2769.7, 1511.17, 5.99257, 0, 0, 0.144799, -0.989461}, + {5572.84, -2774.16, 1527.06, 0.836428, 0, 0, 0.406129, 0.913816}, + {5538.32, -2805.94, 1498.87, 4.30082, 0, 0, 0.836674, -0.547701}, + {5515.66, -2801.74, 1503.53, 5.57316, 0, 0, 0.347602, -0.937642}, + {5516.76, -2827.14, 1501.15, 0.35026, 0, 0, 0.174236, 0.984704}, + {5536.13, -2813.51, 1537.21, 4.51681, 0, 0, 0.772765, -0.634692}, + {5525.05, -2825.16, 1538.53, 0.489275, 0, 0, 0.242205, 0.970225}, + {5534.42, -2815.45, 1562.84, 4.62834, 0, 0, 0.736191, -0.676774}, + {5519.64, -2831.12, 1526.46, 0.611008, 0, 0, 0.300774, 0.953696}, + {5551.04, -2827.55, 1523.5, 3.35206, 0, 0, 0.994468, -0.10504}, + {5469.22, -2802.87, 1503.5, 4.99509, 0, 0, 0.600436, -0.799673}, + {5427.8, -2737.26, 1487.12, 1.78673, 0, 0, 0.779186, 0.626793}, + {5454.1, -2709.1, 1485.92, 3.03552, 0, 0, 0.998594, 0.0530137}, + {5436.3, -2718.2, 1506.02, 2.7567, 0, 0, 0.981539, 0.191261}, + {5412.6, -2740.55, 1510.79, 2.98446, 0, 0, 0.996915, 0.0784832}, + {5406.12, -2752.48, 1521.01, 2.05769, 0, 0, 0.856705, 0.515807}, + {5445.24, -2676.35, 1521.89, 2.91378, 0, 0, 0.99352, 0.113661}, + {5481.4, -2665.08, 1482.23, 4.30001, 0, 0, 0.836895, -0.547363}, + {5443.51, -2675.44, 1487.12, 2.90986, 0, 0, 0.993295, 0.115606}, + {5391.72, -2647.3, 1528.9, 3.76987, 0, 0, 0.951063, -0.308997}, + {5421.09, -2734.12, 1521.01, 2.70567, 0, 0, 0.97634, 0.216242}, + {5405.39, -2710.33, 1533.77, 2.51324, 0, 0, 0.951052, 0.309032}, + {5423.96, -2703.76, 1516.34, 2.79206, 0, 0, 0.984767, 0.173879}, + {5444.75, -2735.23, 1486.37, 2.22657, 0, 0, 0.897155, 0.441715}, + {5570.98, -2747.91, 1495.7, 5.14433, 0, 0, 0.53915, -0.84221}, + {5567.79, -2673.9, 1484.66, 2.72529, 0, 0, 0.978415, 0.20665}, + {5600.71, -2696.8, 1500.42, 0.443704, 0, 0, 0.220036, 0.975492}, + {5600.7, -2693.04, 1515.2, 5.16003, 0, 0, 0.532522, -0.846416}, + {5627.56, -2839.66, 1510.53, 5.41527, 0, 0, 0.420463, -0.907309}, + {5622.02, -2868.71, 1516.22, 2.25482, 0, 0, 0.903303, 0.429002}, + {5586.61, -2878.97, 1510.34, 4.55604, 0, 0, 0.76017, -0.649724}, + {5583.78, -2843.71, 1509.54, 5.35715, 0, 0, 0.44665, -0.894709}, + {5580.95, -2811.3, 1513.3, 3.57587, 0, 0, 0.976518, -0.215434}, + {5542.52, -2869.31, 1523.13, 5.23304, 0, 0, 0.501275, -0.865288}, + {5557.35, -2866.36, 1518.76, 4.48299, 0, 0, 0.783388, -0.621533}, + {5380.91, -2849.36, 1512.81, 3.90962, 0, 0, 0.927168, -0.374646}, + {5395.76, -2881.41, 1521.11, 4.28426, 0, 0, 0.84118, -0.540755}, + {5374.87, -2859.63, 1528.98, 3.30252, 0, 0, 0.996765, -0.0803745}, + {5356.07, -2854.66, 1520.34, 5.83933, 0, 0, 0.220108, -0.975475}, + {5363.01, -2975.72, 1539.02, 4.13738, 0, 0, 0.87859, -0.477576}, + {5336.85, -2980.74, 1561.24, 5.11126, 0, 0, 0.553001, -0.83318}, + {5335.23, -2974.62, 1540.05, 5.04451, 0, 0, 0.580496, -0.814263}, + {5422.37, -2998.87, 1549.98, 4.51831, 0, 0, 0.772288, -0.635272}, + {5405.54, -3014.6, 1562.16, 5.86761, 0, 0, 0.206298, -0.978489}, + {5427.96, -3019.4, 1561.58, 3.53498, 0, 0, 0.980718, -0.19543}, + {5348.12, -2977.84, 1582.47, 3.94025, 0, 0, 0.921323, -0.388799}, + {5331.12, -2993.71, 1576.14, 0.0642734, 0, 0, 0.0321311, 0.999484}, + {5321.63, -2986.55, 1552.2, 5.29503, 0, 0, 0.474219, -0.880407}, + {5292.1, -2914.36, 1529.52, 2.9742, 0, 0, 0.996499, 0.083601}, + {5281.77, -2926.5, 1530.62, 1.67829, 0, 0, 0.744071, 0.6681}, + {5287.19, -2909.94, 1543.49, 3.31192, 0, 0, 0.996376, -0.0850591}, + {5534.15, -2679.35, 1483.61, 0.428685, 0, 0, 0.212705, 0.977116}, {5545.43, -2647.82, 1483.05, 5.38848, 0, 0, 0.432578, -0.901596} }; @@ -333,7 +333,7 @@ void hyjalAI::JustSummoned(Creature *summoned) Summons.Summon(summoned); } -void hyjalAI::SummonedCreatureDespawn(Creature* summoned) +void hyjalAI::SummonedCreatureDespawn(Creature* summoned) { Summons.Despawn(summoned); } @@ -372,14 +372,14 @@ void hyjalAI::Reset() break; } - //Bools + //Bools EventBegun = false; FirstBossDead = false; SecondBossDead = false; Summon = false; bRetreat = false; Debug = false; - + //Flags m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); @@ -387,7 +387,7 @@ void hyjalAI::Reset() //Initialize spells memset(Spell, 0, sizeof(Spell)); - + //Reset Instance Data for trash count if(pInstance) @@ -417,7 +417,7 @@ void hyjalAI::EnterEvadeMode() if(m_creature->isAlive()) m_creature->GetMotionMaster()->MoveTargetedHome(); - + m_creature->SetLootRecipient(NULL); InCombat = false; @@ -456,7 +456,7 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) } Creature* pCreature = NULL; switch(entry) - { + { case 17906: //GARGOYLE if(!FirstBossDead && (WaveCount == 1 || WaveCount == 3)) @@ -468,7 +468,7 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_GARG_GATE][0]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][1]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); } break; - case 17907: //FROST_WYRM , + case 17907: //FROST_WYRM , if(FirstBossDead && WaveCount == 1) {//summon at gate pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_WYRM_GATE][0],SpawnPointSpecial[SPAWN_WYRM_GATE][1],SpawnPointSpecial[SPAWN_WYRM_GATE][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); @@ -476,9 +476,9 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0], SpawnPointSpecial[SPAWN_NEAR_TOWER][1],SpawnPointSpecial[SPAWN_NEAR_TOWER][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); if(pCreature) ((hyjal_trashAI*)pCreature->AI())->useFlyPath = true; - } + } break; - case 17908: //GIANT_INFERNAL + case 17908: //GIANT_INFERNAL InfernalCount++; if(InfernalCount > 7)InfernalCount = 0; pCreature = m_creature->SummonCreature(entry, InfernalPos[InfernalCount][0], InfernalPos[InfernalCount][1], InfernalPos[InfernalCount][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); @@ -486,9 +486,9 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) default: pCreature = m_creature->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); break; - + } - + if(pCreature) { // Increment Enemy Count to be used in World States and instance script @@ -498,21 +498,21 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) pCreature->setActive(true); switch(entry) { - case NECROMANCER: - case ABOMINATION: - case GHOUL: - case BANSHEE: - case CRYPT_FIEND: - case GARGOYLE: + case NECROMANCER: + case ABOMINATION: + case GHOUL: + case BANSHEE: + case CRYPT_FIEND: + case GARGOYLE: case FROST_WYRM: - case GIANT_INFERNAL: - case FEL_STALKER: - case RAGE_WINTERCHILL: - case ANETHERON: - case KAZROGAL: - case AZGALOR: + case GIANT_INFERNAL: + case FEL_STALKER: + case RAGE_WINTERCHILL: + case ANETHERON: + case KAZROGAL: + case AZGALOR: ((hyjal_trashAI*)pCreature->AI())->IsEvent = true; - break; + break; } if(pInstance) { @@ -648,12 +648,12 @@ void hyjalAI::Talk(uint32 id) void hyjalAI::UpdateWorldState(uint32 id, uint32 state) { Map * map = m_creature->GetMap(); - - if(!map->IsDungeon()) + + if(!map->IsDungeon()) return; Map::PlayerList const& players = map->GetPlayers(); - + if (!players.isEmpty()) { for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) @@ -665,7 +665,7 @@ void hyjalAI::UpdateWorldState(uint32 id, uint32 state) } void hyjalAI::Retreat() -{ +{ if(pInstance) { if(Faction == 0) @@ -681,7 +681,7 @@ void hyjalAI::Retreat() pInstance->SetData(DATA_HORDE_RETREAT, 1); Creature* JainaDummy = m_creature->SummonCreature(JAINA,JainaDummySpawn[0][0],JainaDummySpawn[0][1],JainaDummySpawn[0][2],JainaDummySpawn[0][3],TEMPSUMMON_TIMED_DESPAWN,60000); if(JainaDummy) - { + { JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); ((hyjalAI*)JainaDummy->AI())->IsDummy = true; DummyGuid = JainaDummy->GetGUID(); @@ -692,7 +692,7 @@ void hyjalAI::Retreat() } } SpawnVeins(); - Overrun = true; + Overrun = true; m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//cant talk after overrun event started } @@ -724,7 +724,7 @@ void hyjalAI::SpawnVeins() void hyjalAI::DeSpawnVeins() { - if(!pInstance)return; + if(!pInstance)return; if(Faction == 1) { Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_JAINAPROUDMOORE)); @@ -768,7 +768,7 @@ void hyjalAI::UpdateAI(const uint32 diff) DoHide = false; switch(m_creature->GetEntry()) { - case JAINA: + case JAINA: if(pInstance->GetData(DATA_ALLIANCE_RETREAT)) { m_creature->SetVisibility(VISIBILITY_OFF); @@ -776,7 +776,7 @@ void hyjalAI::UpdateAI(const uint32 diff) HideNearPos(5037.76, -1889.71); for(uint8 i = 0; i < 92; i++)//summon fires m_creature->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0); - + } else m_creature->SetVisibility(VISIBILITY_ON); break; @@ -789,11 +789,11 @@ void hyjalAI::UpdateAI(const uint32 diff) HideNearPos(5542.2, -2629.36); for(uint8 i = 0; i < 65; i++)//summon fires m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0); - + } - else m_creature->SetVisibility(VISIBILITY_ON); + else m_creature->SetVisibility(VISIBILITY_ON); break; - } + } } if(DoRespawn) { @@ -802,7 +802,7 @@ void hyjalAI::UpdateAI(const uint32 diff) DoRespawn = false; RespawnNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); if(Faction == 0) - { + { RespawnNearPos(5037.76, -1889.71); }else if (Faction == 1) { @@ -832,11 +832,11 @@ void hyjalAI::UpdateAI(const uint32 diff) break; case THRALL://thrall HideNearPos(5563, -2763.19); - HideNearPos(5542.2, -2629.36); + HideNearPos(5542.2, -2629.36); HideNearPos(5603.75, -2853.12); break; } - m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetVisibility(VISIBILITY_OFF); }else RetreatTimer -= diff; } @@ -944,7 +944,7 @@ void hyjalAI::JustDied(Unit* killer) if(pInstance->GetData(DATA_AZGALOREVENT) == IN_PROGRESS) pInstance->SetData(DATA_AZGALOREVENT, NOT_STARTED); pInstance->SetData(DATA_RESET_RAIDDAMAGE, NULL);//reset damage on die - } + } } void hyjalAI::HideNearPos(float x, float y) { @@ -1094,14 +1094,14 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) case 0://alliance for(uint8 i = 0; i < 92; i++)//summon fires m_creature->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0); - + for(uint8 i = 0; i < 25; i++)//summon 25 ghouls { uint8 r = rand()%4; Creature* pUnit = m_creature->SummonCreature(GHOUL, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); if(pUnit) { - ((hyjal_trashAI*)pUnit->AI())->faction = Faction; + ((hyjal_trashAI*)pUnit->AI())->faction = Faction; ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true; ((hyjal_trashAI*)pUnit->AI())->OverrunType = i; pUnit->setActive(true); @@ -1113,7 +1113,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) Creature* pUnit = m_creature->SummonCreature(ABOMINATION, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); if(pUnit) { - ((hyjal_trashAI*)pUnit->AI())->faction = Faction; + ((hyjal_trashAI*)pUnit->AI())->faction = Faction; ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true; ((hyjal_trashAI*)pUnit->AI())->OverrunType = i; pUnit->setActive(true); @@ -1125,28 +1125,28 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) if(pUnit) { pUnit->SetHomePosition(AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3]); - ((hyjal_trashAI*)pUnit->AI())->faction = Faction; + ((hyjal_trashAI*)pUnit->AI())->faction = Faction; ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true; ((hyjal_trashAI*)pUnit->AI())->OverrunType = i; pUnit->setActive(true); } } break; - case 1://horde + case 1://horde for(uint8 i = 0; i < 65; i++)//summon fires m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0); - + for(uint8 i = 0; i < 26; i++)//summon infernals { Creature* pUnit = m_creature->SummonCreature(GIANT_INFERNAL, InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); if(pUnit) { pUnit->SetHomePosition(InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3]); - ((hyjal_trashAI*)pUnit->AI())->faction = Faction; + ((hyjal_trashAI*)pUnit->AI())->faction = Faction; ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true; ((hyjal_trashAI*)pUnit->AI())->OverrunType = i; pUnit->setActive(true); - } + } } for(uint8 i = 0; i < 25; i++)//summon 25 ghouls { @@ -1154,7 +1154,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) Creature* pUnit = m_creature->SummonCreature(GHOUL, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); if(pUnit) { - ((hyjal_trashAI*)pUnit->AI())->faction = Faction; + ((hyjal_trashAI*)pUnit->AI())->faction = Faction; ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true; ((hyjal_trashAI*)pUnit->AI())->OverrunType = i; pUnit->setActive(true); @@ -1166,7 +1166,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) Creature* pUnit = m_creature->SummonCreature(ABOMINATION, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); if(pUnit) { - ((hyjal_trashAI*)pUnit->AI())->faction = Faction; + ((hyjal_trashAI*)pUnit->AI())->faction = Faction; ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true; ((hyjal_trashAI*)pUnit->AI())->OverrunType = i; pUnit->setActive(true); diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h index 4a2fbd6494e..6f252d8e2bc 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h @@ -216,7 +216,7 @@ struct TRINITY_DLL_DECL hyjalAI : public npc_escortAI bool Summon; bool bRetreat; bool Debug; - bool VeinsSpawned[2]; + bool VeinsSpawned[2]; uint8 InfernalCount; SummonList Summons; bool Overrun; diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp index 998db444cfb..55096b56e42 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp @@ -30,21 +30,21 @@ float AllianceWPs[8][3]=//basic waypoints from spawn to leader {4989.16, -1716.67, 1335.74},//first WP in the base, after the gate {5026.27, -1736.89, 1323.02}, {5037.77, -1770.56, 1324.36}, - {5067.23, -1789.95, 1321.17} + {5067.23, -1789.95, 1321.17} }; float FrostWyrmWPs[3][3]=//waypoints for the frost wyrms in horde base { {5580.82, -2628.83, 1528.28}, {5550.90, -2667.16, 1505.45}, - {5459.64, -2725.91, 1484.83} + {5459.64, -2725.91, 1484.83} }; float GargoyleWPs[3][3]=//waypoints for the gargoyles in horde base -{ +{ {5533.66, -2634.32, 1495.33}, - {5517.88, -2712.05, 1490.54}, - {5459.64, -2725.91, 1484.83} + {5517.88, -2712.05, 1490.54}, + {5459.64, -2725.91, 1484.83} }; float FlyPathWPs[3][3]=//waypoints for the gargoyls and frost wyrms in horde base in wave 1/3 @@ -115,7 +115,7 @@ float AllianceOverrunWP[55][3]=//waypoints in the alliance base used in the end }; float HordeOverrunWP[21][3]=//waypoints in the horde base used in the end in the cleaning wave -{ +{ {5490.72,-2702.94,1482.14},//0 start {5469.77,-2741.34,1486.95}, {5439.47,-2771.02,1494.59}, @@ -162,7 +162,7 @@ void hyjal_trashAI::DamageTaken(Unit *done_by, uint32 &damage) { damageTaken += damage; if(pInstance) - pInstance->SetData(DATA_RAIDDAMAGE,damage);//store raid's damage + pInstance->SetData(DATA_RAIDDAMAGE,damage);//store raid's damage } } @@ -174,7 +174,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff) { SetupOverrun = true; if(faction == 0) - { + { if(m_creature->GetEntry() == GARGOYLE) { DummyTarget[0] = AllianceOverrunWP[50+OverrunType][0]; //+OverrunType 0 - 4 @@ -195,7 +195,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff) AddWaypoint( 8, AllianceOverrunWP[26][0]+irand(-3,3), AllianceOverrunWP[26][1]+irand(-3,3), AllianceOverrunWP[26][2]); AddWaypoint( 9, AllianceOverrunWP[27][0]+irand(-3,3), AllianceOverrunWP[27][1]+irand(-3,3), AllianceOverrunWP[27][2]); AddWaypoint(10, AllianceOverrunWP[28][0]+irand(-3,3), AllianceOverrunWP[28][1]+irand(-3,3), AllianceOverrunWP[28][2]); - + AddWaypoint(11, AllianceOverrunWP[36][0]+irand(-3,3), AllianceOverrunWP[36][1]+irand(-3,3), AllianceOverrunWP[36][2]); AddWaypoint(12, AllianceOverrunWP[37][0]+irand(-3,3), AllianceOverrunWP[37][1]+irand(-3,3), AllianceOverrunWP[37][2]); AddWaypoint(13, AllianceOverrunWP[38][0]+irand(-3,3), AllianceOverrunWP[38][1]+irand(-3,3), AllianceOverrunWP[38][2]); @@ -311,11 +311,11 @@ void hyjal_trashAI::UpdateAI(const uint32 diff) LastOverronPos = 17; Start(true, true, true); break; - } - } + } + } } if(faction == 1) - { + { if(m_creature->GetEntry() == GHOUL) { for(uint8 i = 0; i < 6; i++) @@ -359,7 +359,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff) AddWaypoint( i+6, HordeOverrunWP[i][0]+irand(-10,10), HordeOverrunWP[i][1]+irand(-10,10), HordeOverrunWP[i][2]); SetDespawnAtEnd(true); LastOverronPos = 21; - Start(true, true, true); + Start(true, true, true); } } } @@ -386,7 +386,7 @@ struct mob_giant_infernalAI : public hyjal_trashAI m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_INVIS); - go = false; + go = false; pos = 0; Reset(); } @@ -401,7 +401,7 @@ struct mob_giant_infernalAI : public hyjal_trashAI bool imol; void Reset() - { + { spawnTimer = 2000; FlameBuffetTimer= 2000; imol = false; @@ -463,7 +463,7 @@ struct mob_giant_infernalAI : public hyjal_trashAI }else if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && pInstance->GetData(DATA_HORDE_RETREAT)){ //do overrun } - } + } }else spawnTimer -= diff; } if(!CanMove)return; @@ -514,7 +514,7 @@ struct mob_abominationAI : public hyjal_trashAI mob_abominationAI(Creature* c) : hyjal_trashAI(c) { pInstance = ((ScriptedInstance*)c->GetInstanceData()); - go = false; + go = false; pos = 0; Reset(); } @@ -561,7 +561,7 @@ struct mob_abominationAI : public hyjal_trashAI if(IsEvent || IsOverrun) npc_escortAI::UpdateAI(diff); if (IsEvent) - { + { if(!go) { go = true; @@ -580,7 +580,7 @@ struct mob_abominationAI : public hyjal_trashAI ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); } - } + } } } if(!m_creature->HasAura(SPELL_DISEASE_CLOUD,0)) @@ -609,7 +609,7 @@ struct mob_ghoulAI : public hyjal_trashAI mob_ghoulAI(Creature* c) : hyjal_trashAI(c) { pInstance = ((ScriptedInstance*)c->GetInstanceData()); - go = false; + go = false; pos = 0; Reset(); } @@ -650,7 +650,7 @@ struct mob_ghoulAI : public hyjal_trashAI m_creature->setDeathState(DEAD); m_creature->RemoveCorpse(); } - + } } @@ -681,14 +681,14 @@ struct mob_ghoulAI : public hyjal_trashAI ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); } - } - } + } + } } if(FrenzyTimer<diff) { DoCast(m_creature,SPELL_FRENZY); FrenzyTimer = 15000+rand()%15000; - }else FrenzyTimer -= diff; + }else FrenzyTimer -= diff; if (!UpdateVictim()) return; @@ -712,7 +712,7 @@ struct mob_necromancerAI : public hyjal_trashAI mob_necromancerAI(Creature* c) : hyjal_trashAI(c), summons(m_creature) { pInstance = ((ScriptedInstance*)c->GetInstanceData()); - go = false; + go = false; pos = 0; Reset(); } @@ -800,8 +800,8 @@ struct mob_necromancerAI : public hyjal_trashAI ((npc_escortAI*)(m_creature->AI()))->Start(true, true, true); ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); } - } - } + } + } } if (!UpdateVictim()) return; @@ -809,7 +809,7 @@ struct mob_necromancerAI : public hyjal_trashAI { DoCast(m_creature->getVictim(),SPELL_SHADOW_BOLT); ShadowBoltTimer = 20000+rand()%10000; - }else ShadowBoltTimer -= diff; + }else ShadowBoltTimer -= diff; DoMeleeAttackIfReady(); } @@ -830,7 +830,7 @@ struct mob_bansheeAI : public hyjal_trashAI mob_bansheeAI(Creature* c) : hyjal_trashAI(c) { pInstance = ((ScriptedInstance*)c->GetInstanceData()); - go = false; + go = false; pos = 0; Reset(); } @@ -892,8 +892,8 @@ struct mob_bansheeAI : public hyjal_trashAI ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); } - } - } + } + } } if (!UpdateVictim()) return; @@ -929,7 +929,7 @@ struct mob_crypt_fiendAI : public hyjal_trashAI mob_crypt_fiendAI(Creature* c) : hyjal_trashAI(c) { pInstance = ((ScriptedInstance*)c->GetInstanceData()); - go = false; + go = false; pos = 0; Reset(); } @@ -988,8 +988,8 @@ struct mob_crypt_fiendAI : public hyjal_trashAI ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); } - } - } + } + } } if (!UpdateVictim()) return; @@ -1015,7 +1015,7 @@ struct mob_fel_stalkerAI : public hyjal_trashAI mob_fel_stalkerAI(Creature* c) : hyjal_trashAI(c) { pInstance = ((ScriptedInstance*)c->GetInstanceData()); - go = false; + go = false; pos = 0; Reset(); } @@ -1074,8 +1074,8 @@ struct mob_fel_stalkerAI : public hyjal_trashAI ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); } - } - } + } + } } if (!UpdateVictim()) return; @@ -1114,7 +1114,7 @@ struct mob_frost_wyrmAI : public hyjal_trashAI void Reset() { FrostBreathTimer = 5000; - MoveTimer = 0; + MoveTimer = 0; m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); } @@ -1129,7 +1129,7 @@ struct mob_frost_wyrmAI : public hyjal_trashAI m_creature->AddThreat(target,0.0); DoCast(target,SPELL_FROST_BREATH,true); } - } + } } void JustDied(Unit *victim) @@ -1154,8 +1154,8 @@ struct mob_frost_wyrmAI : public hyjal_trashAI ((hyjal_trashAI*)m_creature->AI())->SetCanMelee(false); npc_escortAI::UpdateAI(diff); } - if (IsEvent) - { + if (IsEvent) + { if(!go) { go = true; @@ -1173,8 +1173,8 @@ struct mob_frost_wyrmAI : public hyjal_trashAI ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); } - } - } + } + } } if (!UpdateVictim()) return; @@ -1185,7 +1185,7 @@ struct mob_frost_wyrmAI : public hyjal_trashAI MoveTimer = 2000; }else MoveTimer-=diff; } - + if(FrostBreathTimer<diff) { if(m_creature->GetDistance(m_creature->getVictim()) < 25) @@ -1194,7 +1194,7 @@ struct mob_frost_wyrmAI : public hyjal_trashAI m_creature->StopMoving(); m_creature->GetMotionMaster()->Clear(); FrostBreathTimer = 4000; - } + } }else FrostBreathTimer -= diff; } }; @@ -1223,15 +1223,15 @@ struct mob_gargoyleAI : public hyjal_trashAI uint32 pos; uint32 MoveTimer; float Zpos; - bool forcemove; + bool forcemove; void Reset() { forcemove = true; Zpos = 10.0; StrikeTimer = 2000+rand()%5000; - MoveTimer = 0; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + MoveTimer = 0; + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); } void WaypointReached(uint32 i) @@ -1245,7 +1245,7 @@ struct mob_gargoyleAI : public hyjal_trashAI m_creature->AddThreat(target,0.0); DoCast(target,SPELL_GARGOYLE_STRIKE,true); } - } + } } void JustDied(Unit *victim) @@ -1255,7 +1255,7 @@ struct mob_gargoyleAI : public hyjal_trashAI z = m_creature->GetMap()->GetVmapHeight(x, y, z, true); m_creature->GetMotionMaster()->MovePoint(0,x,y,z); m_creature->Relocate(x,y,z,0); - hyjal_trashAI::JustDied(victim); + hyjal_trashAI::JustDied(victim); } void UpdateAI(const uint32 diff) @@ -1285,8 +1285,8 @@ struct mob_gargoyleAI : public hyjal_trashAI ((npc_escortAI*)(m_creature->AI()))->Start(false, true, true); ((npc_escortAI*)(m_creature->AI()))->SetDespawnAtEnd(false); } - } - } + } + } } if(IsOverrun && !UpdateVictim()) { @@ -1294,7 +1294,7 @@ struct mob_gargoyleAI : public hyjal_trashAI { if(StrikeTimer<diff) { - m_creature->CastSpell(DummyTarget[0],DummyTarget[1],DummyTarget[2],SPELL_GARGOYLE_STRIKE,false); + m_creature->CastSpell(DummyTarget[0],DummyTarget[1],DummyTarget[2],SPELL_GARGOYLE_STRIKE,false); StrikeTimer = 2000+rand()%1000; }else StrikeTimer -= diff; } @@ -1316,10 +1316,10 @@ struct mob_gargoyleAI : public hyjal_trashAI m_creature->getVictim()->GetPosition(x,y,z); m_creature->GetMotionMaster()->MovePoint(0,x,y,z+Zpos); Zpos-=1.0; - if(Zpos<=0)Zpos=0; + if(Zpos<=0)Zpos=0; MoveTimer = 2000; }else MoveTimer-=diff; - } + } if(StrikeTimer<diff) { if(m_creature->GetDistance(m_creature->getVictim()) < 20) diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h index 1113ce4c8a2..bbc2f6663a8 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h @@ -23,7 +23,7 @@ struct TRINITY_DLL_DECL hyjal_trashAI : public npc_escortAI void DamageTaken(Unit *done_by, uint32 &damage); - public: + public: ScriptedInstance* pInstance; bool IsEvent; uint32 Delay; diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp index 9ce778b3600..ccfdcf2eb31 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp @@ -92,18 +92,18 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance } void OnObjectCreate(GameObject *go) - { + { switch(go->GetEntry()) { - case 182060: - HordeGate = go->GetGUID(); + case 182060: + HordeGate = go->GetGUID(); if(allianceRetreat) go->SetGoState(0); else go->SetGoState(1); break; - case 182061: - ElfGate = go->GetGUID(); + case 182061: + ElfGate = go->GetGUID(); if(hordeRetreat) go->SetGoState(0); else @@ -155,23 +155,23 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance switch(type) { case DATA_RAGEWINTERCHILLEVENT: Encounters[0] = data; break; - case DATA_ANETHERONEVENT: - Encounters[1] = data; + case DATA_ANETHERONEVENT: + Encounters[1] = data; break; case DATA_KAZROGALEVENT: Encounters[2] = data; break; - case DATA_AZGALOREVENT: + case DATA_AZGALOREVENT: { - Encounters[3] = data; + Encounters[3] = data; if(data==DONE) - { + { if(ArchiYell)break; ArchiYell = true; Creature* pCreature = instance->GetCreatureInMap(Azgalor); if(pCreature) - { + { Creature* pUnit = pCreature->SummonCreature(21987,pCreature->GetPositionX(),pCreature->GetPositionY(),pCreature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000); - + Map *map = pCreature->GetMap(); if (map->IsDungeon() && pUnit) { @@ -179,12 +179,12 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance Map::PlayerList const &PlayerList = map->GetPlayers(); if (PlayerList.isEmpty()) return; - + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { if (i->getSource()) { - WorldPacket data(SMSG_MESSAGECHAT, 200); + WorldPacket data(SMSG_MESSAGECHAT, 200); pUnit->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,"All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more.",0,"Archimonde",i->getSource()->GetGUID()); i->getSource()->GetSession()->SendPacket(&data); @@ -206,12 +206,12 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance else Trash--; UpdateWorldState(WORLD_STATE_ENEMYCOUNT, Trash); break; - case DATA_ALLIANCE_RETREAT: + case DATA_ALLIANCE_RETREAT: allianceRetreat = data; OpenDoor(HordeGate,true); SaveToDB(); break; - case DATA_HORDE_RETREAT: + case DATA_HORDE_RETREAT: hordeRetreat = data; OpenDoor(ElfGate,true); SaveToDB(); @@ -252,7 +252,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance void UpdateWorldState(uint32 id, uint32 state) { Map::PlayerList const& players = instance->GetPlayers(); - + if (!players.isEmpty()) { for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp index ea85414a27e..c350990cde7 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp @@ -386,11 +386,11 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI //alot will happen here, thrall and taretha talk, erozion appear at spot to explain m_creature->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000); } - break; + break; case 108: - //last waypoint, just set Thrall invisible, respawn is turned off + //last waypoint, just set Thrall invisible, respawn is turned off m_creature->SetVisibility(VISIBILITY_OFF); - break; + break; } } @@ -713,8 +713,11 @@ bool GossipSelect_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature, { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); - pInstance->SetData(TYPE_THRALL_EVENT,IN_PROGRESS); - pInstance->SetData(TYPE_THRALL_PART1,IN_PROGRESS); + if(pInstance) + { + pInstance->SetData(TYPE_THRALL_EVENT,IN_PROGRESS); + pInstance->SetData(TYPE_THRALL_PART1,IN_PROGRESS); + } DoScriptText(SAY_TH_START_EVENT_PART1, _Creature); @@ -732,7 +735,8 @@ bool GossipSelect_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature, case GOSSIP_ACTION_INFO_DEF+20: player->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC3, _Creature->GetGUID()); _Creature->SummonCreature(SKARLOC_MOUNT,2038.81,270.26,63.20,5.41,TEMPSUMMON_TIMED_DESPAWN,12000); - pInstance->SetData(TYPE_THRALL_PART2,IN_PROGRESS); + if(pInstance) + pInstance->SetData(TYPE_THRALL_PART2,IN_PROGRESS); DoScriptText(SAY_TH_START_EVENT_PART2, _Creature); @@ -741,7 +745,8 @@ bool GossipSelect_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature, case GOSSIP_ACTION_INFO_DEF+3: player->CLOSE_GOSSIP_MENU(); - pInstance->SetData(TYPE_THRALL_PART3,IN_PROGRESS); + if(pInstance) + pInstance->SetData(TYPE_THRALL_PART3,IN_PROGRESS); ((npc_thrall_old_hillsbradAI*)_Creature->AI())->StartWP(); break; } @@ -827,7 +832,8 @@ bool GossipSelect_npc_taretha(Player *player, Creature *_Creature, uint32 sender if( pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS ) { - pInstance->SetData(TYPE_THRALL_PART4,IN_PROGRESS); + if(pInstance) + pInstance->SetData(TYPE_THRALL_PART4,IN_PROGRESS); if(pInstance->GetData64(DATA_EPOCH) == 0) _Creature->SummonCreature(ENTRY_EPOCH,2639.13,698.55,65.43,4.59,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000); diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp index 134dac56ca0..3a3f7e8291d 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp @@ -131,18 +131,17 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI Creature* pAdvisor = NULL; for( int i=0; i<3; i++ ) - - if(RAdvisors[i]) - { - pAdvisor = (Unit::GetCreature((*m_creature), RAdvisors[i])); - if(pAdvisor && !pAdvisor->isAlive()) + if(RAdvisors[i]) { - pAdvisor->Respawn(); - pAdvisor->AI()->EnterEvadeMode(); - pAdvisor->GetMotionMaster()->MoveTargetedHome(); + pAdvisor = (Unit::GetCreature((*m_creature), RAdvisors[i])); + if(pAdvisor && !pAdvisor->isAlive()) + { + pAdvisor->Respawn(); + pAdvisor->AI()->EnterEvadeMode(); + pAdvisor->GetMotionMaster()->MoveTargetedHome(); + } } - } - pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); + pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); } diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp index 6c2588671e6..73d55127c78 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp @@ -219,7 +219,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI float ny = y; float o = 2.4f; if (i == 0) {nx += 10; ny -= 5; o=2.5f;} - if (i == 1) {nx -= 8; ny -= 7; o=0.9f;} + if (i == 1) {nx -= 8; ny -= 7; o=0.9f;} if (i == 2) {nx -= 3; ny += 9; o=5.0f;} Creature* binder = m_creature->SummonCreature(MOB_SPELLBINDER,nx,ny,z,o,TEMPSUMMON_DEAD_DESPAWN,0); if (binder) diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp index 02125f5fd38..a3a4230c342 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp @@ -76,7 +76,8 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI { boss_the_lurker_belowAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature) { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SPOUT_ANIM); + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SPOUT_ANIM); if(TempSpell) { TempSpell->Effect[0] = 0;//remove all spell effect, only anim is needed @@ -227,7 +228,7 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { Player *target = i->getSource(); - if(target->isAlive() && m_creature->HasInArc((double)diff/20000*(double)M_PI*2,target) && m_creature->GetDistance(target) <= SPOUT_DIST && !target->IsInWater()) + if(target && target->isAlive() && m_creature->HasInArc((double)diff/20000*(double)M_PI*2,target) && m_creature->GetDistance(target) <= SPOUT_DIST && !target->IsInWater()) DoCast(target,SPELL_SPOUT,true);//only knock back palyers in arc, in 100yards, not in water } } @@ -370,7 +371,8 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI Summoned = m_creature->SummonCreature(MOB_COILFANG_AMBUSHER,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); else Summoned = m_creature->SummonCreature(MOB_COILFANG_GUARDIAN,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - Summons.Summon(Summoned); + if(Summoned) + Summons.Summon(Summoned); Spawned = true; } } diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp index 7d56bbf6d2a..b892741c973 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp @@ -206,7 +206,8 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI { Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); Creature* Murloc = m_creature->SummonCreature(MurlocCords[i][0],MurlocCords[i][1],MurlocCords[i][2],MurlocCords[i][3],MurlocCords[i][4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - Murloc->AI()->AttackStart(target); + if(target && Murloc) + Murloc->AI()->AttackStart(target); } DoScriptText(EMOTE_EARTHQUAKE, m_creature); Earthquake = false; diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp index 5153edb5e62..c3c8d977509 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp @@ -131,7 +131,7 @@ struct TRINITY_DLL_DECL boss_the_black_stalkerAI : public ScriptedAI target->AddAura(SPELL_SUSPENSION, target); LevitatedTarget = 0; } - else + else { target->CastSpell(target, SPELL_MAGNETIC_PULL, true); InAir = true; diff --git a/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp b/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp index 3f71dc9041b..fcafcf6079e 100644 --- a/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp +++ b/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp @@ -63,6 +63,9 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance virtual void Update(uint32 diff) { + if(!IronCladDoor || !DefiasCannon || !DoorLever) + return; + switch(State) { case CANNON_GUNPOWDER_USED: @@ -107,6 +110,9 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance void MoveCreaturesInside() { + if(!DefiasPirate1 || !DefiasPirate2 || !DefiasCompanion) + return; + MoveCreatureInside(DefiasPirate1); MoveCreatureInside(DefiasPirate2); MoveCreatureInside(DefiasCompanion); diff --git a/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp b/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp index abba40ffe2a..623cda57518 100644 --- a/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp +++ b/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp @@ -62,7 +62,10 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1)) { if(lifeTimer < diff) - m_creature->AI()->EnterEvadeMode(); + { + EnterEvadeMode(); + return; + } else lifeTimer -= diff; } diff --git a/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp b/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp index 2e07f91984c..354da2892c1 100644 --- a/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp +++ b/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp @@ -62,7 +62,10 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1)) { if(lifeTimer < diff) - m_creature->AI()->EnterEvadeMode(); + { + EnterEvadeMode(); + return; + } else lifeTimer -= diff; } diff --git a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp index bdd36dba074..d6a3bbb51ba 100644 --- a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp +++ b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp @@ -167,7 +167,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature); if(Cage) - Cage->SetGoState(0); + Cage->SetGoState(0); DoScriptText(SAY_START, m_creature, player); break; } @@ -182,8 +182,11 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI DoScriptText(SAY_PROGRESS3, m_creature, player); Creature* Summ1 = m_creature->SummonCreature(16342, 7627.083984, -7532.538086, 152.128616, 1.082733, TEMPSUMMON_DEAD_DESPAWN, 0); Creature* Summ2 = m_creature->SummonCreature(16343, 7620.432129, -7532.550293, 152.454865, 0.827478, TEMPSUMMON_DEAD_DESPAWN, 0); - Summ1->Attack(m_creature, true); - Summ2->Attack(player, true); + if(Summ1 && Summ2) + { + Summ1->Attack(m_creature, true); + Summ2->Attack(player, true); + } m_creature->AI()->AttackStart(Summ1); break; } diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp index 0131d39dc48..e7a392a5370 100644 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp +++ b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp @@ -250,8 +250,8 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI //Whirlwind_Timer if (Whirlwind_Timer < diff) { - DoCast(m_creature->getVictim(), SPELL_WHIRLWIND); - Whirlwind_Timer = 55000; + DoCast(m_creature->getVictim(), SPELL_WHIRLWIND); + Whirlwind_Timer = 55000; }else Whirlwind_Timer -= diff; //MightyBlow_Timer @@ -280,18 +280,19 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI Unit* target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM, 0); if (target) + { AttackStart(target); - DoCast(target, SPELL_BERSERKER_C); - + DoCast(target, SPELL_BERSERKER_C); + } Charging_Timer = 20000; }else Charging_Timer -= diff; - //Intimidating Roar - if(Roar_Timer < diff) - { - DoCast(m_creature, SPELL_ROAR); - Roar_Timer = 40000+(rand()%10000); - }else Roar_Timer -= diff; + //Intimidating Roar + if(Roar_Timer < diff) + { + DoCast(m_creature, SPELL_ROAR); + Roar_Timer = 40000+(rand()%10000); + }else Roar_Timer -= diff; } DoMeleeAttackIfReady(); @@ -316,7 +317,7 @@ struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI { DarkDecay_Timer = 10000; Summon_Timer = 15000; - DeathCoil_Timer = 20000; + DeathCoil_Timer = 20000; //reset encounter if (pInstance) @@ -381,19 +382,19 @@ struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI //Summon_Timer if(Summon_Timer < diff) { - DoCast(m_creature, SPELL_SUMMON_WFH); - Summon_Timer = 30000; + DoCast(m_creature, SPELL_SUMMON_WFH); + Summon_Timer = 30000; }else Summon_Timer -= diff; - //DeathCoil Timer /need correct timer - if(DeathCoil_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if(target) - DoCast(target, SPELL_DEATH_COIL); - DeathCoil_Timer = 20000; - }else DeathCoil_Timer -= diff; + //DeathCoil Timer /need correct timer + if(DeathCoil_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if(target) + DoCast(target, SPELL_DEATH_COIL); + DeathCoil_Timer = 20000; + }else DeathCoil_Timer -= diff; DoMeleeAttackIfReady(); @@ -445,9 +446,9 @@ struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI if(Maulgar) ((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath(); - + if(CheckAllBossDied(pInstance, m_creature)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); + pInstance->SetData(DATA_MAULGAREVENT, DONE); } } @@ -551,7 +552,7 @@ struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI if(Maulgar) ((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath(); - + if(CheckAllBossDied(pInstance, m_creature)) pInstance->SetData(DATA_MAULGAREVENT, DONE); } diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp index 86d76952b45..4483a8be037 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp @@ -308,9 +308,11 @@ struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI if(!summoned) { Creature* Vazruden = m_creature->SummonCreature(ENTRY_VAZRUDEN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000); - VazrudenGUID = Vazruden->GetGUID(); + if(Vazruden) + VazrudenGUID = Vazruden->GetGUID(); Creature* Nazan = m_creature->SummonCreature(ENTRY_NAZAN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000); - NazanGUID = Nazan->GetGUID(); + if(Nazan) + NazanGUID = Nazan->GetGUID(); summoned = true; m_creature->SetVisibility(VISIBILITY_OFF); m_creature->addUnitState(UNIT_STAT_ROOT); @@ -391,6 +393,7 @@ struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI { UnsummonAdds(); EnterEvadeMode(); + return; } }else { diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp index 8c4b24421c6..7ae44f2f80a 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp @@ -276,6 +276,7 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI if ( tempx > 255 || tempx < 205) { EnterEvadeMode(); + return; } resetcheck_timer = 5000; }else resetcheck_timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp index 9c5563e8ac8..c2bfeaecbb8 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp @@ -130,7 +130,8 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI { Unit* target = NULL; target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); - DoCast(target, SPELL_HATEFUL_BOLT); + if(target) + DoCast(target, SPELL_HATEFUL_BOLT); HatefulBoltTimer = 15000; }else HatefulBoltTimer -= diff; diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp index 0d3f6f010c6..20bf8076b27 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp @@ -104,9 +104,6 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI void StartEvent() { - if(!pInstance) - return; - if(pInstance) pInstance->SetData(DATA_MOROES_EVENT, IN_PROGRESS); } @@ -266,7 +263,10 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI return; if(pInstance && !pInstance->GetData(DATA_MOROES_EVENT)) + { EnterEvadeMode(); + return; + } if(!Enrage && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30) { diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp index 96f58bd3a3c..e738466652b 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp @@ -117,7 +117,12 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI { m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); m_creature->RemoveCorpse(); - }else pInstance->SetData(DATA_NIGHTBANE_EVENT, NOT_STARTED); + } + else + { + if(pInstance) + pInstance->SetData(DATA_NIGHTBANE_EVENT, NOT_STARTED); + } HandleTerraceDoors(true); diff --git a/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp index e3babcf89df..00fe2e23c69 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp @@ -288,6 +288,7 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI { RaidWiped = true; EnterEvadeMode(); + return; } WipeTimer = 15000; @@ -507,6 +508,8 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI Step = 1; EventStarted = true; Creature* Arcanagos = m_creature->SummonCreature(MOB_ARCANAGOS,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); + if(!Arcanagos) + return; ArcanagosGUID = Arcanagos->GetGUID(); Arcanagos->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); (*Arcanagos).GetMotionMaster()->MovePoint(0,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2]); diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp index 3743423f0e0..5575e700405 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp @@ -145,7 +145,7 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI if(ChainLightningTimer < diff) { if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_CHAIN_LIGHTNING); + DoCast(target, SPELL_CHAIN_LIGHTNING); ChainLightningTimer = 10000; }else ChainLightningTimer -= diff; @@ -153,7 +153,8 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI { Unit* target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM, 0); - DoCast(target, SPELL_ARCANE_SHOCK); + if(target) + DoCast(target, SPELL_ARCANE_SHOCK); ArcaneShockTimer = 8000; }else ArcaneShockTimer -= diff; }else @@ -161,7 +162,7 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI if(OverloadTimer < diff) { if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_OVERLOAD); + DoCast(target, SPELL_OVERLOAD); OverloadTimer = 2200; }else OverloadTimer -= diff; } |