mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Misc: Remove trailing whitespace, compile warnings and minor cosmetic changes
This commit is contained in:
@@ -25,7 +25,7 @@ namespace MMAP
|
||||
{
|
||||
// ######################## MMapFactory ########################
|
||||
// our global singleton copy
|
||||
MMapManager *g_MMapManager = NULL;
|
||||
MMapManager* g_MMapManager = NULL;
|
||||
|
||||
MMapManager* MMapFactory::createOrGetMMapManager()
|
||||
{
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace MMAP
|
||||
|
||||
snprintf(fileName, pathLen, (sWorld->GetDataPath()+"mmaps/%03i%02i%02i.mmtile").c_str(), mapId, x, y);
|
||||
|
||||
FILE *file = fopen(fileName, "rb");
|
||||
FILE* file = fopen(fileName, "rb");
|
||||
if (!file)
|
||||
{
|
||||
TC_LOG_DEBUG(LOG_FILTER_MAPS, "MMAP:loadMap: Could not open mmtile file '%s'", fileName);
|
||||
@@ -156,7 +156,7 @@ namespace MMAP
|
||||
{
|
||||
mmap->mmapLoadedTiles.insert(std::pair<uint32, dtTileRef>(packedGridPos, tileRef));
|
||||
++loadedTiles;
|
||||
TC_LOG_INFO(LOG_FILTER_MAPS, "MMAP:loadMap: Loaded mmtile %03i[%02i,%02i] into %03i[%02i,%02i]", mapId, x, y, mapId, header->x, header->y);
|
||||
TC_LOG_INFO(LOG_FILTER_MAPS, "MMAP:loadMap: Loaded mmtile %03i[%02i, %02i] into %03i[%02i, %02i]", mapId, x, y, mapId, header->x, header->y);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -205,7 +205,7 @@ namespace MMAP
|
||||
{
|
||||
mmap->mmapLoadedTiles.erase(packedGridPos);
|
||||
--loadedTiles;
|
||||
TC_LOG_INFO(LOG_FILTER_MAPS, "MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId);
|
||||
TC_LOG_INFO(LOG_FILTER_MAPS, "MMAP:unloadMap: Unloaded mmtile %03i[%02i, %02i] from %03i", mapId, x, y, mapId);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ namespace MMAP
|
||||
else
|
||||
{
|
||||
--loadedTiles;
|
||||
TC_LOG_INFO(LOG_FILTER_MAPS, "MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId);
|
||||
TC_LOG_INFO(LOG_FILTER_MAPS, "MMAP:unloadMap: Unloaded mmtile %03i[%02i, %02i] from %03i", mapId, x, y, mapId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1046,7 +1046,7 @@ const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX][4] =
|
||||
{ 13326, 1216, 59, 59 }, //Seasoned Defender
|
||||
{ 13331, 1216, 60, 60 }, //Veteran Defender
|
||||
{ 13422, 1216, 61, 61 }, //Champion Defender
|
||||
{ 13358, 1216, 59, 60 }, //Stormpike Bowman /// @todo: Confirm if this is correct. Author assumpted 60,61 & 69,70, but wouldn't work here
|
||||
{ 13358, 1216, 59, 60 }, //Stormpike Bowman /// @todo: Confirm if this is correct. Author assumpted 60, 61 & 69, 70, but wouldn't work here
|
||||
{ 11949, 469, 0, 0}, //not spawned with this data, but used for handlekillunit
|
||||
{ 11948, 469, 0, 0}, //not spawned with this data, but used for handlekillunit
|
||||
{ 12053, 1214, 58, 58 }, //Frostwolf Guardian
|
||||
|
||||
@@ -418,7 +418,7 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 typ
|
||||
* @author Machiavelli
|
||||
* @date 17-2-2013
|
||||
*
|
||||
* @param [in,out] The prospective passenger.
|
||||
* @param [in, out] The prospective passenger.
|
||||
* @param seatId Identifier for the seat. Value of -1 indicates the next available seat.
|
||||
*
|
||||
* @return true if it succeeds, false if it fails.
|
||||
@@ -493,7 +493,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
|
||||
* @author Machiavelli
|
||||
* @date 17-2-2013
|
||||
*
|
||||
* @param [in,out] unit The passenger to remove.
|
||||
* @param [in, out] unit The passenger to remove.
|
||||
*/
|
||||
|
||||
void Vehicle::RemovePassenger(Unit* unit)
|
||||
@@ -616,7 +616,7 @@ void Vehicle::InitMovementInfoForBase()
|
||||
* @author Machiavelli
|
||||
* @date 17-2-2013
|
||||
*
|
||||
* @param [in,out] The passenger for which we check the seat info.
|
||||
* @param [in, out] The passenger for which we check the seat info.
|
||||
*
|
||||
* @return null if passenger not found on vehicle, else the DBC record for the seat.
|
||||
*/
|
||||
@@ -638,7 +638,7 @@ VehicleSeatEntry const* Vehicle::GetSeatForPassenger(Unit const* passenger) cons
|
||||
* @author Machiavelli
|
||||
* @date 17-2-2013
|
||||
*
|
||||
* @param [in,out] passenger Passenger to look up.
|
||||
* @param [in, out] passenger Passenger to look up.
|
||||
*
|
||||
* @return The seat iterator for specified passenger if it's found on the vehicle. Otherwise Seats.end() (invalid iterator).
|
||||
*/
|
||||
|
||||
@@ -289,7 +289,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
|
||||
// If player is a Gamemaster and doesn't accept whisper, we auto-whitelist every player that the Gamemaster is talking to
|
||||
// We also do that if a player is under the required level for whispers.
|
||||
if (receiver->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) ||
|
||||
if (receiver->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) ||
|
||||
(HasPermission(RBAC_PERM_CAN_FILTER_WHISPERS) && !sender->isAcceptWhispers() && !sender->IsInWhisperWhiteList(receiver->GetGUID())))
|
||||
sender->AddWhisperWhiteList(receiver->GetGUID());
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "Player.h"
|
||||
|
||||
template<class T, typename D>
|
||||
void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T* owner, bool updateDestination)
|
||||
void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T* owner, bool updateDestination)
|
||||
{
|
||||
if (!i_target.isValid() || !i_target->IsInWorld())
|
||||
return;
|
||||
@@ -117,7 +117,7 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T* owner, bool upd
|
||||
}
|
||||
|
||||
template<class T, typename D>
|
||||
bool TargetedMovementGeneratorMedium<T,D>::DoUpdate(T* owner, uint32 time_diff)
|
||||
bool TargetedMovementGeneratorMedium<T, D>::DoUpdate(T* owner, uint32 time_diff)
|
||||
{
|
||||
if (!i_target.isValid() || !i_target->IsInWorld())
|
||||
return false;
|
||||
@@ -185,7 +185,7 @@ template<class T>
|
||||
void ChaseMovementGenerator<T>::_reachTarget(T* owner)
|
||||
{
|
||||
if (owner->IsWithinMeleeRange(this->i_target.getTarget()))
|
||||
owner->Attack(this->i_target.getTarget(),true);
|
||||
owner->Attack(this->i_target.getTarget(), true);
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -303,14 +303,14 @@ void FollowMovementGenerator<Creature>::MovementInform(Creature* unit)
|
||||
}
|
||||
|
||||
//-----------------------------------------------//
|
||||
template void TargetedMovementGeneratorMedium<Player,ChaseMovementGenerator<Player> >::_setTargetLocation(Player*, bool);
|
||||
template void TargetedMovementGeneratorMedium<Player,FollowMovementGenerator<Player> >::_setTargetLocation(Player*, bool);
|
||||
template void TargetedMovementGeneratorMedium<Creature,ChaseMovementGenerator<Creature> >::_setTargetLocation(Creature*, bool);
|
||||
template void TargetedMovementGeneratorMedium<Creature,FollowMovementGenerator<Creature> >::_setTargetLocation(Creature*, bool);
|
||||
template bool TargetedMovementGeneratorMedium<Player,ChaseMovementGenerator<Player> >::DoUpdate(Player*, uint32);
|
||||
template bool TargetedMovementGeneratorMedium<Player,FollowMovementGenerator<Player> >::DoUpdate(Player*, uint32);
|
||||
template bool TargetedMovementGeneratorMedium<Creature,ChaseMovementGenerator<Creature> >::DoUpdate(Creature*, uint32);
|
||||
template bool TargetedMovementGeneratorMedium<Creature,FollowMovementGenerator<Creature> >::DoUpdate(Creature*, uint32);
|
||||
template void TargetedMovementGeneratorMedium<Player, ChaseMovementGenerator<Player> >::_setTargetLocation(Player*, bool);
|
||||
template void TargetedMovementGeneratorMedium<Player, FollowMovementGenerator<Player> >::_setTargetLocation(Player*, bool);
|
||||
template void TargetedMovementGeneratorMedium<Creature, ChaseMovementGenerator<Creature> >::_setTargetLocation(Creature*, bool);
|
||||
template void TargetedMovementGeneratorMedium<Creature, FollowMovementGenerator<Creature> >::_setTargetLocation(Creature*, bool);
|
||||
template bool TargetedMovementGeneratorMedium<Player, ChaseMovementGenerator<Player> >::DoUpdate(Player*, uint32);
|
||||
template bool TargetedMovementGeneratorMedium<Player, FollowMovementGenerator<Player> >::DoUpdate(Player*, uint32);
|
||||
template bool TargetedMovementGeneratorMedium<Creature, ChaseMovementGenerator<Creature> >::DoUpdate(Creature*, uint32);
|
||||
template bool TargetedMovementGeneratorMedium<Creature, FollowMovementGenerator<Creature> >::DoUpdate(Creature*, uint32);
|
||||
|
||||
template void ChaseMovementGenerator<Player>::_reachTarget(Player*);
|
||||
template void ChaseMovementGenerator<Creature>::_reachTarget(Creature*);
|
||||
|
||||
@@ -701,7 +701,7 @@ dtStatus PathGenerator::FindSmoothPath(float const* startPos, float const* endPo
|
||||
// Find movement delta.
|
||||
float delta[VERTEX_SIZE];
|
||||
dtVsub(delta, steerPos, iterPos);
|
||||
float len = dtSqrt(dtVdot(delta,delta));
|
||||
float len = dtSqrt(dtVdot(delta, delta));
|
||||
// If the steer target is end of path or off-mesh link, do not move past the location.
|
||||
if ((endOfPath || offMeshConnection) && len < SMOOTH_PATH_STEP_SIZE)
|
||||
len = 1.0f;
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace Movement
|
||||
}
|
||||
|
||||
PacketBuilder::WriteMonsterMove(move_spline, data);
|
||||
unit->SendMessageToSet(&data,true);
|
||||
unit->SendMessageToSet(&data, true);
|
||||
|
||||
return move_spline.Duration();
|
||||
}
|
||||
|
||||
@@ -91,13 +91,13 @@ public:
|
||||
@param t - percent of segment length, assumes that t in range [0, 1]
|
||||
@param Idx - spline segment index, should be in range [first, last)
|
||||
*/
|
||||
void evaluate_percent(index_type Idx, float u, Vector3& c) const {(this->*evaluators[m_mode])(Idx, u,c);}
|
||||
void evaluate_percent(index_type Idx, float u, Vector3& c) const {(this->*evaluators[m_mode])(Idx, u, c);}
|
||||
|
||||
/** Caclulates derivation in index Idx, and percent of segment length t
|
||||
@param Idx - spline segment index, should be in range [first, last)
|
||||
@param t - percent of spline segment length, assumes that t in range [0, 1]
|
||||
*/
|
||||
void evaluate_derivative(index_type Idx, float u, Vector3& hermite) const {(this->*derivative_evaluators[m_mode])(Idx, u,hermite);}
|
||||
void evaluate_derivative(index_type Idx, float u, Vector3& hermite) const {(this->*derivative_evaluators[m_mode])(Idx, u, hermite);}
|
||||
|
||||
/** Bounds for spline indexes. All indexes should be in range [first, last). */
|
||||
index_type first() const { return index_lo;}
|
||||
@@ -156,12 +156,12 @@ public:
|
||||
/** Calculates the position for given segment Idx, and percent of segment length t
|
||||
@param t = partial_segment_length / whole_segment_length
|
||||
@param Idx - spline segment index, should be in range [first, last). */
|
||||
void evaluate_percent(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_percent(Idx, u,c);}
|
||||
void evaluate_percent(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_percent(Idx, u, c);}
|
||||
|
||||
/** Caclulates derivation for index Idx, and percent of segment length t
|
||||
@param Idx - spline segment index, should be in range [first, last)
|
||||
@param t - percent of spline segment length, assumes that t in range [0, 1]. */
|
||||
void evaluate_derivative(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_derivative(Idx, u,c);}
|
||||
void evaluate_derivative(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_derivative(Idx, u, c);}
|
||||
|
||||
// Assumes that t in range [0, 1]
|
||||
index_type computeIndexInBounds(float t) const;
|
||||
@@ -169,7 +169,7 @@ public:
|
||||
|
||||
/** Initializes spline. Don't call other methods while spline not initialized. */
|
||||
void init_spline(const Vector3 * controls, index_type count, EvaluationMode m) { SplineBase::init_spline(controls, count, m);}
|
||||
void init_cyclic_spline(const Vector3 * controls, index_type count, EvaluationMode m, index_type cyclic_point) { SplineBase::init_cyclic_spline(controls, count, m,cyclic_point);}
|
||||
void init_cyclic_spline(const Vector3 * controls, index_type count, EvaluationMode m, index_type cyclic_point) { SplineBase::init_cyclic_spline(controls, count, m, cyclic_point);}
|
||||
|
||||
/** Initializes lengths with SplineBase::SegLength method. */
|
||||
void initLengths();
|
||||
|
||||
@@ -40,13 +40,13 @@ class Path
|
||||
void erase(uint32 idx) { i_nodes.erase(i_nodes.begin()+idx); }
|
||||
void crop(unsigned int start, unsigned int end)
|
||||
{
|
||||
while(start && !i_nodes.empty())
|
||||
while (start && !i_nodes.empty())
|
||||
{
|
||||
i_nodes.pop_front();
|
||||
--start;
|
||||
}
|
||||
|
||||
while(end && !i_nodes.empty())
|
||||
while (end && !i_nodes.empty())
|
||||
{
|
||||
i_nodes.pop_back();
|
||||
--end;
|
||||
|
||||
@@ -320,7 +320,7 @@ public:
|
||||
// check online security
|
||||
if (handler->HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
|
||||
playerOldName = target->GetName();
|
||||
}
|
||||
else
|
||||
@@ -345,7 +345,7 @@ public:
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (WorldSession* session = handler->GetSession())
|
||||
{
|
||||
if (!session->HasPermission(RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RESERVEDNAME) && sObjectMgr->IsReservedName(newName))
|
||||
|
||||
@@ -518,7 +518,7 @@ public:
|
||||
uint32 copp = (money % GOLD) % SILVER;
|
||||
std::string receiverStr = handler->playerLink(receiver);
|
||||
std::string senderStr = handler->playerLink(sender);
|
||||
handler->PSendSysMessage(LANG_LIST_MAIL_INFO_1 , messageId, subject.c_str(),gold, silv, copp);
|
||||
handler->PSendSysMessage(LANG_LIST_MAIL_INFO_1, messageId, subject.c_str(), gold, silv, copp);
|
||||
handler->PSendSysMessage(LANG_LIST_MAIL_INFO_2, senderStr.c_str(), senderId, receiverStr.c_str(), receiverId);
|
||||
handler->PSendSysMessage(LANG_LIST_MAIL_INFO_3, TimeToTimestampStr(deliverTime).c_str(), TimeToTimestampStr(expireTime).c_str());
|
||||
if (hasItem == 1)
|
||||
@@ -541,7 +541,7 @@ public:
|
||||
uint32 item_entry = fields[0].GetUInt32();
|
||||
uint32 item_count = fields[1].GetUInt32();
|
||||
QueryResult result4;
|
||||
result4 = WorldDatabase.PQuery("SELECT name,quality FROM item_template WHERE entry = '%u'", item_entry);
|
||||
result4 = WorldDatabase.PQuery("SELECT name, quality FROM item_template WHERE entry = '%u'", item_entry);
|
||||
Field* fields1 = result4->Fetch();
|
||||
std::string item_name = fields1[0].GetString();
|
||||
int item_quality = fields1[1].GetUInt8();
|
||||
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
int32 gy = 32 - player->GetPositionY() / SIZE_OF_GRIDS;
|
||||
|
||||
handler->PSendSysMessage("%03u%02i%02i.mmtile", player->GetMapId(), gy, gx);
|
||||
handler->PSendSysMessage("gridloc [%i,%i]", gx, gy);
|
||||
handler->PSendSysMessage("gridloc [%i, %i]", gx, gy);
|
||||
|
||||
// calculate navmesh tile location
|
||||
dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId());
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
int32 tilex = int32((y - min[0]) / SIZE_OF_GRIDS);
|
||||
int32 tiley = int32((x - min[2]) / SIZE_OF_GRIDS);
|
||||
|
||||
handler->PSendSysMessage("Calc [%02i,%02i]", tilex, tiley);
|
||||
handler->PSendSysMessage("Calc [%02i, %02i]", tilex, tiley);
|
||||
|
||||
// navmesh poly -> navmesh tile location
|
||||
dtQueryFilter filter = dtQueryFilter();
|
||||
@@ -156,16 +156,16 @@ public:
|
||||
navmeshquery->findNearestPoly(location, extents, &filter, &polyRef, NULL);
|
||||
|
||||
if (polyRef == INVALID_POLYREF)
|
||||
handler->PSendSysMessage("Dt [??,??] (invalid poly, probably no tile loaded)");
|
||||
handler->PSendSysMessage("Dt [??, ??] (invalid poly, probably no tile loaded)");
|
||||
else
|
||||
{
|
||||
dtMeshTile const* tile;
|
||||
dtPoly const* poly;
|
||||
navmesh->getTileAndPolyByRef(polyRef, &tile, &poly);
|
||||
if (tile)
|
||||
handler->PSendSysMessage("Dt [%02i,%02i]", tile->header->x, tile->header->y);
|
||||
handler->PSendSysMessage("Dt [%02i, %02i]", tile->header->x, tile->header->y);
|
||||
else
|
||||
handler->PSendSysMessage("Dt [??,??] (no tile loaded)");
|
||||
handler->PSendSysMessage("Dt [??, ??] (no tile loaded)");
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
if (!tile || !tile->header)
|
||||
continue;
|
||||
|
||||
handler->PSendSysMessage("[%02i,%02i]", tile->header->x, tile->header->y);
|
||||
handler->PSendSysMessage("[%02i, %02i]", tile->header->x, tile->header->y);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -222,7 +222,7 @@ class boss_arlokk : public CreatureScript
|
||||
break;
|
||||
case EVENT_MARK_OF_ARLOKK:
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, urand(1,3), 0.0f, false, -SPELL_MARK_OF_ARLOKK);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, urand(1, 3), 0.0f, false, -SPELL_MARK_OF_ARLOKK);
|
||||
if (!target)
|
||||
target = me->getVictim();
|
||||
if (target)
|
||||
|
||||
@@ -409,7 +409,7 @@ class spell_threatening_gaze : public SpellScriptLoader
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if(Unit* target = GetTarget())
|
||||
if (Unit* target = GetTarget())
|
||||
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
|
||||
caster->CastSpell(target, SPELL_WATCH_CHARGE);
|
||||
}
|
||||
|
||||
@@ -154,14 +154,14 @@ struct DialogueEntry
|
||||
class DialogueHelper
|
||||
{
|
||||
public:
|
||||
// The array MUST be terminated by {0,0,0}
|
||||
// The array MUST be terminated by {0, 0, 0}
|
||||
DialogueHelper(DialogueEntry const* dialogueArray) :
|
||||
_dialogueArray(dialogueArray),
|
||||
_currentEntry(NULL),
|
||||
_actionTimer(0),
|
||||
_isFirstSide(true)
|
||||
{}
|
||||
// The array MUST be terminated by {0,0,0,0,0}
|
||||
// The array MUST be terminated by {0, 0, 0, 0, 0}
|
||||
|
||||
/// Function to initialize the dialogue helper for instances. If not used with instances, GetSpeakerByEntry MUST be overwritten to obtain the speakers
|
||||
/// Set if take first entries or second entries
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
|
||||
if (!found)
|
||||
return;
|
||||
|
||||
|
||||
DoNextDialogueStep();
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@ public:
|
||||
|
||||
void WaypointReached(uint32 pointId)
|
||||
{
|
||||
switch(pointId)
|
||||
switch (pointId)
|
||||
{
|
||||
case 3:
|
||||
Talk(SAY_ENTER_OWL_THICKET);
|
||||
@@ -437,7 +437,7 @@ public:
|
||||
SetEscortPaused(true);
|
||||
DoSummonPriestess();
|
||||
Talk(SAY_RANSHALLA_ALTAR_2);
|
||||
events.ScheduleEvent(EVENT_RESUME,2000);
|
||||
events.ScheduleEvent(EVENT_RESUME, 2000);
|
||||
break;
|
||||
case 44:
|
||||
// Stop the escort and turn towards the altar
|
||||
|
||||
@@ -148,10 +148,10 @@ class npc_announcer_toc10 : public CreatureScript
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (i >= NUM_MESSAGES)
|
||||
return false;
|
||||
|
||||
|
||||
player->SEND_GOSSIP_MENU(_GossipMessage[i].msgnum, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ enum Yells
|
||||
SAY_STORMWIND_ROLEPLAY_2 = 1,
|
||||
SAY_STORMWIND_ROLEPLAY_3 = 2,
|
||||
SAY_STORMWIND_ROLEPLAY_6 = 3,
|
||||
|
||||
|
||||
// King Llane
|
||||
SAY_STORMWIND_ROLEPLAY_5 = 0,
|
||||
};
|
||||
@@ -440,7 +440,7 @@ class boss_voice_of_yogg_saron : public CreatureScript
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
BossAI::EnterEvadeMode();
|
||||
|
||||
|
||||
for (uint8 i = DATA_SARA; i <= DATA_MIMIRON_YS; ++i)
|
||||
if (Creature* creature = ObjectAccessor::GetCreature(*me, instance->GetData64(i)))
|
||||
creature->AI()->EnterEvadeMode();
|
||||
@@ -448,7 +448,7 @@ class boss_voice_of_yogg_saron : public CreatureScript
|
||||
// not sure, spoken by Sara (sound), regarding to wowwiki Voice whispers it
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player *player = itr->getSource())
|
||||
if (Player* player = itr->getSource())
|
||||
{
|
||||
if (events.IsInPhase(PHASE_ONE))
|
||||
Talk(WHISPER_VOICE_PHASE_1_WIPE, player->GetGUID());
|
||||
@@ -670,16 +670,16 @@ class boss_sara : public CreatureScript
|
||||
std::map<uint64, uint64>::const_iterator itr = _linkData.find(guid);
|
||||
if (itr != _linkData.end())
|
||||
return itr->second;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void SetLinkBetween(uint64 player1, uint64 player2)
|
||||
{
|
||||
_linkData[player1] = player2;
|
||||
_linkData[player2] = player1;
|
||||
}
|
||||
|
||||
|
||||
// called once for each target on aura remove
|
||||
void RemoveLinkFrom(uint64 player1)
|
||||
{
|
||||
@@ -932,7 +932,7 @@ class boss_yogg_saron : public CreatureScript
|
||||
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player *player = itr->getSource())
|
||||
if (Player* player = itr->getSource())
|
||||
{
|
||||
player->RemoveAurasDueToSpell(SPELL_SANITY);
|
||||
player->RemoveAurasDueToSpell(SPELL_INSANE);
|
||||
@@ -1069,7 +1069,7 @@ class boss_brain_of_yogg_saron : public CreatureScript
|
||||
uint8 illusion = _instance->GetData(DATA_ILLUSION);
|
||||
if (++_tentaclesKilled >= (illusion == ICECROWN_ILLUSION ? 9 : 8))
|
||||
{
|
||||
sCreatureTextMgr->SendChat(me, EMOTE_BRAIN_ILLUSION_SHATTERED, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_AREA);
|
||||
sCreatureTextMgr->SendChat(me, EMOTE_BRAIN_ILLUSION_SHATTERED, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_AREA);
|
||||
_summons.DespawnAll();
|
||||
DoCastAOE(SPELL_SHATTERED_ILLUSION, true);
|
||||
_instance->HandleGameObject(_instance->GetData64(GO_BRAIN_ROOM_DOOR_1 + illusion), true);
|
||||
@@ -1522,7 +1522,7 @@ class npc_observation_ring_keeper : public CreatureScript
|
||||
DoCast(SPELL_TELEPORT);
|
||||
Talk(SAY_KEEPER_CHOSEN_1, player->GetGUID());
|
||||
Talk(SAY_KEEPER_CHOSEN_2, player->GetGUID());
|
||||
|
||||
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case NPC_FREYA_OBSERVATION_RING:
|
||||
@@ -2085,16 +2085,16 @@ class spell_yogg_saron_malady_of_the_mind : public SpellScriptLoader // 63830
|
||||
return new spell_yogg_saron_malady_of_the_mind_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class spell_yogg_saron_brain_link : public SpellScriptLoader // 63802
|
||||
{
|
||||
public:
|
||||
spell_yogg_saron_brain_link() : SpellScriptLoader("spell_yogg_saron_brain_link") { }
|
||||
|
||||
|
||||
class spell_yogg_saron_brain_link_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_yogg_saron_brain_link_SpellScript);
|
||||
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_ILLUSION_ROOM));
|
||||
@@ -2104,17 +2104,17 @@ class spell_yogg_saron_brain_link : public SpellScriptLoader // 63802
|
||||
targets.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (SaraAI* ai = CAST_AI(SaraAI, GetCaster()->GetAI()))
|
||||
ai->SetLinkBetween(targets.front()->GetGUID(), targets.back()->GetGUID());
|
||||
}
|
||||
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_yogg_saron_brain_link_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class spell_yogg_saron_brain_link_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_yogg_saron_brain_link_AuraScript);
|
||||
@@ -2127,13 +2127,13 @@ class spell_yogg_saron_brain_link : public SpellScriptLoader // 63802
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
|
||||
if (SaraAI* ai = CAST_AI(SaraAI, caster->GetAI()))
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
|
||||
@@ -2148,36 +2148,36 @@ class spell_yogg_saron_brain_link : public SpellScriptLoader // 63802
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DummyTick(AuraEffect const* aurEff)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
|
||||
SaraAI* ai = CAST_AI(SaraAI, caster->GetAI());
|
||||
if (!ai)
|
||||
return;
|
||||
|
||||
|
||||
Player* linked = ObjectAccessor::GetPlayer(*GetTarget(), ai->GetLinkedPlayerGUID(GetTarget()->GetGUID()));
|
||||
if (!linked)
|
||||
return;
|
||||
|
||||
|
||||
GetTarget()->CastSpell(linked, (GetTarget()->GetDistance(linked) > (float)aurEff->GetAmount()) ? SPELL_BRAIN_LINK_DAMAGE : SPELL_BRAIN_LINK_NO_DAMAGE, true);
|
||||
}
|
||||
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_yogg_saron_brain_link_AuraScript::DummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_yogg_saron_brain_link_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_yogg_saron_brain_link_SpellScript();
|
||||
}
|
||||
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_yogg_saron_brain_link_AuraScript();
|
||||
@@ -2212,7 +2212,7 @@ class spell_yogg_saron_boil_ominously : public SpellScriptLoader // 63030
|
||||
{
|
||||
public:
|
||||
spell_yogg_saron_boil_ominously() : SpellScriptLoader("spell_yogg_saron_boil_ominously") { }
|
||||
|
||||
|
||||
class spell_yogg_saron_boil_ominously_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_yogg_saron_boil_ominously_SpellScript);
|
||||
@@ -2223,7 +2223,7 @@ class spell_yogg_saron_boil_ominously : public SpellScriptLoader // 63030
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
@@ -2235,7 +2235,7 @@ class spell_yogg_saron_boil_ominously : public SpellScriptLoader // 63030
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_GUARDIAN_1, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_yogg_saron_boil_ominously_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "ObjectMgr.h"
|
||||
#define UlduarScriptName "instance_ulduar"
|
||||
|
||||
extern Position const ObservationRingKeepersPos[4];
|
||||
extern Position const ObservationRingKeepersPos[4];
|
||||
extern Position const YSKeepersPos[4];
|
||||
extern Position const AlgalonLandPos;
|
||||
|
||||
@@ -149,7 +149,7 @@ enum UlduarNPCs
|
||||
NPC_SANITY_WELL = 33991,
|
||||
NPC_DESCEND_INTO_MADNESS = 34072,
|
||||
NPC_MARKED_IMMORTAL_GUARDIAN = 36064,
|
||||
|
||||
|
||||
// Algalon the Observer
|
||||
NPC_BRANN_BRONZBEARD_ALG = 34064,
|
||||
NPC_AZEROTH = 34246,
|
||||
|
||||
@@ -115,10 +115,10 @@ public:
|
||||
/// There is a good reason to store them like this, we are going to shuffle the order.
|
||||
for (uint32 i = PHASE_FRENZIED_WORGEN; i < PHASE_GORTOK_PALEHOOF; ++i)
|
||||
Sequence[i] = Phase(i);
|
||||
|
||||
|
||||
/// This ensures a random order and only executes each phase once.
|
||||
std::random_shuffle(Sequence, Sequence + PHASE_GORTOK_PALEHOOF);
|
||||
|
||||
|
||||
uiArcingSmashTimer = 15000;
|
||||
uiImpaleTimer = 12000;
|
||||
uiWhiteringRoarTimer = 10000;
|
||||
|
||||
@@ -3531,7 +3531,7 @@ class spell_gen_orc_disguise : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_TRIGGER) || !sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_MALE) ||
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_TRIGGER) || !sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_MALE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_FEMALE))
|
||||
return false;
|
||||
return true;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
namespace Trinity {
|
||||
|
||||
void Assert(char const *file, int line, char const *function, char const *message)
|
||||
void Assert(char const* file, int line, char const* function, char const* message)
|
||||
{
|
||||
ACE_Stack_Trace st;
|
||||
fprintf(stderr, "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n",
|
||||
@@ -33,7 +33,7 @@ void Assert(char const *file, int line, char const *function, char const *messag
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void Fatal(char const *file, int line, char const *function, char const *message)
|
||||
void Fatal(char const* file, int line, char const* function, char const* message)
|
||||
{
|
||||
fprintf(stderr, "\n%s:%i in %s FATAL ERROR:\n %s\n",
|
||||
file, line, function, message);
|
||||
@@ -42,7 +42,7 @@ void Fatal(char const *file, int line, char const *function, char const *message
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void Error(char const *file, int line, char const *function, char const *message)
|
||||
void Error(char const* file, int line, char const* function, char const* message)
|
||||
{
|
||||
fprintf(stderr, "\n%s:%i in %s ERROR:\n %s\n",
|
||||
file, line, function, message);
|
||||
@@ -50,7 +50,7 @@ void Error(char const *file, int line, char const *function, char const *message
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void Warning(char const *file, int line, char const *function, char const *message)
|
||||
void Warning(char const* file, int line, char const* function, char const* message)
|
||||
{
|
||||
fprintf(stderr, "\n%s:%i in %s WARNING:\n %s\n",
|
||||
file, line, function, message);
|
||||
|
||||
@@ -24,20 +24,20 @@
|
||||
namespace Trinity
|
||||
{
|
||||
|
||||
DECLSPEC_NORETURN void Assert(char const *file, int line, char const *function, char const *message) ATTR_NORETURN;
|
||||
DECLSPEC_NORETURN void Assert(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
|
||||
|
||||
DECLSPEC_NORETURN void Fatal(char const *file, int line, char const *function, char const *message) ATTR_NORETURN;
|
||||
DECLSPEC_NORETURN void Fatal(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
|
||||
|
||||
DECLSPEC_NORETURN void Error(char const *file, int line, char const *function, char const *message) ATTR_NORETURN;
|
||||
DECLSPEC_NORETURN void Error(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
|
||||
|
||||
void Warning(char const *file, int line, char const *function, char const *message);
|
||||
void Warning(char const* file, int line, char const* function, char const* message);
|
||||
|
||||
} // namespace Trinity
|
||||
|
||||
#define WPAssert(cond) do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, #cond); } while(0)
|
||||
#define WPFatal(cond, msg) do { if (!(cond)) Trinity::Fatal(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0)
|
||||
#define WPError(cond, msg) do { if (!(cond)) Trinity::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0)
|
||||
#define WPWarning(cond, msg) do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0)
|
||||
#define WPAssert(cond) do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, #cond); } while (0)
|
||||
#define WPFatal(cond, msg) do { if (!(cond)) Trinity::Fatal(__FILE__, __LINE__, __FUNCTION__, (msg)); } while (0)
|
||||
#define WPError(cond, msg) do { if (!(cond)) Trinity::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while (0)
|
||||
#define WPWarning(cond, msg) do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while (0)
|
||||
|
||||
#define ASSERT WPAssert
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class ByteBufferException : public std::exception
|
||||
public:
|
||||
~ByteBufferException() throw() { }
|
||||
|
||||
char const * what() const throw() { return msg_.c_str(); }
|
||||
char const* what() const throw() { return msg_.c_str(); }
|
||||
|
||||
protected:
|
||||
std::string & message() throw() { return msg_; }
|
||||
|
||||
Reference in New Issue
Block a user