diff options
Diffstat (limited to 'src/server/game')
59 files changed, 214 insertions, 195 deletions
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index a3cb57b3332..09ba2cc19b1 100644 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -172,7 +172,9 @@ void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered) void UnitAI::DoCastVictim(uint32 spellId, bool triggered) { - // Why don't we check for casting unit_state and existing target as we do in DoCast(.. ? + if (!me->getVictim() || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered)) + return; + me->CastSpell(me->getVictim(), spellId, triggered); } diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index ec5957b4230..ec118b44f59 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -472,13 +472,13 @@ void Battlefield::SendWarningToAllInZone(uint32 entry) sCreatureTextMgr->SendChat(stalker, (uint8) entry, 0, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_ADDON, TEXT_RANGE_ZONE); } -/*void Battlefield::SendWarningToAllInWar(int32 entry,...) +/*void Battlefield::SendWarningToAllInWar(int32 entry, ...) { const char *format = sObjectMgr->GetTrinityStringForDBCLocale(entry); va_list ap; char str [1024]; va_start(ap, entry); - vsnprintf(str,1024,format, ap); + vsnprintf(str, 1024, format, ap); va_end(ap); std::string msg = (std::string)str; @@ -607,7 +607,7 @@ BfGraveyard* Battlefield::GetGraveyardById(uint32 id) const return NULL; } -WorldSafeLocsEntry const * Battlefield::GetClosestGraveYard(Player* player) +WorldSafeLocsEntry const* Battlefield::GetClosestGraveYard(Player* player) { BfGraveyard* closestGY = NULL; float maxdist = -1; @@ -819,7 +819,7 @@ Creature* Battlefield::SpawnCreature(uint32 entry, Position pos, TeamId team) Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, float o, TeamId team) { //Get map object - Map* map = const_cast < Map * >(sMapMgr->CreateBaseMap(m_MapId)); + Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(m_MapId)); if (!map) { sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::SpawnCreature: Can't create creature entry: %u map not found", entry); diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h index cd441a41181..fea5ee2e7db 100644 --- a/src/server/game/Battlefield/Battlefield.h +++ b/src/server/game/Battlefield/Battlefield.h @@ -279,7 +279,7 @@ class Battlefield : public ZoneScript // Graveyard methods // Find which graveyard the player must be teleported to to be resurrected by spiritguide - WorldSafeLocsEntry const * GetClosestGraveYard(Player* player); + WorldSafeLocsEntry const* GetClosestGraveYard(Player* player); virtual void AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid); void RemovePlayerFromResurrectQueue(uint64 player_guid); diff --git a/src/server/game/Battlefield/BattlefieldMgr.cpp b/src/server/game/Battlefield/BattlefieldMgr.cpp index 7e37e947646..c525d07f3ac 100644 --- a/src/server/game/Battlefield/BattlefieldMgr.cpp +++ b/src/server/game/Battlefield/BattlefieldMgr.cpp @@ -68,7 +68,7 @@ void BattlefieldMgr::AddZone(uint32 zoneid, Battlefield *handle) m_BattlefieldMap[zoneid] = handle; } -void BattlefieldMgr::HandlePlayerEnterZone(Player * player, uint32 zoneid) +void BattlefieldMgr::HandlePlayerEnterZone(Player* player, uint32 zoneid) { BattlefieldMap::iterator itr = m_BattlefieldMap.find(zoneid); if (itr == m_BattlefieldMap.end()) @@ -81,7 +81,7 @@ void BattlefieldMgr::HandlePlayerEnterZone(Player * player, uint32 zoneid) sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId()); } -void BattlefieldMgr::HandlePlayerLeaveZone(Player * player, uint32 zoneid) +void BattlefieldMgr::HandlePlayerLeaveZone(Player* player, uint32 zoneid) { BattlefieldMap::iterator itr = m_BattlefieldMap.find(zoneid); if (itr == m_BattlefieldMap.end()) @@ -138,7 +138,7 @@ void BattlefieldMgr::Update(uint32 diff) } } -ZoneScript *BattlefieldMgr::GetZoneScript(uint32 zoneId) +ZoneScript* BattlefieldMgr::GetZoneScript(uint32 zoneId) { BattlefieldMap::iterator itr = m_BattlefieldMap.find(zoneId); if (itr != m_BattlefieldMap.end()) diff --git a/src/server/game/Battlefield/BattlefieldMgr.h b/src/server/game/Battlefield/BattlefieldMgr.h index f4848261ba5..20522e858ea 100644 --- a/src/server/game/Battlefield/BattlefieldMgr.h +++ b/src/server/game/Battlefield/BattlefieldMgr.h @@ -39,11 +39,11 @@ class BattlefieldMgr // create battlefield events void InitBattlefield(); // called when a player enters an battlefield area - void HandlePlayerEnterZone(Player * player, uint32 areaflag); + void HandlePlayerEnterZone(Player* player, uint32 areaflag); // called when player leaves an battlefield area - void HandlePlayerLeaveZone(Player * player, uint32 areaflag); + void HandlePlayerLeaveZone(Player* player, uint32 areaflag); // called when player resurrects - void HandlePlayerResurrects(Player * player, uint32 areaflag); + void HandlePlayerResurrects(Player* player, uint32 areaflag); // return assigned battlefield Battlefield* GetBattlefieldToZoneId(uint32 zoneid); Battlefield* GetBattlefieldByBattleId(uint32 battleid); @@ -55,14 +55,14 @@ class BattlefieldMgr void Update(uint32 diff); - void HandleGossipOption(Player * player, uint64 guid, uint32 gossipid); + void HandleGossipOption(Player* player, uint64 guid, uint32 gossipid); - bool CanTalkTo(Player * player, Creature * creature, GossipMenuItems gso); + bool CanTalkTo(Player* player, Creature* creature, GossipMenuItems gso); - void HandleDropFlag(Player * player, uint32 spellId); + void HandleDropFlag(Player* player, uint32 spellId); typedef std::vector < Battlefield * >BattlefieldSet; - typedef std::map < uint32 /* zoneid */ , Battlefield * >BattlefieldMap; + typedef std::map < uint32 /* zoneid */, Battlefield * >BattlefieldMap; private: // contains all initiated battlefield events // used when initing / cleaning up diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index a36d204a4b7..060aca3e5aa 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -916,7 +916,7 @@ void BattlefieldWG::UpdatedDestroyedTowerCount(TeamId team) } } -void BattlefieldWG::ProcessEvent(WorldObject *obj, uint32 eventId) +void BattlefieldWG::ProcessEvent(WorldObject* obj, uint32 eventId) { if (!obj || !IsWarTime()) return; diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index 422518632f4..09ad5b284fd 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -405,7 +405,7 @@ class BattlefieldWG : public Battlefield void PromotePlayer(Player* killer); void UpdateTenacity(); - void ProcessEvent(WorldObject *obj, uint32 eventId); + void ProcessEvent(WorldObject* obj, uint32 eventId); bool FindAndRemoveVehicleFromList(Unit* vehicle); @@ -562,7 +562,7 @@ struct WintergraspObjectPositionData }; // ***************************************************** -// ************ Destructible (Wall,Tower..) ************ +// ************ Destructible (Wall, Tower..) ************ // ***************************************************** struct WintergraspBuildingSpawnData @@ -755,7 +755,7 @@ const WintergraspTeleporterData WGPortalDefenderData[WG_MAX_TELEPORTER] = }; // ********************************************************* -// **********Tower Element(GameObject,Creature)************* +// **********Tower Element(GameObject, Creature)************* // ********************************************************* struct WintergraspTowerData @@ -1055,7 +1055,7 @@ const WGWorkshopData WorkshopsData[WG_MAX_WORKSHOP] = }; // ******************************************************************** -// * Structs using for Building,Graveyard,Workshop * +// * Structs using for Building, Graveyard, Workshop * // ******************************************************************** // Structure for different buildings that can be destroyed during battle struct BfWGGameObjectBuilding diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index c148151b0f5..07112c957af 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1755,7 +1755,7 @@ void Battleground::SendWarningToAll(int32 entry, ...) if (!entry) return; - char const *format = sObjectMgr->GetTrinityStringForDBCLocale(entry); + char const* format = sObjectMgr->GetTrinityStringForDBCLocale(entry); char str[1024]; va_list ap; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index 4ddf7a8b052..b6452e76b5d 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -247,7 +247,7 @@ void BattlegroundEY::UpdatePointStatuses() if (player) { this->UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], player); - //if point owner changed we must evoke event! + //if point owner changed we must evoke event! if (pointOwnerTeamId != m_PointOwnedByTeam[point]) { //point was uncontrolled and player is from team which captured point @@ -258,6 +258,12 @@ void BattlegroundEY::UpdatePointStatuses() if (m_PointState[point] == EY_POINT_UNDER_CONTROL && player->GetTeam() != m_PointOwnedByTeam[point]) this->EventTeamLostPoint(player, point); } + + /// @workaround The original AreaTrigger is covered by a bigger one and not triggered on client side. + if (point == FEL_REAVER && m_PointOwnedByTeam[point] == player->GetTeam()) + if (m_FlagState && GetFlagPickerGUID() == player->GetGUID()) + if (player->GetDistance(2044.0f, 1729.729f, 1190.03f) < 3.0f) + EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_FEL_REAVER); } } } diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index ed15694758d..f5627da0386 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -68,7 +68,7 @@ void CalendarMgr::LoadFromDB() if (flags & CALENDAR_FLAG_GUILD_EVENT || flags & CALENDAR_FLAG_WITHOUT_INVITES) guildId = Player::GetGuildIdFromDB(creatorGUID); - CalendarEvent* calendarEvent = new CalendarEvent(eventId, creatorGUID , guildId, type, dungeonId, time_t(eventTime), flags, time_t(timezoneTime), title, description); + CalendarEvent* calendarEvent = new CalendarEvent(eventId, creatorGUID, guildId, type, dungeonId, time_t(eventTime), flags, time_t(timezoneTime), title, description); _events.insert(calendarEvent); _maxEventId = std::max(_maxEventId, eventId); diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index a0705ff48d6..bedc167b711 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -272,7 +272,7 @@ HostileReference* ThreatContainer::getReferenceByTarget(Unit* victim) const uint64 const guid = victim->GetGUID(); for (ThreatContainer::StorageType::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i) { - HostileReference *ref = (*i); + HostileReference* ref = (*i); if (ref && ref->getUnitGuid() == guid) return ref; } diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 1ef035d8f87..06c7cd17492 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -311,6 +311,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) condMeets = ((1 << object->GetMap()->GetSpawnMode()) & ConditionValue1); break; } + case CONDITION_UNIT_STATE: + { + if (Unit* unit = object->ToUnit()) + condMeets = unit->HasUnitState(ConditionValue1); + break; + } default: condMeets = false; break; @@ -468,6 +474,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition() case CONDITION_GENDER: mask |= GRID_MAP_TYPE_MASK_PLAYER; break; + case CONDITION_UNIT_STATE: + mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER; + break; default: ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!"); break; @@ -1379,7 +1388,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) if ((cond->SourceGroup > MAX_EFFECT_MASK) || !cond->SourceGroup) { - sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set , ignoring.", cond->SourceEntry, cond->SourceGroup); + sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set, ignoring.", cond->SourceEntry, cond->SourceGroup); return false; } @@ -1988,9 +1997,15 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } break; } - case CONDITION_UNUSED_21: - sLog->outError(LOG_FILTER_SQL, "Found ConditionTypeOrReference = CONDITION_UNUSED_21 in `conditions` table - ignoring"); - return false; + case CONDITION_UNIT_STATE: + { + if (cond->ConditionValue1 > uint32(UNIT_STATE_ALL_STATE)) + { + sLog->outError(LOG_FILTER_SQL, "UnitState condition has non existing UnitState in value1 (%u), skipped", cond->ConditionValue1); + return false; + } + break; + } case CONDITION_UNUSED_24: sLog->outError(LOG_FILTER_SQL, "Found ConditionTypeOrReference = CONDITION_UNUSED_24 in `conditions` table - ignoring"); return false; diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index cd3cf7bbbd8..4db03d8f7df 100644 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -54,7 +54,7 @@ enum ConditionTypes CONDITION_TITLE = 18, // title id 0 0 true if player has title CONDITION_SPAWNMASK = 19, // spawnMask 0 0 true if in spawnMask CONDITION_GENDER = 20, // gender 0 0 true if player's gender is equal to gender - CONDITION_UNUSED_21 = 21, // + CONDITION_UNIT_STATE = 21, // unitState 0 0 true if unit has unitState CONDITION_MAPID = 22, // map_id 0 0 true if in map_id CONDITION_AREAID = 23, // area_id 0 0 true if in area_id CONDITION_UNUSED_24 = 24, // diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 9d5d8e40b54..a931d61f740 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1563,7 +1563,6 @@ void LFGMgr::FinishDungeon(uint64 gguid, const uint32 dungeonId) LfgPlayerRewardData data = LfgPlayerRewardData(dungeon->Entry(), GetDungeon(gguid, false), done, quest); player->GetSession()->SendLfgPlayerReward(data); } - SetDungeon(gguid, 0); } // --------------------------------------------------------------------------// @@ -1632,6 +1631,18 @@ LfgState LFGMgr::GetState(uint64 guid) return state; } +LfgState LFGMgr::GetOldState(uint64 guid) +{ + LfgState state; + if (IS_GROUP_GUID(guid)) + state = GroupsStore[guid].GetOldState(); + else + state = PlayersStore[guid].GetOldState(); + + sLog->outTrace(LOG_FILTER_LFG, "LFGMgr::GetOldState: [" UI64FMTD "] = %u", guid, state); + return state; +} + uint32 LFGMgr::GetDungeon(uint64 guid, bool asId /*= true */) { uint32 dungeon = GroupsStore[guid].GetDungeon(asId); @@ -1693,7 +1704,7 @@ uint8 LFGMgr::GetKicksLeft(uint64 guid) return kicks; } -void LFGMgr::RestoreState(uint64 guid, char const *debugMsg) +void LFGMgr::RestoreState(uint64 guid, char const* debugMsg) { if (IS_GROUP_GUID(guid)) { diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index f1c2579fdc9..6f6e770a5bd 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -347,6 +347,7 @@ class LFGMgr uint32 GetDungeon(uint64 guid, bool asId = true); uint32 GetDungeonMapId(uint64 guid); LfgState GetState(uint64 guid); + LfgState GetOldState(uint64 guid); uint8 GetKicksLeft(uint64 gguid); uint64 GetLeader(uint64 guid); bool IsLfgGroup(uint64 guid); @@ -382,8 +383,8 @@ class LFGMgr private: uint8 GetTeam(uint64 guid); - void RestoreState(uint64 guid, char const *debugMsg); - void ClearState(uint64 guid, char const *debugMsg); + void RestoreState(uint64 guid, char const* debugMsg); + void ClearState(uint64 guid, char const* debugMsg); void SetDungeon(uint64 guid, uint32 dungeon); void SetSelectedDungeons(uint64 guid, LfgDungeonSet const& dungeons); void SetLockedDungeons(uint64 guid, LfgLockMap const& lock); diff --git a/src/server/game/DungeonFinding/LFGQueue.cpp b/src/server/game/DungeonFinding/LFGQueue.cpp index e75a1bdc4b3..f1d2dbb313d 100644 --- a/src/server/game/DungeonFinding/LFGQueue.cpp +++ b/src/server/game/DungeonFinding/LFGQueue.cpp @@ -483,7 +483,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check) uint64 gguid = *check.begin(); proposal.queues = check; - proposal.isNew = numLfgGroups != 1 || !sLFGMgr->GetDungeon(gguid); + proposal.isNew = numLfgGroups != 1 || sLFGMgr->GetOldState(gguid) != LFG_STATE_DUNGEON; if (!sLFGMgr->AllQueued(check)) { diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 5cd7951951d..9e800059268 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -791,7 +791,7 @@ class GameObject : public WorldObject, public GridObject<GameObject> void SetDisplayId(uint32 displayid); uint32 GetDisplayId() const { return GetUInt32Value(GAMEOBJECT_DISPLAYID); } - GameObjectModel * m_model; + GameObjectModel* m_model; protected: bool AIM_Initialize(); uint32 m_spellId; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 6dc56f910d1..18c33457c23 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1117,20 +1117,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) addActionButton(action_itr->button, action_itr->action, action_itr->type); // original items - CharStartOutfitEntry const* oEntry = NULL; - for (uint32 i = 1; i < sCharStartOutfitStore.GetNumRows(); ++i) - { - if (CharStartOutfitEntry const* entry = sCharStartOutfitStore.LookupEntry(i)) - { - if (entry->RaceClassGender == RaceClassGender) - { - oEntry = entry; - break; - } - } - } - - if (oEntry) + if (CharStartOutfitEntry const* oEntry = sCharStartOutfitStore.LookupEntry(RaceClassGender)) { for (int j = 0; j < MAX_OUTFIT_ITEMS; ++j) { @@ -2400,7 +2387,7 @@ void Player::ProcessDelayedOperations() if (m_DelayedOperations & DELAYED_BG_GROUP_RESTORE) { - if (Group *g = GetGroup()) + if (Group* g = GetGroup()) g->SendUpdateToPlayer(GetGUID()); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index b6fc1599ce0..497aa98e043 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2826,7 +2826,7 @@ class Player : public Unit, public GridObject<Player> //We allow only one timed quest active at the same time. Below can then be simple value instead of set. typedef std::set<uint32> QuestSet; typedef std::set<uint32> SeasonalQuestSet; - typedef UNORDERED_MAP<uint32,SeasonalQuestSet> SeasonalEventQuestMap; + typedef UNORDERED_MAP<uint32, SeasonalQuestSet> SeasonalEventQuestMap; QuestSet m_timedquests; QuestSet m_weeklyquests; QuestSet m_monthlyquests; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 155ce911a65..6d79c401b6a 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -388,7 +388,7 @@ bool Unit::haveOffhandWeapon() const void Unit::MonsterMoveWithSpeed(float x, float y, float z, float speed) { Movement::MoveSplineInit init(*this); - init.MoveTo(x,y,z); + init.MoveTo(x, y, z); init.SetVelocity(speed); init.Launch(); } @@ -6256,8 +6256,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere RemoveAura(57934); if (!redirectTarget) break; - CastSpell(this,59628,true); - CastSpell(redirectTarget,57933,true); + CastSpell(this, 59628, true); + CastSpell(redirectTarget, 57933, true); break; } } @@ -9799,7 +9799,7 @@ bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMas { if (!((*i)->IsAffectingSpell(spellProto))) continue; - int32 modChance = 0; + switch ((*i)->GetMiscValue()) { // Shatter @@ -14328,7 +14328,7 @@ void Unit::UpdateAuraForGroup(uint8 slot) } } -float Unit::CalculateDefaultCoefficient(SpellInfo const *spellInfo, DamageEffectType damagetype) const +float Unit::CalculateDefaultCoefficient(SpellInfo const* spellInfo, DamageEffectType damagetype) const { // Damage over Time spells bonus calculation float DotFactor = 1.0f; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 8ab965dc5ef..2a82b520d32 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -499,7 +499,7 @@ enum UnitState UNIT_STATE_FOLLOW_MOVE = 0x08000000, UNIT_STATE_UNATTACKABLE = (UNIT_STATE_IN_FLIGHT | UNIT_STATE_ONVEHICLE), // for real move using movegen check and stop (except unstoppable flight) - UNIT_STATE_MOVING = UNIT_STATE_ROAMING_MOVE | UNIT_STATE_CONFUSED_MOVE | UNIT_STATE_FLEEING_MOVE | UNIT_STATE_CHASE_MOVE | UNIT_STATE_FOLLOW_MOVE , + UNIT_STATE_MOVING = UNIT_STATE_ROAMING_MOVE | UNIT_STATE_CONFUSED_MOVE | UNIT_STATE_FLEEING_MOVE | UNIT_STATE_CHASE_MOVE | UNIT_STATE_FOLLOW_MOVE, UNIT_STATE_CONTROLLED = (UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING), UNIT_STATE_LOST_CONTROL = (UNIT_STATE_CONTROLLED | UNIT_STATE_JUMPING | UNIT_STATE_CHARGING), UNIT_STATE_SIGHTLESS = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_EVADE), @@ -2008,15 +2008,15 @@ class Unit : public WorldObject int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask); int32 SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask); - uint32 SpellDamageBonusDone(Unit* victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1); - uint32 SpellDamageBonusTaken(Unit* caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1); + uint32 SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1); + uint32 SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1); int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask); int32 SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask); - uint32 SpellHealingBonusDone(Unit* victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); - uint32 SpellHealingBonusTaken(Unit* caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); + uint32 SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); + uint32 SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); - uint32 MeleeDamageBonusDone(Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const *spellProto = NULL); - uint32 MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage,WeaponAttackType attType, SpellInfo const *spellProto = NULL); + uint32 MeleeDamageBonusDone(Unit* pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const* spellProto = NULL); + uint32 MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const* spellProto = NULL); bool isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType = BASE_ATTACK); @@ -2028,7 +2028,7 @@ class Unit : public WorldObject void SetContestedPvP(Player* attackedPlayer = NULL); uint32 GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const; - float CalculateDefaultCoefficient(SpellInfo const *spellInfo, DamageEffectType damagetype) const; + float CalculateDefaultCoefficient(SpellInfo const* spellInfo, DamageEffectType damagetype) const; uint32 GetRemainingPeriodicAmount(uint64 caster, uint32 spellId, AuraType auraType, uint8 effectIndex = 0) const; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 6e659cb9f02..394d85a919f 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2835,32 +2835,23 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3 sLog->outError(LOG_FILTER_SQL, "Invalid count %i specified on item %u be removed from original player create info (use -1)!", count, itemId); uint32 RaceClass = (race_) | (class_ << 8); - bool doneOne = false; - for (uint32 i = 1; i < sCharStartOutfitStore.GetNumRows(); ++i) + for (uint32 gender = 0; gender < GENDER_NONE; ++gender) { - if (CharStartOutfitEntry const* entry = sCharStartOutfitStore.LookupEntry(i)) + if (CharStartOutfitEntry const* entry = sCharStartOutfitStore.LookupEntry(RaceClass | (gender << 16))) { - if (entry->RaceClassGender == RaceClass || entry->RaceClassGender == (RaceClass | (1 << 16))) + bool found = false; + for (uint8 x = 0; x < MAX_OUTFIT_ITEMS; ++x) { - bool found = false; - for (uint8 x = 0; x < MAX_OUTFIT_ITEMS; ++x) + if (entry->ItemId[x] > 0 && uint32(entry->ItemId[x]) == itemId) { - if (entry->ItemId[x] > 0 && uint32(entry->ItemId[x]) == itemId) - { - found = true; - const_cast<CharStartOutfitEntry*>(entry)->ItemId[x] = 0; - break; - } - } - - if (!found) - sLog->outError(LOG_FILTER_SQL, "Item %u specified to be removed from original create info not found in dbc!", itemId); - - if (!doneOne) - doneOne = true; - else + found = true; + const_cast<CharStartOutfitEntry*>(entry)->ItemId[x] = 0; break; + } } + + if (!found) + sLog->outError(LOG_FILTER_SQL, "Item %u specified to be removed from original create info not found in dbc!", itemId); } } } @@ -3067,10 +3058,10 @@ void ObjectMgr::LoadPlayerInfo() uint32 max_class = current_class ? current_class + 1 : MAX_CLASSES; for (uint32 r = min_race; r < max_race; ++r) for (uint32 c = min_class; c < max_class; ++c) - if (PlayerInfo * info = _playerInfo[r][c]) + if (PlayerInfo* info = _playerInfo[r][c]) info->spell.push_back(fields[2].GetUInt32()); } - else if (PlayerInfo * info = _playerInfo[current_race][current_class]) + else if (PlayerInfo* info = _playerInfo[current_race][current_class]) info->spell.push_back(fields[2].GetUInt32()); else { diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index a71c761c04a..72889216e93 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -968,7 +968,7 @@ namespace Trinity if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->isTotem()) return false; - if (i_funit->_IsValidAttackTarget(u, _spellInfo,i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT ? i_obj : NULL) && i_obj->IsWithinDistInMap(u, i_range)) + if (i_funit->_IsValidAttackTarget(u, _spellInfo, i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT ? i_obj : NULL) && i_obj->IsWithinDistInMap(u, i_range)) return true; return false; diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 5590ad010d1..8c570bc1937 100644 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -404,7 +404,7 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket& recvPacket) if (!go) return; - Guild * const guild = GetPlayer()->GetGuild(); + Guild* const guild = GetPlayer()->GetGuild(); if (!guild) { Guild::SendCommandResult(this, GUILD_COMMAND_VIEW_TAB, ERR_GUILD_PLAYER_NOT_IN_GUILD); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index a919e33d56d..579b4f38a5c 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1798,7 +1798,7 @@ void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket& recvData) sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, guid); if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId())) - bf->SendAreaSpiritHealerQueryOpcode(_player,guid); + bf->SendAreaSpiritHealerQueryOpcode(_player, guid); } void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket& recvData) diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index f2d6041cc08..836e69eb6b3 100644 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -445,7 +445,7 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi if (encounter->lastEncounterDungeon) { dungeonId = encounter->lastEncounterDungeon; - sLog->outDebug(LOG_FILTER_LFG, "UpdateEncounterState: Instance %s (instanceId %u) completed encounter %s. Credit Dungeon: %u", instance->GetMapName(), instance->GetInstanceId(), encounter->dbcEntry->encounterName[0], dungeonId); + sLog->outDebug(LOG_FILTER_LFG, "UpdateEncounterState: Instance %s (instanceId %u) completed encounter %s. Credit Dungeon: %u", instance->GetMapName(), instance->GetInstanceId(), encounter->dbcEntry->encounterName, dungeonId); break; } } diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index e9817745102..9c3b7d5e5b5 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -311,7 +311,7 @@ void Map::DeleteFromWorld(Player* player) void Map::EnsureGridCreated(const GridCoord &p) { - TRINITY_GUARD(ACE_Thread_Mutex, Lock); + TRINITY_GUARD(ACE_Thread_Mutex, GridLock); EnsureGridCreated_i(p); } diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index bc7c850d6c2..5bb40a45f7e 100644 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -527,6 +527,7 @@ class Map : public GridRefManager<NGridType> void SetUnloadReferenceLock(const GridCoord &p, bool on) { getNGrid(p.x_coord, p.y_coord)->setUnloadReferenceLock(on); } ACE_Thread_Mutex Lock; + ACE_Thread_Mutex GridLock; MapEntry const* i_mapEntry; uint8 i_spawnMode; diff --git a/src/server/game/Maps/ZoneScript.h b/src/server/game/Maps/ZoneScript.h index 9cea5fec518..ce7168a4040 100644 --- a/src/server/game/Maps/ZoneScript.h +++ b/src/server/game/Maps/ZoneScript.h @@ -32,11 +32,11 @@ class ZoneScript virtual uint32 GetCreatureEntry(uint32 /*guidlow*/, CreatureData const* data) { return data->id; } virtual uint32 GetGameObjectEntry(uint32 /*guidlow*/, uint32 entry) { return entry; } - virtual void OnCreatureCreate(Creature *) { } - virtual void OnCreatureRemove(Creature *) { } + virtual void OnCreatureCreate(Creature* ) { } + virtual void OnCreatureRemove(Creature* ) { } - virtual void OnGameObjectCreate(GameObject *) { } - virtual void OnGameObjectRemove(GameObject *) { } + virtual void OnGameObjectCreate(GameObject* ) { } + virtual void OnGameObjectRemove(GameObject* ) { } virtual void OnUnitDeath(Unit*) { } diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 504cd67fffb..77acb5e0218 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -936,6 +936,7 @@ enum TrinityStrings LANG_COMMAND_TICKETSHOWESCALATEDLIST = 2026, LANG_COMMAND_TICKETPENDING = 2027, LANG_COMMAND_TICKETRESET = 2028, + LANG_COMMAND_TICKETLISTRESPONSE = 2029, // Trinity strings 5000-9999 LANG_COMMAND_FREEZE = 5000, diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index ed0d69a84e9..6ff47f40ed4 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -443,7 +443,7 @@ enum SpellAttr4 SPELL_ATTR4_UNK19 = 0x00080000, // 19 proc dalayed, after damage or don't proc on absorb? SPELL_ATTR4_NOT_CHECK_SELFCAST_POWER = 0x00100000, // 20 supersedes message "More powerful spell applied" for self casts. SPELL_ATTR4_UNK21 = 0x00200000, // 21 Pally aura, dk presence, dudu form, warrior stance, shadowform, hunter track - SPELL_ATTR4_UNK22 = 0x00400000, // 22 Seal of Command (42058,57770) and Gymer's Smash 55426 + SPELL_ATTR4_UNK22 = 0x00400000, // 22 Seal of Command (42058, 57770) and Gymer's Smash 55426 SPELL_ATTR4_UNK23 = 0x00800000, // 23 SPELL_ATTR4_UNK24 = 0x01000000, // 24 some shoot spell SPELL_ATTR4_IS_PET_SCALING = 0x02000000, // 25 pet scaling auras @@ -452,7 +452,7 @@ enum SpellAttr4 SPELL_ATTR4_UNK28 = 0x10000000, // 28 Aimed Shot SPELL_ATTR4_UNK29 = 0x20000000, // 29 SPELL_ATTR4_UNK30 = 0x40000000, // 30 - SPELL_ATTR4_UNK31 = 0x80000000 // 31 Polymorph (chicken) 228 and Sonic Boom (38052,38488) + SPELL_ATTR4_UNK31 = 0x80000000 // 31 Polymorph (chicken) 228 and Sonic Boom (38052, 38488) }; enum SpellAttr5 diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index ba648c72e26..277a5721c3d 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -207,11 +207,11 @@ void MotionMaster::MoveTargetedHome() else if (_owner->GetTypeId()==TYPEID_UNIT && ((Creature*)_owner)->GetCharmerOrOwnerGUID()) { sLog->outDebug(LOG_FILTER_GENERAL, "Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow()); - Unit *target = ((Creature*)_owner)->GetCharmerOrOwner(); + Unit* target = ((Creature*)_owner)->GetCharmerOrOwner(); if (target) { sLog->outDebug(LOG_FILTER_GENERAL, "Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow()); - Mutate(new FollowMovementGenerator<Creature>(*target,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE), MOTION_SLOT_ACTIVE); + Mutate(new FollowMovementGenerator<Creature>(*target, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE), MOTION_SLOT_ACTIVE); } } else @@ -248,7 +248,7 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle) _owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new ChaseMovementGenerator<Player>(*target,dist,angle), MOTION_SLOT_ACTIVE); + Mutate(new ChaseMovementGenerator<Player>(*target, dist, angle), MOTION_SLOT_ACTIVE); } else { @@ -256,7 +256,7 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle) _owner->GetEntry(), _owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new ChaseMovementGenerator<Creature>(*target,dist,angle), MOTION_SLOT_ACTIVE); + Mutate(new ChaseMovementGenerator<Creature>(*target, dist, angle), MOTION_SLOT_ACTIVE); } } @@ -272,7 +272,7 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) follow to %s (GUID: %u)", _owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new FollowMovementGenerator<Player>(*target,dist,angle), slot); + Mutate(new FollowMovementGenerator<Player>(*target, dist, angle), slot); } else { @@ -280,7 +280,7 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo _owner->GetEntry(), _owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new FollowMovementGenerator<Creature>(*target,dist,angle), slot); + Mutate(new FollowMovementGenerator<Creature>(*target, dist, angle), slot); } } @@ -307,7 +307,7 @@ void MotionMaster::MoveLand(uint32 id, Position const& pos) sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z); Movement::MoveSplineInit init(*_owner); - init.MoveTo(x,y,z); + init.MoveTo(x, y, z); init.SetAnimation(Movement::ToGround); init.Launch(); Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE); @@ -321,7 +321,7 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos) sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z); Movement::MoveSplineInit init(*_owner); - init.MoveTo(x,y,z); + init.MoveTo(x, y, z); init.SetAnimation(Movement::ToFly); init.Launch(); Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE); @@ -336,13 +336,13 @@ void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, floa float x, y, z; float moveTimeHalf = speedZ / Movement::gravity; float dist = 2 * moveTimeHalf * speedXY; - float max_height = -Movement::computeFallElevation(moveTimeHalf,false,-speedZ); + float max_height = -Movement::computeFallElevation(moveTimeHalf, false, -speedZ); _owner->GetNearPoint(_owner, x, y, z, _owner->GetObjectSize(), dist, _owner->GetAngle(srcX, srcY) + M_PI); Movement::MoveSplineInit init(*_owner); - init.MoveTo(x,y,z); - init.SetParabolic(max_height,0); + init.MoveTo(x, y, z); + init.SetParabolic(max_height, 0); init.SetOrientationFixed(true); init.SetVelocity(speedXY); init.Launch(); @@ -368,11 +368,11 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee sLog->outDebug(LOG_FILTER_GENERAL, "Unit (GUID: %u) jump to point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z); float moveTimeHalf = speedZ / Movement::gravity; - float max_height = -Movement::computeFallElevation(moveTimeHalf,false,-speedZ); + float max_height = -Movement::computeFallElevation(moveTimeHalf, false, -speedZ); Movement::MoveSplineInit init(*_owner); - init.MoveTo(x,y,z); - init.SetParabolic(max_height,0); + init.MoveTo(x, y, z); + init.SetParabolic(max_height, 0); init.SetVelocity(speedXY); init.Launch(); Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED); diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index e89d30c56f4..d9050e2b76a 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -47,7 +47,7 @@ void FleeingMovementGenerator<T>::_setTargetLocation(T &owner) owner.AddUnitState(UNIT_STATE_FLEEING_MOVE); Movement::MoveSplineInit init(owner); - init.MoveTo(x,y,z); + init.MoveTo(x, y, z); init.SetWalk(false); init.Launch(); } @@ -153,9 +153,9 @@ bool FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float Trinity::NormalizeMapCoord(temp_y); if (owner.IsWithinLOS(temp_x, temp_y, z)) { - bool is_water_now = _map->IsInWater(x,y,z); + bool is_water_now = _map->IsInWater(x, y, z); - if (is_water_now && _map->IsInWater(temp_x,temp_y,z)) + if (is_water_now && _map->IsInWater(temp_x, temp_y, z)) { x = temp_x; y = temp_y; @@ -173,8 +173,8 @@ bool FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float if (!(new_z - z) || distance / fabs(new_z - z) > 1.0f) { - float new_z_left = _map->GetHeight(owner.GetPhaseMask(), temp_x + 1.0f* std::cos(angle+static_cast<float>(M_PI/2)),temp_y + 1.0f* std::sin(angle+static_cast<float>(M_PI/2)),z,true); - float new_z_right = _map->GetHeight(owner.GetPhaseMask(), temp_x + 1.0f* std::cos(angle-static_cast<float>(M_PI/2)),temp_y + 1.0f* std::sin(angle-static_cast<float>(M_PI/2)),z,true); + float new_z_left = _map->GetHeight(owner.GetPhaseMask(), temp_x + 1.0f * std::cos(angle+static_cast<float>(M_PI/2)), temp_y + 1.0f * std::sin(angle+static_cast<float>(M_PI/2)), z, true); + float new_z_right = _map->GetHeight(owner.GetPhaseMask(), temp_x + 1.0f * std::cos(angle-static_cast<float>(M_PI/2)), temp_y + 1.0f * std::sin(angle-static_cast<float>(M_PI/2)), z, true); if (fabs(new_z_left - new_z) < 1.2f && fabs(new_z_right - new_z) < 1.2f) { x = temp_x; @@ -186,7 +186,7 @@ bool FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float } } i_to_distance_from_caster = 0.0f; - i_nextCheckTime.Reset(urand(500,1000)); + i_nextCheckTime.Reset(urand(500, 1000)); return false; } @@ -209,7 +209,7 @@ bool FleeingMovementGenerator<T>::_setMoveData(T &owner) { // we are very far or too close, stopping i_to_distance_from_caster = 0.0f; - i_nextCheckTime.Reset(urand(500,1000)); + i_nextCheckTime.Reset(urand(500, 1000)); return false; } else @@ -293,7 +293,7 @@ void FleeingMovementGenerator<T>::DoInitialize(T &owner) _Init(owner); - if (Unit *fright = ObjectAccessor::GetUnit(owner, i_frightGUID)) + if (Unit* fright = ObjectAccessor::GetUnit(owner, i_frightGUID)) { i_caster_x = fright->GetPositionX(); i_caster_y = fright->GetPositionY(); diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index 358362c9c15..4f0a620c303 100644 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -40,12 +40,12 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner) Movement::MoveSplineInit init(owner); float x, y, z, o; // at apply we can select more nice return points base at current movegen - //if (owner.GetMotionMaster()->empty() || !owner.GetMotionMaster()->top()->GetResetPosition(owner,x,y,z)) + //if (owner.GetMotionMaster()->empty() || !owner.GetMotionMaster()->top()->GetResetPosition(owner, x, y, z)) //{ owner.GetHomePosition(x, y, z, o); init.SetFacing(o); //} - init.MoveTo(x,y,z); + init.MoveTo(x, y, z); init.SetWalk(false); init.Launch(); diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index 59c41d841f2..68f62d28899 100644 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -129,7 +129,7 @@ void EffectMovementGenerator::Finalize(Unit &unit) // Need restore previous movement since we have no proper states system //if (unit.isAlive() && !unit.HasUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_FLEEING)) //{ - // if (Unit * victim = unit.getVictim()) + // if (Unit* victim = unit.getVictim()) // unit.GetMotionMaster()->MoveChase(victim); // else // unit.GetMotionMaster()->Initialize(); diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index f733fa3331c..06521fadb3a 100644 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -165,8 +165,8 @@ bool RandomMovementGenerator<Creature>::GetResetPosition(Creature &creature, flo creature.GetRespawnPosition(x, y, z, NULL, &radius); // use current if in range - if (creature.IsWithinDist2d(x,y,radius)) - creature.GetPosition(x,y,z); + if (creature.IsWithinDist2d(x, y,radius)) + creature.GetPosition(x, y, z); return true; } diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index ebcb830cf61..a1ac4ccb679 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -29,7 +29,7 @@ #include <cmath> template<class T, typename D> -void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner) +void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T &owner) { if (!i_target.isValid() || !i_target->IsInWorld()) return; @@ -41,7 +41,7 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner) //! Following block of code deleted by MrSmite in issue 4891 //! Code kept for learning and diagnostical purposes // -// if (i_offset && i_target->IsWithinDistInMap(&owner,2*i_offset)) +// if (i_offset && i_target->IsWithinDistInMap(&owner, 2*i_offset)) // { // if (!owner.movespline->Finalized()) // return; @@ -99,7 +99,7 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner) //We don't update Mob Movement, if the difference between New destination and last destination is < BothObjectSize float bothObjectSize = i_target->GetObjectBoundingRadius() + owner.GetObjectBoundingRadius() + CONTACT_DISTANCE; - if ( i_destinationHolder.HasDestination() && i_destinationHolder.GetDestinationDiff(x,y,z) < bothObjectSize ) + if ( i_destinationHolder.HasDestination() && i_destinationHolder.GetDestinationDiff(x, y,z) < bothObjectSize ) return; */ @@ -109,39 +109,39 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner) i_recalculateTravel = false; Movement::MoveSplineInit init(owner); - init.MoveTo(x,y,z); + init.MoveTo(x, y, z); init.SetWalk(((D*)this)->EnableWalking()); init.Launch(); } template<> -void TargetedMovementGeneratorMedium<Player,ChaseMovementGenerator<Player> >::UpdateFinalDistance(float /*fDistance*/) +void TargetedMovementGeneratorMedium<Player, ChaseMovementGenerator<Player> >::UpdateFinalDistance(float /*fDistance*/) { // nothing to do for Player } template<> -void TargetedMovementGeneratorMedium<Player,FollowMovementGenerator<Player> >::UpdateFinalDistance(float /*fDistance*/) +void TargetedMovementGeneratorMedium<Player, FollowMovementGenerator<Player> >::UpdateFinalDistance(float /*fDistance*/) { // nothing to do for Player } template<> -void TargetedMovementGeneratorMedium<Creature,ChaseMovementGenerator<Creature> >::UpdateFinalDistance(float fDistance) +void TargetedMovementGeneratorMedium<Creature, ChaseMovementGenerator<Creature> >::UpdateFinalDistance(float fDistance) { i_offset = fDistance; i_recalculateTravel = true; } template<> -void TargetedMovementGeneratorMedium<Creature,FollowMovementGenerator<Creature> >::UpdateFinalDistance(float fDistance) +void TargetedMovementGeneratorMedium<Creature, FollowMovementGenerator<Creature> >::UpdateFinalDistance(float fDistance) { i_offset = fDistance; i_recalculateTravel = true; } 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; @@ -176,7 +176,7 @@ bool TargetedMovementGeneratorMedium<T,D>::DoUpdate(T &owner, uint32 time_diff) i_recheckDistance.Reset(50); //More distance let have better performance, less distance let have more sensitive reaction at target move. float allowed_dist = i_target->GetObjectSize() + owner.GetObjectSize() + MELEE_RANGE - 0.5f; - float dist = (owner.movespline->FinalDestination() - G3D::Vector3(i_target->GetPositionX(),i_target->GetPositionY(),i_target->GetPositionZ())).squaredLength(); + float dist = (owner.movespline->FinalDestination() - G3D::Vector3(i_target->GetPositionX(), i_target->GetPositionY(), i_target->GetPositionZ())).squaredLength(); if (dist >= allowed_dist * allowed_dist) _setTargetLocation(owner); } @@ -206,7 +206,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<> @@ -275,9 +275,9 @@ void FollowMovementGenerator<Creature>::_updateSpeed(Creature &u) if (!((Creature&)u).isPet() || !i_target.isValid() || i_target->GetGUID() != u.GetOwnerGUID()) return; - u.UpdateSpeed(MOVE_RUN,true); - u.UpdateSpeed(MOVE_WALK,true); - u.UpdateSpeed(MOVE_SWIM,true); + u.UpdateSpeed(MOVE_RUN, true); + u.UpdateSpeed(MOVE_WALK, true); + u.UpdateSpeed(MOVE_SWIM, true); } template<> @@ -323,14 +323,14 @@ void FollowMovementGenerator<Creature>::MovementInform(Creature &unit) } //-----------------------------------------------// -template void TargetedMovementGeneratorMedium<Player,ChaseMovementGenerator<Player> >::_setTargetLocation(Player &); -template void TargetedMovementGeneratorMedium<Player,FollowMovementGenerator<Player> >::_setTargetLocation(Player &); -template void TargetedMovementGeneratorMedium<Creature,ChaseMovementGenerator<Creature> >::_setTargetLocation(Creature &); -template void TargetedMovementGeneratorMedium<Creature,FollowMovementGenerator<Creature> >::_setTargetLocation(Creature &); -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 &); +template void TargetedMovementGeneratorMedium<Player, FollowMovementGenerator<Player> >::_setTargetLocation(Player &); +template void TargetedMovementGeneratorMedium<Creature, ChaseMovementGenerator<Creature> >::_setTargetLocation(Creature &); +template void TargetedMovementGeneratorMedium<Creature, FollowMovementGenerator<Creature> >::_setTargetLocation(Creature &); +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 &); diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp index 70e4aad2967..9f521d2c3f9 100644 --- a/src/server/game/Movement/Spline/MoveSpline.cpp +++ b/src/server/game/Movement/Spline/MoveSpline.cpp @@ -32,7 +32,7 @@ Location MoveSpline::ComputePosition() const ASSERT(Initialized()); float u = 1.f; - int32 seg_time = spline.length(point_Idx,point_Idx+1); + int32 seg_time = spline.length(point_Idx, point_Idx+1); if (seg_time > 0) u = (time_passed - spline.length(point_Idx)) / (float)seg_time; Location c; @@ -103,7 +103,7 @@ struct FallInitializer float start_elevation; inline int32 operator()(Spline<int32>& s, int32 i) { - return Movement::computeFallTime(start_elevation - s.getPoint(i+1).z,false) * 1000.f; + return Movement::computeFallTime(start_elevation - s.getPoint(i+1).z, false) * 1000.f; } }; @@ -125,7 +125,7 @@ struct CommonInitializer void MoveSpline::init_spline(const MoveSplineInitArgs& args) { - const SplineBase::EvaluationMode modes[2] = {SplineBase::ModeLinear,SplineBase::ModeCatmullrom}; + const SplineBase::EvaluationMode modes[2] = {SplineBase::ModeLinear, SplineBase::ModeCatmullrom}; if (args.flags.cyclic) { uint32 cyclic_point = 0; diff --git a/src/server/game/Movement/Spline/MoveSpline.h b/src/server/game/Movement/Spline/MoveSpline.h index 46611e58447..8e51e2678dd 100644 --- a/src/server/game/Movement/Spline/MoveSpline.h +++ b/src/server/game/Movement/Spline/MoveSpline.h @@ -27,7 +27,7 @@ namespace Movement struct Location : public Vector3 { Location() : orientation(0) {} - Location(float x, float y, float z, float o) : Vector3(x,y,z), orientation(o) {} + Location(float x, float y, float z, float o) : Vector3(x, y, z), orientation(o) {} Location(const Vector3& v) : Vector3(v), orientation(0) {} Location(const Vector3& v, float o) : Vector3(v), orientation(o) {} @@ -101,14 +101,14 @@ namespace Movement ASSERT(Initialized()); do handler(_updateState(difftime)); - while(difftime > 0); + while (difftime > 0); } void updateState(int32 difftime) { ASSERT(Initialized()); do _updateState(difftime); - while(difftime > 0); + while (difftime > 0); } Location ComputePosition() const; diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h index b7e09468192..b94283caeed 100644 --- a/src/server/game/Movement/Spline/MoveSplineFlag.h +++ b/src/server/game/Movement/Spline/MoveSplineFlag.h @@ -27,7 +27,7 @@ namespace Movement #if defined( __GNUC__ ) #pragma pack(1) #else -#pragma pack(push,1) +#pragma pack(push, 1) #endif class MoveSplineFlag diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index 3ffce05a7dc..61178f3f9ad 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -157,7 +157,7 @@ namespace Movement args.flags.smoothGroundPath = true; // enabled by default, CatmullRom mode or client config "pathSmoothing" will disable this } - void MoveSplineInit::SetFacing(const Unit * target) + void MoveSplineInit::SetFacing(const Unit* target) { args.flags.EnableFacingTarget(); args.facing.target = target->GetGUID(); diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index 0293d427dda..74e5cdfa9f4 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -79,7 +79,7 @@ namespace Movement */ void SetFacing(float angle); void SetFacing(Vector3 const& point); - void SetFacing(const Unit * target); + void SetFacing(const Unit* target); /* Initializes movement by path * @param path - array of points, shouldn't be empty diff --git a/src/server/game/Movement/Spline/MoveSplineInitArgs.h b/src/server/game/Movement/Spline/MoveSplineInitArgs.h index 32045629c9f..4a086094c3f 100644 --- a/src/server/game/Movement/Spline/MoveSplineInitArgs.h +++ b/src/server/game/Movement/Spline/MoveSplineInitArgs.h @@ -31,7 +31,7 @@ namespace Movement union FacingInfo { struct{ - float x,y,z; + float x, y, z; }f; uint64 target; float angle; diff --git a/src/server/game/Movement/Spline/Spline.cpp b/src/server/game/Movement/Spline/Spline.cpp index 6970acf5415..887541e2289 100644 --- a/src/server/game/Movement/Spline/Spline.cpp +++ b/src/server/game/Movement/Spline/Spline.cpp @@ -59,7 +59,7 @@ SplineBase::InitMethtod SplineBase::initializers[SplineBase::ModesEnd] = using G3D::Matrix4; static const Matrix4 s_catmullRomCoeffs( - -0.5f, 1.5f,-1.5f, 0.5f, + -0.5f, 1.5f, -1.5f, 0.5f, 1.f, -2.5f, 2.f, -0.5f, -0.5f, 0.f, 0.5f, 0.f, 0.f, 1.f, 0.f, 0.f); @@ -222,7 +222,7 @@ void SplineBase::InitLinear(const Vector3* controls, index_type count, bool cycl points.resize(real_size); - memcpy(&points[0],controls, sizeof(Vector3) * count); + memcpy(&points[0], controls, sizeof(Vector3) * count); // first and last two indexes are space for special 'virtual points' // these points are required for proper C_Evaluate and C_Evaluate_Derivative methtod work @@ -244,7 +244,7 @@ void SplineBase::InitCatmullRom(const Vector3* controls, index_type count, bool int lo_index = 1; int high_index = lo_index + count - 1; - memcpy(&points[lo_index],controls, sizeof(Vector3) * count); + memcpy(&points[lo_index], controls, sizeof(Vector3) * count); // first and last two indexes are space for special 'virtual points' // these points are required for proper C_Evaluate and C_Evaluate_Derivative methtod work @@ -274,7 +274,7 @@ void SplineBase::InitBezier3(const Vector3* controls, index_type count, bool /*c index_type t = c / 3u; points.resize(c); - memcpy(&points[0],controls, sizeof(Vector3) * c); + memcpy(&points[0], controls, sizeof(Vector3) * c); index_lo = 0; index_hi = t-1; diff --git a/src/server/game/Movement/Spline/Spline.h b/src/server/game/Movement/Spline/Spline.h index 63e61b84579..2a2f3fa8f43 100644 --- a/src/server/game/Movement/Spline/Spline.h +++ b/src/server/game/Movement/Spline/Spline.h @@ -61,7 +61,7 @@ protected: void EvaluateLinear(index_type, float, Vector3&) const; void EvaluateCatmullRom(index_type, float, Vector3&) const; void EvaluateBezier3(index_type, float, Vector3&) const; - typedef void (SplineBase::*EvaluationMethtod)(index_type,float,Vector3&) const; + typedef void (SplineBase::*EvaluationMethtod)(index_type, float, Vector3&) const; static EvaluationMethtod evaluators[ModesEnd]; void EvaluateDerivativeLinear(index_type, float, Vector3&) const; @@ -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;} @@ -119,7 +119,7 @@ public: would be no harm to have some custom initializers. */ template<class Init> inline void init_spline(Init& initializer) { - initializer(m_mode,cyclic,points,index_lo,index_hi); + initializer(m_mode, cyclic, points, index_lo, index_hi); } void clear(); @@ -156,20 +156,20 @@ 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; void computeIndex(float t, index_type& out_idx, float& out_u) const; /** 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_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);} /** Initializes lengths with SplineBase::SegLength method. */ void initLengths(); @@ -181,7 +181,7 @@ public: index_type i = index_lo; lengths.resize(index_hi+1); length_type prev_length = 0, new_length = 0; - while(i < index_hi) + while (i < index_hi) { new_length = cacher(*this, i); lengths[++i] = new_length; diff --git a/src/server/game/Movement/Spline/SplineImpl.h b/src/server/game/Movement/Spline/SplineImpl.h index eded2d8c903..98f3f5fe079 100644 --- a/src/server/game/Movement/Spline/SplineImpl.h +++ b/src/server/game/Movement/Spline/SplineImpl.h @@ -81,7 +81,7 @@ template<typename length_type> void Spline<length_type>::initLengths() index_type i = index_lo; length_type length = 0; lengths.resize(index_hi+1); - while(i < index_hi ) + while (i < index_hi) { length += SegLength(i); lengths[++i] = length; diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index bb7dea76461..93bf7edc7d5 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -392,7 +392,7 @@ void OutdoorPvP::SendUpdateWorldState(uint32 field, uint32 value) if (m_sendUpdate) for (int i = 0; i < 2; ++i) for (PlayerSet::iterator itr = m_players[i].begin(); itr != m_players[i].end(); ++itr) - if (Player * const player = ObjectAccessor::FindPlayer(*itr)) + if (Player* const player = ObjectAccessor::FindPlayer(*itr)) player->SendUpdateWorldState(field, value); } @@ -402,7 +402,7 @@ void OPvPCapturePoint::SendUpdateWorldState(uint32 field, uint32 value) { // send to all players present in the area for (PlayerSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); ++itr) - if (Player * const player = ObjectAccessor::FindPlayer(*itr)) + if (Player* const player = ObjectAccessor::FindPlayer(*itr)) player->SendUpdateWorldState(field, value); } } @@ -424,7 +424,7 @@ void OPvPCapturePoint::SendObjectiveComplete(uint32 id, uint64 guid) // send to all players present in the area for (PlayerSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); ++itr) - if (Player * const player = ObjectAccessor::FindPlayer(*itr)) + if (Player* const player = ObjectAccessor::FindPlayer(*itr)) player->KilledMonsterCredit(id, guid); } @@ -563,7 +563,7 @@ void OutdoorPvP::BroadcastPacket(WorldPacket &data) const // This is faster than sWorld->SendZoneMessage for (uint32 team = 0; team < 2; ++team) for (PlayerSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr) - if (Player * const player = ObjectAccessor::FindPlayer(*itr)) + if (Player* const player = ObjectAccessor::FindPlayer(*itr)) player->GetSession()->SendPacket(&data); } @@ -583,13 +583,13 @@ void OutdoorPvP::TeamCastSpell(TeamId team, int32 spellId) if (spellId > 0) { for (PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr) - if (Player * const player = ObjectAccessor::FindPlayer(*itr)) + if (Player* const player = ObjectAccessor::FindPlayer(*itr)) player->CastSpell(player, (uint32)spellId, true); } else { for (PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr) - if (Player * const player = ObjectAccessor::FindPlayer(*itr)) + if (Player* const player = ObjectAccessor::FindPlayer(*itr)) player->RemoveAura((uint32)-spellId); // by stack? } } diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.h b/src/server/game/OutdoorPvP/OutdoorPvP.h index 940b744f5fc..662e80eba7f 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.h +++ b/src/server/game/OutdoorPvP/OutdoorPvP.h @@ -284,7 +284,7 @@ class OutdoorPvP : public ZoneScript void RegisterZone(uint32 zoneid); - bool HasPlayer(Player const * player) const; + bool HasPlayer(Player const* player) const; void TeamCastSpell(TeamId team, int32 spellId); }; diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index 6cd6a72a06a..7cee754bba7 100644 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -476,7 +476,7 @@ void Map::ScriptsProcess() // Source or target must be Creature. if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script)) { - Unit * unit = (Unit*)cSource; + Unit* unit = (Unit*)cSource; if (step.script->MoveTo.TravelTime != 0) { float speed = unit->GetDistance(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ) / ((float)step.script->MoveTo.TravelTime * 0.001f); diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index fefddffb48c..633e17ff014 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -589,6 +589,7 @@ void AddSC_boss_high_astromancer_solarian(); void AddSC_instance_the_eye(); void AddSC_the_eye(); void AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar +void AddSC_boss_gatewatcher_gyrokill(); void AddSC_boss_nethermancer_sepethrea(); void AddSC_boss_pathaleon_the_calculator(); void AddSC_boss_mechano_lord_capacitus(); @@ -1073,6 +1074,7 @@ void AddOutlandScripts() AddSC_instance_the_eye(); AddSC_the_eye(); AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar + AddSC_boss_gatewatcher_gyrokill(); AddSC_boss_nethermancer_sepethrea(); AddSC_boss_pathaleon_the_calculator(); AddSC_boss_mechano_lord_capacitus(); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 43e8c2be05a..ab139a44741 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5004,13 +5004,13 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool switch (GetId()) { case 59628: //Tricks of the trade buff on rogue (6sec duration) - target->SetReducedThreatPercent(0,0); + target->SetReducedThreatPercent(0, 0); break; case 57934: //Tricks of the trade buff on rogue (30sec duration) if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE || !caster->GetMisdirectionTarget()) - target->SetReducedThreatPercent(0,0); + target->SetReducedThreatPercent(0, 0); else - target->SetReducedThreatPercent(0,caster->GetMisdirectionTarget()->GetGUID()); + target->SetReducedThreatPercent(0, caster->GetMisdirectionTarget()->GetGUID()); break; } default: diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index abfda74d555..14d8b7e9ce6 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1866,7 +1866,7 @@ void Spell::SearchTargets(SEARCHER& searcher, uint32 containerMask, Unit* refere bool searchInWorld = containerMask & (GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER | GRID_MAP_TYPE_MASK_CORPSE); if (searchInGrid || searchInWorld) { - float x,y; + float x, y; x = pos->GetPositionX(); y = pos->GetPositionY(); @@ -1884,7 +1884,7 @@ void Spell::SearchTargets(SEARCHER& searcher, uint32 containerMask, Unit* refere if (searchInGrid) { TypeContainerVisitor<SEARCHER, GridTypeMapContainer > grid_object_notifier(searcher); - cell.Visit(p, grid_object_notifier, map, radius, x , y); + cell.Visit(p, grid_object_notifier, map, radius, x, y); } } } diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 60d84a558d0..e85d0e2bfe6 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -232,7 +232,7 @@ SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_ {TARGET_OBJECT_TYPE_GOBJ, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 23 TARGET_GAMEOBJECT_TARGET {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_ENEMY, TARGET_DIR_FRONT}, // 24 TARGET_UNIT_CONE_ENEMY_24 {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 25 TARGET_UNIT_TARGET_ANY - {TARGET_OBJECT_TYPE_GOBJ_ITEM, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 26 TARGET_GAMEOBJECT_ITEM_TARGET + {TARGET_OBJECT_TYPE_GOBJ_ITEM, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 26 TARGET_GAMEOBJECT_ITEM_TARGET {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 27 TARGET_UNIT_MASTER {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 28 TARGET_DEST_DYNOBJ_ENEMY {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_ALLY, TARGET_DIR_NONE}, // 29 TARGET_DEST_DYNOBJ_ALLY @@ -267,7 +267,7 @@ SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_ {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_RAID, TARGET_DIR_NONE}, // 58 TARGET_UNIT_NEARBY_RAID {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_ALLY, TARGET_DIR_FRONT}, // 59 TARGET_UNIT_CONE_ALLY {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_ENTRY, TARGET_DIR_FRONT}, // 60 TARGET_UNIT_CONE_ENTRY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_RAID_CLASS,TARGET_DIR_NONE}, // 61 TARGET_UNIT_TARGET_AREA_RAID_CLASS + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_RAID_CLASS, TARGET_DIR_NONE}, // 61 TARGET_UNIT_TARGET_AREA_RAID_CLASS {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 62 TARGET_UNK_62 {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 63 TARGET_DEST_TARGET_ANY {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT}, // 64 TARGET_DEST_TARGET_FRONT @@ -299,9 +299,9 @@ SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_ {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 90 TARGET_UNIT_TARGET_MINIPET {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_RANDOM}, // 91 TARGET_DEST_DEST_RADIUS {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 92 TARGET_UNIT_SUMMONER - {TARGET_OBJECT_TYPE_CORPSE, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 93 TARGET_CORPSE_SRC_AREA_ENEMY + {TARGET_OBJECT_TYPE_CORPSE, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 93 TARGET_CORPSE_SRC_AREA_ENEMY {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 94 TARGET_UNIT_VEHICLE - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_PASSENGER, TARGET_DIR_NONE}, // 95 TARGET_UNIT_TARGET_PASSENGER + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_PASSENGER, TARGET_DIR_NONE}, // 95 TARGET_UNIT_TARGET_PASSENGER {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 96 TARGET_UNIT_PASSENGER_0 {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 97 TARGET_UNIT_PASSENGER_1 {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 98 TARGET_UNIT_PASSENGER_2 diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index f5ba0594912..f030b3dc6f2 100644 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -187,6 +187,8 @@ std::string GmTicket::FormatMessageString(ChatHandler& handler, bool detailed) c ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTMESSAGE, _message.c_str()); if (!_comment.empty()) ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTCOMMENT, _comment.c_str()); + if (!_response.empty()) + ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTRESPONSE, _response.c_str()); } return ss.str(); } diff --git a/src/server/game/Warden/Warden.h b/src/server/game/Warden/Warden.h index 7a61f3d5723..b9470b0c8a7 100644 --- a/src/server/game/Warden/Warden.h +++ b/src/server/game/Warden/Warden.h @@ -40,7 +40,7 @@ enum WardenOpcodes WARDEN_SMSG_MODULE_CACHE = 1, WARDEN_SMSG_CHEAT_CHECKS_REQUEST = 2, WARDEN_SMSG_MODULE_INITIALIZE = 3, - WARDEN_SMSG_MEM_CHECKS_REQUEST = 4, // byte len; while(!EOF) { byte unk(1); byte index(++); string module(can be 0); int offset; byte len; byte[] bytes_to_compare[len]; } + WARDEN_SMSG_MEM_CHECKS_REQUEST = 4, // byte len; while (!EOF) { byte unk(1); byte index(++); string module(can be 0); int offset; byte len; byte[] bytes_to_compare[len]; } WARDEN_SMSG_HASH_REQUEST = 5 }; @@ -60,7 +60,7 @@ enum WardenCheckType #if defined(__GNUC__) #pragma pack(1) #else -#pragma pack(push,1) +#pragma pack(push, 1) #endif struct WardenModuleUse diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp index d1df94d7f07..7c2979e0dc6 100644 --- a/src/server/game/Warden/WardenMac.cpp +++ b/src/server/game/Warden/WardenMac.cpp @@ -38,7 +38,7 @@ WardenMac::~WardenMac() { } -void WardenMac::Init(WorldSession *pClient, BigNumber *K) +void WardenMac::Init(WorldSession* pClient, BigNumber* K) { _session = pClient; // Generate Warden Key diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp index bff12280d89..4da05eded0c 100644 --- a/src/server/game/Warden/WardenWin.cpp +++ b/src/server/game/Warden/WardenWin.cpp @@ -42,7 +42,7 @@ WardenWin::~WardenWin() { } -void WardenWin::Init(WorldSession* session, BigNumber *k) +void WardenWin::Init(WorldSession* session, BigNumber* k) { _session = session; // Generate Warden Key @@ -368,7 +368,7 @@ void WardenWin::HandleData(ByteBuffer &buff) sLog->outDebug(LOG_FILTER_WARDEN, "Ticks diff %u", ourTicks - newClientTicks); } - WardenCheckResult *rs; + WardenCheckResult* rs; WardenCheck *rd; uint8 type; uint16 checkFailed = 0; diff --git a/src/server/game/Warden/WardenWin.h b/src/server/game/Warden/WardenWin.h index 102a64c6895..1b1cc6746f4 100644 --- a/src/server/game/Warden/WardenWin.h +++ b/src/server/game/Warden/WardenWin.h @@ -28,7 +28,7 @@ #if defined(__GNUC__) #pragma pack(1) #else -#pragma pack(push,1) +#pragma pack(push, 1) #endif struct WardenInitModuleRequest diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 215e9bb629b..7248703c9db 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2989,7 +2989,7 @@ void World::ResetMonthlyQuests() void World::ResetEventSeasonalQuests(uint16 event_id) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_STATUS_SEASONAL); - stmt->setUInt16(0,event_id); + stmt->setUInt16(0, event_id); CharacterDatabase.Execute(stmt); for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) |
