Core/Script: Code style and remove unused core.
Signed-off-by: Gyx <[email protected]>
This commit is contained in:
+1
-1
@@ -105,7 +105,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTERS ; ++i)
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
|
||||
if (EncounterStatus[i] == IN_PROGRESS)
|
||||
return true;
|
||||
return false;
|
||||
|
||||
@@ -457,7 +457,7 @@ public:
|
||||
{
|
||||
if (HealthBelowPct(45))
|
||||
{
|
||||
Phase = 3 ;
|
||||
Phase = 3;
|
||||
DoScriptText(SAY_REQUEST_AID, me);
|
||||
//here Lich King should respond to KelThuzad but I don't know which Creature to make talk
|
||||
//so for now just make Kelthuzad says it.
|
||||
|
||||
@@ -465,7 +465,6 @@ public:
|
||||
playerDied = buff2;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_instance_naxxramas()
|
||||
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
if (!instance || instance->GetData(DATA_UROM_PLATAFORM) > 2)
|
||||
return;
|
||||
|
||||
for (uint8 i = 0; i < 4 ; i++)
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
{
|
||||
SetPosition(i);
|
||||
me->SummonCreature(Group[group[instance->GetData(DATA_UROM_PLATAFORM)]].entry[i], x, y, me->GetPositionZ(), me->GetOrientation());
|
||||
|
||||
@@ -308,7 +308,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader
|
||||
|
||||
float orientation = CAST_AI(boss_varos::boss_varosAI, varos->AI())->GetCoreEnergizeOrientation();
|
||||
|
||||
for (std::list<Unit*>::iterator itr = targetList.begin() ; itr != targetList.end();)
|
||||
for (std::list<Unit*>::iterator itr = targetList.begin(); itr != targetList.end();)
|
||||
{
|
||||
Position pos;
|
||||
(*itr)->GetPosition(&pos);
|
||||
@@ -355,7 +355,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader
|
||||
|
||||
float orientation = CAST_AI(boss_varos::boss_varosAI, varos->AI())->GetCoreEnergizeOrientation();
|
||||
|
||||
for (std::list<Unit*>::iterator itr = targetList.begin() ; itr != targetList.end();)
|
||||
for (std::list<Unit*>::iterator itr = targetList.begin(); itr != targetList.end();)
|
||||
{
|
||||
Position pos;
|
||||
(*itr)->GetPosition(&pos);
|
||||
|
||||
@@ -48,65 +48,77 @@ public:
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (fm_Type == 0) fm_Type = GetForgeMasterType();
|
||||
if (fm_Type == 0)
|
||||
fm_Type = GetForgeMasterType();
|
||||
|
||||
CheckForge();
|
||||
}
|
||||
|
||||
void CheckForge()
|
||||
{
|
||||
if (instance)
|
||||
if (instance)
|
||||
{
|
||||
switch (fm_Type)
|
||||
{
|
||||
case 1:
|
||||
instance->SetData(EVENT_FORGE_1, me->isAlive() ? NOT_STARTED : DONE);
|
||||
break;
|
||||
case 2:
|
||||
instance->SetData(EVENT_FORGE_2, me->isAlive() ? NOT_STARTED : DONE);
|
||||
break;
|
||||
case 3:
|
||||
instance->SetData(EVENT_FORGE_3, me->isAlive() ? NOT_STARTED : DONE);
|
||||
break;
|
||||
case 1:
|
||||
instance->SetData(EVENT_FORGE_1, me->isAlive() ? NOT_STARTED : DONE);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
instance->SetData(EVENT_FORGE_2, me->isAlive() ? NOT_STARTED : DONE);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
instance->SetData(EVENT_FORGE_3, me->isAlive() ? NOT_STARTED : DONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (fm_Type == 0) fm_Type = GetForgeMasterType();
|
||||
if (fm_Type == 0)
|
||||
fm_Type = GetForgeMasterType();
|
||||
|
||||
if (instance)
|
||||
{
|
||||
switch (fm_Type)
|
||||
{
|
||||
case 1:
|
||||
instance->SetData(EVENT_FORGE_1, DONE);
|
||||
break;
|
||||
case 2:
|
||||
instance->SetData(EVENT_FORGE_2, DONE);
|
||||
break;
|
||||
case 3:
|
||||
instance->SetData(EVENT_FORGE_3, DONE);
|
||||
break;
|
||||
case 1:
|
||||
instance->SetData(EVENT_FORGE_1, DONE);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
instance->SetData(EVENT_FORGE_2, DONE);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
instance->SetData(EVENT_FORGE_3, DONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (fm_Type == 0) fm_Type = GetForgeMasterType();
|
||||
if (fm_Type == 0)
|
||||
fm_Type = GetForgeMasterType();
|
||||
|
||||
if (instance)
|
||||
{
|
||||
switch (fm_Type)
|
||||
{
|
||||
case 1:
|
||||
instance->SetData(EVENT_FORGE_1, IN_PROGRESS);
|
||||
break;
|
||||
case 2:
|
||||
instance->SetData(EVENT_FORGE_2, IN_PROGRESS);
|
||||
break;
|
||||
case 3:
|
||||
instance->SetData(EVENT_FORGE_3, IN_PROGRESS);
|
||||
break;
|
||||
case 1:
|
||||
instance->SetData(EVENT_FORGE_1, IN_PROGRESS);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
instance->SetData(EVENT_FORGE_2, IN_PROGRESS);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
instance->SetData(EVENT_FORGE_3, IN_PROGRESS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
|
||||
@@ -115,29 +127,26 @@ public:
|
||||
uint8 GetForgeMasterType()
|
||||
{
|
||||
float diff = 30.0f;
|
||||
int near_f = 0;
|
||||
uint8 near_f = 0;
|
||||
|
||||
for (uint8 i = 0; i < 3 ; ++i)
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
GameObject* temp;
|
||||
temp = me->FindNearestGameObject(entry_search[i], 30);
|
||||
if (temp)
|
||||
if (GameObject* go = me->FindNearestGameObject(entry_search[i], 30))
|
||||
{
|
||||
if (me->IsWithinDist(temp, diff, false))
|
||||
if (me->IsWithinDist(go, diff, false))
|
||||
{
|
||||
near_f = i + 1;
|
||||
diff = me->GetDistance2d(temp);
|
||||
|
||||
diff = me->GetDistance2d(go);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (near_f)
|
||||
{
|
||||
case 1: return 1;
|
||||
case 2: return 2;
|
||||
case 3: return 3;
|
||||
default: return 0;
|
||||
case 1: return 1;
|
||||
case 2: return 2;
|
||||
case 3: return 3;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +161,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_utgarde_keep()
|
||||
|
||||
@@ -1071,7 +1071,7 @@ public:
|
||||
|
||||
SummonList.clear();
|
||||
|
||||
for (uint8 uiI = 0; uiI < 16 ; uiI++)
|
||||
for (uint8 uiI = 0; uiI < 16; uiI++)
|
||||
{
|
||||
if (Creature* summon = me->SummonCreature(Boss[uiBossRandom].uiAdd, AddSpawnPosition[uiI]))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user