* In case of a 'for' loop, don't declare the iterator of a type that has a larger value range when the iterator can take a maximum value of a more efficient data type. (int to uint8 in most cases).
* Other minor cleanups, Null pointer checks etc. --HG-- branch : trunk
This commit is contained in:
@@ -894,7 +894,7 @@ void ScriptsFree()
|
||||
delete []SpellSummary;
|
||||
|
||||
// Free resources before library unload
|
||||
for(int i=0;i<MAX_SCRIPTS;i++)
|
||||
for(uint16 i =0;i<MAX_SCRIPTS;i++)
|
||||
delete m_scripts[i];
|
||||
|
||||
num_sc_scripts = 0;
|
||||
@@ -934,7 +934,7 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf")
|
||||
bar.step();
|
||||
outstring_log("");
|
||||
|
||||
for(int i=0;i<MAX_SCRIPTS;i++)
|
||||
for(uint16 i =0;i<MAX_SCRIPTS;i++)
|
||||
m_scripts[i]=NULL;
|
||||
|
||||
FillSpellSummary();
|
||||
|
||||
@@ -145,7 +145,7 @@ struct TRINITY_DLL_DECL boss_ysondreAI : public ScriptedAI
|
||||
{
|
||||
// summon 10 druids
|
||||
Unit* target = NULL;
|
||||
for(int i = 0; i < 10;i++)
|
||||
for(uint8 i = 0; i < 10;i++)
|
||||
{
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
SummonDruids(target);
|
||||
@@ -162,7 +162,7 @@ struct TRINITY_DLL_DECL boss_ysondreAI : public ScriptedAI
|
||||
{
|
||||
// summon 10 druids
|
||||
Unit* target = NULL;
|
||||
for(int i = 0; i < 10;i++)
|
||||
for(uint8 i = 0; i < 10;i++)
|
||||
{
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
SummonDruids(target);
|
||||
@@ -179,7 +179,7 @@ struct TRINITY_DLL_DECL boss_ysondreAI : public ScriptedAI
|
||||
{
|
||||
// summon 10 druids
|
||||
Unit* target = NULL;
|
||||
for(int i = 0; i < 10;i++)
|
||||
for(uint8 i = 0; i < 10;i++)
|
||||
{
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
SummonDruids(target);
|
||||
|
||||
@@ -224,14 +224,14 @@ bool EquippedOk(Player* player, uint32 spellId)
|
||||
if( !spell )
|
||||
return false;
|
||||
|
||||
for(int i=0; i<3; i++)
|
||||
for(uint8 i=0; i<3; i++)
|
||||
{
|
||||
uint32 reqSpell = spell->EffectTriggerSpell[i];
|
||||
if( !reqSpell )
|
||||
continue;
|
||||
|
||||
Item* pItem;
|
||||
for(int j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; j++)
|
||||
for(uint8 j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; j++)
|
||||
{
|
||||
pItem = player->GetItemByPos( INVENTORY_SLOT_BAG_0, j );
|
||||
if( pItem )
|
||||
|
||||
@@ -1819,7 +1819,7 @@ void boss_illidan_stormrageAI::Reset()
|
||||
}
|
||||
|
||||
MaievGUID = 0;
|
||||
for(int i = 0; i < 2; ++i)
|
||||
for(uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
FlameGUID[i] = 0;
|
||||
GlaiveGUID[i] = 0;
|
||||
|
||||
@@ -516,7 +516,6 @@ bool GossipSelect_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature,
|
||||
#define SAY_DUGHAL_FREE "Thank you, $N! I'm free!!!"
|
||||
#define GOSSIP_DUGHAL "You're free, Dughal! Get out of here!"
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
/*
|
||||
struct TRINITY_DLL_DECL npc_dughal_stormwingAI : public npc_escortAI
|
||||
{
|
||||
|
||||
+1
-1
@@ -688,7 +688,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI
|
||||
|
||||
Unit* selectAdvisorUnit()
|
||||
{
|
||||
Unit* pUnit;
|
||||
Unit* pUnit = NULL;
|
||||
if(pInstance)
|
||||
{
|
||||
switch(rand()%4)
|
||||
|
||||
+2
-2
@@ -303,7 +303,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
|
||||
//Despawn all Inner Demon summoned
|
||||
void DespawnDemon()
|
||||
{
|
||||
for(int i=0; i<5; i++)
|
||||
for(uint8 i=0; i<5; i++)
|
||||
{
|
||||
if(InnderDemon[i])
|
||||
{
|
||||
@@ -322,7 +322,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
|
||||
|
||||
void CastConsumingMadness() //remove this once SPELL_INSIDIOUS_WHISPER is supported by core
|
||||
{
|
||||
for(int i=0; i<5; i++)
|
||||
for(uint8 i=0; i<5; i++)
|
||||
{
|
||||
if(InnderDemon[i] > 0 )
|
||||
{
|
||||
|
||||
+2
-2
@@ -184,7 +184,7 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance
|
||||
{
|
||||
case DATA_STRANGE_POOL: StrangePool = data;
|
||||
case DATA_CONTROL_CONSOLE:
|
||||
if(data = DONE)
|
||||
if(data == DONE)
|
||||
{
|
||||
OpenDoor(BridgePart[0], true);
|
||||
OpenDoor(BridgePart[1], true);
|
||||
@@ -212,7 +212,7 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance
|
||||
case DATA_SHIELDGENERATOR4:ShieldGeneratorDeactivated[3] = (data) ? true : false; break;
|
||||
}
|
||||
|
||||
if(data = DONE)
|
||||
if(data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ struct TRINITY_DLL_DECL npc_unworthy_initiateAI : public ScriptedAI
|
||||
void AddEquipp()
|
||||
{
|
||||
int model_counter = 0;
|
||||
for(int i = 0; i< 20; i++)
|
||||
for(uint8 i = 0; i< 20; i++)
|
||||
{
|
||||
if(m_creature->GetDisplayId() == modelid_dk_unworthy[i])
|
||||
{
|
||||
@@ -261,7 +261,7 @@ void npc_unworthy_initiateAI::UpdateAI(const uint32 diff)
|
||||
float dist = 99.0f;
|
||||
uint64 nearest_prison;
|
||||
|
||||
for(int i = 0; i < 12; i++)
|
||||
for(uint8 i = 0; i < 12; i++)
|
||||
{
|
||||
GameObject* temp_prison;
|
||||
temp_prison = m_creature->FindNearestGameObject(acherus_soul_prison[i],30);
|
||||
|
||||
@@ -700,7 +700,7 @@ struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI
|
||||
//BlastWave_Timer
|
||||
if(BlastWave_Timer < diff)
|
||||
{
|
||||
Unit *target;
|
||||
Unit *target;
|
||||
std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
|
||||
std::vector<Unit *> target_list;
|
||||
for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
|
||||
+4
-4
@@ -71,7 +71,7 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
HeroicMode = c->GetMap()->IsHeroic();
|
||||
for(int i=0; i<5; ++i)
|
||||
for(uint8 i=0; i<5; ++i)
|
||||
Channelers[i] = 0;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
default: DoScriptText(SAY_ADD_AGGRO_3, m_creature); break;
|
||||
}
|
||||
}
|
||||
for(int i=0; i<5; ++i)
|
||||
for(uint8 i=0; i<5; ++i)
|
||||
{
|
||||
Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]);
|
||||
if(who && channeler && !channeler->isInCombat())
|
||||
@@ -144,7 +144,7 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
|
||||
void ChannelerDied(Unit* killer)
|
||||
{
|
||||
for(int i=0; i<5; ++i)
|
||||
for(uint8 i=0; i<5; ++i)
|
||||
{
|
||||
Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]);
|
||||
if(channeler && channeler->isAlive())
|
||||
@@ -171,7 +171,7 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
|
||||
void SummonChannelers()
|
||||
{
|
||||
for(int i=0; i<5; ++i)
|
||||
for(uint8 i=0; i<5; ++i)
|
||||
{
|
||||
Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]);
|
||||
if(!channeler || channeler->isDead())
|
||||
|
||||
+1
-1
@@ -256,7 +256,7 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI
|
||||
{
|
||||
Unit* target = NULL;
|
||||
|
||||
for(int i = 0; i < summoned; i++)
|
||||
for(uint8 i = 0; i < summoned; i++)
|
||||
{
|
||||
switch(rand()%3)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
|
||||
{
|
||||
boss_moroesAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
for(int i = 0; i < 4; i++)
|
||||
for(uint8 i = 0; i < 4; i++)
|
||||
{
|
||||
AddId[i] = 0;
|
||||
}
|
||||
@@ -185,7 +185,7 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
|
||||
}
|
||||
}else
|
||||
{
|
||||
for(int i = 0; i < 4; i++)
|
||||
for(uint8 i = 0; i < 4; i++)
|
||||
{
|
||||
Creature *pCreature = m_creature->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
|
||||
if (pCreature)
|
||||
@@ -198,7 +198,7 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
|
||||
|
||||
bool isAddlistEmpty()
|
||||
{
|
||||
for(int i = 0; i < 4; i++)
|
||||
for(uint8 i = 0; i < 4; i++)
|
||||
{
|
||||
if(AddId[i] == 0)
|
||||
return true;
|
||||
|
||||
@@ -188,10 +188,10 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
|
||||
InfernalCleanup();
|
||||
positions.clear();
|
||||
|
||||
for(int i =0; i < 5; ++i)
|
||||
for(uint8 i =0; i < 5; ++i)
|
||||
enfeeble_targets[i] = 0;
|
||||
|
||||
for(int i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
|
||||
for(uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
|
||||
positions.push_back(&InfernalPoints[i]);
|
||||
|
||||
EnfeebleTimer = 30000;
|
||||
@@ -232,7 +232,7 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
|
||||
InfernalCleanup();
|
||||
positions.clear();
|
||||
|
||||
for(int i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
|
||||
for(uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
|
||||
positions.push_back(&InfernalPoints[i]);
|
||||
|
||||
if(pInstance)
|
||||
@@ -270,7 +270,7 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
|
||||
|
||||
void AxesCleanup()
|
||||
{
|
||||
for(int i=0; i<2;++i)
|
||||
for(uint8 i=0; i<2;++i)
|
||||
{
|
||||
Unit *axe = Unit::GetUnit(*m_creature, axes[i]);
|
||||
if(axe && axe->isAlive())
|
||||
@@ -335,7 +335,7 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
|
||||
|
||||
void EnfeebleResetHealth()
|
||||
{
|
||||
for(int i = 0; i < 5; ++i)
|
||||
for(uint8 i = 0; i < 5; ++i)
|
||||
{
|
||||
Unit *target = Unit::GetUnit(*m_creature, enfeeble_targets[i]);
|
||||
if(target && target->isAlive())
|
||||
@@ -501,7 +501,7 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
|
||||
Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
if(target)
|
||||
{
|
||||
for(int i = 0; i < 2; ++i)
|
||||
for(uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
Unit *axe = Unit::GetUnit(*m_creature, axes[i]);
|
||||
if(axe)
|
||||
|
||||
@@ -217,7 +217,7 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI
|
||||
DoScriptText(SAY_REINFORCEMENTS1, m_creature);
|
||||
|
||||
// summon 10 elementals
|
||||
for(int i = 0; i < 9; ++i)
|
||||
for(uint8 i = 0; i < 9; ++i)
|
||||
{
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
{
|
||||
@@ -236,7 +236,7 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI
|
||||
{
|
||||
DoScriptText(SAY_REINFORCEMENTS2, m_creature);
|
||||
|
||||
for(int i = 0; i < 9; ++i)
|
||||
for(uint8 i = 0; i < 9; ++i)
|
||||
{
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL boss_four_horsemenAI : public BossAI
|
||||
boss_four_horsemenAI(Creature *c) : BossAI(c, BOSS_HORSEMEN)
|
||||
{
|
||||
id = Horsemen(0);
|
||||
for(uint32 i = 1; i < 4; ++i)
|
||||
for(uint8 i = 1; i < 4; ++i)
|
||||
if(me->GetEntry() == MOB_HORSEMEN[i])
|
||||
id = Horsemen(i);
|
||||
caster = (id == HORSEMEN_LADY || id == HORSEMEN_SIR);
|
||||
@@ -107,9 +107,9 @@ struct TRINITY_DLL_DECL boss_four_horsemenAI : public BossAI
|
||||
DoScriptText(SAY_BARON_AGGRO, me);
|
||||
else
|
||||
DoScriptText(SAY_AGGRO[id], me);
|
||||
events.ScheduleEvent(EVENT_MARK, 15000);
|
||||
events.ScheduleEvent(EVENT_CAST, 20000+rand()%5000);
|
||||
events.ScheduleEvent(EVENT_BERSERK, 15*100*1000);
|
||||
events.ScheduleEvent(EVENT_MARK, 15000);
|
||||
events.ScheduleEvent(EVENT_CAST, 20000+rand()%5000);
|
||||
events.ScheduleEvent(EVENT_BERSERK, 15*100*1000);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -96,15 +96,16 @@ struct TRINITY_DLL_DECL boss_anomalusAI : public ScriptedAI
|
||||
|
||||
if (m_creature->HasAura(SPELL_RIFT_SHIELD))
|
||||
{
|
||||
Unit* Rift;
|
||||
if (ChaoticRiftGUID)
|
||||
Rift = Unit::GetUnit((*m_creature), ChaoticRiftGUID);
|
||||
if (Rift && Rift->isDead())
|
||||
{
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD);
|
||||
ChaoticRiftGUID = 0;
|
||||
Unit* Rift = Unit::GetUnit((*m_creature), ChaoticRiftGUID);
|
||||
if (Rift && Rift->isDead())
|
||||
{
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD);
|
||||
ChaoticRiftGUID = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
return;
|
||||
} else
|
||||
ChaoticRiftGUID = 0;
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ struct TRINITY_DLL_DECL boss_keristraszaAI : public ScriptedAI
|
||||
{
|
||||
pInstance->SetData(DATA_KERISTRASZA_FREED, DONE);
|
||||
}
|
||||
if (pInstance->GetData(DATA_KERISTRASZA_FREED) == DONE)
|
||||
if (pInstance && pInstance->GetData(DATA_KERISTRASZA_FREED) == DONE)
|
||||
{
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
|
||||
|
||||
@@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
|
||||
void OnCreatureCreate(Creature* pCreature, bool add)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
uint32 TeamInInstance;
|
||||
uint32 TeamInInstance = 0;
|
||||
|
||||
if (!players.isEmpty())
|
||||
{
|
||||
|
||||
@@ -119,7 +119,7 @@ struct TRINITY_DLL_DECL boss_jandicebarovAI : public ScriptedAI
|
||||
|
||||
//Summon 10 Illusions attacking random gamers
|
||||
Unit* target = NULL;
|
||||
for(int i = 0; i < 10;i++)
|
||||
for(uint8 i = 0; i < 10;i++)
|
||||
{
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if(target)
|
||||
|
||||
@@ -303,7 +303,7 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
|
||||
{
|
||||
Unit* target = NULL;
|
||||
Creature* temp = NULL;
|
||||
for(int i = 0;i<3;i++)
|
||||
for(uint8 i = 0;i<3;i++)
|
||||
{
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
temp = DoSpawnCreature(MOB_SHADOW_IMAGE,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN,10000);
|
||||
|
||||
@@ -541,7 +541,6 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI
|
||||
{
|
||||
if(entry == MOB_VAPOR_TRAIL && Phase == PHASE_FLIGHT)
|
||||
{
|
||||
float x, y, z;
|
||||
(*i)->GetPosition(x, y, z);
|
||||
m_creature->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
}
|
||||
|
||||
@@ -131,14 +131,14 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI
|
||||
{
|
||||
SathGUID = pInstance->GetData64(DATA_SATHROVARR);
|
||||
DoorGUID = pInstance->GetData64(DATA_GO_FORCEFIELD);
|
||||
|
||||
if(GameObject *Door = pInstance->instance->GetGameObject(pInstance->GetData64(DoorGUID)))
|
||||
Door->SetLootState(GO_JUST_DEACTIVATED);
|
||||
}
|
||||
|
||||
Unit *Sath = Unit::GetUnit(*m_creature,SathGUID);
|
||||
if(Sath) CAST_CRE(Sath)->AI()->EnterEvadeMode();
|
||||
|
||||
if(GameObject *Door = pInstance->instance->GetGameObject(pInstance->GetData64(DoorGUID)))
|
||||
Door->SetLootState(GO_JUST_DEACTIVATED);
|
||||
|
||||
m_creature->setFaction(14);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
|
||||
@@ -151,7 +151,7 @@ struct TRINITY_DLL_DECL boss_warp_splinterAI : public ScriptedAI
|
||||
|
||||
void SummonTreants()
|
||||
{
|
||||
for(int i = 0; i < 6; ++i)
|
||||
for(uint8 i = 0; i < 6; ++i)
|
||||
{
|
||||
float angle = (M_PI / 3) * i;
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
|
||||
//After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind.
|
||||
m_creature->GetMotionMaster()->Clear();
|
||||
m_creature->Relocate(SolarianPos[0], SolarianPos[1], SolarianPos[2], SolarianPos[3]);
|
||||
for(int i=0; i<=2; ++i)
|
||||
for(uint8 i=0; i<=2; ++i)
|
||||
{
|
||||
if (!i)
|
||||
{
|
||||
|
||||
@@ -710,7 +710,10 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
|
||||
if (Phase_Timer < diff)
|
||||
{
|
||||
DoScriptText(SAY_PHASE3_ADVANCE, m_creature);
|
||||
pInstance->SetData(DATA_KAELTHASEVENT, 3);
|
||||
|
||||
if(pInstance)
|
||||
pInstance->SetData(DATA_KAELTHASEVENT, 3);
|
||||
|
||||
Phase = 3;
|
||||
PhaseSubphase = 0;
|
||||
}else Phase_Timer -= diff;
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ struct TRINITY_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI
|
||||
|
||||
if(Summon_Timer < diff)
|
||||
{
|
||||
for(int i = 0; i < 3;i++)
|
||||
for(uint8 i = 0; i < 3;i++)
|
||||
{
|
||||
Unit* target = NULL;
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
|
||||
@@ -235,7 +235,7 @@ struct TRINITY_DLL_DECL boss_yaujAI : public ScriptedAI
|
||||
pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
|
||||
}
|
||||
|
||||
for(int i = 0; i < 10;i++)
|
||||
for(uint8 i = 0; i < 10;i++)
|
||||
{
|
||||
Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
Creature* Summoned = m_creature->SummonCreature(15621,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,90000);
|
||||
|
||||
@@ -348,16 +348,19 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI
|
||||
for(std::list<Creature*>::iterator iter = unitList.begin(); iter != unitList.end(); ++iter)
|
||||
{
|
||||
Creature *c = *iter;
|
||||
if (c && c->isDead())
|
||||
if (c)
|
||||
{
|
||||
c->Respawn();
|
||||
c->setFaction(7);
|
||||
c->RemoveAllAuras();
|
||||
}
|
||||
if (c->IsWithinDistInMap(m_creature, ABUSE_BUG_RANGE))
|
||||
{
|
||||
if (!nearb || (rand()%4)==0)
|
||||
nearb = c;
|
||||
if(c->isDead())
|
||||
{
|
||||
c->Respawn();
|
||||
c->setFaction(7);
|
||||
c->RemoveAllAuras();
|
||||
}
|
||||
if (c->IsWithinDistInMap(m_creature, ABUSE_BUG_RANGE))
|
||||
{
|
||||
if (!nearb || (rand()%4) == 0)
|
||||
nearb = c;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nearb;
|
||||
|
||||
@@ -108,7 +108,7 @@ struct TRINITY_DLL_DECL npc_dragonflayer_forge_masterAI : public ScriptedAI
|
||||
float diff = 30.0f;
|
||||
int near_f = 0;
|
||||
|
||||
for(int i = 0; i < 3 ; i++)
|
||||
for(uint8 i = 0; i < 3 ; i++)
|
||||
{
|
||||
GameObject* temp;
|
||||
temp = m_creature->FindNearestGameObject(entry_search[i],30);
|
||||
|
||||
@@ -65,7 +65,7 @@ struct TRINITY_DLL_DECL boss_archavonAI : public ScriptedAI
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
DoScriptText(rand()%2 ? SAY_AGGRO1 : SAY_AGGRO2, me);
|
||||
DoScriptText((rand()%2) ? SAY_AGGRO1 : SAY_AGGRO2, me);
|
||||
DoZoneInCombat();
|
||||
events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000);
|
||||
events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000);
|
||||
|
||||
@@ -558,10 +558,10 @@ struct TRINITY_DLL_DECL boss_alyson_antilleAI : public boss_hexlord_addAI
|
||||
{
|
||||
if(rand()%2)
|
||||
{
|
||||
if(Unit* target = DoSelectLowestHpFriendly(50, 0))
|
||||
if(target = DoSelectLowestHpFriendly(50, 0))
|
||||
m_creature->CastSpell(target, SPELL_DISPEL_MAGIC, false);
|
||||
}
|
||||
else if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
else if(target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
m_creature->CastSpell(target, SPELL_DISPEL_MAGIC, false);
|
||||
}
|
||||
flashheal_timer = 2500;
|
||||
|
||||
@@ -72,7 +72,7 @@ struct TRINITY_DLL_DECL boss_hazzarahAI : public ScriptedAI
|
||||
//We will summon 3 illusions that will spawn on a random gamer and attack this gamer
|
||||
//We will just use one model for the beginning
|
||||
Unit* target = NULL;
|
||||
for(int i = 0; i < 3;i++)
|
||||
for(uint8 i = 0; i < 3;i++)
|
||||
{
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if(!target)
|
||||
|
||||
@@ -112,7 +112,7 @@ struct TRINITY_DLL_DECL boss_venoxisAI : public ScriptedAI
|
||||
if (HolyNova_Timer < diff)
|
||||
{
|
||||
TargetInRange = 0;
|
||||
for(int i=0; i<10; i++)
|
||||
for(uint8 i=0; i<10; i++)
|
||||
{
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO,i))
|
||||
if(m_creature->IsWithinMeleeRange(target))
|
||||
|
||||
Reference in New Issue
Block a user