More warning removal (Some code modifications and cleanup when needed)

--HG--
branch : trunk
This commit is contained in:
Spp committed 2010-04-19 17:03:10 +02:00
1 parent f74e969a06
commit be01821050
46 files changed
+420 -353

No files matched your search

@@ -173,8 +173,8 @@ struct boss_vaelAI : public ScriptedAI
while (i < 3) // max 3 tries to get a random target with power_mana
{
++i;
if (pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) //not aggro leader
if (pTarget->getPowerType() == POWER_MANA)
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); //not aggro leader
if (pTarget && pTarget->getPowerType() == POWER_MANA)
i = 3;
}
if (pTarget) // cast on self (see below)
@@ -1511,7 +1511,8 @@ struct npc_highlord_darion_mograineAI : public npc_escortAI
// Death
for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
{
if (!(pTemp = Unit::GetCreature(*me, uiGhoulGUID[i])))
pTemp = Unit::GetCreature(*me, uiGhoulGUID[i]);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_ACHERUS_GHOUL, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
pTemp->setFaction(2084);
@@ -1520,7 +1521,8 @@ struct npc_highlord_darion_mograineAI : public npc_escortAI
}
for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
{
if (!(pTemp = Unit::GetCreature(*me, uiAbominationGUID[i])))
pTemp = Unit::GetCreature(*me, uiAbominationGUID[i]);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
pTemp->setFaction(2084);
@@ -1529,7 +1531,8 @@ struct npc_highlord_darion_mograineAI : public npc_escortAI
}
for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
{
if (!(pTemp = Unit::GetCreature(*me, uiWarriorGUID[i])))
pTemp = Unit::GetCreature(*me, uiWarriorGUID[i]);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
pTemp->setFaction(2084);
@@ -1538,7 +1541,8 @@ struct npc_highlord_darion_mograineAI : public npc_escortAI
}
for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
{
if (!(pTemp = Unit::GetCreature(*me, uiBehemothGUID[i])))
pTemp = Unit::GetCreature(*me, uiBehemothGUID[i]);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_FLESH_BEHEMOTH, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
pTemp->setFaction(2084);
@@ -1549,7 +1553,8 @@ struct npc_highlord_darion_mograineAI : public npc_escortAI
// Dawn
for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i)
{
if (!(pTemp = Unit::GetCreature(*me, uiDefenderGUID[i])))
pTemp = Unit::GetCreature(*me, uiDefenderGUID[i]);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
pTemp->setFaction(2089);
@@ -1559,7 +1564,8 @@ struct npc_highlord_darion_mograineAI : public npc_escortAI
}
for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i)
{
if (!(pTemp = Unit::GetCreature(*me, uiEarthshatterGUID[i])))
pTemp = Unit::GetCreature(*me, uiEarthshatterGUID[i]);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
pTemp->setFaction(2089);
@@ -1567,28 +1573,32 @@ struct npc_highlord_darion_mograineAI : public npc_escortAI
uiEarthshatterGUID[i] = pTemp->GetGUID();
}
}
if (!(pTemp = Unit::GetCreature(*me, uiKorfaxGUID)))
pTemp = Unit::GetCreature(*me, uiKorfaxGUID);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_KORFAX_CHAMPION_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
pTemp->setFaction(2089);
me->AddThreat(pTemp, 0.0f);
uiKorfaxGUID = pTemp->GetGUID();
}
if (!(pTemp = Unit::GetCreature(*me, uiMaxwellGUID)))
pTemp = Unit::GetCreature(*me, uiMaxwellGUID);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_LORD_MAXWELL_TYROSUS, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
pTemp->setFaction(2089);
me->AddThreat(pTemp, 0.0f);
uiMaxwellGUID = pTemp->GetGUID();
}
if (!(pTemp = Unit::GetCreature(*me, uiEligorGUID)))
pTemp = Unit::GetCreature(*me, uiEligorGUID);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_COMMANDER_ELIGOR_DAWNBRINGER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
pTemp->setFaction(2089);
me->AddThreat(pTemp, 0.0f);
uiEligorGUID = pTemp->GetGUID();
}
if (!(pTemp = Unit::GetCreature(*me, uiRayneGUID)))
pTemp = Unit::GetCreature(*me, uiRayneGUID);
if (!pTemp)
{
pTemp = me->SummonCreature(NPC_RAYNE, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
pTemp->setFaction(2089);
@@ -60,7 +60,7 @@ struct boss_azshir_the_sleeplessAI : public ScriptedAI
DoCast(me->getVictim(), SPELL_SOULSIPHON);
return;
SoulSiphon_Timer = 20000;
//SoulSiphon_Timer = 20000;
} else SoulSiphon_Timer -= diff;
}
@@ -116,12 +116,7 @@ static Locations Spawn[]=
{1765.28,1347.46,17.55} //spawn point for smoke
};
struct Summon
{
const std::string text;
};
static Summon Text[]=
static const char* Text[]=
{
{"Horseman rise..."},
{"Your time is nigh..."},
@@ -615,14 +610,14 @@ struct boss_headless_horsemanAI : public ScriptedAI
if (count < 3)
{
if (plr)
plr->Say(Text[count].text,0);
plr->Say(Text[count],0);
}
else
{
DoCast(me, SPELL_RHYME_BIG);
if (plr)
{
plr->Say(Text[count].text,0);
plr->Say(Text[count],0);
plr->HandleEmoteCommand(ANIM_EMOTE_SHOUT);
}
wp_reached = true;
@@ -559,11 +559,10 @@ struct boss_alyson_antilleAI : public boss_hexlord_addAI
else
{
if (urand(0,1))
{
if (pTarget = DoSelectLowestHpFriendly(50, 0))
DoCast(pTarget, SPELL_DISPEL_MAGIC, false);
}
else if (pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
pTarget = DoSelectLowestHpFriendly(50, 0);
else
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
DoCast(pTarget, SPELL_DISPEL_MAGIC, false);
}
flashheal_timer = 2500;
@@ -167,8 +167,8 @@ struct boss_marliAI : public ScriptedAI
while (i < 3) // max 3 tries to get a random target with power_mana
{
++i;
if (pTarget = SelectTarget(SELECT_TARGET_RANDOM,1, 100, true)) // not aggro leader
if (pTarget->getPowerType() == POWER_MANA)
pTarget = SelectTarget(SELECT_TARGET_RANDOM,1, 100, true); // not aggro leader
if (pTarget && pTarget->getPowerType() == POWER_MANA)
i = 3;
}
if (pTarget)