Code style (game + scripts only):

"if(" --> "if ("

--HG--
branch : trunk
This commit is contained in:
Spp
2010-04-07 19:14:10 +02:00
parent 2e127f7a30
commit d19e127080
254 changed files with 9517 additions and 9517 deletions
@@ -154,7 +154,7 @@ struct mob_av_marshal_or_warmasterAI : public ScriptedAI
// check if creature is not outside of building
if(uiResetTimer <= diff)
if (uiResetTimer <= diff)
{
if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
EnterEvadeMode();
@@ -59,14 +59,14 @@ struct mob_water_elementalAI : public ScriptedAI
if (!UpdateVictim())
return;
if(uiWaterBoltTimer < diff)
if (uiWaterBoltTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_WATERBOLT);
uiWaterBoltTimer = 5*IN_MILISECONDS;
} else uiWaterBoltTimer -= diff;
// check if creature is not outside of building
if(uiResetTimer < diff)
if (uiResetTimer < diff)
{
if (Creature *pBalinda = Unit::GetCreature(*m_creature, uiBalindaGUID))
if (m_creature->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50)
@@ -133,7 +133,7 @@ struct boss_balindaAI : public ScriptedAI
if (uiWaterElementalTimer < diff)
{
if(Summons.empty())
if (Summons.empty())
m_creature->SummonCreature(NPC_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45*IN_MILISECONDS);
uiWaterElementalTimer = 50*IN_MILISECONDS;
} else uiWaterElementalTimer -= diff;
@@ -164,7 +164,7 @@ struct boss_balindaAI : public ScriptedAI
// check if creature is not outside of building
if(uiResetTimer < diff)
if (uiResetTimer < diff)
{
if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
{
@@ -108,7 +108,7 @@ struct boss_drektharAI : public ScriptedAI
} else uiYellTimer -= diff;
// check if creature is not outside of building
if(uiResetTimer <= diff)
if (uiResetTimer <= diff)
{
if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
{
@@ -100,7 +100,7 @@ struct boss_galvangarAI : public ScriptedAI
} else uiMortalStrikeTimer -= diff;
// check if creature is not outside of building
if(uiResetTimer <= diff)
if (uiResetTimer <= diff)
{
if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
{
@@ -100,7 +100,7 @@ struct boss_vanndarAI : public ScriptedAI
} else uiYellTimer -= diff;
// check if creature is not outside of building
if(uiResetTimer <= diff)
if (uiResetTimer <= diff)
{
if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
{
@@ -53,9 +53,9 @@ bool GOHello_go_shadowforge_brazier(Player* pPlayer, GameObject* pGo)
else
pInstance->SetData(TYPE_LYCEUM, IN_PROGRESS);
// If used brazier open linked doors (North or South)
if(pGo->GetGUID() == pInstance->GetData64(DATA_SF_BRAZIER_N))
if (pGo->GetGUID() == pInstance->GetData64(DATA_SF_BRAZIER_N))
pInstance->HandleGameObject(pInstance->GetData64(DATA_GOLEM_DOOR_N), true);
else if(pGo->GetGUID() == pInstance->GetData64(DATA_SF_BRAZIER_S))
else if (pGo->GetGUID() == pInstance->GetData64(DATA_SF_BRAZIER_S))
pInstance->HandleGameObject(pInstance->GetData64(DATA_GOLEM_DOOR_S), true);
}
return false;
@@ -79,7 +79,7 @@ struct boss_magmusAI : public ScriptedAI
// When he die open door to last chamber
void JustDied(Unit *who)
{
if(ScriptedInstance* pInstance = who->GetInstanceData())
if (ScriptedInstance* pInstance = who->GetInstanceData())
pInstance->HandleGameObject(pInstance->GetData64(DATA_THRONE_DOOR), true);
}
};
@@ -166,7 +166,7 @@ struct instance_blackrock_depths : public ScriptedInstance
case NPC_ANGERREL: TombBossGUIDs[6] = pCreature->GetGUID(); break;
case NPC_MAGMUS:
MagmusGUID = pCreature->GetGUID();
if(!pCreature->isAlive())
if (!pCreature->isAlive())
HandleGameObject(GetData64(DATA_THRONE_DOOR), true); // if Magmus is dead open door to last boss
break;
}
@@ -108,9 +108,9 @@ struct boss_nefarianAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if( DespawnTimer <= diff)
if ( DespawnTimer <= diff)
{
if(!UpdateVictim())
if (!UpdateVictim())
m_creature->ForcedDespawn();
DespawnTimer = 5000;
} else DespawnTimer -= diff;
+3 -3
View File
@@ -31,12 +31,12 @@ bool AreaTrigger_at_twilight_grove(Player* pPlayer, const AreaTriggerEntry *at)
{
if (pPlayer->HasQuestForItem(21149))
{
if(Unit* TCorrupter = pPlayer->SummonCreature(15625,-10328.16,-489.57,49.95,0,TEMPSUMMON_MANUAL_DESPAWN,60000))
if (Unit* TCorrupter = pPlayer->SummonCreature(15625,-10328.16,-489.57,49.95,0,TEMPSUMMON_MANUAL_DESPAWN,60000))
{
TCorrupter->setFaction(14);
TCorrupter->SetMaxHealth(832750);
}
if(Unit* CorrupterSpeaker = pPlayer->SummonCreature(1,pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ()-1,0,TEMPSUMMON_TIMED_DESPAWN,15000))
if (Unit* CorrupterSpeaker = pPlayer->SummonCreature(1,pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ()-1,0,TEMPSUMMON_TIMED_DESPAWN,15000))
{
CorrupterSpeaker->SetName("Twilight Corrupter");
CorrupterSpeaker->SetVisibility(VISIBILITY_ON);
@@ -90,7 +90,7 @@ struct boss_twilight_corrupterAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(!UpdateVictim())
if (!UpdateVictim())
return;
if (SoulCorruption_Timer <= diff)
{
@@ -209,17 +209,17 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
{
Map::PlayerList const &PlList = m_creature->GetMap()->GetPlayers();
if(PlList.isEmpty())
if (PlList.isEmpty())
return;
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
{
if(Player* pPlayer = i->getSource())
if (Player* pPlayer = i->getSource())
{
if(pPlayer->isGameMaster())
if (pPlayer->isGameMaster())
continue;
if(pPlayer->isAlive())
if (pPlayer->isAlive())
{
pTemp->SetInCombatWith(pPlayer);
pPlayer->SetInCombatWith(pTemp);
@@ -147,7 +147,7 @@ struct boss_curatorAI : public ScriptedAI
}
else
{
if(urand(0,1) == 0)
if (urand(0,1) == 0)
{
DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), m_creature);
}
@@ -134,7 +134,7 @@ struct boss_moroesAI : public ScriptedAI
DeSpawnAdds();
//remove aura from spell Garrote when Moroes dies
if(pInstance)
if (pInstance)
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_GARROTE);
}
@@ -275,7 +275,7 @@ struct boss_moroesAI : public ScriptedAI
std::list<Unit*> pTargets;
SelectTargetList(pTargets, 5, SELECT_TARGET_RANDOM, m_creature->GetMeleeReach()*5, true);
for (std::list<Unit*>::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i)
if(!m_creature->IsWithinMeleeRange(*i))
if (!m_creature->IsWithinMeleeRange(*i))
{
DoCast(*i, SPELL_BLIND);
break;
@@ -71,7 +71,7 @@ struct boss_netherspiteAI : public ScriptedAI
// need core fix
for (int i=0; i<3; ++i)
{
if(SpellEntry *spell = (SpellEntry*)GetSpellStore()->LookupEntry(PlayerBuff[i]))
if (SpellEntry *spell = (SpellEntry*)GetSpellStore()->LookupEntry(PlayerBuff[i]))
spell->AttributesEx |= SPELL_ATTR_EX_NEGATIVE;
}
}
@@ -92,7 +92,7 @@ struct boss_netherspiteAI : public ScriptedAI
bool IsBetween(WorldObject* u1, WorldObject *pTarget, WorldObject* u2) // the in-line checker
{
if(!u1 || !u2 || !pTarget)
if (!u1 || !u2 || !pTarget)
return false;
float xn, yn, xp, yp, xh, yh;
@@ -104,7 +104,7 @@ struct boss_netherspiteAI : public ScriptedAI
yh = pTarget->GetPositionY();
// check if target is between (not checking distance from the beam yet)
if(dist(xn,yn,xh,yh)>=dist(xn,yn,xp,yp) || dist(xp,yp,xh,yh)>=dist(xn,yn,xp,yp))
if (dist(xn,yn,xh,yh)>=dist(xn,yn,xp,yp) || dist(xp,yp,xh,yh)>=dist(xn,yn,xp,yp))
return false;
// check distance from the beam
return (abs((xn-xp)*yh+(yp-yn)*xh-xn*yp+xp*yn)/dist(xn,yn,xp,yp) < 1.5f);
@@ -135,7 +135,7 @@ struct boss_netherspiteAI : public ScriptedAI
pos[BLUE_PORTAL] = (r>1 ? 1: 2); // Blue Portal not on the left side (0)
for (int i=0; i<3; ++i)
if(Creature *portal = m_creature->SummonCreature(PortalID[i],PortalCoord[pos[i]][0],PortalCoord[pos[i]][1],PortalCoord[pos[i]][2],0,TEMPSUMMON_TIMED_DESPAWN,60000))
if (Creature *portal = m_creature->SummonCreature(PortalID[i],PortalCoord[pos[i]][0],PortalCoord[pos[i]][1],PortalCoord[pos[i]][2],0,TEMPSUMMON_TIMED_DESPAWN,60000))
{
PortalGUID[i] = portal->GetGUID();
portal->AddAura(PortalVisual[i], portal);
@@ -146,9 +146,9 @@ struct boss_netherspiteAI : public ScriptedAI
{
for (int i=0; i<3; ++i)
{
if(Creature *portal = Unit::GetCreature(*m_creature, PortalGUID[i]))
if (Creature *portal = Unit::GetCreature(*m_creature, PortalGUID[i]))
portal->DisappearAndDie();
if(Creature *portal = Unit::GetCreature(*m_creature, BeamerGUID[i]))
if (Creature *portal = Unit::GetCreature(*m_creature, BeamerGUID[i]))
portal->DisappearAndDie();
PortalGUID[i] = 0;
BeamTarget[i] = 0;
@@ -158,14 +158,14 @@ struct boss_netherspiteAI : public ScriptedAI
void UpdatePortals() // Here we handle the beams' behavior
{
for (int j=0; j<3; ++j) // j = color
if(Creature *portal = Unit::GetCreature(*m_creature, PortalGUID[j]))
if (Creature *portal = Unit::GetCreature(*m_creature, PortalGUID[j]))
{
// the one who's been casted upon before
Unit *current = Unit::GetUnit(*portal, BeamTarget[j]);
// temporary store for the best suitable beam reciever
Unit *pTarget = m_creature;
if(Map* map = m_creature->GetMap())
if (Map* map = m_creature->GetMap())
{
Map::PlayerList const& players = map->GetPlayers();
@@ -173,7 +173,7 @@ struct boss_netherspiteAI : public ScriptedAI
for (Map::PlayerList::const_iterator i = players.begin(); i!=players.end(); ++i)
{
Player* p = i->getSource();
if(p && p->isAlive() // alive
if (p && p->isAlive() // alive
&& (!pTarget || pTarget->GetDistance2d(portal)>p->GetDistance2d(portal)) // closer than current best
&& !p->HasAura(PlayerDebuff[j],0) // not exhausted
&& !p->HasAura(PlayerBuff[(j+1)%3],0) // not on another beam
@@ -183,31 +183,31 @@ struct boss_netherspiteAI : public ScriptedAI
}
}
// buff the target
if(pTarget->GetTypeId() == TYPEID_PLAYER)
if (pTarget->GetTypeId() == TYPEID_PLAYER)
pTarget->AddAura(PlayerBuff[j], pTarget);
else
pTarget->AddAura(NetherBuff[j], pTarget);
// cast visual beam on the chosen target if switched
// simple target switching isn't working -> using BeamerGUID to cast (workaround)
if(!current || pTarget != current)
if (!current || pTarget != current)
{
BeamTarget[j] = pTarget->GetGUID();
// remove currently beaming portal
if(Creature *beamer = Unit::GetCreature(*portal, BeamerGUID[j]))
if (Creature *beamer = Unit::GetCreature(*portal, BeamerGUID[j]))
{
beamer->CastSpell(pTarget, PortalBeam[j], false);
beamer->DisappearAndDie();
BeamerGUID[j] = 0;
}
// create new one and start beaming on the target
if(Creature *beamer = portal->SummonCreature(PortalID[j],portal->GetPositionX(),portal->GetPositionY(),portal->GetPositionZ(),portal->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,60000))
if (Creature *beamer = portal->SummonCreature(PortalID[j],portal->GetPositionX(),portal->GetPositionY(),portal->GetPositionZ(),portal->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,60000))
{
beamer->CastSpell(pTarget, PortalBeam[j], false);
BeamerGUID[j] = beamer->GetGUID();
}
}
// aggro target if Red Beam
if(j==RED_PORTAL && m_creature->getVictim() != pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
if (j==RED_PORTAL && m_creature->getVictim() != pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
m_creature->getThreatManager().addThreat(pTarget, 100000.0f+DoGetThreat(m_creature->getVictim()));
}
}
@@ -241,7 +241,7 @@ struct boss_netherspiteAI : public ScriptedAI
void HandleDoors(bool open) // Massive Door switcher
{
if(GameObject *Door = GameObject::GetGameObject(*m_creature, pInstance ? pInstance->GetData64(DATA_GO_MASSIVE_DOOR) : 0))
if (GameObject *Door = GameObject::GetGameObject(*m_creature, pInstance ? pInstance->GetData64(DATA_GO_MASSIVE_DOOR) : 0))
Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY);
}
@@ -259,7 +259,7 @@ struct boss_netherspiteAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(!UpdateVictim())
if (!UpdateVictim())
return;
// Void Zone
@@ -277,7 +277,7 @@ struct boss_netherspiteAI : public ScriptedAI
Berserk = true;
} else NetherInfusionTimer -= diff;
if(PortalPhase) // PORTAL PHASE
if (PortalPhase) // PORTAL PHASE
{
// Distribute beams and buffs
if (PortalTimer <= diff)
@@ -308,7 +308,7 @@ struct boss_netherspiteAI : public ScriptedAI
// Netherbreath
if (NetherbreathTimer <= diff)
{
if(Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,40,true))
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,40,true))
DoCast(pTarget, SPELL_NETHERBREATH);
NetherbreathTimer = urand(5000,7000);
} else NetherbreathTimer -= diff;
@@ -135,7 +135,7 @@ struct boss_nightbaneAI : public ScriptedAI
void HandleTerraceDoors(bool open)
{
if(pInstance)
if (pInstance)
{
pInstance->HandleGameObject(pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_1), open);
pInstance->HandleGameObject(pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_2), open);
@@ -215,9 +215,9 @@ struct boss_terestianAI : public ScriptedAI
m_creature->RemoveAurasDueToSpell(SPELL_BROKEN_PACT);
if(Minion* Kilrek = m_creature->GetFirstMinion())
if (Minion* Kilrek = m_creature->GetFirstMinion())
{
if(!Kilrek->isAlive())
if (!Kilrek->isAlive())
{
Kilrek->UnSummon();
DoCast(m_creature, SPELL_SUMMON_IMP, true);
@@ -301,13 +301,13 @@ struct boss_terestianAI : public ScriptedAI
if (SummonTimer <= diff)
{
if(!PortalGUID[0])
if (!PortalGUID[0])
DoCast(m_creature->getVictim(), SPELL_FIENDISH_PORTAL, false);
if(!PortalGUID[1])
if (!PortalGUID[1])
DoCast(m_creature->getVictim(), SPELL_FIENDISH_PORTAL_1, false);
if(PortalGUID[0] && PortalGUID[1])
if (PortalGUID[0] && PortalGUID[1])
{
if (Creature* pPortal = Unit::GetCreature(*m_creature, PortalGUID[urand(0,1)]))
pPortal->CastSpell(m_creature->getVictim(), SPELL_SUMMON_FIENDISIMP, false);
@@ -139,7 +139,7 @@ struct npc_unworthy_initiateAI : public ScriptedAI
wait_timer = 5000;
me->CastSpell(me, SPELL_DK_INITIATE_VISUAL, true);
if(Player* starter = Unit::GetPlayer(playerGUID))
if (Player* starter = Unit::GetPlayer(playerGUID))
DoScriptText(say_event_attack[rand()%9], me, starter);
phase = PHASE_TO_ATTACK;
@@ -192,7 +192,7 @@ void npc_unworthy_initiateAI::UpdateAI(const uint32 diff)
case PHASE_CHAINED:
if (!anchorGUID)
{
if(Creature *anchor = me->FindNearestCreature(29521, 30))
if (Creature *anchor = me->FindNearestCreature(29521, 30))
{
anchor->AI()->SetGUID(me->GetGUID());
anchor->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true);
@@ -611,7 +611,7 @@ struct npc_salanar_the_horsemanAI : public ScriptedAI
if (charmer->GetTypeId() == TYPEID_PLAYER)
{
// for quest Into the Realm of Shadows(12687)
if(me->GetEntry() == 28788 && CAST_PLR(charmer)->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE)
if (me->GetEntry() == 28788 && CAST_PLR(charmer)->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE)
{
CAST_PLR(charmer)->GroupEventHappens(12687, me);
charmer->RemoveAurasDueToSpell(SPELL_EFFECT_OVERTAKE);
@@ -817,7 +817,7 @@ struct npc_scarlet_miner_cartAI : public PassiveAI
void DoAction(const int32 param)
{
if(Creature *miner = Unit::GetCreature(*me, minerGUID))
if (Creature *miner = Unit::GetCreature(*me, minerGUID))
{
// very bad visual effect
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
@@ -829,8 +829,8 @@ struct npc_scarlet_miner_cartAI : public PassiveAI
void PassengerBoarded(Unit *who, int8 seatId, bool apply)
{
if(!apply)
if(Creature *miner = Unit::GetCreature(*me, minerGUID))
if (!apply)
if (Creature *miner = Unit::GetCreature(*me, minerGUID))
miner->DisappearAndDie();
}
};
@@ -880,7 +880,7 @@ struct npc_scarlet_minerAI : public npc_escortAI
AddWaypoint(11, 2202.595947, -6061.325684, 5.882018 );
AddWaypoint(12, 2188.974609, -6080.866699, 3.370027 );
if(urand(0,1))
if (urand(0,1))
{
AddWaypoint(13, 2176.483887, -6110.407227, 1.855181 );
AddWaypoint(14, 2172.516602, -6146.752441, 1.074235 );
@@ -911,7 +911,7 @@ struct npc_scarlet_minerAI : public npc_escortAI
switch (i)
{
case 1:
if(Unit *car = Unit::GetCreature(*me, carGUID))
if (Unit *car = Unit::GetCreature(*me, carGUID))
{
me->SetInFront(car);
me->SendMovementFlagUpdate();
@@ -922,7 +922,7 @@ struct npc_scarlet_minerAI : public npc_escortAI
IntroPhase = 1;
break;
case 17:
if(Unit *car = Unit::GetCreature(*me, carGUID))
if (Unit *car = Unit::GetCreature(*me, carGUID))
{
me->SetInFront(car);
me->SendMovementFlagUpdate();
@@ -947,14 +947,14 @@ struct npc_scarlet_minerAI : public npc_escortAI
{
if (IntroPhase == 1)
{
if(Creature *car = Unit::GetCreature(*me, carGUID))
if (Creature *car = Unit::GetCreature(*me, carGUID))
DoCast(car, SPELL_CART_DRAG);
IntroTimer = 800;
IntroPhase = 2;
}
else
{
if(Creature *car = Unit::GetCreature(*me, carGUID))
if (Creature *car = Unit::GetCreature(*me, carGUID))
car->AI()->DoAction();
IntroPhase = 0;
}
@@ -980,12 +980,12 @@ bool GOHello_go_inconspicuous_mine_car(Player* pPlayer, GameObject* pGO)
if (pPlayer->GetQuestStatus(12701) == QUEST_STATUS_INCOMPLETE)
{
// Hack Why Trinity Dont Support Custom Summon Location
if(Creature *miner = pPlayer->SummonCreature(28841, 2383.869629, -5900.312500, 107.996086, pPlayer->GetOrientation(),TEMPSUMMON_DEAD_DESPAWN, 1))
if (Creature *miner = pPlayer->SummonCreature(28841, 2383.869629, -5900.312500, 107.996086, pPlayer->GetOrientation(),TEMPSUMMON_DEAD_DESPAWN, 1))
{
pPlayer->CastSpell(pPlayer, SPELL_CART_SUMM, true);
if(Creature *car = pPlayer->GetVehicleCreatureBase())
if (Creature *car = pPlayer->GetVehicleCreatureBase())
{
if(car->GetEntry() == 28817)
if (car->GetEntry() == 28817)
{
car->AI()->SetGUID(miner->GetGUID());
CAST_AI(npc_scarlet_minerAI, miner->AI())->InitCartQuest(pPlayer);
@@ -66,7 +66,7 @@ struct npc_crusade_persuadedAI : public ScriptedAI
{
if (spell->Id == SPELL_PERSUASIVE_STRIKE && caster->GetTypeId() == TYPEID_PLAYER && me->isAlive() && !uiSpeech_counter)
{
if(CAST_PLR(caster)->GetQuestStatus(12720) == QUEST_STATUS_INCOMPLETE)
if (CAST_PLR(caster)->GetQuestStatus(12720) == QUEST_STATUS_INCOMPLETE)
{
uiPlayerGUID = caster->GetGUID();
uiSpeech_timer = 1000;
@@ -94,7 +94,7 @@ struct npc_crusade_persuadedAI : public ScriptedAI
if (uiSpeech_timer <= diff)
{
Player* pPlayer = Unit::GetPlayer(uiPlayerGUID);
if(!pPlayer)
if (!pPlayer)
{
EnterEvadeMode();
return;
@@ -123,7 +123,7 @@ struct npc_crusade_persuadedAI : public ScriptedAI
return;
}
if(!UpdateVictim())
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
@@ -361,16 +361,16 @@ struct mob_scarlet_courierAI : public ScriptedAI
void MovementInform(uint32 type, uint32 id)
{
if(type != POINT_MOTION_TYPE)
if (type != POINT_MOTION_TYPE)
return;
if(id == 1)
if (id == 1)
uiStage = 2;
}
void UpdateAI(const uint32 diff)
{
if(uiStage && !me->isInCombat())
if (uiStage && !me->isInCombat())
{
if (uiStage_timer <= diff)
{
@@ -388,7 +388,7 @@ struct mob_scarlet_courierAI : public ScriptedAI
break;
case 2:
if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f))
if(Unit *unit = tree->GetOwner())
if (Unit *unit = tree->GetOwner())
AttackStart(unit);
break;
}
@@ -397,7 +397,7 @@ struct mob_scarlet_courierAI : public ScriptedAI
} else uiStage_timer -= diff;
}
if(!UpdateVictim())
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
@@ -474,7 +474,7 @@ struct mob_high_inquisitor_valrothAI : public ScriptedAI
void Shout()
{
if(rand()%100 < 15)
if (rand()%100 < 15)
DoScriptText(RAND(SAY_VALROTH3,SAY_VALROTH4,SAY_VALROTH5), me);
}
@@ -579,7 +579,7 @@ struct npc_highlord_darion_mograineAI : public npc_escortAI
void EnterEvadeMode()
{
if(!bIsBattle)//do not reset self if we are in battle
if (!bIsBattle)//do not reset self if we are in battle
npc_escortAI::EnterEvadeMode();
}
@@ -52,12 +52,12 @@ struct npc_valkyr_battle_maidenAI : public PassiveAI
if (FlyBackTimer <= diff)
{
Player *plr = NULL;
if(me->isSummon())
if(Unit *summoner = CAST_SUM(me)->GetSummoner())
if(summoner->GetTypeId() == TYPEID_PLAYER)
if (me->isSummon())
if (Unit *summoner = CAST_SUM(me)->GetSummoner())
if (summoner->GetTypeId() == TYPEID_PLAYER)
plr = CAST_PLR(summoner);
if(!plr)
if (!plr)
phase = 3;
switch(phase)
@@ -824,7 +824,7 @@ bool GOHello_go_loosely_turned_soil(Player* pPlayer, GameObject* soil)
ScriptedInstance* pInstance = pPlayer->GetInstanceData();
if (pInstance)
{
if(pInstance->GetData(DATA_HORSEMAN_EVENT) != NOT_STARTED)
if (pInstance->GetData(DATA_HORSEMAN_EVENT) != NOT_STARTED)
return true;
pInstance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS);
}
@@ -280,12 +280,12 @@ struct pyrewood_ambushAI : public ScriptedAI
{
//sLog.outString("DEBUG: p(%i) k(%i) d(%u) W(%i)", Phase, KillCount, diff, WaitTimer);
if(!QuestInProgress)
if (!QuestInProgress)
return;
if(KillCount && Phase < 6)
if (KillCount && Phase < 6)
{
if(!UpdateVictim()) //reset() on target Despawn...
if (!UpdateVictim()) //reset() on target Despawn...
return;
DoMeleeAttackIfReady();
@@ -295,10 +295,10 @@ struct pyrewood_ambushAI : public ScriptedAI
switch (Phase)
{
case 0:
if(WaitTimer == WAIT_SECS)
if (WaitTimer == WAIT_SECS)
m_creature->MonsterSay(NPCSAY_INIT, LANG_UNIVERSAL, 0); //no blizzlike
if(WaitTimer <= diff)
if (WaitTimer <= diff)
{
WaitTimer -= diff;
return;
@@ -100,7 +100,7 @@ struct instance_sunken_temple : public ScriptedInstance
switch(State)
{
case GO_ATALAI_STATUE1:
if(!s1 && !s2 && !s3 && !s4 && !s5 && !s6)
if (!s1 && !s2 && !s3 && !s4 && !s5 && !s6)
{
if (GameObject *pAtalaiStatue1 = instance->GetGameObject(GOAtalaiStatue1))
UseStatue(pAtalaiStatue1);
@@ -109,7 +109,7 @@ struct instance_sunken_temple : public ScriptedInstance
};
break;
case GO_ATALAI_STATUE2:
if(s1 && !s2 && !s3 && !s4 && !s5 && !s6)
if (s1 && !s2 && !s3 && !s4 && !s5 && !s6)
{
if (GameObject *pAtalaiStatue2 = instance->GetGameObject(GOAtalaiStatue2))
UseStatue(pAtalaiStatue2);
@@ -118,7 +118,7 @@ struct instance_sunken_temple : public ScriptedInstance
};
break;
case GO_ATALAI_STATUE3:
if(s1 && s2 && !s3 && !s4 && !s5 && !s6)
if (s1 && s2 && !s3 && !s4 && !s5 && !s6)
{
if (GameObject *pAtalaiStatue3 = instance->GetGameObject(GOAtalaiStatue3))
UseStatue(pAtalaiStatue3);
@@ -127,7 +127,7 @@ struct instance_sunken_temple : public ScriptedInstance
};
break;
case GO_ATALAI_STATUE4:
if(s1 && s2 && s3 && !s4 && !s5 && !s6)
if (s1 && s2 && s3 && !s4 && !s5 && !s6)
{
if (GameObject *pAtalaiStatue4 = instance->GetGameObject(GOAtalaiStatue4))
UseStatue(pAtalaiStatue4);
@@ -136,7 +136,7 @@ struct instance_sunken_temple : public ScriptedInstance
}
break;
case GO_ATALAI_STATUE5:
if(s1 && s2 && s3 && s4 && !s5 && !s6)
if (s1 && s2 && s3 && s4 && !s5 && !s6)
{
if (GameObject *pAtalaiStatue5 = instance->GetGameObject(GOAtalaiStatue5))
UseStatue(pAtalaiStatue5);
@@ -145,7 +145,7 @@ struct instance_sunken_temple : public ScriptedInstance
}
break;
case GO_ATALAI_STATUE6:
if(s1 && s2 && s3 && s4 && s5 && !s6)
if (s1 && s2 && s3 && s4 && s5 && !s6)
{
if (GameObject *pAtalaiStatue6 = instance->GetGameObject(GOAtalaiStatue6))
UseStatue(pAtalaiStatue6);
@@ -265,7 +265,7 @@ struct boss_brutallusAI : public ScriptedAI
if (Intro && !IsIntro)
StartIntro();
if(!Intro)
if (!Intro)
ScriptedAI::MoveInLineOfSight(who);
}
@@ -314,7 +314,7 @@ struct boss_brutallusAI : public ScriptedAI
std::list<Unit*> pTargets;
SelectTargetList(pTargets, 10, SELECT_TARGET_RANDOM, 100, true);
for (std::list<Unit*>::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i)
if(!(*i)->HasAura(SPELL_BURN))
if (!(*i)->HasAura(SPELL_BURN))
{
(*i)->CastSpell((*i), SPELL_BURN, true);
break;
@@ -575,9 +575,9 @@ struct boss_alythessAI : public Scripted_NoMovementAI
}
}
}
if(!m_creature->getVictim())
if (!m_creature->getVictim())
{
if(pInstance)
if (pInstance)
{
Creature* sisiter = Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_SACROLASH));
if (sisiter && !sisiter->isDead() && sisiter->getVictim())
@@ -149,11 +149,11 @@ struct boss_kalecgosAI : public ScriptedAI
pInstance->SetData(DATA_KALECGOS_EVENT, NOT_STARTED);
}
if(Creature *Sath = Unit::GetCreature(*me, SathGUID))
if (Creature *Sath = Unit::GetCreature(*me, SathGUID))
Sath->AI()->EnterEvadeMode();
me->setFaction(14);
if(!JustReseted)//first reset at create
if (!JustReseted)//first reset at create
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
@@ -223,7 +223,7 @@ struct boss_kalecgosAI : public ScriptedAI
}
else
{
if(JustReseted)
if (JustReseted)
{
if (ResetTimer <= diff)
{
@@ -241,20 +241,20 @@ struct boss_kalecgosAI : public ScriptedAI
if (CheckTimer <= diff)
{
if(me->GetDistance(CENTER_X, CENTER_Y, DRAGON_REALM_Z) >= 75)
if (me->GetDistance(CENTER_X, CENTER_Y, DRAGON_REALM_Z) >= 75)
{
me->AI()->EnterEvadeMode();
return;
}
if (HealthBelowPct(10) && !isEnraged)
{
if(Creature* Sath = Unit::GetCreature(*me, SathGUID))
if (Creature* Sath = Unit::GetCreature(*me, SathGUID))
Sath->AI()->DoAction(DO_ENRAGE);
DoAction(DO_ENRAGE);
}
if (!isBanished && HealthBelowPct(1))
{
if(Creature* Sath = Unit::GetCreature(*me, SathGUID))
if (Creature* Sath = Unit::GetCreature(*me, SathGUID))
{
if (Sath->HasAura(SPELL_BANISH))
{
@@ -303,16 +303,16 @@ struct boss_kalecgosAI : public ScriptedAI
std::list<HostileReference*> &m_threatlist = me->getThreatManager().getThreatList();
std::list<Unit*> targetList;
for (std::list<HostileReference*>::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
if((*itr)->getTarget() && (*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER && (*itr)->getTarget()->GetGUID() != me->getVictim()->GetGUID() && !(*itr)->getTarget()->HasAura(AURA_SPECTRAL_EXHAUSTION) && (*itr)->getTarget()->GetPositionZ() > me->GetPositionZ()-5)
if ((*itr)->getTarget() && (*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER && (*itr)->getTarget()->GetGUID() != me->getVictim()->GetGUID() && !(*itr)->getTarget()->HasAura(AURA_SPECTRAL_EXHAUSTION) && (*itr)->getTarget()->GetPositionZ() > me->GetPositionZ()-5)
targetList.push_back((*itr)->getTarget());
if(targetList.empty())
if (targetList.empty())
{
SpectralBlastTimer = 1000;
return;
}
std::list<Unit*>::const_iterator i = targetList.begin();
advance(i, rand()%targetList.size());
if((*i))
if ((*i))
{
(*i)->CastSpell((*i), SPELL_SPECTRAL_BLAST,true);
SpectralBlastTimer = 20000+rand()%5000;
@@ -325,7 +325,7 @@ struct boss_kalecgosAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
if(JustReseted)//boss is invisible, don't attack
if (JustReseted)//boss is invisible, don't attack
return;
if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)))
{
@@ -360,7 +360,7 @@ struct boss_kalecgosAI : public ScriptedAI
void MovementInform(uint32 type,uint32 id)
{
if(type != POINT_MOTION_TYPE)
if (type != POINT_MOTION_TYPE)
return;
me->SetVisibility(VISIBILITY_OFF);
if (isFriendly)
@@ -482,7 +482,7 @@ struct boss_sathrovarrAI : public ScriptedAI
void EnterCombat(Unit* who)
{
if(Creature *Kalec = me->SummonCreature(MOB_KALEC, me->GetPositionX() + 10, me->GetPositionY() + 5, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0))
if (Creature *Kalec = me->SummonCreature(MOB_KALEC, me->GetPositionX() + 10, me->GetPositionY() + 5, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0))
{
KalecGUID = Kalec->GetGUID();
me->CombatStart(Kalec);
@@ -536,7 +536,7 @@ struct boss_sathrovarrAI : public ScriptedAI
Map::PlayerList const &PlayerList = pMap->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if(i->getSource()->GetPositionZ() <= DRAGON_REALM_Z-5)
if (i->getSource()->GetPositionZ() <= DRAGON_REALM_Z-5)
{
i->getSource()->RemoveAura(AURA_SPECTRAL_REALM);
i->getSource()->TeleportTo(me->GetMap()->GetId(),i->getSource()->GetPositionX(),i->getSource()->GetPositionY(),DRAGON_REALM_Z+5,i->getSource()->GetOrientation());
@@ -561,7 +561,7 @@ struct boss_sathrovarrAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(!me->HasAura(AURA_SPECTRAL_INVISIBILITY))
if (!me->HasAura(AURA_SPECTRAL_INVISIBILITY))
me->CastSpell(me, AURA_SPECTRAL_INVISIBILITY, true);
if (!UpdateVictim())
return;
@@ -569,7 +569,7 @@ struct boss_sathrovarrAI : public ScriptedAI
if (CheckTimer <= diff)
{
Creature *Kalec = Unit::GetCreature(*me, KalecGUID);
if(!Kalec || (Kalec && !Kalec->isAlive()))
if (!Kalec || (Kalec && !Kalec->isAlive()))
{
if (Creature *Kalecgos = Unit::GetCreature(*me, KalecgosGUID))
Kalecgos->AI()->EnterEvadeMode();
@@ -577,14 +577,14 @@ struct boss_sathrovarrAI : public ScriptedAI
}
if (HealthBelowPct(10) && !isEnraged)
{
if(Creature* Kalecgos = Unit::GetCreature(*me, KalecgosGUID))
if (Creature* Kalecgos = Unit::GetCreature(*me, KalecgosGUID))
Kalecgos->AI()->DoAction(DO_ENRAGE);
DoAction(DO_ENRAGE);
}
Creature *Kalecgos = Unit::GetCreature(*me, KalecgosGUID);
if (Kalecgos)
{
if(!Kalecgos->isInCombat())
if (!Kalecgos->isInCombat())
{
me->AI()->EnterEvadeMode();
return;
@@ -616,9 +616,9 @@ struct boss_sathrovarrAI : public ScriptedAI
{
for (std::list<HostileReference*>::const_iterator itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr)
{
if(Unit* pUnit = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
if (Unit* pUnit = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
{
if(pUnit->GetPositionZ() > me->GetPositionZ()+5)
if (pUnit->GetPositionZ() > me->GetPositionZ()+5)
{
me->getThreatManager().modifyThreatPercent(pUnit,-100);
}
@@ -629,7 +629,7 @@ struct boss_sathrovarrAI : public ScriptedAI
if (ShadowBoltTimer <= diff)
{
if(!(rand()%5))DoScriptText(SAY_SATH_SPELL1, me);
if (!(rand()%5))DoScriptText(SAY_SATH_SPELL1, me);
DoCast(me, SPELL_SHADOW_BOLT);
ShadowBoltTimer = 7000+(rand()%3000);
} else ShadowBoltTimer -= diff;
@@ -644,7 +644,7 @@ struct boss_sathrovarrAI : public ScriptedAI
if (CorruptionStrikeTimer <= diff)
{
if(!(rand()%5))DoScriptText(SAY_SATH_SPELL2, me);
if (!(rand()%5))DoScriptText(SAY_SATH_SPELL2, me);
DoCast(me->getVictim(), SPELL_CORRUPTION_STRIKE);
CorruptionStrikeTimer = 13000;
} else CorruptionStrikeTimer -= diff;
@@ -694,7 +694,7 @@ struct boss_kalecAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(!me->HasAura(AURA_SPECTRAL_INVISIBILITY))
if (!me->HasAura(AURA_SPECTRAL_INVISIBILITY))
me->CastSpell(me, AURA_SPECTRAL_INVISIBILITY, true);
if (!UpdateVictim())
return;
@@ -751,7 +751,7 @@ bool GOkalecgos_teleporter(Player* pPlayer, GameObject* pGo)
Map::PlayerList const &PlayerList = pMap->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if(i->getSource() && i->getSource()->GetPositionZ() < DEMON_REALM_Z + 5)
if (i->getSource() && i->getSource()->GetPositionZ() < DEMON_REALM_Z + 5)
++SpectralPlayers;
}
if (pPlayer->HasAura(AURA_SPECTRAL_EXHAUSTION) || (MAX_PLAYERS_IN_SPECTRAL_REALM && SpectralPlayers >= MAX_PLAYERS_IN_SPECTRAL_REALM))
@@ -275,7 +275,7 @@ bool GOHello_go_orb_of_the_blue_flight(Player* pPlayer, GameObject* pGo)
pGo->SummonCreature(CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 121000);
pPlayer->CastSpell(pPlayer, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, true);
pGo->SetUInt32Value(GAMEOBJECT_FACTION, 0);
if(pInstance)
if (pInstance)
Creature* Kalec = Unit::GetCreature(*pPlayer, pInstance->GetData64(DATA_KALECGOS_KJ));
//Kalec->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
pGo->GetPosition(x,y,z);
@@ -397,7 +397,7 @@ struct boss_kalecgos_kjAI : public ScriptedAI
}
}
}*/
if(OrbGUID[random])
if (OrbGUID[random])
{
if (GameObject* pOrb = m_creature->GetMap()->GetGameObject(OrbGUID[random]))
{
@@ -548,7 +548,7 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
// Reset the controller
if (pInstance)
if(Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))))
if (Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))))
CAST_AI(Scripted_NoMovementAI, Control->AI())->Reset();
}
@@ -768,7 +768,7 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
{
Phase = PHASE_SACRIFICE;
if (pInstance)
if(Creature* Anveena = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ANVEENA)))
if (Creature* Anveena = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ANVEENA)))
Anveena->CastSpell(m_creature, SPELL_SACRIFICE_OF_ANVEENA, false);
OrbActivated = false;
ChangeTimers(true, 10000); // He shouldn't cast spells for ~10 seconds after Anveena's sacrifice. This will be done within Anveena's script
@@ -287,7 +287,7 @@ struct boss_muruAI : public Scripted_NoMovementAI
{
if (Timer[TIMER_PHASE] <= diff)
{
if(!pInstance)
if (!pInstance)
return;
switch(pInstance->GetData(DATA_MURU_EVENT))
{
@@ -200,13 +200,13 @@ struct instance_sunwell_plateau : public ScriptedInstance
{
case DATA_KALECGOS_EVENT:
{
if(data == NOT_STARTED || data == DONE)
if (data == NOT_STARTED || data == DONE)
{
HandleGameObject(ForceField,true);
HandleGameObject(KalecgosWall[0],true);
HandleGameObject(KalecgosWall[1],true);
}
else if(data == IN_PROGRESS)
else if (data == IN_PROGRESS)
{
HandleGameObject(ForceField,false);
HandleGameObject(KalecgosWall[0],false);
+5 -5
View File
@@ -490,7 +490,7 @@ struct npc_geezleAI : public ScriptedAI
for (std::list<Player*>::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if((*itr)->GetQuestStatus(QUEST_TREES_COMPANY)==QUEST_STATUS_INCOMPLETE
if ((*itr)->GetQuestStatus(QUEST_TREES_COMPANY)==QUEST_STATUS_INCOMPLETE
&&(*itr)->HasAura(SPELL_TREE_DISGUISE) )
{
(*itr)->KilledMonsterCredit(MOB_SPARK,0);
@@ -613,9 +613,9 @@ enum eRavegerCage
bool go_ravager_cage(Player* pPlayer, GameObject* pGo)
{
if(pPlayer->GetQuestStatus(QUEST_STRENGTH_ONE) == QUEST_STATUS_INCOMPLETE)
if (pPlayer->GetQuestStatus(QUEST_STRENGTH_ONE) == QUEST_STATUS_INCOMPLETE)
{
if(Creature* ravager = pGo->FindNearestCreature(NPC_DEATH_RAVAGER, 5.0f, true))
if (Creature* ravager = pGo->FindNearestCreature(NPC_DEATH_RAVAGER, 5.0f, true))
{
ravager->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
ravager->SetReactState(REACT_AGGRESSIVE);
@@ -646,14 +646,14 @@ struct npc_death_ravagerAI : public ScriptedAI
if (!UpdateVictim())
return;
if(RendTimer <= diff)
if (RendTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_REND);
RendTimer = 30000;
}
else RendTimer -= diff;
if(EnragingBiteTimer <= diff)
if (EnragingBiteTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ENRAGING_BITE);
EnragingBiteTimer = 15000;
@@ -88,17 +88,17 @@ struct npc_blackfathom_deeps_eventAI : public ScriptedAI
{
Map::PlayerList const &PlList = m_creature->GetMap()->GetPlayers();
if(PlList.isEmpty())
if (PlList.isEmpty())
return;
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
{
if(Player* pPlayer = i->getSource())
if (Player* pPlayer = i->getSource())
{
if(pPlayer->isGameMaster())
if (pPlayer->isGameMaster())
continue;
if(pPlayer->isAlive())
if (pPlayer->isAlive())
{
m_creature->SetInCombatWith(pPlayer);
pPlayer->SetInCombatWith(m_creature);
@@ -469,7 +469,7 @@ struct npc_arthasAI : public npc_escortAI
DoMeleeAttackIfReady();
if(bStepping)
if (bStepping)
{
if (uiPhaseTimer <= diff)
{
@@ -487,7 +487,7 @@ struct npc_arthasAI : public npc_escortAI
//After waypoint 0
case 1:
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
if(Unit* pUther = m_creature->SummonCreature(NPC_UTHER,1794.357f,1272.183f,140.558f,1.37f,TEMPSUMMON_DEAD_DESPAWN,180000))
if (Unit* pUther = m_creature->SummonCreature(NPC_UTHER,1794.357f,1272.183f,140.558f,1.37f,TEMPSUMMON_DEAD_DESPAWN,180000))
{
uiUtherGUID = pUther->GetGUID();
pUther->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
@@ -1023,7 +1023,7 @@ struct npc_arthasAI : public npc_escortAI
//After Gossip 5
case 85:
DoScriptText(SAY_PHASE501, m_creature);
if(Creature* pMalganis = m_creature->SummonCreature(NPC_MAL_GANIS,2296.665f,1502.362f,128.362f,4.961f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
if (Creature* pMalganis = m_creature->SummonCreature(NPC_MAL_GANIS,2296.665f,1502.362f,128.362f,4.961f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
{
uiMalganisGUID = pMalganis->GetGUID();
pMalganis->SetReactState(REACT_PASSIVE);
@@ -292,7 +292,7 @@ struct npc_time_riftAI : public ScriptedAI
//normalize Z-level if we can, if rift is not at ground level.
pos.m_positionZ = std::max(m_creature->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
if(Unit *Summon = DoSummon(creature_entry, pos, 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT))
if (Unit *Summon = DoSummon(creature_entry, pos, 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT))
if (Unit *temp = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_MEDIVH) : 0))
Summon->AddThreat(temp,0.0f);
}
@@ -260,7 +260,7 @@ struct instance_dark_portal : public ScriptedInstance
//normalize Z-level if we can, if rift is not at ground level.
pos.m_positionZ = std::max(m_creature->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
if(Creature *summon = m_creature->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000))
if (Creature *summon = m_creature->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000))
return summon;
debug_log("TSCR: Instance Dark Portal: What just happened there? No boss, no loot, no fun...");
@@ -868,7 +868,7 @@ void hyjalAI::UpdateAI(const uint32 diff)
CheckTimer = 0;
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
BossGUID[i] = 0;
if(pInstance)
if (pInstance)
pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); // Reset world state for enemies to disable it
}
}
+1 -1
View File
@@ -65,7 +65,7 @@ struct npc_lazy_peonAI : public ScriptedAI
caster->ToPlayer()->KilledMonsterCredit(m_creature->GetEntry(),m_creature->GetGUID());
DoScriptText(SAY_SPELL_HIT, m_creature, caster);
m_creature->RemoveAllAuras();
if(GameObject* Lumberpile = m_creature->FindNearestGameObject(GO_LUMBERPILE, 20))
if (GameObject* Lumberpile = m_creature->FindNearestGameObject(GO_LUMBERPILE, 20))
m_creature->GetMotionMaster()->MovePoint(1,Lumberpile->GetPositionX()-1,Lumberpile->GetPositionY(),Lumberpile->GetPositionZ());
}
}
+38 -38
View File
@@ -499,7 +499,7 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
void HandleAnimation()
{
Player* plr = Unit::GetPlayer(PlayerGUID);
if(!plr)
if (!plr)
return;
Unit* Fandral = plr->FindNearestCreature(C_FANDRAL_STAGHELM, 100, m_creature);
@@ -507,7 +507,7 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
Unit* Caelestrasz = plr->FindNearestCreature(C_CAELESTRASZ, 100, m_creature);
Unit* Merithra = plr->FindNearestCreature(C_MERITHRA, 100,m_creature);
if(!Fandral || !Arygos || !Caelestrasz || !Merithra)
if (!Fandral || !Arygos || !Caelestrasz || !Merithra)
return;
Unit* mob;
@@ -724,13 +724,13 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
m_creature->GetMotionMaster()->MoveCharge(-8117.99,1532.24,3.94,4);
break;
case 60:
if(plr)
if (plr)
DoScriptText(ANACHRONOS_SAY_10, m_creature,plr);
m_creature->GetMotionMaster()->MoveCharge(-8113.46,1524.16,2.89,4);
break;
case 61:
m_creature->GetMotionMaster()->MoveCharge(-8057.1,1470.32,2.61,6);
if(plr->IsInRange(m_creature,0,15))
if (plr->IsInRange(m_creature,0,15))
plr->GroupEventHappens(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD ,m_creature);
break;
case 62:
@@ -745,7 +745,7 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
break;
case 65:
m_creature->SetVisibility(VISIBILITY_OFF);
if(Creature* AnachronosQuestTrigger = (Unit::GetCreature(*m_creature, AnachronosQuestTriggerGUID)))
if (Creature* AnachronosQuestTrigger = (Unit::GetCreature(*m_creature, AnachronosQuestTriggerGUID)))
{
DoScriptText(ARYGOS_YELL_1,m_creature);
AnachronosQuestTrigger->AI()->EnterEvadeMode();
@@ -758,15 +758,15 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
}
void UpdateAI(const uint32 diff)
{
if(AnimationTimer)
if (AnimationTimer)
{
if(AnimationTimer <= diff)
if (AnimationTimer <= diff)
HandleAnimation();
else AnimationTimer -= diff;
}
if(AnimationCount < 65)
if (AnimationCount < 65)
m_creature->CombatStop();
if(AnimationCount == 65 || eventEnd)
if (AnimationCount == 65 || eventEnd)
m_creature->AI()->EnterEvadeMode();
}
};
@@ -801,32 +801,32 @@ struct mob_qiraj_war_spawnAI : public ScriptedAI
Unit *pTarget;
Player* plr = m_creature->GetPlayer(PlayerGUID);
if(!Timers)
if (!Timers)
{
if(m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414) //all but Kaldorei Soldiers
if (m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414) //all but Kaldorei Soldiers
{
SpellTimer1 = SpawnCast[1].Timer1;
SpellTimer2 = SpawnCast[2].Timer1;
SpellTimer3 = SpawnCast[3].Timer1;
}
if(m_creature->GetEntry() == 15423 || m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414)
if (m_creature->GetEntry() == 15423 || m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414)
SpellTimer4 = SpawnCast[0].Timer1;
Timers = true;
}
if(m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422|| m_creature->GetEntry() == 15414)
if (m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422|| m_creature->GetEntry() == 15414)
{
if(SpellTimer1 <= diff)
if (SpellTimer1 <= diff)
{
DoCast(m_creature, SpawnCast[1].SpellId);
DoCast(m_creature, 24319);
SpellTimer1 = SpawnCast[1].Timer2;
} else SpellTimer1 -= diff;
if(SpellTimer2 <= diff)
if (SpellTimer2 <= diff)
{
DoCast(m_creature, SpawnCast[2].SpellId);
SpellTimer2 = SpawnCast[2].Timer2;
} else SpellTimer2 -= diff;
if(SpellTimer3 <= diff)
if (SpellTimer3 <= diff)
{
DoCast(m_creature, SpawnCast[3].SpellId);
SpellTimer3 = SpawnCast[3].Timer2;
@@ -834,7 +834,7 @@ struct mob_qiraj_war_spawnAI : public ScriptedAI
}
if (m_creature->GetEntry() == 15423 || m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414)
{
if(SpellTimer4 <= diff)
if (SpellTimer4 <= diff)
{
m_creature->RemoveAllAttackers();
m_creature->AttackStop();
@@ -858,7 +858,7 @@ struct mob_qiraj_war_spawnAI : public ScriptedAI
pTarget = m_creature->FindNearestCreature(15414,20,true);
}
hasTarget = true;
if(pTarget)
if (pTarget)
m_creature->AI()->AttackStart(pTarget);
}
if (!(m_creature->FindNearestCreature(15379,100)))
@@ -928,7 +928,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
uint32 desptimer = WavesInfo[WaveCount].DespTimer;
Spawn = m_creature->SummonCreature(WavesInfo[WaveCount].CreatureId, X, Y, Z, O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer);
if(Spawn)
if (Spawn)
{
Spawn->LoadCreaturesAddon();
if (Spawn->GetGUID()== 15423)
@@ -938,7 +938,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
if (i >= 45) WaveCount = 3;
if (i >= 51) WaveCount = 4;
if(WaveCount < 5) //1-4 Wave
if (WaveCount < 5) //1-4 Wave
{
CAST_AI(mob_qiraj_war_spawnAI, Spawn->AI())->MobGUID = m_creature->GetGUID();
CAST_AI(mob_qiraj_war_spawnAI, Spawn->AI())->PlayerGUID = PlayerGUID;
@@ -953,10 +953,10 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
{
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
if(!pPlayer)
if (!pPlayer)
return;
if(Group *EventGroup = pPlayer->GetGroup())
if (Group *EventGroup = pPlayer->GetGroup())
{
Player* GroupMember;
@@ -969,9 +969,9 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
for (Group::member_citerator itr = members.begin(); itr!= members.end(); ++itr)
{
GroupMember = (Unit::GetPlayer(itr->guid));
if(!GroupMember)
if (!GroupMember)
continue;
if(!GroupMember->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE)
if (!GroupMember->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE)
{
GroupMember->FailQuest(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD);
GroupMember->SetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD, QUEST_STATUS_NONE);
@@ -979,11 +979,11 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
}
++GroupMemberCount;
if(GroupMember->isDead())
if (GroupMember->isDead())
++DeadMemberCount;
}
if(GroupMemberCount == FailedMemberCount || !pPlayer->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS))
if (GroupMemberCount == FailedMemberCount || !pPlayer->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS))
Failed = true; //only so event can restart
}
}
@@ -991,24 +991,24 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
void LiveCounter()
{
--LiveCount;
if(!LiveCount)
if (!LiveCount)
Announced = false;
}
void UpdateAI(const uint32 diff)
{
if(!PlayerGUID || !EventStarted)
if (!PlayerGUID || !EventStarted)
return;
if(WaveCount < 4)
if (WaveCount < 4)
{
if(!Announced && AnnounceTimer <= diff)
if (!Announced && AnnounceTimer <= diff)
{
DoScriptText(WavesInfo[WaveCount].WaveTextId, m_creature);
Announced = true;
} else AnnounceTimer -= diff;
if(WaveTimer <= diff)
if (WaveTimer <= diff)
SummonNextWave();
else WaveTimer -= diff;
}
@@ -1020,7 +1020,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
void mob_qiraj_war_spawnAI::JustDied(Unit* slayer)
{
m_creature->RemoveCorpse();
if(Creature* Mob = (Unit::GetCreature(*m_creature, MobGUID)))
if (Creature* Mob = (Unit::GetCreature(*m_creature, MobGUID)))
CAST_AI(npc_anachronos_quest_triggerAI, Mob->AI())->LiveCounter();
};
@@ -1030,10 +1030,10 @@ void mob_qiraj_war_spawnAI::JustDied(Unit* slayer)
bool GOQuestAccept_GO_crystalline_tear(Player* plr, GameObject* go, Quest const* quest)
{
if(quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD)
if (quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD)
{
if(Unit* Anachronos_Quest_Trigger = go->FindNearestCreature(15454, 100, plr))
if (Unit* Anachronos_Quest_Trigger = go->FindNearestCreature(15454, 100, plr))
{
Unit *Merithra = Anachronos_Quest_Trigger->SummonCreature(15378,-8034.535,1535.14,2.61,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,150000);
@@ -1042,7 +1042,7 @@ bool GOQuestAccept_GO_crystalline_tear(Player* plr, GameObject* go, Quest const*
/* Unit *Fandral = */ Anachronos_Quest_Trigger->SummonCreature(15382,-8028.462, 1535.843, 2.61, 3.141592,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,215000);
Creature *Anachronos = Anachronos_Quest_Trigger->SummonCreature(15381,-8028.75, 1538.795, 2.61, 4,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,220000);
if(Merithra)
if (Merithra)
{
Merithra->SetUInt32Value(UNIT_NPC_FLAGS, 0);
Merithra->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
@@ -1050,7 +1050,7 @@ bool GOQuestAccept_GO_crystalline_tear(Player* plr, GameObject* go, Quest const*
Merithra->setFaction(35);
}
if(Caelestrasz)
if (Caelestrasz)
{
Caelestrasz->SetUInt32Value(UNIT_NPC_FLAGS, 0);
Caelestrasz->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
@@ -1058,7 +1058,7 @@ bool GOQuestAccept_GO_crystalline_tear(Player* plr, GameObject* go, Quest const*
Caelestrasz->setFaction(35);
}
if(Arygos)
if (Arygos)
{
Arygos->SetUInt32Value(UNIT_NPC_FLAGS, 0);
Arygos->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
@@ -1066,7 +1066,7 @@ bool GOQuestAccept_GO_crystalline_tear(Player* plr, GameObject* go, Quest const*
Arygos->setFaction(35);
}
if(Anachronos)
if (Anachronos)
{
CAST_AI(npc_anachronos_the_ancientAI, Anachronos->AI())->PlayerGUID = plr->GetGUID();
CAST_AI(npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->Failed=false;
@@ -180,7 +180,7 @@ struct aqsentinelAI : public ScriptedAI
break;
Creature *pNearby = Unit::GetCreature(*m_creature, NearbyGUID[bli]);
if(!pNearby)
if (!pNearby)
break;
AddSentinelsNear(pNearby);
+1 -1
View File
@@ -377,7 +377,7 @@ bool go_panther_cage(Player* pPlayer, GameObject* pGo)
if (pPlayer->GetQuestStatus(5151) == QUEST_STATUS_INCOMPLETE)
{
if(Creature* panther = pGo->FindNearestCreature(ENRAGED_PANTHER, 5, true))
if (Creature* panther = pGo->FindNearestCreature(ENRAGED_PANTHER, 5, true))
{
panther->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
panther->SetReactState(REACT_AGGRESSIVE);
@@ -207,7 +207,7 @@ struct boss_volazjAI : public ScriptedAI
// Check if all summons in this phase killed
for (SummonList::const_iterator iter = Summons.begin(); iter!=Summons.end(); ++iter)
{
if(Creature *visage = Unit::GetCreature(*m_creature, *iter))
if (Creature *visage = Unit::GetCreature(*m_creature, *iter))
{
// Not all are dead
if (phase == visage->GetPhaseMask())
@@ -279,7 +279,7 @@ struct boss_taldaramAI : public ScriptedAI
bool CheckSpheres()
{
if(!pInstance)
if (!pInstance)
return false;
uint64 uiSphereGuids[2];
@@ -308,7 +308,7 @@ struct boss_taldaramAI : public ScriptedAI
void RemovePrison()
{
if(!pInstance)
if (!pInstance)
return;
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -153,7 +153,7 @@ struct boss_anub_arakAI : public ScriptedAI
bGuardianSummoned = true;
}
if(!bVenomancerSummoned)
if (!bVenomancerSummoned)
{
if (uiVenomancerTimer <= diff)
{
@@ -172,7 +172,7 @@ struct boss_anub_arakAI : public ScriptedAI
} else uiVenomancerTimer -= diff;
}
if(!bDatterSummoned)
if (!bDatterSummoned)
{
if (uiDatterTimer <= diff)
{
+11 -11
View File
@@ -283,7 +283,7 @@ struct npc_sinkhole_kill_creditAI : public ScriptedAI
break;
case 7:
DoCast(m_creature, SPELL_EXPLODE_CART, true);
if(Player *caster = Unit::GetPlayer(casterGuid))
if (Player *caster = Unit::GetPlayer(casterGuid))
caster->KilledMonster(m_creature->GetCreatureInfo(),m_creature->GetGUID());
uiPhaseTimer = 5000;
Phase = 8;
@@ -539,7 +539,7 @@ struct npc_jennyAI : public ScriptedAI
void Reset()
{
if(!setCrateNumber)
if (!setCrateNumber)
setCrateNumber = true;
m_creature->SetReactState(REACT_PASSIVE);
@@ -563,7 +563,7 @@ struct npc_jennyAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(setCrateNumber)
if (setCrateNumber)
{
m_creature->AddAura(SPELL_CRATES_CARRIED,m_creature);
setCrateNumber = false;
@@ -877,7 +877,7 @@ bool QuestAccept_npc_lurgglbr(Player* pPlayer, Creature* pCreature, Quest const
{
if (pQuest->GetQuestId() == QUEST_ESCAPE_WINTERFIN_CAVERNS)
{
if(GameObject* pGo = pCreature->FindNearestGameObject(GO_CAGE, 5.0f))
if (GameObject* pGo = pCreature->FindNearestGameObject(GO_CAGE, 5.0f))
{
pGo->SetRespawnTime(0);
pGo->SetGoType(GAMEOBJECT_TYPE_BUTTON);
@@ -1432,7 +1432,7 @@ struct npc_counselor_talbotAI : public ScriptedAI
}
void MovementInform(uint32 uiType, uint32 uiId)
{
if(uiType != POINT_MOTION_TYPE)
if (uiType != POINT_MOTION_TYPE)
return;
if (m_creature->isSummon())
@@ -1485,7 +1485,7 @@ struct npc_counselor_talbotAI : public ScriptedAI
Creature *pLeryssa = Unit::GetCreature(*m_creature, LeryssaGUID);
Creature *pArlos = Unit::GetCreature(*m_creature, ArlosGUID);
if(!pLeryssa || !pArlos)
if (!pLeryssa || !pArlos)
return;
DoScriptText(SAY_ARLOS_1, pArlos);
@@ -1529,7 +1529,7 @@ struct npc_leryssaAI : public ScriptedAI
void MovementInform(uint32 uiType, uint32 uiId)
{
if(uiType != POINT_MOTION_TYPE)
if (uiType != POINT_MOTION_TYPE)
return;
if (!bDone)
@@ -1967,7 +1967,7 @@ struct npc_bonker_togglevoltAI : public npc_escortAI
{
if (GetAttack() && UpdateVictim())
{
if(Bonker_agro==0)
if (Bonker_agro==0)
{
DoScriptText(SAY_bonker_1,m_creature);
Bonker_agro++;
@@ -2187,12 +2187,12 @@ struct npc_seaforium_depth_chargeAI : public ScriptedAI
DoCast(SPELL_SEAFORIUM_DEPTH_CHARGE_EXPLOSION);
for (uint8 i = 0; i < 4; ++i)
{
if(Creature* cCredit = m_creature->FindNearestCreature(25402 + i, 10.0f))//25402-25405 credit markers
if (Creature* cCredit = m_creature->FindNearestCreature(25402 + i, 10.0f))//25402-25405 credit markers
{
if(Unit* uOwner = m_creature->GetOwner(true))
if (Unit* uOwner = m_creature->GetOwner(true))
{
Player* pOwner = uOwner->ToPlayer();
if(pOwner && pOwner->GetQuestStatus(QUEST_BURY_THOSE_COCKROACHES) == QUEST_STATUS_INCOMPLETE)
if (pOwner && pOwner->GetQuestStatus(QUEST_BURY_THOSE_COCKROACHES) == QUEST_STATUS_INCOMPLETE)
pOwner->KilledMonsterCredit(cCredit->GetEntry(),cCredit->GetGUID());
}
}
@@ -92,17 +92,17 @@ void AggroAllPlayers(Creature* pTemp)
{
Map::PlayerList const &PlList = pTemp->GetMap()->GetPlayers();
if(PlList.isEmpty())
if (PlList.isEmpty())
return;
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
{
if(Player* pPlayer = i->getSource())
if (Player* pPlayer = i->getSource())
{
if(pPlayer->isGameMaster())
if (pPlayer->isGameMaster())
continue;
if(pPlayer->isAlive())
if (pPlayer->isAlive())
{
pTemp->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
pTemp->SetReactState(REACT_AGGRESSIVE);
@@ -373,17 +373,17 @@ struct npc_announcer_toc5AI : public ScriptedAI
{
Map::PlayerList const &PlList = m_creature->GetMap()->GetPlayers();
if(PlList.isEmpty())
if (PlList.isEmpty())
return;
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
{
if(Player* pPlayer = i->getSource())
if (Player* pPlayer = i->getSource())
{
if(pPlayer->isGameMaster())
if (pPlayer->isGameMaster())
continue;
if(pPlayer->isAlive())
if (pPlayer->isAlive())
{
pTemp->SetHomePosition(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation());
pTemp->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
@@ -281,7 +281,7 @@ struct mob_novos_minionAI : public ScriptedAI
void MovementInform(uint32 type, uint32 id)
{
if(type != POINT_MOTION_TYPE || id !=0)
if (type != POINT_MOTION_TYPE || id !=0)
return;
if (Creature* pNovos = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
{
@@ -54,7 +54,7 @@ struct boss_drakkari_colossusAI : public ScriptedAI
{
if (pInstance)
pInstance->SetData(DATA_DRAKKARI_COLOSSUS_EVENT, NOT_STARTED);
if(!m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
if (!m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->clearUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
@@ -177,10 +177,10 @@ struct boss_drakkari_elementalAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if(!UpdateVictim())
if (!UpdateVictim())
return;
if(!bGoToColossus && HealthBelowPct(50))
if (!bGoToColossus && HealthBelowPct(50))
{
if (Creature *pColossus = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0))
{
+2 -2
View File
@@ -86,7 +86,7 @@ struct boss_eckAI : public ScriptedAI
if (uiSpringTimer <= diff)
{
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if(pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
{
DoCast(pTarget, RAND(SPELL_ECK_SPRING_1, SPELL_ECK_SPRING_2));
uiSpringTimer = urand(5*IN_MILISECONDS,10*IN_MILISECONDS);
@@ -138,7 +138,7 @@ struct npc_ruins_dwellerAI : public ScriptedAI
void JustDied(Unit *who)
{
if(pInstance)
if (pInstance)
{
pInstance->SetData64(DATA_RUIN_DWELLER_DIED,m_creature->GetGUID());
if (pInstance->GetData(DATA_ALIVE_RUIN_DWELLERS) == 0)
@@ -92,7 +92,7 @@ struct boss_moorabiAI : public ScriptedAI
if (!UpdateVictim())
return;
if(!bPhase && m_creature->HasAura(SPELL_TRANSFORMATION))
if (!bPhase && m_creature->HasAura(SPELL_TRANSFORMATION))
{
bPhase = true;
m_creature->RemoveAura(SPELL_MOJO_FRENZY);
+8 -8
View File
@@ -80,7 +80,7 @@ struct npc_Apothecary_HanesAI : public npc_escortAI
void UpdateEscortAI(const uint32 diff)
{
if(HealthBelowPct(75))
if (HealthBelowPct(75))
{
if (PotTimer <= diff)
{
@@ -166,9 +166,9 @@ struct npc_plaguehound_trackerAI : public npc_escortAI
void InitScriptData()
{
Player* pPlayer = NULL;
if(me->isSummon())
if(Unit* summoner = CAST_SUM(me)->GetSummoner())
if(summoner->GetTypeId() == TYPEID_PLAYER)
if (me->isSummon())
if (Unit* summoner = CAST_SUM(me)->GetSummoner())
if (summoner->GetTypeId() == TYPEID_PLAYER)
pPlayer = CAST_PLR(summoner);
if (!pPlayer)
@@ -181,9 +181,9 @@ struct npc_plaguehound_trackerAI : public npc_escortAI
void WaypointReached(uint32 i)
{
Player* pPlayer = NULL;
if(me->isSummon())
if(Unit* summoner = CAST_SUM(me)->GetSummoner())
if(summoner->GetTypeId() == TYPEID_PLAYER)
if (me->isSummon())
if (Unit* summoner = CAST_SUM(me)->GetSummoner())
if (summoner->GetTypeId() == TYPEID_PLAYER)
pPlayer = CAST_PLR(summoner);
if (!pPlayer)
@@ -285,7 +285,7 @@ enum eMcGoyver
bool GossipHello_npc_mcgoyver(Player* pPlayer, Creature* pCreature)
{
if(pPlayer->GetQuestStatus(QUEST_WE_CAN_REBUILD_IT) == QUEST_STATUS_INCOMPLETE)
if (pPlayer->GetQuestStatus(QUEST_WE_CAN_REBUILD_IT) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MG_I, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
@@ -66,13 +66,13 @@ struct boss_patchwerkAI : public BossAI
_JustDied();
DoScriptText(SAY_DEATH, me);
if(EncounterTime <= MAX_ENCOUNTER_TIME)
if (EncounterTime <= MAX_ENCOUNTER_TIME)
{
AchievementEntry const *AchievMakeQuickWerkOfHim = GetAchievementStore()->LookupEntry(ACHIEVEMENT_MAKE_QUICK_WERK_OF_HIM);
if(AchievMakeQuickWerkOfHim)
if (AchievMakeQuickWerkOfHim)
{
Map *pMap = m_creature->GetMap();
if(pMap && pMap->IsDungeon())
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
@@ -66,7 +66,7 @@ struct boss_razuviousAI : public BossAI
void DamageTaken(Unit* pDone_by, uint32& uiDamage)
{
// Damage done by the controlled Death Knight understudies should also count toward damage done by players
if(pDone_by->GetTypeId() == TYPEID_UNIT && (pDone_by->GetEntry() == 16803 || pDone_by->GetEntry() == 29941))
if (pDone_by->GetTypeId() == TYPEID_UNIT && (pDone_by->GetEntry() == 16803 || pDone_by->GetEntry() == 29941))
{
me->LowerPlayerDamageReq(uiDamage);
}
@@ -142,12 +142,12 @@ struct boss_sapphironAI : public BossAI
me->CastSpell(me, SPELL_DIES, true);
CheckPlayersFrostResist();
if(CanTheHundredClub)
if (CanTheHundredClub)
{
AchievementEntry const *AchievTheHundredClub = GetAchievementStore()->LookupEntry(ACHIEVEMENT_THE_HUNDRED_CLUB);
if(AchievTheHundredClub)
if (AchievTheHundredClub)
{
if(pMap && pMap->IsDungeon())
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
@@ -174,12 +174,12 @@ struct boss_sapphironAI : public BossAI
void CheckPlayersFrostResist()
{
if(CanTheHundredClub && pMap && pMap->IsDungeon())
if (CanTheHundredClub && pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if(itr->getSource()->GetResistance(SPELL_SCHOOL_FROST) > MAX_FROST_RESISTANCE)
if (itr->getSource()->GetResistance(SPELL_SCHOOL_FROST) > MAX_FROST_RESISTANCE)
{
CanTheHundredClub = false;
break;
@@ -222,7 +222,7 @@ struct boss_sapphironAI : public BossAI
if (phase != PHASE_BIRTH && !UpdateCombatState() || !CheckInRoom())
return;
if(CanTheHundredClub)
if (CanTheHundredClub)
{
if (CheckFrostResistTimer <= diff)
{
@@ -114,7 +114,7 @@ struct boss_keristraszaAI : public ScriptedAI
bool CheckContainmentSpheres(bool remove_prison = false)
{
if(!pInstance)
if (!pInstance)
return false;
auiContainmentSphereGUIDs[0] = pInstance->GetData64(ANOMALUS_CONTAINMET_SPHERE);
@@ -92,9 +92,9 @@ struct boss_drakosAI : public ScriptedAI
if (!UpdateVictim())
return;
if(uiBombSummonTimer < diff)
if (uiBombSummonTimer < diff)
{
if(bPostPull)
if (bPostPull)
{
m_creature->SummonCreature(NPC_UNSTABLE_SPHERE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
m_creature->SummonCreature(NPC_UNSTABLE_SPHERE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
@@ -104,9 +104,9 @@ struct boss_drakosAI : public ScriptedAI
uiBombSummonTimer = 2*IN_MILISECONDS;
} else uiBombSummonTimer -= diff;
if(uiMagicPullTimer < diff)
if (uiMagicPullTimer < diff)
{
if(bIsPulling)
if (bIsPulling)
{
if (pInstance)
{
@@ -128,14 +128,14 @@ struct boss_drakosAI : public ScriptedAI
}
} else uiMagicPullTimer -= diff;
if(bPostPull)
if (bPostPull)
{
if (uiPostPullTimer < diff)
bPostPull = false;
else uiPostPullTimer -= diff;
}
if(uiStompTimer < diff)
if (uiStompTimer < diff)
{
DoScriptText(RAND(SAY_STOMP_1,SAY_STOMP_2,SAY_STOMP_3), m_creature);
DoCast(DUNGEON_MODE(SPELL_THUNDERING_STOMP, SPELL_THUNDERING_STOMP_H));
@@ -183,13 +183,13 @@ struct npc_unstable_sphereAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(uiPulseTimer < diff)
if (uiPulseTimer < diff)
{
DoCast(SPELL_UNSTABLE_SPHERE_PULSE);
uiPulseTimer = 3*IN_MILISECONDS;
} else uiPulseTimer -= diff;
if(uiDeathTimer < diff)
if (uiDeathTimer < diff)
m_creature->DisappearAndDie();
else uiDeathTimer -= diff;
}
@@ -54,7 +54,7 @@ bool GossipHello_npc_oculus_drake(Player* pPlayer, Creature* pCreature)
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if(pCreature->GetInstanceData()->GetData(DATA_DRAKOS_EVENT) == DONE)
if (pCreature->GetInstanceData()->GetData(DATA_DRAKOS_EVENT) == DONE)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DRAKES, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DRAKES, pCreature->GetGUID());
@@ -71,7 +71,7 @@ bool GossipSelect_npc_oculus_drake(Player* pPlayer, Creature* pCreature, uint32
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF + 1:
if(!HAS_ESSENCE(pPlayer))
if (!HAS_ESSENCE(pPlayer))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
@@ -101,7 +101,7 @@ bool GossipSelect_npc_oculus_drake(Player* pPlayer, Creature* pCreature, uint32
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF + 1:
if(!HAS_ESSENCE(pPlayer))
if (!HAS_ESSENCE(pPlayer))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
@@ -131,7 +131,7 @@ bool GossipSelect_npc_oculus_drake(Player* pPlayer, Creature* pCreature, uint32
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF + 1:
if(!HAS_ESSENCE(pPlayer))
if (!HAS_ESSENCE(pPlayer))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
@@ -320,7 +320,7 @@ struct boss_sartharionAI : public ScriptedAI
void FetchDragons()
{
if(!pInstance)
if (!pInstance)
return;
Creature* pFetchTene = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_TENEBRON));
Creature* pFetchShad = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SHADRON));
@@ -517,7 +517,7 @@ struct boss_sartharionAI : public ScriptedAI
{
DoCast(pTarget, SPELL_LAVA_STRIKE);
if(urand(0,4) == 4)
if (urand(0,4) == 4)
DoScriptText(RAND(SAY_SARTHARION_SPECIAL_1,SAY_SARTHARION_SPECIAL_2,SAY_SARTHARION_SPECIAL_3), m_creature);
}
m_uiLavaStrikeTimer = urand(5000,20000);
@@ -712,7 +712,7 @@ struct dummy_dragonAI : public ScriptedAI
case NPC_SHADRON:
{
iTextId = WHISPER_OPEN_PORTAL;
if(pInstance && !pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
if (pInstance && !pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
m_creature->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron.x, AcolyteofShadron.y , AcolyteofShadron.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
else
m_creature->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron2.x, AcolyteofShadron2.y , AcolyteofShadron2.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
@@ -786,7 +786,7 @@ struct dummy_dragonAI : public ScriptedAI
{
if (m_uiMoveNextTimer <= uiDiff)
{
if(m_uiWaypointId < MAX_WAYPOINT)
if (m_uiWaypointId < MAX_WAYPOINT)
m_creature->GetMotionMaster()->MovePoint(m_uiWaypointId,
m_aDragonCommon[m_uiWaypointId].m_fX, m_aDragonCommon[m_uiWaypointId].m_fY, m_aDragonCommon[m_uiWaypointId].m_fZ);
+5 -5
View File
@@ -186,9 +186,9 @@ struct npc_goblin_prisonerAI : public ScriptedAI
{
m_creature->SetReactState(REACT_PASSIVE);
if(GameObject* pGO = m_creature->FindNearestGameObject(GO_RUSTY_CAGE,5.0f))
if (GameObject* pGO = m_creature->FindNearestGameObject(GO_RUSTY_CAGE,5.0f))
{
if(pGO->GetGoState() == GO_STATE_ACTIVE)
if (pGO->GetGoState() == GO_STATE_ACTIVE)
pGO->SetGoState(GO_STATE_READY);
}
}
@@ -236,13 +236,13 @@ struct npc_victorious_challengerAI : public ScriptedAI
if (!UpdateVictim())
return;
if(RendTimer < diff)
if (RendTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_REND_VC, true);
RendTimer = 15000;
}else RendTimer -= diff;
if(SunderArmorTimer < diff)
if (SunderArmorTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_SUNDER_ARMOR, true);
SunderArmorTimer = 10000;
@@ -260,7 +260,7 @@ struct npc_victorious_challengerAI : public ScriptedAI
bool GossipHello_npc_victorious_challenger(Player* pPlayer, Creature* pCreature)
{
if(pCreature->isQuestGiver())
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pPlayer->GetQuestStatus(QUEST_TAKING_ALL_CHALLENGERS) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(QUEST_DEFENDING_YOUR_TITLE) == QUEST_STATUS_INCOMPLETE)
@@ -100,7 +100,7 @@ struct boss_maiden_of_griefAI : public ScriptedAI
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if(pTarget)
if (pTarget)
DoCast(pTarget, SPELL_PARTING_SORROW);
PartingSorrowTimer = 30000 + rand()%10000;
@@ -269,7 +269,7 @@ struct mob_iron_sludgeAI : public ScriptedAI
void JustDied(Unit* pKiller)
{
if (pInstance)
if(Creature* pSjonnir = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SJONNIR)))
if (Creature* pSjonnir = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SJONNIR)))
CAST_AI(boss_sjonnirAI, pSjonnir->AI())->KilledIronSludge();
}
};
@@ -184,7 +184,7 @@ struct mob_tribuna_controllerAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(bKaddrakActivated)
if (bKaddrakActivated)
{
if (uiKaddrakEncounterTimer <= diff)
{
@@ -133,9 +133,9 @@ struct boss_flame_leviathanAI : public BossAI
void SpellHit(Unit *caster, const SpellEntry *spell)
{
if(spell->Id == 62472)
if (spell->Id == 62472)
vehicle->InstallAllAccessories();
else if(spell->Id == SPELL_ELECTROSHOCK)
else if (spell->Id == SPELL_ELECTROSHOCK)
m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL);
}
@@ -166,7 +166,7 @@ struct boss_flame_leviathanAI : public BossAI
DoCastAOE(SPELL_PURSUED, true);
//events.RepeatEvent(35000); // this should not be used because eventId may be overriden
events.RescheduleEvent(EVENT_PURSUE, 35000);
if(!m_creature->getVictim()) // all siege engines and demolishers are dead
if (!m_creature->getVictim()) // all siege engines and demolishers are dead
UpdateVictim(); // begin to kill other things
return;
case EVENT_MISSILE:
@@ -183,8 +183,8 @@ struct boss_flame_leviathanAI : public BossAI
events.RepeatEvent(15000);
return;
case EVENT_SUMMON:
if(summons.size() < 15) // 4seat+1turret+10lift
if(Creature *lift = DoSummonFlyer(MOB_MECHANOLIFT, me, urand(20,40), 50, 0))
if (summons.size() < 15) // 4seat+1turret+10lift
if (Creature *lift = DoSummonFlyer(MOB_MECHANOLIFT, me, urand(20,40), 50, 0))
lift->GetMotionMaster()->MoveRandom(100);
events.RepeatEvent(2000);
return;
@@ -222,7 +222,7 @@ struct boss_flame_leviathan_seatAI : public PassiveAI
#ifdef BOSS_DEBUG
void MoveInLineOfSight(Unit *who)
{
if(who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->isGameMaster()
if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->isGameMaster()
&& !who->GetVehicle() && vehicle->GetPassenger(SEAT_TURRET))
who->EnterVehicle(vehicle, SEAT_PLAYER);
}
@@ -235,16 +235,16 @@ struct boss_flame_leviathan_seatAI : public PassiveAI
if (seatId == SEAT_PLAYER)
{
if(!apply)
if (!apply)
return;
if(Creature *turret = CAST_CRE(vehicle->GetPassenger(SEAT_TURRET)))
if (Creature *turret = CAST_CRE(vehicle->GetPassenger(SEAT_TURRET)))
{
turret->setFaction(m_creature->GetVehicleBase()->getFaction());
turret->SetUInt32Value(UNIT_FIELD_FLAGS, 0); // unselectable
turret->AI()->AttackStart(who);
}
if(Unit *device = vehicle->GetPassenger(SEAT_DEVICE))
if (Unit *device = vehicle->GetPassenger(SEAT_DEVICE))
{
device->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
device->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -288,17 +288,17 @@ struct boss_flame_leviathan_overload_deviceAI : public PassiveAI
void DoAction(const int32 param)
{
if(param == EVENT_SPELLCLICK)
if (param == EVENT_SPELLCLICK)
{
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if(m_creature->GetVehicle())
if (m_creature->GetVehicle())
{
if(Unit *player = m_creature->GetVehicle()->GetPassenger(SEAT_PLAYER))
if (Unit *player = m_creature->GetVehicle()->GetPassenger(SEAT_PLAYER))
{
player->ExitVehicle();
m_creature->GetVehicleBase()->CastSpell(player, SPELL_SMOKE_TRAIL, true);
if(Unit *leviathan = m_creature->GetVehicleBase()->GetVehicleBase())
if (Unit *leviathan = m_creature->GetVehicleBase()->GetVehicleBase())
player->GetMotionMaster()->MoveKnockbackFrom(leviathan->GetPositionX(), leviathan->GetPositionY(), 30, 30);
}
}
@@ -312,9 +312,9 @@ struct boss_flame_leviathan_safety_containerAI : public PassiveAI
void MovementInform(uint32 type, uint32 id)
{
if(id == m_creature->GetEntry())
if (id == m_creature->GetEntry())
{
if(Creature *liquid = DoSummon(MOB_LIQUID, me, 0))
if (Creature *liquid = DoSummon(MOB_LIQUID, me, 0))
liquid->CastSpell(liquid, 62494, true);
m_creature->DisappearAndDie(); // this will relocate creature to sky
}
@@ -322,7 +322,7 @@ struct boss_flame_leviathan_safety_containerAI : public PassiveAI
void UpdateAI(const uint32 diff)
{
if(!m_creature->GetVehicle() && m_creature->isSummon() && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
if (!m_creature->GetVehicle() && m_creature->isSummon() && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
m_creature->GetMotionMaster()->MoveFall(409.8f, m_creature->GetEntry());
}
};
@@ -341,7 +341,7 @@ struct spell_pool_of_tarAI : public TriggerAI
void SpellHit(Unit* caster, const SpellEntry *spell)
{
if(spell->SchoolMask & SPELL_SCHOOL_MASK_FIRE && !m_creature->HasAura(SPELL_BLAZE))
if (spell->SchoolMask & SPELL_SCHOOL_MASK_FIRE && !m_creature->HasAura(SPELL_BLAZE))
m_creature->CastSpell(me, SPELL_BLAZE, true);
}
};
@@ -117,19 +117,19 @@ struct boss_kologarnAI : public BossAI
case EVENT_NONE:
break;
case EVENT_SMASH:
if(left && right)
if (left && right)
DoCastVictim(SPELL_TWO_ARM_SMASH, true);
else if(left || right)
else if (left || right)
DoCastVictim(SPELL_ONE_ARM_SMASH, true);
events.RepeatEvent(15000);
break;
case EVENT_SWEEP:
if(left)
if (left)
DoCastAOE(SPELL_ARM_SWEEP, true);
events.RepeatEvent(15000);
break;
case EVENT_GRIP:
if(right)
if (right)
DoCastAOE(SPELL_STONE_GRIP, true);
events.RepeatEvent(15000);
break;
@@ -110,7 +110,7 @@ struct boss_razorscaleAI : public BossAI
if (!UpdateVictim())
return;
if(m_creature->GetPositionY() > -60 || m_creature->GetPositionX() < 450) // Not Blizzlike, anti-exploit to prevent players from pulling bosses to vehicles.
if (m_creature->GetPositionY() > -60 || m_creature->GetPositionX() < 450) // Not Blizzlike, anti-exploit to prevent players from pulling bosses to vehicles.
{
m_creature->RemoveAllAuras();
m_creature->DeleteThreatList();
@@ -24,21 +24,21 @@ The teleporter appears to be active and stable.
bool GoHello_ulduar_teleporter( Player *pPlayer, GameObject *pGO )
{
ScriptedInstance *pInstance = pGO->GetInstanceData();
if(!pInstance) return true;
if (!pInstance) return true;
pPlayer->ADD_GOSSIP_ITEM(0, "Teleport to the Expedition Base Camp", GOSSIP_SENDER_MAIN, BASE_CAMP);
pPlayer->ADD_GOSSIP_ITEM(0, "Teleport to the Formation Grounds", GOSSIP_SENDER_MAIN, GROUNDS);
if(pInstance->GetData(TYPE_LEVIATHAN) == DONE)
if (pInstance->GetData(TYPE_LEVIATHAN) == DONE)
{
pPlayer->ADD_GOSSIP_ITEM(0, "Teleport to the Colossal Forge", GOSSIP_SENDER_MAIN, FORGE);
if(pInstance->GetData(TYPE_XT002) == DONE)
if (pInstance->GetData(TYPE_XT002) == DONE)
{
pPlayer->ADD_GOSSIP_ITEM(0, "Teleport to the Scrapyard", GOSSIP_SENDER_MAIN, SCRAPYARD);
pPlayer->ADD_GOSSIP_ITEM(0, "Teleport to the Antechamber of Ulduar", GOSSIP_SENDER_MAIN, ANTECHAMBER);
if(pInstance->GetData(TYPE_KOLOGARN) == DONE)
if (pInstance->GetData(TYPE_KOLOGARN) == DONE)
{
pPlayer->ADD_GOSSIP_ITEM(0, "Teleport to the Shattered Walkway", GOSSIP_SENDER_MAIN, WALKWAY);
if(pInstance->GetData(TYPE_AURIAYA) == DONE)
if (pInstance->GetData(TYPE_AURIAYA) == DONE)
pPlayer->ADD_GOSSIP_ITEM(0, "Teleport to the Conservatory of Life", GOSSIP_SENDER_MAIN, CONSERVATORY);
}
}
@@ -50,8 +50,8 @@ bool GoHello_ulduar_teleporter( Player *pPlayer, GameObject *pGO )
bool GOSelect_ulduar_teleporter( Player *pPlayer, GameObject *pGO, uint32 sender, uint32 action )
{
if(sender != GOSSIP_SENDER_MAIN) return true;
if(!pPlayer->getAttackers().empty()) return true;
if (sender != GOSSIP_SENDER_MAIN) return true;
if (!pPlayer->getAttackers().empty()) return true;
switch(action)
{
@@ -145,7 +145,7 @@ struct boss_palehoofAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(currentPhase!=PHASE_GORTOK_PALEHOOF)
if (currentPhase!=PHASE_GORTOK_PALEHOOF)
return;
//Return since we have no target
if (!UpdateVictim())
@@ -194,7 +194,7 @@ struct boss_palehoofAI : public ScriptedAI
void NextPhase()
{
if(currentPhase == PHASE_NONE)
if (currentPhase == PHASE_NONE)
{
pInstance->SetData(DATA_GORTOK_PALEHOOF_EVENT, IN_PROGRESS);
m_creature->SummonCreature(MOB_STASIS_CONTROLLER,moveLocs[5].x,moveLocs[5].y,moveLocs[5].z,0,TEMPSUMMON_CORPSE_DESPAWN);
@@ -208,7 +208,7 @@ struct boss_palehoofAI : public ScriptedAI
uint8 next = urand(0,3);
for (uint8 i=0; i < 16; i++)
{
if(!DoneAdds[i%4] && next == 0)
if (!DoneAdds[i%4] && next == 0)
{
move = (Phase)(i%4);
break;
@@ -223,7 +223,7 @@ struct boss_palehoofAI : public ScriptedAI
Creature *pOrb = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_ORB) : 0);
if (pOrb && pOrb->isAlive())
{
if(currentPhase == PHASE_NONE)
if (currentPhase == PHASE_NONE)
pOrb->CastSpell(m_creature,SPELL_ORB_VISUAL,true);
pOrb->GetMotionMaster()->MovePoint(move,moveLocs[move].x,moveLocs[move].y,moveLocs[move].z);
}
@@ -274,7 +274,7 @@ struct mob_ravenous_furbolgAI : public ScriptedAI
m_creature->GetMotionMaster()->MoveTargetedHome();
if (pInstance)
if(pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT)==IN_PROGRESS)
if (pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT)==IN_PROGRESS)
{
Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
if (pPalehoof && pPalehoof->isAlive())
@@ -380,7 +380,7 @@ struct mob_frenzied_worgenAI : public ScriptedAI
m_creature->GetMotionMaster()->MoveTargetedHome();
if (pInstance)
if(pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT)==IN_PROGRESS)
if (pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT)==IN_PROGRESS)
{
Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
if (pPalehoof && pPalehoof->isAlive())
@@ -489,7 +489,7 @@ struct mob_ferocious_rhinoAI : public ScriptedAI
m_creature->GetMotionMaster()->MoveTargetedHome();
if (pInstance)
if(pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT)==IN_PROGRESS)
if (pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT)==IN_PROGRESS)
{
Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
if (pPalehoof && pPalehoof->isAlive())
@@ -602,7 +602,7 @@ struct mob_massive_jormungarAI : public ScriptedAI
m_creature->GetMotionMaster()->MoveTargetedHome();
if (pInstance)
if(pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT) == IN_PROGRESS)
if (pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT) == IN_PROGRESS)
{
Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
if (pPalehoof && pPalehoof->isAlive())
@@ -702,12 +702,12 @@ struct mob_palehoof_orbAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(currentPhase==PHASE_NONE)
if (currentPhase==PHASE_NONE)
return;
if(SummonTimer<=diff)
if (SummonTimer<=diff)
{
if(currentPhase<5&&currentPhase>=0)
if (currentPhase<5&&currentPhase>=0)
{
Creature *pNext;
switch(currentPhase)
@@ -737,7 +737,7 @@ struct mob_palehoof_orbAI : public ScriptedAI
{
if (type != POINT_MOTION_TYPE)
return;
if(id<0 || id>4)
if (id<0 || id>4)
return;
Creature *pNext;
switch(id)
@@ -748,7 +748,7 @@ struct mob_palehoof_orbAI : public ScriptedAI
case PHASE_FEROCIOUS_RHINO: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_FEROCIOUS_RHINO) : 0); break;
case PHASE_GORTOK_PALEHOOF: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0); break;
}
if(pNext)
if (pNext)
DoCast(pNext, SPELL_ORB_CHANNEL, false);
currentPhase=(Phase)id;
SummonTimer=5000;
@@ -186,7 +186,7 @@ struct boss_skadiAI : public ScriptedAI
void MovementInform(uint32 type, uint32 id)
{
if(type != POINT_MOTION_TYPE)
if (type != POINT_MOTION_TYPE)
return;
if (uiSpawnCounter >= DUNGEON_MODE(4, 5))
@@ -116,7 +116,7 @@ struct boss_emalonAI : public BossAI
switch(eventId)
{
case EVENT_CHAIN_LIGHTNING:
if(Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_CHAIN_LIGHTNING);
events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 25000);
break;
@@ -175,7 +175,7 @@ struct mob_tempest_minionAI : public ScriptedAI
void JustDied(Unit* Killer)
{
if(Creature *pEmalon = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EMALON) : 0))
if (Creature *pEmalon = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EMALON) : 0))
{
if (pEmalon->isAlive())
{
@@ -190,7 +190,7 @@ struct mob_tempest_minionAI : public ScriptedAI
DoZoneInCombat();
events.ScheduleEvent(EVENT_SHOCK, 20000);
if(Creature *pEmalon = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EMALON) : 0))
if (Creature *pEmalon = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_EMALON) : 0))
{
if (!pEmalon->getVictim() && pEmalon->AI())
pEmalon->AI()->AttackStart(who);
@@ -158,7 +158,7 @@ struct boss_erekemAI : public ScriptedAI
{
if (uint64 TargetGUID = GetChainHealTargetGUID())
{
if(Creature *pTarget = Unit::GetCreature(*m_creature, TargetGUID))
if (Creature *pTarget = Unit::GetCreature(*m_creature, TargetGUID))
DoCast(pTarget, DUNGEON_MODE(SPELL_CHAIN_HEAL, H_SPELL_CHAIN_HEAL));
//If one of the adds is dead spawn heals faster
@@ -50,7 +50,7 @@ struct boss_moraggAI : public ScriptedAI
if (pInstance)
{
if (GameObject *pDoor = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_MORAGG_CELL)))
if(pDoor->GetGoState() == GO_STATE_READY)
if (pDoor->GetGoState() == GO_STATE_READY)
{
EnterEvadeMode();
return;
+1 -1
View File
@@ -544,7 +544,7 @@ struct npc_orinoko_tuskbreakerAI : public ScriptedAI
pSummon->AI()->AttackStart(m_creature->getVictim());
break;
case NPC_HUNGRY_PENGUIN:
if(Unit *pAffected = Unit::GetUnit(*m_creature, AffectedGUID))
if (Unit *pAffected = Unit::GetUnit(*m_creature, AffectedGUID))
{
if (pAffected->isAlive())
pSummon->AI()->AttackStart(pAffected);
@@ -89,7 +89,7 @@ struct mob_voidtravelerAI : public ScriptedAI
if (move <= diff)
{
Creature *Vorpil = Unit::GetCreature(*m_creature, VorpilGUID);
if(!Vorpil)
if (!Vorpil)
{
VorpilGUID = 0;
return;
@@ -1003,7 +1003,7 @@ struct npc_akama_illidanAI : public ScriptedAI
DoorGUID[0] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_R);
DoorGUID[1] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_L);
if(JustCreated)//close all doors at create
if (JustCreated)//close all doors at create
{
pInstance->HandleGameObject(GateGUID, false);
@@ -1058,7 +1058,7 @@ struct npc_akama_illidanAI : public ScriptedAI
void MovementInform(uint32 MovementType, uint32 Data)
{
if(MovementType == POINT_MOTION_TYPE)
if (MovementType == POINT_MOTION_TYPE)
Timer = 1;
}
@@ -1107,7 +1107,7 @@ struct npc_akama_illidanAI : public ScriptedAI
{
m_creature->setActive(true);
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
if(!JustCreated)
if (!JustCreated)
return;
float x, y, z;
if (GETGO(Gate, GateGUID))
@@ -1259,7 +1259,7 @@ struct npc_akama_illidanAI : public ScriptedAI
m_creature->InterruptNonMeleeSpells(true);
Spirit[0]->InterruptNonMeleeSpells(true);
Spirit[1]->InterruptNonMeleeSpells(true);
if(pInstance)
if (pInstance)
pInstance->HandleGameObject(GateGUID, true);
Timer = 2000;
break;
@@ -1290,7 +1290,7 @@ struct npc_akama_illidanAI : public ScriptedAI
{
case 6:
for (uint8 i = 0; i < 2; ++i)
if(pInstance)
if (pInstance)
pInstance->HandleGameObject(DoorGUID[i], true);
break;
case 8:
@@ -1314,11 +1314,11 @@ struct npc_akama_illidanAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(m_creature->GetVisibility() == VISIBILITY_OFF)
if (m_creature->GetVisibility() == VISIBILITY_OFF)
{
if (Check_Timer <= diff)
{
if(pInstance && pInstance->GetData(DATA_ILLIDARICOUNCILEVENT) == DONE)
if (pInstance && pInstance->GetData(DATA_ILLIDARICOUNCILEVENT) == DONE)
m_creature->SetVisibility(VISIBILITY_ON);
Check_Timer = 5000;
@@ -1337,7 +1337,7 @@ struct npc_akama_illidanAI : public ScriptedAI
switch(Phase)
{
case PHASE_CHANNEL:
if(JustCreated)
if (JustCreated)
HandleChannelSequence();
else{
EnterPhase(PHASE_WALK);
@@ -98,7 +98,7 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
bool CheckCanStart()//check if players fished
{
if(pInstance && pInstance->GetData(DATA_STRANGE_POOL) == NOT_STARTED)
if (pInstance && pInstance->GetData(DATA_STRANGE_POOL) == NOT_STARTED)
return false;
return true;
}
@@ -151,7 +151,7 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
void MoveInLineOfSight(Unit *who)
{
if(!CanStartEvent)//boss is invisible, don't attack
if (!CanStartEvent)//boss is invisible, don't attack
return;
if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)))
{
@@ -165,17 +165,17 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
void MovementInform(uint32 type, uint32 id)
{
if(type == ROTATE_MOTION_TYPE)
if (type == ROTATE_MOTION_TYPE)
me->SetReactState(REACT_AGGRESSIVE);
}
void UpdateAI(const uint32 diff)
{
if(!CanStartEvent)//boss is invisible, don't attack
if (!CanStartEvent)//boss is invisible, don't attack
{
if(CheckCanStart())
if (CheckCanStart())
{
if(Submerged)
if (Submerged)
{
m_creature->SetVisibility(VISIBILITY_ON);
Submerged = false;
@@ -201,9 +201,9 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
return;
}
if(m_creature->getThreatManager().getThreatList().empty())//check if should evade
if (m_creature->getThreatManager().getThreatList().empty())//check if should evade
{
if(m_creature->isInCombat())
if (m_creature->isInCombat())
EnterEvadeMode();
return;
}
@@ -244,14 +244,14 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
{
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if(m_creature->IsWithinMeleeRange(i->getSource()))
if (m_creature->IsWithinMeleeRange(i->getSource()))
InRange = true;
}
}
CheckTimer = 2000;
} else CheckTimer -= diff;
if(RotTimer)
if (RotTimer)
{
Map* pMap = m_creature->GetMap();
if (pMap->IsDungeon())
@@ -287,7 +287,7 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
GeyserTimer = rand()%5000 + 15000;
} else GeyserTimer -= diff;
if(!InRange)//if on players in melee range cast Waterbolt
if (!InRange)//if on players in melee range cast Waterbolt
{
if (WaterboltTimer <= diff)
{
@@ -321,7 +321,7 @@ struct boss_the_lurker_belowAI : public Scripted_NoMovementAI
return;
} else PhaseTimer-=diff;
if(m_creature->getThreatManager().getThreatList().empty())//check if should evade
if (m_creature->getThreatManager().getThreatList().empty())//check if should evade
{
EnterEvadeMode();
return;
@@ -131,7 +131,7 @@ struct instance_serpentshrine_cavern : public ScriptedInstance
void Update (uint32 diff)
{
//Lurker Fishing event
if(LurkerSubEvent == LURKER_FISHING)
if (LurkerSubEvent == LURKER_FISHING)
{
if (FishingTimer <= diff)
{
@@ -142,7 +142,7 @@ struct instance_serpentshrine_cavern : public ScriptedInstance
//Water checks
if (WaterCheckTimer <= diff)
{
if(TrashCount >= MIN_KILLS)
if (TrashCount >= MIN_KILLS)
Water = WATERSTATE_SCALDING;
else
Water = WATERSTATE_FRENZY;
@@ -156,19 +156,19 @@ struct instance_serpentshrine_cavern : public ScriptedInstance
{
if (pPlayer->isAlive() && /*i->getSource()->GetPositionZ() <= -21.434931f*/pPlayer->IsInWater())
{
if(Water == WATERSTATE_SCALDING)
if (Water == WATERSTATE_SCALDING)
{
if(!pPlayer->HasAura(SPELL_SCALDINGWATER))
if (!pPlayer->HasAura(SPELL_SCALDINGWATER))
{
pPlayer->CastSpell(pPlayer, SPELL_SCALDINGWATER,true);
}
} else if(Water == WATERSTATE_FRENZY)
} else if (Water == WATERSTATE_FRENZY)
{
//spawn frenzy
if(DoSpawnFrenzy)
if (DoSpawnFrenzy)
{
if(Creature* frenzy = pPlayer->SummonCreature(MOB_COILFANG_FRENZY,pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ(),pPlayer->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,2000))
if (Creature* frenzy = pPlayer->SummonCreature(MOB_COILFANG_FRENZY,pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ(),pPlayer->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,2000))
{
frenzy->Attack(pPlayer,false);
frenzy->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING);
@@ -177,7 +177,7 @@ struct instance_serpentshrine_cavern : public ScriptedInstance
}
}
}
if(!pPlayer->IsInWater())
if (!pPlayer->IsInWater())
pPlayer->RemoveAurasDueToSpell(SPELL_SCALDINGWATER);
}
@@ -215,7 +215,7 @@ struct instance_serpentshrine_cavern : public ScriptedInstance
pGo->setActive(true);
break;
case GAMEOBJECT_FISHINGNODE_ENTRY://no way checking if fish is hooked, so we create a timed event
if(LurkerSubEvent == LURKER_NOT_STARTED)
if (LurkerSubEvent == LURKER_NOT_STARTED)
{
FishingTimer = 10000+rand()%30000;//random time before lurker emerges
LurkerSubEvent = LURKER_FISHING;
@@ -237,7 +237,7 @@ struct instance_serpentshrine_cavern : public ScriptedInstance
case 21215: LeotherasTheBlind = pCreature->GetGUID(); break;
/*case TRASHMOB_COILFANG_PRIESTESS:
case TRASHMOB_COILFANG_SHATTERER:
if(pCreature->isAlive())
if (pCreature->isAlive())
++TrashCount;
break;*/
}
@@ -275,7 +275,7 @@ struct instance_serpentshrine_cavern : public ScriptedInstance
case DATA_STRANGE_POOL:
{
StrangePool = data;
if(data == NOT_STARTED)
if (data == NOT_STARTED)
LurkerSubEvent = LURKER_NOT_STARTED;
}
break;
@@ -289,7 +289,7 @@ struct instance_serpentshrine_cavern : public ScriptedInstance
ControlConsole = data;break;
case DATA_TRASH :
{
if(data == 1 && TrashCount < MIN_KILLS)
if (data == 1 && TrashCount < MIN_KILLS)
++TrashCount;//+1 died
SaveToDB();
break;
@@ -181,7 +181,7 @@ struct boss_high_king_maulgarAI : public ScriptedAI
void GetCouncil()
{
if(pInstance)
if (pInstance)
{
//get council member's guid to respawn them if needed
Council[0] = pInstance->GetData64(DATA_KIGGLERTHECRAZED);
+4 -4
View File
@@ -711,7 +711,7 @@ struct mob_phase_hunterAI : public ScriptedAI
ManaBurnTimer = 5000 + (rand() % 3 * 1000); // 5-8 sec cd
if(m_creature->GetEntry() == NPC_DRAINED_PHASE_HUNTER_ENTRY)
if (m_creature->GetEntry() == NPC_DRAINED_PHASE_HUNTER_ENTRY)
m_creature->UpdateEntry(NPC_PHASE_HUNTER_ENTRY);
}
@@ -748,13 +748,13 @@ struct mob_phase_hunterAI : public ScriptedAI
for (std::list<HostileReference*>::const_iterator itr = AggroList.begin(); itr != AggroList.end(); ++itr)
{
if(Unit *pUnit = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
if (Unit *pUnit = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
{
if(pUnit->GetCreateMana() > 0)
if (pUnit->GetCreateMana() > 0)
UnitsWithMana.push_back(pUnit);
}
}
if(!UnitsWithMana.empty())
if (!UnitsWithMana.empty())
{
std::list<Unit*>::const_iterator it = UnitsWithMana.begin();
std::advance(it, rand() % UnitsWithMana.size());
+1 -1
View File
@@ -281,7 +281,7 @@ struct mob_enslaved_netherwing_drakeAI : public ScriptedAI
dz += 20; // so it's in the air, not ground*/
Position pos;
if(Unit* EscapeDummy = me->FindNearestCreature(CREATURE_ESCAPE_DUMMY, 30))
if (Unit* EscapeDummy = me->FindNearestCreature(CREATURE_ESCAPE_DUMMY, 30))
EscapeDummy->GetPosition(&pos);
else
{
@@ -214,7 +214,7 @@ struct boss_high_astromancer_solarianAI : public ScriptedAI
if (Wrath_Timer <= diff)
{
m_creature->InterruptNonMeleeSpells(false);
if(Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER, true);
Wrath_Timer = 20000+rand()%5000;
} else Wrath_Timer -= diff;
@@ -613,7 +613,7 @@ struct boss_kaelthasAI : public ScriptedAI
if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD))
{
Phase = 2;
if(m_pInstance)
if (m_pInstance)
m_pInstance->SetData(DATA_KAELTHASEVENT, 2);
DoScriptText(SAY_PHASE2_WEAPON, m_creature);
@@ -656,7 +656,7 @@ struct boss_kaelthasAI : public ScriptedAI
if (Phase_Timer <= diff)
{
DoScriptText(SAY_PHASE3_ADVANCE, m_creature);
if(m_pInstance)
if (m_pInstance)
m_pInstance->SetData(DATA_KAELTHASEVENT, 3);
Phase = 3;
PhaseSubphase = 0;
@@ -692,7 +692,7 @@ struct boss_kaelthasAI : public ScriptedAI
DoScriptText(SAY_PHASE4_INTRO2, m_creature);
Phase = 4;
if(m_pInstance)
if (m_pInstance)
m_pInstance->SetData(DATA_KAELTHASEVENT, 4);
// Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael.
@@ -785,7 +785,7 @@ struct boss_kaelthasAI : public ScriptedAI
{
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
{
if(m_pInstance)
if (m_pInstance)
m_pInstance->SetData(DATA_KAELTHASEVENT, 4);
Phase = 5;
Phase_Timer = 10000;
+5 -5
View File
@@ -505,28 +505,28 @@ bool GOHello_go_matrix_punchograph(Player *pPlayer, GameObject *pGO)
switch(pGO->GetEntry())
{
case MATRIX_PUNCHOGRAPH_3005_A:
if(pPlayer->HasItemCount(ITEM_WHITE_PUNCH_CARD, 1))
if (pPlayer->HasItemCount(ITEM_WHITE_PUNCH_CARD, 1))
{
pPlayer->DestroyItemCount(ITEM_WHITE_PUNCH_CARD, 1, true);
pPlayer->CastSpell(pPlayer,SPELL_YELLOW_PUNCH_CARD,true);
}
break;
case MATRIX_PUNCHOGRAPH_3005_B:
if(pPlayer->HasItemCount(ITEM_YELLOW_PUNCH_CARD, 1))
if (pPlayer->HasItemCount(ITEM_YELLOW_PUNCH_CARD, 1))
{
pPlayer->DestroyItemCount(ITEM_YELLOW_PUNCH_CARD, 1, true);
pPlayer->CastSpell(pPlayer,SPELL_BLUE_PUNCH_CARD,true);
}
break;
case MATRIX_PUNCHOGRAPH_3005_C:
if(pPlayer->HasItemCount(ITEM_BLUE_PUNCH_CARD, 1))
if (pPlayer->HasItemCount(ITEM_BLUE_PUNCH_CARD, 1))
{
pPlayer->DestroyItemCount(ITEM_BLUE_PUNCH_CARD, 1, true);
pPlayer->CastSpell(pPlayer,SPELL_RED_PUNCH_CARD,true);
}
break;
case MATRIX_PUNCHOGRAPH_3005_D:
if(pPlayer->HasItemCount(ITEM_RED_PUNCH_CARD, 1))
if (pPlayer->HasItemCount(ITEM_RED_PUNCH_CARD, 1))
{
pPlayer->DestroyItemCount(ITEM_RED_PUNCH_CARD, 1, true);
pPlayer->CastSpell(pPlayer, SPELL_PRISMATIC_PUNCH_CARD, true);
@@ -549,7 +549,7 @@ enum eRustyCage
bool GOHello_go_rusty_cage(Player *pPlayer, GameObject *pGO)
{
if(Creature *pGoblinPrisoner = pGO->FindNearestCreature(NPC_GOBLIN_PRISIONER, 5.0f, true))
if (Creature *pGoblinPrisoner = pGO->FindNearestCreature(NPC_GOBLIN_PRISIONER, 5.0f, true))
{
pGO->SetGoState(GO_STATE_ACTIVE);
pPlayer->KilledMonsterCredit(NPC_GOBLIN_PRISIONER, pGoblinPrisoner->GetGUID());
+3 -3
View File
@@ -1250,7 +1250,7 @@ bool GossipSelect_npc_rogue_trainer(Player* pPlayer, Creature* pCreature, uint32
pPlayer->SendTalentWipeConfirm(pCreature->GetGUID());
break;
case GOSSIP_OPTION_LEARNDUALSPEC:
if(pPlayer->GetSpecsCount() == 1 && !(pPlayer->getLevel() < sWorld.getConfig(CONFIG_MIN_DUALSPEC_LEVEL)))
if (pPlayer->GetSpecsCount() == 1 && !(pPlayer->getLevel() < sWorld.getConfig(CONFIG_MIN_DUALSPEC_LEVEL)))
{
if (pPlayer->GetMoney() < 10000000)
{
@@ -1805,7 +1805,7 @@ struct npc_ebon_gargoyleAI : CasterAI
Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(m_creature, targets, u_check);
m_creature->VisitNearbyObject(30, searcher);
for (std::list<Unit*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
if((*iter)->GetAura(49206,owner->GetGUID()))
if ((*iter)->GetAura(49206,owner->GetGUID()))
{
me->Attack((*iter),false);
break;
@@ -1822,7 +1822,7 @@ struct npc_ebon_gargoyleAI : CasterAI
// Fly away when dismissed
void SpellHit(Unit *source, const SpellEntry *spell)
{
if(spell->Id != 50515 || !me->isAlive() )
if (spell->Id != 50515 || !me->isAlive() )
return;
Unit *owner = me->GetOwner();