mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 07:06:23 +00:00
chore(Core/Misc): Some cleanup (#19970)
* remove weird blanks * update if * ) ) to )) * missed some ) ) * now switch * .
This commit is contained in:
@@ -143,7 +143,7 @@ public:
|
||||
{
|
||||
if (hp)
|
||||
{
|
||||
switch(HealthCheck)
|
||||
switch (HealthCheck)
|
||||
{
|
||||
case 75:
|
||||
Talk(SAY_75HEALTH);
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature) override
|
||||
{
|
||||
switch(pCreature->GetEntry())
|
||||
switch (pCreature->GetEntry())
|
||||
{
|
||||
case NPC_BJARNGRIM:
|
||||
m_uiGeneralBjarngrimGUID = pCreature->GetGUID();
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo) override
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
switch (pGo->GetEntry())
|
||||
{
|
||||
case GO_BJARNGRIM_DOOR:
|
||||
m_uiBjarngrimDoorGUID = pGo->GetGUID();
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
|
||||
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
|
||||
{
|
||||
switch(criteria_id)
|
||||
switch (criteria_id)
|
||||
{
|
||||
case 7321: //Shatter Resistant (2042)
|
||||
return volkhanAchievement;
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
void SetData(uint32 uiType, uint32 uiData) override
|
||||
{
|
||||
m_auiEncounter[uiType] = uiData;
|
||||
if( uiType == TYPE_LOKEN_INTRO )
|
||||
if (uiType == TYPE_LOKEN_INTRO)
|
||||
SaveToDB();
|
||||
|
||||
// Achievements
|
||||
@@ -148,10 +148,10 @@ public:
|
||||
else if (uiType == DATA_VOLKHAN_ACHIEVEMENT)
|
||||
volkhanAchievement = (bool)uiData;
|
||||
|
||||
if( uiData != DONE )
|
||||
if (uiData != DONE)
|
||||
return;
|
||||
|
||||
switch(uiType)
|
||||
switch (uiType)
|
||||
{
|
||||
case TYPE_BJARNGRIM:
|
||||
HandleGameObject(m_uiBjarngrimDoorGUID, true);
|
||||
@@ -197,7 +197,7 @@ public:
|
||||
|
||||
ObjectGuid GetGuidData(uint32 uiData) const override
|
||||
{
|
||||
switch(uiData)
|
||||
switch (uiData)
|
||||
{
|
||||
case TYPE_BJARNGRIM:
|
||||
return m_uiGeneralBjarngrimGUID;
|
||||
|
||||
@@ -95,15 +95,15 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if(!UpdateVictim())
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_STORM:
|
||||
{
|
||||
|
||||
@@ -319,7 +319,7 @@ public:
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
|
||||
|
||||
if(pInstance)
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(BRANN_BRONZEBEARD, 1);
|
||||
pInstance->SetData(DATA_BRANN_ACHIEVEMENT, true);
|
||||
@@ -586,7 +586,7 @@ public:
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
Creature* cr = me->SummonCreature(entry, 946.5971f + urand(0, 6), 383.5330f + urand(0, 6), 205.9943f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
|
||||
if(cr)
|
||||
if (cr)
|
||||
{
|
||||
cr->AI()->AttackStart(me);
|
||||
cr->AddThreat(me, 100.0f);
|
||||
@@ -598,7 +598,7 @@ public:
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
ResetEvent();
|
||||
if(pInstance)
|
||||
if (pInstance)
|
||||
{
|
||||
if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_BRANN)))
|
||||
{
|
||||
@@ -662,7 +662,7 @@ void brann_bronzebeard::brann_bronzebeardAI::WaypointReached(uint32 id)
|
||||
// In front of Console
|
||||
case 11:
|
||||
SetEscortPaused(true);
|
||||
if(pInstance)
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(BOSS_TRIBUNAL_OF_AGES, IN_PROGRESS);
|
||||
if (GameObject* tribunal = ObjectAccessor::GetGameObject(*me, pInstance->GetGuidData(GO_TRIBUNAL_CONSOLE)))
|
||||
@@ -672,7 +672,7 @@ void brann_bronzebeard::brann_bronzebeardAI::WaypointReached(uint32 id)
|
||||
// Before Sjonnir's door
|
||||
case 27:
|
||||
SetEscortPaused(true);
|
||||
if(pInstance)
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(BRANN_BRONZEBEARD, 5);
|
||||
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) override
|
||||
{
|
||||
switch(go->GetEntry())
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_KADDRAK:
|
||||
goKaddrakGUID = go->GetGUID();
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
switch(creature->GetEntry())
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_SJONNIR:
|
||||
SjonnirGUID = creature->GetGUID();
|
||||
|
||||
@@ -340,7 +340,7 @@ public:
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch(events.ExecuteEvent())
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_FUSION_PUNCH:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FUSION_PUNCH, false);
|
||||
@@ -509,7 +509,7 @@ public:
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch(events.ExecuteEvent())
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_RUNE_OF_POWER:
|
||||
{
|
||||
|
||||
@@ -432,7 +432,7 @@ public:
|
||||
events.Repeat(20s);
|
||||
return;
|
||||
case EVENT_SUMMON:
|
||||
if(summons.size() < 20)
|
||||
if (summons.size() < 20)
|
||||
if (Creature* lift = DoSummonFlyer(NPC_MECHANOLIFT, me, 30.0f, 50.0f, 0))
|
||||
lift->GetMotionMaster()->MoveRandom(100);
|
||||
|
||||
@@ -474,9 +474,9 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
if(me->isAttackReady() && !me->HasUnitState(UNIT_STATE_STUNNED))
|
||||
if (me->isAttackReady() && !me->HasUnitState(UNIT_STATE_STUNNED))
|
||||
{
|
||||
if(me->IsWithinCombatRange(me->GetVictim(), 15.0f))
|
||||
if (me->IsWithinCombatRange(me->GetVictim(), 15.0f))
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), SPELL_BATTERING_RAM, false);
|
||||
me->resetAttackTimer();
|
||||
@@ -1036,7 +1036,7 @@ public:
|
||||
_switchTargetTimer += diff;
|
||||
if (_switchTargetTimer >= 30000)
|
||||
{
|
||||
if(Unit* target = me->SelectNearbyTarget(nullptr, 200.0f))
|
||||
if (Unit* target = me->SelectNearbyTarget(nullptr, 200.0f))
|
||||
{
|
||||
if (target->GetVehicleBase() && target->GetVehicleBase()->GetEntry() == NPC_SEAT)
|
||||
{
|
||||
|
||||
@@ -502,7 +502,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_FREYA_BERSERK, 10min);
|
||||
events.SetPhase(EVENT_PHASE_ADDS);
|
||||
|
||||
if( !m_pInstance )
|
||||
if (!m_pInstance)
|
||||
return;
|
||||
|
||||
if (m_pInstance->GetData(TYPE_FREYA) != DONE)
|
||||
|
||||
@@ -177,7 +177,7 @@ public:
|
||||
|
||||
void DoAction(int32 param) override
|
||||
{
|
||||
switch( param )
|
||||
switch (param)
|
||||
{
|
||||
case 1:
|
||||
hardmodeAvailable = false;
|
||||
@@ -209,18 +209,18 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if( !UpdateVictim() )
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if( !berserk && (me->GetPositionX() < 1720.0f || me->GetPositionX() > 1940.0f || me->GetPositionY() < 20.0f || me->GetPositionY() > 210.0f) )
|
||||
if (!berserk && (me->GetPositionX() < 1720.0f || me->GetPositionX() > 1940.0f || me->GetPositionY() < 20.0f || me->GetPositionY() > 210.0f))
|
||||
events.RescheduleEvent(EVENT_BERSERK, 1ms);
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
@@ -238,7 +238,7 @@ public:
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
{
|
||||
Player* temp = itr->GetSource();
|
||||
if( temp->IsAlive() && temp->GetDistance(me) > 15.0f )
|
||||
if (temp->IsAlive() && temp->GetDistance(me) > 15.0f )
|
||||
players.push_back(temp);
|
||||
}
|
||||
if (!players.empty())
|
||||
@@ -256,7 +256,7 @@ public:
|
||||
me->SetGuidValue(UNIT_FIELD_TARGET, me->GetVictim()->GetGUID());
|
||||
break;
|
||||
case EVENT_SPELL_SEARING_FLAMES:
|
||||
if(!me->HasAura(SPELL_SARONITE_BARRIER))
|
||||
if (!me->HasAura(SPELL_SARONITE_BARRIER))
|
||||
me->CastSpell(me->GetVictim(), SPELL_SEARING_FLAMES, false);
|
||||
events.Repeat(me->GetMap()->Is25ManRaid() ? 8s : 15s);
|
||||
break;
|
||||
@@ -273,19 +273,19 @@ public:
|
||||
std::vector<Player*> inside;
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* tmp = itr->GetSource() )
|
||||
if( tmp->IsAlive() )
|
||||
if (Player* tmp = itr->GetSource())
|
||||
if (tmp->IsAlive())
|
||||
{
|
||||
if( tmp->GetDistance(me) > 15.0f )
|
||||
if (tmp->GetDistance(me) > 15.0f )
|
||||
outside.push_back(tmp);
|
||||
else
|
||||
inside.push_back(tmp);
|
||||
}
|
||||
|
||||
Player* t = nullptr;
|
||||
if( outside.size() >= uint8(me->GetMap()->Is25ManRaid() ? 9 : 4) )
|
||||
if (outside.size() >= uint8(me->GetMap()->Is25ManRaid() ? 9 : 4))
|
||||
t = outside.at(urand(0, outside.size() - 1));
|
||||
else if( !inside.empty() )
|
||||
else if (!inside.empty())
|
||||
t = inside.at(urand(0, inside.size() - 1));
|
||||
|
||||
if (t)
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
vaporsCount++;
|
||||
me->CastSpell(me, SPELL_SUMMON_SARONITE_VAPORS, false);
|
||||
|
||||
if( vaporsCount < 6 || !hardmodeAvailable )
|
||||
if (vaporsCount < 6 || !hardmodeAvailable)
|
||||
events.Repeat(30s);
|
||||
else
|
||||
{
|
||||
@@ -321,7 +321,7 @@ public:
|
||||
if (summons.size())
|
||||
{
|
||||
Talk(SAY_EMOTE_ANIMUS);
|
||||
if( Creature* sv = ObjectAccessor::GetCreature(*me, *(summons.begin())) )
|
||||
if (Creature* sv = ObjectAccessor::GetCreature(*me, *(summons.begin())))
|
||||
sv->CastSpell(sv, SPELL_SARONITE_ANIMUS_FORMATION_VISUAL, true);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_SUMMON_SARONITE_ANIMUS, 2s);
|
||||
@@ -334,7 +334,7 @@ public:
|
||||
Talk(SAY_HARDMODE);
|
||||
Talk(SAY_EMOTE_BARRIER);
|
||||
me->CastSpell(me, SPELL_SARONITE_BARRIER, true);
|
||||
if( Creature* sv = ObjectAccessor::GetCreature(*me, *(summons.begin())) )
|
||||
if (Creature* sv = ObjectAccessor::GetCreature(*me, *(summons.begin())))
|
||||
sv->CastSpell(sv, SPELL_SUMMON_SARONITE_ANIMUS, true);
|
||||
|
||||
events.ScheduleEvent(EVENT_DESPAWN_SARONITE_VAPORS, 2500ms);
|
||||
@@ -357,8 +357,8 @@ public:
|
||||
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if( GameObject* door = me->FindNearestGameObject(GO_VEZAX_DOOR, 500.0f) )
|
||||
if( door->GetGoState() != GO_STATE_ACTIVE )
|
||||
if (GameObject* door = me->FindNearestGameObject(GO_VEZAX_DOOR, 500.0f))
|
||||
if (door->GetGoState() != GO_STATE_ACTIVE )
|
||||
{
|
||||
door->SetLootState(GO_READY);
|
||||
door->UseDoorOrButton(0, false);
|
||||
@@ -367,7 +367,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
{
|
||||
if( who->IsPlayer() )
|
||||
if (who->IsPlayer())
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
@@ -410,8 +410,8 @@ public:
|
||||
me->CastSpell(me, SPELL_SARONITE_VAPORS_AURA, true);
|
||||
|
||||
// killed saronite vapors, hard mode unavailable
|
||||
if( pInstance )
|
||||
if( Creature* vezax = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_VEZAX)) )
|
||||
if (pInstance)
|
||||
if (Creature* vezax = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_VEZAX)))
|
||||
vezax->AI()->DoAction(1);
|
||||
}
|
||||
|
||||
@@ -437,8 +437,8 @@ public:
|
||||
npc_ulduar_saronite_animusAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceScript();
|
||||
if( pInstance )
|
||||
if( Creature* vezax = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_VEZAX)) )
|
||||
if (pInstance)
|
||||
if (Creature* vezax = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_VEZAX)))
|
||||
vezax->AI()->JustSummoned(me);
|
||||
timer = 0;
|
||||
me->SetInCombatWithZone();
|
||||
@@ -451,8 +451,8 @@ public:
|
||||
{
|
||||
me->DespawnOrUnsummon(3000);
|
||||
|
||||
if( pInstance )
|
||||
if( Creature* vezax = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_VEZAX)) )
|
||||
if (pInstance)
|
||||
if (Creature* vezax = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_VEZAX)))
|
||||
vezax->AI()->DoAction(2);
|
||||
}
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ public:
|
||||
|
||||
void SmallIcicles(bool enable)
|
||||
{
|
||||
if( enable )
|
||||
if (enable)
|
||||
me->CastSpell(me, SPELL_ICICLE_BOSS_AURA, true);
|
||||
else
|
||||
me->RemoveAura(SPELL_ICICLE_BOSS_AURA);
|
||||
@@ -318,7 +318,7 @@ public:
|
||||
|
||||
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
|
||||
{
|
||||
switch( spell->Id )
|
||||
switch (spell->Id)
|
||||
{
|
||||
case SPELL_ICICLE_TBBA:
|
||||
me->CastSpell(target, SPELL_ICICLE_VISUAL_UNPACKED, true);
|
||||
@@ -360,9 +360,9 @@ public:
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
|
||||
if( GameObject* d = me->FindNearestGameObject(GO_HODIR_FROZEN_DOOR, 250.0f))
|
||||
if (GameObject* d = me->FindNearestGameObject(GO_HODIR_FROZEN_DOOR, 250.0f))
|
||||
{
|
||||
if( d->GetGoState() != GO_STATE_ACTIVE )
|
||||
if (d->GetGoState() != GO_STATE_ACTIVE )
|
||||
{
|
||||
d->SetLootState(GO_READY);
|
||||
d->UseDoorOrButton(0, false);
|
||||
@@ -370,7 +370,7 @@ public:
|
||||
}
|
||||
if (GameObject* d = me->FindNearestGameObject(GO_HODIR_DOOR, 250.0f))
|
||||
{
|
||||
if( d->GetGoState() != GO_STATE_ACTIVE )
|
||||
if (d->GetGoState() != GO_STATE_ACTIVE )
|
||||
{
|
||||
d->SetLootState(GO_READY);
|
||||
d->UseDoorOrButton(0, false);
|
||||
@@ -414,7 +414,7 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
@@ -518,7 +518,7 @@ public:
|
||||
void SpawnHelpers()
|
||||
{
|
||||
char faction = 'A';
|
||||
if( hhd[0][0].id )
|
||||
if (hhd[0][0].id)
|
||||
{
|
||||
Map::PlayerList const& cl = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = cl.begin(); itr != cl.end(); ++itr)
|
||||
@@ -530,25 +530,25 @@ public:
|
||||
}
|
||||
|
||||
uint8 cnt = 0;
|
||||
if( faction )
|
||||
if (faction)
|
||||
for( uint8 k = 0; k < 4; ++k )
|
||||
{
|
||||
if( (faction == 'A' && ( k > 1 || (k == 1 && RAID_MODE(1, 0)) )) ||
|
||||
(faction == 'H' && ( k < 2 || (k == 3 && RAID_MODE(1, 0)) )) )
|
||||
if ((faction == 'A' && ( k > 1 || (k == 1 && RAID_MODE(1, 0)))) ||
|
||||
(faction == 'H' && ( k < 2 || (k == 3 && RAID_MODE(1, 0)))))
|
||||
continue;
|
||||
|
||||
for( uint8 i = 0; i < 4; ++i )
|
||||
{
|
||||
if( !hhd[k][i].id )
|
||||
if (!hhd[k][i].id)
|
||||
continue;
|
||||
|
||||
if( Creature* h_p = me->SummonCreature(hhd[k][i].id, hhd[k][i].x, hhd[k][i].y, 432.69f, M_PI / 2) )
|
||||
if (Creature* h_p = me->SummonCreature(hhd[k][i].id, hhd[k][i].x, hhd[k][i].y, 432.69f, M_PI / 2))
|
||||
{
|
||||
h_p->SetFaction(1665);
|
||||
if( cnt < 8 )
|
||||
if (cnt < 8)
|
||||
Helpers[cnt++] = h_p->GetGUID();
|
||||
|
||||
if( Creature* c = h_p->SummonCreature(NPC_FLASH_FREEZE_NPC, h_p->GetPositionX(), h_p->GetPositionY(), h_p->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000) )
|
||||
if (Creature* c = h_p->SummonCreature(NPC_FLASH_FREEZE_NPC, h_p->GetPositionX(), h_p->GetPositionY(), h_p->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
|
||||
{
|
||||
c->CastSpell(h_p, SPELL_FLASH_FREEZE_TRAPPED_NPC, true);
|
||||
JustSummoned(c);
|
||||
@@ -644,7 +644,7 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if( timer1 <= diff )
|
||||
if (timer1 <= diff)
|
||||
{
|
||||
me->CastSpell(me, (me->GetEntry() == 33169 ? SPELL_ICICLE_FALL_EFFECT_UNPACKED : SPELL_ICICLE_FALL_EFFECT_PACKED), true);
|
||||
me->CastSpell(me, SPELL_ICICLE_VISUAL_FALLING, false);
|
||||
@@ -745,7 +745,7 @@ public:
|
||||
{
|
||||
if (a == 1)
|
||||
{
|
||||
if( GameObject* fire = me->FindNearestGameObject(194300, 1.0f) )
|
||||
if (GameObject* fire = me->FindNearestGameObject(194300, 1.0f))
|
||||
{
|
||||
fire->SetOwnerGUID(ObjectGuid::Empty);
|
||||
fire->Delete();
|
||||
@@ -756,7 +756,7 @@ public:
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
switch( spell->Id )
|
||||
switch (spell->Id)
|
||||
{
|
||||
case SPELL_ICE_SHARDS_SMALL:
|
||||
case SPELL_ICE_SHARDS_BIG:
|
||||
@@ -803,7 +803,7 @@ public:
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
if(spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
|
||||
if (spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_TRY_FREE_HELPER, 2s);
|
||||
@@ -814,19 +814,19 @@ public:
|
||||
{
|
||||
events.Update(diff);
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case EVENT_TRY_FREE_HELPER:
|
||||
{
|
||||
if( !me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC) )
|
||||
if( pInstance )
|
||||
if( ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR) )
|
||||
if( Creature* hodir = ObjectAccessor::GetCreature(*me, g) )
|
||||
if (!me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC))
|
||||
if (pInstance)
|
||||
if (ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR))
|
||||
if (Creature* hodir = ObjectAccessor::GetCreature(*me, g))
|
||||
{
|
||||
AttackStart(hodir);
|
||||
ScheduleAbilities();
|
||||
@@ -900,7 +900,7 @@ public:
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
if(spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
|
||||
if (spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_TRY_FREE_HELPER, 2s);
|
||||
@@ -911,19 +911,19 @@ public:
|
||||
{
|
||||
events.Update(diff);
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case EVENT_TRY_FREE_HELPER:
|
||||
{
|
||||
if( !me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC) )
|
||||
if( pInstance )
|
||||
if( ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR) )
|
||||
if( Creature* hodir = ObjectAccessor::GetCreature(*me, g) )
|
||||
if (!me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC))
|
||||
if (pInstance)
|
||||
if (ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR))
|
||||
if (Creature* hodir = ObjectAccessor::GetCreature(*me, g))
|
||||
{
|
||||
AttackStart(hodir);
|
||||
ScheduleAbilities();
|
||||
@@ -998,7 +998,7 @@ public:
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
if(spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
|
||||
if (spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_TRY_FREE_HELPER, 2s);
|
||||
@@ -1016,19 +1016,19 @@ public:
|
||||
{
|
||||
events.Update(diff);
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case EVENT_TRY_FREE_HELPER:
|
||||
{
|
||||
if( !me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC) )
|
||||
if( pInstance )
|
||||
if( ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR) )
|
||||
if( Creature* hodir = ObjectAccessor::GetCreature(*me, g) )
|
||||
if (!me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC))
|
||||
if (pInstance)
|
||||
if (ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR))
|
||||
if (Creature* hodir = ObjectAccessor::GetCreature(*me, g))
|
||||
{
|
||||
AttackStart(hodir);
|
||||
ScheduleAbilities();
|
||||
@@ -1100,7 +1100,7 @@ public:
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
if(spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
|
||||
if (spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_TRY_FREE_HELPER, 2s);
|
||||
@@ -1111,19 +1111,19 @@ public:
|
||||
{
|
||||
events.Update(diff);
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case EVENT_TRY_FREE_HELPER:
|
||||
{
|
||||
if( !me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC) )
|
||||
if( pInstance )
|
||||
if( ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR) )
|
||||
if( Creature* hodir = ObjectAccessor::GetCreature(*me, g) )
|
||||
if (!me->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC))
|
||||
if (pInstance)
|
||||
if (ObjectGuid g = pInstance->GetGuidData(TYPE_HODIR))
|
||||
if (Creature* hodir = ObjectAccessor::GetCreature(*me, g))
|
||||
{
|
||||
AttackStart(hodir);
|
||||
ScheduleAbilities();
|
||||
@@ -1147,14 +1147,14 @@ public:
|
||||
bool found = false;
|
||||
me->GetCreaturesWithEntryInRange(FB, 150.0f, NPC_FLASH_FREEZE_NPC);
|
||||
for( std::list<Creature*>::const_iterator itr = FB.begin(); itr != FB.end(); ++itr )
|
||||
if( !((*itr)->HasAura(SPELL_MAGE_MELT_ICE)) )
|
||||
if (!((*itr)->HasAura(SPELL_MAGE_MELT_ICE)))
|
||||
{
|
||||
me->CastSpell((*itr), SPELL_MAGE_MELT_ICE, false);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if( found )
|
||||
if (found)
|
||||
{
|
||||
events.DelayEvents(2s);
|
||||
events.Repeat(2s);
|
||||
@@ -1372,7 +1372,7 @@ class spell_hodir_flash_freeze_aura : public AuraScript
|
||||
if (target->IsPlayer())
|
||||
{
|
||||
caster->ToCreature()->AI()->SetData(1, 1);
|
||||
if( Creature* c = target->SummonCreature(NPC_FLASH_FREEZE_PLR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5 * 60 * 1000) )
|
||||
if (Creature* c = target->SummonCreature(NPC_FLASH_FREEZE_PLR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5 * 60 * 1000))
|
||||
{
|
||||
c->CastSpell(target, SPELL_FLASH_FREEZE_TRAPPED_PLAYER, true);
|
||||
caster->ToCreature()->AI()->JustSummoned(c);
|
||||
@@ -1380,7 +1380,7 @@ class spell_hodir_flash_freeze_aura : public AuraScript
|
||||
}
|
||||
else if (target->IsCreature())
|
||||
{
|
||||
if( Creature* c = target->SummonCreature(NPC_FLASH_FREEZE_NPC, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000) )
|
||||
if (Creature* c = target->SummonCreature(NPC_FLASH_FREEZE_NPC, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
|
||||
{
|
||||
c->CastSpell(target, SPELL_FLASH_FREEZE_TRAPPED_NPC, true);
|
||||
caster->ToCreature()->AI()->JustSummoned(c);
|
||||
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
|
||||
void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
||||
{
|
||||
if( damage >= RAID_MODE(3000U, 5000U) && me->GetAura(S_BRITTLE) )
|
||||
if (damage >= RAID_MODE(3000U, 5000U) && me->GetAura(S_BRITTLE))
|
||||
{
|
||||
me->CastSpell(me, SPELL_SHATTER, true);
|
||||
Unit::Kill(attacker, me);
|
||||
@@ -219,7 +219,7 @@ public:
|
||||
bShattered = false;
|
||||
lastShatterMSTime = 0;
|
||||
|
||||
if( InstanceScript* m_pInstance = me->GetInstanceScript() )
|
||||
if (InstanceScript* m_pInstance = me->GetInstanceScript())
|
||||
{
|
||||
m_pInstance->SetData(TYPE_IGNIS, NOT_STARTED);
|
||||
m_pInstance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_STOKIN_THE_FURNACE_EVENT);
|
||||
@@ -256,7 +256,7 @@ public:
|
||||
Talk(SAY_AGGRO);
|
||||
DoZoneInCombat();
|
||||
|
||||
if( InstanceScript* m_pInstance = me->GetInstanceScript() )
|
||||
if (InstanceScript* m_pInstance = me->GetInstanceScript())
|
||||
{
|
||||
m_pInstance->SetData(TYPE_IGNIS, IN_PROGRESS);
|
||||
m_pInstance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_STOKIN_THE_FURNACE_EVENT);
|
||||
@@ -298,7 +298,7 @@ public:
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if( me->GetInstanceScript() )
|
||||
if (me->GetInstanceScript())
|
||||
me->GetInstanceScript()->SetData(TYPE_IGNIS, DONE);
|
||||
|
||||
std::list<Creature*> icl;
|
||||
@@ -324,7 +324,7 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if( me->GetPositionX() < 490.0f || me->GetPositionX() > 690.0f || me->GetPositionY() < 130.0f || me->GetPositionY() > 410.0f )
|
||||
if (me->GetPositionX() < 490.0f || me->GetPositionX() > 690.0f || me->GetPositionY() < 130.0f || me->GetPositionY() > 410.0f )
|
||||
{
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
@@ -380,9 +380,9 @@ public:
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
{
|
||||
temp = itr->GetSource();
|
||||
if( !temp->IsAlive() || temp->GetExactDist2d(me) > 90.0f )
|
||||
if (!temp->IsAlive() || temp->GetExactDist2d(me) > 90.0f )
|
||||
continue;
|
||||
if( me->GetVictim() && temp->GetGUID() == me->GetVictim()->GetGUID() )
|
||||
if (me->GetVictim() && temp->GetGUID() == me->GetVictim()->GetGUID())
|
||||
continue;
|
||||
bool found = false;
|
||||
for (std::list<Creature*>::iterator iterator = icl.begin(); iterator != icl.end(); ++iterator)
|
||||
@@ -394,14 +394,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if( !found )
|
||||
if (!found)
|
||||
playerGUIDs.push_back(temp->GetGUID());
|
||||
}
|
||||
|
||||
if( !playerGUIDs.empty() )
|
||||
if (!playerGUIDs.empty())
|
||||
{
|
||||
int8 pos = urand(0, playerGUIDs.size() - 1);
|
||||
if( Player* pTarget = ObjectAccessor::GetPlayer(*me, playerGUIDs.at(pos)) )
|
||||
if (Player* pTarget = ObjectAccessor::GetPlayer(*me, playerGUIDs.at(pos)))
|
||||
{
|
||||
Talk(SAY_SLAG_POT);
|
||||
me->CastSpell(pTarget, SPELL_GRAB, false);
|
||||
|
||||
@@ -573,7 +573,7 @@ public:
|
||||
{
|
||||
float x, y, z;
|
||||
// left arm
|
||||
if( me->GetEntry() == NPC_LEFT_ARM )
|
||||
if (me->GetEntry() == NPC_LEFT_ARM )
|
||||
{
|
||||
x = 1776.97f;
|
||||
y = -44.8396f;
|
||||
|
||||
@@ -417,16 +417,16 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case EVENT_COMPUTER_SAY_INITIATED:
|
||||
if( Creature* computer = me->SummonCreature(NPC_COMPUTER, 2746.7f, 2569.44f, 410.39f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000) )
|
||||
if (Creature* computer = me->SummonCreature(NPC_COMPUTER, 2746.7f, 2569.44f, 410.39f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
|
||||
computer->AI()->Talk(TALK_COMPUTER_INITIATED);
|
||||
break;
|
||||
case EVENT_COMPUTER_SAY_MINUTES:
|
||||
if( Creature* computer = me->SummonCreature(NPC_COMPUTER, 2746.7f, 2569.44f, 410.39f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000) )
|
||||
if (Creature* computer = me->SummonCreature(NPC_COMPUTER, 2746.7f, 2569.44f, 410.39f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
|
||||
computer->AI()->Talk(minutesTalkNum++);
|
||||
break;
|
||||
case EVENT_MIMIRON_SAY_HARDMODE:
|
||||
@@ -442,12 +442,12 @@ public:
|
||||
std::vector<Player*> pg;
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* plr = itr->GetSource() )
|
||||
if( plr->IsAlive() && plr->GetExactDist2d(me) < 150.0f && !plr->IsGameMaster() )
|
||||
if (Player* plr = itr->GetSource())
|
||||
if (plr->IsAlive() && plr->GetExactDist2d(me) < 150.0f && !plr->IsGameMaster())
|
||||
pg.push_back(plr);
|
||||
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( !pg.empty() )
|
||||
if (!pg.empty())
|
||||
{
|
||||
uint8 index = urand(0, pg.size() - 1);
|
||||
Player* player = pg[index];
|
||||
@@ -467,7 +467,7 @@ public:
|
||||
case EVENT_BERSERK:
|
||||
berserk = true;
|
||||
Talk(SAY_BERSERK);
|
||||
if( hardmode )
|
||||
if (hardmode)
|
||||
me->SummonCreature(33576, 2744.78f, 2569.47f, 364.32f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 120000);
|
||||
events.ScheduleEvent(EVENT_BERSERK_2, 0ms);
|
||||
break;
|
||||
@@ -486,7 +486,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case EVENT_SIT_LMK2:
|
||||
if(Creature* LMK2 = GetLMK2())
|
||||
if (Creature* LMK2 = GetLMK2())
|
||||
{
|
||||
me->EnterVehicle(LMK2, 6);
|
||||
events.ScheduleEvent(EVENT_SIT_LMK2_INTERVAL, 2s);
|
||||
@@ -500,8 +500,8 @@ public:
|
||||
if (hardmode)
|
||||
{
|
||||
LMK2->CastSpell(LMK2, SPELL_EMERGENCY_MODE, true);
|
||||
if( Vehicle* veh = LMK2->GetVehicleKit() )
|
||||
if( Unit* cannon = veh->GetPassenger(3) )
|
||||
if (Vehicle* veh = LMK2->GetVehicleKit())
|
||||
if (Unit* cannon = veh->GetPassenger(3))
|
||||
cannon->CastSpell(cannon, SPELL_EMERGENCY_MODE, true);
|
||||
}
|
||||
LMK2->AI()->SetData(1, 1);
|
||||
@@ -521,7 +521,7 @@ public:
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
break;
|
||||
case EVENT_ELEVATOR_INTERVAL_0:
|
||||
if( GameObject* elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 100.0f) )
|
||||
if (GameObject* elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 100.0f))
|
||||
{
|
||||
elevator->SetLootState(GO_READY);
|
||||
elevator->UseDoorOrButton(0, false);
|
||||
@@ -530,9 +530,9 @@ public:
|
||||
events.ScheduleEvent(EVENT_ELEVATOR_INTERVAL_1, 6s);
|
||||
break;
|
||||
case EVENT_ELEVATOR_INTERVAL_1:
|
||||
if(me->SummonCreature(NPC_VX001, 2744.65f, 2569.46f, 364.40f, 3.14f, TEMPSUMMON_MANUAL_DESPAWN))
|
||||
if (me->SummonCreature(NPC_VX001, 2744.65f, 2569.46f, 364.40f, 3.14f, TEMPSUMMON_MANUAL_DESPAWN))
|
||||
{
|
||||
if( GameObject* elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 100.0f) )
|
||||
if (GameObject* elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 100.0f))
|
||||
{
|
||||
elevator->SetLootState(GO_READY);
|
||||
elevator->UseDoorOrButton(0, true);
|
||||
@@ -557,7 +557,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_ENTER_VX001, 5s);
|
||||
break;
|
||||
case EVENT_ENTER_VX001:
|
||||
if( Creature* VX001 = GetVX001() )
|
||||
if (Creature* VX001 = GetVX001())
|
||||
{
|
||||
me->EnterVehicle(VX001, 1);
|
||||
events.ScheduleEvent(EVENT_EMOTE_VX001, 2s);
|
||||
@@ -566,7 +566,7 @@ public:
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
break;
|
||||
case EVENT_EMOTE_VX001:
|
||||
if( Creature* VX001 = GetVX001() )
|
||||
if (Creature* VX001 = GetVX001())
|
||||
{
|
||||
VX001->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
|
||||
events.ScheduleEvent(EVENT_VX001_START_FIGHT, 1750ms);
|
||||
@@ -575,9 +575,9 @@ public:
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
break;
|
||||
case EVENT_VX001_START_FIGHT:
|
||||
if( Creature* VX001 = GetVX001() )
|
||||
if (Creature* VX001 = GetVX001())
|
||||
{
|
||||
if( hardmode )
|
||||
if (hardmode)
|
||||
VX001->CastSpell(VX001, SPELL_EMERGENCY_MODE, true);
|
||||
VX001->AI()->SetData(1, 2);
|
||||
me->SetInCombatWithZone();
|
||||
@@ -586,7 +586,7 @@ public:
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
break;
|
||||
case EVENT_VX001_EMOTESTATE_DEATH:
|
||||
if( Creature* VX001 = GetVX001() )
|
||||
if (Creature* VX001 = GetVX001())
|
||||
{
|
||||
VX001->HandleEmoteCommand(EMOTE_STATE_DROWNED);
|
||||
VX001->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DROWNED);
|
||||
@@ -596,8 +596,8 @@ public:
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
break;
|
||||
case EVENT_GET_OUT_VX001:
|
||||
if( Creature* VX001 = GetVX001() )
|
||||
if( Creature* ACU = me->SummonCreature(NPC_AERIAL_COMMAND_UNIT, 2743.91f, 2568.78f, 391.34f, M_PI, TEMPSUMMON_MANUAL_DESPAWN) )
|
||||
if (Creature* VX001 = GetVX001())
|
||||
if (Creature* ACU = me->SummonCreature(NPC_AERIAL_COMMAND_UNIT, 2743.91f, 2568.78f, 391.34f, M_PI, TEMPSUMMON_MANUAL_DESPAWN))
|
||||
{
|
||||
me->EnterVehicle(VX001, 4);
|
||||
float speed = ACU->GetDistance(2737.75f, 2574.22f, 381.34f) / 2.0f;
|
||||
@@ -614,7 +614,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_ENTER_ACU, 7s);
|
||||
break;
|
||||
case EVENT_ENTER_ACU:
|
||||
if( Creature* ACU = GetACU() )
|
||||
if (Creature* ACU = GetACU())
|
||||
{
|
||||
me->EnterVehicle(ACU, 0);
|
||||
events.ScheduleEvent(EVENT_SAY_ACU_ACTIVATE, 6s);
|
||||
@@ -627,9 +627,9 @@ public:
|
||||
events.ScheduleEvent(EVENT_ACU_START_ATTACK, 4s);
|
||||
break;
|
||||
case EVENT_ACU_START_ATTACK:
|
||||
if( Creature* ACU = GetACU() )
|
||||
if (Creature* ACU = GetACU())
|
||||
{
|
||||
if( hardmode )
|
||||
if (hardmode)
|
||||
ACU->CastSpell(ACU, SPELL_EMERGENCY_MODE, true);
|
||||
ACU->AI()->SetData(1, 3);
|
||||
me->SetInCombatWithZone();
|
||||
@@ -654,7 +654,7 @@ public:
|
||||
{
|
||||
Creature* LMK2 = GetLMK2();
|
||||
Creature* VX001 = GetVX001();
|
||||
if( !VX001 || !LMK2 )
|
||||
if (!VX001 || !LMK2)
|
||||
{
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
@@ -670,7 +670,7 @@ public:
|
||||
{
|
||||
Creature* VX001 = GetVX001();
|
||||
Creature* LMK2 = GetLMK2();
|
||||
if( !VX001 || !LMK2 )
|
||||
if (!VX001 || !LMK2)
|
||||
{
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
@@ -687,7 +687,7 @@ public:
|
||||
{
|
||||
Creature* ACU = GetACU();
|
||||
Creature* VX001 = GetVX001();
|
||||
if( !VX001 || !ACU )
|
||||
if (!VX001 || !ACU)
|
||||
{
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
@@ -705,7 +705,7 @@ public:
|
||||
Creature* VX001 = GetVX001();
|
||||
Creature* LMK2 = GetLMK2();
|
||||
Creature* ACU = GetACU();
|
||||
if( !VX001 || !LMK2 || !ACU )
|
||||
if (!VX001 || !LMK2 || !ACU)
|
||||
{
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return;
|
||||
@@ -717,7 +717,7 @@ public:
|
||||
LMK2->CastSpell(LMK2, SPELL_SELF_REPAIR, true); //LMK2->SetHealth( LMK2->GetMaxHealth()/2 );
|
||||
VX001->CastSpell(VX001, SPELL_SELF_REPAIR, true); //VX001->SetHealth( VX001->GetMaxHealth()/2 );
|
||||
ACU->CastSpell(ACU, SPELL_SELF_REPAIR, true); //ACU->SetHealth( ACU->GetMaxHealth()/2 );
|
||||
if( hardmode )
|
||||
if (hardmode)
|
||||
{
|
||||
LMK2->CastSpell(LMK2, SPELL_EMERGENCY_MODE, true);
|
||||
VX001->CastSpell(VX001, SPELL_EMERGENCY_MODE, true);
|
||||
@@ -770,11 +770,11 @@ public:
|
||||
|
||||
DoCastSelf(SPELL_SLEEP_VISUAL_1);
|
||||
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
for( uint16 i = 0; i < 3; ++i )
|
||||
if( ObjectGuid guid = pInstance->GetGuidData(DATA_GO_MIMIRON_DOOR_1 + i) )
|
||||
if( GameObject* door = ObjectAccessor::GetGameObject(*me, guid) )
|
||||
if( door->GetGoState() != GO_STATE_ACTIVE )
|
||||
if (ObjectGuid guid = pInstance->GetGuidData(DATA_GO_MIMIRON_DOOR_1 + i))
|
||||
if (GameObject* door = ObjectAccessor::GetGameObject(*me, guid))
|
||||
if (door->GetGoState() != GO_STATE_ACTIVE )
|
||||
{
|
||||
door->SetLootState(GO_READY);
|
||||
door->UseDoorOrButton(0, false);
|
||||
@@ -784,7 +784,7 @@ public:
|
||||
pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, NPC_LEVIATHAN_MKII, 1, me);
|
||||
|
||||
if (hardmode)
|
||||
if( Creature* computer = me->SummonCreature(NPC_COMPUTER, 2746.7f, 2569.44f, 410.39f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000) )
|
||||
if (Creature* computer = me->SummonCreature(NPC_COMPUTER, 2746.7f, 2569.44f, 410.39f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
|
||||
computer->AI()->Talk(TALK_COMPUTER_TERMINATED);
|
||||
|
||||
events.Reset();
|
||||
@@ -873,19 +873,19 @@ public:
|
||||
|
||||
void ResetGameObjects()
|
||||
{
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
for( uint16 i = 0; i < 3; ++i )
|
||||
if( ObjectGuid guid = pInstance->GetGuidData(DATA_GO_MIMIRON_DOOR_1 + i) )
|
||||
if( GameObject* door = ObjectAccessor::GetGameObject(*me, guid) )
|
||||
if( door->GetGoState() != GO_STATE_ACTIVE )
|
||||
if (ObjectGuid guid = pInstance->GetGuidData(DATA_GO_MIMIRON_DOOR_1 + i))
|
||||
if (GameObject* door = ObjectAccessor::GetGameObject(*me, guid))
|
||||
if (door->GetGoState() != GO_STATE_ACTIVE )
|
||||
{
|
||||
door->SetLootState(GO_READY);
|
||||
door->UseDoorOrButton(0, false);
|
||||
}
|
||||
|
||||
if( GameObject* elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 200.0f) )
|
||||
if (GameObject* elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 200.0f))
|
||||
{
|
||||
if( elevator->GetGoState() != GO_STATE_ACTIVE )
|
||||
if (elevator->GetGoState() != GO_STATE_ACTIVE )
|
||||
{
|
||||
elevator->SetLootState(GO_READY);
|
||||
elevator->SetByteValue(GAMEOBJECT_BYTES_1, 0, GO_STATE_ACTIVE);
|
||||
@@ -893,8 +893,8 @@ public:
|
||||
elevator->EnableCollision(false);
|
||||
}
|
||||
|
||||
if( GameObject* button = me->FindNearestGameObject(GO_BUTTON, 200.0f) )
|
||||
if( button->GetGoState() != GO_STATE_READY )
|
||||
if (GameObject* button = me->FindNearestGameObject(GO_BUTTON, 200.0f))
|
||||
if (button->GetGoState() != GO_STATE_READY )
|
||||
{
|
||||
button->SetLootState(GO_READY);
|
||||
button->UseDoorOrButton(0, false);
|
||||
@@ -904,18 +904,18 @@ public:
|
||||
|
||||
void CloseDoorAndButton()
|
||||
{
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
for( uint16 i = 0; i < 3; ++i )
|
||||
if( ObjectGuid guid = pInstance->GetGuidData(DATA_GO_MIMIRON_DOOR_1 + i) )
|
||||
if( GameObject* door = ObjectAccessor::GetGameObject(*me, guid) )
|
||||
if( door->GetGoState() != GO_STATE_READY )
|
||||
if (ObjectGuid guid = pInstance->GetGuidData(DATA_GO_MIMIRON_DOOR_1 + i))
|
||||
if (GameObject* door = ObjectAccessor::GetGameObject(*me, guid))
|
||||
if (door->GetGoState() != GO_STATE_READY )
|
||||
{
|
||||
door->SetLootState(GO_READY);
|
||||
door->UseDoorOrButton(0, false);
|
||||
}
|
||||
|
||||
if( GameObject* button = me->FindNearestGameObject(GO_BUTTON, 200.0f) )
|
||||
if( button->GetGoState() != GO_STATE_ACTIVE )
|
||||
if (GameObject* button = me->FindNearestGameObject(GO_BUTTON, 200.0f))
|
||||
if (button->GetGoState() != GO_STATE_ACTIVE )
|
||||
{
|
||||
button->SetLootState(GO_READY);
|
||||
button->UseDoorOrButton(0, false);
|
||||
@@ -1143,7 +1143,7 @@ public:
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if (Player* plr = itr->GetSource())
|
||||
if( plr->IsAlive() && plr->GetDistance2d(me) > 15.0f )
|
||||
if (plr->IsAlive() && plr->GetDistance2d(me) > 15.0f )
|
||||
pList.push_back(plr);
|
||||
|
||||
if (!pList.empty())
|
||||
@@ -1151,7 +1151,7 @@ public:
|
||||
else
|
||||
pTarget = (Player*)SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true);
|
||||
|
||||
if( pTarget )
|
||||
if (pTarget)
|
||||
cannon->CastSpell(pTarget, SPELL_NAPALM_SHELL, false);
|
||||
|
||||
events.Repeat(14s);
|
||||
@@ -1236,7 +1236,7 @@ public:
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
if( spell->Id == SPELL_SELF_REPAIR )
|
||||
if (spell->Id == SPELL_SELF_REPAIR)
|
||||
{
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
@@ -1339,7 +1339,7 @@ public:
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
if (action == 1337)
|
||||
if( Vehicle* vk = me->GetVehicleKit() )
|
||||
if (Vehicle* vk = me->GetVehicleKit())
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
if (Unit* r = vk->GetPassenger(5 + i))
|
||||
if (r->IsCreature())
|
||||
@@ -1422,15 +1422,15 @@ public:
|
||||
events.Repeat(10s);
|
||||
break;
|
||||
case EVENT_SPELL_ROCKET_STRIKE:
|
||||
if( Vehicle* vk = me->GetVehicleKit() )
|
||||
if (Vehicle* vk = me->GetVehicleKit())
|
||||
{
|
||||
for( int i = 0; i < (Phase / 2); ++i )
|
||||
{
|
||||
uint8 index = (Phase == 2 ? rand() % 2 : i);
|
||||
if( Unit* r = vk->GetPassenger(5 + index) )
|
||||
if (Unit* r = vk->GetPassenger(5 + index))
|
||||
if (Player* temp = SelectTargetFromPlayerList(100.0f))
|
||||
{
|
||||
if( Creature* trigger = me->SummonCreature(NPC_ROCKET_STRIKE_N, temp->GetPositionX(), temp->GetPositionY(), temp->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 6000) )
|
||||
if (Creature* trigger = me->SummonCreature(NPC_ROCKET_STRIKE_N, temp->GetPositionX(), temp->GetPositionY(), temp->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 6000))
|
||||
trigger->CastSpell(trigger, SPELL_ROCKET_STRIKE_AURA, true);
|
||||
Position exitPos = r->GetPosition();
|
||||
exitPos.m_positionX += cos(me->GetOrientation()) * 2.35f;
|
||||
@@ -1473,7 +1473,7 @@ public:
|
||||
vb->SendMeleeAttackStop();
|
||||
vb->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
|
||||
|
||||
if( !leftarm )
|
||||
if (!leftarm)
|
||||
{
|
||||
vb->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_03);
|
||||
me->CastSpell(p, SPELL_HAND_PULSE_R, false);
|
||||
@@ -1560,7 +1560,7 @@ public:
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
if( spell->Id == SPELL_SELF_REPAIR )
|
||||
if (spell->Id == SPELL_SELF_REPAIR)
|
||||
{
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
@@ -1715,12 +1715,12 @@ public:
|
||||
return;
|
||||
|
||||
// following :D
|
||||
if( Phase == 3 && !immobilized )
|
||||
if( Unit* victim = me->GetVictim() )
|
||||
if( me->GetExactDist2d(victim) > 25.0f )
|
||||
if (Phase == 3 && !immobilized)
|
||||
if (Unit* victim = me->GetVictim())
|
||||
if (me->GetExactDist2d(victim) > 25.0f )
|
||||
{
|
||||
float angle = victim->GetAngle(me->GetPositionX(), me->GetPositionY());
|
||||
me->SetOrientation( me->GetAngle(victim->GetPositionX(), victim->GetPositionY()) );
|
||||
me->SetOrientation( me->GetAngle(victim->GetPositionX(), victim->GetPositionY()));
|
||||
float x = victim->GetPositionX() + 15.0f * cos(angle);
|
||||
float y = victim->GetPositionY() + 15.0f * std::sin(angle);
|
||||
|
||||
@@ -1759,11 +1759,11 @@ public:
|
||||
case 0:
|
||||
break;
|
||||
case EVENT_SPELL_PLASMA_BALL:
|
||||
if( !immobilized )
|
||||
if (!immobilized)
|
||||
{
|
||||
if (Phase == 3)
|
||||
{
|
||||
if( Unit* victim = me->GetVictim() )
|
||||
if (Unit* victim = me->GetVictim())
|
||||
me->CastSpell(victim, SPELL_PLASMA_BALL, false);
|
||||
}
|
||||
else
|
||||
@@ -1778,18 +1778,18 @@ public:
|
||||
events.Repeat(3s);
|
||||
break;
|
||||
case EVENT_SUMMON_BOMB_BOT:
|
||||
if( !immobilized )
|
||||
if (!immobilized)
|
||||
me->CastSpell(me, SPELL_SUMMON_BOMB_BOT, false);
|
||||
events.Repeat(15s);
|
||||
break;
|
||||
case EVENT_SUMMON_ASSAULT_BOT:
|
||||
if( GameObject* pad = me->FindNearestGameObject(RAND(194742, 194746, 194745), 200.0f) )
|
||||
if (GameObject* pad = me->FindNearestGameObject(RAND(194742, 194746, 194745), 200.0f))
|
||||
if (Creature* trigger = me->SummonCreature(NPC_BOT_SUMMON_TRIGGER, *pad, TEMPSUMMON_TIMED_DESPAWN, 15000))
|
||||
trigger->AI()->DoAction(2);
|
||||
events.Repeat(30s);
|
||||
break;
|
||||
case EVENT_SUMMON_JUNK_BOT:
|
||||
if( GameObject* pad = me->FindNearestGameObject(RAND(194741, 194744, 194747), 200.0f) )
|
||||
if (GameObject* pad = me->FindNearestGameObject(RAND(194741, 194744, 194747), 200.0f))
|
||||
if (Creature* trigger = me->SummonCreature(NPC_BOT_SUMMON_TRIGGER, *pad, TEMPSUMMON_TIMED_DESPAWN, 15000))
|
||||
trigger->AI()->DoAction(1);
|
||||
events.Repeat(10s);
|
||||
@@ -1798,7 +1798,7 @@ public:
|
||||
{
|
||||
uint32 ids[3] = {194740, 194743, 194748};
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( GameObject* pad = me->FindNearestGameObject(ids[i], 200.0f) )
|
||||
if (GameObject* pad = me->FindNearestGameObject(ids[i], 200.0f))
|
||||
if (Creature* trigger = me->SummonCreature(NPC_BOT_SUMMON_TRIGGER, *pad, TEMPSUMMON_MANUAL_DESPAWN))
|
||||
trigger->AI()->DoAction(3);
|
||||
events.Repeat(45s);
|
||||
@@ -1871,7 +1871,7 @@ public:
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
if( spell->Id == SPELL_SELF_REPAIR )
|
||||
if (spell->Id == SPELL_SELF_REPAIR)
|
||||
{
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
@@ -2062,7 +2062,7 @@ public:
|
||||
|
||||
void DoAction(int32 param) override
|
||||
{
|
||||
switch( param )
|
||||
switch (param)
|
||||
{
|
||||
case 1:
|
||||
me->CastSpell(me, SPELL_BEAM_GREEN, true);
|
||||
@@ -2081,14 +2081,14 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if( timer <= diff )
|
||||
if (timer <= diff)
|
||||
{
|
||||
uint32 option_npcid[3] = {NPC_JUNK_BOT, NPC_ASSAULT_BOT, NPC_EMERGENCY_FIRE_BOT};
|
||||
InstanceScript* pInstance = me->GetInstanceScript();
|
||||
if (Creature* ACU = GetACU()) // ACU summons for easy removing
|
||||
if( Creature* bot = ACU->SummonCreature( option_npcid[option - 1], *me, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000 ) )
|
||||
if (Creature* bot = ACU->SummonCreature( option_npcid[option - 1], *me, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000))
|
||||
{
|
||||
if( option < 3 )
|
||||
if (option < 3)
|
||||
bot->SetInCombatWithZone();
|
||||
if (Creature* m = GetMimiron())
|
||||
if (m->AI()->GetData(1)) // hardmode
|
||||
@@ -2190,12 +2190,12 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go) override
|
||||
{
|
||||
if(!player || !go)
|
||||
if (!player || !go)
|
||||
return true;
|
||||
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
{
|
||||
if(instance->GetData(TYPE_MIMIRON) != NOT_STARTED)
|
||||
if (instance->GetData(TYPE_MIMIRON) != NOT_STARTED)
|
||||
return false;
|
||||
|
||||
if (Creature* c = ObjectAccessor::GetCreature(*go, instance->GetGuidData(TYPE_MIMIRON)))
|
||||
@@ -2226,7 +2226,7 @@ public:
|
||||
CreateTime = GameTime::GetGameTime().count();
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_FLAMES_SPREAD, 5750ms);
|
||||
if( Creature* flame = me->SummonCreature(NPC_FLAMES_SPREAD, me->GetPositionX(), me->GetPositionY(), 364.32f, 0.0f) )
|
||||
if (Creature* flame = me->SummonCreature(NPC_FLAMES_SPREAD, me->GetPositionX(), me->GetPositionY(), 364.32f, 0.0f))
|
||||
{
|
||||
FlameList.push_back(flame->GetGUID());
|
||||
flame->CastSpell(flame, SPELL_FLAMES_AURA, true);
|
||||
@@ -2245,7 +2245,7 @@ public:
|
||||
|
||||
void SpreadFlame(float x, float y)
|
||||
{
|
||||
if( Creature* flame = me->SummonCreature(NPC_FLAMES_SPREAD, x, y, 364.32f, 0.0f) )
|
||||
if (Creature* flame = me->SummonCreature(NPC_FLAMES_SPREAD, x, y, 364.32f, 0.0f))
|
||||
{
|
||||
FlameList.push_back(flame->GetGUID());
|
||||
if (Creature* c = me->FindNearestCreature(NPC_FLAMES_SPREAD, 10.0f))
|
||||
@@ -2280,13 +2280,13 @@ public:
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case EVENT_FLAMES_SPREAD:
|
||||
{
|
||||
if( FlameList.empty() )
|
||||
if (FlameList.empty())
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
@@ -2300,15 +2300,15 @@ public:
|
||||
}
|
||||
|
||||
Creature* last = ObjectAccessor::GetCreature(*me, FlameList.back());
|
||||
if( last )
|
||||
if (last)
|
||||
{
|
||||
float prevdist = 100.0f;
|
||||
Player* target = nullptr;
|
||||
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* plr = itr->GetSource() )
|
||||
if( plr->IsAlive() && plr->GetExactDist2d(last) < prevdist && !plr->IsGameMaster() )
|
||||
if (Player* plr = itr->GetSource())
|
||||
if (plr->IsAlive() && plr->GetExactDist2d(last) < prevdist && !plr->IsGameMaster())
|
||||
{
|
||||
target = plr;
|
||||
prevdist = plr->GetExactDist2d(last);
|
||||
@@ -2345,7 +2345,7 @@ public:
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
switch( spell->Id )
|
||||
switch (spell->Id)
|
||||
{
|
||||
case SPELL_FROST_BOMB_EXPLOSION_10:
|
||||
case SPELL_FROST_BOMB_EXPLOSION_25:
|
||||
@@ -2403,7 +2403,7 @@ public:
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
events.Update(diff);
|
||||
switch( events.ExecuteEvent() )
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
|
||||
@@ -197,7 +197,7 @@ public:
|
||||
bGroundPhase = false;
|
||||
flyTimes = 0;
|
||||
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_RAZORSCALE, NOT_STARTED);
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ public:
|
||||
uint8 i = 0;
|
||||
for( std::list<Creature*>::iterator itr = eeList.begin(); itr != eeList.end(); ++itr )
|
||||
{
|
||||
if( i > 2 )
|
||||
if (i > 2)
|
||||
break;
|
||||
ExpeditionEngineerGUIDs[i] = (*itr)->GetGUID();
|
||||
if (!i)
|
||||
@@ -233,7 +233,7 @@ public:
|
||||
if (Creature* c = me->FindNearestCreature(NPC_EXPEDITION_COMMANDER, 300.0f, true))
|
||||
CommanderGUID = c->GetGUID();
|
||||
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_RAZORSCALE, IN_PROGRESS);
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ public:
|
||||
{
|
||||
summons.DespawnAll();
|
||||
|
||||
if( pInstance )
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_RAZORSCALE, DONE);
|
||||
}
|
||||
|
||||
@@ -278,18 +278,18 @@ public:
|
||||
case SPELL_CHAIN_4:
|
||||
{
|
||||
uint8 count = 0;
|
||||
if( me->HasAura(SPELL_CHAIN_1) )
|
||||
if (me->HasAura(SPELL_CHAIN_1))
|
||||
count++;
|
||||
if( me->HasAura(SPELL_CHAIN_3) )
|
||||
if (me->HasAura(SPELL_CHAIN_3))
|
||||
count++;
|
||||
if (RAID_MODE(0, 1))
|
||||
{
|
||||
if( me->HasAura(SPELL_CHAIN_2) )
|
||||
if (me->HasAura(SPELL_CHAIN_2))
|
||||
count++;
|
||||
if( me->HasAura(SPELL_CHAIN_4) )
|
||||
if (me->HasAura(SPELL_CHAIN_4))
|
||||
count++;
|
||||
}
|
||||
if( count >= REQ_CHAIN_COUNT )
|
||||
if (count >= REQ_CHAIN_COUNT)
|
||||
{
|
||||
if (Creature* commander = ObjectAccessor::GetCreature(*me, CommanderGUID))
|
||||
commander->AI()->Talk(SAY_COMMANDER_GROUND_PHASE);
|
||||
@@ -397,25 +397,25 @@ public:
|
||||
}
|
||||
break;
|
||||
case EVENT_SPELL_FIREBALL:
|
||||
if( Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, true) )
|
||||
if (Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, true))
|
||||
me->CastSpell(pTarget, SPELL_FIREBALL, false);
|
||||
events.Repeat(4s);
|
||||
break;
|
||||
case EVENT_SPELL_DEVOURING_FLAME:
|
||||
if( Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, true) )
|
||||
if (Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, true))
|
||||
me->CastSpell(pTarget, SPELL_DEVOURINGFLAME, false);
|
||||
events.Repeat(13s);
|
||||
break;
|
||||
case EVENT_SUMMON_MOLE_MACHINES:
|
||||
{
|
||||
memset(cords, '\0', sizeof(cords));
|
||||
uint8 num = RAID_MODE( urand(2, 3), urand(2, 4) );
|
||||
uint8 num = RAID_MODE( urand(2, 3), urand(2, 4));
|
||||
for( int i = 0; i < num; ++i )
|
||||
{
|
||||
// X: (550, 625) Y: (-185, -230)
|
||||
cords[i][0] = urand(550, 625);
|
||||
cords[i][1] = -230 + rand() % 45;
|
||||
if( GameObject* drill = me->SummonGameObject(GO_DRILL, cords[i][0], cords[i][1], 391.1f, M_PI / 4, 0.0f, 0.0f, 0.0f, 0.0f, 8) )
|
||||
if (GameObject* drill = me->SummonGameObject(GO_DRILL, cords[i][0], cords[i][1], 391.1f, M_PI / 4, 0.0f, 0.0f, 0.0f, 0.0f, 8))
|
||||
{
|
||||
//drill->SetGoAnimProgress(0);
|
||||
//drill->SetLootState(GO_READY);
|
||||
@@ -432,13 +432,13 @@ public:
|
||||
case EVENT_SUMMON_ADDS:
|
||||
for( int i = 0; i < 4; ++i )
|
||||
{
|
||||
if( !cords[i][0] )
|
||||
if (!cords[i][0])
|
||||
break;
|
||||
|
||||
uint8 opt;
|
||||
uint8 r = urand(1, 100);
|
||||
if( r <= 30 ) opt = 1;
|
||||
else if( r <= 65 ) opt = 2;
|
||||
if (r <= 30) opt = 1;
|
||||
else if (r <= 65) opt = 2;
|
||||
else opt = 3;
|
||||
|
||||
for( int j = 0; j < 4; ++j )
|
||||
@@ -447,13 +447,13 @@ public:
|
||||
float y = cords[i][1] + 4.0f * std::sin(j * M_PI / 2);
|
||||
|
||||
uint32 npc_entry = 0;
|
||||
switch( opt )
|
||||
switch (opt)
|
||||
{
|
||||
case 1:
|
||||
if( j == 1 ) npc_entry = NPC_DARK_RUNE_SENTINEL;
|
||||
if (j == 1) npc_entry = NPC_DARK_RUNE_SENTINEL;
|
||||
break;
|
||||
case 2:
|
||||
switch( j )
|
||||
switch (j)
|
||||
{
|
||||
case 1:
|
||||
npc_entry = NPC_DARK_RUNE_WATCHER;
|
||||
@@ -464,7 +464,7 @@ public:
|
||||
}
|
||||
break;
|
||||
default: // case 3:
|
||||
switch( j )
|
||||
switch (j)
|
||||
{
|
||||
case 1:
|
||||
npc_entry = NPC_DARK_RUNE_WATCHER;
|
||||
@@ -479,7 +479,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
if( npc_entry )
|
||||
if (npc_entry)
|
||||
if (Creature* c = me->SummonCreature(npc_entry, x, y, 391.1f, j * M_PI / 2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
|
||||
DoZoneInCombat(c);
|
||||
}
|
||||
@@ -498,8 +498,8 @@ public:
|
||||
me->SetInCombatWithZone(); // just in case
|
||||
if (pInstance)
|
||||
for( int i = 0; i < 4; ++i )
|
||||
if( ObjectGuid guid = pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_1 + i) )
|
||||
if( Creature* hfs = ObjectAccessor::GetCreature(*me, guid) )
|
||||
if (ObjectGuid guid = pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_1 + i))
|
||||
if (Creature* hfs = ObjectAccessor::GetCreature(*me, guid))
|
||||
{
|
||||
me->SummonCreature(34188, hfs->GetPositionX(), hfs->GetPositionY(), hfs->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 22000);
|
||||
hfs->AI()->SetData(1, 0);
|
||||
@@ -515,7 +515,7 @@ public:
|
||||
}
|
||||
me->CastSpell(me, SPELL_WINGBUFFET, true);
|
||||
|
||||
if( (me->GetHealth() * 100) / me->GetMaxHealth() < 50 ) // start phase 3
|
||||
if ((me->GetHealth() * 100) / me->GetMaxHealth() < 50 ) // start phase 3
|
||||
{
|
||||
Talk(EMOTE_PERMA_GROUND);
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
@@ -753,11 +753,11 @@ public:
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
if( me->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_1) )
|
||||
if (me->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_1))
|
||||
return GO_HARPOON_GUN_1;
|
||||
else if( me->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_2) )
|
||||
else if (me->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_2))
|
||||
return GO_HARPOON_GUN_2;
|
||||
else if( me->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_3) )
|
||||
else if (me->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_3))
|
||||
return GO_HARPOON_GUN_3;
|
||||
else
|
||||
return GO_HARPOON_GUN_4;
|
||||
@@ -773,12 +773,12 @@ public:
|
||||
if (pInstance)
|
||||
{
|
||||
uint32 h_entry = GetHarpoonGunIdForThisHFS();
|
||||
if( GameObject* wh = me->FindNearestGameObject(h_entry, 5.0f) )
|
||||
if (GameObject* wh = me->FindNearestGameObject(h_entry, 5.0f))
|
||||
{
|
||||
wh->SetRespawnTime(0);
|
||||
wh->Delete();
|
||||
}
|
||||
if( GameObject* bh = me->FindNearestGameObject(GO_BROKEN_HARPOON, 5.0f) )
|
||||
if (GameObject* bh = me->FindNearestGameObject(GO_BROKEN_HARPOON, 5.0f))
|
||||
if (bh->GetPhaseMask() != 1)
|
||||
bh->SetPhaseMask(1, true);
|
||||
}
|
||||
@@ -789,9 +789,9 @@ public:
|
||||
{
|
||||
if (++repairPoints >= REPAIR_POINTS)
|
||||
{
|
||||
if( GameObject* bh = me->FindNearestGameObject(GO_BROKEN_HARPOON, 4.0f) )
|
||||
if (GameObject* bh = me->FindNearestGameObject(GO_BROKEN_HARPOON, 4.0f))
|
||||
bh->SetPhaseMask(2, true);
|
||||
if( GameObject* wh = me->SummonGameObject(GetHarpoonGunIdForThisHFS(), me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 3 * M_PI / 2, 0.0f, 0.0f, 0.0f, 0.0f, 0) )
|
||||
if (GameObject* wh = me->SummonGameObject(GetHarpoonGunIdForThisHFS(), me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 3 * M_PI / 2, 0.0f, 0.0f, 0.0f, 0.0f, 0))
|
||||
{
|
||||
me->RemoveGameObject(wh, false);
|
||||
if (Creature* cr = me->SummonCreature(NPC_RAZORSCALE_CONTROLLER, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 5000))
|
||||
@@ -884,7 +884,7 @@ public:
|
||||
if (Creature* c = ObjectAccessor::GetCreature(*me, fixingGUID))
|
||||
if (me->GetExactDist2dSq(c) <= 25.0f)
|
||||
{
|
||||
if( me->GetUInt32Value(UNIT_NPC_EMOTESTATE) != EMOTE_STATE_WORK )
|
||||
if (me->GetUInt32Value(UNIT_NPC_EMOTESTATE) != EMOTE_STATE_WORK )
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_WORK);
|
||||
|
||||
if (std::fabs(me->GetOrientation() - me->GetAngle(c)) > M_PI / 4)
|
||||
@@ -899,10 +899,10 @@ public:
|
||||
if (!fixingGUID)
|
||||
{
|
||||
Creature* razorscale = nullptr;
|
||||
if( ObjectGuid rsGUID = pInstance->GetGuidData(TYPE_RAZORSCALE) )
|
||||
if (ObjectGuid rsGUID = pInstance->GetGuidData(TYPE_RAZORSCALE))
|
||||
razorscale = ObjectAccessor::GetCreature(*me, rsGUID);
|
||||
|
||||
if( !razorscale || !razorscale->IsInCombat() )
|
||||
if (!razorscale || !razorscale->IsInCombat())
|
||||
{
|
||||
Reset();
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
@@ -910,8 +910,8 @@ public:
|
||||
}
|
||||
|
||||
for( int i = 0; i < 4; ++i )
|
||||
if( ObjectGuid fs_GUID = pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_1 + i) )
|
||||
if( Creature* fs = ObjectAccessor::GetCreature(*me, fs_GUID) )
|
||||
if (ObjectGuid fs_GUID = pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_1 + i))
|
||||
if (Creature* fs = ObjectAccessor::GetCreature(*me, fs_GUID))
|
||||
if (!fs->AI()->GetData(2))
|
||||
{
|
||||
float a = rand_norm() * M_PI;
|
||||
@@ -940,18 +940,18 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* user, GameObject* go) override
|
||||
{
|
||||
if( !user || !go )
|
||||
if (!user || !go)
|
||||
return true;
|
||||
|
||||
InstanceScript* pInstance = go->GetInstanceScript();
|
||||
if( !pInstance )
|
||||
if (!pInstance)
|
||||
return true;
|
||||
|
||||
Creature* rs = nullptr;
|
||||
if( ObjectGuid rsGUID = pInstance->GetGuidData(TYPE_RAZORSCALE) )
|
||||
if (ObjectGuid rsGUID = pInstance->GetGuidData(TYPE_RAZORSCALE))
|
||||
rs = ObjectAccessor::GetCreature(*go, rsGUID);
|
||||
|
||||
if( !rs || !rs->IsInCombat() )
|
||||
if (!rs || !rs->IsInCombat())
|
||||
{
|
||||
go->SetRespawnTime(0);
|
||||
go->Delete();
|
||||
@@ -960,7 +960,7 @@ public:
|
||||
|
||||
uint32 npc = 0;
|
||||
uint32 spell = 0;
|
||||
switch( go->GetEntry() )
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_HARPOON_GUN_1:
|
||||
npc = DATA_HARPOON_FIRE_STATE_1;
|
||||
@@ -980,8 +980,8 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
if( ObjectGuid g = pInstance->GetGuidData(npc) )
|
||||
if( Creature* hfs = ObjectAccessor::GetCreature(*go, g) )
|
||||
if (ObjectGuid g = pInstance->GetGuidData(npc))
|
||||
if (Creature* hfs = ObjectAccessor::GetCreature(*go, g))
|
||||
hfs->AI()->SetData(3, spell);
|
||||
|
||||
go->SetLootState(GO_JUST_DEACTIVATED);
|
||||
@@ -1017,7 +1017,7 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if( !UpdateVictim() )
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (timer2 <= diff) timer2 = 0;
|
||||
@@ -1066,10 +1066,10 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if( !UpdateVictim() )
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if( timer1 <= diff )
|
||||
if (timer1 <= diff)
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), SPELL_CHAINLIGHTNING, false);
|
||||
timer1 = urand(10000, 12000);
|
||||
@@ -1122,10 +1122,10 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if( !UpdateVictim() )
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if( timer1 <= diff )
|
||||
if (timer1 <= diff)
|
||||
{
|
||||
me->CastSpell(me, SPELL_BATTLE_SHOUT, false);
|
||||
timer1 = urand(15000, 20000);
|
||||
|
||||
@@ -1416,14 +1416,14 @@ public:
|
||||
|
||||
void RunRunicSmash(bool cast)
|
||||
{
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*me, _leftHand ? _triggerLeftGUID[0] : _triggerRightGUID[0]) )
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*me, _leftHand ? _triggerLeftGUID[0] : _triggerRightGUID[0]))
|
||||
{
|
||||
if (cast)
|
||||
cr->CastSpell(cr, SPELL_RUNIC_SMASH_DAMAGE, true);
|
||||
cr->SetPosition(_leftHand ? 2235.0f : 2221.0f, _nextTriggerPos, cr->GetPositionZ(), 0.0f);
|
||||
cr->StopMovingOnCurrentPos();
|
||||
}
|
||||
if( Creature* cr = ObjectAccessor::GetCreature(*me, _leftHand ? _triggerLeftGUID[1] : _triggerRightGUID[1]) )
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*me, _leftHand ? _triggerLeftGUID[1] : _triggerRightGUID[1]))
|
||||
{
|
||||
if (cast)
|
||||
cr->CastSpell(cr, SPELL_RUNIC_SMASH_DAMAGE, true);
|
||||
|
||||
@@ -308,7 +308,7 @@ public:
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch(events.ExecuteEvent())
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
// Control events
|
||||
case EVENT_HEALTH_CHECK:
|
||||
@@ -509,7 +509,7 @@ public:
|
||||
_spawnSelection++;
|
||||
break;
|
||||
case 3:
|
||||
if(_pummelerCount < 2)
|
||||
if (_pummelerCount < 2)
|
||||
me->SummonCreature(NPC_XM024_PUMMELLER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + 2, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
|
||||
|
||||
_pummelerCount++;
|
||||
|
||||
@@ -791,7 +791,7 @@ public:
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch(events.ExecuteEvent())
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SARA_P1_DOORS_CLOSE:
|
||||
// Whispers of YS
|
||||
@@ -1405,7 +1405,7 @@ public:
|
||||
{
|
||||
// Stun
|
||||
if (me->GetInstanceScript())
|
||||
if(Creature* sara = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetGuidData(NPC_SARA)))
|
||||
if (Creature* sara = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetGuidData(NPC_SARA)))
|
||||
sara->AI()->DoAction(MINUTE * IN_MILLISECONDS - std::min((uint32)MINUTE * IN_MILLISECONDS, _induceTimer));
|
||||
|
||||
_induceTimer = 0;
|
||||
@@ -1419,7 +1419,7 @@ public:
|
||||
return;
|
||||
|
||||
summons.DespawnAll();
|
||||
switch(param)
|
||||
switch (param)
|
||||
{
|
||||
case ACTION_ILLUSION_STORMWIND:
|
||||
PrepareStormwindIllusion();
|
||||
@@ -1472,7 +1472,7 @@ public:
|
||||
|
||||
me->CastSpell(me, SPELL_BRAIN_HURT_VISUAL, true);
|
||||
if (me->GetInstanceScript())
|
||||
if(Creature* sara = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetGuidData(NPC_SARA)))
|
||||
if (Creature* sara = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetGuidData(NPC_SARA)))
|
||||
sara->AI()->DoAction(ACTION_BRAIN_DAMAGED);
|
||||
}
|
||||
}
|
||||
@@ -1905,7 +1905,7 @@ public:
|
||||
if (_visualTimer)
|
||||
{
|
||||
_visualTimer += diff;
|
||||
if (_visualTimer >= 100 && _visualTimer < 10000 )
|
||||
if (_visualTimer >= 100 && _visualTimer < 10000)
|
||||
{
|
||||
me->CastSpell(me, SPELL_SIMPLE_TELEPORT, false);
|
||||
_visualTimer = 10000;
|
||||
@@ -1989,7 +1989,7 @@ public:
|
||||
if (_checkTimer != 0)
|
||||
{
|
||||
_checkTimer -= diff;
|
||||
if (_checkTimer < 0 )
|
||||
if (_checkTimer < 0)
|
||||
_checkTimer = 0;
|
||||
}
|
||||
else
|
||||
@@ -2076,7 +2076,7 @@ public:
|
||||
if (_checkTimer != 0)
|
||||
{
|
||||
_checkTimer -= diff;
|
||||
if (_checkTimer < 0 )
|
||||
if (_checkTimer < 0)
|
||||
_checkTimer = 0;
|
||||
}
|
||||
else
|
||||
@@ -2171,7 +2171,7 @@ public:
|
||||
if (_checkTimer != 0)
|
||||
{
|
||||
_checkTimer -= diff;
|
||||
if (_checkTimer < 0 )
|
||||
if (_checkTimer < 0)
|
||||
_checkTimer = 0;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -310,7 +310,7 @@ public:
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
switch(creature->GetEntry())
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_LEVIATHAN:
|
||||
m_uiLeviathanGUID = creature->GetGUID();
|
||||
@@ -373,11 +373,11 @@ public:
|
||||
break;
|
||||
case NPC_HARPOON_FIRE_STATE:
|
||||
{
|
||||
if( creature->GetPositionX() > 595 )
|
||||
if (creature->GetPositionX() > 595 )
|
||||
m_RazorscaleHarpoonFireStateGUID[3] = creature->GetGUID();
|
||||
else if( creature->GetPositionX() > 585 )
|
||||
else if (creature->GetPositionX() > 585 )
|
||||
m_RazorscaleHarpoonFireStateGUID[2] = creature->GetGUID();
|
||||
else if( creature->GetPositionX() > 575 )
|
||||
else if (creature->GetPositionX() > 575 )
|
||||
m_RazorscaleHarpoonFireStateGUID[1] = creature->GetGUID();
|
||||
else
|
||||
m_RazorscaleHarpoonFireStateGUID[0] = creature->GetGUID();
|
||||
@@ -446,7 +446,7 @@ public:
|
||||
// Flame Leviathan
|
||||
case GO_REPAIR_STATION_TRAP:
|
||||
{
|
||||
if(m_RepairSGUID[0])
|
||||
if (m_RepairSGUID[0])
|
||||
m_RepairSGUID[1] = gameObject->GetGUID();
|
||||
else
|
||||
m_RepairSGUID[0] = gameObject->GetGUID();
|
||||
@@ -558,15 +558,15 @@ public:
|
||||
case GO_HODIR_FROZEN_DOOR:
|
||||
case GO_HODIR_DOOR:
|
||||
if (GetData(TYPE_HODIR) == DONE)
|
||||
if( gameObject->GetGoState() != GO_STATE_ACTIVE )
|
||||
if (gameObject->GetGoState() != GO_STATE_ACTIVE )
|
||||
{
|
||||
gameObject->SetLootState(GO_READY);
|
||||
gameObject->UseDoorOrButton(0, false);
|
||||
}
|
||||
break;
|
||||
case GO_VEZAX_DOOR:
|
||||
if( GetData(TYPE_VEZAX) == DONE )
|
||||
if( gameObject->GetGoState() != GO_STATE_ACTIVE )
|
||||
if (GetData(TYPE_VEZAX) == DONE )
|
||||
if (gameObject->GetGoState() != GO_STATE_ACTIVE )
|
||||
{
|
||||
gameObject->SetLootState(GO_READY);
|
||||
gameObject->UseDoorOrButton(0, false);
|
||||
@@ -669,7 +669,7 @@ public:
|
||||
|
||||
void SetData(uint32 type, uint32 data) override
|
||||
{
|
||||
switch(type)
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_LEVIATHAN:
|
||||
m_auiEncounter[type] = data;
|
||||
@@ -1056,7 +1056,7 @@ public:
|
||||
|
||||
uint32 GetData(uint32 type) const override
|
||||
{
|
||||
switch(type)
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_LEVIATHAN:
|
||||
case TYPE_IGNIS:
|
||||
|
||||
Reference in New Issue
Block a user