aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/server')
-rw-r--r--src/server/bnetserver/Main.cpp2
-rw-r--r--src/server/database/Database/AdhocStatement.cpp2
-rw-r--r--src/server/database/Database/AdhocStatement.h4
-rw-r--r--src/server/database/Database/DatabaseEnv.h4
-rw-r--r--src/server/database/Database/DatabaseLoader.cpp4
-rw-r--r--src/server/database/Database/DatabaseLoader.h2
-rw-r--r--src/server/database/Database/DatabaseWorkerPool.cpp12
-rw-r--r--src/server/database/Database/DatabaseWorkerPool.h12
-rw-r--r--src/server/database/Database/MySQLConnection.cpp6
-rw-r--r--src/server/database/Database/MySQLConnection.h6
-rw-r--r--src/server/database/Database/PreparedStatement.h2
-rw-r--r--src/server/database/Database/QueryHolder.cpp2
-rw-r--r--src/server/database/Database/SQLOperation.h2
-rw-r--r--src/server/database/Database/Transaction.cpp4
-rw-r--r--src/server/database/Database/Transaction.h2
-rw-r--r--src/server/database/PrecompiledHeaders/databasePCH.h22
-rw-r--r--src/server/database/Updater/UpdateFetcher.cpp1
-rw-r--r--src/server/game/AI/CoreAI/CombatAI.cpp2
-rw-r--r--src/server/game/AI/CoreAI/GameObjectAI.h6
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.h18
-rw-r--r--src/server/game/AI/CreatureAI.cpp2
-rw-r--r--src/server/game/AI/CreatureAIFactory.h3
-rw-r--r--src/server/game/AI/CreatureAIImpl.h4
-rw-r--r--src/server/game/AI/CreatureAIRegistry.cpp15
-rw-r--r--src/server/game/AI/PlayerAI/PlayerAI.h1
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.cpp4
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.h6
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp4
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h4
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp12
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.h12
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp9
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.h9
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h37
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBot.h4
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp2
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp1
-rw-r--r--src/server/game/Battlefield/Battlefield.cpp4
-rw-r--r--src/server/game/Battlefield/Battlefield.h2
-rw-r--r--src/server/game/Battlefield/Zones/BattlefieldWG.cpp12
-rw-r--r--src/server/game/Battlegrounds/ArenaTeam.cpp2
-rw-r--r--src/server/game/Battlegrounds/ArenaTeam.h2
-rw-r--r--src/server/game/Battlegrounds/Battleground.cpp8
-rw-r--r--src/server/game/Battlegrounds/Battleground.h10
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp4
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAB.h2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp6
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAV.h4
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundDS.h1
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp16
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundEY.h8
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundIC.h2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundSA.h2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundWS.h2
-rw-r--r--src/server/game/Chat/Channels/Channel.h3
-rw-r--r--src/server/game/Chat/Channels/ChannelAppenders.h4
-rw-r--r--src/server/game/Conditions/ConditionMgr.cpp3
-rw-r--r--src/server/game/DataStores/M2Stores.cpp1
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.cpp16
-rw-r--r--src/server/game/DungeonFinding/LFGPlayerData.h2
-rw-r--r--src/server/game/DungeonFinding/LFGQueue.cpp4
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp11
-rw-r--r--src/server/game/Entities/Creature/Creature.h8
-rw-r--r--src/server/game/Entities/Creature/CreatureGroups.cpp2
-rw-r--r--src/server/game/Entities/Creature/CreatureGroups.h4
-rw-r--r--src/server/game/Entities/Creature/TemporarySummon.h2
-rw-r--r--src/server/game/Entities/DynamicObject/DynamicObject.h2
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp9
-rw-r--r--src/server/game/Entities/Item/Container/Bag.cpp2
-rw-r--r--src/server/game/Entities/Item/Item.cpp6
-rw-r--r--src/server/game/Entities/Item/Item.h4
-rw-r--r--src/server/game/Entities/Object/Object.cpp36
-rw-r--r--src/server/game/Entities/Object/Object.h6
-rw-r--r--src/server/game/Entities/Object/ObjectPosSelector.cpp2
-rw-r--r--src/server/game/Entities/Object/ObjectPosSelector.h4
-rw-r--r--src/server/game/Entities/Object/Position.cpp10
-rw-r--r--src/server/game/Entities/Object/Position.h16
-rw-r--r--src/server/game/Entities/Object/Updates/UpdateData.cpp2
-rw-r--r--src/server/game/Entities/Object/Updates/UpdateData.h2
-rw-r--r--src/server/game/Entities/Pet/Pet.cpp8
-rw-r--r--src/server/game/Entities/Player/EquipmentSet.h (renamed from src/server/game/Entities/Player/EquipementSet.h)12
-rw-r--r--src/server/game/Entities/Player/Player.cpp226
-rw-r--r--src/server/game/Entities/Player/Player.h14
-rw-r--r--src/server/game/Entities/Player/PlayerTaxi.h9
-rw-r--r--src/server/game/Entities/Unit/StatSystem.cpp1
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp33
-rw-r--r--src/server/game/Entities/Unit/Unit.h16
-rw-r--r--src/server/game/Events/GameEventMgr.cpp2
-rw-r--r--src/server/game/Globals/ObjectAccessor.h1
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp50
-rw-r--r--src/server/game/Globals/ObjectMgr.h84
-rw-r--r--src/server/game/Grids/Cells/Cell.h4
-rw-r--r--src/server/game/Grids/Dynamic/TypeContainerVisitor.h4
-rw-r--r--src/server/game/Grids/GridRefManager.h2
-rw-r--r--src/server/game/Grids/NGrid.h8
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.cpp2
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.h6
-rw-r--r--src/server/game/Grids/ObjectGridLoader.h2
-rw-r--r--src/server/game/Groups/Group.cpp36
-rw-r--r--src/server/game/Groups/Group.h2
-rw-r--r--src/server/game/Guilds/Guild.cpp36
-rw-r--r--src/server/game/Guilds/Guild.h2
-rw-r--r--src/server/game/Handlers/AuctionHouseHandler.cpp1
-rw-r--r--src/server/game/Handlers/BattleGroundHandler.cpp1
-rw-r--r--src/server/game/Handlers/BattlefieldHandler.cpp8
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp1
-rw-r--r--src/server/game/Handlers/GroupHandler.cpp8
-rw-r--r--src/server/game/Handlers/GuildHandler.cpp2
-rw-r--r--src/server/game/Handlers/ItemHandler.cpp5
-rw-r--r--src/server/game/Handlers/MiscHandler.cpp2
-rw-r--r--src/server/game/Handlers/NPCHandler.cpp4
-rw-r--r--src/server/game/Handlers/PetHandler.cpp3
-rw-r--r--src/server/game/Handlers/PetitionsHandler.cpp6
-rw-r--r--src/server/game/Handlers/QueryHandler.cpp1
-rw-r--r--src/server/game/Handlers/QuestHandler.cpp1
-rw-r--r--src/server/game/Handlers/SpellHandler.cpp2
-rw-r--r--src/server/game/Handlers/TaxiHandler.cpp2
-rw-r--r--src/server/game/Handlers/TicketHandler.cpp4
-rw-r--r--src/server/game/Handlers/TradeHandler.cpp6
-rw-r--r--src/server/game/Instances/InstanceSaveMgr.cpp4
-rw-r--r--src/server/game/Instances/InstanceSaveMgr.h2
-rw-r--r--src/server/game/Instances/InstanceScript.cpp15
-rw-r--r--src/server/game/Instances/InstanceScript.h4
-rw-r--r--src/server/game/Loot/LootItemStorage.h2
-rw-r--r--src/server/game/Loot/LootMgr.cpp12
-rw-r--r--src/server/game/Loot/LootMgr.h4
-rw-r--r--src/server/game/Mails/Mail.h2
-rw-r--r--src/server/game/Maps/Map.cpp30
-rw-r--r--src/server/game/Maps/Map.h40
-rw-r--r--src/server/game/Maps/MapInstanced.cpp10
-rw-r--r--src/server/game/Maps/MapInstanced.h6
-rw-r--r--src/server/game/Maps/MapManager.h2
-rw-r--r--src/server/game/Maps/MapScripts.cpp14
-rw-r--r--src/server/game/Maps/TransportMgr.h2
-rw-r--r--src/server/game/Miscellaneous/Formulas.h2
-rw-r--r--src/server/game/Miscellaneous/SharedDefines.h2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp8
-rw-r--r--src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp4
-rw-r--r--src/server/game/Movement/MovementGenerators/PointMovementGenerator.h4
-rw-r--r--src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp4
-rw-r--r--src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp10
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h1
-rw-r--r--src/server/game/Movement/PathGenerator.cpp25
-rw-r--r--src/server/game/Movement/PathGenerator.h22
-rw-r--r--src/server/game/Movement/Spline/MoveSpline.cpp28
-rw-r--r--src/server/game/Movement/Spline/MoveSpline.h30
-rw-r--r--src/server/game/Movement/Spline/MoveSplineFlag.h24
-rw-r--r--src/server/game/Movement/Spline/MoveSplineInit.cpp26
-rw-r--r--src/server/game/Movement/Spline/MoveSplineInit.h26
-rw-r--r--src/server/game/Movement/Spline/MoveSplineInitArgs.h22
-rw-r--r--src/server/game/Movement/Spline/MovementTypedefs.h22
-rw-r--r--src/server/game/Movement/Spline/MovementUtil.cpp22
-rw-r--r--src/server/game/Movement/Spline/Spline.cpp31
-rw-r--r--src/server/game/Movement/Spline/Spline.h36
-rw-r--r--src/server/game/Movement/Spline/SplineImpl.h22
-rw-r--r--src/server/game/OutdoorPvP/OutdoorPvP.cpp7
-rw-r--r--src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp3
-rw-r--r--src/server/game/OutdoorPvP/OutdoorPvPMgr.h3
-rw-r--r--src/server/game/Petitions/PetitionMgr.cpp3
-rw-r--r--src/server/game/Petitions/PetitionMgr.h1
-rw-r--r--src/server/game/Pools/PoolMgr.cpp8
-rw-r--r--src/server/game/PrecompiledHeaders/gamePCH.h17
-rw-r--r--src/server/game/Reputation/ReputationMgr.cpp4
-rw-r--r--src/server/game/Scripting/ScriptMgr.cpp62
-rw-r--r--src/server/game/Scripting/ScriptMgr.h68
-rw-r--r--src/server/game/Scripting/ScriptSystem.cpp2
-rw-r--r--src/server/game/Server/Packets/EquipmentSetPackets.cpp6
-rw-r--r--src/server/game/Server/Packets/EquipmentSetPackets.h4
-rw-r--r--src/server/game/Server/WorldSession.cpp12
-rw-r--r--src/server/game/Server/WorldSession.h2
-rw-r--r--src/server/game/Skills/SkillDiscovery.cpp8
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp2
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.h4
-rw-r--r--src/server/game/Spells/Spell.cpp20
-rw-r--r--src/server/game/Spells/Spell.h1
-rw-r--r--src/server/game/Spells/SpellEffects.cpp2
-rw-r--r--src/server/game/Spells/SpellInfo.cpp2
-rw-r--r--src/server/game/Spells/SpellScript.cpp1
-rw-r--r--src/server/game/Spells/SpellScript.h4
-rw-r--r--src/server/game/Texts/CreatureTextMgr.cpp2
-rw-r--r--src/server/game/Texts/CreatureTextMgr.h2
-rw-r--r--src/server/game/Time/GameTime.h1
-rw-r--r--src/server/game/Tools/CharacterDatabaseCleaner.cpp4
-rw-r--r--src/server/game/Tools/CharacterDatabaseCleaner.h2
-rw-r--r--src/server/game/Warden/Warden.cpp4
-rw-r--r--src/server/game/World/World.cpp22
-rw-r--r--src/server/game/World/World.h9
-rw-r--r--src/server/scripts/Commands/cs_account.cpp2
-rw-r--r--src/server/scripts/Commands/cs_ahbot.cpp38
-rw-r--r--src/server/scripts/Commands/cs_ban.cpp4
-rw-r--r--src/server/scripts/Commands/cs_bf.cpp10
-rw-r--r--src/server/scripts/Commands/cs_character.cpp4
-rw-r--r--src/server/scripts/Commands/cs_cheat.cpp18
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp12
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp4
-rw-r--r--src/server/scripts/Commands/cs_gobject.cpp4
-rw-r--r--src/server/scripts/Commands/cs_group.cpp2
-rw-r--r--src/server/scripts/Commands/cs_guild.cpp2
-rw-r--r--src/server/scripts/Commands/cs_honor.cpp1
-rw-r--r--src/server/scripts/Commands/cs_instance.cpp1
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp6
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp10
-rw-r--r--src/server/scripts/Commands/cs_mmaps.cpp6
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp54
-rw-r--r--src/server/scripts/Commands/cs_pet.cpp3
-rw-r--r--src/server/scripts/Commands/cs_quest.cpp6
-rw-r--r--src/server/scripts/Commands/cs_rbac.cpp2
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp198
-rw-r--r--src/server/scripts/Commands/cs_reset.cpp2
-rw-r--r--src/server/scripts/Commands/cs_tele.cpp10
-rw-r--r--src/server/scripts/Commands/cs_ticket.cpp4
-rw-r--r--src/server/scripts/Commands/cs_titles.cpp1
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp14
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp9
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_ambassador_flamelash.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp243
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h6
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp1
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h6
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/deadmines.h6
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp18
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h6
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp1
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp16
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h6
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp14
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp17
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp22
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp1
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp7
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h2
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/zulaman.h8
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp33
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h6
-rw-r--r--src/server/scripts/EasternKingdoms/zone_duskwood.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_hinterlands.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp2
-rw-r--r--src/server/scripts/Events/fireworks_show.cpp115
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp6
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h4
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp4
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h6
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp4
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h1
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp62
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp3
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h6
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp6
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h1
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp1
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.h6
-rw-r--r--src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp1
-rw-r--r--src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp1
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp3
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/maraudon.h6
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp7
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp2
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h11
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h4
-rw-r--r--src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h6
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp3
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h4
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp2
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp2
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp12
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp130
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp2
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h6
-rw-r--r--src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp3
-rw-r--r--src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp2
-rw-r--r--src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h6
-rw-r--r--src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp4
-rw-r--r--src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp13
-rw-r--r--src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.h2
-rw-r--r--src/server/scripts/Kalimdor/zone_ashenvale.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp4
-rw-r--r--src/server/scripts/Kalimdor/zone_durotar.cpp13
-rw-r--r--src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_moonglade.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_silithus.cpp6
-rw-r--r--src/server/scripts/Kalimdor/zone_the_barrens.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_winterspring.cpp2
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h2
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp9
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp6
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp1
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp9
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp1
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h6
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp9
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp2
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp30
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp2
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp4
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h6
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp7
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp2
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp17
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp6
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp1
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp2
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h2
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp2
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp5
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp3
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h6
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp2
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp6
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp2
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp10
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp5
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp15
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp4
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h6
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp2
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h6
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp3
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h6
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp5
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp1
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_horAI.h5
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp1
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h6
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp6
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp12
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp23
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp7
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h6
-rw-r--r--src/server/scripts/Northrend/Gundrak/gundrak.h2
-rw-r--r--src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp11
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp3
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp11
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp6
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp11
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp5
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp14
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp13
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp1
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp11
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp6
-rw-r--r--src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp4
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp1
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp6
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp4
-rw-r--r--src/server/scripts/Northrend/Naxxramas/naxxramas.h3
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp3
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h6
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp1
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp18
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp4
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/oculus.h6
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h6
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp23
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h6
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp17
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp4
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp4
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp3
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp46
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp9
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp3
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h8
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp20
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h6
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp7
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp3
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp1
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp1
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h2
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp2
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h6
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp1
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_moragg.cpp1
-rw-r--r--src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp3
-rw-r--r--src/server/scripts/Northrend/VioletHold/violet_hold.cpp12
-rw-r--r--src/server/scripts/Northrend/VioletHold/violet_hold.h2
-rw-r--r--src/server/scripts/Northrend/zone_borean_tundra.cpp16
-rw-r--r--src/server/scripts/Northrend/zone_dalaran.cpp5
-rw-r--r--src/server/scripts/Northrend/zone_dragonblight.cpp6
-rw-r--r--src/server/scripts/Northrend/zone_grizzly_hills.cpp11
-rw-r--r--src/server/scripts/Northrend/zone_storm_peaks.cpp11
-rw-r--r--src/server/scripts/Northrend/zone_wintergrasp.cpp2
-rw-r--r--src/server/scripts/Northrend/zone_zuldrak.cpp10
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp3
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp236
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp78
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp78
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPZM.h12
-rw-r--r--src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h6
-rw-r--r--src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp6
-rw-r--r--src/server/scripts/Outland/Auchindoun/ManaTombs/mana_tombs.h6
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp2
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h6
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/black_temple.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/black_temple.h2
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp3
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_illidan.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_illidari_council.cpp12
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp14
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp7
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp3
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp16
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp6
-rw-r--r--src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp6
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp39
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp14
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp4
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/the_underbog.h6
-rw-r--r--src/server/scripts/Outland/GruulsLair/boss_gruul.cpp2
-rw-r--r--src/server/scripts/Outland/GruulsLair/gruuls_lair.h6
-rw-r--r--src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp45
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp3
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp3
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp22
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h6
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp16
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp7
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h8
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp31
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.cpp6
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h12
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp4
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp13
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp14
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/the_eye.h6
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp32
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h6
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h6
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp19
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp1
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h6
-rw-r--r--src/server/scripts/Outland/zone_blades_edge_mountains.cpp8
-rw-r--r--src/server/scripts/Outland/zone_hellfire_peninsula.cpp1
-rw-r--r--src/server/scripts/Outland/zone_nagrand.cpp7
-rw-r--r--src/server/scripts/Outland/zone_netherstorm.cpp11
-rw-r--r--src/server/scripts/Outland/zone_shadowmoon_valley.cpp9
-rw-r--r--src/server/scripts/Pet/pet_dk.cpp1
-rw-r--r--src/server/scripts/Pet/pet_mage.cpp5
-rw-r--r--src/server/scripts/ScriptPCH.h17
-rw-r--r--src/server/scripts/Spells/spell_holiday.cpp70
-rw-r--r--src/server/scripts/Spells/spell_item.cpp28
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp46
-rw-r--r--src/server/scripts/Spells/spell_pet.cpp10
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp19
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp23
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp49
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp6
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp20
-rw-r--r--src/server/scripts/World/boss_emerald_dragons.cpp6
-rw-r--r--src/server/scripts/World/duel_reset.cpp4
-rw-r--r--src/server/scripts/World/go_scripts.cpp5
-rw-r--r--src/server/scripts/World/mob_generic_creature.cpp2
-rw-r--r--src/server/scripts/World/npc_innkeeper.cpp4
-rw-r--r--src/server/scripts/World/npcs_special.cpp8
-rw-r--r--src/server/shared/Dynamic/FactoryHolder.h2
-rw-r--r--src/server/shared/Dynamic/LinkedList.h10
-rw-r--r--src/server/shared/Dynamic/ObjectRegistry.h2
-rw-r--r--src/server/shared/Packets/ByteBuffer.cpp23
-rw-r--r--src/server/shared/Packets/ByteBuffer.h6
-rw-r--r--src/server/shared/PrecompiledHeaders/sharedPCH.h17
-rw-r--r--src/server/worldserver/CommandLine/CliRunnable.cpp8
-rw-r--r--src/server/worldserver/PrecompiledHeaders/worldPCH.h17
-rw-r--r--src/server/worldserver/RemoteAccess/RASession.cpp7
-rw-r--r--src/server/worldserver/RemoteAccess/RASession.h4
-rw-r--r--src/server/worldserver/TCSoap/TCSoap.h4
582 files changed, 2598 insertions, 2978 deletions
diff --git a/src/server/bnetserver/Main.cpp b/src/server/bnetserver/Main.cpp
index 7ffc504eeab..58ea4d52034 100644
--- a/src/server/bnetserver/Main.cpp
+++ b/src/server/bnetserver/Main.cpp
@@ -118,7 +118,7 @@ int main(int argc, char** argv)
{
TC_LOG_INFO("server.bnetserver", "%s", text);
},
- []()
+ []()
{
TC_LOG_INFO("server.bnetserver", "Using configuration file %s.", sConfigMgr->GetFilename().c_str());
TC_LOG_INFO("server.bnetserver", "Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
diff --git a/src/server/database/Database/AdhocStatement.cpp b/src/server/database/Database/AdhocStatement.cpp
index 5c94ee7c1ef..43be78c76c4 100644
--- a/src/server/database/Database/AdhocStatement.cpp
+++ b/src/server/database/Database/AdhocStatement.cpp
@@ -23,7 +23,7 @@
#include <cstring>
/*! Basic, ad-hoc queries. */
-BasicStatementTask::BasicStatementTask(const char* sql, bool async) :
+BasicStatementTask::BasicStatementTask(char const* sql, bool async) :
m_result(nullptr)
{
m_sql = strdup(sql);
diff --git a/src/server/database/Database/AdhocStatement.h b/src/server/database/Database/AdhocStatement.h
index 0e11ca83717..b9e197398cc 100644
--- a/src/server/database/Database/AdhocStatement.h
+++ b/src/server/database/Database/AdhocStatement.h
@@ -26,14 +26,14 @@
class TC_DATABASE_API BasicStatementTask : public SQLOperation
{
public:
- BasicStatementTask(const char* sql, bool async = false);
+ BasicStatementTask(char const* sql, bool async = false);
~BasicStatementTask();
bool Execute() override;
QueryResultFuture GetFuture() const { return m_result->get_future(); }
private:
- const char* m_sql; //- Raw query to be executed
+ char const* m_sql; //- Raw query to be executed
bool m_has_result;
QueryResultPromise* m_result;
};
diff --git a/src/server/database/Database/DatabaseEnv.h b/src/server/database/Database/DatabaseEnv.h
index 22ea681e5c9..b481368b842 100644
--- a/src/server/database/Database/DatabaseEnv.h
+++ b/src/server/database/Database/DatabaseEnv.h
@@ -21,9 +21,9 @@
#include "Define.h"
#include "DatabaseWorkerPool.h"
-#include "Implementation/WorldDatabase.h"
-#include "Implementation/CharacterDatabase.h"
#include "Implementation/LoginDatabase.h"
+#include "Implementation/CharacterDatabase.h"
+#include "Implementation/WorldDatabase.h"
#include "Implementation/HotfixDatabase.h"
#include "Field.h"
diff --git a/src/server/database/Database/DatabaseLoader.cpp b/src/server/database/Database/DatabaseLoader.cpp
index 9d1af5363e8..eac5fe58a39 100644
--- a/src/server/database/Database/DatabaseLoader.cpp
+++ b/src/server/database/Database/DatabaseLoader.cpp
@@ -184,6 +184,6 @@ DatabaseLoader& DatabaseLoader::AddDatabase<LoginDatabaseConnection>(DatabaseWor
template TC_DATABASE_API
DatabaseLoader& DatabaseLoader::AddDatabase<CharacterDatabaseConnection>(DatabaseWorkerPool<CharacterDatabaseConnection>&, std::string const&);
template TC_DATABASE_API
-DatabaseLoader& DatabaseLoader::AddDatabase<HotfixDatabaseConnection>(DatabaseWorkerPool<HotfixDatabaseConnection>&, std::string const&);
-template TC_DATABASE_API
DatabaseLoader& DatabaseLoader::AddDatabase<WorldDatabaseConnection>(DatabaseWorkerPool<WorldDatabaseConnection>&, std::string const&);
+template TC_DATABASE_API
+DatabaseLoader& DatabaseLoader::AddDatabase<HotfixDatabaseConnection>(DatabaseWorkerPool<HotfixDatabaseConnection>&, std::string const&);
diff --git a/src/server/database/Database/DatabaseLoader.h b/src/server/database/Database/DatabaseLoader.h
index bcb4f79e8eb..2d527c5bb01 100644
--- a/src/server/database/Database/DatabaseLoader.h
+++ b/src/server/database/Database/DatabaseLoader.h
@@ -25,7 +25,7 @@
#include <stack>
#include <string>
-template<class T>
+template <class T>
class DatabaseWorkerPool;
// A helper class to initiate all database worker pools,
diff --git a/src/server/database/Database/DatabaseWorkerPool.cpp b/src/server/database/Database/DatabaseWorkerPool.cpp
index 94b041b4b87..a1492c65bf7 100644
--- a/src/server/database/Database/DatabaseWorkerPool.cpp
+++ b/src/server/database/Database/DatabaseWorkerPool.cpp
@@ -167,7 +167,7 @@ bool DatabaseWorkerPool<T>::PrepareStatements()
}
template <class T>
-QueryResult DatabaseWorkerPool<T>::Query(const char* sql, T* connection /*= nullptr*/)
+QueryResult DatabaseWorkerPool<T>::Query(char const* sql, T* connection /*= nullptr*/)
{
if (!connection)
connection = GetFreeConnection();
@@ -203,7 +203,7 @@ PreparedQueryResult DatabaseWorkerPool<T>::Query(PreparedStatement<T>* stmt)
}
template <class T>
-QueryCallback DatabaseWorkerPool<T>::AsyncQuery(const char* sql)
+QueryCallback DatabaseWorkerPool<T>::AsyncQuery(char const* sql)
{
BasicStatementTask* task = new BasicStatementTask(sql, true);
// Store future result before enqueueing - task might get already processed and deleted before returning from this method
@@ -395,7 +395,7 @@ uint32 DatabaseWorkerPool<T>::OpenConnections(InternalIndex type, uint8 numConne
}
template <class T>
-unsigned long DatabaseWorkerPool<T>::EscapeString(char *to, const char *from, unsigned long length)
+unsigned long DatabaseWorkerPool<T>::EscapeString(char* to, char const* from, unsigned long length)
{
if (!to || !from || !length)
return 0;
@@ -434,7 +434,7 @@ char const* DatabaseWorkerPool<T>::GetDatabaseName() const
}
template <class T>
-void DatabaseWorkerPool<T>::Execute(const char* sql)
+void DatabaseWorkerPool<T>::Execute(char const* sql)
{
if (Trinity::IsFormatEmptyOrNull(sql))
return;
@@ -451,7 +451,7 @@ void DatabaseWorkerPool<T>::Execute(PreparedStatement<T>* stmt)
}
template <class T>
-void DatabaseWorkerPool<T>::DirectExecute(const char* sql)
+void DatabaseWorkerPool<T>::DirectExecute(char const* sql)
{
if (Trinity::IsFormatEmptyOrNull(sql))
return;
@@ -473,7 +473,7 @@ void DatabaseWorkerPool<T>::DirectExecute(PreparedStatement<T>* stmt)
}
template <class T>
-void DatabaseWorkerPool<T>::ExecuteOrAppend(SQLTransaction<T>& trans, const char* sql)
+void DatabaseWorkerPool<T>::ExecuteOrAppend(SQLTransaction<T>& trans, char const* sql)
{
if (!trans)
Execute(sql);
diff --git a/src/server/database/Database/DatabaseWorkerPool.h b/src/server/database/Database/DatabaseWorkerPool.h
index e84b1072733..f72817c3a8f 100644
--- a/src/server/database/Database/DatabaseWorkerPool.h
+++ b/src/server/database/Database/DatabaseWorkerPool.h
@@ -68,7 +68,7 @@ class DatabaseWorkerPool
//! Enqueues a one-way SQL operation in string format that will be executed asynchronously.
//! This method should only be used for queries that are only executed once, e.g during startup.
- void Execute(const char* sql);
+ void Execute(char const* sql);
//! Enqueues a one-way SQL operation in string format -with variable args- that will be executed asynchronously.
//! This method should only be used for queries that are only executed once, e.g during startup.
@@ -91,7 +91,7 @@ class DatabaseWorkerPool
//! Directly executes a one-way SQL operation in string format, that will block the calling thread until finished.
//! This method should only be used for queries that are only executed once, e.g during startup.
- void DirectExecute(const char* sql);
+ void DirectExecute(char const* sql);
//! Directly executes a one-way SQL operation in string format -with variable args-, that will block the calling thread until finished.
//! This method should only be used for queries that are only executed once, e.g during startup.
@@ -114,7 +114,7 @@ class DatabaseWorkerPool
//! Directly executes an SQL query in string format that will block the calling thread until finished.
//! Returns reference counted auto pointer, no need for manual memory management in upper level code.
- QueryResult Query(const char* sql, T* connection = nullptr);
+ QueryResult Query(char const* sql, T* connection = nullptr);
//! Directly executes an SQL query in string format -with variable args- that will block the calling thread until finished.
//! Returns reference counted auto pointer, no need for manual memory management in upper level code.
@@ -149,7 +149,7 @@ class DatabaseWorkerPool
//! Enqueues a query in string format that will set the value of the QueryResultFuture return object as soon as the query is executed.
//! The return value is then processed in ProcessQueryCallback methods.
- QueryCallback AsyncQuery(const char* sql);
+ QueryCallback AsyncQuery(char const* sql);
//! Enqueues a query in prepared format that will set the value of the PreparedQueryResultFuture return object as soon as the query is executed.
//! The return value is then processed in ProcessQueryCallback methods.
@@ -183,7 +183,7 @@ class DatabaseWorkerPool
//! Method used to execute ad-hoc statements in a diverse context.
//! Will be wrapped in a transaction if valid object is present, otherwise executed standalone.
- void ExecuteOrAppend(SQLTransaction<T>& trans, const char* sql);
+ void ExecuteOrAppend(SQLTransaction<T>& trans, char const* sql);
//! Method used to execute prepared statements in a diverse context.
//! Will be wrapped in a transaction if valid object is present, otherwise executed standalone.
@@ -209,7 +209,7 @@ class DatabaseWorkerPool
private:
uint32 OpenConnections(InternalIndex type, uint8 numConnections);
- unsigned long EscapeString(char *to, const char *from, unsigned long length);
+ unsigned long EscapeString(char* to, char const* from, unsigned long length);
void Enqueue(SQLOperation* op);
diff --git a/src/server/database/Database/MySQLConnection.cpp b/src/server/database/Database/MySQLConnection.cpp
index 083eadef93d..4ca0f3802f4 100644
--- a/src/server/database/Database/MySQLConnection.cpp
+++ b/src/server/database/Database/MySQLConnection.cpp
@@ -165,7 +165,7 @@ bool MySQLConnection::PrepareStatements()
return !m_prepareError;
}
-bool MySQLConnection::Execute(const char* sql)
+bool MySQLConnection::Execute(char const* sql)
{
if (!m_Mysql)
return false;
@@ -294,7 +294,7 @@ bool MySQLConnection::_Query(PreparedStatementBase* stmt, MySQLResult** pResult,
return true;
}
-ResultSet* MySQLConnection::Query(const char* sql)
+ResultSet* MySQLConnection::Query(char const* sql)
{
if (!sql)
return nullptr;
@@ -394,7 +394,7 @@ int MySQLConnection::ExecuteTransaction(std::shared_ptr<TransactionBase> transac
break;
case SQL_ELEMENT_RAW:
{
- const char* sql = data.element.query;
+ char const* sql = data.element.query;
ASSERT(sql);
if (!Execute(sql))
{
diff --git a/src/server/database/Database/MySQLConnection.h b/src/server/database/Database/MySQLConnection.h
index 2de991a8b70..f1ae98279cd 100644
--- a/src/server/database/Database/MySQLConnection.h
+++ b/src/server/database/Database/MySQLConnection.h
@@ -66,11 +66,11 @@ class TC_DATABASE_API MySQLConnection
bool PrepareStatements();
- bool Execute(const char* sql);
+ bool Execute(char const* sql);
bool Execute(PreparedStatementBase* stmt);
- ResultSet* Query(const char* sql);
+ ResultSet* Query(char const* sql);
PreparedResultSet* Query(PreparedStatementBase* stmt);
- bool _Query(const char* sql, MySQLResult** pResult, MySQLField** pFields, uint64* pRowCount, uint32* pFieldCount);
+ bool _Query(char const* sql, MySQLResult** pResult, MySQLField** pFields, uint64* pRowCount, uint32* pFieldCount);
bool _Query(PreparedStatementBase* stmt, MySQLResult** pResult, uint64* pRowCount, uint32* pFieldCount);
void BeginTransaction();
diff --git a/src/server/database/Database/PreparedStatement.h b/src/server/database/Database/PreparedStatement.h
index 64f2bf89cc0..7f20bb93adc 100644
--- a/src/server/database/Database/PreparedStatement.h
+++ b/src/server/database/Database/PreparedStatement.h
@@ -83,6 +83,7 @@ class TC_DATABASE_API PreparedStatementBase
explicit PreparedStatementBase(uint32 index, uint8 capacity);
virtual ~PreparedStatementBase();
+ void setNull(const uint8 index);
void setBool(const uint8 index, const bool value);
void setUInt8(const uint8 index, const uint8 value);
void setUInt16(const uint8 index, const uint16 value);
@@ -102,7 +103,6 @@ class TC_DATABASE_API PreparedStatementBase
std::vector<uint8> vec(value.begin(), value.end());
setBinary(index, vec);
}
- void setNull(const uint8 index);
uint32 GetIndex() const { return m_index; }
diff --git a/src/server/database/Database/QueryHolder.cpp b/src/server/database/Database/QueryHolder.cpp
index 953a54fecaa..92877c97ded 100644
--- a/src/server/database/Database/QueryHolder.cpp
+++ b/src/server/database/Database/QueryHolder.cpp
@@ -85,7 +85,7 @@ bool SQLQueryHolderTask::Execute()
return false;
/// execute all queries in the holder and pass the results
- for (size_t i = 0; i < m_holder->m_queries.size(); i++)
+ for (size_t i = 0; i < m_holder->m_queries.size(); ++i)
if (PreparedStatementBase* stmt = m_holder->m_queries[i].first)
m_holder->SetPreparedResult(i, m_conn->Query(stmt));
diff --git a/src/server/database/Database/SQLOperation.h b/src/server/database/Database/SQLOperation.h
index ba855e57e72..97f1b396cea 100644
--- a/src/server/database/Database/SQLOperation.h
+++ b/src/server/database/Database/SQLOperation.h
@@ -25,7 +25,7 @@
union SQLElementUnion
{
PreparedStatementBase* stmt;
- const char* query;
+ char const* query;
};
//- Type specifier of our element data
diff --git a/src/server/database/Database/Transaction.cpp b/src/server/database/Database/Transaction.cpp
index 27aa2a4808c..da72b018ea6 100644
--- a/src/server/database/Database/Transaction.cpp
+++ b/src/server/database/Database/Transaction.cpp
@@ -23,7 +23,7 @@
std::mutex TransactionTask::_deadlockLock;
//- Append a raw ad-hoc query to the transaction
-void TransactionBase::Append(const char* sql)
+void TransactionBase::Append(char const* sql)
{
SQLElementData data;
data.type = SQL_ELEMENT_RAW;
@@ -46,7 +46,7 @@ void TransactionBase::Cleanup()
if (_cleanedUp)
return;
- for (SQLElementData const &data : m_queries)
+ for (SQLElementData const& data : m_queries)
{
switch (data.type)
{
diff --git a/src/server/database/Database/Transaction.h b/src/server/database/Database/Transaction.h
index 36f7d3ec749..205b06908fd 100644
--- a/src/server/database/Database/Transaction.h
+++ b/src/server/database/Database/Transaction.h
@@ -39,7 +39,7 @@ class TC_DATABASE_API TransactionBase
TransactionBase() : _cleanedUp(false) { }
virtual ~TransactionBase() { Cleanup(); }
- void Append(const char* sql);
+ void Append(char const* sql);
template<typename Format, typename... Args>
void PAppend(Format&& sql, Args&&... args)
{
diff --git a/src/server/database/PrecompiledHeaders/databasePCH.h b/src/server/database/PrecompiledHeaders/databasePCH.h
index 39701ca8ca9..015b163e82b 100644
--- a/src/server/database/PrecompiledHeaders/databasePCH.h
+++ b/src/server/database/PrecompiledHeaders/databasePCH.h
@@ -1,15 +1,29 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
#include "Define.h"
#include "Errors.h"
#include "Field.h"
#include "Log.h"
#include "MySQLConnection.h"
+#include "MySQLWorkaround.h"
#include "PreparedStatement.h"
#include "QueryResult.h"
#include "SQLOperation.h"
#include "Transaction.h"
-#ifdef _WIN32 // hack for broken mysql.h not including the correct winsock header for SOCKET definition, fixed in 5.7
-#include <winsock2.h>
-#endif
-#include <mysql.h>
#include <string>
#include <vector>
diff --git a/src/server/database/Updater/UpdateFetcher.cpp b/src/server/database/Updater/UpdateFetcher.cpp
index a5220ab7af1..d36e4d2f771 100644
--- a/src/server/database/Updater/UpdateFetcher.cpp
+++ b/src/server/database/Updater/UpdateFetcher.cpp
@@ -34,7 +34,6 @@ struct UpdateFetcher::DirectoryEntry
DirectoryEntry(Path const& path_, State state_) : path(path_), state(state_) { }
Path const path;
-
State const state;
};
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp
index 160b58a9742..b96a97d8734 100644
--- a/src/server/game/AI/CoreAI/CombatAI.cpp
+++ b/src/server/game/AI/CoreAI/CombatAI.cpp
@@ -248,7 +248,7 @@ TurretAI::TurretAI(Creature* c) : CreatureAI(c)
me->m_SightDistance = me->m_CombatDistance;
}
-bool TurretAI::CanAIAttack(const Unit* /*who*/) const
+bool TurretAI::CanAIAttack(Unit const* /*who*/) const
{
/// @todo use one function to replace it
if (!me->IsWithinCombatRange(me->GetVictim(), me->m_CombatDistance)
diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h
index 61fb2f350a1..1e15325eefb 100644
--- a/src/server/game/AI/CoreAI/GameObjectAI.h
+++ b/src/server/game/AI/CoreAI/GameObjectAI.h
@@ -46,7 +46,7 @@ class TC_GAME_API GameObjectAI
virtual void SetGUID(uint64 /*guid*/, int32 /*id = 0 */) { }
virtual uint64 GetGUID(int32 /*id = 0 */) const { return 0; }
- static int32 Permissible(GameObject const* /*go*/);
+ static int32 Permissible(GameObject const* go);
// Called when a player opens a gossip dialog with the gameobject.
virtual bool GossipHello(Player* /*player*/) { return false; }
@@ -82,7 +82,7 @@ class TC_GAME_API GameObjectAI
virtual void OnLootStateChanged(uint32 /*state*/, Unit* /*unit*/) { }
virtual void OnStateChanged(uint32 /*state*/) { }
virtual void EventInform(uint32 /*eventId*/) { }
- virtual void SpellHit(Unit* /*unit*/, const SpellInfo* /*spellInfo*/) { }
+ virtual void SpellHit(Unit* /*unit*/, SpellInfo const* /*spellInfo*/) { }
};
class TC_GAME_API NullGameObjectAI : public GameObjectAI
@@ -92,6 +92,6 @@ class TC_GAME_API NullGameObjectAI : public GameObjectAI
void UpdateAI(uint32 /*diff*/) override { }
- static int32 Permissible(GameObject const* /*go*/);
+ static int32 Permissible(GameObject const* go);
};
#endif
diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h
index a38bf60e632..cec43d12698 100644
--- a/src/server/game/AI/CoreAI/UnitAI.h
+++ b/src/server/game/AI/CoreAI/UnitAI.h
@@ -28,7 +28,7 @@
#define ENSURE_AI(a,b) (EnsureAI<a>(b))
template<class T, class U>
-inline T* EnsureAI(U* ai)
+T* EnsureAI(U* ai)
{
T* cast_ai = dynamic_cast<T*>(ai);
ASSERT(cast_ai);
@@ -74,7 +74,7 @@ struct TC_GAME_API DefaultTargetSelector
// Target selector for spell casts checking range, auras and attributes
/// @todo Add more checks from Spell::CheckCast
-struct TC_GAME_API SpellTargetSelector : public std::unary_function<Unit*, bool>
+struct TC_GAME_API SpellTargetSelector
{
public:
SpellTargetSelector(Unit* caster, uint32 spellId);
@@ -88,7 +88,7 @@ struct TC_GAME_API SpellTargetSelector : public std::unary_function<Unit*, bool>
// Very simple target selector, will just skip main target
// NOTE: When passing to UnitAI::SelectTarget remember to use 0 as position for random selection
// because tank will not be in the temporary list
-struct TC_GAME_API NonTankTargetSelector : public std::unary_function<Unit*, bool>
+struct TC_GAME_API NonTankTargetSelector
{
public:
NonTankTargetSelector(Unit* source, bool playerOnly = true) : _source(source), _playerOnly(playerOnly) { }
@@ -119,11 +119,11 @@ public:
FarthestTargetSelector(Unit const* unit, float dist, bool playerOnly, bool inLos) : _me(unit), _dist(dist), _playerOnly(playerOnly), _inLos(inLos) {}
bool operator()(Unit const* target) const;
-private:
- const Unit* _me;
- float _dist;
- bool _playerOnly;
- bool _inLos;
+ private:
+ Unit const* _me;
+ float _dist;
+ bool _playerOnly;
+ bool _inLos;
};
class TC_GAME_API UnitAI
@@ -315,7 +315,7 @@ class TC_GAME_API UnitAI
virtual bool GossipSelect(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/) { return false; }
// Called when a player selects a gossip with a code in the creature's gossip menu.
- virtual bool GossipSelectCode(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/, const char* /*code*/) { return false; }
+ virtual bool GossipSelectCode(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/, char const* /*code*/) { return false; }
// Called when a player accepts a quest from the creature.
virtual void QuestAccept(Player* /*player*/, Quest const* /*quest*/) { }
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 7e57465443b..bb44c5d572f 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -393,7 +393,7 @@ bool CreatureAI::CheckInRoom()
}
}
-Creature* CreatureAI::DoSummon(uint32 entry, const Position& pos, uint32 despawnTime, TempSummonType summonType)
+Creature* CreatureAI::DoSummon(uint32 entry, Position const& pos, uint32 despawnTime, TempSummonType summonType)
{
return me->SummonCreature(entry, pos, summonType, despawnTime);
}
diff --git a/src/server/game/AI/CreatureAIFactory.h b/src/server/game/AI/CreatureAIFactory.h
index 92e757d835d..70de867e8e8 100644
--- a/src/server/game/AI/CreatureAIFactory.h
+++ b/src/server/game/AI/CreatureAIFactory.h
@@ -21,6 +21,9 @@
#include "ObjectRegistry.h"
#include "FactoryHolder.h"
+class Creature;
+class CreatureAI;
+
typedef FactoryHolder<CreatureAI, Creature> CreatureAICreator;
struct SelectableAI : public CreatureAICreator, public Permissible<Creature>
diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h
index cbc7c5912a0..fa3b5662d99 100644
--- a/src/server/game/AI/CreatureAIImpl.h
+++ b/src/server/game/AI/CreatureAIImpl.h
@@ -93,8 +93,8 @@ AISpellInfoType* GetAISpellInfo(uint32 spellId, Difficulty difficulty);
TC_GAME_API bool InstanceHasScript(WorldObject const* obj, char const* scriptName);
-template<class AI, class T>
-inline AI* GetInstanceAI(T* obj, char const* scriptName)
+template <class AI, class T>
+AI* GetInstanceAI(T* obj, char const* scriptName)
{
if (InstanceHasScript(obj, scriptName))
return new AI(obj);
diff --git a/src/server/game/AI/CreatureAIRegistry.cpp b/src/server/game/AI/CreatureAIRegistry.cpp
index 34cc64af22b..35ba2a56be6 100644
--- a/src/server/game/AI/CreatureAIRegistry.cpp
+++ b/src/server/game/AI/CreatureAIRegistry.cpp
@@ -15,19 +15,20 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "PassiveAI.h"
-#include "ReactorAI.h"
+#include "CreatureAIFactory.h"
+#include "GameObjectAIFactory.h"
+
#include "CombatAI.h"
#include "GuardAI.h"
+#include "PassiveAI.h"
#include "PetAI.h"
+#include "ReactorAI.h"
+#include "SmartAI.h"
#include "TotemAI.h"
-#include "RandomMovementGenerator.h"
+
#include "MovementGenerator.h"
-#include "CreatureAIRegistry.h"
+#include "RandomMovementGenerator.h"
#include "WaypointMovementGenerator.h"
-#include "CreatureAIFactory.h"
-#include "GameObjectAIFactory.h"
-#include "SmartAI.h"
namespace AIRegistry
{
diff --git a/src/server/game/AI/PlayerAI/PlayerAI.h b/src/server/game/AI/PlayerAI/PlayerAI.h
index 225b51c09f7..600713e9680 100644
--- a/src/server/game/AI/PlayerAI/PlayerAI.h
+++ b/src/server/game/AI/PlayerAI/PlayerAI.h
@@ -30,6 +30,7 @@ class TC_GAME_API PlayerAI : public UnitAI
void OnCharmed(bool /*apply*/) override { } // charm AI application for players is handled by Unit::SetCharmedBy / Unit::RemoveCharmedBy
Creature* GetCharmer() const;
+
// helper functions to determine player info
uint16 GetSpec(Player const* who = nullptr) const;
static bool IsPlayerHealer(Player const* who);
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
index ee6d0770604..ae30dcca730 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
@@ -548,7 +548,7 @@ bool BossAI::CanAIAttack(Unit const* target) const
return CheckBoundary(target);
}
-void BossAI::_DespawnAtEvade(Seconds delayToRespawn, Creature* who)
+void BossAI::_DespawnAtEvade(Seconds delayToRespawn /*= 30s*/, Creature* who /*= nullptr*/)
{
if (delayToRespawn < Seconds(2))
{
@@ -566,7 +566,7 @@ void BossAI::_DespawnAtEvade(Seconds delayToRespawn, Creature* who)
return;
}
- who->DespawnOrUnsummon(0, Seconds(delayToRespawn));
+ who->DespawnOrUnsummon(0, delayToRespawn);
if (instance && who == me)
instance->SetBossState(_bossId, FAIL);
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
index c255f97ae24..28d40b24856 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
@@ -19,7 +19,7 @@
#define SCRIPTEDCREATURE_H_
#include "CreatureAI.h"
-#include "Creature.h" // convenience include for scripts, all uses of ScriptedCreature also need Creature (except ScriptedCreature itself doesn't need Creature)
+#include "Creature.h" // convenience include for scripts, all uses of ScriptedCreature also need Creature (except ScriptedCreature itself doesn't need Creature)
#include "DBCEnums.h"
#include "TaskScheduler.h"
@@ -90,7 +90,7 @@ public:
void DespawnAll();
template <typename T>
- void DespawnIf(T const &predicate)
+ void DespawnIf(T const& predicate)
{
storage_.remove_if(predicate);
}
@@ -364,7 +364,7 @@ class TC_GAME_API BossAI : public ScriptedAI
void _EnterCombat();
void _JustDied();
void _JustReachedHome();
- void _DespawnAtEvade(Seconds delayToRespawn, Creature* who = nullptr);
+ void _DespawnAtEvade(Seconds delayToRespawn, Creature* who = nullptr);
void _DespawnAtEvade(uint32 delayToRespawn = 30, Creature* who = nullptr) { _DespawnAtEvade(Seconds(delayToRespawn), who); }
void TeleportCheaters();
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index b8b9fb065d4..79919e46397 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -109,11 +109,9 @@ void EscortAI::JustDied(Unit* /*killer*/)
if (Group* group = player->GetGroup())
{
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
- {
if (Player* member = groupRef->GetSource())
if (member->IsInMap(player))
member->FailQuest(_escortQuest->GetQuestId());
- }
}
else
player->FailQuest(_escortQuest->GetQuestId());
@@ -170,11 +168,9 @@ bool EscortAI::IsPlayerOrGroupInRange()
if (Group* group = player->GetGroup())
{
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
- {
if (Player* member = groupRef->GetSource())
if (me->IsWithinDistInMap(member, GetMaxPlayerDistance()))
return true;
- }
}
else if (me->IsWithinDistInMap(player, GetMaxPlayerDistance()))
return true;
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index 5c6884dc026..30cec2a814d 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -270,7 +270,7 @@ void FollowerAI::MovementInform(uint32 motionType, uint32 pointId)
}
}
-void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Quest* quest)
+void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, Quest const* quest)
{
if (me->GetVictim())
{
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
index 0212d8e61d3..39c5da0e8ae 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
@@ -55,7 +55,7 @@ class TC_GAME_API FollowerAI : public ScriptedAI
void UpdateAI(uint32) override; //the "internal" update, calls UpdateFollowerAI()
virtual void UpdateFollowerAI(uint32); //used when it's needed to add code in update (abilities, scripted events, etc)
- void StartFollow(Player* player, uint32 factionForFollower = 0, const Quest* quest = nullptr);
+ void StartFollow(Player* player, uint32 factionForFollower = 0, Quest const* quest = nullptr);
void SetFollowPaused(bool bPaused); //if special event require follow mode to hold/resume during the follow
void SetFollowComplete(bool bWithEndEvent = false);
@@ -75,7 +75,7 @@ class TC_GAME_API FollowerAI : public ScriptedAI
uint32 m_uiUpdateFollowTimer;
uint32 m_uiFollowState;
- const Quest* m_pQuestForFollow; //normally we have a quest
+ Quest const* m_pQuestForFollow; //normally we have a quest
};
#endif
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index 6a1e18f3fc8..3327a43cf43 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -494,7 +494,7 @@ void SmartAI::MoveInLineOfSight(Unit* who)
CreatureAI::MoveInLineOfSight(who);
}
-bool SmartAI::CanAIAttack(const Unit* /*who*/) const
+bool SmartAI::CanAIAttack(Unit const* /*who*/) const
{
return !(me->HasReactState(REACT_PASSIVE));
}
@@ -635,12 +635,12 @@ void SmartAI::AttackStart(Unit* who)
}
}
-void SmartAI::SpellHit(Unit* unit, const SpellInfo* spellInfo)
+void SmartAI::SpellHit(Unit* unit, SpellInfo const* spellInfo)
{
GetScript()->ProcessEventsFor(SMART_EVENT_SPELLHIT, unit, 0, 0, false, spellInfo);
}
-void SmartAI::SpellHitTarget(Unit* target, const SpellInfo* spellInfo)
+void SmartAI::SpellHitTarget(Unit* target, SpellInfo const* spellInfo)
{
GetScript()->ProcessEventsFor(SMART_EVENT_SPELLHIT_TARGET, target, 0, 0, false, spellInfo);
}
@@ -788,7 +788,7 @@ bool SmartAI::GossipSelect(Player* player, uint32 menuId, uint32 gossipListId)
return _gossipReturn;
}
-bool SmartAI::GossipSelectCode(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/, const char* /*code*/)
+bool SmartAI::GossipSelectCode(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/, char const* /*code*/)
{
return false;
}
@@ -967,7 +967,7 @@ bool SmartGameObjectAI::GossipSelect(Player* player, uint32 sender, uint32 actio
}
// Called when a player selects a gossip with a code in the gameobject's gossip menu.
-bool SmartGameObjectAI::GossipSelectCode(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/, const char* /*code*/)
+bool SmartGameObjectAI::GossipSelectCode(Player* /*player*/, uint32 /*menuId*/, uint32 /*gossipListId*/, char const* /*code*/)
{
return false;
}
@@ -1017,7 +1017,7 @@ void SmartGameObjectAI::EventInform(uint32 eventId)
GetScript()->ProcessEventsFor(SMART_EVENT_GO_EVENT_INFORM, nullptr, eventId);
}
-void SmartGameObjectAI::SpellHit(Unit* unit, const SpellInfo* spellInfo)
+void SmartGameObjectAI::SpellHit(Unit* unit, SpellInfo const* spellInfo)
{
GetScript()->ProcessEventsFor(SMART_EVENT_SPELLHIT, unit, 0, 0, false, spellInfo);
}
diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h
index 357020f80b2..4e9a9f976a6 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.h
+++ b/src/server/game/AI/SmartScripts/SmartAI.h
@@ -102,10 +102,10 @@ class TC_GAME_API SmartAI : public CreatureAI
void MoveInLineOfSight(Unit* who) override;
// Called when hit by a spell
- void SpellHit(Unit* unit, const SpellInfo* spellInfo) override;
+ void SpellHit(Unit* unit, SpellInfo const* spellInfo) override;
// Called when spell hits a target
- void SpellHitTarget(Unit* target, const SpellInfo* spellInfo) override;
+ void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override;
// Called at any Damage from any attacker (before damage apply)
void DamageTaken(Unit* doneBy, uint32& damage) override;
@@ -144,7 +144,7 @@ class TC_GAME_API SmartAI : public CreatureAI
void OnCharmed(bool apply) override;
// Called when victim is in line of sight
- bool CanAIAttack(const Unit* who) const override;
+ bool CanAIAttack(Unit const* who) const override;
// Used in scripts to share variables
void DoAction(int32 param = 0) override;
@@ -176,7 +176,7 @@ class TC_GAME_API SmartAI : public CreatureAI
bool GossipHello(Player* player) override;
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override;
- bool GossipSelectCode(Player* player, uint32 menuId, uint32 gossipListId, const char* code) override;
+ bool GossipSelectCode(Player* player, uint32 menuId, uint32 gossipListId, char const* code) override;
void QuestAccept(Player* player, Quest const* quest) override;
void QuestReward(Player* player, Quest const* quest, uint32 opt) override;
void OnGameEvent(bool start, uint16 eventId) override;
@@ -263,7 +263,7 @@ class TC_GAME_API SmartGameObjectAI : public GameObjectAI
bool GossipHello(Player* player) override;
bool OnReportUse(Player* player) override;
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override;
- bool GossipSelectCode(Player* player, uint32 menuId, uint32 gossipListId, const char* code) override;
+ bool GossipSelectCode(Player* player, uint32 menuId, uint32 gossipListId, char const* code) override;
void QuestAccept(Player* player, Quest const* quest) override;
void QuestReward(Player* player, Quest const* quest, uint32 opt) override;
void Destroyed(Player* player, uint32 eventId) override;
@@ -272,7 +272,7 @@ class TC_GAME_API SmartGameObjectAI : public GameObjectAI
void OnGameEvent(bool start, uint16 eventId) override;
void OnLootStateChanged(uint32 state, Unit* unit) override;
void EventInform(uint32 eventId) override;
- void SpellHit(Unit* unit, const SpellInfo* spellInfo) override;
+ void SpellHit(Unit* unit, SpellInfo const* spellInfo) override;
void SetGossipReturn(bool val) { _gossipReturn = val; }
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index d3388b1916e..ea07eeafcfb 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -172,6 +172,7 @@ void SmartScript::ResetBaseObject()
go = nullptr;
}
}
+
if (!goOrigGUID.IsEmpty())
{
if (GameObject* o = ObjectAccessor::GetGameObject(*lookupRoot, goOrigGUID))
@@ -185,7 +186,7 @@ void SmartScript::ResetBaseObject()
meOrigGUID.Clear();
}
-void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob, std::string const& varString)
+void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint32 var1, bool bvar, SpellInfo const* spell, GameObject* gob, std::string const& varString)
{
for (SmartAIEventList::iterator i = mEvents.begin(); i != mEvents.end(); ++i)
{
@@ -199,7 +200,7 @@ void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint3
}
}
-void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob, std::string const& varString)
+void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, uint32 var1, bool bvar, SpellInfo const* spell, GameObject* gob, std::string const& varString)
{
// calc random
if (e.GetEventType() != SMART_EVENT_LINK && e.event.event_chance < 100 && e.event.event_chance)
@@ -2351,7 +2352,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
}
-void SmartScript::ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, uint32 const& max, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob, std::string const& varString)
+void SmartScript::ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, uint32 const& max, Unit* unit, uint32 var0, uint32 var1, bool bvar, SpellInfo const* spell, GameObject* gob, std::string const& varString)
{
// We may want to execute action rarely and because of this if condition is not fulfilled the action will be rechecked in a long time
if (sConditionMgr->IsObjectMeetingSmartEventConditions(e.entryOrGuid, e.event_id, e.source_type, unit, GetBaseObject()))
@@ -2829,7 +2830,7 @@ void SmartScript::GetWorldObjectsInDist(ObjectVector& targets, float dist) const
Cell::VisitAllObjects(obj, searcher, dist);
}
-void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob, std::string const& varString)
+void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, uint32 var1, bool bvar, SpellInfo const* spell, GameObject* gob, std::string const& varString)
{
if (!e.active && e.GetEventType() != SMART_EVENT_LINK)
return;
diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h
index 64aa2716cc7..cb573d79809 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.h
+++ b/src/server/game/AI/SmartScripts/SmartScript.h
@@ -40,14 +40,14 @@ class TC_GAME_API SmartScript
void GetScript();
void FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEntry const* at, SceneTemplate const* scene);
- void ProcessEventsFor(SMART_EVENT e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr, std::string const& varString = "");
- void ProcessEvent(SmartScriptHolder& e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr, std::string const& varString = "");
+ void ProcessEventsFor(SMART_EVENT e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, SpellInfo const* spell = nullptr, GameObject* gob = nullptr, std::string const& varString = "");
+ void ProcessEvent(SmartScriptHolder& e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, SpellInfo const* spell = nullptr, GameObject* gob = nullptr, std::string const& varString = "");
bool CheckTimer(SmartScriptHolder const& e) const;
static void RecalcTimer(SmartScriptHolder& e, uint32 min, uint32 max);
void UpdateTimer(SmartScriptHolder& e, uint32 const diff);
static void InitTimer(SmartScriptHolder& e);
- void ProcessAction(SmartScriptHolder& e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr, std::string const& varString = "");
- void ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, uint32 const& max, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr, std::string const& varString = "");
+ void ProcessAction(SmartScriptHolder& e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, SpellInfo const* spell = nullptr, GameObject* gob = nullptr, std::string const& varString = "");
+ void ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, uint32 const& max, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, SpellInfo const* spell = nullptr, GameObject* gob = nullptr, std::string const& varString = "");
void GetTargets(ObjectVector& targets, SmartScriptHolder const& e, Unit* invoker = nullptr) const;
void GetWorldObjectsInDist(ObjectVector& objects, float dist) const;
void InstallTemplate(SmartScriptHolder const& e);
@@ -55,7 +55,6 @@ class TC_GAME_API SmartScript
void AddEvent(SMART_EVENT e, uint32 event_flags, uint32 event_param1, uint32 event_param2, uint32 event_param3, uint32 event_param4, uint32 event_param5, SMART_ACTION action, uint32 action_param1, uint32 action_param2, uint32 action_param3, uint32 action_param4, uint32 action_param5, uint32 action_param6, SMARTAI_TARGETS t, uint32 target_param1, uint32 target_param2, uint32 target_param3, uint32 phaseMask = 0);
void SetPathId(uint32 id) { mPathId = id; }
uint32 GetPathId() const { return mPathId; }
-
WorldObject* GetBaseObject() const;
WorldObject* GetBaseObjectOrUnit(Unit* unit);
static bool IsUnit(WorldObject* obj);
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 3f0962a20b8..2e120c1862d 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -16,8 +16,8 @@
*/
#include "SmartScriptMgr.h"
-#include "DB2Stores.h"
#include "CreatureTextMgr.h"
+#include "DB2Stores.h"
#include "DatabaseEnv.h"
#include "GameEventMgr.h"
#include "InstanceScript.h"
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index f358ea81c90..26563797b1c 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -1630,31 +1630,22 @@ class TC_GAME_API SmartAIMgr
bool IsEventValid(SmartScriptHolder& e);
bool IsTargetValid(SmartScriptHolder const& e);
+
bool IsMinMaxValid(SmartScriptHolder const& e, uint32 min, uint32 max);
- /*inline bool IsPercentValid(SmartScriptHolder e, int32 pct)
- {
- if (pct < -100 || pct > 100)
- {
- TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has invalid Percent set (%d), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), pct);
- return false;
- }
- return true;
- }*/
-
- bool NotNULL(SmartScriptHolder const& e, uint32 data);
- bool IsCreatureValid(SmartScriptHolder const& e, uint32 entry);
- bool IsQuestValid(SmartScriptHolder const& e, uint32 entry);
- bool IsGameObjectValid(SmartScriptHolder const& e, uint32 entry);
- bool IsSpellValid(SmartScriptHolder const& e, uint32 entry);
- bool IsItemValid(SmartScriptHolder const& e, uint32 entry);
- bool IsTextEmoteValid(SmartScriptHolder const& e, uint32 entry);
- bool IsEmoteValid(SmartScriptHolder const& e, uint32 entry);
- bool IsAreaTriggerValid(SmartScriptHolder const& e, uint32 entry);
- bool IsSoundValid(SmartScriptHolder const& e, uint32 entry);
- bool IsAnimKitValid(SmartScriptHolder const& e, uint32 entry);
- bool IsSpellVisualKitValid(SmartScriptHolder const& e, uint32 entry);
- bool IsTextValid(SmartScriptHolder const& e, uint32 id);
+ static bool NotNULL(SmartScriptHolder const& e, uint32 data);
+ static bool IsCreatureValid(SmartScriptHolder const& e, uint32 entry);
+ static bool IsQuestValid(SmartScriptHolder const& e, uint32 entry);
+ static bool IsGameObjectValid(SmartScriptHolder const& e, uint32 entry);
+ static bool IsSpellValid(SmartScriptHolder const& e, uint32 entry);
+ static bool IsItemValid(SmartScriptHolder const& e, uint32 entry);
+ static bool IsTextEmoteValid(SmartScriptHolder const& e, uint32 entry);
+ static bool IsEmoteValid(SmartScriptHolder const& e, uint32 entry);
+ static bool IsAreaTriggerValid(SmartScriptHolder const& e, uint32 entry);
+ static bool IsSoundValid(SmartScriptHolder const& e, uint32 entry);
+ static bool IsAnimKitValid(SmartScriptHolder const& e, uint32 entry);
+ static bool IsSpellVisualKitValid(SmartScriptHolder const& e, uint32 entry);
+ static bool IsTextValid(SmartScriptHolder const& e, uint32 id);
// Helpers
void LoadHelperStores();
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.h b/src/server/game/AuctionHouseBot/AuctionHouseBot.h
index 3bf9caef9f8..0ce9c86a427 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBot.h
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.h
@@ -214,8 +214,8 @@ public:
static AuctionBotConfig* instance();
bool Initialize();
- const std::string& GetAHBotIncludes() const { return _AHBotIncludes; }
- const std::string& GetAHBotExcludes() const { return _AHBotExcludes; }
+ std::string const& GetAHBotIncludes() const { return _AHBotIncludes; }
+ std::string const& GetAHBotExcludes() const { return _AHBotExcludes; }
uint32 GetConfig(AuctionBotConfigUInt32Values index) const { return _configUint32Values[index]; }
bool GetConfig(AuctionBotConfigBoolValues index) const { return _configBoolValues[index]; }
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
index bd6425f9dfd..a1dbb211070 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
@@ -317,7 +317,7 @@ void AuctionBotBuyer::BuyAndBidItems(BuyerConfiguration& config)
bidPrice = auction->MinBid;
}
- const BuyerItemInfo* ahInfo = nullptr;
+ BuyerItemInfo const* ahInfo = nullptr;
BuyerItemInfoMap::const_iterator sameItemItr = config.SameItemInfo.find(auction->Bucket->Key.ItemId);
if (sameItemItr != config.SameItemInfo.end())
ahInfo = &sameItemItr->second;
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
index da14231ec3c..194c8f790be 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
@@ -109,7 +109,6 @@ bool AuctionBotSeller::Initialize()
for (uint32 itemId = 0; itemId < sItemStore.GetNumRows(); ++itemId)
{
ItemTemplate const* prototype = sObjectMgr->GetItemTemplate(itemId);
-
if (!prototype)
continue;
diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp
index 4203af63d28..778e8132484 100644
--- a/src/server/game/Battlefield/Battlefield.cpp
+++ b/src/server/game/Battlefield/Battlefield.cpp
@@ -588,7 +588,7 @@ BfGraveyard* Battlefield::GetGraveyardById(uint32 id) const
return nullptr;
}
-WorldSafeLocsEntry const* Battlefield::GetClosestGraveYard(Player* player)
+WorldSafeLocsEntry const* Battlefield::GetClosestGraveyard(Player* player)
{
BfGraveyard* closestGY = nullptr;
float maxdist = -1;
@@ -762,7 +762,7 @@ void BfGraveyard::RelocateDeadPlayers()
player->TeleportTo(closestGrave->Loc);
else
{
- closestGrave = m_Bf->GetClosestGraveYard(player);
+ closestGrave = m_Bf->GetClosestGraveyard(player);
if (closestGrave)
player->TeleportTo(closestGrave->Loc);
}
diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h
index 4beab5bba95..80bb14ab40b 100644
--- a/src/server/game/Battlefield/Battlefield.h
+++ b/src/server/game/Battlefield/Battlefield.h
@@ -300,7 +300,7 @@ class TC_GAME_API 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(ObjectGuid npc_guid, ObjectGuid player_guid);
void RemovePlayerFromResurrectQueue(ObjectGuid player_guid);
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
index 22ff6ef0616..423edd6cf07 100644
--- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
+++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
@@ -45,7 +45,7 @@ struct BfWGCoordGY
};
// 7 in sql, 7 in header
-BfWGCoordGY const WGGraveYard[BATTLEFIELD_WG_GRAVEYARD_MAX] =
+BfWGCoordGY const WGGraveyard[BATTLEFIELD_WG_GRAVEYARD_MAX] =
{
{ { 5104.750f, 2300.940f, 368.579f, 0.733038f }, 1329, BATTLEFIELD_WG_GOSSIPTEXT_GY_NE, TEAM_NEUTRAL },
{ { 5099.120f, 3466.036f, 368.484f, 5.317802f }, 1330, BATTLEFIELD_WG_GOSSIPTEXT_GY_NW, TEAM_NEUTRAL },
@@ -436,7 +436,7 @@ bool BattlefieldWG::SetupBattlefield()
m_saveTimer = 60000;
- // Init GraveYards
+ // Init Graveyards
SetGraveyardNumber(BATTLEFIELD_WG_GRAVEYARD_MAX);
// Load from db
@@ -468,12 +468,12 @@ bool BattlefieldWG::SetupBattlefield()
BfGraveyardWG* graveyard = new BfGraveyardWG(this);
// When between games, the graveyard is controlled by the defending team
- if (WGGraveYard[i].StartControl == TEAM_NEUTRAL)
- graveyard->Initialize(m_DefenderTeam, WGGraveYard[i].GraveyardID);
+ if (WGGraveyard[i].StartControl == TEAM_NEUTRAL)
+ graveyard->Initialize(m_DefenderTeam, WGGraveyard[i].GraveyardID);
else
- graveyard->Initialize(WGGraveYard[i].StartControl, WGGraveYard[i].GraveyardID);
+ graveyard->Initialize(WGGraveyard[i].StartControl, WGGraveyard[i].GraveyardID);
- graveyard->SetTextId(WGGraveYard[i].TextID);
+ graveyard->SetTextId(WGGraveyard[i].TextID);
m_GraveyardList[i] = graveyard;
}
diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp
index e544336d4b4..3a087bd1fdd 100644
--- a/src/server/game/Battlegrounds/ArenaTeam.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeam.cpp
@@ -460,7 +460,7 @@ void ArenaTeam::BroadcastPacket(WorldPacket* packet)
{
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
if (Player* player = ObjectAccessor::FindConnectedPlayer(itr->Guid))
- player->GetSession()->SendPacket(packet);
+ player->SendDirectMessage(packet);
}
uint8 ArenaTeam::GetSlotByType(uint32 type)
diff --git a/src/server/game/Battlegrounds/ArenaTeam.h b/src/server/game/Battlegrounds/ArenaTeam.h
index 8cb9c398aa0..0c40635150e 100644
--- a/src/server/game/Battlegrounds/ArenaTeam.h
+++ b/src/server/game/Battlegrounds/ArenaTeam.h
@@ -127,7 +127,7 @@ class TC_GAME_API ArenaTeam
static uint8 GetTypeBySlot(uint8 slot);
ObjectGuid GetCaptain() const { return CaptainGuid; }
std::string const& GetName() const { return TeamName; }
- const ArenaTeamStats& GetStats() const { return Stats; }
+ ArenaTeamStats const& GetStats() const { return Stats; }
uint32 GetRating() const { return Stats.Rating; }
uint32 GetAverageMMR(Group* group) const;
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 5ae3f387853..1efed636f87 100644
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -153,7 +153,7 @@ void Battleground::Update(uint32 diff)
// [[ but if you use battleground object again (more battles possible to be played on 1 instance)
// then this condition should be removed and code:
// if (!GetInvitedCount(HORDE) && !GetInvitedCount(ALLIANCE))
- // this->AddToFreeBGObjectsQueue(); // not yet implemented
+ // AddToFreeBGObjectsQueue(); // not yet implemented
// should be used instead of current
// ]]
// Battleground Template instance cannot be updated, because it would be deleted
@@ -1365,7 +1365,7 @@ void Battleground::RelocateDeadPlayers(ObjectGuid guideGuid)
continue;
if (!closestGrave)
- closestGrave = GetClosestGraveYard(player);
+ closestGrave = GetClosestGraveyard(player);
if (closestGrave)
player->TeleportTo(closestGrave->Loc);
@@ -1825,9 +1825,9 @@ void Battleground::SetBgRaid(uint32 TeamID, Group* bg_raid)
old_raid = bg_raid;
}
-WorldSafeLocsEntry const* Battleground::GetClosestGraveYard(Player* player)
+WorldSafeLocsEntry const* Battleground::GetClosestGraveyard(Player* player)
{
- return sObjectMgr->GetClosestGraveYard(*player, player->GetTeam(), player);
+ return sObjectMgr->GetClosestGraveyard(*player, player->GetTeam(), player);
}
void Battleground::StartCriteriaTimer(CriteriaTimedTypes type, uint32 entry)
diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h
index 7dface61839..43b798a734d 100644
--- a/src/server/game/Battlegrounds/Battleground.h
+++ b/src/server/game/Battlegrounds/Battleground.h
@@ -444,7 +444,7 @@ class TC_GAME_API Battleground
virtual void HandlePlayerResurrect(Player* /*player*/) { }
// Death related
- virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
+ virtual WorldSafeLocsEntry const* GetClosestGraveyard(Player* player);
virtual WorldSafeLocsEntry const* GetExploitTeleportLocation(Team /*team*/) { return nullptr; }
// GetExploitTeleportLocation(TeamId) must be implemented in the battleground subclass.
@@ -507,10 +507,10 @@ class TC_GAME_API Battleground
void EndNow();
void PlayerAddedToBGCheckIfBGIsRunning(Player* player);
- Player* _GetPlayer(ObjectGuid guid, bool offlineRemove, const char* context) const;
- Player* _GetPlayer(BattlegroundPlayerMap::iterator itr, const char* context) { return _GetPlayer(itr->first, itr->second.OfflineRemoveTime != 0, context); }
- Player* _GetPlayer(BattlegroundPlayerMap::const_iterator itr, const char* context) const { return _GetPlayer(itr->first, itr->second.OfflineRemoveTime != 0, context); }
- Player* _GetPlayerForTeam(uint32 teamId, BattlegroundPlayerMap::const_iterator itr, const char* context) const;
+ Player* _GetPlayer(ObjectGuid guid, bool offlineRemove, char const* context) const;
+ Player* _GetPlayer(BattlegroundPlayerMap::iterator itr, char const* context) { return _GetPlayer(itr->first, itr->second.OfflineRemoveTime != 0, context); }
+ Player* _GetPlayer(BattlegroundPlayerMap::const_iterator itr, char const* context) const { return _GetPlayer(itr->first, itr->second.OfflineRemoveTime != 0, context); }
+ Player* _GetPlayerForTeam(uint32 teamId, BattlegroundPlayerMap::const_iterator itr, char const* context) const;
/* Pre- and post-update hooks */
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
index 6b264536549..6d110933b53 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
@@ -631,7 +631,7 @@ void BattlegroundAB::EndBattleground(uint32 winner)
Battleground::EndBattleground(winner);
}
-WorldSafeLocsEntry const* BattlegroundAB::GetClosestGraveYard(Player* player)
+WorldSafeLocsEntry const* BattlegroundAB::GetClosestGraveyard(Player* player)
{
TeamId teamIndex = GetTeamIndexByTeamId(player->GetTeam());
@@ -651,7 +651,7 @@ WorldSafeLocsEntry const* BattlegroundAB::GetClosestGraveYard(Player* player)
float mindist = 999999.0f;
for (uint8 i = 0; i < nodes.size(); ++i)
{
- WorldSafeLocsEntry const*entry = sObjectMgr->GetWorldSafeLoc(BG_AB_GraveyardIds[nodes[i]]);
+ WorldSafeLocsEntry const* entry = sObjectMgr->GetWorldSafeLoc(BG_AB_GraveyardIds[nodes[i]]);
if (!entry)
continue;
float dist = (entry->Loc.GetPositionX() - plr_x) * (entry->Loc.GetPositionX() - plr_x) + (entry->Loc.GetPositionY() - plr_y) * (entry->Loc.GetPositionY() - plr_y);
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h
index c95d33ee82e..830d817b28b 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h
@@ -322,7 +322,7 @@ class BattlegroundAB : public Battleground
bool SetupBattleground() override;
void Reset() override;
void EndBattleground(uint32 winner) override;
- WorldSafeLocsEntry const* GetClosestGraveYard(Player* player) override;
+ WorldSafeLocsEntry const* GetClosestGraveyard(Player* player) override;
WorldSafeLocsEntry const* GetExploitTeleportLocation(Team team) override;
/* Scorekeeping */
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
index 7d4798c88df..f3684e7c037 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
@@ -395,7 +395,7 @@ void BattlegroundAV::PostUpdateImpl(uint32 diff)
}
}
if (m_Mine_Timer <= 0)
- m_Mine_Timer=AV_MINE_TICK_TIMER; //this is at the end, cause we need to update both mines
+ m_Mine_Timer = AV_MINE_TICK_TIMER; //this is at the end, cause we need to update both mines
//looks for all timers of the nodes and destroy the building (for graveyards the building wont get destroyed, it goes just to the other team
for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
@@ -1099,7 +1099,7 @@ void BattlegroundAV::SendMineWorldStates(uint32 mine)
UpdateWorldState(BG_AV_MineWorldStates[mine2][prevowner], 0);
}
-WorldSafeLocsEntry const* BattlegroundAV::GetClosestGraveYard(Player* player)
+WorldSafeLocsEntry const* BattlegroundAV::GetClosestGraveyard(Player* player)
{
WorldSafeLocsEntry const* pGraveyard = nullptr;
WorldSafeLocsEntry const* entry = nullptr;
@@ -1498,7 +1498,7 @@ void BattlegroundAV::ResetBGSubclass()
InitNode(i, HORDE, true);
InitNode(BG_AV_NODES_SNOWFALL_GRAVE, AV_NEUTRAL_TEAM, false); //give snowfall neutral owner
- m_Mine_Timer=AV_MINE_TICK_TIMER;
+ m_Mine_Timer = AV_MINE_TICK_TIMER;
for (uint16 i = 0; i < AV_CPLACE_MAX+AV_STATICCPLACE_MAX; i++)
if (!BgCreatures[i].IsEmpty())
DelCreature(i);
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
index afcab05675d..6a145dc0f38 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
@@ -1650,7 +1650,7 @@ class BattlegroundAV : public Battleground
void EndBattleground(uint32 winner) override;
- WorldSafeLocsEntry const* GetClosestGraveYard(Player* player) override;
+ WorldSafeLocsEntry const* GetClosestGraveyard(Player* player) override;
WorldSafeLocsEntry const* GetExploitTeleportLocation(Team team) override;
// Achievement: Av perfection and Everything counts
@@ -1687,7 +1687,7 @@ class BattlegroundAV : public Battleground
bool IsTower(BG_AV_Nodes node) { return m_Nodes[node].Tower; }
/*mine*/
- void ChangeMineOwner(uint8 mine, uint32 team, bool initial=false);
+ void ChangeMineOwner(uint8 mine, uint32 team, bool initial = false);
/*worldstates*/
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override;
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h
index d151548f21d..a54c54aad98 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h
@@ -109,4 +109,5 @@ class BattlegroundDS : public Arena
uint32 _pipeKnockBackTimer;
uint8 _pipeKnockBackCount;
};
+
#endif
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
index d782fb22c8c..e93c0b952bb 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
@@ -109,10 +109,10 @@ void BattlegroundEY::PostUpdateImpl(uint32 diff)
/*I used this order of calls, because although we will check if one player is in gameobject's distance 2 times
but we can count of players on current point in CheckSomeoneLeftPoint
*/
- this->CheckSomeoneJoinedPoint();
+ CheckSomeoneJoinedPoint();
//check if player left point
- this->CheckSomeoneLeftPoint();
- this->UpdatePointStatuses();
+ CheckSomeoneLeftPoint();
+ UpdatePointStatuses();
m_TowerCapCheckTimer = BG_EY_FPOINTS_TICK_TIME;
}
}
@@ -791,10 +791,10 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* player, uint32 Point)
if (!BgCreatures[Point].IsEmpty())
DelCreature(Point);
- WorldSafeLocsEntry const* sg = sObjectMgr->GetWorldSafeLoc(m_CapturingPointTypes[Point].GraveYardId);
+ WorldSafeLocsEntry const* sg = sObjectMgr->GetWorldSafeLoc(m_CapturingPointTypes[Point].GraveyardId);
if (!sg || !AddSpiritGuide(Point, sg->Loc.GetPositionX(), sg->Loc.GetPositionY(), sg->Loc.GetPositionZ(), 3.124139f, GetTeamIndexByTeamId(Team)))
TC_LOG_ERROR("bg.battleground", "BatteGroundEY: Failed to spawn spirit guide. point: %u, team: %u, graveyard_id: %u",
- Point, Team, m_CapturingPointTypes[Point].GraveYardId);
+ Point, Team, m_CapturingPointTypes[Point].GraveyardId);
// SpawnBGCreature(Point, RESPAWN_IMMEDIATELY);
@@ -916,7 +916,7 @@ void BattlegroundEY::FillInitialWorldStates(WorldPackets::WorldState::InitWorldS
}
}
-WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveYard(Player* player)
+WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveyard(Player* player)
{
uint32 g_id = 0;
@@ -953,9 +953,9 @@ WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveYard(Player* player)
{
if (m_PointOwnedByTeam[i] == player->GetTeam() && m_PointState[i] == EY_POINT_UNDER_CONTROL)
{
- entry = sObjectMgr->GetWorldSafeLoc(m_CapturingPointTypes[i].GraveYardId);
+ entry = sObjectMgr->GetWorldSafeLoc(m_CapturingPointTypes[i].GraveyardId);
if (!entry)
- TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Graveyard %u could not be found.", m_CapturingPointTypes[i].GraveYardId);
+ TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Graveyard %u could not be found.", m_CapturingPointTypes[i].GraveyardId);
else
{
distance = (entry->Loc.GetPositionX() - plr_x) * (entry->Loc.GetPositionX() - plr_x)
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h
index 37e3aed3837..71a3df30dc0 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h
@@ -329,11 +329,11 @@ struct BattlegroundEYLosingPointStruct
struct BattlegroundEYCapturingPointStruct
{
- BattlegroundEYCapturingPointStruct(uint32 _DespawnNeutralObjectType, uint32 _SpawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _SpawnObjectTypeHorde, uint32 _MessageIdHorde, uint32 _GraveYardId)
+ BattlegroundEYCapturingPointStruct(uint32 _DespawnNeutralObjectType, uint32 _SpawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _SpawnObjectTypeHorde, uint32 _MessageIdHorde, uint32 _GraveyardId)
: DespawnNeutralObjectType(_DespawnNeutralObjectType),
SpawnObjectTypeAlliance(_SpawnObjectTypeAlliance), MessageIdAlliance(_MessageIdAlliance),
SpawnObjectTypeHorde(_SpawnObjectTypeHorde), MessageIdHorde(_MessageIdHorde),
- GraveYardId(_GraveYardId)
+ GraveyardId(_GraveyardId)
{ }
uint32 DespawnNeutralObjectType;
@@ -341,7 +341,7 @@ struct BattlegroundEYCapturingPointStruct
uint32 MessageIdAlliance;
uint32 SpawnObjectTypeHorde;
uint32 MessageIdHorde;
- uint32 GraveYardId;
+ uint32 GraveyardId;
};
const uint8 BG_EY_TickPoints[EY_POINTS_MAX] = {1, 2, 5, 10};
@@ -424,7 +424,7 @@ class BattlegroundEY : public Battleground
void RemovePlayer(Player* player, ObjectGuid guid, uint32 team) override;
void HandleAreaTrigger(Player* source, uint32 trigger, bool entered) override;
void HandleKillPlayer(Player* player, Player* killer) override;
- WorldSafeLocsEntry const* GetClosestGraveYard(Player* player) override;
+ WorldSafeLocsEntry const* GetClosestGraveyard(Player* player) override;
WorldSafeLocsEntry const* GetExploitTeleportLocation(Team team) override;
bool SetupBattleground() override;
void Reset() override;
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
index 15b64ffb1d5..925419f9be0 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
@@ -856,7 +856,7 @@ void BattlegroundIC::DestroyGate(Player* player, GameObject* go)
SendBroadcastText(textId, msgType);
}
-WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveYard(Player* player)
+WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveyard(Player* player)
{
TeamId teamIndex = GetTeamIndexByTeamId(player->GetTeam());
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h
index 05b37f9c246..704f19f8781 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h
@@ -973,7 +973,7 @@ class BattlegroundIC : public Battleground
void DestroyGate(Player* player, GameObject* go) override;
- WorldSafeLocsEntry const* GetClosestGraveYard(Player* player) override;
+ WorldSafeLocsEntry const* GetClosestGraveyard(Player* player) override;
WorldSafeLocsEntry const* GetExploitTeleportLocation(Team team) override;
/* Scorekeeping */
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
index 48366a84af7..d9d3af56f21 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
@@ -687,7 +687,7 @@ void BattlegroundSA::DestroyGate(Player* /*player*/, GameObject* /*go*/)
{
}
-WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveYard(Player* player)
+WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveyard(Player* player)
{
uint32 safeloc = 0;
WorldSafeLocsEntry const* ret;
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h
index 3a4b157305f..475239dc459 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h
@@ -588,7 +588,7 @@ class BattlegroundSA : public Battleground
/// Called when a player kill a unit in bg
void HandleKillUnit(Creature* creature, Player* killer) override;
/// Return the nearest graveyard where player can respawn
- WorldSafeLocsEntry const* GetClosestGraveYard(Player* player) override;
+ WorldSafeLocsEntry const* GetClosestGraveyard(Player* player) override;
/// Called when someone activates an event
void ProcessEvent(WorldObject* /*obj*/, uint32 /*eventId*/, WorldObject* /*invoker*/ = nullptr) override;
/// Called when a player click on flag (graveyard flag)
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
index 30298d78a0d..483e7ab1706 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
@@ -814,7 +814,7 @@ bool BattlegroundWS::UpdatePlayerScore(Player* player, uint32 type, uint32 value
return true;
}
-WorldSafeLocsEntry const* BattlegroundWS::GetClosestGraveYard(Player* player)
+WorldSafeLocsEntry const* BattlegroundWS::GetClosestGraveyard(Player* player)
{
//if status in progress, it returns main graveyards with spiritguides
//else it will return the graveyard in the flagroom - this is especially good
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h
index d40f185240d..35e9a18f0e0 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h
@@ -245,7 +245,7 @@ class BattlegroundWS : public Battleground
bool SetupBattleground() override;
void Reset() override;
void EndBattleground(uint32 winner) override;
- WorldSafeLocsEntry const* GetClosestGraveYard(Player* player) override;
+ WorldSafeLocsEntry const* GetClosestGraveyard(Player* player) override;
WorldSafeLocsEntry const* GetExploitTeleportLocation(Team team) override;
void UpdateFlagState(uint32 team, uint32 value);
diff --git a/src/server/game/Chat/Channels/Channel.h b/src/server/game/Chat/Channels/Channel.h
index cbf56637285..4c3f074588e 100644
--- a/src/server/game/Chat/Channels/Channel.h
+++ b/src/server/game/Chat/Channels/Channel.h
@@ -24,6 +24,7 @@
#include <unordered_set>
class Player;
+struct AreaTableEntry;
namespace WorldPackets
{
@@ -33,8 +34,6 @@ namespace WorldPackets
}
}
-struct AreaTableEntry;
-
enum ChatNotify
{
CHAT_JOINED_NOTICE = 0x00, //+ "%s joined channel.";
diff --git a/src/server/game/Chat/Channels/ChannelAppenders.h b/src/server/game/Chat/Channels/ChannelAppenders.h
index 67666a8c727..eb7b9d70c4c 100644
--- a/src/server/game/Chat/Channels/ChannelAppenders.h
+++ b/src/server/game/Chat/Channels/ChannelAppenders.h
@@ -185,8 +185,8 @@ struct ChannelOwnerAppend
{
explicit ChannelOwnerAppend(Channel const* channel, ObjectGuid const& ownerGuid) : _channel(channel), _ownerGuid(ownerGuid)
{
- if (CharacterCacheEntry const* characterInfo = sCharacterCache->GetCharacterCacheByGuid(_ownerGuid))
- _ownerName = characterInfo->Name;
+ if (CharacterCacheEntry const* cInfo = sCharacterCache->GetCharacterCacheByGuid(_ownerGuid))
+ _ownerName = cInfo->Name;
}
static uint8 const NotificationType = CHAT_CHANNEL_OWNER_NOTICE;
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 1e411d9d56c..03c75df9348 100644
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -43,6 +43,7 @@
#include "World.h"
#include "WorldSession.h"
#include <random>
+#include <sstream>
char const* const ConditionMgr::StaticSourceTypeData[CONDITION_SOURCE_TYPE_MAX] =
{
@@ -1125,7 +1126,7 @@ void ConditionMgr::LoadConditions(bool isReload)
}
cond->ReferenceId = uint32(abs(iConditionTypeOrReference));
- const char* rowType = "reference template";
+ char const* rowType = "reference template";
if (iSourceTypeOrReferenceId >= 0)
rowType = "reference";
//check for useless data
diff --git a/src/server/game/DataStores/M2Stores.cpp b/src/server/game/DataStores/M2Stores.cpp
index a14f9ae8121..c5eb43fdf24 100644
--- a/src/server/game/DataStores/M2Stores.cpp
+++ b/src/server/game/DataStores/M2Stores.cpp
@@ -262,6 +262,7 @@ TC_GAME_API void LoadM2Cameras(std::string const& dataPath)
if (!readCamera(cam, fileSize - m2start, header, cameraEntry))
TC_LOG_ERROR("server.loading", "Camera file %s is damaged. Camera references position beyond file end", filename.string().c_str());
}
+
TC_LOG_INFO("server.loading", ">> Loaded " SZFMTD " cinematic waypoint sets in %u ms", sFlyByCameraStore.size(), GetMSTimeDiffToNow(oldMSTime));
}
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index b224af5f9c7..08320def248 100644
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -43,17 +43,17 @@
namespace lfg
{
-LFGDungeonData::LFGDungeonData() : id(0), name(""), map(0), type(0), expansion(0), group(0), minlevel(0),
-maxlevel(0), difficulty(DIFFICULTY_NONE), seasonal(false), x(0.0f), y(0.0f), z(0.0f), o(0.0f),
-requiredItemLevel(0)
+LFGDungeonData::LFGDungeonData() : id(0), name(), map(0), type(0), expansion(0), group(0), minlevel(0),
+ maxlevel(0), difficulty(DIFFICULTY_NONE), seasonal(false), x(0.0f), y(0.0f), z(0.0f), o(0.0f),
+ requiredItemLevel(0)
{
}
LFGDungeonData::LFGDungeonData(LFGDungeonsEntry const* dbc) : id(dbc->ID), name(dbc->Name[sWorld->GetDefaultDbcLocale()]), map(dbc->MapID),
-type(uint8(dbc->TypeID)), expansion(uint8(dbc->ExpansionLevel)), group(uint8(dbc->GroupID)),
-minlevel(uint8(dbc->MinLevel)), maxlevel(uint8(dbc->MaxLevel)), difficulty(Difficulty(dbc->DifficultyID)),
-seasonal((dbc->Flags[0] & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f),
-requiredItemLevel(0)
+ type(uint8(dbc->TypeID)), expansion(uint8(dbc->ExpansionLevel)), group(uint8(dbc->GroupID)),
+ minlevel(uint8(dbc->MinLevel)), maxlevel(uint8(dbc->MaxLevel)), difficulty(Difficulty(dbc->DifficultyID)),
+ seasonal((dbc->Flags[0] & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f),
+ requiredItemLevel(0)
{
}
@@ -1417,7 +1417,7 @@ void LFGMgr::FinishDungeon(ObjectGuid gguid, const uint32 dungeonId, Map const*
}
uint32 rDungeonId = 0;
- const LfgDungeonSet& dungeons = GetSelectedDungeons(guid);
+ LfgDungeonSet const& dungeons = GetSelectedDungeons(guid);
if (!dungeons.empty())
rDungeonId = (*dungeons.begin());
diff --git a/src/server/game/DungeonFinding/LFGPlayerData.h b/src/server/game/DungeonFinding/LFGPlayerData.h
index ba351ed738f..5c8ad907dfe 100644
--- a/src/server/game/DungeonFinding/LFGPlayerData.h
+++ b/src/server/game/DungeonFinding/LFGPlayerData.h
@@ -42,7 +42,7 @@ class TC_GAME_API LfgPlayerData
// Queue
void SetRoles(uint8 roles);
- void SetSelectedDungeons(const LfgDungeonSet& dungeons);
+ void SetSelectedDungeons(LfgDungeonSet const& dungeons);
// General
WorldPackets::LFG::RideTicket const& GetTicket() const;
diff --git a/src/server/game/DungeonFinding/LFGQueue.cpp b/src/server/game/DungeonFinding/LFGQueue.cpp
index ac296295104..6e747e6d0b8 100644
--- a/src/server/game/DungeonFinding/LFGQueue.cpp
+++ b/src/server/game/DungeonFinding/LFGQueue.cpp
@@ -503,7 +503,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(GuidList check)
else
{
ObjectGuid gguid = *check.begin();
- const LfgQueueData &queue = QueueDataStore[gguid];
+ LfgQueueData const& queue = QueueDataStore[gguid];
proposalDungeons = queue.dungeons;
proposalRoles = queue.roles;
LFGMgr::CheckGroupRoles(proposalRoles); // assing new roles
@@ -673,7 +673,7 @@ std::string LFGQueue::DumpCompatibleInfo(bool full /* = false */) const
{
o << " (";
bool first = true;
- for (const auto& role : itr->second.roles)
+ for (auto const& role : itr->second.roles)
{
if (!first)
o << "|";
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 22b7fe930ce..95b329a6af7 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -67,6 +67,7 @@ bool VendorItemData::RemoveItem(uint32 item_id, uint8 type)
{
return vendorItem.item == item_id && vendorItem.Type == type;
});
+
bool found = newEnd != m_items.end();
m_items.erase(newEnd, m_items.end());
return found;
@@ -812,7 +813,7 @@ void Creature::Update(uint32 diff)
if (m_combatPulseTime == 0)
{
- Map::PlayerList const &players = GetMap()->GetPlayers();
+ Map::PlayerList const& players = GetMap()->GetPlayers();
if (!players.isEmpty())
for (Map::PlayerList::const_iterator it = players.begin(); it != players.end(); ++it)
{
@@ -2190,7 +2191,7 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn, Seconds const& forceRespawn
void Creature::DespawnOrUnsummon(uint32 msTimeToDespawn /*= 0*/, Seconds const& forceRespawnTimer /*= 0*/)
{
- if (TempSummon* summon = this->ToTempSummon())
+ if (TempSummon* summon = ToTempSummon())
summon->UnSummon(msTimeToDespawn);
else
ForcedDespawn(msTimeToDespawn, forceRespawnTimer);
@@ -2456,7 +2457,7 @@ void Creature::CallForHelp(float radius)
Cell::VisitGridObjects(this, worker, radius);
}
-bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /*= true*/) const
+bool Creature::CanAssistTo(Unit const* u, Unit const* enemy, bool checkfaction /*= true*/) const
{
if (IsInEvadeMode())
return false;
@@ -2730,7 +2731,7 @@ void Creature::SetInCombatWithZone()
return;
}
- Map::PlayerList const &PlList = map->GetPlayers();
+ Map::PlayerList const& PlList = map->GetPlayers();
if (PlList.isEmpty())
return;
@@ -3057,7 +3058,7 @@ float Creature::GetAggroRange(Unit const* target) const
// Determines the aggro range for creatures (usually pets), used mainly for aggressive pet target selection.
// Based on data from wowwiki due to lack of 3.3.5a data
- if (target && this->IsPet())
+ if (target && IsPet())
{
uint32 targetLevel = 0;
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index 5798ea814e0..853039a20e8 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -229,8 +229,8 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
void SetNoCallAssistance(bool val) { m_AlreadyCallAssistance = val; }
void SetNoSearchAssistance(bool val) { m_AlreadySearchedAssistance = val; }
bool HasSearchedAssistance() const { return m_AlreadySearchedAssistance; }
- bool CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction = true) const;
- bool _IsTargetAcceptable(const Unit* target) const;
+ bool CanAssistTo(Unit const* u, Unit const* enemy, bool checkfaction = true) const;
+ bool _IsTargetAcceptable(Unit const* target) const;
MovementGeneratorType GetDefaultMovementType() const { return m_defaultMovementType; }
void SetDefaultMovementType(MovementGeneratorType mgt) { m_defaultMovementType = mgt; }
@@ -281,12 +281,12 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
bool CanNotReachTarget() const { return m_cannotReachTarget; }
void SetHomePosition(float x, float y, float z, float o) { m_homePosition.Relocate(x, y, z, o); }
- void SetHomePosition(const Position &pos) { m_homePosition.Relocate(pos); }
+ void SetHomePosition(Position const& pos) { m_homePosition.Relocate(pos); }
void GetHomePosition(float& x, float& y, float& z, float& ori) const { m_homePosition.GetPosition(x, y, z, ori); }
Position const& GetHomePosition() const { return m_homePosition; }
void SetTransportHomePosition(float x, float y, float z, float o) { m_transportHomePosition.Relocate(x, y, z, o); }
- void SetTransportHomePosition(const Position &pos) { m_transportHomePosition.Relocate(pos); }
+ void SetTransportHomePosition(Position const& pos) { m_transportHomePosition.Relocate(pos); }
void GetTransportHomePosition(float& x, float& y, float& z, float& ori) const { m_transportHomePosition.GetPosition(x, y, z, ori); }
Position const& GetTransportHomePosition() const { return m_transportHomePosition; }
diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp
index c18740b673a..02b02ff27f8 100644
--- a/src/server/game/Entities/Creature/CreatureGroups.cpp
+++ b/src/server/game/Entities/Creature/CreatureGroups.cpp
@@ -217,7 +217,7 @@ void CreatureGroup::FormationReset(bool dismiss)
m_Formed = !dismiss;
}
-void CreatureGroup::LeaderMoveTo(Position destination, uint32 id /*= 0*/, uint32 moveType /*= 0*/, bool orientation /*= false*/)
+void CreatureGroup::LeaderMoveTo(Position const& destination, uint32 id /*= 0*/, uint32 moveType /*= 0*/, bool orientation /*= false*/)
{
//! To do: This should probably get its own movement generator or use WaypointMovementGenerator.
//! If the leader's path is known, member's path can be plotted as well using formation offsets.
diff --git a/src/server/game/Entities/Creature/CreatureGroups.h b/src/server/game/Entities/Creature/CreatureGroups.h
index 75c25d79c48..a5735ca3f88 100644
--- a/src/server/game/Entities/Creature/CreatureGroups.h
+++ b/src/server/game/Entities/Creature/CreatureGroups.h
@@ -19,7 +19,6 @@
#define _FORMATIONS_H
#include "Define.h"
-#include "Position.h"
#include "ObjectGuid.h"
#include <unordered_map>
#include <map>
@@ -36,6 +35,7 @@ enum GroupAIFlags
class Creature;
class CreatureGroup;
class Unit;
+struct Position;
struct FormationInfo
{
@@ -89,7 +89,7 @@ class TC_GAME_API CreatureGroup
void RemoveMember(Creature* member);
void FormationReset(bool dismiss);
- void LeaderMoveTo(Position destination, uint32 id = 0, uint32 moveType = 0, bool orientation = false);
+ void LeaderMoveTo(Position const& destination, uint32 id = 0, uint32 moveType = 0, bool orientation = false);
void MemberEngagingTarget(Creature* member, Unit* target);
bool CanLeaderStartMoving() const;
};
diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h
index c91af442cef..b2837e951cd 100644
--- a/src/server/game/Entities/Creature/TemporarySummon.h
+++ b/src/server/game/Entities/Creature/TemporarySummon.h
@@ -62,7 +62,7 @@ class TC_GAME_API TempSummon : public Creature
void SetVisibleBySummonerOnly(bool visibleBySummonerOnly) { m_visibleBySummonerOnly = visibleBySummonerOnly; }
bool IsVisibleBySummonerOnly() const { return m_visibleBySummonerOnly; }
- const SummonPropertiesEntry* const m_Properties;
+ SummonPropertiesEntry const* const m_Properties;
private:
TempSummonType m_type;
uint32 m_timer;
diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.h b/src/server/game/Entities/DynamicObject/DynamicObject.h
index 4786dd763f3..b9ee877d95d 100644
--- a/src/server/game/Entities/DynamicObject/DynamicObject.h
+++ b/src/server/game/Entities/DynamicObject/DynamicObject.h
@@ -63,7 +63,7 @@ class TC_GAME_API DynamicObject : public WorldObject, public GridObject<DynamicO
Unit* GetCaster() const { return _caster; }
void BindToCaster();
void UnbindFromCaster();
- uint32 GetSpellId() const { return m_dynamicObjectData->SpellID; }
+ uint32 GetSpellId() const { return m_dynamicObjectData->SpellID; }
SpellInfo const* GetSpellInfo() const;
ObjectGuid GetCasterGUID() const { return m_dynamicObjectData->Caster; }
float GetRadius() const { return m_dynamicObjectData->Radius; }
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 3fc26262ede..97c017ca13b 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -27,6 +27,7 @@
#include "GameObjectModel.h"
#include "GameObjectPackets.h"
#include "GameTime.h"
+#include "GossipDef.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
#include "GroupMgr.h"
@@ -43,7 +44,6 @@
#include "ScriptMgr.h"
#include "SpellMgr.h"
#include "Transport.h"
-#include "GossipDef.h"
#include "World.h"
#include <G3D/Quat.h>
#include <sstream>
@@ -97,7 +97,7 @@ WorldPacket GameObjectTemplate::BuildQueryData(LocaleConstant loc) const
bool QuaternionData::isUnit() const
{
- return fabs(x * x + y * y + z * z + w * w - 1.0f) < 1e-5;
+ return fabs(x * x + y * y + z * z + w * w - 1.0f) < 1e-5f;
}
QuaternionData QuaternionData::fromEulerAnglesZYX(float Z, float Y, float X)
@@ -1018,8 +1018,7 @@ void GameObject::SaveToDB()
void GameObject::SaveToDB(uint32 mapid, std::vector<Difficulty> const& spawnDifficulties)
{
- const GameObjectTemplate* goI = GetGOInfo();
-
+ GameObjectTemplate const* goI = GetGOInfo();
if (!goI)
return;
@@ -1427,7 +1426,7 @@ void GameObject::SetGoArtKit(uint8 kit)
void GameObject::SetGoArtKit(uint8 artkit, GameObject* go, ObjectGuid::LowType lowguid)
{
- const GameObjectData* data = nullptr;
+ GameObjectData const* data = nullptr;
if (go)
{
go->SetGoArtKit(artkit);
diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp
index fa317105ce4..2b9628034f5 100644
--- a/src/server/game/Entities/Item/Container/Bag.cpp
+++ b/src/server/game/Entities/Item/Container/Bag.cpp
@@ -161,7 +161,7 @@ void Bag::StoreItem(uint8 slot, Item* pItem, bool /*update*/)
{
ASSERT(slot < MAX_BAG_SIZE);
- if (pItem && pItem->GetGUID() != this->GetGUID())
+ if (pItem && pItem->GetGUID() != GetGUID())
{
m_bagslot[slot] = pItem;
SetSlot(slot, pItem->GetGUID());
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 4ac35bbb68d..038534dba16 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -1139,7 +1139,7 @@ void AddItemToUpdateQueueOf(Item* item, Player* player)
if (player->GetGUID() != item->GetOwnerGUID())
{
- TC_LOG_DEBUG("entities.player.items", "Item::AddToUpdateQueueOf - Owner's guid (%s) and player's guid (%s) don't match!",
+ TC_LOG_DEBUG("entities.player.items", "AddItemToUpdateQueueOf - Owner's guid (%s) and player's guid (%s) don't match!",
item->GetOwnerGUID().ToString().c_str(), player->GetGUID().ToString().c_str());
return;
}
@@ -1160,7 +1160,7 @@ void RemoveItemFromUpdateQueueOf(Item* item, Player* player)
if (player->GetGUID() != item->GetOwnerGUID())
{
- TC_LOG_DEBUG("entities.player.items", "Item::RemoveFromUpdateQueueOf - Owner's guid (%s) and player's guid (%s) don't match!",
+ TC_LOG_DEBUG("entities.player.items", "RemoveItemFromUpdateQueueOf - Owner's guid (%s) and player's guid (%s) don't match!",
item->GetOwnerGUID().ToString().c_str(), player->GetGUID().ToString().c_str());
return;
}
@@ -1223,7 +1223,7 @@ void Item::SetCount(uint32 value)
}
}
-bool Item::HasEnchantRequiredSkill(const Player* player) const
+bool Item::HasEnchantRequiredSkill(Player const* player) const
{
// Check all enchants for required skill
for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot)
diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h
index ddac293b715..9861459f114 100644
--- a/src/server/game/Entities/Item/Item.h
+++ b/src/server/game/Entities/Item/Item.h
@@ -167,6 +167,7 @@ class TC_GAME_API Item : public Object
{
friend void AddItemToUpdateQueueOf(Item* item, Player* player);
friend void RemoveItemFromUpdateQueueOf(Item* item, Player* player);
+
public:
static Item* CreateItem(uint32 itemEntry, uint32 count, ItemContext context, Player const* player = nullptr);
Item* CloneItem(uint32 count, Player const* player = nullptr) const;
@@ -250,7 +251,7 @@ class TC_GAME_API Item : public Object
void SetInTrade(bool b = true) { mb_in_trade = b; }
bool IsInTrade() const { return mb_in_trade; }
- bool HasEnchantRequiredSkill(const Player* player) const;
+ bool HasEnchantRequiredSkill(Player const* player) const;
uint32 GetEnchantRequiredLevel() const;
bool IsFitToSpellRequirements(SpellInfo const* spellInfo) const;
@@ -307,7 +308,6 @@ class TC_GAME_API Item : public Object
// Update States
ItemUpdateState GetState() const { return uState; }
void SetState(ItemUpdateState state, Player* forplayer = nullptr);
- void RemoveFromUpdateQueueOf(Player* player);
bool IsInUpdateQueue() const { return uQueuePos != -1; }
uint16 GetQueuePos() const { return uQueuePos; }
void FSetState(ItemUpdateState state) // forced
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index dd2fb6486f5..53139520892 100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -889,14 +889,14 @@ void WorldObject::setActive(bool on)
if (on)
{
if (GetTypeId() == TYPEID_UNIT)
- map->AddToActive(this->ToCreature());
+ map->AddToActive(ToCreature());
else if (GetTypeId() == TYPEID_DYNAMICOBJECT)
map->AddToActive((DynamicObject*)this);
}
else
{
if (GetTypeId() == TYPEID_UNIT)
- map->RemoveFromActive(this->ToCreature());
+ map->RemoveFromActive(ToCreature());
else if (GetTypeId() == TYPEID_DYNAMICOBJECT)
map->RemoveFromActive((DynamicObject*)this);
}
@@ -973,7 +973,7 @@ InstanceScript* WorldObject::GetInstanceScript() const
return map->IsDungeon() ? ((InstanceMap*)map)->GetInstanceScript() : nullptr;
}
-float WorldObject::GetDistanceZ(const WorldObject* obj) const
+float WorldObject::GetDistanceZ(WorldObject const* obj) const
{
float dz = std::fabs(GetPositionZ() - obj->GetPositionZ());
float sizefactor = GetCombatReach() + obj->GetCombatReach();
@@ -1003,13 +1003,13 @@ bool WorldObject::_IsWithinDist(WorldObject const* obj, float dist2compare, bool
return thisOrTransport->IsInDist2d(objOrObjTransport, maxdist);
}
-float WorldObject::GetDistance(const WorldObject* obj) const
+float WorldObject::GetDistance(WorldObject const* obj) const
{
float d = GetExactDist(obj) - GetCombatReach() - obj->GetCombatReach();
return d > 0.0f ? d : 0.0f;
}
-float WorldObject::GetDistance(const Position &pos) const
+float WorldObject::GetDistance(Position const& pos) const
{
float d = GetExactDist(&pos) - GetCombatReach();
return d > 0.0f ? d : 0.0f;
@@ -1021,7 +1021,7 @@ float WorldObject::GetDistance(float x, float y, float z) const
return d > 0.0f ? d : 0.0f;
}
-float WorldObject::GetDistance2d(const WorldObject* obj) const
+float WorldObject::GetDistance2d(WorldObject const* obj) const
{
float d = GetExactDist2d(obj) - GetCombatReach() - obj->GetCombatReach();
return d > 0.0f ? d : 0.0f;
@@ -1033,14 +1033,14 @@ float WorldObject::GetDistance2d(float x, float y) const
return d > 0.0f ? d : 0.0f;
}
-bool WorldObject::IsSelfOrInSameMap(const WorldObject* obj) const
+bool WorldObject::IsSelfOrInSameMap(WorldObject const* obj) const
{
if (this == obj)
return true;
return IsInMap(obj);
}
-bool WorldObject::IsInMap(const WorldObject* obj) const
+bool WorldObject::IsInMap(WorldObject const* obj) const
{
if (obj)
return IsInWorld() && obj->IsInWorld() && (GetMap() == obj->GetMap());
@@ -1052,7 +1052,7 @@ bool WorldObject::IsWithinDist3d(float x, float y, float z, float dist) const
return IsInDist(x, y, z, dist + GetCombatReach());
}
-bool WorldObject::IsWithinDist3d(const Position* pos, float dist) const
+bool WorldObject::IsWithinDist3d(Position const* pos, float dist) const
{
return IsInDist(pos, dist + GetCombatReach());
}
@@ -1062,7 +1062,7 @@ bool WorldObject::IsWithinDist2d(float x, float y, float dist) const
return IsInDist2d(x, y, dist + GetCombatReach());
}
-bool WorldObject::IsWithinDist2d(const Position* pos, float dist) const
+bool WorldObject::IsWithinDist2d(Position const* pos, float dist) const
{
return IsInDist2d(pos, dist + GetCombatReach());
}
@@ -1102,7 +1102,7 @@ bool WorldObject::IsWithinLOS(float ox, float oy, float oz, LineOfSightChecks ch
return true;
}
-bool WorldObject::IsWithinLOSInMap(const WorldObject* obj, LineOfSightChecks checks, VMAP::ModelIgnoreFlags ignoreFlags) const
+bool WorldObject::IsWithinLOSInMap(WorldObject const* obj, LineOfSightChecks checks, VMAP::ModelIgnoreFlags ignoreFlags) const
{
if (!IsInMap(obj))
return false;
@@ -1240,7 +1240,7 @@ bool WorldObject::isInBack(WorldObject const* target, float arc) const
return !HasInArc(2 * float(M_PI) - arc, target);
}
-void WorldObject::GetRandomPoint(const Position &pos, float distance, float &rand_x, float &rand_y, float &rand_z) const
+void WorldObject::GetRandomPoint(Position const& pos, float distance, float& rand_x, float& rand_y, float& rand_z) const
{
if (!distance)
{
@@ -1262,7 +1262,7 @@ void WorldObject::GetRandomPoint(const Position &pos, float distance, float &ran
UpdateGroundPositionZ(rand_x, rand_y, rand_z); // update to LOS height if available
}
-Position WorldObject::GetRandomPoint(const Position &srcPos, float distance) const
+Position WorldObject::GetRandomPoint(Position const& srcPos, float distance) const
{
float x, y, z;
GetRandomPoint(srcPos, distance, x, y, z);
@@ -1370,7 +1370,7 @@ float WorldObject::GetVisibilityRange() const
return GetMap()->GetVisibilityRange();
}
-float WorldObject::GetSightRange(const WorldObject* target) const
+float WorldObject::GetSightRange(WorldObject const* target) const
{
if (ToUnit())
{
@@ -1438,7 +1438,7 @@ bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
}
WorldObject const* viewpoint = this;
- if (Player const* player = this->ToPlayer())
+ if (Player const* player = ToPlayer())
{
viewpoint = player->GetViewpoint();
@@ -1499,7 +1499,7 @@ bool WorldObject::CanNeverSee(WorldObject const* obj) const
bool WorldObject::CanDetect(WorldObject const* obj, bool ignoreStealth, bool checkAlert) const
{
- const WorldObject* seer = this;
+ WorldObject const* seer = this;
// Pets don't have detection, they use the detection of their masters
if (Unit const* thisUnit = ToUnit())
@@ -2058,7 +2058,7 @@ Position WorldObject::GetRandomNearPosition(float radius)
return pos;
}
-void WorldObject::GetContactPoint(const WorldObject* obj, float &x, float &y, float &z, float distance2d /*= CONTACT_DISTANCE*/) const
+void WorldObject::GetContactPoint(WorldObject const* obj, float& x, float& y, float& z, float distance2d /*= CONTACT_DISTANCE*/) const
{
// angle to face `obj` to `this` using distance includes size of `obj`
GetNearPoint(obj, x, y, z, obj->GetCombatReach(), distance2d, GetAngle(obj));
@@ -2306,7 +2306,7 @@ struct WorldObjectChangeAccumulator
if (guid.IsPlayer())
{
- //Caster may be NULL if DynObj is in removelist
+ //Caster may be nullptr if DynObj is in removelist
if (Player* caster = ObjectAccessor::FindPlayer(guid))
if (*caster->m_activePlayerData->FarsightObject == source->GetGUID())
BuildPacket(caster);
diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h
index 9ba475fce44..5fb09b5c64a 100644
--- a/src/server/game/Entities/Object/Object.h
+++ b/src/server/game/Entities/Object/Object.h
@@ -401,8 +401,8 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation
void UpdateGroundPositionZ(float x, float y, float &z) const;
void UpdateAllowedPositionZ(float x, float y, float &z) const;
- void GetRandomPoint(Position const &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const;
- Position GetRandomPoint(Position const &srcPos, float distance) const;
+ void GetRandomPoint(Position const& srcPos, float distance, float& rand_x, float& rand_y, float& rand_z) const;
+ Position GetRandomPoint(Position const& srcPos, float distance) const;
uint32 GetInstanceId() const { return m_InstanceId; }
@@ -433,7 +433,7 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation
std::string GetNameForLocaleIdx(LocaleConstant /*locale*/) const override { return m_name; }
float GetDistance(WorldObject const* obj) const;
- float GetDistance(Position const &pos) const;
+ float GetDistance(Position const& pos) const;
float GetDistance(float x, float y, float z) const;
float GetDistance2d(WorldObject const* obj) const;
float GetDistance2d(float x, float y) const;
diff --git a/src/server/game/Entities/Object/ObjectPosSelector.cpp b/src/server/game/Entities/Object/ObjectPosSelector.cpp
index 1d995cf3732..4bdae2dc636 100644
--- a/src/server/game/Entities/Object/ObjectPosSelector.cpp
+++ b/src/server/game/Entities/Object/ObjectPosSelector.cpp
@@ -41,7 +41,7 @@ ObjectPosSelector::UsedPosList::value_type const* ObjectPosSelector::nextUsedPos
if (itr!=m_UsedPosLists[uptype].end())
++itr;
- if (itr==m_UsedPosLists[uptype].end())
+ if (itr == m_UsedPosLists[uptype].end())
{
if (!m_UsedPosLists[~uptype].empty())
return &*m_UsedPosLists[~uptype].rbegin();
diff --git a/src/server/game/Entities/Object/ObjectPosSelector.h b/src/server/game/Entities/Object/ObjectPosSelector.h
index 9020aa680e8..42bb2dd0794 100644
--- a/src/server/game/Entities/Object/ObjectPosSelector.h
+++ b/src/server/game/Entities/Object/ObjectPosSelector.h
@@ -24,9 +24,9 @@
enum UsedPosType { USED_POS_PLUS, USED_POS_MINUS };
-inline UsedPosType operator ~(UsedPosType uptype)
+inline UsedPosType operator~(UsedPosType uptype)
{
- return uptype==USED_POS_PLUS ? USED_POS_MINUS : USED_POS_PLUS;
+ return uptype == USED_POS_PLUS ? USED_POS_MINUS : USED_POS_PLUS;
}
struct TC_GAME_API ObjectPosSelector
diff --git a/src/server/game/Entities/Object/Position.cpp b/src/server/game/Entities/Object/Position.cpp
index a63a3da76d6..6afdb283c1b 100644
--- a/src/server/game/Entities/Object/Position.cpp
+++ b/src/server/game/Entities/Object/Position.cpp
@@ -23,7 +23,7 @@
#include <G3D/g3dmath.h>
#include <sstream>
-bool Position::operator==(Position const &a) const
+bool Position::operator==(Position const& a) const
{
return (G3D::fuzzyEq(a.m_positionX, m_positionX) &&
G3D::fuzzyEq(a.m_positionY, m_positionY) &&
@@ -31,7 +31,7 @@ bool Position::operator==(Position const &a) const
G3D::fuzzyEq(a.m_orientation, m_orientation));
}
-void Position::RelocateOffset(const Position & offset)
+void Position::RelocateOffset(Position const& offset)
{
m_positionX = GetPositionX() + (offset.GetPositionX() * std::cos(GetOrientation()) + offset.GetPositionY() * std::sin(GetOrientation() + float(M_PI)));
m_positionY = GetPositionY() + (offset.GetPositionY() * std::cos(GetOrientation()) + offset.GetPositionX() * std::sin(GetOrientation()));
@@ -64,7 +64,7 @@ float Position::GetExactDist(Position const* pos) const
return std::sqrt(GetExactDistSq(pos));
}
-void Position::GetPositionOffsetTo(const Position & endPos, Position & retOffset) const
+void Position::GetPositionOffsetTo(Position const& endPos, Position& retOffset) const
{
float dx = endPos.GetPositionX() - GetPositionX();
float dy = endPos.GetPositionY() - GetPositionY();
@@ -120,7 +120,7 @@ void Position::GetSinCos(const float x, const float y, float &vsin, float &vcos)
}
}
-bool Position::IsWithinBox(const Position& center, float xradius, float yradius, float zradius) const
+bool Position::IsWithinBox(Position const& center, float xradius, float yradius, float zradius) const
{
// rotate the WorldObject position instead of rotating the whole cube, that way we can make a simplified
// is-in-cube check and we have to calculate only one point instead of 4
@@ -154,7 +154,7 @@ bool Position::IsWithinDoubleVerticalCylinder(Position const* center, float radi
return IsInDist2d(center, radius) && std::abs(verticalDelta) <= height;
}
-bool Position::HasInArc(float arc, const Position* obj, float border) const
+bool Position::HasInArc(float arc, Position const* obj, float border) const
{
// always have self in arc
if (obj == this)
diff --git a/src/server/game/Entities/Object/Position.h b/src/server/game/Entities/Object/Position.h
index 84342433aa0..9f2218397e9 100644
--- a/src/server/game/Entities/Object/Position.h
+++ b/src/server/game/Entities/Object/Position.h
@@ -35,18 +35,18 @@ struct TC_GAME_API Position
struct XYZO;
struct PackedXYZ;
- template<class Tag>
+ template <class Tag>
struct ConstStreamer
{
explicit ConstStreamer(Position const& pos) : Pos(&pos) { }
Position const* Pos;
};
- template<class Tag>
+ template <class Tag>
struct Streamer
{
explicit Streamer(Position& pos) : Pos(&pos) { }
- operator ConstStreamer<Tag>() { return ConstStreamer<Tag>(*Pos); }
+ operator ConstStreamer<Tag>() const { return ConstStreamer<Tag>(*Pos); }
Position* Pos;
};
@@ -58,9 +58,9 @@ private:
float m_orientation;
public:
- bool operator==(Position const &a) const;
+ bool operator==(Position const& a) const;
- inline bool operator!=(Position const &a) const
+ inline bool operator!=(Position const& a) const
{
return !(operator==(a));
}
@@ -80,7 +80,7 @@ public:
m_positionX = x; m_positionY = y; m_positionZ = z; SetOrientation(orientation);
}
- void Relocate(Position const &pos)
+ void Relocate(Position const& pos)
{
m_positionX = pos.m_positionX; m_positionY = pos.m_positionY; m_positionZ = pos.m_positionZ; SetOrientation(pos.m_orientation);
}
@@ -90,7 +90,7 @@ public:
m_positionX = pos->m_positionX; m_positionY = pos->m_positionY; m_positionZ = pos->m_positionZ; SetOrientation(pos->m_orientation);
}
- void RelocateOffset(Position const &offset);
+ void RelocateOffset(Position const& offset);
void SetOrientation(float orientation)
{
@@ -209,7 +209,7 @@ public:
bool IsInDist(Position const& pos, float dist) const { return GetExactDistSq(pos) < dist * dist; }
bool IsInDist(Position const* pos, float dist) const { return GetExactDistSq(pos) < dist * dist; }
- bool IsWithinBox(const Position& center, float xradius, float yradius, float zradius) const;
+ bool IsWithinBox(Position const& center, float xradius, float yradius, float zradius) const;
/*
search using this relation: dist2d < radius && abs(dz) < height
diff --git a/src/server/game/Entities/Object/Updates/UpdateData.cpp b/src/server/game/Entities/Object/Updates/UpdateData.cpp
index 6ef8253c0d7..e437c28e064 100644
--- a/src/server/game/Entities/Object/Updates/UpdateData.cpp
+++ b/src/server/game/Entities/Object/Updates/UpdateData.cpp
@@ -37,7 +37,7 @@ void UpdateData::AddOutOfRangeGUID(ObjectGuid guid)
m_outOfRangeGUIDs.insert(guid);
}
-void UpdateData::AddUpdateBlock(const ByteBuffer &block)
+void UpdateData::AddUpdateBlock(ByteBuffer const& block)
{
m_data.append(block);
++m_blockCount;
diff --git a/src/server/game/Entities/Object/Updates/UpdateData.h b/src/server/game/Entities/Object/Updates/UpdateData.h
index fdc4bb42d7a..9b185ea14e2 100644
--- a/src/server/game/Entities/Object/Updates/UpdateData.h
+++ b/src/server/game/Entities/Object/Updates/UpdateData.h
@@ -46,7 +46,7 @@ class UpdateData
void AddDestroyObject(ObjectGuid guid);
void AddOutOfRangeGUID(GuidSet& guids);
void AddOutOfRangeGUID(ObjectGuid guid);
- void AddUpdateBlock(const ByteBuffer &block);
+ void AddUpdateBlock(ByteBuffer const& block);
bool BuildPacket(WorldPacket* packet);
bool HasData() const { return m_blockCount > 0 || !m_outOfRangeGUIDs.empty(); }
void Clear();
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index 5c58ab5069f..7b60c7209eb 100644
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -202,7 +202,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
return false;
}
- map->AddToMap(this->ToCreature());
+ map->AddToMap(ToCreature());
return true;
}
@@ -315,7 +315,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
}
owner->SetMinion(this, true);
- map->AddToMap(this->ToCreature());
+ map->AddToMap(ToCreature());
uint32 timediff = uint32(time(nullptr) - fields[13].GetUInt32());
_LoadAuras(timediff);
@@ -1412,7 +1412,7 @@ bool Pet::learnSpell(uint32 spell_id)
{
WorldPackets::Pet::PetLearnedSpells packet;
packet.Spells.push_back(spell_id);
- GetOwner()->GetSession()->SendPacket(packet.Write());
+ GetOwner()->SendDirectMessage(packet.Write());
GetOwner()->PetSpellInitialize();
}
return true;
@@ -1479,7 +1479,7 @@ bool Pet::unlearnSpell(uint32 spell_id, bool learn_prev, bool clear_ab)
{
WorldPackets::Pet::PetUnlearnedSpells packet;
packet.Spells.push_back(spell_id);
- GetOwner()->GetSession()->SendPacket(packet.Write());
+ GetOwner()->SendDirectMessage(packet.Write());
}
return true;
}
diff --git a/src/server/game/Entities/Player/EquipementSet.h b/src/server/game/Entities/Player/EquipmentSet.h
index 937446b35e2..ce9d0952e21 100644
--- a/src/server/game/Entities/Player/EquipementSet.h
+++ b/src/server/game/Entities/Player/EquipmentSet.h
@@ -15,8 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef EquipementSet_h__
-#define EquipementSet_h__
+#ifndef EquipmentSet_h__
+#define EquipmentSet_h__
#include "Define.h"
#include "ObjectGuid.h"
@@ -31,7 +31,7 @@ enum EquipmentSetUpdateState
EQUIPMENT_SET_DELETED = 3
};
-#define EQUIPEMENT_SET_SLOTS 19
+#define EQUIPMENT_SET_SLOTS 19
struct EquipmentSetInfo
{
@@ -51,8 +51,8 @@ struct EquipmentSetInfo
int32 AssignedSpecIndex = -1; ///< Index of character specialization that this set is automatically equipped for
std::string SetName;
std::string SetIcon;
- std::array<ObjectGuid, EQUIPEMENT_SET_SLOTS> Pieces;
- std::array<int32, EQUIPEMENT_SET_SLOTS> Appearances; ///< ItemModifiedAppearanceID
+ std::array<ObjectGuid, EQUIPMENT_SET_SLOTS> Pieces;
+ std::array<int32, EQUIPMENT_SET_SLOTS> Appearances; ///< ItemModifiedAppearanceID
std::array<int32, 2> Enchants; ///< SpellItemEnchantmentID
} Data;
@@ -64,4 +64,4 @@ struct EquipmentSetInfo
typedef std::map<uint64, EquipmentSetInfo> EquipmentSetContainer;
-#endif // EquipementSet_h__
+#endif // EquipmentSet_h__
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 4d967243f15..c9525736629 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -72,8 +72,8 @@
#include "InstanceScript.h"
#include "ItemPackets.h"
#include "KillRewarder.h"
-#include "LFGMgr.h"
#include "Language.h"
+#include "LFGMgr.h"
#include "Log.h"
#include "LootItemStorage.h"
#include "LootMgr.h"
@@ -127,6 +127,7 @@
#include "WorldSession.h"
#include "WorldStatePackets.h"
#include <G3D/g3dmath.h>
+#include <sstream>
#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS)
@@ -362,7 +363,7 @@ Player::Player(WorldSession* session) : Unit(true), m_sceneMgr(this)
Player::~Player()
{
// it must be unloaded already in PlayerLogout and accessed only for logged in player
- //m_social = NULL;
+ //m_social = nullptr;
// Note: buy back item already deleted from DB when player was saved
for (uint8 i = 0; i < PLAYER_SLOTS_COUNT; ++i)
@@ -686,13 +687,13 @@ void Player::SendMirrorTimer(MirrorTimerType Type, uint32 MaxValue, uint32 Curre
return;
}
- GetSession()->SendPacket(WorldPackets::Misc::StartMirrorTimer(Type, CurrentValue, MaxValue, Regen, 0, false).Write());
+ SendDirectMessage(WorldPackets::Misc::StartMirrorTimer(Type, CurrentValue, MaxValue, Regen, 0, false).Write());
}
void Player::StopMirrorTimer(MirrorTimerType Type)
{
m_MirrorTimer[Type] = DISABLED_MIRROR_TIMER;
- GetSession()->SendPacket(WorldPackets::Misc::StopMirrorTimer(Type).Write());
+ SendDirectMessage(WorldPackets::Misc::StopMirrorTimer(Type).Write());
}
bool Player::IsImmuneToEnvironmentalDamage() const
@@ -817,14 +818,14 @@ void Player::HandleDrowning(uint32 time_diff)
}
else // If activated - do tick
{
- m_MirrorTimer[BREATH_TIMER]-=time_diff;
+ m_MirrorTimer[BREATH_TIMER] -= time_diff;
// Timer limit - need deal damage
if (m_MirrorTimer[BREATH_TIMER] < 0)
{
- m_MirrorTimer[BREATH_TIMER]+= 1*IN_MILLISECONDS;
+ m_MirrorTimer[BREATH_TIMER] += 1 * IN_MILLISECONDS;
// Calculate and deal damage
/// @todo Check this formula
- uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel()-1);
+ uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel() - 1);
EnvironmentalDamage(DAMAGE_DROWNING, damage);
}
else if (!(m_MirrorTimerFlagsLast & UNDERWATER_INWATER)) // Update time in client if need
@@ -835,7 +836,7 @@ void Player::HandleDrowning(uint32 time_diff)
{
int32 UnderWaterTime = getMaxTimer(BREATH_TIMER);
// Need breath regen
- m_MirrorTimer[BREATH_TIMER]+=10*time_diff;
+ m_MirrorTimer[BREATH_TIMER] += 10 * time_diff;
if (m_MirrorTimer[BREATH_TIMER] >= UnderWaterTime || !IsAlive())
StopMirrorTimer(BREATH_TIMER);
else if (m_MirrorTimerFlagsLast & UNDERWATER_INWATER)
@@ -853,14 +854,14 @@ void Player::HandleDrowning(uint32 time_diff)
}
else
{
- m_MirrorTimer[FATIGUE_TIMER]-=time_diff;
+ m_MirrorTimer[FATIGUE_TIMER] -= time_diff;
// Timer limit - need deal damage or teleport ghost to graveyard
if (m_MirrorTimer[FATIGUE_TIMER] < 0)
{
- m_MirrorTimer[FATIGUE_TIMER]+= 1*IN_MILLISECONDS;
+ m_MirrorTimer[FATIGUE_TIMER] += 1 * IN_MILLISECONDS;
if (IsAlive()) // Calculate and deal damage
{
- uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel()-1);
+ uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel() - 1);
EnvironmentalDamage(DAMAGE_EXHAUSTED, damage);
}
else if (HasPlayerFlag(PLAYER_FLAGS_GHOST)) // Teleport ghost to graveyard
@@ -873,7 +874,7 @@ void Player::HandleDrowning(uint32 time_diff)
else if (m_MirrorTimer[FATIGUE_TIMER] != DISABLED_MIRROR_TIMER) // Regen timer
{
int32 DarkWaterTime = getMaxTimer(FATIGUE_TIMER);
- m_MirrorTimer[FATIGUE_TIMER]+=10*time_diff;
+ m_MirrorTimer[FATIGUE_TIMER] += 10 * time_diff;
if (m_MirrorTimer[FATIGUE_TIMER] >= DarkWaterTime || !IsAlive())
StopMirrorTimer(FATIGUE_TIMER);
else if (m_MirrorTimerFlagsLast & UNDERWATER_INDARKWATER)
@@ -890,7 +891,7 @@ void Player::HandleDrowning(uint32 time_diff)
m_MirrorTimer[FIRE_TIMER] -= time_diff;
if (m_MirrorTimer[FIRE_TIMER] < 0)
{
- m_MirrorTimer[FIRE_TIMER]+= 1*IN_MILLISECONDS;
+ m_MirrorTimer[FIRE_TIMER] += 1 * IN_MILLISECONDS;
// Calculate and deal damage
/// @todo Check this formula
uint32 damage = urand(600, 700);
@@ -907,13 +908,15 @@ void Player::HandleDrowning(uint32 time_diff)
m_MirrorTimer[FIRE_TIMER] = DISABLED_MIRROR_TIMER;
// Recheck timers flag
- m_MirrorTimerFlags&=~UNDERWATER_EXIST_TIMERS;
- for (uint8 i = 0; i< MAX_TIMERS; ++i)
+ m_MirrorTimerFlags &= ~UNDERWATER_EXIST_TIMERS;
+ for (uint8 i = 0; i < MAX_TIMERS; ++i)
+ {
if (m_MirrorTimer[i] != DISABLED_MIRROR_TIMER)
{
- m_MirrorTimerFlags|=UNDERWATER_EXIST_TIMERS;
+ m_MirrorTimerFlags |= UNDERWATER_EXIST_TIMERS;
break;
}
+ }
m_MirrorTimerFlagsLast = m_MirrorTimerFlags;
}
@@ -1577,7 +1580,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
transferPending.Ship->OriginMapID = GetMapId();
}
- GetSession()->SendPacket(transferPending.Write());
+ SendDirectMessage(transferPending.Write());
}
// remove from old map now
@@ -1608,7 +1611,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
return true;
}
-bool Player::TeleportTo(WorldLocation const &loc, uint32 options /*= 0*/)
+bool Player::TeleportTo(WorldLocation const& loc, uint32 options /*= 0*/)
{
return TeleportTo(loc.GetMapId(), loc.GetPositionX(), loc.GetPositionY(), loc.GetPositionZ(), loc.GetOrientation(), options);
}
@@ -2122,7 +2125,7 @@ void Player::SetInWater(bool apply)
getHostileRefManager().updateThreatTables();
}
-bool Player::IsInAreaTriggerRadius(const AreaTriggerEntry* trigger) const
+bool Player::IsInAreaTriggerRadius(AreaTriggerEntry const* trigger) const
{
if (!trigger)
return false;
@@ -2277,7 +2280,7 @@ void Player::UninviteFromGroup()
}
}
-void Player::RemoveFromGroup(Group* group, ObjectGuid guid, RemoveMethod method /* = GROUP_REMOVEMETHOD_DEFAULT*/, ObjectGuid kicker /* = ObjectGuid::Empty */, const char* reason /* = nullptr */)
+void Player::RemoveFromGroup(Group* group, ObjectGuid guid, RemoveMethod method /* = GROUP_REMOVEMETHOD_DEFAULT*/, ObjectGuid kicker /* = ObjectGuid::Empty */, char const* reason /* = nullptr */)
{
if (!group)
return;
@@ -2336,7 +2339,7 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate)
packet.Amount = xp;
packet.GroupBonus = group_rate;
packet.ReferAFriendBonusType = recruitAFriend ? 1 : 0;
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
uint32 curXP = m_activePlayerData->XP;
uint32 nextLvlXP = m_activePlayerData->NextLevelXP;
@@ -2392,7 +2395,7 @@ void Player::GiveLevel(uint8 level)
packet.NumNewTalents = DB2Manager::GetNumTalentsAtLevel(level, Classes(getClass())) - DB2Manager::GetNumTalentsAtLevel(oldLevel, Classes(getClass()));
packet.NumNewPvpTalentSlots = sDB2Manager.GetPvpTalentNumSlotsAtLevel(level, Classes(getClass())) - sDB2Manager.GetPvpTalentNumSlotsAtLevel(oldLevel, Classes(getClass()));
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
SetUpdateFieldValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::NextLevelXP), sObjectMgr->GetXPForLevel(level));
@@ -2698,7 +2701,7 @@ void Player::SendMailResult(uint32 mailId, MailResponseType mailAction, MailResp
result.AttachID = item_guid;
result.QtyInInventory = item_count;
}
- GetSession()->SendPacket(result.Write());
+ SendDirectMessage(result.Write());
}
void Player::SendNewMail() const
@@ -2707,7 +2710,7 @@ void Player::SendNewMail() const
WorldPackets::Mail::NotifyReceivedMail notify;
notify.Delay = 0.0f;
- GetSession()->SendPacket(notify.Write());
+ SendDirectMessage(notify.Write());
}
void Player::UpdateNextMailTimeAndUnreads()
@@ -3200,7 +3203,7 @@ void Player::LearnSpell(uint32 spell_id, bool dependent, int32 fromSkill /*= 0*/
WorldPackets::Spells::LearnedSpells packet;
packet.SpellID.push_back(spell_id);
packet.SuppressMessaging = suppressMessaging;
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
}
// learn all disabled higher ranks and required spells (recursive)
@@ -3338,7 +3341,7 @@ void Player::RemoveSpell(uint32 spell_id, bool disabled /*= false*/, bool learn_
if (uint32 prev_id = sSpellMgr->GetPrevSpellInChain(spell_id))
{
// if ranked non-stackable spell: need activate lesser rank and update dendence state
- /// No need to check for spellInfo != NULL here because if cur_active is true, then that means that the spell was already in m_spells, and only valid spells can be pushed there.
+ /// No need to check for spellInfo != nullptr here because if cur_active is true, then that means that the spell was already in m_spells, and only valid spells can be pushed there.
if (cur_active && spellInfo->IsRanked())
{
// need manually update dependence state (learn spell ignore like attempts)
@@ -3505,7 +3508,7 @@ bool Player::ResetTalents(bool noCost)
if (Pet* pet = GetPet())
{
if (pet->getPetType() == HUNTER_PET && !pet->GetCreatureTemplate()->IsTameable(CanTameExoticPets()))
- RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
+ RemovePet(nullptr, PET_SAVE_NOT_IN_SLOT, true);
}
*/
@@ -4267,7 +4270,7 @@ void Player::BuildPlayerRepop()
{
WorldPackets::Misc::PreRessurect packet;
packet.PlayerGUID = GetGUID();
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
// If the player has the Wisp racial then cast the Wisp aura on them
if (HasSpell(20585))
@@ -4325,7 +4328,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
{
WorldPackets::Misc::DeathReleaseLoc packet;
packet.MapID = -1;
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
// speed change, land walk
@@ -4753,13 +4756,13 @@ void Player::RepopAtGraveyard()
// Special handle for battleground maps
if (Battleground* bg = GetBattleground())
- ClosestGrave = bg->GetClosestGraveYard(this);
+ ClosestGrave = bg->GetClosestGraveyard(this);
else
{
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId()))
- ClosestGrave = bf->GetClosestGraveYard(this);
+ ClosestGrave = bf->GetClosestGraveyard(this);
else
- ClosestGrave = sObjectMgr->GetClosestGraveYard(*this, GetTeam(), this);
+ ClosestGrave = sObjectMgr->GetClosestGraveyard(*this, GetTeam(), this);
}
// stop countdown until repop
@@ -4775,7 +4778,7 @@ void Player::RepopAtGraveyard()
WorldPackets::Misc::DeathReleaseLoc packet;
packet.MapID = ClosestGrave->Loc.GetMapId();
packet.Loc = ClosestGrave->Loc;
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
}
}
else if (GetPositionZ() < GetMap()->GetMinHeight(GetPhaseShift(), GetPositionX(), GetPositionY()))
@@ -6059,7 +6062,7 @@ bool Player::UpdatePosition(float x, float y, float z, float orientation, bool t
void Player::SendMessageToSetInRange(WorldPacket const* data, float dist, bool self) const
{
if (self)
- GetSession()->SendPacket(data);
+ SendDirectMessage(data);
Trinity::MessageDistDeliverer notifier(this, data, dist);
Cell::VisitWorldObjects(this, notifier, dist);
@@ -6068,7 +6071,7 @@ void Player::SendMessageToSetInRange(WorldPacket const* data, float dist, bool s
void Player::SendMessageToSetInRange(WorldPacket const* data, float dist, bool self, bool own_team_only) const
{
if (self)
- GetSession()->SendPacket(data);
+ SendDirectMessage(data);
Trinity::MessageDistDeliverer notifier(this, data, dist, own_team_only);
Cell::VisitWorldObjects(this, notifier, dist);
@@ -6077,7 +6080,7 @@ void Player::SendMessageToSetInRange(WorldPacket const* data, float dist, bool s
void Player::SendMessageToSet(WorldPacket const* data, Player const* skipped_rcvr) const
{
if (skipped_rcvr != this)
- GetSession()->SendPacket(data);
+ SendDirectMessage(data);
// we use World::GetMaxVisibleDistance() because i cannot see why not use a distance
// update: replaced by GetMap()->GetVisibilityDistance()
@@ -6556,7 +6559,7 @@ bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvpto
data.Target = victim_guid;
data.Rank = victim_rank;
- GetSession()->SendPacket(data.Write());
+ SendDirectMessage(data.Write());
AddHonorXP(honor);
@@ -6763,7 +6766,7 @@ void Player::SendNewCurrency(uint32 id) const
packet.Data.push_back(record);
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
}
void Player::SendCurrencies() const
@@ -6790,7 +6793,7 @@ void Player::SendCurrencies() const
packet.Data.push_back(record);
}
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
}
void Player::SendPvpRewards() const
@@ -6956,7 +6959,7 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo
packet.Flags = itr->second.Flags;
packet.QuantityChange = count;
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
}
}
@@ -7261,7 +7264,7 @@ void Player::CheckDuelDistance(time_t currTime)
{
duel->outOfBound = currTime;
- GetSession()->SendPacket(WorldPackets::Duel::DuelOutOfBounds().Write());
+ SendDirectMessage(WorldPackets::Duel::DuelOutOfBounds().Write());
}
}
else
@@ -7270,7 +7273,7 @@ void Player::CheckDuelDistance(time_t currTime)
{
duel->outOfBound = 0;
- GetSession()->SendPacket(WorldPackets::Duel::DuelInBounds().Write());
+ SendDirectMessage(WorldPackets::Duel::DuelInBounds().Write());
}
else if (currTime >= (duel->outOfBound+10))
DuelComplete(DUEL_FLED);
@@ -7301,10 +7304,10 @@ void Player::DuelComplete(DuelCompleteType type)
WorldPackets::Duel::DuelComplete duelCompleted;
duelCompleted.Started = type != DUEL_INTERRUPTED;
WorldPacket const* duelCompletedPacket = duelCompleted.Write();
- GetSession()->SendPacket(duelCompletedPacket);
+ SendDirectMessage(duelCompletedPacket);
if (duel->opponent->GetSession())
- duel->opponent->GetSession()->SendPacket(duelCompletedPacket);
+ duel->opponent->SendDirectMessage(duelCompletedPacket);
if (type != DUEL_INTERRUPTED)
{
@@ -9015,7 +9018,7 @@ void Player::SendNotifyLootItemRemoved(ObjectGuid lootObj, uint8 lootSlot) const
packet.Owner = GetLootWorldObjectGUID(lootObj);
packet.LootObj = lootObj;
packet.LootListID = lootSlot + 1;
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
}
void Player::SendUpdateWorldState(uint32 variable, uint32 value, bool hidden /*= false*/) const
@@ -9646,7 +9649,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
break;
}
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
SendBGWeekendWorldStates();
SendBattlefieldWorldStates();
}
@@ -9694,7 +9697,7 @@ void Player::SendBattlefieldWorldStates() const
void Player::SetBindPoint(ObjectGuid guid) const
{
WorldPackets::Misc::BinderConfirm packet(guid);
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
}
void Player::SendRespecWipeConfirm(ObjectGuid const& guid, uint32 cost) const
@@ -9703,7 +9706,7 @@ void Player::SendRespecWipeConfirm(ObjectGuid const& guid, uint32 cost) const
respecWipeConfirm.RespecMaster = guid;
respecWipeConfirm.Cost = cost;
respecWipeConfirm.RespecType = SPEC_RESET_TALENTS;
- GetSession()->SendPacket(respecWipeConfirm.Write());
+ SendDirectMessage(respecWipeConfirm.Write());
}
/*********************************************************/
@@ -12316,7 +12319,7 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update)
spellCooldown.Caster = GetGUID();
spellCooldown.Flags = SPELL_COOLDOWN_FLAG_INCLUDE_GCD;
spellCooldown.SpellCooldowns.emplace_back(cooldownSpell, 0);
- GetSession()->SendPacket(spellCooldown.Write());
+ SendDirectMessage(spellCooldown.Write());
}
}
}
@@ -13856,7 +13859,7 @@ void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32
packet.VendorGUID = creature ? creature->GetGUID() : ObjectGuid::Empty;
packet.Muid = item;
packet.Reason = msg;
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
}
void Player::SendSellError(SellResult msg, Creature* creature, ObjectGuid guid) const
@@ -13865,7 +13868,7 @@ void Player::SendSellError(SellResult msg, Creature* creature, ObjectGuid guid)
sellResponse.VendorGUID = (creature ? creature->GetGUID() : ObjectGuid::Empty);
sellResponse.ItemGUID = guid;
sellResponse.Reason = msg;
- GetSession()->SendPacket(sellResponse.Write());
+ SendDirectMessage(sellResponse.Write());
}
bool Player::IsUseEquipedWeapon(bool mainhand) const
@@ -13989,7 +13992,7 @@ void Player::UpdateItemDuration(uint32 time, bool realtimeonly)
void Player::UpdateEnchantTime(uint32 time)
{
- for (EnchantDurationList::iterator itr = m_enchantDuration.begin(), next; itr != m_enchantDuration.end(); itr=next)
+ for (EnchantDurationList::iterator itr = m_enchantDuration.begin(), next; itr != m_enchantDuration.end(); itr = next)
{
ASSERT(itr->item);
next = itr;
@@ -14575,7 +14578,7 @@ void Player::SendNewItem(Item* item, uint32 quantity, bool pushed, bool created,
if (broadcast && GetGroup())
GetGroup()->BroadcastPacket(packet.Write(), true);
else
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
}
/*********************************************************/
@@ -15998,7 +16001,7 @@ bool Player::SatisfyQuestLog(bool msg) const
if (msg)
{
WorldPackets::Quest::QuestLogFull data;
- GetSession()->SendPacket(data.Write());
+ SendDirectMessage(data.Write());
}
return false;
}
@@ -17438,7 +17441,7 @@ void Player::SendQuestComplete(Quest const* quest) const
{
WorldPackets::Quest::QuestUpdateComplete data;
data.QuestID = quest->GetQuestId();
- GetSession()->SendPacket(data.Write());
+ SendDirectMessage(data.Write());
}
}
@@ -17479,7 +17482,7 @@ void Player::SendQuestReward(Quest const* quest, Creature const* questGiver, uin
packet.HideChatMessage = hideChatMessage;
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
}
void Player::SendQuestFailed(uint32 questID, InventoryResult reason) const
@@ -17489,7 +17492,7 @@ void Player::SendQuestFailed(uint32 questID, InventoryResult reason) const
WorldPackets::Quest::QuestGiverQuestFailed questGiverQuestFailed;
questGiverQuestFailed.QuestID = questID;
questGiverQuestFailed.Reason = reason; // failed reason (valid reasons: 4, 16, 50, 17, other values show default message)
- GetSession()->SendPacket(questGiverQuestFailed.Write());
+ SendDirectMessage(questGiverQuestFailed.Write());
}
}
@@ -17499,7 +17502,7 @@ void Player::SendQuestTimerFailed(uint32 questID) const
{
WorldPackets::Quest::QuestUpdateFailedTimer questUpdateFailedTimer;
questUpdateFailedTimer.QuestID = questID;
- GetSession()->SendPacket(questUpdateFailedTimer.Write());
+ SendDirectMessage(questUpdateFailedTimer.Write());
}
}
@@ -17511,7 +17514,7 @@ void Player::SendCanTakeQuestResponse(QuestFailedReason reason, bool sendErrorMe
questGiverInvalidQuest.SendErrorMessage = sendErrorMessage;
questGiverInvalidQuest.ReasonText = reasonText;
- GetSession()->SendPacket(questGiverInvalidQuest.Write());
+ SendDirectMessage(questGiverInvalidQuest.Write());
}
void Player::SendQuestConfirmAccept(Quest const* quest, Player* receiver) const
@@ -17532,7 +17535,7 @@ void Player::SendQuestConfirmAccept(Quest const* quest, Player* receiver) const
packet.QuestID = questID;
packet.InitiatedBy = GetGUID();
- receiver->GetSession()->SendPacket(packet.Write());
+ receiver->SendDirectMessage(packet.Write());
}
void Player::SendPushToPartyResponse(Player const* player, QuestPushReason reason) const
@@ -17555,7 +17558,7 @@ void Player::SendQuestUpdateAddCredit(Quest const* quest, ObjectGuid guid, Quest
packet.Count = count;
packet.Required = obj.Amount;
packet.ObjectiveType = obj.Type;
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
}
void Player::SendQuestUpdateAddCreditSimple(QuestObjective const& obj) const
@@ -17572,7 +17575,7 @@ void Player::SendQuestUpdateAddPlayer(Quest const* quest, uint16 newCount) const
WorldPackets::Quest::QuestUpdateAddPvPCredit questUpdateAddPvpCredit;
questUpdateAddPvpCredit.QuestID = quest->GetQuestId();
questUpdateAddPvpCredit.Count = newCount;
- GetSession()->SendPacket(questUpdateAddPvpCredit.Write());
+ SendDirectMessage(questUpdateAddPvpCredit.Write());
}
void Player::SendQuestGiverStatusMultiple()
@@ -17602,7 +17605,7 @@ void Player::SendQuestGiverStatusMultiple()
}
}
- GetSession()->SendPacket(response.Write());
+ SendDirectMessage(response.Write());
}
bool Player::HasPvPForcingQuest() const
@@ -17710,8 +17713,7 @@ void Player::_LoadEquipmentSets(PreparedQueryResult result)
continue;
_equipmentSets[eqSet.Data.Guid] = eqSet;
- }
- while (result->NextRow());
+ } while (result->NextRow());
}
void Player::_LoadTransmogOutfits(PreparedQueryResult result)
@@ -18644,7 +18646,7 @@ bool Player::isAllowedToLoot(const Creature* creature) const
if (HasPendingBind())
return false;
- const Loot* loot = &creature->loot;
+ Loot const* loot = &creature->loot;
if (loot->isLooted()) // nothing to loot or everything looted.
return false;
if (!loot->hasItemForAll() && !loot->hasItemFor(this)) // no loot in creature for this player
@@ -19964,12 +19966,12 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, B
void Player::BindToInstance()
{
InstanceSave* mapSave = sInstanceSaveMgr->GetInstanceSave(_pendingBindId);
- if (!mapSave) //it seems sometimes mapSave is NULL, but I did not check why
+ if (!mapSave) //it seems sometimes mapSave is nullptr, but I did not check why
return;
WorldPackets::Instance::InstanceSaveCreated data;
data.Gm = IsGameMaster();
- GetSession()->SendPacket(data.Write());
+ SendDirectMessage(data.Write());
if (!IsGameMaster())
{
BindToInstance(mapSave, true, EXTEND_STATE_KEEP);
@@ -20021,7 +20023,7 @@ void Player::SendRaidInfo()
}
}
- GetSession()->SendPacket(instanceInfo.Write());
+ SendDirectMessage(instanceInfo.Write());
}
bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report)
@@ -21457,28 +21459,28 @@ void Player::SetUInt32ValueInArray(Tokenizer& Tokenizer, uint16 index, uint32 va
void Player::SendAttackSwingDeadTarget() const
{
- GetSession()->SendPacket(WorldPackets::Combat::AttackSwingError(WorldPackets::Combat::AttackSwingError::DeadTarget).Write());
+ SendDirectMessage(WorldPackets::Combat::AttackSwingError(WorldPackets::Combat::AttackSwingError::DeadTarget).Write());
}
void Player::SendAttackSwingCantAttack() const
{
- GetSession()->SendPacket(WorldPackets::Combat::AttackSwingError(WorldPackets::Combat::AttackSwingError::CantAttack).Write());
+ SendDirectMessage(WorldPackets::Combat::AttackSwingError(WorldPackets::Combat::AttackSwingError::CantAttack).Write());
}
void Player::SendAttackSwingNotInRange() const
{
- GetSession()->SendPacket(WorldPackets::Combat::AttackSwingError(WorldPackets::Combat::AttackSwingError::NotInRange).Write());
+ SendDirectMessage(WorldPackets::Combat::AttackSwingError(WorldPackets::Combat::AttackSwingError::NotInRange).Write());
}
void Player::SendAttackSwingBadFacingAttack() const
{
- GetSession()->SendPacket(WorldPackets::Combat::AttackSwingError(WorldPackets::Combat::AttackSwingError::BadFacing).Write());
+ SendDirectMessage(WorldPackets::Combat::AttackSwingError(WorldPackets::Combat::AttackSwingError::BadFacing).Write());
}
void Player::SendAttackSwingCancelAttack() const
{
WorldPackets::Combat::CancelCombat packet;
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
}
void Player::SendAutoRepeatCancel(Unit* target)
@@ -21490,14 +21492,14 @@ void Player::SendAutoRepeatCancel(Unit* target)
void Player::SendExplorationExperience(uint32 Area, uint32 Experience) const
{
- GetSession()->SendPacket(WorldPackets::Misc::ExplorationExperience(Experience, Area).Write());
+ SendDirectMessage(WorldPackets::Misc::ExplorationExperience(Experience, Area).Write());
}
void Player::SendDungeonDifficulty(int32 forcedDifficulty /*= -1*/) const
{
WorldPackets::Misc::DungeonDifficultySet dungeonDifficultySet;
dungeonDifficultySet.DifficultyID = forcedDifficulty == -1 ? GetDungeonDifficultyID() : forcedDifficulty;
- GetSession()->SendPacket(dungeonDifficultySet.Write());
+ SendDirectMessage(dungeonDifficultySet.Write());
}
void Player::SendRaidDifficulty(bool legacy, int32 forcedDifficulty /*= -1*/) const
@@ -21505,13 +21507,13 @@ void Player::SendRaidDifficulty(bool legacy, int32 forcedDifficulty /*= -1*/) co
WorldPackets::Misc::RaidDifficultySet raidDifficultySet;
raidDifficultySet.DifficultyID = forcedDifficulty == -1 ? (legacy ? GetLegacyRaidDifficultyID() : GetRaidDifficultyID()) : forcedDifficulty;
raidDifficultySet.Legacy = legacy;
- GetSession()->SendPacket(raidDifficultySet.Write());
+ SendDirectMessage(raidDifficultySet.Write());
}
void Player::SendResetFailedNotify(uint32 /*mapid*/) const
{
WorldPackets::Instance::ResetFailedNotify data;
- GetSession()->SendPacket(data.Write());
+ SendDirectMessage(data.Write());
}
/// Reset all solo instances and optionally send a message on success for each
@@ -21536,7 +21538,7 @@ void Player::ResetInstances(uint8 method, bool isRaid, bool isLegacy)
for (auto itr = difficultyItr->second.begin(); itr != difficultyItr->second.end();)
{
InstanceSave* p = itr->second.save;
- const MapEntry* entry = sMapStore.LookupEntry(itr->first);
+ MapEntry const* entry = sMapStore.LookupEntry(itr->first);
if (!entry || entry->IsRaid() != isRaid || !p->CanReset())
{
++itr;
@@ -21578,7 +21580,7 @@ void Player::SendResetInstanceSuccess(uint32 MapId) const
{
WorldPackets::Instance::InstanceReset data;
data.MapID = MapId;
- GetSession()->SendPacket(data.Write());
+ SendDirectMessage(data.Write());
}
void Player::SendResetInstanceFailed(ResetFailedReason reason, uint32 mapID) const
@@ -21592,7 +21594,7 @@ void Player::SendResetInstanceFailed(ResetFailedReason reason, uint32 mapID) con
WorldPackets::Instance::InstanceResetFailed data;
data.MapID = mapID;
data.ResetFailedReason = reason;
- GetSession()->SendPacket(data.Write());
+ SendDirectMessage(data.Write());
}
/*********************************************************/
@@ -21773,7 +21775,7 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
if (pet->isControlled())
{
WorldPackets::Pet::PetSpells petSpellsPacket;
- GetSession()->SendPacket(petSpellsPacket.Write());
+ SendDirectMessage(petSpellsPacket.Write());
if (GetGroup())
SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET);
@@ -21955,7 +21957,7 @@ bool Player::RemoveMItem(ObjectGuid::LowType id)
void Player::SendOnCancelExpectedVehicleRideAura() const
{
- GetSession()->SendPacket(WorldPackets::Vehicle::OnCancelExpectedRideVehicleAura().Write());
+ SendDirectMessage(WorldPackets::Vehicle::OnCancelExpectedRideVehicleAura().Write());
}
void Player::PetSpellInitialize()
@@ -21994,7 +21996,7 @@ void Player::PetSpellInitialize()
// Cooldowns
pet->GetSpellHistory()->WritePacket(&petSpellsPacket);
- GetSession()->SendPacket(petSpellsPacket.Write());
+ SendDirectMessage(petSpellsPacket.Write());
}
void Player::PossessSpellInitialize()
@@ -22020,7 +22022,7 @@ void Player::PossessSpellInitialize()
// Cooldowns
charm->GetSpellHistory()->WritePacket(&petSpellsPacket);
- GetSession()->SendPacket(petSpellsPacket.Write());
+ SendDirectMessage(petSpellsPacket.Write());
}
void Player::VehicleSpellInitialize()
@@ -22064,7 +22066,7 @@ void Player::VehicleSpellInitialize()
// Cooldowns
vehicle->GetSpellHistory()->WritePacket(&petSpells);
- GetSession()->SendPacket(petSpells.Write());
+ SendDirectMessage(petSpells.Write());
}
void Player::CharmSpellInitialize()
@@ -22104,13 +22106,13 @@ void Player::CharmSpellInitialize()
if (charm->GetTypeId() != TYPEID_PLAYER)
charm->GetSpellHistory()->WritePacket(&petSpells);
- GetSession()->SendPacket(petSpells.Write());
+ SendDirectMessage(petSpells.Write());
}
void Player::SendRemoveControlBar() const
{
WorldPackets::Pet::PetSpells packet;
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
}
bool Player::IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod, Spell* spell)
@@ -22754,7 +22756,7 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c
packet.Muid = vendorslot + 1;
packet.NewQuantity = crItem->maxcount > 0 ? new_count : 0xFFFFFFFF;
packet.QuantityBought = count;
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
SendNewItem(it, count, true, false, false);
@@ -23481,7 +23483,7 @@ void Player::SetBattlegroundEntryPoint()
// If map is dungeon find linked graveyard
if (GetMap()->IsDungeon())
{
- if (WorldSafeLocsEntry const* entry = sObjectMgr->GetClosestGraveYard(*this, GetTeam(), this))
+ if (WorldSafeLocsEntry const* entry = sObjectMgr->GetClosestGraveyard(*this, GetTeam(), this))
m_bgData.joinPos.WorldRelocate(entry->Loc.GetMapId(), entry->Loc.GetPositionX(), entry->Loc.GetPositionY(), entry->Loc.GetPositionZ());
else
TC_LOG_ERROR("entities.player", "Player::SetBattlegroundEntryPoint: Dungeon (MapID: %u) has no linked graveyard, setting home location as entry point.", GetMapId());
@@ -23633,7 +23635,7 @@ bool Player::IsAlwaysDetectableFor(WorldObject const* seer) const
if (Unit::IsAlwaysDetectableFor(seer))
return true;
- if (const Player* seerPlayer = seer->ToPlayer())
+ if (Player const* seerPlayer = seer->ToPlayer())
if (IsGroupVisibleFor(seerPlayer))
return !(seerPlayer->duel && seerPlayer->duel->startTime != 0 && seerPlayer->duel->opponent == this);
@@ -23776,7 +23778,7 @@ void Player::UpdateTriggerVisibility()
return;
udata.BuildPacket(&packet);
- GetSession()->SendPacket(&packet);
+ SendDirectMessage(&packet);
}
void Player::SendInitialVisiblePackets(Unit* target) const
@@ -24202,7 +24204,7 @@ void Player::SendTransferAborted(uint32 mapid, TransferAbortReason reason, uint8
transferAborted.MapID = mapid;
transferAborted.Arg = arg;
transferAborted.TransfertAbort = reason;
- GetSession()->SendPacket(transferAborted.Write());
+ SendDirectMessage(transferAborted.Write());
}
void Player::SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint32 time, bool welcome) const
@@ -24229,7 +24231,7 @@ void Player::SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint3
else
raidInstanceMessage.Locked = false;
raidInstanceMessage.Extended = false;
- GetSession()->SendPacket(raidInstanceMessage.Write());
+ SendDirectMessage(raidInstanceMessage.Write());
}
void Player::ApplyEquipCooldown(Item* pItem)
@@ -24267,7 +24269,7 @@ void Player::ApplyEquipCooldown(Item* pItem)
data.ItemGuid = pItem->GetGUID();
data.SpellID = effectData->SpellID;
data.Cooldown = 30 * IN_MILLISECONDS; // Always 30secs?
- GetSession()->SendPacket(data.Write());
+ SendDirectMessage(data.Write());
}
}
@@ -24549,7 +24551,7 @@ void Player::SendAurasForTarget(Unit* target) const
update.Auras.push_back(auraInfo);
}
- GetSession()->SendPacket(update.Write());
+ SendDirectMessage(update.Write());
}
void Player::SetDailyQuestStatus(uint32 quest_id)
@@ -24954,7 +24956,7 @@ void Player::UpdateForQuestWorldObjects()
}
}
udata.BuildPacket(&packet);
- GetSession()->SendPacket(&packet);
+ SendDirectMessage(&packet);
}
bool Player::HasSummonPending() const
@@ -24982,7 +24984,7 @@ void Player::SendSummonRequestFrom(Unit* summoner)
summonRequest.SummonerGUID = summoner->GetGUID();
summonRequest.SummonerVirtualRealmAddress = GetVirtualRealmAddress();
summonRequest.AreaID = summoner->GetZoneId();
- GetSession()->SendPacket(summonRequest.Write());
+ SendDirectMessage(summonRequest.Write());
}
void Player::SummonIfPossible(bool agree)
@@ -25235,7 +25237,7 @@ bool Player::GetsRecruitAFriendBonus(bool forXP)
bool recruitAFriend = false;
if (getLevel() <= sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL) || !forXP)
{
- if (Group* group = this->GetGroup())
+ if (Group* group = GetGroup())
{
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
{
@@ -25309,7 +25311,7 @@ bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const
if (!pRewardSource || !IsInMap(pRewardSource))
return false;
- const WorldObject* player = GetCorpse();
+ WorldObject const* player = GetCorpse();
if (!player || IsAlive())
player = this;
@@ -25324,7 +25326,7 @@ bool Player::IsAtRecruitAFriendDistance(WorldObject const* pOther) const
if (!pOther || !IsInMap(pOther))
return false;
- const WorldObject* player = GetCorpse();
+ WorldObject const* player = GetCorpse();
if (!player || IsAlive())
player = this;
@@ -25374,7 +25376,7 @@ void Player::SetClientControl(Unit* target, bool allowMove)
WorldPackets::Movement::ControlUpdate data;
data.Guid = target->GetGUID();
data.On = allowMove;
- GetSession()->SendPacket(data.Write());
+ SendDirectMessage(data.Write());
if (this != target)
SetViewpoint(target, allowMove);
@@ -25510,7 +25512,7 @@ void Player::SendCorpseReclaimDelay(uint32 delay) const
{
WorldPackets::Misc::CorpseReclaimDelay packet;
packet.Remaining = delay;
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
}
Player* Player::GetNextRandomRaidMember(float radius)
@@ -25793,7 +25795,7 @@ void Player::SetViewpoint(WorldObject* target, bool apply)
SetSeer(this);
//WorldPacket data(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, 0);
- //GetSession()->SendPacket(&data);
+ //SendDirectMessage(&data);
}
}
@@ -25931,7 +25933,7 @@ void Player::SetTitle(CharTitlesEntry const* title, bool lost)
WorldPackets::Character::TitleEarned packet(lost ? SMSG_TITLE_LOST : SMSG_TITLE_EARNED);
packet.Index = title->MaskID;
- GetSession()->SendPacket(packet.Write());
+ SendDirectMessage(packet.Write());
}
uint8 Player::GetRunesState() const
@@ -25999,7 +26001,7 @@ void Player::ResyncRunes() const
for (uint32 i = 0; i < maxRunes; ++i)
data.Runes.Cooldowns.push_back(uint8((baseCd - float(GetRuneCooldown(i))) / baseCd * 255));
- GetSession()->SendPacket(data.Write());
+ SendDirectMessage(data.Write());
}
void Player::InitRunes()
@@ -27087,7 +27089,7 @@ void Player::ResetMap()
// after decrement+unlink, ++m_mapRefIter will continue correctly
// when the first element of the list is being removed
// nocheck_prev will return the padding element of the RefManager
- // instead of NULL in the case of prev
+ // instead of nullptr in the case of prev
GetMap()->UpdateIteratorBack(this);
Unit::ResetMap();
GetMapRef().unlink();
@@ -27251,7 +27253,7 @@ void Player::ActivateTalentGroup(ChrSpecializationEntry const* spec)
if (GetPet())
GetPet()->RemoveAllAurasOnDeath();*/
- //RemoveAllAuras(GetGUID(), NULL, false, true); // removes too many auras
+ //RemoveAllAuras(GetGUID(), nullptr, false, true); // removes too many auras
//ExitVehicle(); // should be impossible to switch specs from inside a vehicle..
// Let client clear his current Actions
@@ -27536,7 +27538,7 @@ void Player::SendRefundInfo(Item* item)
setItemPurchaseData.Contents.Currencies[i].CurrencyID = iece->CurrencyID[i];
}
- GetSession()->SendPacket(setItemPurchaseData.Write());
+ SendDirectMessage(setItemPurchaseData.Write());
}
bool Player::AddItem(uint32 itemId, uint32 count)
@@ -27587,7 +27589,7 @@ void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece,
}
}
- GetSession()->SendPacket(itemPurchaseRefundResult.Write());
+ SendDirectMessage(itemPurchaseRefundResult.Write());
}
void Player::RefundItem(Item* item)
@@ -28276,7 +28278,7 @@ void Player::SendSupercededSpell(uint32 oldSpell, uint32 newSpell) const
WorldPackets::Spells::SupercededSpells supercededSpells;
supercededSpells.SpellID.push_back(newSpell);
supercededSpells.Superceded.push_back(oldSpell);
- GetSession()->SendPacket(supercededSpells.Write());
+ SendDirectMessage(supercededSpells.Write());
}
Difficulty Player::GetDifficultyID(MapEntry const* mapEntry) const
@@ -28582,7 +28584,7 @@ void Player::SendRaidGroupOnlyMessage(RaidGroupReason reason, int32 delay) const
raidGroupOnly.Delay = delay;
raidGroupOnly.Reason = reason;
- GetSession()->SendPacket(raidGroupOnly.Write());
+ SendDirectMessage(raidGroupOnly.Write());
}
uint32 Player::DoRandomRoll(uint32 minimum, uint32 maximum)
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 6f8005ca42a..3b69f04b319 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -22,7 +22,7 @@
#include "CUFProfile.h"
#include "DatabaseEnvFwd.h"
#include "DBCEnums.h"
-#include "EquipementSet.h"
+#include "EquipmentSet.h"
#include "GroupReference.h"
#include "ItemDefines.h"
#include "ItemEnchantmentMgr.h"
@@ -1013,7 +1013,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
void SetObjectScale(float scale) override;
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options = 0);
- bool TeleportTo(WorldLocation const &loc, uint32 options = 0);
+ bool TeleportTo(WorldLocation const& loc, uint32 options = 0);
bool TeleportToBGEntryPoint();
bool HasSummonPending() const;
@@ -1030,7 +1030,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
bool IsInWater() const override { return m_isInWater; }
bool IsUnderWater() const override;
- bool IsInAreaTriggerRadius(const AreaTriggerEntry* trigger) const;
+ bool IsInAreaTriggerRadius(AreaTriggerEntry const* trigger) const;
void SendInitialPacketsBeforeAddToMap();
void SendInitialPacketsAfterAddToMap();
@@ -1695,7 +1695,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
PvPInfo pvpInfo;
void UpdatePvPState(bool onlyFFA = false);
void SetPvP(bool state) override;
- void UpdatePvP(bool state, bool override=false);
+ void UpdatePvP(bool state, bool override = false);
void UpdateZone(uint32 newZone, uint32 newArea);
void UpdateArea(uint32 newArea);
void UpdateZoneDependentAuras(uint32 zone_id); // zones
@@ -1720,7 +1720,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
bool IsInSameGroupWith(Player const* p) const;
bool IsInSameRaidWith(Player const* p) const;
void UninviteFromGroup();
- static void RemoveFromGroup(Group* group, ObjectGuid guid, RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT, ObjectGuid kicker = ObjectGuid::Empty, const char* reason = nullptr);
+ static void RemoveFromGroup(Group* group, ObjectGuid guid, RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT, ObjectGuid kicker = ObjectGuid::Empty, char const* reason = nullptr);
void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(), GetGUID(), method); }
void SendUpdateToOutOfRangeGroupMembers();
@@ -1863,7 +1863,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
void SendResetFailedNotify(uint32 mapid) const;
bool UpdatePosition(float x, float y, float z, float orientation, bool teleport = false) override;
- bool UpdatePosition(const Position &pos, bool teleport = false) override { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); }
+ bool UpdatePosition(Position const& pos, bool teleport = false) override { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); }
void ProcessTerrainStatusUpdate(ZLiquidStatus status, Optional<LiquidData> const& liquidData) override;
void SendMessageToSet(WorldPacket const* data, bool self) const override { SendMessageToSetInRange(data, GetVisibilityRange(), self); }
@@ -2314,7 +2314,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
void SetMap(Map* map) override;
void ResetMap() override;
- bool isAllowedToLoot(const Creature* creature) const;
+ bool isAllowedToLoot(Creature const* creature) const;
DeclinedName const* GetDeclinedNames() const { return m_declinedname; }
uint8 GetRunesState() const;
diff --git a/src/server/game/Entities/Player/PlayerTaxi.h b/src/server/game/Entities/Player/PlayerTaxi.h
index 1f8850d5578..fd962967f8b 100644
--- a/src/server/game/Entities/Player/PlayerTaxi.h
+++ b/src/server/game/Entities/Player/PlayerTaxi.h
@@ -15,14 +15,14 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __PLAYERTAXI_H__
-#define __PLAYERTAXI_H__
+#ifndef PlayerTaxi_h__
+#define PlayerTaxi_h__
#include "DBCEnums.h"
#include "Define.h"
#include <deque>
#include <iosfwd>
-#include <vector>
+#include <string>
struct FactionTemplateEntry;
namespace WorldPackets
@@ -69,7 +69,6 @@ class TC_GAME_API PlayerTaxi
void ClearTaxiDestinations() { m_TaxiDestinations.clear(); }
void AddTaxiDestination(uint32 dest) { m_TaxiDestinations.push_back(dest); }
- void SetTaxiDestination(std::vector<uint32>& nodes) { m_TaxiDestinations.clear(); m_TaxiDestinations.insert(m_TaxiDestinations.begin(), nodes.begin(), nodes.end()); }
uint32 GetTaxiSource() const { return m_TaxiDestinations.empty() ? 0 : m_TaxiDestinations.front(); }
uint32 GetTaxiDestination() const { return m_TaxiDestinations.size() < 2 ? 0 : m_TaxiDestinations[1]; }
uint32 GetCurrentTaxiPath() const;
@@ -93,4 +92,4 @@ class TC_GAME_API PlayerTaxi
std::ostringstream& operator <<(std::ostringstream& ss, PlayerTaxi const& taxi);
-#endif
+#endif // PlayerTaxi_h__
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
index ac86632924b..7da7282d6f9 100644
--- a/src/server/game/Entities/Unit/StatSystem.cpp
+++ b/src/server/game/Entities/Unit/StatSystem.cpp
@@ -20,7 +20,6 @@
#include "Item.h"
#include "Player.h"
#include "Pet.h"
-#include "Creature.h"
#include "GameTables.h"
#include "ObjectMgr.h"
#include "SharedDefines.h"
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 2ea4ee71237..9aeb1397b6f 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -79,6 +79,7 @@
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
+#include <sstream>
#include <cmath>
float baseMoveSpeed[MAX_MOVE_TYPE] =
@@ -107,6 +108,13 @@ float playerBaseMoveSpeed[MAX_MOVE_TYPE] =
3.14f // MOVE_PITCH_RATE
};
+DispelableAura::DispelableAura(Aura* aura, int32 dispelChance, uint8 dispelCharges) :
+ _aura(aura), _chance(dispelChance), _charges(dispelCharges)
+{
+}
+
+DispelableAura::~DispelableAura() = default;
+
bool DispelableAura::RollDispel() const
{
return roll_chance_i(_chance);
@@ -292,7 +300,7 @@ Unit::Unit(bool isWorldObject) :
m_ControlledByPlayer(false), movespline(new Movement::MoveSpline()),
i_AI(nullptr), i_disabledAI(nullptr), m_AutoRepeatFirstCast(false), m_procDeep(0),
m_removedAurasCount(0), i_motionMaster(new MotionMaster(this)), m_regenTimer(0), m_ThreatManager(this),
- m_vehicle(nullptr), m_vehicleKit(nullptr), m_unitTypeMask(UNIT_MASK_NONE),
+ m_vehicle(nullptr), m_vehicleKit(nullptr), m_unitTypeMask(UNIT_MASK_NONE), m_Diminishing(),
m_HostileRefManager(this), _aiAnimKitId(0), _movementAnimKitId(0), _meleeAnimKitId(0),
_spellHistory(new SpellHistory(this))
{
@@ -578,7 +586,7 @@ void Unit::resetAttackTimer(WeaponAttackType type)
m_attackTimer[type] = uint32(GetBaseAttackTime(type) * m_modAttackSpeedPct[type]);
}
-bool Unit::IsWithinCombatRange(const Unit* obj, float dist2compare) const
+bool Unit::IsWithinCombatRange(Unit const* obj, float dist2compare) const
{
if (!obj || !IsInMap(obj) || !IsInPhase(obj))
return false;
@@ -625,7 +633,7 @@ bool Unit::IsWithinBoundaryRadius(const Unit* obj) const
return IsInDist(obj, objBoundaryRadius);
}
-void Unit::GetRandomContactPoint(const Unit* obj, float &x, float &y, float &z, float distance2dMin, float distance2dMax) const
+void Unit::GetRandomContactPoint(Unit const* obj, float &x, float &y, float &z, float distance2dMin, float distance2dMax) const
{
float combat_reach = GetCombatReach();
if (combat_reach < 0.1f) // sometimes bugged for players
@@ -935,7 +943,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
ASSERT(he && he->duel);
- if (duel_wasMounted) // In this case victim==mount
+ if (duel_wasMounted) // In this case victim == mount
victim->SetHealth(1);
else
he->SetHealth(1);
@@ -1569,6 +1577,7 @@ bool Unit::IsDamageReducedByArmor(SpellSchoolMask schoolMask, SpellInfo const* s
if (spellInfo->HasAttribute(SPELL_ATTR0_CU_IGNORE_ARMOR))
return false;
+ // bleeding effects are not reduced by armor
if (effIndex != -1)
{
// bleeding effects are not reduced by armor
@@ -2898,7 +2907,7 @@ void Unit::_UpdateSpells(uint32 time)
void Unit::_UpdateAutoRepeatSpell()
{
- const SpellInfo* autoRepeatSpellInfo = m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo;
+ SpellInfo const* autoRepeatSpellInfo = m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo;
// check "realtime" interrupts
// don't cancel spells which are affected by a SPELL_AURA_CAST_WHILE_WALKING effect
@@ -9333,8 +9342,8 @@ void Unit::ApplyDiminishingAura(DiminishingGroup group, bool apply)
void Unit::ClearDiminishings()
{
- for (uint32 i = 0; i < DIMINISHING_MAX; ++i)
- m_Diminishing[i].Clear();
+ for (DiminishingReturn& dim : m_Diminishing)
+ dim.Clear();
}
float Unit::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const
@@ -10682,13 +10691,13 @@ void Unit::SendPetAIReaction(ObjectGuid guid)
owner->ToPlayer()->SendDirectMessage(packet.Write());
}
+///----------End of Pet responses methods----------
+
void Unit::PropagateSpeedChange()
{
GetMotionMaster()->PropagateSpeedChange();
}
-///----------End of Pet responses methods----------
-
void Unit::StopMoving()
{
ClearUnitState(UNIT_STATE_MOVING);
@@ -10748,7 +10757,7 @@ void Unit::SetStandState(UnitStandStateType state, uint32 animKitID /* = 0*/)
if (GetTypeId() == TYPEID_PLAYER)
{
WorldPackets::Misc::StandStateUpdate packet(state, animKitID);
- ToPlayer()->GetSession()->SendPacket(packet.Write());
+ ToPlayer()->SendDirectMessage(packet.Write());
}
}
@@ -12143,7 +12152,7 @@ void Unit::RemoveVehicleKit(bool onRemoveFromWorld /*= false*/)
RemoveNpcFlag(NPCFlags(UNIT_NPC_FLAG_SPELLCLICK | UNIT_NPC_FLAG_PLAYER_VEHICLE));
}
-bool Unit::IsOnVehicle(const Unit* vehicle) const
+bool Unit::IsOnVehicle(Unit const* vehicle) const
{
return m_vehicle && m_vehicle == vehicle->GetVehicleKit();
}
@@ -13397,7 +13406,7 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel
return (relocated || turn);
}
-bool Unit::UpdatePosition(const Position &pos, bool teleport)
+bool Unit::UpdatePosition(Position const& pos, bool teleport)
{
return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport);
}
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 82297d25d92..9c5cdc8fb6a 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -23,13 +23,13 @@
#include "FollowerReference.h"
#include "FollowerRefManager.h"
#include "HostileRefManager.h"
+#include "OptionalFwd.h"
#include "SpellAuraDefines.h"
#include "ThreatManager.h"
#include "Timer.h"
#include "UnitDefines.h"
#include "Util.h"
#include <boost/container/flat_set.hpp>
-#include <algorithm>
#include <array>
#include <map>
@@ -235,8 +235,8 @@ typedef std::list<Unit*> UnitList;
class DispelableAura
{
public:
- DispelableAura(Aura* aura, int32 dispelChance, uint8 dispelCharges) :
- _aura(aura), _chance(dispelChance), _charges(dispelCharges) { }
+ DispelableAura(Aura* aura, int32 dispelChance, uint8 dispelCharges);
+ ~DispelableAura();
Aura* GetAura() const { return _aura; }
bool RollDispel() const;
@@ -973,7 +973,7 @@ class TC_GAME_API Unit : public WorldObject
void SetCombatReach(float combatReach) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::CombatReach), combatReach); }
float GetBoundingRadius() const { return m_unitData->BoundingRadius; }
void SetBoundingRadius(float boundingRadius) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::BoundingRadius), boundingRadius); }
- bool IsWithinCombatRange(const Unit* obj, float dist2compare) const;
+ bool IsWithinCombatRange(Unit const* obj, float dist2compare) const;
bool IsWithinMeleeRange(Unit const* obj) const;
float GetMeleeRange(Unit const* target) const;
virtual SpellSchoolMask GetMeleeDamageSchoolMask() const;
@@ -1334,7 +1334,7 @@ class TC_GAME_API Unit : public WorldObject
void CastCustomSpell(Unit* victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim = nullptr, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
- void CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* victim = nullptr, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
+ void CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit* victim = nullptr, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
Aura* AddAura(uint32 spellId, Unit* target);
Aura* AddAura(SpellInfo const* spellInfo, uint32 effMask, Unit* target);
void SetAuraStack(uint32 spellId, Unit* target, uint32 stack);
@@ -1364,7 +1364,7 @@ class TC_GAME_API Unit : public WorldObject
void SendTeleportPacket(Position const& pos);
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false);
// returns true if unit's position really changed
- virtual bool UpdatePosition(const Position &pos, bool teleport = false);
+ virtual bool UpdatePosition(Position const& pos, bool teleport = false);
void UpdateOrientation(float orientation);
void UpdateHeight(float newZ);
@@ -1905,7 +1905,7 @@ class TC_GAME_API Unit : public WorldObject
void removeFollower(FollowerReference* /*pRef*/) { /* nothing to do yet */ }
MotionMaster* GetMotionMaster() { return i_motionMaster; }
- const MotionMaster* GetMotionMaster() const { return i_motionMaster; }
+ MotionMaster const* GetMotionMaster() const { return i_motionMaster; }
bool IsStopped() const { return !(HasUnitState(UNIT_STATE_MOVING)); }
void StopMoving();
@@ -1966,7 +1966,7 @@ class TC_GAME_API Unit : public WorldObject
Vehicle* GetVehicleKit()const { return m_vehicleKit; }
Vehicle* GetVehicle() const { return m_vehicle; }
void SetVehicle(Vehicle* vehicle) { m_vehicle = vehicle; }
- bool IsOnVehicle(const Unit* vehicle) const;
+ bool IsOnVehicle(Unit const* vehicle) const;
Unit* GetVehicleBase() const;
Creature* GetVehicleCreatureBase() const;
ObjectGuid GetTransGUID() const override;
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp
index 64443d58e90..16f7d6ab619 100644
--- a/src/server/game/Events/GameEventMgr.cpp
+++ b/src/server/game/Events/GameEventMgr.cpp
@@ -467,7 +467,7 @@ void GameEventMgr::LoadFromDB()
// 0 1 2 3 4
QueryResult result = WorldDatabase.Query("SELECT creature.guid, creature.id, game_event_model_equip.eventEntry, game_event_model_equip.modelid, game_event_model_equip.equipment_id "
- "FROM creature JOIN game_event_model_equip ON creature.guid=game_event_model_equip.guid");
+ "FROM creature JOIN game_event_model_equip ON creature.guid = game_event_model_equip.guid");
if (!result)
TC_LOG_INFO("server.loading", ">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty.");
diff --git a/src/server/game/Globals/ObjectAccessor.h b/src/server/game/Globals/ObjectAccessor.h
index 3e5ca4c1ef3..089da4e0f20 100644
--- a/src/server/game/Globals/ObjectAccessor.h
+++ b/src/server/game/Globals/ObjectAccessor.h
@@ -47,6 +47,7 @@ class TC_GAME_API HashMapHolder
HashMapHolder() { }
public:
+
typedef std::unordered_map<ObjectGuid, T*> MapType;
static void Insert(T* o);
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 90dde6d7f78..2e4e837c10e 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -1597,7 +1597,7 @@ void ObjectMgr::LoadLinkedRespawn()
{
case CREATURE_TO_CREATURE:
{
- const CreatureData* slave = GetCreatureData(guidLow);
+ CreatureData const* slave = GetCreatureData(guidLow);
if (!slave)
{
TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature (guid) '" UI64FMTD "' not found in creature table", guidLow);
@@ -1605,7 +1605,7 @@ void ObjectMgr::LoadLinkedRespawn()
break;
}
- const CreatureData* master = GetCreatureData(linkedGuidLow);
+ CreatureData const* master = GetCreatureData(linkedGuidLow);
if (!master)
{
TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature (linkedGuid) '" UI64FMTD "' not found in creature table", linkedGuidLow);
@@ -1635,7 +1635,7 @@ void ObjectMgr::LoadLinkedRespawn()
}
case CREATURE_TO_GO:
{
- const CreatureData* slave = GetCreatureData(guidLow);
+ CreatureData const* slave = GetCreatureData(guidLow);
if (!slave)
{
TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature (guid) '" UI64FMTD "' not found in creature table", guidLow);
@@ -1719,7 +1719,7 @@ void ObjectMgr::LoadLinkedRespawn()
break;
}
- const CreatureData* master = GetCreatureData(linkedGuidLow);
+ CreatureData const* master = GetCreatureData(linkedGuidLow);
if (!master)
{
TC_LOG_ERROR("sql.sql", "LinkedRespawn: Creature (linkedGuid) '" UI64FMTD "' not found in creature table", linkedGuidLow);
@@ -6417,7 +6417,7 @@ void ObjectMgr::LoadGraveyardZones()
{
uint32 oldMSTime = getMSTime();
- GraveYardStore.clear(); // needed for reload case
+ GraveyardStore.clear(); // needed for reload case
// 0 1 2
QueryResult result = WorldDatabase.Query("SELECT ID, GhostZone, Faction FROM graveyard_zone");
@@ -6460,14 +6460,14 @@ void ObjectMgr::LoadGraveyardZones()
continue;
}
- if (!AddGraveYardLink(safeLocId, zoneId, team, false))
+ if (!AddGraveyardLink(safeLocId, zoneId, team, false))
TC_LOG_ERROR("sql.sql", "Table `graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.", safeLocId, zoneId);
} while (result->NextRow());
TC_LOG_INFO("server.loading", ">> Loaded %u graveyard-zone links in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
-WorldSafeLocsEntry const* ObjectMgr::GetDefaultGraveYard(uint32 team) const
+WorldSafeLocsEntry const* ObjectMgr::GetDefaultGraveyard(uint32 team) const
{
enum DefaultGraveyard
{
@@ -6482,7 +6482,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetDefaultGraveYard(uint32 team) const
else return nullptr;
}
-WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(WorldLocation const& location, uint32 team, WorldObject* conditionObject) const
+WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveyard(WorldLocation const& location, uint32 team, WorldObject* conditionObject) const
{
float x, y, z;
location.GetPosition(x, y, z);
@@ -6496,7 +6496,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(WorldLocation const& lo
if (z > -500)
{
TC_LOG_ERROR("misc", "ZoneId not found for map %u coords (%f, %f, %f)", MapId, x, y, z);
- return GetDefaultGraveYard(team);
+ return GetDefaultGraveyard(team);
}
}
@@ -6507,7 +6507,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(WorldLocation const& lo
// then check faction
// if mapId != graveyard.mapId (ghost in instance) and search any graveyard associated
// then check faction
- GraveYardMapBounds range = GraveYardStore.equal_range(zoneId);
+ GraveyardMapBounds range = GraveyardStore.equal_range(zoneId);
MapEntry const* map = sMapStore.LookupEntry(MapId);
// not need to check validity of map object; MapId _MUST_ be valid here
@@ -6515,7 +6515,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(WorldLocation const& lo
{
if (zoneId != 0) // zone == 0 can't be fixed, used by bliz for bugged zones
TC_LOG_ERROR("sql.sql", "Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
- return GetDefaultGraveYard(team);
+ return GetDefaultGraveyard(team);
}
// at corpse map
@@ -6537,7 +6537,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(WorldLocation const& lo
for (; range.first != range.second; ++range.first)
{
- GraveYardData const& data = range.first->second;
+ GraveyardData const& data = range.first->second;
WorldSafeLocsEntry const* entry = ASSERT_NOTNULL(GetWorldSafeLoc(data.safeLocId));
@@ -6619,12 +6619,12 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(WorldLocation const& lo
return entryFar;
}
-GraveYardData const* ObjectMgr::FindGraveYardData(uint32 id, uint32 zoneId) const
+GraveyardData const* ObjectMgr::FindGraveyardData(uint32 id, uint32 zoneId) const
{
- GraveYardMapBounds range = GraveYardStore.equal_range(zoneId);
+ GraveyardMapBounds range = GraveyardStore.equal_range(zoneId);
for (; range.first != range.second; ++range.first)
{
- GraveYardData const& data = range.first->second;
+ GraveyardData const& data = range.first->second;
if (data.safeLocId == id)
return &data;
}
@@ -6687,17 +6687,17 @@ AccessRequirement const* ObjectMgr::GetAccessRequirement(uint32 mapid, Difficult
return nullptr;
}
-bool ObjectMgr::AddGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool persist /*= true*/)
+bool ObjectMgr::AddGraveyardLink(uint32 id, uint32 zoneId, uint32 team, bool persist /*= true*/)
{
- if (FindGraveYardData(id, zoneId))
+ if (FindGraveyardData(id, zoneId))
return false;
// add link to loaded data
- GraveYardData data;
+ GraveyardData data;
data.safeLocId = id;
data.team = team;
- GraveYardStore.insert(GraveYardContainer::value_type(zoneId, data));
+ GraveyardStore.insert(GraveyardContainer::value_type(zoneId, data));
// add link to DB
if (persist)
@@ -6714,9 +6714,9 @@ bool ObjectMgr::AddGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool per
return true;
}
-void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool persist /*= false*/)
+void ObjectMgr::RemoveGraveyardLink(uint32 id, uint32 zoneId, uint32 team, bool persist /*= false*/)
{
- GraveYardMapBoundsNonConst range = GraveYardStore.equal_range(zoneId);
+ GraveyardMapBoundsNonConst range = GraveyardStore.equal_range(zoneId);
if (range.first == range.second)
{
//TC_LOG_ERROR("sql.sql", "Table `graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
@@ -6728,7 +6728,7 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool
for (; range.first != range.second; ++range.first)
{
- GraveYardData & data = range.first->second;
+ GraveyardData & data = range.first->second;
// skip not matching safezone id
if (data.safeLocId != id)
@@ -6748,7 +6748,7 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool
return;
// remove from links
- GraveYardStore.erase(range.first);
+ GraveyardStore.erase(range.first);
// remove link from DB
if (persist)
@@ -6932,13 +6932,13 @@ AreaTriggerStruct const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
{
bool useParentDbValue = false;
uint32 parentId = 0;
- const MapEntry* mapEntry = sMapStore.LookupEntry(Map);
+ MapEntry const* mapEntry = sMapStore.LookupEntry(Map);
if (!mapEntry || mapEntry->CorpseMapID < 0)
return nullptr;
if (mapEntry->IsDungeon())
{
- const InstanceTemplate* iTemplate = sObjectMgr->GetInstanceTemplate(Map);
+ InstanceTemplate const* iTemplate = sObjectMgr->GetInstanceTemplate(Map);
if (!iTemplate)
return nullptr;
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index 43778ad4298..ce1cd5d6ea0 100644
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -138,14 +138,14 @@ enum ScriptCommands
enum ChatType
{
- CHAT_TYPE_SAY = 0,
- CHAT_TYPE_YELL = 1,
- CHAT_TYPE_TEXT_EMOTE = 2,
- CHAT_TYPE_BOSS_EMOTE = 3,
- CHAT_TYPE_WHISPER = 4,
- CHAT_TYPE_BOSS_WHISPER = 5,
- CHAT_TYPE_ZONE_YELL = 6,
- CHAT_TYPE_END = 255
+ CHAT_TYPE_SAY = 0,
+ CHAT_TYPE_YELL = 1,
+ CHAT_TYPE_TEXT_EMOTE = 2,
+ CHAT_TYPE_BOSS_EMOTE = 3,
+ CHAT_TYPE_WHISPER = 4,
+ CHAT_TYPE_BOSS_WHISPER = 5,
+ CHAT_TYPE_ZONE_YELL = 6,
+ CHAT_TYPE_END = 255
};
typedef std::map<uint32, PageText> PageTextContainer;
@@ -567,55 +567,51 @@ struct PlayerCreateInfoItem
{
PlayerCreateInfoItem(uint32 id, uint32 amount) : item_id(id), item_amount(amount) { }
- uint32 item_id;
- uint32 item_amount;
+ uint32 item_id = 0;
+ uint32 item_amount = 0;
};
-typedef std::list<PlayerCreateInfoItem> PlayerCreateInfoItems;
+typedef std::vector<PlayerCreateInfoItem> PlayerCreateInfoItems;
struct PlayerLevelInfo
{
- PlayerLevelInfo() { for (uint8 i = 0; i < MAX_STATS; ++i) stats[i] = 0; }
-
- uint16 stats[MAX_STATS];
+ uint16 stats[MAX_STATS] = { };
};
-typedef std::list<uint32> PlayerCreateInfoSpells;
+typedef std::vector<uint32> PlayerCreateInfoSpells;
struct PlayerCreateInfoAction
{
- PlayerCreateInfoAction() : button(0), type(0), action(0) { }
PlayerCreateInfoAction(uint8 _button, uint32 _action, uint8 _type) : button(_button), type(_type), action(_action) { }
- uint8 button;
- uint8 type;
- uint32 action;
+ uint8 button = 0;
+ uint8 type = 0;
+ uint32 action = 0;
};
-typedef std::list<PlayerCreateInfoAction> PlayerCreateInfoActions;
+typedef std::vector<PlayerCreateInfoAction> PlayerCreateInfoActions;
-typedef std::list<SkillRaceClassInfoEntry const*> PlayerCreateInfoSkills;
+typedef std::vector<SkillRaceClassInfoEntry const*> PlayerCreateInfoSkills;
+// existence checked by displayId != 0
struct PlayerInfo
{
- // existence checked by displayId != 0
- PlayerInfo() : mapId(0), areaId(0), positionX(0.0f), positionY(0.0f), positionZ(0.0f), orientation(0.0f), displayId_m(0), displayId_f(0), levelInfo(nullptr) { }
-
- uint32 mapId;
- uint32 areaId;
- float positionX;
- float positionY;
- float positionZ;
- float orientation;
- uint32 displayId_m;
- uint32 displayId_f;
+ uint32 mapId = 0;
+ uint32 areaId = 0;
+ float positionX = 0.0f;
+ float positionY = 0.0f;
+ float positionZ = 0.0f;
+ float orientation = 0.0f;
+ uint32 displayId_m = 0;
+ uint32 displayId_f = 0;
PlayerCreateInfoItems item;
PlayerCreateInfoSpells customSpells;
PlayerCreateInfoSpells castSpells;
PlayerCreateInfoActions action;
PlayerCreateInfoSkills skills;
- PlayerLevelInfo* levelInfo; //[level-1] 0..MaxPlayerLevel-1
+ //[level-1] 0..MaxPlayerLevel-1
+ PlayerLevelInfo* levelInfo = nullptr;
};
struct PetLevelInfo
@@ -774,15 +770,15 @@ struct WorldSafeLocsEntry
WorldLocation Loc;
};
-struct GraveYardData
+struct GraveyardData
{
uint32 safeLocId;
uint32 team;
};
-typedef std::multimap<uint32, GraveYardData> GraveYardContainer;
-typedef std::pair<GraveYardContainer::const_iterator, GraveYardContainer::const_iterator> GraveYardMapBounds;
-typedef std::pair<GraveYardContainer::iterator, GraveYardContainer::iterator> GraveYardMapBoundsNonConst;
+typedef std::multimap<uint32, GraveyardData> GraveyardContainer;
+typedef std::pair<GraveyardContainer::const_iterator, GraveyardContainer::const_iterator> GraveyardMapBounds;
+typedef std::pair<GraveyardContainer::iterator, GraveyardContainer::iterator> GraveyardMapBoundsNonConst;
typedef std::unordered_map<uint32, VendorItemData> CacheVendorItemContainer;
@@ -1116,12 +1112,12 @@ class TC_GAME_API ObjectMgr
QuestGreeting const* GetQuestGreeting(TypeID type, uint32 id) const;
QuestGreetingLocale const* GetQuestGreetingLocale(TypeID type, uint32 id) const;
- WorldSafeLocsEntry const* GetDefaultGraveYard(uint32 team) const;
- WorldSafeLocsEntry const* GetClosestGraveYard(WorldLocation const& location, uint32 team, WorldObject* conditionObject) const;
- bool AddGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool persist = true);
- void RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool persist = false);
+ WorldSafeLocsEntry const* GetDefaultGraveyard(uint32 team) const;
+ WorldSafeLocsEntry const* GetClosestGraveyard(WorldLocation const& location, uint32 team, WorldObject* conditionObject) const;
+ bool AddGraveyardLink(uint32 id, uint32 zoneId, uint32 team, bool persist = true);
+ void RemoveGraveyardLink(uint32 id, uint32 zoneId, uint32 team, bool persist = false);
void LoadGraveyardZones();
- GraveYardData const* FindGraveYardData(uint32 id, uint32 zone) const;
+ GraveyardData const* FindGraveyardData(uint32 id, uint32 zone) const;
void LoadWorldSafeLocs();
WorldSafeLocsEntry const* GetWorldSafeLoc(uint32 id) const;
Trinity::IteratorPair<std::unordered_map<uint32, WorldSafeLocsEntry>::const_iterator> GetWorldSafeLocs() const;
@@ -1609,7 +1605,7 @@ class TC_GAME_API ObjectMgr
}
// for wintergrasp only
- GraveYardContainer GraveYardStore;
+ GraveyardContainer GraveyardStore;
static void AddLocaleString(std::string&& value, LocaleConstant localeConstant, std::vector<std::string>& data);
static inline void GetLocaleString(std::vector<std::string> const& data, LocaleConstant localeConstant, std::string& value)
@@ -1794,10 +1790,10 @@ class TC_GAME_API ObjectMgr
CreatureTemplateContainer _creatureTemplateStore;
CreatureModelContainer _creatureModelStore;
CreatureAddonContainer _creatureAddonStore;
+ CreatureTemplateAddonContainer _creatureTemplateAddonStore;
GameObjectAddonContainer _gameObjectAddonStore;
GameObjectQuestItemMap _gameObjectQuestItemStore;
CreatureQuestItemMap _creatureQuestItemStore;
- CreatureTemplateAddonContainer _creatureTemplateAddonStore;
EquipmentInfoContainer _equipmentInfoStore;
LinkedRespawnContainer _linkedRespawnStore;
CreatureLocaleContainer _creatureLocaleStore;
diff --git a/src/server/game/Grids/Cells/Cell.h b/src/server/game/Grids/Cells/Cell.h
index 0cd4f042aa8..cf1337350aa 100644
--- a/src/server/game/Grids/Cells/Cell.h
+++ b/src/server/game/Grids/Cells/Cell.h
@@ -58,13 +58,13 @@ struct Cell
y = data.Part.grid_y * MAX_NUMBER_OF_CELLS + data.Part.cell_y;
}
- bool DiffCell(const Cell &cell) const
+ bool DiffCell(Cell const& cell) const
{
return(data.Part.cell_x != cell.data.Part.cell_x ||
data.Part.cell_y != cell.data.Part.cell_y);
}
- bool DiffGrid(const Cell &cell) const
+ bool DiffGrid(Cell const& cell) const
{
return(data.Part.grid_x != cell.data.Part.grid_x ||
data.Part.grid_y != cell.data.Part.grid_y);
diff --git a/src/server/game/Grids/Dynamic/TypeContainerVisitor.h b/src/server/game/Grids/Dynamic/TypeContainerVisitor.h
index ee903337c55..cfe3c68edf3 100644
--- a/src/server/game/Grids/Dynamic/TypeContainerVisitor.h
+++ b/src/server/game/Grids/Dynamic/TypeContainerVisitor.h
@@ -86,12 +86,12 @@ class TypeContainerVisitor
public:
TypeContainerVisitor(VISITOR &v) : i_visitor(v) { }
- void Visit(TYPE_CONTAINER &c)
+ void Visit(TYPE_CONTAINER& c)
{
VisitorHelper(i_visitor, c);
}
- void Visit(const TYPE_CONTAINER &c) const
+ void Visit(TYPE_CONTAINER const& c) const
{
VisitorHelper(i_visitor, c);
}
diff --git a/src/server/game/Grids/GridRefManager.h b/src/server/game/Grids/GridRefManager.h
index 9e38238a114..fa2939b4ca7 100644
--- a/src/server/game/Grids/GridRefManager.h
+++ b/src/server/game/Grids/GridRefManager.h
@@ -33,6 +33,6 @@ class GridRefManager : public RefManager<GridRefManager<OBJECT>, OBJECT>
GridReference<OBJECT>* getLast() { return (GridReference<OBJECT>*)RefManager<GridRefManager<OBJECT>, OBJECT>::getLast(); }
iterator begin() { return iterator(getFirst()); }
- iterator end() { return iterator(NULL); }
+ iterator end() { return iterator(nullptr); }
};
#endif
diff --git a/src/server/game/Grids/NGrid.h b/src/server/game/Grids/NGrid.h
index 587cda84111..fa0862dc896 100644
--- a/src/server/game/Grids/NGrid.h
+++ b/src/server/game/Grids/NGrid.h
@@ -32,14 +32,14 @@ class TC_GAME_API GridInfo
{
public:
GridInfo();
- GridInfo(time_t expiry, bool unload = true );
- const TimeTracker& getTimeTracker() const { return i_timer; }
+ GridInfo(time_t expiry, bool unload = true);
+ TimeTracker const& getTimeTracker() const { return i_timer; }
bool getUnloadLock() const { return i_unloadActiveLockCount || i_unloadExplicitLock; }
void setUnloadExplicitLock(bool on) { i_unloadExplicitLock = on; }
void incUnloadActiveLock() { ++i_unloadActiveLockCount; }
void decUnloadActiveLock() { if (i_unloadActiveLockCount) --i_unloadActiveLockCount; }
- void setTimer(const TimeTracker& pTimer) { i_timer = pTimer; }
+ void setTimer(TimeTracker const& pTimer) { i_timer = pTimer; }
void ResetTimeTracker(time_t interval) { i_timer.Reset(interval); }
void UpdateTimeTracker(time_t diff) { i_timer.Update(diff); }
PeriodicTimer& getRelocationTimer() { return vis_Update; }
@@ -102,7 +102,7 @@ class NGrid
void setGridObjectDataLoaded(bool pLoaded) { i_GridObjectDataLoaded = pLoaded; }
GridInfo* getGridInfoRef() { return &i_GridInfo; }
- const TimeTracker& getTimeTracker() const { return i_GridInfo.getTimeTracker(); }
+ TimeTracker const& getTimeTracker() const { return i_GridInfo.getTimeTracker(); }
bool getUnloadLock() const { return i_GridInfo.getUnloadLock(); }
void setUnloadExplicitLock(bool on) { i_GridInfo.setUnloadExplicitLock(on); }
void incUnloadActiveLock() { i_GridInfo.incUnloadActiveLock(); }
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp
index c5f00519626..4e1db87c417 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp
@@ -79,7 +79,7 @@ void VisibleNotifier::SendToSelf()
WorldPacket packet;
i_data.BuildPacket(&packet);
- i_player.GetSession()->SendPacket(&packet);
+ i_player.SendDirectMessage(&packet);
for (std::set<Unit*>::const_iterator it = i_visibleNow.begin(); it != i_visibleNow.end(); ++it)
i_player.SendInitialVisiblePackets(*it);
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index 85c0fab72d0..f8e3cc5cb0b 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -1415,7 +1415,7 @@ namespace Trinity
class AllGameObjectsWithEntryInRange
{
public:
- AllGameObjectsWithEntryInRange(const WorldObject* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) { }
+ AllGameObjectsWithEntryInRange(WorldObject const* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) { }
bool operator()(GameObject* go) const
{
@@ -1434,7 +1434,7 @@ namespace Trinity
class AllCreaturesOfEntryInRange
{
public:
- AllCreaturesOfEntryInRange(const WorldObject* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) { }
+ AllCreaturesOfEntryInRange(WorldObject const* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) { }
bool operator()(Unit* unit) const
{
@@ -1490,7 +1490,7 @@ namespace Trinity
class AllWorldObjectsInRange
{
public:
- AllWorldObjectsInRange(const WorldObject* object, float maxRange) : m_pObject(object), m_fRange(maxRange) { }
+ AllWorldObjectsInRange(WorldObject const* object, float maxRange) : m_pObject(object), m_fRange(maxRange) { }
bool operator()(WorldObject* go) const
{
diff --git a/src/server/game/Grids/ObjectGridLoader.h b/src/server/game/Grids/ObjectGridLoader.h
index a39d8c90157..a0638d1069a 100644
--- a/src/server/game/Grids/ObjectGridLoader.h
+++ b/src/server/game/Grids/ObjectGridLoader.h
@@ -31,7 +31,7 @@ class TC_GAME_API ObjectGridLoader
friend class ObjectWorldLoader;
public:
- ObjectGridLoader(NGridType &grid, Map* map, const Cell &cell)
+ ObjectGridLoader(NGridType& grid, Map* map, Cell const& cell)
: i_cell(cell), i_grid(grid), i_map(map), i_gameObjects(0), i_creatures(0), i_corpses (0)
{ }
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 10d09b63c11..22e9b84252e 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -19,7 +19,6 @@
#include "Battleground.h"
#include "BattlegroundMgr.h"
#include "CharacterCache.h"
-#include "Common.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "Formulas.h"
@@ -38,7 +37,6 @@
#include "Pet.h"
#include "Player.h"
#include "Random.h"
-#include "SpellAuras.h"
#include "UpdateData.h"
#include "Util.h"
#include "World.h"
@@ -351,7 +349,7 @@ void Group::RemoveInvite(Player* player)
void Group::RemoveAllInvites()
{
- for (InvitesList::iterator itr=m_invitees.begin(); itr != m_invitees.end(); ++itr)
+ for (InvitesList::iterator itr = m_invitees.begin(); itr != m_invitees.end(); ++itr)
if (*itr)
(*itr)->SetGroupInvite(nullptr);
@@ -528,7 +526,7 @@ bool Group::AddMember(Player* player)
return true;
}
-bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_REMOVEMETHOD_DEFAULT*/, ObjectGuid kicker /*= 0*/, const char* reason /*= nullptr*/)
+bool Group::RemoveMember(ObjectGuid guid, RemoveMethod method /*= GROUP_REMOVEMETHOD_DEFAULT*/, ObjectGuid kicker /*= 0*/, const char* reason /*= nullptr*/)
{
BroadcastGroupUpdate();
@@ -890,7 +888,7 @@ void Group::SendLootRoll(ObjectGuid playerGuid, int32 rollNumber, uint8 rollType
continue;
if (itr->second != NOT_VALID)
- p->GetSession()->SendPacket(lootRoll.GetRawPacket());
+ p->SendDirectMessage(lootRoll.GetRawPacket());
}
}
@@ -912,7 +910,7 @@ void Group::SendLootRollWon(ObjectGuid winnerGuid, int32 rollNumber, uint8 rollT
continue;
if (itr->second != NOT_VALID)
- p->GetSession()->SendPacket(lootRollWon.GetRawPacket());
+ p->SendDirectMessage(lootRollWon.GetRawPacket());
}
}
@@ -930,7 +928,7 @@ void Group::SendLootAllPassed(Roll const& roll) const
continue;
if (itr->second != NOT_VALID)
- player->GetSession()->SendPacket(lootAllPassed.GetRawPacket());
+ player->SendDirectMessage(lootAllPassed.GetRawPacket());
}
}
@@ -948,7 +946,7 @@ void Group::SendLootRollsComplete(Roll const& roll) const
continue;
if (itr->second != NOT_VALID)
- player->GetSession()->SendPacket(lootRollsComplete.GetRawPacket());
+ player->SendDirectMessage(lootRollsComplete.GetRawPacket());
}
}
@@ -1149,7 +1147,7 @@ void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject)
{
Player* looter = itr->GetSource();
if (looter->IsAtGroupRewardDistance(pLootedObject))
- looter->GetSession()->SendPacket(masterLootCandidateList.GetRawPacket());
+ looter->SendDirectMessage(masterLootCandidateList.GetRawPacket());
}
}
@@ -1231,7 +1229,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
ObjectGuid maxguid = ObjectGuid::Empty;
Player* player = nullptr;
- for (Roll::PlayerVote::const_iterator itr=roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr)
+ for (Roll::PlayerVote::const_iterator itr = roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr)
{
if (itr->second != NEED)
continue;
@@ -1527,7 +1525,7 @@ void Group::SendUpdateToPlayer(ObjectGuid playerGUID, MemberSlot* slot)
partyUpdate.LfgInfos->MyKickVoteCount = 0;
}
- player->GetSession()->SendPacket(partyUpdate.Write());
+ player->SendDirectMessage(partyUpdate.Write());
}
void Group::SendUpdateDestroyGroupToPlayer(Player* player) const
@@ -1539,7 +1537,7 @@ void Group::SendUpdateDestroyGroupToPlayer(Player* player) const
partyUpdate.PartyGUID = m_guid;
partyUpdate.MyIndex = -1;
partyUpdate.SequenceNum = player->NextGroupUpdateSequenceNumber(m_groupCategory);
- player->GetSession()->SendPacket(partyUpdate.Write());
+ player->SendDirectMessage(partyUpdate.Write());
}
void Group::UpdatePlayerOutOfRange(Player* player)
@@ -1555,7 +1553,7 @@ void Group::UpdatePlayerOutOfRange(Player* player)
{
member = itr->GetSource();
if (member && member != player && (!member->IsInMap(player) || !member->IsWithinDist(player, member->GetSightRange(), false)))
- member->GetSession()->SendPacket(packet.Write());
+ member->SendDirectMessage(packet.Write());
}
}
@@ -1567,10 +1565,8 @@ void Group::BroadcastAddonMessagePacket(WorldPacket const* packet, const std::st
if (!player || (!ignore.IsEmpty() && player->GetGUID() == ignore) || (ignorePlayersInBGRaid && player->GetGroup() != this))
continue;
- if (WorldSession* session = player->GetSession())
- if (session && (group == -1 || itr->getSubGroup() == group))
- if (session->IsAddonRegistered(prefix))
- session->SendPacket(packet);
+ if (player->GetSession()->IsAddonRegistered(prefix) && (group == -1 || itr->getSubGroup() == group))
+ player->SendDirectMessage(packet);
}
}
@@ -1582,8 +1578,8 @@ void Group::BroadcastPacket(WorldPacket const* packet, bool ignorePlayersInBGRai
if (!player || (!ignoredPlayer.IsEmpty() && player->GetGUID() == ignoredPlayer) || (ignorePlayersInBGRaid && player->GetGroup() != this))
continue;
- if (player->GetSession() && (group == -1 || itr->getSubGroup() == group))
- player->GetSession()->SendPacket(packet);
+ if (group == -1 || itr->getSubGroup() == group)
+ player->SendDirectMessage(packet);
}
}
@@ -2028,7 +2024,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, bool isLegacy, Player* Sen
for (auto itr = difficultyItr->second.begin(); itr != difficultyItr->second.end();)
{
InstanceSave* instanceSave = itr->second.save;
- const MapEntry* entry = sMapStore.LookupEntry(itr->first);
+ MapEntry const* entry = sMapStore.LookupEntry(itr->first);
if (!entry || entry->IsRaid() != isRaid || (!instanceSave->CanReset() && method != INSTANCE_RESET_GROUP_DISBAND))
{
++itr;
diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h
index 41f47f0f3e5..712b62537c4 100644
--- a/src/server/game/Groups/Group.h
+++ b/src/server/game/Groups/Group.h
@@ -252,7 +252,7 @@ class TC_GAME_API Group
void RemoveAllInvites();
bool AddLeaderInvite(Player* player);
bool AddMember(Player* player);
- bool RemoveMember(ObjectGuid guid, const RemoveMethod &method = GROUP_REMOVEMETHOD_DEFAULT, ObjectGuid kicker = ObjectGuid::Empty, const char* reason = nullptr);
+ bool RemoveMember(ObjectGuid guid, RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT, ObjectGuid kicker = ObjectGuid::Empty, const char* reason = nullptr);
void ChangeLeader(ObjectGuid guid, int8 partyIndex = 0);
static void ConvertLeaderInstancesToGroup(Player* player, Group* group, bool switchLeader);
void SetLootMethod(LootMethod method);
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index 0171aeb007a..e4c8c640833 100644
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -358,12 +358,12 @@ void Guild::RankInfo::SetBankTabSlotsAndRights(GuildBankRightsAndSlots rightsAnd
}
}
+// BankTab
Guild::BankTab::BankTab(ObjectGuid::LowType guildId, uint8 tabId) : m_guildId(guildId), m_tabId(tabId)
{
memset(m_items, 0, GUILD_BANK_MAX_SLOTS * sizeof(Item*));
}
-// BankTab
void Guild::BankTab::LoadFromDB(Field* fields)
{
m_name = fields[2].GetString();
@@ -508,6 +508,7 @@ void Guild::BankTab::SendText(Guild const* guild, WorldSession* session) const
}
}
+// Member
Guild::Member::Member(ObjectGuid::LowType guildId, ObjectGuid guid, uint8 rankId) :
m_guildId(guildId),
m_guid(guid),
@@ -529,7 +530,6 @@ Guild::Member::Member(ObjectGuid::LowType guildId, ObjectGuid guid, uint8 rankId
memset(m_bankWithdraw, 0, (GUILD_BANK_MAX_TABS) * sizeof(uint32));
}
-// Member
void Guild::Member::SetStats(Player* player)
{
m_name = player->GetName();
@@ -757,6 +757,7 @@ void EmblemInfo::SaveToDB(ObjectGuid::LowType guildId) const
CharacterDatabase.Execute(stmt);
}
+// MoveItemData
Guild::MoveItemData::MoveItemData(Guild* guild, Player* player, uint8 container, uint8 slotId) : m_pGuild(guild), m_pPlayer(player),
m_container(container), m_slotId(slotId), m_pItem(nullptr), m_pClonedItem(nullptr)
{
@@ -766,7 +767,6 @@ Guild::MoveItemData::~MoveItemData()
{
}
-// MoveItemData
bool Guild::MoveItemData::CheckItem(uint32& splitedAmount)
{
ASSERT(m_pItem);
@@ -1496,7 +1496,7 @@ void Guild::HandleSetInfo(WorldSession* session, std::string const& info)
}
}
-void Guild::HandleSetEmblem(WorldSession* session, const EmblemInfo& emblemInfo)
+void Guild::HandleSetEmblem(WorldSession* session, EmblemInfo const& emblemInfo)
{
Player* player = session->GetPlayer();
if (!_IsLeader(player))
@@ -1599,7 +1599,7 @@ void Guild::HandleSetMemberNote(WorldSession* session, std::string const& note,
}
}
-void Guild::HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string const& name, uint32 rights, uint32 moneyPerDay, const GuildBankRightsAndSlotsVec& rightsAndSlots)
+void Guild::HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string const& name, uint32 rights, uint32 moneyPerDay, GuildBankRightsAndSlotsVec const& rightsAndSlots)
{
// Only leader can modify ranks
if (!_IsLeader(session->GetPlayer()))
@@ -1730,7 +1730,7 @@ void Guild::HandleInviteMember(WorldSession* session, std::string const& name)
invite.OldGuildVirtualRealmAddress = GetVirtualRealmAddress();
}
- pInvitee->GetSession()->SendPacket(invite.Write());
+ pInvitee->SendDirectMessage(invite.Write());
TC_LOG_DEBUG("guild", "SMSG_GUILD_INVITE [%s]", pInvitee->GetName().c_str());
}
@@ -2592,7 +2592,7 @@ void Guild::BroadcastToGuild(WorldSession* session, bool officerOnly, std::strin
if (Player* player = itr->second->FindConnectedPlayer())
if (player->GetSession() && _HasRankRight(player, officerOnly ? GR_RIGHT_OFFCHATLISTEN : GR_RIGHT_GCHATLISTEN) &&
!player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUID()))
- player->GetSession()->SendPacket(data);
+ player->SendDirectMessage(data);
}
}
@@ -2608,7 +2608,7 @@ void Guild::BroadcastAddonToGuild(WorldSession* session, bool officerOnly, std::
if (player->GetSession() && _HasRankRight(player, officerOnly ? GR_RIGHT_OFFCHATLISTEN : GR_RIGHT_GCHATLISTEN) &&
!player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUID()) &&
player->GetSession()->IsAddonRegistered(prefix))
- player->GetSession()->SendPacket(data);
+ player->SendDirectMessage(data);
}
}
@@ -2617,14 +2617,14 @@ void Guild::BroadcastPacketToRank(WorldPacket const* packet, uint8 rankId) const
for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
if (itr->second->IsRank(rankId))
if (Player* player = itr->second->FindConnectedPlayer())
- player->GetSession()->SendPacket(packet);
+ player->SendDirectMessage(packet);
}
void Guild::BroadcastPacket(WorldPacket const* packet) const
{
for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
if (Player* player = itr->second->FindPlayer())
- player->GetSession()->SendPacket(packet);
+ player->SendDirectMessage(packet);
}
void Guild::BroadcastPacketIfTrackingAchievement(WorldPacket const* packet, uint32 criteriaId) const
@@ -2976,7 +2976,7 @@ bool Guild::_IsLeader(Player* player) const
{
if (player->GetGUID() == m_leaderGuid)
return true;
- if (const Member* member = GetMember(player->GetGUID()))
+ if (Member const* member = GetMember(player->GetGUID()))
return member->IsRank(GR_GUILDMASTER);
return false;
}
@@ -3049,21 +3049,21 @@ void Guild::_SetRankBankTabRightsAndSlots(uint8 rankId, GuildBankRightsAndSlots
inline std::string Guild::_GetRankName(uint8 rankId) const
{
- if (const RankInfo* rankInfo = GetRankInfo(rankId))
+ if (RankInfo const* rankInfo = GetRankInfo(rankId))
return rankInfo->GetName();
return "<unknown>";
}
inline uint32 Guild::_GetRankRights(uint8 rankId) const
{
- if (const RankInfo* rankInfo = GetRankInfo(rankId))
+ if (RankInfo const* rankInfo = GetRankInfo(rankId))
return rankInfo->GetRights();
return 0;
}
inline uint32 Guild::_GetRankBankMoneyPerDay(uint8 rankId) const
{
- if (const RankInfo* rankInfo = GetRankInfo(rankId))
+ if (RankInfo const* rankInfo = GetRankInfo(rankId))
return rankInfo->GetBankMoneyPerDay();
return 0;
}
@@ -3071,14 +3071,14 @@ inline uint32 Guild::_GetRankBankMoneyPerDay(uint8 rankId) const
inline int32 Guild::_GetRankBankTabSlotsPerDay(uint8 rankId, uint8 tabId) const
{
if (tabId < _GetPurchasedTabsSize())
- if (const RankInfo* rankInfo = GetRankInfo(rankId))
+ if (RankInfo const* rankInfo = GetRankInfo(rankId))
return rankInfo->GetBankTabSlotsPerDay(tabId);
return 0;
}
inline int8 Guild::_GetRankBankTabRights(uint8 rankId, uint8 tabId) const
{
- if (const RankInfo* rankInfo = GetRankInfo(rankId))
+ if (RankInfo const* rankInfo = GetRankInfo(rankId))
return rankInfo->GetBankTabRights(tabId);
return 0;
}
@@ -3126,7 +3126,7 @@ inline void Guild::_UpdateMemberWithdrawSlots(CharacterDatabaseTransaction& tran
inline bool Guild::_MemberHasTabRights(ObjectGuid guid, uint8 tabId, int32 rights) const
{
- if (const Member* member = GetMember(guid))
+ if (Member const* member = GetMember(guid))
{
// Leader always has full rights
if (member->IsRank(GR_GUILDMASTER) || m_leaderGuid == guid)
@@ -3170,7 +3170,7 @@ void Guild::_LogBankEvent(CharacterDatabaseTransaction& trans, GuildBankEventLog
inline Item* Guild::_GetItem(uint8 tabId, uint8 slotId) const
{
- if (const BankTab* tab = GetBankTab(tabId))
+ if (BankTab const* tab = GetBankTab(tabId))
return tab->GetItem(slotId);
return nullptr;
}
diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h
index c9112518656..20e6196d66e 100644
--- a/src/server/game/Guilds/Guild.h
+++ b/src/server/game/Guilds/Guild.h
@@ -738,7 +738,7 @@ class TC_GAME_API Guild
void HandleGetAchievementMembers(WorldSession* session, uint32 achievementId) const;
void HandleSetMOTD(WorldSession* session, std::string const& motd);
void HandleSetInfo(WorldSession* session, std::string const& info);
- void HandleSetEmblem(WorldSession* session, const EmblemInfo& emblemInfo);
+ void HandleSetEmblem(WorldSession* session, EmblemInfo const& emblemInfo);
void HandleSetNewGuildMaster(WorldSession* session, std::string const& name, bool isSelfPromote);
void HandleSetBankTabInfo(WorldSession* session, uint8 tabId, std::string const& name, std::string const& icon);
void HandleSetMemberNote(WorldSession* session, std::string const& note, ObjectGuid guid, bool isPublic);
diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp
index 95454d49f90..49d35cd452f 100644
--- a/src/server/game/Handlers/AuctionHouseHandler.cpp
+++ b/src/server/game/Handlers/AuctionHouseHandler.cpp
@@ -32,7 +32,6 @@
#include "Player.h"
#include "Util.h"
#include "World.h"
-#include "WorldPacket.h"
#include <sstream>
void WorldSession::HandleAuctionBrowseQuery(WorldPackets::AuctionHouse::AuctionBrowseQuery& browseQuery)
diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp
index fdd96a8369d..0ac44ad961e 100644
--- a/src/server/game/Handlers/BattleGroundHandler.cpp
+++ b/src/server/game/Handlers/BattleGroundHandler.cpp
@@ -168,7 +168,6 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPackets::Battleground::Batt
BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, nullptr, bgTypeId, bracketEntry, 0, false, isPremade, 0, 0);
-
uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId());
uint32 queueSlot = _player->AddBattlegroundQueueId(bgQueueTypeId);
diff --git a/src/server/game/Handlers/BattlefieldHandler.cpp b/src/server/game/Handlers/BattlefieldHandler.cpp
index a969451c335..82fd6a65ef1 100644
--- a/src/server/game/Handlers/BattlefieldHandler.cpp
+++ b/src/server/game/Handlers/BattlefieldHandler.cpp
@@ -15,17 +15,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ObjectAccessor.h"
-#include "ObjectMgr.h"
-#include "Opcodes.h"
-#include "Player.h"
-#include "WorldPacket.h"
#include "WorldSession.h"
-#include "Object.h"
-
#include "Battlefield.h"
#include "BattlefieldMgr.h"
#include "BattlefieldPackets.h"
+#include "Player.h"
/**
* @fn void WorldSession::SendBfInvitePlayerToWar(uint64 queueId, uint32 zoneId, uint32 acceptTime)
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index f35566d0b10..0a54c0c7d53 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -58,7 +58,6 @@
#include "Realm.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
-#include "SharedDefines.h"
#include "SocialMgr.h"
#include "SystemPackets.h"
#include "Util.h"
diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp
index 51fbcd05ab3..d5ca7ec9b04 100644
--- a/src/server/game/Handlers/GroupHandler.cpp
+++ b/src/server/game/Handlers/GroupHandler.cpp
@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "WorldSession.h"
#include "Common.h"
#include "DatabaseEnv.h"
#include "Group.h"
@@ -29,7 +30,6 @@
#include "Util.h"
#include "World.h"
#include "WorldPacket.h"
-#include "WorldSession.h"
class Aura;
@@ -132,7 +132,7 @@ void WorldSession::HandlePartyInviteOpcode(WorldPackets::Party::PartyInviteClien
// tell the player that they were invited but it failed as they were already in a group
WorldPackets::Party::PartyInvite partyInvite;
partyInvite.Initialize(invitingPlayer, packet.ProposedRoles, false);
- invitedPlayer->GetSession()->SendPacket(partyInvite.Write());
+ invitedPlayer->SendDirectMessage(partyInvite.Write());
}
return;
@@ -185,7 +185,7 @@ void WorldSession::HandlePartyInviteOpcode(WorldPackets::Party::PartyInviteClien
WorldPackets::Party::PartyInvite partyInvite;
partyInvite.Initialize(invitingPlayer, packet.ProposedRoles, true);
- invitedPlayer->GetSession()->SendPacket(partyInvite.Write());
+ invitedPlayer->SendDirectMessage(partyInvite.Write());
SendPartyResult(PARTY_OP_INVITE, invitedPlayer->GetName(), ERR_PARTY_RESULT_OK);
}
@@ -253,7 +253,7 @@ void WorldSession::HandlePartyInviteResponseOpcode(WorldPackets::Party::PartyInv
// report
WorldPackets::Party::GroupDecline decline(GetPlayer()->GetName());
- leader->GetSession()->SendPacket(decline.Write());
+ leader->SendDirectMessage(decline.Write());
}
}
diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp
index ad08a616293..ccfcf2222af 100644
--- a/src/server/game/Handlers/GuildHandler.cpp
+++ b/src/server/game/Handlers/GuildHandler.cpp
@@ -23,10 +23,8 @@
#include "GuildPackets.h"
#include "Log.h"
#include "ObjectMgr.h"
-#include "Opcodes.h"
#include "Player.h"
#include "World.h"
-#include "WorldPacket.h"
void WorldSession::HandleGuildQueryOpcode(WorldPackets::Guild::QueryGuildInfo& query)
{
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index 9eff5fce9b2..b6d32905be5 100644
--- a/src/server/game/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -15,7 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "WorldPacket.h"
+#include "WorldSession.h"
#include "BattlePetMgr.h"
#include "Common.h"
#include "Creature.h"
@@ -30,7 +30,6 @@
#include "Player.h"
#include "SpellMgr.h"
#include "World.h"
-#include "WorldSession.h"
void WorldSession::HandleSplitItemOpcode(WorldPackets::Item::SplitItem& splitItem)
{
@@ -903,7 +902,7 @@ void WorldSession::HandleWrapItem(WorldPackets::Item::WrapItem& packet)
{
// after save it will be impossible to remove the item from the queue
RemoveItemFromUpdateQueueOf(item, _player);
- item->SaveToDB(trans); // item gave inventory record unchanged and can be save standalone
+ item->SaveToDB(trans); // item gave inventory record unchanged and can be save standalone
}
CharacterDatabase.CommitTransaction(trans);
diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp
index ad09333c588..01ff03ce2c1 100644
--- a/src/server/game/Handlers/MiscHandler.cpp
+++ b/src/server/game/Handlers/MiscHandler.cpp
@@ -358,7 +358,7 @@ void WorldSession::HandleRequestCemeteryList(WorldPackets::Misc::RequestCemetery
uint32 team = _player->GetTeam();
std::vector<uint32> graveyardIds;
- auto range = sObjectMgr->GraveYardStore.equal_range(zoneId);
+ auto range = sObjectMgr->GraveyardStore.equal_range(zoneId);
for (auto it = range.first; it != range.second && graveyardIds.size() < 16; ++it) // client max
{
diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp
index f4df5db9fd6..4ef08588c07 100644
--- a/src/server/game/Handlers/NPCHandler.cpp
+++ b/src/server/game/Handlers/NPCHandler.cpp
@@ -299,7 +299,7 @@ void WorldSession::SendSpiritResurrect()
WorldLocation corpseLocation = _player->GetCorpseLocation();
if (_player->HasCorpse())
{
- corpseGrave = sObjectMgr->GetClosestGraveYard(corpseLocation, _player->GetTeam(), _player);
+ corpseGrave = sObjectMgr->GetClosestGraveyard(corpseLocation, _player->GetTeam(), _player);
}
// now can spawn bones
@@ -308,7 +308,7 @@ void WorldSession::SendSpiritResurrect()
// teleport to nearest from corpse graveyard, if different from nearest to player ghost
if (corpseGrave)
{
- WorldSafeLocsEntry const* ghostGrave = sObjectMgr->GetClosestGraveYard(*_player, _player->GetTeam(), _player);
+ WorldSafeLocsEntry const* ghostGrave = sObjectMgr->GetClosestGraveyard(*_player, _player->GetTeam(), _player);
if (corpseGrave != ghostGrave)
_player->TeleportTo(corpseGrave->Loc);
diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp
index 7c5be8d4a81..4db06b61727 100644
--- a/src/server/game/Handlers/PetHandler.cpp
+++ b/src/server/game/Handlers/PetHandler.cpp
@@ -440,7 +440,7 @@ void WorldSession::SendQueryPetNameResponse(ObjectGuid guid)
}
}
- _player->GetSession()->SendPacket(response.Write());
+ _player->SendDirectMessage(response.Write());
}
bool WorldSession::CheckStableMaster(ObjectGuid guid)
@@ -692,6 +692,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPackets::Spells::PetCastSpell&
spell->m_targets = targets;
SpellCastResult result = spell->CheckPetCast(nullptr);
+
if (result == SPELL_CAST_OK)
{
if (Creature* creature = caster->ToCreature())
diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp
index 8fe9e626f74..294f12c36df 100644
--- a/src/server/game/Handlers/PetitionsHandler.cpp
+++ b/src/server/game/Handlers/PetitionsHandler.cpp
@@ -276,7 +276,7 @@ void WorldSession::HandleSignPetition(WorldPackets::Petition::SignPetition& pack
// update for owner if online
if (Player* owner = ObjectAccessor::FindConnectedPlayer(ownerGuid))
- owner->GetSession()->SendPacket(signResult.GetRawPacket());
+ owner->SendDirectMessage(signResult.GetRawPacket());
return;
}
@@ -298,7 +298,7 @@ void WorldSession::HandleSignPetition(WorldPackets::Petition::SignPetition& pack
// update for owner if online
if (Player* owner = ObjectAccessor::FindConnectedPlayer(ownerGuid))
- owner->GetSession()->SendPacket(signResult.GetRawPacket());
+ owner->SendDirectMessage(signResult.GetRawPacket());
}
void WorldSession::HandleDeclinePetition(WorldPackets::Petition::DeclinePetition& packet)
@@ -316,7 +316,7 @@ void WorldSession::HandleDeclinePetition(WorldPackets::Petition::DeclinePetition
{
WorldPackets::Petition::PetitionDeclined packet;
packet.Decliner = _player->GetGUID();
- owner->GetSession()->SendPacket(packet.Write());
+ owner->SendDirectMessage(packet.Write());
}
*/
}
diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp
index 7df727bfec1..090a1d1e87f 100644
--- a/src/server/game/Handlers/QueryHandler.cpp
+++ b/src/server/game/Handlers/QueryHandler.cpp
@@ -30,7 +30,6 @@
#include "QueryPackets.h"
#include "Realm.h"
#include "World.h"
-#include "WorldPacket.h"
void WorldSession::SendNameQueryOpcode(ObjectGuid guid)
{
diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp
index 9f2044dab59..1963e618157 100644
--- a/src/server/game/Handlers/QuestHandler.cpp
+++ b/src/server/game/Handlers/QuestHandler.cpp
@@ -35,7 +35,6 @@
#include "ScriptMgr.h"
#include "UnitAI.h"
#include "World.h"
-#include "WorldPacket.h"
void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPackets::Quest::QuestGiverStatusQuery& packet)
{
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp
index 5be7223cb81..5ff33e97bf3 100644
--- a/src/server/game/Handlers/SpellHandler.cpp
+++ b/src/server/game/Handlers/SpellHandler.cpp
@@ -477,7 +477,7 @@ void WorldSession::HandleTotemDestroyed(WorldPackets::Totem::TotemDestroyed& tot
if (!_player->m_SummonSlot[slotId])
return;
- Creature* totem = ObjectAccessor::GetCreature(*GetPlayer(), _player->m_SummonSlot[slotId]);
+ Creature* totem = ObjectAccessor::GetCreature(*_player, _player->m_SummonSlot[slotId]);
if (totem && totem->IsTotem() && totem->GetGUID() == totemDestroyed.TotemGUID)
totem->ToTotem()->UnSummon();
}
diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp
index c34270c3836..52d5521a733 100644
--- a/src/server/game/Handlers/TaxiHandler.cpp
+++ b/src/server/game/Handlers/TaxiHandler.cpp
@@ -48,7 +48,7 @@ void WorldSession::SendTaxiStatus(ObjectGuid guid)
Creature* unit = ObjectAccessor::GetCreature(*player, guid);
if (!unit || unit->IsHostileTo(player) || !unit->HasNpcFlag(UNIT_NPC_FLAG_FLIGHTMASTER))
{
- TC_LOG_DEBUG("network", "WorldSession::SendTaxiStatus - %s not found.", guid.ToString().c_str());
+ TC_LOG_DEBUG("network", "WorldSession::SendTaxiStatus - %s not found or you can't interact with him.", guid.ToString().c_str());
return;
}
diff --git a/src/server/game/Handlers/TicketHandler.cpp b/src/server/game/Handlers/TicketHandler.cpp
index e784f09cd07..ef1332dc4a2 100644
--- a/src/server/game/Handlers/TicketHandler.cpp
+++ b/src/server/game/Handlers/TicketHandler.cpp
@@ -15,16 +15,14 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "WorldSession.h"
#include "Common.h"
#include "DatabaseEnv.h"
#include "ObjectMgr.h"
-#include "Opcodes.h"
#include "Player.h"
#include "SupportMgr.h"
#include "TicketPackets.h"
#include "Util.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
void WorldSession::HandleGMTicketGetCaseStatusOpcode(WorldPackets::Ticket::GMTicketGetCaseStatus& /*packet*/)
{
diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp
index 833edbc6f4b..c53c68ce681 100644
--- a/src/server/game/Handlers/TradeHandler.cpp
+++ b/src/server/game/Handlers/TradeHandler.cpp
@@ -198,7 +198,7 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item* *m
if (Item* item = myTrade->GetItem(TradeSlots(i)))
{
TC_LOG_DEBUG("network", "player trade %s bag: %u slot: %u", item->GetGUID().ToString().c_str(), item->GetBagSlot(), item->GetSlot());
- //Can return NULL
+ //Can return nullptr
myItems[i] = item;
myItems[i]->SetInTrade();
}
@@ -242,8 +242,8 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPackets::Trade::AcceptTrade& acc
if (!his_trade)
return;
- Item* myItems[TRADE_SLOT_TRADED_COUNT] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
- Item* hisItems[TRADE_SLOT_TRADED_COUNT] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
+ Item* myItems[TRADE_SLOT_TRADED_COUNT] = { };
+ Item* hisItems[TRADE_SLOT_TRADED_COUNT] = { };
// set before checks for propertly undo at problems (it already set in to client)
my_trade->SetAccepted(true);
diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp
index 0028b9f38a8..f7fa4c3ce2a 100644
--- a/src/server/game/Instances/InstanceSaveMgr.cpp
+++ b/src/server/game/Instances/InstanceSaveMgr.cpp
@@ -78,7 +78,7 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance
if (InstanceSave* old_save = GetInstanceSave(instanceId))
return old_save;
- const MapEntry* entry = sMapStore.LookupEntry(mapId);
+ MapEntry const* entry = sMapStore.LookupEntry(mapId);
if (!entry)
{
TC_LOG_ERROR("misc", "InstanceSaveManager::AddInstanceSave: wrong mapid = %d, instanceid = %d!", mapId, instanceId);
@@ -233,7 +233,7 @@ void InstanceSave::SaveToDB()
time_t InstanceSave::GetResetTimeForDB()
{
// only save the reset time for normal instances
- const MapEntry* entry = sMapStore.LookupEntry(GetMapId());
+ MapEntry const* entry = sMapStore.LookupEntry(GetMapId());
if (!entry || entry->IsRaid() || GetDifficultyID() == DIFFICULTY_HEROIC)
return 0;
else
diff --git a/src/server/game/Instances/InstanceSaveMgr.h b/src/server/game/Instances/InstanceSaveMgr.h
index f3bf10c81dd..ad8160612c5 100644
--- a/src/server/game/Instances/InstanceSaveMgr.h
+++ b/src/server/game/Instances/InstanceSaveMgr.h
@@ -177,7 +177,7 @@ class TC_GAME_API InstanceSaveManager
InstResetEvent() : type(0), difficulty(DIFFICULTY_NORMAL), mapid(0), instanceId(0) { }
InstResetEvent(uint8 t, uint32 _mapid, Difficulty d, uint32 _instanceid)
: type(t), difficulty(d), mapid(_mapid), instanceId(_instanceid) { }
- bool operator == (const InstResetEvent& e) const { return e.instanceId == instanceId; }
+ bool operator==(InstResetEvent const& e) const { return e.instanceId == instanceId; }
};
typedef std::multimap<time_t /*resetTime*/, InstResetEvent> ResetTimeQueue;
diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp
index 5caac91a946..ae969379cf5 100644
--- a/src/server/game/Instances/InstanceScript.cpp
+++ b/src/server/game/Instances/InstanceScript.cpp
@@ -29,7 +29,6 @@
#include "Log.h"
#include "Map.h"
#include "ObjectMgr.h"
-#include "Opcodes.h"
#include "Pet.h"
#include "PhasingHandler.h"
#include "Player.h"
@@ -141,14 +140,14 @@ void InstanceScript::SetHeaders(std::string const& dataHeaders)
headers.push_back(header);
}
-void InstanceScript::LoadBossBoundaries(const BossBoundaryData& data)
+void InstanceScript::LoadBossBoundaries(BossBoundaryData const& data)
{
for (BossBoundaryEntry const& entry : data)
if (entry.BossId < bosses.size())
bosses[entry.BossId].boundary.push_back(entry.Boundary);
}
-void InstanceScript::LoadMinionData(const MinionData* data)
+void InstanceScript::LoadMinionData(MinionData const* data)
{
while (data->entry)
{
@@ -160,7 +159,7 @@ void InstanceScript::LoadMinionData(const MinionData* data)
TC_LOG_DEBUG("scripts", "InstanceScript::LoadMinionData: " UI64FMTD " minions loaded.", uint64(minions.size()));
}
-void InstanceScript::LoadDoorData(const DoorData* data)
+void InstanceScript::LoadDoorData(DoorData const* data)
{
while (data->entry)
{
@@ -619,7 +618,7 @@ void InstanceScript::DoSendNotifyToInstance(char const* format, ...)
// Update Achievement Criteria for all players in instance
void InstanceScript::DoUpdateCriteria(CriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit* unit /*= nullptr*/)
{
- Map::PlayerList const &PlayerList = instance->GetPlayers();
+ Map::PlayerList const& PlayerList = instance->GetPlayers();
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
@@ -630,7 +629,7 @@ void InstanceScript::DoUpdateCriteria(CriteriaTypes type, uint32 miscValue1 /*=
// Start timed achievement for all players in instance
void InstanceScript::DoStartCriteriaTimer(CriteriaTimedTypes type, uint32 entry)
{
- Map::PlayerList const &PlayerList = instance->GetPlayers();
+ Map::PlayerList const& PlayerList = instance->GetPlayers();
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
@@ -641,7 +640,7 @@ void InstanceScript::DoStartCriteriaTimer(CriteriaTimedTypes type, uint32 entry)
// Stop timed achievement for all players in instance
void InstanceScript::DoStopCriteriaTimer(CriteriaTimedTypes type, uint32 entry)
{
- Map::PlayerList const &PlayerList = instance->GetPlayers();
+ Map::PlayerList const& PlayerList = instance->GetPlayers();
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
@@ -670,7 +669,7 @@ void InstanceScript::DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
// Cast spell on all players in instance
void InstanceScript::DoCastSpellOnPlayers(uint32 spell)
{
- Map::PlayerList const &PlayerList = instance->GetPlayers();
+ Map::PlayerList const& PlayerList = instance->GetPlayers();
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h
index 823996f2481..996eab16c20 100644
--- a/src/server/game/Instances/InstanceScript.h
+++ b/src/server/game/Instances/InstanceScript.h
@@ -20,10 +20,10 @@
#include "ZoneScript.h"
#include "Common.h"
+#include <iosfwd>
#include <map>
#include <memory>
#include <set>
-#include <sstream>
#define OUT_SAVE_INST_DATA TC_LOG_DEBUG("scripts", "Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
#define OUT_SAVE_INST_DATA_COMPLETE TC_LOG_DEBUG("scripts", "Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
@@ -233,7 +233,7 @@ class TC_GAME_API InstanceScript : public ZoneScript
void DoCastSpellOnPlayers(uint32 spell);
// Return wether server allow two side groups or not
- bool ServerAllowsTwoSideGroups();
+ static bool ServerAllowsTwoSideGroups();
virtual bool SetBossState(uint32 id, EncounterState state);
EncounterState GetBossState(uint32 id) const { return id < bosses.size() ? bosses[id].state : TO_BE_DECIDED; }
diff --git a/src/server/game/Loot/LootItemStorage.h b/src/server/game/Loot/LootItemStorage.h
index 7855559ce1e..3b242154865 100644
--- a/src/server/game/Loot/LootItemStorage.h
+++ b/src/server/game/Loot/LootItemStorage.h
@@ -18,8 +18,8 @@
#ifndef __LOOTITEMSTORAGE_H
#define __LOOTITEMSTORAGE_H
-#include "DatabaseEnvFwd.h"
#include "Define.h"
+#include "DatabaseEnvFwd.h"
#include "DBCEnums.h"
#include "ItemEnchantmentMgr.h"
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 4bb5e07fc90..672fc3a13c4 100644
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -103,14 +103,14 @@ class LootTemplate::LootGroup // A set of loot def
LootStoreItem const* Roll(Loot& loot, uint16 lootMode) const; // Rolls an item from the group, returns NULL if all miss their chances
// This class must never be copied - storing pointers
- LootGroup(LootGroup const&);
- LootGroup& operator=(LootGroup const&);
+ LootGroup(LootGroup const&) = delete;
+ LootGroup& operator=(LootGroup const&) = delete;
};
//Remove all data and free all memory
void LootStore::Clear()
{
- for (LootTemplateMap::const_iterator itr=m_LootTemplates.begin(); itr != m_LootTemplates.end(); ++itr)
+ for (LootTemplateMap::const_iterator itr = m_LootTemplates.begin(); itr != m_LootTemplates.end(); ++itr)
delete itr->second;
m_LootTemplates.clear();
}
@@ -271,7 +271,7 @@ void LootStore::ReportNonExistingId(uint32 lootId) const
TC_LOG_ERROR("sql.sql", "Table '%s' Entry %d does not exist", GetName(), lootId);
}
-void LootStore::ReportNonExistingId(uint32 lootId, const char* ownerType, uint32 ownerId) const
+void LootStore::ReportNonExistingId(uint32 lootId, char const* ownerType, uint32 ownerId) const
{
TC_LOG_ERROR("sql.sql", "Table '%s' Entry %d does not exist but it is used by %s %d", GetName(), lootId, ownerType, ownerId);
}
@@ -538,7 +538,7 @@ void LootTemplate::AddEntry(LootStoreItem* item)
Entries.push_back(item);
}
-void LootTemplate::CopyConditions(const ConditionContainer& conditions)
+void LootTemplate::CopyConditions(ConditionContainer const& conditions)
{
for (LootStoreItemList::iterator i = Entries.begin(); i != Entries.end(); ++i)
(*i)->conditions.clear();
@@ -1108,7 +1108,7 @@ void LoadLootTemplates_Spell()
{
// not report about not trainable spells (optionally supported by DB)
// ignore 61756 (Northrend Inscription Research (FAST QA VERSION) for example
- if (!spellInfo->HasAttribute(SPELL_ATTR0_NOT_SHAPESHIFT) || (spellInfo->HasAttribute(SPELL_ATTR0_TRADESPELL)))
+ if (!spellInfo->HasAttribute(SPELL_ATTR0_NOT_SHAPESHIFT) || spellInfo->HasAttribute(SPELL_ATTR0_TRADESPELL))
LootTemplates_Spell.ReportNonExistingId(spellInfo->Id, "Spell", spellInfo->Id);
}
else
diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h
index 0fa7b86198c..c531d085b37 100644
--- a/src/server/game/Loot/LootMgr.h
+++ b/src/server/game/Loot/LootMgr.h
@@ -75,7 +75,7 @@ class TC_GAME_API LootStore
void CheckLootRefs(LootIdSet* ref_set = nullptr) const; // check existence reference and remove it from ref_set
void ReportUnusedIds(LootIdSet const& ids_set) const;
void ReportNonExistingId(uint32 lootId) const;
- void ReportNonExistingId(uint32 lootId, const char* ownerType, uint32 ownerId) const;
+ void ReportNonExistingId(uint32 lootId, char const* ownerType, uint32 ownerId) const;
bool HaveLootFor(uint32 loot_id) const { return m_LootTemplates.find(loot_id) != m_LootTemplates.end(); }
bool HaveQuestLootFor(uint32 loot_id) const;
@@ -111,7 +111,7 @@ class TC_GAME_API LootTemplate
void AddEntry(LootStoreItem* item);
// Rolls for every item in the template and adds the rolled items the the loot
void Process(Loot& loot, bool rate, uint16 lootMode, uint8 groupId = 0) const;
- void CopyConditions(const ConditionContainer& conditions);
+ void CopyConditions(ConditionContainer const& conditions);
void CopyConditions(LootItem* li) const;
// True if template includes at least 1 quest drop entry
diff --git a/src/server/game/Mails/Mail.h b/src/server/game/Mails/Mail.h
index 6c86a51d484..dc9ea2828df 100644
--- a/src/server/game/Mails/Mail.h
+++ b/src/server/game/Mails/Mail.h
@@ -19,8 +19,8 @@
#define TRINITY_MAIL_H
#include "Common.h"
+#include "DatabaseEnvFwd.h"
#include "ObjectGuid.h"
-#include "Transaction.h"
#include <map>
struct CalendarEvent;
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index ea1040a4e9b..b96fb726d50 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -553,7 +553,7 @@ void Map::DeleteFromWorld(Transport* transport)
delete transport;
}
-void Map::EnsureGridCreated(const GridCoord &p)
+void Map::EnsureGridCreated(GridCoord const& p)
{
std::lock_guard<std::mutex> lock(_gridLock);
EnsureGridCreated_i(p);
@@ -561,7 +561,7 @@ void Map::EnsureGridCreated(const GridCoord &p)
//Create NGrid so the object can be added to it
//But object data is not loaded here
-void Map::EnsureGridCreated_i(const GridCoord &p)
+void Map::EnsureGridCreated_i(GridCoord const& p)
{
if (!getNGrid(p.x_coord, p.y_coord))
{
@@ -600,7 +600,7 @@ void Map::EnsureGridCreated_i(const GridCoord &p)
}
//Load NGrid and make it active
-void Map::EnsureGridLoadedForActiveObject(const Cell &cell, WorldObject* object)
+void Map::EnsureGridLoadedForActiveObject(Cell const& cell, WorldObject* object)
{
EnsureGridLoaded(cell);
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
@@ -616,7 +616,7 @@ void Map::EnsureGridLoadedForActiveObject(const Cell &cell, WorldObject* object)
}
//Create NGrid and load the object data in it
-bool Map::EnsureGridLoaded(const Cell &cell)
+bool Map::EnsureGridLoaded(Cell const& cell)
{
EnsureGridCreated(GridCoord(cell.GridX(), cell.GridY()));
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
@@ -804,7 +804,7 @@ bool Map::AddToMap(Transport* obj)
return true;
}
-bool Map::IsGridLoaded(const GridCoord &p) const
+bool Map::IsGridLoaded(GridCoord const& p) const
{
return (getNGrid(p.x_coord, p.y_coord) && isGridObjectDataLoaded(p.x_coord, p.y_coord));
}
@@ -2051,7 +2051,7 @@ GridMap::~GridMap()
unloadData();
}
-GridMap::LoadResult GridMap::loadData(const char* filename)
+GridMap::LoadResult GridMap::loadData(char const* filename)
{
// Unload old data if exist
unloadData();
@@ -3183,7 +3183,7 @@ void Map::SendInitSelf(Player* player)
WorldPacket packet;
data.BuildPacket(&packet);
- player->GetSession()->SendPacket(&packet);
+ player->SendDirectMessage(&packet);
}
void Map::SendInitTransports(Player* player)
@@ -3201,7 +3201,7 @@ void Map::SendInitTransports(Player* player)
WorldPacket packet;
transData.BuildPacket(&packet);
- player->GetSession()->SendPacket(&packet);
+ player->SendDirectMessage(&packet);
}
void Map::SendRemoveTransports(Player* player)
@@ -3219,7 +3219,7 @@ void Map::SendRemoveTransports(Player* player)
WorldPacket packet;
transData.BuildPacket(&packet);
- player->GetSession()->SendPacket(&packet);
+ player->SendDirectMessage(&packet);
}
void Map::SendUpdateTransportVisibility(Player* player)
@@ -3275,7 +3275,7 @@ void Map::SendObjectUpdates()
for (UpdateDataMapType::iterator iter = update_players.begin(); iter != update_players.end(); ++iter)
{
iter->second.BuildPacket(&packet);
- iter->first->GetSession()->SendPacket(&packet);
+ iter->first->SendDirectMessage(&packet);
packet.clear(); // clean the string
}
}
@@ -3890,7 +3890,7 @@ uint32 Map::GetPlayersCountExceptGMs() const
void Map::SendToPlayers(WorldPacket const* data) const
{
for (MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
- itr->GetSource()->GetSession()->SendPacket(data);
+ itr->GetSource()->SendDirectMessage(data);
}
bool Map::ActiveObjectsNearGrid(NGridType const& ngrid) const
@@ -4158,7 +4158,7 @@ bool InstanceMap::AddPlayerToMap(Player* player, bool initPlayer /*= true*/)
pendingRaidLock.CompletedMask = i_data ? i_data->GetCompletedEncounterMask() : 0;
pendingRaidLock.Extending = false;
pendingRaidLock.WarningOnly = false; // events it throws: 1 : INSTANCE_LOCK_WARNING 0 : INSTANCE_LOCK_STOP / INSTANCE_LOCK_START
- player->GetSession()->SendPacket(pendingRaidLock.Write());
+ player->SendDirectMessage(pendingRaidLock.Write());
player->SetPendingBind(mapSave->GetInstanceId(), 60000);
}
}
@@ -4364,7 +4364,7 @@ void InstanceMap::PermBindAllPlayers()
player->BindToInstance(save, true);
WorldPackets::Instance::InstanceSaveCreated data;
data.Gm = player->IsGameMaster();
- player->GetSession()->SendPacket(data.Write());
+ player->SendDirectMessage(data.Write());
player->GetSession()->SendCalendarRaidLockout(save, true);
// if group leader is in instance, group also gets bound
@@ -5090,10 +5090,14 @@ void Map::UpdateAreaDependentAuras()
{
Map::PlayerList const& players = GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
+ {
if (Player* player = itr->GetSource())
+ {
if (player->IsInWorld())
{
player->UpdateAreaDependentAuras(player->GetAreaId());
player->UpdateZoneDependentAuras(player->GetZoneId());
}
+ }
+ }
}
diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h
index d646a3bf023..4288037297e 100644
--- a/src/server/game/Maps/Map.h
+++ b/src/server/game/Maps/Map.h
@@ -248,7 +248,7 @@ public:
InvalidFile
};
- LoadResult loadData(const char* filename);
+ LoadResult loadData(char const* filename);
void unloadData();
uint16 getArea(float x, float y) const;
@@ -360,7 +360,7 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
void AreaTriggerRelocation(AreaTrigger* at, float x, float y, float z, float orientation);
template<class T, class CONTAINER>
- void Visit(const Cell& cell, TypeContainerVisitor<T, CONTAINER> &visitor);
+ void Visit(Cell const& cell, TypeContainerVisitor<T, CONTAINER>& visitor);
bool IsRemovalGrid(float x, float y) const
{
@@ -373,8 +373,8 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
bool IsGridLoaded(float x, float y) const { return IsGridLoaded(Trinity::ComputeGridCoord(x, y)); }
bool IsGridLoaded(Position const& pos) const { return IsGridLoaded(pos.GetPositionX(), pos.GetPositionY()); }
- bool GetUnloadLock(const GridCoord &p) const { return getNGrid(p.x_coord, p.y_coord)->getUnloadLock(); }
- void SetUnloadLock(const GridCoord &p, bool on) { getNGrid(p.x_coord, p.y_coord)->setUnloadExplicitLock(on); }
+ bool GetUnloadLock(GridCoord const& p) const { return getNGrid(p.x_coord, p.y_coord)->getUnloadLock(); }
+ void SetUnloadLock(GridCoord const& p, bool on) { getNGrid(p.x_coord, p.y_coord)->setUnloadExplicitLock(on); }
void LoadGrid(float x, float y);
void LoadAllCells();
bool UnloadGrid(NGridType& ngrid, bool pForce);
@@ -453,7 +453,7 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
CANNOT_ENTER_UNSPECIFIED_REASON
};
virtual EnterState CannotEnter(Player* /*player*/) { return CAN_ENTER; }
- const char* GetMapName() const;
+ char const* GetMapName() const;
// have meaning only for instanced map (that have set real difficulty)
Difficulty GetDifficultyID() const { return Difficulty(i_spawnMode); }
@@ -472,11 +472,11 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
bool IsBattleArena() const;
bool IsBattlegroundOrArena() const;
bool IsGarrison() const;
- bool GetEntrancePos(int32 &mapid, float &x, float &y);
+ bool GetEntrancePos(int32& mapid, float& x, float& y);
void AddObjectToRemoveList(WorldObject* obj);
void AddObjectToSwitchList(WorldObject* obj, bool on);
- virtual void DelayedUpdate(const uint32 diff);
+ virtual void DelayedUpdate(uint32 diff);
void resetMarkedCells() { marked_cells.reset(); }
bool isCellMarked(uint32 pCellId) { return marked_cells.test(pCellId); }
@@ -571,9 +571,9 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
float GetHeight(PhaseShift const& phaseShift, Position const& pos, bool vmap = true, float maxSearchDist = DEFAULT_HEIGHT_SEARCH) { return GetHeight(phaseShift, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), vmap, maxSearchDist); }
bool isInLineOfSight(PhaseShift const& phaseShift, float x1, float y1, float z1, float x2, float y2, float z2, LineOfSightChecks checks, VMAP::ModelIgnoreFlags ignoreFlags) const;
void Balance() { _dynamicTree.balance(); }
- void RemoveGameObjectModel(const GameObjectModel& model) { _dynamicTree.remove(model); }
- void InsertGameObjectModel(const GameObjectModel& model) { _dynamicTree.insert(model); }
- bool ContainsGameObjectModel(const GameObjectModel& model) const { return _dynamicTree.contains(model);}
+ void RemoveGameObjectModel(GameObjectModel const& model) { _dynamicTree.remove(model); }
+ void InsertGameObjectModel(GameObjectModel const& model) { _dynamicTree.insert(model); }
+ bool ContainsGameObjectModel(GameObjectModel const& model) const { return _dynamicTree.contains(model);}
float GetGameObjectFloor(PhaseShift const& phaseShift, float x, float y, float z, float maxSearchDist = DEFAULT_HEIGHT_SEARCH) const
{
return _dynamicTree.getHeight(x, y, z, maxSearchDist, phaseShift);
@@ -687,9 +687,9 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
bool _areaTriggersToMoveLock;
std::vector<AreaTrigger*> _areaTriggersToMove;
- bool IsGridLoaded(const GridCoord &) const;
- void EnsureGridCreated(const GridCoord &);
- void EnsureGridCreated_i(const GridCoord &);
+ bool IsGridLoaded(GridCoord const&) const;
+ void EnsureGridCreated(GridCoord const&);
+ void EnsureGridCreated_i(GridCoord const&);
bool EnsureGridLoaded(Cell const&);
void EnsureGridLoadedForActiveObject(Cell const&, WorldObject* object);
@@ -737,13 +737,13 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
TransportsContainer::iterator _transportsUpdateIter;
private:
- Player* _GetScriptPlayerSourceOrTarget(Object* source, Object* target, const ScriptInfo* scriptInfo) const;
- Creature* _GetScriptCreatureSourceOrTarget(Object* source, Object* target, const ScriptInfo* scriptInfo, bool bReverse = false) const;
- Unit* _GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const;
- Player* _GetScriptPlayer(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const;
- Creature* _GetScriptCreature(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const;
- WorldObject* _GetScriptWorldObject(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const;
- void _ScriptProcessDoor(Object* source, Object* target, const ScriptInfo* scriptInfo) const;
+ Player* _GetScriptPlayerSourceOrTarget(Object* source, Object* target, ScriptInfo const* scriptInfo) const;
+ Creature* _GetScriptCreatureSourceOrTarget(Object* source, Object* target, ScriptInfo const* scriptInfo, bool bReverse = false) const;
+ Unit* _GetScriptUnit(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const;
+ Player* _GetScriptPlayer(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const;
+ Creature* _GetScriptCreature(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const;
+ WorldObject* _GetScriptWorldObject(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const;
+ void _ScriptProcessDoor(Object* source, Object* target, ScriptInfo const* scriptInfo) const;
GameObject* _FindGameObject(WorldObject* pWorldObject, ObjectGuid::LowType guid) const;
time_t i_gridExpiry;
diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp
index d81267144e4..1aa047b9f37 100644
--- a/src/server/game/Maps/MapInstanced.cpp
+++ b/src/server/game/Maps/MapInstanced.cpp
@@ -45,7 +45,7 @@ void MapInstanced::InitVisibilityDistance()
}
}
-void MapInstanced::Update(const uint32 t)
+void MapInstanced::Update(uint32 t)
{
// take care of loaded GridMaps (when unused, unload it!)
Map::Update(t);
@@ -74,7 +74,7 @@ void MapInstanced::Update(const uint32 t)
}
}
-void MapInstanced::DelayedUpdate(const uint32 diff)
+void MapInstanced::DelayedUpdate(uint32 diff)
{
for (InstancedMaps::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); ++i)
i->second->DelayedUpdate(diff);
@@ -111,7 +111,7 @@ void MapInstanced::UnloadAll()
- create the instance if it's not created already
- the player is not actually added to the instance (only in InstanceMap::Add)
*/
-Map* MapInstanced::CreateInstanceForPlayer(const uint32 mapId, Player* player, uint32 loginInstanceId)
+Map* MapInstanced::CreateInstanceForPlayer(uint32 mapId, Player* player, uint32 loginInstanceId /*= 0*/)
{
if (GetId() != mapId || !player)
return nullptr;
@@ -211,13 +211,13 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save,
std::lock_guard<std::mutex> lock(_mapLock);
// make sure we have a valid map id
- const MapEntry* entry = sMapStore.LookupEntry(GetId());
+ MapEntry const* entry = sMapStore.LookupEntry(GetId());
if (!entry)
{
TC_LOG_ERROR("maps", "CreateInstance: no entry for map %d", GetId());
ABORT();
}
- const InstanceTemplate* iTemplate = sObjectMgr->GetInstanceTemplate(GetId());
+ InstanceTemplate const* iTemplate = sObjectMgr->GetInstanceTemplate(GetId());
if (!iTemplate)
{
TC_LOG_ERROR("maps", "CreateInstance: no instance template for map %d", GetId());
diff --git a/src/server/game/Maps/MapInstanced.h b/src/server/game/Maps/MapInstanced.h
index e2908625ba3..e6aaefe7c18 100644
--- a/src/server/game/Maps/MapInstanced.h
+++ b/src/server/game/Maps/MapInstanced.h
@@ -34,13 +34,13 @@ class TC_GAME_API MapInstanced : public Map
~MapInstanced() { }
// functions overwrite Map versions
- void Update(const uint32) override;
- void DelayedUpdate(const uint32 diff) override;
+ void Update(uint32 diff) override;
+ void DelayedUpdate(uint32 diff) override;
//void RelocationNotify();
void UnloadAll() override;
EnterState CannotEnter(Player* /*player*/) override;
- Map* CreateInstanceForPlayer(const uint32 mapId, Player* player, uint32 loginInstanceId=0);
+ Map* CreateInstanceForPlayer(uint32 mapId, Player* player, uint32 loginInstanceId = 0);
Map* FindInstanceMap(uint32 instanceId) const
{
InstancedMaps::const_iterator i = m_InstancedMaps.find(instanceId);
diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h
index 9ff42ff557f..d74e87dd32c 100644
--- a/src/server/game/Maps/MapManager.h
+++ b/src/server/game/Maps/MapManager.h
@@ -82,7 +82,7 @@ class TC_GAME_API MapManager
i_timer.Reset();
}
- //void LoadGrid(int mapid, int instId, float x, float y, const WorldObject* obj, bool no_unload = false);
+ //void LoadGrid(int mapid, int instId, float x, float y, WorldObject const* obj, bool no_unload = false);
void UnloadAll();
static bool ExistMapAndVMap(uint32 mapid, float x, float y);
diff --git a/src/server/game/Maps/MapScripts.cpp b/src/server/game/Maps/MapScripts.cpp
index 9a86dfaedbe..5118e160932 100644
--- a/src/server/game/Maps/MapScripts.cpp
+++ b/src/server/game/Maps/MapScripts.cpp
@@ -100,7 +100,7 @@ void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* sou
}
// Helpers for ScriptProcess method.
-inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* target, const ScriptInfo* scriptInfo) const
+inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* target, ScriptInfo const* scriptInfo) const
{
Player* player = nullptr;
if (!source && !target)
@@ -122,7 +122,7 @@ inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* targe
return player;
}
-inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* target, const ScriptInfo* scriptInfo, bool bReverse) const
+inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* target, ScriptInfo const* scriptInfo, bool bReverse) const
{
Creature* creature = nullptr;
if (!source && !target)
@@ -155,7 +155,7 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t
return creature;
}
-inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
+inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const
{
Unit* unit = nullptr;
if (!obj)
@@ -175,7 +175,7 @@ inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* s
return unit;
}
-inline Player* Map::_GetScriptPlayer(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
+inline Player* Map::_GetScriptPlayer(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const
{
Player* player = nullptr;
if (!obj)
@@ -192,7 +192,7 @@ inline Player* Map::_GetScriptPlayer(Object* obj, bool isSource, const ScriptInf
return player;
}
-inline Creature* Map::_GetScriptCreature(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
+inline Creature* Map::_GetScriptCreature(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const
{
Creature* creature = nullptr;
if (!obj)
@@ -209,7 +209,7 @@ inline Creature* Map::_GetScriptCreature(Object* obj, bool isSource, const Scrip
return creature;
}
-inline WorldObject* Map::_GetScriptWorldObject(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
+inline WorldObject* Map::_GetScriptWorldObject(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const
{
WorldObject* pWorldObject = nullptr;
if (!obj)
@@ -227,7 +227,7 @@ inline WorldObject* Map::_GetScriptWorldObject(Object* obj, bool isSource, const
return pWorldObject;
}
-inline void Map::_ScriptProcessDoor(Object* source, Object* target, const ScriptInfo* scriptInfo) const
+inline void Map::_ScriptProcessDoor(Object* source, Object* target, ScriptInfo const* scriptInfo) const
{
bool bOpen = false;
ObjectGuid::LowType guid = scriptInfo->ToggleDoor.GOGuid;
diff --git a/src/server/game/Maps/TransportMgr.h b/src/server/game/Maps/TransportMgr.h
index ba9ffcc77e1..ef381d125a2 100644
--- a/src/server/game/Maps/TransportMgr.h
+++ b/src/server/game/Maps/TransportMgr.h
@@ -30,7 +30,7 @@ class Map;
namespace Movement
{
- template<typename length_type> class Spline;
+ template <typename length_type> class Spline;
}
typedef Movement::Spline<double> TransportSpline;
diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h
index 89852399e65..c49dc93d86a 100644
--- a/src/server/game/Miscellaneous/Formulas.h
+++ b/src/server/game/Miscellaneous/Formulas.h
@@ -198,7 +198,7 @@ namespace Trinity
xpMod *= isBattleGround ? sWorld->getRate(RATE_XP_BG_KILL) : sWorld->getRate(RATE_XP_KILL);
if (creature && creature->m_PlayerDamageReq) // if players dealt less than 50% of the damage and were credited anyway (due to CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ), scale XP gained appropriately (linear scaling)
- xpMod *= 1.0f - 2.0f*creature->m_PlayerDamageReq / creature->GetMaxHealth();
+ xpMod *= 1.0f - 2.0f * creature->m_PlayerDamageReq / creature->GetMaxHealth();
gain = uint32(gain * xpMod);
}
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index 068746b7e35..9c87ab14765 100644
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -5101,7 +5101,7 @@ enum BattlegroundTeamId : uint8
#define BG_TEAMS_COUNT 2
-// indexes of BattlemasterList.dbc (7.1.5.23360)
+// indexes of BattlemasterList.dbc
enum BattlegroundTypeId : uint32
{
BATTLEGROUND_TYPE_NONE = 0, // None
diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
index 0432241432d..d3cdffb462f 100755
--- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
@@ -15,13 +15,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ConfusedMovementGenerator.h"
#include "Creature.h"
-#include "Player.h"
-#include "PathGenerator.h"
-#include "MoveSplineInit.h"
#include "MoveSpline.h"
+#include "MoveSplineInit.h"
+#include "PathGenerator.h"
+#include "Player.h"
#include "Random.h"
-#include "ConfusedMovementGenerator.h"
template<class T>
ConfusedMovementGenerator<T>::~ConfusedMovementGenerator()
diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
index 041961ce91c..191877289c8 100644
--- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
@@ -15,12 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "HomeMovementGenerator.h"
#include "Creature.h"
#include "CreatureAI.h"
-#include "MoveSplineInit.h"
#include "MoveSpline.h"
+#include "MoveSplineInit.h"
#include "PathGenerator.h"
-#include "HomeMovementGenerator.h"
template<class T>
HomeMovementGenerator<T>::~HomeMovementGenerator() { }
diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
index 18f552cc1cd..4f5bcbc6e17 100644
--- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
@@ -30,7 +30,7 @@ template<class T>
class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementGenerator<T> >
{
public:
-explicit PointMovementGenerator(uint32 id, float x, float y, float z, bool generatePath, float speed = 0.0f, Unit const* faceTarget = nullptr, Movement::SpellEffectExtraData const* spellEffectExtraData = nullptr) : _movementId(id), _destination(x, y, z), _speed(speed), i_faceTarget(faceTarget), i_spellEffectExtra(spellEffectExtraData), _generatePath(generatePath), _recalculateSpeed(false), _interrupt(false) { }
+ explicit PointMovementGenerator(uint32 id, float x, float y, float z, bool generatePath, float speed = 0.0f, Unit const* faceTarget = nullptr, Movement::SpellEffectExtraData const* spellEffectExtraData = nullptr) : _movementId(id), _destination(x, y, z), _speed(speed), i_faceTarget(faceTarget), i_spellEffectExtra(spellEffectExtraData), _generatePath(generatePath), _recalculateSpeed(false), _interrupt(false) { }
MovementGeneratorType GetMovementGeneratorType() const override { return POINT_MOTION_TYPE; }
@@ -57,7 +57,7 @@ explicit PointMovementGenerator(uint32 id, float x, float y, float z, bool gener
class AssistanceMovementGenerator : public PointMovementGenerator<Creature>
{
public:
- explicit AssistanceMovementGenerator(float _x, float _y, float _z) : PointMovementGenerator<Creature>(0, _x, _y, _z, true) { }
+ AssistanceMovementGenerator(float x, float y, float z) : PointMovementGenerator<Creature>(0, x, y, z, true) { }
MovementGeneratorType GetMovementGeneratorType() const override { return ASSISTANCE_MOTION_TYPE; }
void Finalize(Unit*) override;
diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
index ca95243d507..48f1c00c616 100644
--- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
@@ -15,13 +15,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "RandomMovementGenerator.h"
#include "Creature.h"
#include "Map.h"
#include "MoveSplineInit.h"
#include "MoveSpline.h"
#include "PathGenerator.h"
#include "Random.h"
-#include "RandomMovementGenerator.h"
template<class T>
RandomMovementGenerator<T>::~RandomMovementGenerator() { }
@@ -42,7 +42,7 @@ void RandomMovementGenerator<Creature>::DoInitialize(Creature* owner)
return;
owner->AddUnitState(UNIT_STATE_ROAMING);
- owner->GetPosition(_reference.m_positionX, _reference.m_positionY, _reference.m_positionZ);
+ _reference = owner->GetPosition();
owner->StopMoving();
if (!_wanderDistance)
diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
index a615bec49bc..c0716f4c247 100644
--- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
@@ -25,7 +25,7 @@ template<class T>
class RandomMovementGenerator : public MovementGeneratorMedium< T, RandomMovementGenerator<T> >
{
public:
- explicit RandomMovementGenerator(float distance = 0.0f) : _path(nullptr), _timer(0), _reference(0.f, 0.f, 0.f), _wanderDistance(distance), _interrupt(false) { }
+ explicit RandomMovementGenerator(float distance = 0.0f) : _path(nullptr), _timer(0), _reference(), _wanderDistance(distance), _interrupt(false) { }
~RandomMovementGenerator();
MovementGeneratorType GetMovementGeneratorType() const override { return RANDOM_MOTION_TYPE; }
diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
index 5c8eb721e18..a2e954ad225 100755
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
@@ -15,15 +15,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "CreatureAI.h"
+#include "TargetedMovementGenerator.h"
#include "Creature.h"
-#include "Player.h"
-#include "VehicleDefines.h"
-#include "MoveSplineInit.h"
+#include "CreatureAI.h"
#include "MoveSpline.h"
+#include "MoveSplineInit.h"
#include "PathGenerator.h"
+#include "Player.h"
+#include "VehicleDefines.h"
#include "World.h"
-#include "TargetedMovementGenerator.h"
template<class T, typename D>
TargetedMovementGenerator<T, D>::~TargetedMovementGenerator()
diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
index b944913a74d..4c5d6cba197 100755
--- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
@@ -136,4 +136,5 @@ class FlightPathMovementGenerator : public MovementGeneratorMedium<Player, Fligh
std::deque<TaxiNodeChangeInfo> _pointsForPathSwitch; //! node indexes and costs where TaxiPath changes
};
+
#endif
diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp
index 66af5f9e55a..25ea5638f08 100644
--- a/src/server/game/Movement/PathGenerator.cpp
+++ b/src/server/game/Movement/PathGenerator.cpp
@@ -1,19 +1,18 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "PathGenerator.h"
@@ -29,7 +28,7 @@
#include "PhasingHandler.h"
////////////////// PathGenerator //////////////////
-PathGenerator::PathGenerator(const Unit* owner) :
+PathGenerator::PathGenerator(Unit const* owner) :
_polyLength(0), _type(PATHFIND_BLANK), _useStraightPath(false),
_forceDestination(false), _pointPathLimit(MAX_POINT_PATH_LENGTH), _straightLine(false),
_endPosition(G3D::Vector3::zero()), _sourceUnit(owner), _navMesh(nullptr),
@@ -886,7 +885,7 @@ dtStatus PathGenerator::FindSmoothPath(float const* startPos, float const* endPo
return nsmoothPath < MAX_POINT_PATH_LENGTH ? DT_SUCCESS : DT_FAILURE;
}
-bool PathGenerator::InRangeYZX(const float* v1, const float* v2, float r, float h) const
+bool PathGenerator::InRangeYZX(float const* v1, float const* v2, float r, float h) const
{
const float dx = v2[0] - v1[0];
const float dy = v2[1] - v1[1]; // elevation
diff --git a/src/server/game/Movement/PathGenerator.h b/src/server/game/Movement/PathGenerator.h
index cc554d73c0a..8109579dfbc 100644
--- a/src/server/game/Movement/PathGenerator.h
+++ b/src/server/game/Movement/PathGenerator.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _PATH_GENERATOR_H
diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp
index c125d9db689..4d72d506549 100644
--- a/src/server/game/Movement/Spline/MoveSpline.cpp
+++ b/src/server/game/Movement/Spline/MoveSpline.cpp
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "MoveSpline.h"
@@ -144,9 +144,9 @@ struct CommonInitializer
}
};
-void MoveSpline::init_spline(const MoveSplineInitArgs& args)
+void MoveSpline::init_spline(MoveSplineInitArgs const& args)
{
- const SplineBase::EvaluationMode modes[2] = {SplineBase::ModeLinear, SplineBase::ModeCatmullrom};
+ static SplineBase::EvaluationMode const modes[2] = { SplineBase::ModeLinear, SplineBase::ModeCatmullrom };
if (args.flags.cyclic)
{
uint32 cyclic_point = 0;
@@ -156,9 +156,7 @@ void MoveSpline::init_spline(const MoveSplineInitArgs& args)
spline.init_cyclic_spline(&args.path[0], args.path.size(), modes[args.flags.isSmooth()], cyclic_point);
}
else
- {
spline.init_spline(&args.path[0], args.path.size(), modes[args.flags.isSmooth()]);
- }
// init spline timestamps
if (splineflags.falling)
diff --git a/src/server/game/Movement/Spline/MoveSpline.h b/src/server/game/Movement/Spline/MoveSpline.h
index ac0b808c82e..0bc025fc5f0 100644
--- a/src/server/game/Movement/Spline/MoveSpline.h
+++ b/src/server/game/Movement/Spline/MoveSpline.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYSERVER_MOVEPLINE_H
@@ -37,8 +37,8 @@ namespace Movement
{
Location() : orientation(0) { }
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) { }
+ Location(Vector3 const& v) : Vector3(v), orientation(0) { }
+ Location(Vector3 const& v, float o) : Vector3(v), orientation(o) { }
float orientation;
};
@@ -82,7 +82,7 @@ namespace Movement
int32 point_Idx_offset;
Optional<SpellEffectExtraData> spell_effect_extra;
- void init_spline(const MoveSplineInitArgs& args);
+ void init_spline(MoveSplineInitArgs const& args);
protected:
MySpline::ControlArray const& getPath() const { return spline.getPoints(); }
@@ -104,7 +104,7 @@ namespace Movement
void _Interrupt() { splineflags.done = true; }
public:
- void Initialize(const MoveSplineInitArgs&);
+ void Initialize(MoveSplineInitArgs const&);
bool Initialized() const { return !spline.empty(); }
MoveSpline();
diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h
index 10f0fb8648e..2f80d1d509c 100644
--- a/src/server/game/Movement/Spline/MoveSplineFlag.h
+++ b/src/server/game/Movement/Spline/MoveSplineFlag.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYSERVER_MOVESPLINEFLAG_H
@@ -71,7 +71,7 @@ namespace Movement
};
inline uint32& raw() { return (uint32&)*this; }
- inline const uint32& raw() const { return (const uint32&)*this; }
+ inline uint32 const& raw() const { return (uint32 const&)*this; }
MoveSplineFlag() { raw() = 0; }
MoveSplineFlag(uint32 f) { raw() = f; }
diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp
index 8740500dac5..a5d6a7c86f3 100644
--- a/src/server/game/Movement/Spline/MoveSplineInit.cpp
+++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "MoveSplineInit.h"
@@ -222,7 +222,7 @@ namespace Movement
args.facing.type = MONSTER_MOVE_FACING_ANGLE;
}
- void MoveSplineInit::MovebyPath(const PointsArray& controls, int32 path_offset)
+ void MoveSplineInit::MovebyPath(PointsArray const& controls, int32 path_offset)
{
args.path_Idx_offset = path_offset;
args.path.reserve(controls.size());
@@ -234,7 +234,7 @@ namespace Movement
MoveTo(G3D::Vector3(x, y, z), generatePath, forceDestination);
}
- void MoveSplineInit::MoveTo(const Vector3& dest, bool generatePath, bool forceDestination)
+ void MoveSplineInit::MoveTo(Vector3 const& dest, bool generatePath, bool forceDestination)
{
if (generatePath)
{
diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h
index 05a64ef7a62..62678e2be91 100644
--- a/src/server/game/Movement/Spline/MoveSplineInit.h
+++ b/src/server/game/Movement/Spline/MoveSplineInit.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYSERVER_MOVESPLINEINIT_H
@@ -87,11 +87,11 @@ namespace Movement
* @param path - array of points, shouldn't be empty
* @param pointId - Id of fisrt point of the path. Example: when third path point will be done it will notify that pointId + 3 done
*/
- void MovebyPath(const PointsArray& path, int32 pointId = 0);
+ void MovebyPath(PointsArray const& path, int32 pointId = 0);
/* Initializes simple A to B motion, A is current unit's position, B is destination
*/
- void MoveTo(const Vector3& destination, bool generatePath = true, bool forceDestination = false);
+ void MoveTo(Vector3 const& destination, bool generatePath = true, bool forceDestination = false);
void MoveTo(float x, float y, float z, bool generatePath = true, bool forceDestination = false);
/* Sets Id of fisrt point of the path. When N-th path point will be done ILisener will notify that pointId + N done
diff --git a/src/server/game/Movement/Spline/MoveSplineInitArgs.h b/src/server/game/Movement/Spline/MoveSplineInitArgs.h
index c190f979362..6ae25b48de0 100644
--- a/src/server/game/Movement/Spline/MoveSplineInitArgs.h
+++ b/src/server/game/Movement/Spline/MoveSplineInitArgs.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYSERVER_MOVESPLINEINIT_ARGS_H
diff --git a/src/server/game/Movement/Spline/MovementTypedefs.h b/src/server/game/Movement/Spline/MovementTypedefs.h
index e2188181841..31760ff01ce 100644
--- a/src/server/game/Movement/Spline/MovementTypedefs.h
+++ b/src/server/game/Movement/Spline/MovementTypedefs.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYSERVER_TYPEDEFS_H
diff --git a/src/server/game/Movement/Spline/MovementUtil.cpp b/src/server/game/Movement/Spline/MovementUtil.cpp
index f706a230480..95ceb3752a5 100644
--- a/src/server/game/Movement/Spline/MovementUtil.cpp
+++ b/src/server/game/Movement/Spline/MovementUtil.cpp
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "MoveSplineFlag.h"
diff --git a/src/server/game/Movement/Spline/Spline.cpp b/src/server/game/Movement/Spline/Spline.cpp
index b6318b6c63d..0866dcc066e 100644
--- a/src/server/game/Movement/Spline/Spline.cpp
+++ b/src/server/game/Movement/Spline/Spline.cpp
@@ -1,19 +1,18 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Spline.h"
@@ -94,7 +93,7 @@ inline void C_Evaluate(const Vector3 *vertice, float t, const float (&matrix)[4]
position.z = z;
}*/
-inline void C_Evaluate(const Vector3 *vertice, float t, const Matrix4& matr, Vector3 &result)
+inline void C_Evaluate(Vector3 const* vertice, float t, Matrix4 const& matr, Vector3 &result)
{
Vector4 tvec(t*t*t, t*t, t, 1.f);
Vector4 weights(tvec * matr);
@@ -103,7 +102,7 @@ inline void C_Evaluate(const Vector3 *vertice, float t, const Matrix4& matr, Vec
+ vertice[2] * weights[2] + vertice[3] * weights[3];
}
-inline void C_Evaluate_Derivative(const Vector3 *vertice, float t, const Matrix4& matr, Vector3 &result)
+inline void C_Evaluate_Derivative(Vector3 const* vertice, float t, Matrix4 const& matr, Vector3 &result)
{
Vector4 tvec(3.f*t*t, 2.f*t, 1.f, 0.f);
Vector4 weights(tvec * matr);
@@ -215,7 +214,7 @@ void SplineBase::init_cyclic_spline(const Vector3 * controls, index_type count,
(this->*initializers[m_mode])(controls, count, cyclic_point);
}
-void SplineBase::InitLinear(const Vector3* controls, index_type count, index_type cyclic_point)
+void SplineBase::InitLinear(Vector3 const* controls, index_type count, index_type cyclic_point)
{
ASSERT(count >= 2);
const int real_size = count + 1;
@@ -235,7 +234,7 @@ void SplineBase::InitLinear(const Vector3* controls, index_type count, index_typ
index_hi = cyclic ? count : (count - 1);
}
-void SplineBase::InitCatmullRom(const Vector3* controls, index_type count, index_type cyclic_point)
+void SplineBase::InitCatmullRom(Vector3 const* controls, index_type count, index_type cyclic_point)
{
const int real_size = count + (cyclic ? (1+2) : (1+1));
@@ -268,7 +267,7 @@ void SplineBase::InitCatmullRom(const Vector3* controls, index_type count, index
index_hi = high_index + (cyclic ? 1 : 0);
}
-void SplineBase::InitBezier3(const Vector3* controls, index_type count, index_type /*cyclic_point*/)
+void SplineBase::InitBezier3(Vector3 const* controls, index_type count, index_type /*cyclic_point*/)
{
index_type c = count / 3u * 3u;
index_type t = c / 3u;
diff --git a/src/server/game/Movement/Spline/Spline.h b/src/server/game/Movement/Spline/Spline.h
index 5f31115b2af..eeb6ddcc350 100644
--- a/src/server/game/Movement/Spline/Spline.h
+++ b/src/server/game/Movement/Spline/Spline.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYSERVER_SPLINE_H
@@ -77,10 +77,10 @@ protected:
typedef float (SplineBase::*SegLenghtMethtod)(index_type) const;
static SegLenghtMethtod seglengths[ModesEnd];
- void InitLinear(const Vector3*, index_type, index_type);
- void InitCatmullRom(const Vector3*, index_type, index_type);
- void InitBezier3(const Vector3*, index_type, index_type);
- typedef void (SplineBase::*InitMethtod)(const Vector3*, index_type, index_type);
+ void InitLinear(Vector3 const*, index_type, index_type);
+ void InitCatmullRom(Vector3 const*, index_type, index_type);
+ void InitBezier3(Vector3 const*, index_type, index_type);
+ typedef void (SplineBase::*InitMethtod)(Vector3 const*, index_type, index_type);
static InitMethtod initializers[ModesEnd];
void UninitializedSplineEvaluationMethod(index_type, float, Vector3&) const { ABORT(); }
@@ -111,9 +111,9 @@ public:
EvaluationMode mode() const { return (EvaluationMode)m_mode;}
bool isCyclic() const { return cyclic;}
- const ControlArray& getPoints() const { return points; }
- index_type getPointCount() const { return index_type(points.size()); }
- const Vector3& getPoint(index_type i) const { return points[i]; }
+ ControlArray const& getPoints() const { return points; }
+ index_type getPointCount() const { return index_type(points.size());}
+ Vector3 const& getPoint(index_type i) const { return points[i]; }
/** Initializes spline. Don't call other methods while spline not initialized. */
void init_spline(const Vector3 * controls, index_type count, EvaluationMode m);
diff --git a/src/server/game/Movement/Spline/SplineImpl.h b/src/server/game/Movement/Spline/SplineImpl.h
index fd77ca3c6fe..4eb7a3f76cd 100644
--- a/src/server/game/Movement/Spline/SplineImpl.h
+++ b/src/server/game/Movement/Spline/SplineImpl.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Movement
diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp
index 379dc7e1d07..b85f344d244 100644
--- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp
+++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp
@@ -489,7 +489,7 @@ bool OutdoorPvP::IsInsideObjective(Player* player) const
bool OPvPCapturePoint::IsInsideObjective(Player* player) const
{
- GuidSet const &plSet = m_activePlayers[player->GetTeamId()];
+ GuidSet const& plSet = m_activePlayers[player->GetTeamId()];
return plSet.find(player->GetGUID()) != plSet.end();
}
@@ -589,7 +589,7 @@ void OutdoorPvP::RegisterZone(uint32 zoneId)
bool OutdoorPvP::HasPlayer(Player const* player) const
{
- GuidSet const &plSet = m_players[player->GetTeamId()];
+ GuidSet const& plSet = m_players[player->GetTeamId()];
return plSet.find(player->GetGUID()) != plSet.end();
}
@@ -652,8 +652,7 @@ void OutdoorPvP::BroadcastWorker(Worker& _worker, uint32 zoneId)
void OutdoorPvP::SetMapFromZone(uint32 zone)
{
- AreaTableEntry const* areaTable = sAreaTableStore.LookupEntry(zone);
- ASSERT(areaTable);
+ AreaTableEntry const* areaTable = sAreaTableStore.AssertEntry(zone);
Map* map = sMapMgr->CreateBaseMap(areaTable->ContinentID);
ASSERT(!map->Instanceable());
m_map = map;
diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
index 7d1036eaa01..9d8107ef8be 100644
--- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
+++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
@@ -36,8 +36,7 @@ void OutdoorPvPMgr::Die()
m_OutdoorPvPSet.clear();
- for (uint32 i = 0; i < MAX_OUTDOORPVP_TYPES; ++i)
- m_OutdoorPvPDatas[i] = 0;
+ m_OutdoorPvPDatas.fill(0);
m_OutdoorPvPMap.clear();
}
diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h
index 1a73a46da70..f91a971597f 100644
--- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h
+++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h
@@ -21,6 +21,7 @@
#define OUTDOORPVP_OBJECTIVE_UPDATE_INTERVAL 1000
#include "OutdoorPvP.h"
+#include <array>
#include <unordered_map>
class Player;
@@ -80,7 +81,7 @@ class TC_GAME_API OutdoorPvPMgr
private:
typedef std::vector<OutdoorPvP*> OutdoorPvPSet;
- typedef std::unordered_map<uint32 /* zoneid */, OutdoorPvP*> OutdoorPvPMap;
+ typedef std::unordered_map<uint32 /*zoneid*/, OutdoorPvP*> OutdoorPvPMap;
typedef std::array<uint32, MAX_OUTDOORPVP_TYPES> OutdoorPvPScriptIds;
// contains all initiated outdoor pvp events
diff --git a/src/server/game/Petitions/PetitionMgr.cpp b/src/server/game/Petitions/PetitionMgr.cpp
index c1dcee3ff87..87199224c4f 100644
--- a/src/server/game/Petitions/PetitionMgr.cpp
+++ b/src/server/game/Petitions/PetitionMgr.cpp
@@ -21,9 +21,8 @@
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
-#include "WorldSession.h"
#include "Timer.h"
-
+#include "WorldSession.h"
#include <unordered_map>
namespace
diff --git a/src/server/game/Petitions/PetitionMgr.h b/src/server/game/Petitions/PetitionMgr.h
index bddc63eb61f..913ed796105 100644
--- a/src/server/game/Petitions/PetitionMgr.h
+++ b/src/server/game/Petitions/PetitionMgr.h
@@ -21,7 +21,6 @@
#include "Define.h"
#include "ObjectGuid.h"
#include "SharedDefines.h"
-
#include <string>
#include <utility>
#include <vector>
diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp
index f7f1facd90c..44a1ef3ee82 100644
--- a/src/server/game/Pools/PoolMgr.cpp
+++ b/src/server/game/Pools/PoolMgr.cpp
@@ -796,8 +796,8 @@ void PoolMgr::LoadFromDB()
if (checkedPools.find(poolItr->second) != checkedPools.end())
{
std::ostringstream ss;
- ss<< "The pool(s) ";
- for (std::set<uint32>::const_iterator itr=checkedPools.begin(); itr != checkedPools.end(); ++itr)
+ ss << "The pool(s) ";
+ for (std::set<uint32>::const_iterator itr = checkedPools.begin(); itr != checkedPools.end(); ++itr)
ss << *itr << ' ';
ss << "create(s) a circular reference, which can cause the server to freeze.\nRemoving the last link between mother pool "
<< poolItr->first << " and child pool " << poolItr->second;
@@ -909,8 +909,8 @@ void PoolMgr::LoadFromDB()
uint32 oldMSTime = getMSTime();
QueryResult result = WorldDatabase.Query("SELECT DISTINCT pool_template.entry, pool_pool.pool_id, pool_pool.mother_pool FROM pool_template"
- " LEFT JOIN game_event_pool ON pool_template.entry=game_event_pool.pool_entry"
- " LEFT JOIN pool_pool ON pool_template.entry=pool_pool.pool_id WHERE game_event_pool.pool_entry IS NULL");
+ " LEFT JOIN game_event_pool ON pool_template.entry = game_event_pool.pool_entry"
+ " LEFT JOIN pool_pool ON pool_template.entry = pool_pool.pool_id WHERE game_event_pool.pool_entry IS NULL");
if (!result)
{
diff --git a/src/server/game/PrecompiledHeaders/gamePCH.h b/src/server/game/PrecompiledHeaders/gamePCH.h
index 65de2d11f94..86714e97a59 100644
--- a/src/server/game/PrecompiledHeaders/gamePCH.h
+++ b/src/server/game/PrecompiledHeaders/gamePCH.h
@@ -1,3 +1,20 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
//add here most rarely modified headers to speed up debug build compilation
#include "Creature.h"
diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp
index b4d39b846ca..4e18c5f0978 100644
--- a/src/server/game/Reputation/ReputationMgr.cpp
+++ b/src/server/game/Reputation/ReputationMgr.cpp
@@ -21,12 +21,10 @@
#include "DB2Stores.h"
#include "Log.h"
#include "ObjectMgr.h"
-#include "Opcodes.h"
#include "Player.h"
#include "ReputationPackets.h"
#include "ScriptMgr.h"
#include "World.h"
-#include "WorldPacket.h"
#include "WorldSession.h"
const int32 ReputationMgr::PointsInRank[MAX_REPUTATION_RANK] = {36000, 3000, 3000, 3000, 6000, 12000, 21000, 1000};
@@ -271,7 +269,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
if (!noSpillover)
{
// if spillover definition exists in DB, override DBC
- if (const RepSpilloverTemplate* repTemplate = sObjectMgr->GetRepSpilloverTemplate(factionEntry->ID))
+ if (RepSpilloverTemplate const* repTemplate = sObjectMgr->GetRepSpilloverTemplate(factionEntry->ID))
{
for (uint32 i = 0; i < MAX_SPILLOVER_FACTIONS; ++i)
{
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index b70994a3ed2..6ca57b18391 100644
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -1105,7 +1105,7 @@ struct TSpellSummary
uint8 Effects; // set of enum SelectEffect
} *SpellSummary;
-ScriptObject::ScriptObject(const char* name) : _name(name)
+ScriptObject::ScriptObject(char const* name) : _name(name)
{
sScriptMgr->IncreaseScriptCount();
}
@@ -1694,7 +1694,7 @@ std::vector<ChatCommand> ScriptMgr::GetChatCommands()
}
// Sort commands in alphabetical order
- std::sort(table.begin(), table.end(), [](const ChatCommand& a, const ChatCommand&b)
+ std::sort(table.begin(), table.end(), [](ChatCommand const& a, ChatCommand const& b)
{
return strcmp(a.Name, b.Name) < 0;
});
@@ -2150,7 +2150,7 @@ void ScriptMgr::OnGroupInviteMember(Group* group, ObjectGuid guid)
FOREACH_SCRIPT(GroupScript)->OnInviteMember(group, guid);
}
-void ScriptMgr::OnGroupRemoveMember(Group* group, ObjectGuid guid, RemoveMethod method, ObjectGuid kicker, const char* reason)
+void ScriptMgr::OnGroupRemoveMember(Group* group, ObjectGuid guid, RemoveMethod method, ObjectGuid kicker, char const* reason)
{
ASSERT(group);
FOREACH_SCRIPT(GroupScript)->OnRemoveMember(group, guid, method, kicker, reason);
@@ -2263,38 +2263,38 @@ void ScriptMgr::OnQuestObjectiveChange(Player* player, Quest const* quest, Quest
tmpscript->OnQuestObjectiveChange(player, quest, objective, oldAmount, newAmount);
}
-SpellScriptLoader::SpellScriptLoader(const char* name)
+SpellScriptLoader::SpellScriptLoader(char const* name)
: ScriptObject(name)
{
ScriptRegistry<SpellScriptLoader>::Instance()->AddScript(this);
}
-ServerScript::ServerScript(const char* name)
+ServerScript::ServerScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<ServerScript>::Instance()->AddScript(this);
}
-WorldScript::WorldScript(const char* name)
+WorldScript::WorldScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<WorldScript>::Instance()->AddScript(this);
}
-FormulaScript::FormulaScript(const char* name)
+FormulaScript::FormulaScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<FormulaScript>::Instance()->AddScript(this);
}
-UnitScript::UnitScript(const char* name, bool addToScripts)
+UnitScript::UnitScript(char const* name, bool addToScripts)
: ScriptObject(name)
{
if (addToScripts)
ScriptRegistry<UnitScript>::Instance()->AddScript(this);
}
-WorldMapScript::WorldMapScript(const char* name, uint32 mapId)
+WorldMapScript::WorldMapScript(char const* name, uint32 mapId)
: ScriptObject(name), MapScript<Map>(sMapStore.LookupEntry(mapId))
{
if (!GetEntry())
@@ -2306,7 +2306,7 @@ WorldMapScript::WorldMapScript(const char* name, uint32 mapId)
ScriptRegistry<WorldMapScript>::Instance()->AddScript(this);
}
-InstanceMapScript::InstanceMapScript(const char* name, uint32 mapId)
+InstanceMapScript::InstanceMapScript(char const* name, uint32 mapId)
: ScriptObject(name), MapScript<InstanceMap>(sMapStore.LookupEntry(mapId))
{
if (!GetEntry())
@@ -2318,7 +2318,7 @@ InstanceMapScript::InstanceMapScript(const char* name, uint32 mapId)
ScriptRegistry<InstanceMapScript>::Instance()->AddScript(this);
}
-BattlegroundMapScript::BattlegroundMapScript(const char* name, uint32 mapId)
+BattlegroundMapScript::BattlegroundMapScript(char const* name, uint32 mapId)
: ScriptObject(name), MapScript<BattlegroundMap>(sMapStore.LookupEntry(mapId))
{
if (!GetEntry())
@@ -2330,25 +2330,25 @@ BattlegroundMapScript::BattlegroundMapScript(const char* name, uint32 mapId)
ScriptRegistry<BattlegroundMapScript>::Instance()->AddScript(this);
}
-ItemScript::ItemScript(const char* name)
+ItemScript::ItemScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<ItemScript>::Instance()->AddScript(this);
}
-CreatureScript::CreatureScript(const char* name)
+CreatureScript::CreatureScript(char const* name)
: UnitScript(name, false)
{
ScriptRegistry<CreatureScript>::Instance()->AddScript(this);
}
-GameObjectScript::GameObjectScript(const char* name)
+GameObjectScript::GameObjectScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<GameObjectScript>::Instance()->AddScript(this);
}
-AreaTriggerScript::AreaTriggerScript(const char* name)
+AreaTriggerScript::AreaTriggerScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<AreaTriggerScript>::Instance()->AddScript(this);
@@ -2375,97 +2375,97 @@ BattlegroundScript::BattlegroundScript(char const* name)
ScriptRegistry<BattlegroundScript>::Instance()->AddScript(this);
}
-OutdoorPvPScript::OutdoorPvPScript(const char* name)
+OutdoorPvPScript::OutdoorPvPScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<OutdoorPvPScript>::Instance()->AddScript(this);
}
-CommandScript::CommandScript(const char* name)
+CommandScript::CommandScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<CommandScript>::Instance()->AddScript(this);
}
-WeatherScript::WeatherScript(const char* name)
+WeatherScript::WeatherScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<WeatherScript>::Instance()->AddScript(this);
}
-AuctionHouseScript::AuctionHouseScript(const char* name)
+AuctionHouseScript::AuctionHouseScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<AuctionHouseScript>::Instance()->AddScript(this);
}
-ConditionScript::ConditionScript(const char* name)
+ConditionScript::ConditionScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<ConditionScript>::Instance()->AddScript(this);
}
-VehicleScript::VehicleScript(const char* name)
+VehicleScript::VehicleScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<VehicleScript>::Instance()->AddScript(this);
}
-DynamicObjectScript::DynamicObjectScript(const char* name)
+DynamicObjectScript::DynamicObjectScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<DynamicObjectScript>::Instance()->AddScript(this);
}
-TransportScript::TransportScript(const char* name)
+TransportScript::TransportScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<TransportScript>::Instance()->AddScript(this);
}
-AchievementCriteriaScript::AchievementCriteriaScript(const char* name)
+AchievementCriteriaScript::AchievementCriteriaScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<AchievementCriteriaScript>::Instance()->AddScript(this);
}
-PlayerScript::PlayerScript(const char* name)
+PlayerScript::PlayerScript(char const* name)
: UnitScript(name, false)
{
ScriptRegistry<PlayerScript>::Instance()->AddScript(this);
}
-AccountScript::AccountScript(const char* name)
+AccountScript::AccountScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<AccountScript>::Instance()->AddScript(this);
}
-SceneScript::SceneScript(const char* name)
+SceneScript::SceneScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<SceneScript>::Instance()->AddScript(this);
}
-QuestScript::QuestScript(const char* name)
+QuestScript::QuestScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<QuestScript>::Instance()->AddScript(this);
}
-GuildScript::GuildScript(const char* name)
+GuildScript::GuildScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<GuildScript>::Instance()->AddScript(this);
}
-GroupScript::GroupScript(const char* name)
+GroupScript::GroupScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<GroupScript>::Instance()->AddScript(this);
}
-AreaTriggerEntityScript::AreaTriggerEntityScript(const char* name)
+AreaTriggerEntityScript::AreaTriggerEntityScript(char const* name)
: ScriptObject(name)
{
ScriptRegistry<AreaTriggerEntityScript>::Instance()->AddScript(this);
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index 375b75264b2..e4765c44bec 100644
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -113,7 +113,7 @@ enum XPColorChar : uint8;
protected:
- MyScriptType(const char* name, uint32 someId)
+ MyScriptType(char const* name, uint32 someId)
: ScriptObject(name), _someId(someId)
{
ScriptRegistry<MyScriptType>::AddScript(this);
@@ -174,7 +174,7 @@ class TC_GAME_API ScriptObject
protected:
- ScriptObject(const char* name);
+ ScriptObject(char const* name);
virtual ~ScriptObject();
private:
@@ -201,7 +201,7 @@ class TC_GAME_API SpellScriptLoader : public ScriptObject
{
protected:
- SpellScriptLoader(const char* name);
+ SpellScriptLoader(char const* name);
public:
@@ -216,7 +216,7 @@ class TC_GAME_API ServerScript : public ScriptObject
{
protected:
- ServerScript(const char* name);
+ ServerScript(char const* name);
public:
@@ -246,7 +246,7 @@ class TC_GAME_API WorldScript : public ScriptObject
{
protected:
- WorldScript(const char* name);
+ WorldScript(char const* name);
public:
@@ -279,7 +279,7 @@ class TC_GAME_API FormulaScript : public ScriptObject
{
protected:
- FormulaScript(const char* name);
+ FormulaScript(char const* name);
public:
@@ -342,7 +342,7 @@ class TC_GAME_API WorldMapScript : public ScriptObject, public MapScript<Map>
{
protected:
- WorldMapScript(const char* name, uint32 mapId);
+ WorldMapScript(char const* name, uint32 mapId);
};
class TC_GAME_API InstanceMapScript
@@ -350,26 +350,26 @@ class TC_GAME_API InstanceMapScript
{
protected:
- InstanceMapScript(const char* name, uint32 mapId);
+ InstanceMapScript(char const* name, uint32 mapId);
public:
// Gets an InstanceScript object for this instance.
- virtual InstanceScript* GetInstanceScript(InstanceMap* /*map*/) const { return NULL; }
+ virtual InstanceScript* GetInstanceScript(InstanceMap* /*map*/) const { return nullptr; }
};
class TC_GAME_API BattlegroundMapScript : public ScriptObject, public MapScript<BattlegroundMap>
{
protected:
- BattlegroundMapScript(const char* name, uint32 mapId);
+ BattlegroundMapScript(char const* name, uint32 mapId);
};
class TC_GAME_API ItemScript : public ScriptObject
{
protected:
- ItemScript(const char* name);
+ ItemScript(char const* name);
public:
@@ -393,7 +393,7 @@ class TC_GAME_API UnitScript : public ScriptObject
{
protected:
- UnitScript(const char* name, bool addToScripts = true);
+ UnitScript(char const* name, bool addToScripts = true);
public:
// Called when a unit deals healing to another unit
@@ -416,7 +416,7 @@ class TC_GAME_API CreatureScript : public UnitScript
{
protected:
- CreatureScript(const char* name);
+ CreatureScript(char const* name);
public:
@@ -431,7 +431,7 @@ class TC_GAME_API GameObjectScript : public ScriptObject
{
protected:
- GameObjectScript(const char* name);
+ GameObjectScript(char const* name);
public:
@@ -443,7 +443,7 @@ class TC_GAME_API AreaTriggerScript : public ScriptObject
{
protected:
- AreaTriggerScript(const char* name);
+ AreaTriggerScript(char const* name);
public:
@@ -468,7 +468,7 @@ class TC_GAME_API BattlegroundScript : public ScriptObject
{
protected:
- BattlegroundScript(const char* name);
+ BattlegroundScript(char const* name);
public:
@@ -480,7 +480,7 @@ class TC_GAME_API OutdoorPvPScript : public ScriptObject
{
protected:
- OutdoorPvPScript(const char* name);
+ OutdoorPvPScript(char const* name);
public:
@@ -492,7 +492,7 @@ class TC_GAME_API CommandScript : public ScriptObject
{
protected:
- CommandScript(const char* name);
+ CommandScript(char const* name);
public:
@@ -504,7 +504,7 @@ class TC_GAME_API WeatherScript : public ScriptObject, public UpdatableScript<We
{
protected:
- WeatherScript(const char* name);
+ WeatherScript(char const* name);
public:
@@ -516,7 +516,7 @@ class TC_GAME_API AuctionHouseScript : public ScriptObject
{
protected:
- AuctionHouseScript(const char* name);
+ AuctionHouseScript(char const* name);
public:
@@ -537,7 +537,7 @@ class TC_GAME_API ConditionScript : public ScriptObject
{
protected:
- ConditionScript(const char* name);
+ ConditionScript(char const* name);
public:
@@ -549,7 +549,7 @@ class TC_GAME_API VehicleScript : public ScriptObject
{
protected:
- VehicleScript(const char* name);
+ VehicleScript(char const* name);
public:
@@ -576,14 +576,14 @@ class TC_GAME_API DynamicObjectScript : public ScriptObject, public UpdatableScr
{
protected:
- DynamicObjectScript(const char* name);
+ DynamicObjectScript(char const* name);
};
class TC_GAME_API TransportScript : public ScriptObject, public UpdatableScript<Transport>
{
protected:
- TransportScript(const char* name);
+ TransportScript(char const* name);
public:
@@ -604,7 +604,7 @@ class TC_GAME_API AchievementCriteriaScript : public ScriptObject
{
protected:
- AchievementCriteriaScript(const char* name);
+ AchievementCriteriaScript(char const* name);
public:
@@ -616,7 +616,7 @@ class TC_GAME_API PlayerScript : public UnitScript
{
protected:
- PlayerScript(const char* name);
+ PlayerScript(char const* name);
public:
@@ -722,7 +722,7 @@ class TC_GAME_API AccountScript : public ScriptObject
{
protected:
- AccountScript(const char* name);
+ AccountScript(char const* name);
public:
@@ -749,7 +749,7 @@ class TC_GAME_API GuildScript : public ScriptObject
{
protected:
- GuildScript(const char* name);
+ GuildScript(char const* name);
public:
@@ -790,7 +790,7 @@ class TC_GAME_API GroupScript : public ScriptObject
{
protected:
- GroupScript(const char* name);
+ GroupScript(char const* name);
public:
@@ -801,7 +801,7 @@ class TC_GAME_API GroupScript : public ScriptObject
virtual void OnInviteMember(Group* /*group*/, ObjectGuid /*guid*/) { }
// Called when a member is removed from a group.
- virtual void OnRemoveMember(Group* /*group*/, ObjectGuid /*guid*/, RemoveMethod /*method*/, ObjectGuid /*kicker*/, const char* /*reason*/) { }
+ virtual void OnRemoveMember(Group* /*group*/, ObjectGuid /*guid*/, RemoveMethod /*method*/, ObjectGuid /*kicker*/, char const* /*reason*/) { }
// Called when the leader of a group is changed.
virtual void OnChangeLeader(Group* /*group*/, ObjectGuid /*newLeaderGuid*/, ObjectGuid /*oldLeaderGuid*/) { }
@@ -814,7 +814,7 @@ class TC_GAME_API AreaTriggerEntityScript : public ScriptObject
{
protected:
- AreaTriggerEntityScript(const char* name);
+ AreaTriggerEntityScript(char const* name);
public:
@@ -837,7 +837,7 @@ class TC_GAME_API SceneScript : public ScriptObject
{
protected:
- SceneScript(const char* name);
+ SceneScript(char const* name);
public:
// Called when a player start a scene
@@ -857,7 +857,7 @@ class TC_GAME_API QuestScript : public ScriptObject
{
protected:
- QuestScript(const char* name);
+ QuestScript(char const* name);
public:
// Called when a quest status change
@@ -1114,7 +1114,7 @@ class TC_GAME_API ScriptMgr
void OnGroupAddMember(Group* group, ObjectGuid guid);
void OnGroupInviteMember(Group* group, ObjectGuid guid);
- void OnGroupRemoveMember(Group* group, ObjectGuid guid, RemoveMethod method, ObjectGuid kicker, const char* reason);
+ void OnGroupRemoveMember(Group* group, ObjectGuid guid, RemoveMethod method, ObjectGuid kicker, char const* reason);
void OnGroupChangeLeader(Group* group, ObjectGuid newLeaderGuid, ObjectGuid oldLeaderGuid);
void OnGroupDisband(Group* group);
diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp
index 0cb051b3cdf..90f01de55fb 100644
--- a/src/server/game/Scripting/ScriptSystem.cpp
+++ b/src/server/game/Scripting/ScriptSystem.cpp
@@ -111,7 +111,7 @@ void SystemMgr::LoadScriptSplineChains()
uint32 entry = fieldsMeta[0].GetUInt32();
uint16 chainId = fieldsMeta[1].GetUInt16();
uint8 splineId = fieldsMeta[2].GetUInt8();
- std::vector<SplineChainLink>& chain = m_mSplineChainsMap[{entry,chainId}];
+ std::vector<SplineChainLink>& chain = m_mSplineChainsMap[{entry, chainId}];
if (splineId != chain.size())
{
diff --git a/src/server/game/Server/Packets/EquipmentSetPackets.cpp b/src/server/game/Server/Packets/EquipmentSetPackets.cpp
index e4b8aadf00e..3ef50d4d525 100644
--- a/src/server/game/Server/Packets/EquipmentSetPackets.cpp
+++ b/src/server/game/Server/Packets/EquipmentSetPackets.cpp
@@ -37,7 +37,7 @@ WorldPacket const* WorldPackets::EquipmentSet::LoadEquipmentSet::Write()
_worldPacket << uint32(equipSet->SetID);
_worldPacket << uint32(equipSet->IgnoreMask);
- for (std::size_t i = 0; i < EQUIPEMENT_SET_SLOTS; ++i)
+ for (std::size_t i = 0; i < EQUIPMENT_SET_SLOTS; ++i)
{
_worldPacket << equipSet->Pieces[i];
_worldPacket << int32(equipSet->Appearances[i]);
@@ -67,7 +67,7 @@ void WorldPackets::EquipmentSet::SaveEquipmentSet::Read()
_worldPacket >> Set.SetID;
_worldPacket >> Set.IgnoreMask;
- for (uint8 i = 0; i < EQUIPEMENT_SET_SLOTS; ++i)
+ for (uint8 i = 0; i < EQUIPMENT_SET_SLOTS; ++i)
{
_worldPacket >> Set.Pieces[i];
_worldPacket >> Set.Appearances[i];
@@ -97,7 +97,7 @@ void WorldPackets::EquipmentSet::UseEquipmentSet::Read()
{
_worldPacket >> Inv;
- for (uint8 i = 0; i < EQUIPEMENT_SET_SLOTS; ++i)
+ for (uint8 i = 0; i < EQUIPMENT_SET_SLOTS; ++i)
{
_worldPacket >> Items[i].Item;
_worldPacket >> Items[i].ContainerSlot;
diff --git a/src/server/game/Server/Packets/EquipmentSetPackets.h b/src/server/game/Server/Packets/EquipmentSetPackets.h
index 609372d1789..a36c95829e0 100644
--- a/src/server/game/Server/Packets/EquipmentSetPackets.h
+++ b/src/server/game/Server/Packets/EquipmentSetPackets.h
@@ -18,7 +18,7 @@
#pragma once
#include "Packet.h"
-#include "EquipementSet.h"
+#include "EquipmentSet.h"
#include "ItemPacketsCommon.h"
namespace WorldPackets
@@ -82,7 +82,7 @@ namespace WorldPackets
};
WorldPackets::Item::InvUpdate Inv;
- EquipmentSetItem Items[EQUIPEMENT_SET_SLOTS];
+ EquipmentSetItem Items[EQUIPMENT_SET_SLOTS];
uint64 GUID = 0; ///< Set Identifier
};
diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp
index aec308cee5e..15a3b354d42 100644
--- a/src/server/game/Server/WorldSession.cpp
+++ b/src/server/game/Server/WorldSession.cpp
@@ -271,11 +271,11 @@ void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/
if ((cur_time - lastTime) < 60)
{
- sendPacketCount+=1;
- sendPacketBytes+=packet->size();
+ sendPacketCount += 1;
+ sendPacketBytes += packet->size();
- sendLastPacketCount+=1;
- sendLastPacketBytes+=packet->size();
+ sendLastPacketCount += 1;
+ sendLastPacketBytes += packet->size();
}
else
{
@@ -303,7 +303,7 @@ void WorldSession::QueuePacket(WorldPacket* new_packet)
}
/// Logging helper for unexpected opcodes
-void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, const char* status, const char *reason)
+void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, char const* status, const char *reason)
{
TC_LOG_ERROR("network.opcode", "Received unexpected opcode %s Status: %s Reason: %s from %s",
GetOpcodeNameForLogging(static_cast<OpcodeClient>(packet->GetOpcode())).c_str(), status, reason, GetPlayerInfo().c_str());
@@ -551,7 +551,7 @@ void WorldSession::LogoutPlayer(bool save)
}
}
- // Repop at GraveYard or other player far teleport will prevent saving player because of not present map
+ // Repop at Graveyard or other player far teleport will prevent saving player because of not present map
// Teleport player immediately for correct player save
while (_player->IsBeingTeleportedFar())
HandleMoveWorldportAck();
diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h
index 8027cec4f43..34c698f2a7f 100644
--- a/src/server/game/Server/WorldSession.h
+++ b/src/server/game/Server/WorldSession.h
@@ -1809,7 +1809,7 @@ class TC_GAME_API WorldSession
bool CanUseBank(ObjectGuid bankerGUID = ObjectGuid::Empty) const;
// logging helper
- void LogUnexpectedOpcode(WorldPacket* packet, const char* status, const char *reason);
+ void LogUnexpectedOpcode(WorldPacket* packet, char const* status, const char *reason);
// EnumData helpers
bool IsLegitCharacterForAccount(ObjectGuid lowGUID)
diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp
index 1117589d0ab..5dd988f8a73 100644
--- a/src/server/game/Skills/SkillDiscovery.cpp
+++ b/src/server/game/Skills/SkillDiscovery.cpp
@@ -15,16 +15,16 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "SkillDiscovery.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "Log.h"
-#include "World.h"
-#include "Util.h"
-#include "SkillDiscovery.h"
-#include "SpellMgr.h"
#include "Player.h"
#include "Random.h"
+#include "SpellMgr.h"
#include "SpellInfo.h"
+#include "Util.h"
+#include "World.h"
#include <map>
#include <sstream>
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 5c618b76954..95e68152182 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -4873,7 +4873,7 @@ void AuraEffect::HandleChannelDeathItem(AuraApplication const* aurApp, uint8 mod
InventoryResult msg = plCaster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, GetSpellEffectInfo()->ItemType, count, &noSpaceForCount);
if (msg != EQUIP_ERR_OK)
{
- count-=noSpaceForCount;
+ count -= noSpaceForCount;
plCaster->SendEquipError(msg, nullptr, nullptr, GetSpellEffectInfo()->ItemType);
if (count == 0)
return;
diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h
index 7f315de9a54..730d177e2b4 100644
--- a/src/server/game/Spells/Auras/SpellAuras.h
+++ b/src/server/game/Spells/Auras/SpellAuras.h
@@ -230,7 +230,7 @@ class TC_GAME_API Aura
// Helpers for targets
ApplicationMap const& GetApplicationMap() { return m_applications; }
void GetApplicationList(Unit::AuraApplicationList& applicationList) const;
- const AuraApplication* GetApplicationOfTarget(ObjectGuid guid) const { ApplicationMap::const_iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return nullptr; }
+ AuraApplication const* GetApplicationOfTarget(ObjectGuid guid) const { ApplicationMap::const_iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return nullptr; }
AuraApplication* GetApplicationOfTarget(ObjectGuid guid) { ApplicationMap::iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return nullptr; }
bool IsAppliedOnTarget(ObjectGuid guid) const { return m_applications.find(guid) != m_applications.end(); }
@@ -281,7 +281,7 @@ class TC_GAME_API Aura
bool CallScriptEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo);
void CallScriptAfterEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo);
- template<class Script>
+ template <class Script>
Script* GetScript(std::string const& scriptName) const
{
return dynamic_cast<Script*>(GetScriptByName(scriptName));
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index bc68a92561c..c7678330cec 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -3173,7 +3173,7 @@ void Spell::_cast(bool skipCheck)
// As of 3.0.2 pets begin attacking their owner's target immediately
// Let any pets know we've attacked something. Check DmgClass for harmful spells only
// This prevents spells such as Hunter's Mark from triggering pet attack
- if (this->GetSpellInfo()->DmgClass != SPELL_DAMAGE_CLASS_NONE)
+ if (GetSpellInfo()->DmgClass != SPELL_DAMAGE_CLASS_NONE)
if (Unit* unitTarget = m_targets.GetUnitTarget())
for (Unit* controlled : playerCaster->m_Controlled)
if (Creature* cControlled = controlled->ToCreature())
@@ -4024,7 +4024,7 @@ void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint32 sp
WorldPackets::Spells::CastFailed packet;
packet.SpellXSpellVisualID = spellVisual;
FillSpellCastFailedArgs(packet, cast_count, spellInfo, result, customError, param1, param2, caster);
- caster->GetSession()->SendPacket(packet.Write());
+ caster->SendDirectMessage(packet.Write());
}
void Spell::SendMountResult(MountResult result)
@@ -4551,21 +4551,15 @@ void Spell::SendResurrectRequest(Player* target)
WorldPackets::Spells::ResurrectRequest resurrectRequest;
resurrectRequest.ResurrectOffererGUID = m_caster->GetGUID();
resurrectRequest.ResurrectOffererVirtualRealmAddress = GetVirtualRealmAddress();
-
+ resurrectRequest.Name = sentName;
+ resurrectRequest.Sickness = m_caster->GetTypeId() != TYPEID_PLAYER && m_caster->IsSpiritHealer(); // "you'll be afflicted with resurrection sickness"
+ resurrectRequest.UseTimer = !m_spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_RESURRECTION_TIMER);
if (Pet* pet = target->GetPet())
- {
if (CharmInfo* charmInfo = pet->GetCharmInfo())
resurrectRequest.PetNumber = charmInfo->GetPetNumber();
- }
resurrectRequest.SpellID = m_spellInfo->Id;
-
- //packet.ReadBit("UseTimer"); /// @todo: 6.x Has to be implemented
- resurrectRequest.Sickness = m_caster->GetTypeId() != TYPEID_PLAYER; // "you'll be afflicted with resurrection sickness"
-
- resurrectRequest.Name = sentName;
-
- target->GetSession()->SendPacket(resurrectRequest.Write());
+ target->SendDirectMessage(resurrectRequest.Write());
}
void Spell::TakeCastItem()
@@ -4991,7 +4985,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
m_needComboPoints = false;
if ((*j)->GetMiscValue() == 1)
{
- reqCombat=false;
+ reqCombat = false;
break;
}
}
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index fdec7c09a13..712e6a365c8 100644
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -954,4 +954,5 @@ namespace Trinity
}
typedef void(Spell::*pEffect)(SpellEffIndex effIndex);
+
#endif
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index c13ea7388e9..e08f7231605 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2683,7 +2683,7 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex)
pet->SetCreatedBySpell(m_spellInfo->Id);
// generate new name for summon pet
- std::string new_name=sObjectMgr->GeneratePetName(petentry);
+ std::string new_name = sObjectMgr->GeneratePetName(petentry);
if (!new_name.empty())
pet->SetName(new_name);
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index f8967a2f23a..3c2ea638171 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -17,7 +17,6 @@
#include "SpellInfo.h"
#include "Battleground.h"
-#include "ConditionMgr.h"
#include "Corpse.h"
#include "DB2Stores.h"
#include "GameTables.h"
@@ -3627,6 +3626,7 @@ float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const
if (caster)
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(Id, SPELLMOD_RANGE, range, spell);
+
return range;
}
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp
index 10722473019..638f69d8721 100644
--- a/src/server/game/Spells/SpellScript.cpp
+++ b/src/server/game/Spells/SpellScript.cpp
@@ -44,6 +44,7 @@ bool _SpellScript::_ValidateSpellInfo(uint32 const* begin, uint32 const* end)
TC_LOG_ERROR("scripts.spells", "_SpellScript::ValidateSpellInfo: Spell %u does not exist.", *begin);
allValid = false;
}
+
++begin;
}
return allValid;
diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h
index e0cca835925..e5a9fb5b491 100644
--- a/src/server/game/Spells/SpellScript.h
+++ b/src/server/game/Spells/SpellScript.h
@@ -148,13 +148,13 @@ class TC_GAME_API _SpellScript
return _ValidateSpellInfo(spellIds.begin(), spellIds.end());
}
- template<class T>
+ template <class T>
static bool ValidateSpellInfo(T const& spellIds)
{
return _ValidateSpellInfo(std::begin(spellIds), std::end(spellIds));
}
-private:
+ private:
static bool _ValidateSpellInfo(uint32 const* begin, uint32 const* end);
};
diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp
index 30f578aa872..9e27747c60a 100644
--- a/src/server/game/Texts/CreatureTextMgr.cpp
+++ b/src/server/game/Texts/CreatureTextMgr.cpp
@@ -334,7 +334,7 @@ void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket const*
if (!whisperTarget || whisperTarget->GetTypeId() != TYPEID_PLAYER)
return;
- whisperTarget->ToPlayer()->GetSession()->SendPacket(data);
+ whisperTarget->ToPlayer()->SendDirectMessage(data);
return;
}
break;
diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h
index c24884582a5..cc76ae1588b 100644
--- a/src/server/game/Texts/CreatureTextMgr.h
+++ b/src/server/game/Texts/CreatureTextMgr.h
@@ -101,7 +101,7 @@ class TC_GAME_API CreatureTextMgr
bool TextExist(uint32 sourceEntry, uint8 textGroup) const;
std::string GetLocalizedChatString(uint32 entry, uint8 gender, uint8 textGroup, uint32 id, LocaleConstant locale) const;
- template<class Builder>
+ template <class Builder>
static void SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* whisperTarget = nullptr, CreatureTextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false);
private:
diff --git a/src/server/game/Time/GameTime.h b/src/server/game/Time/GameTime.h
index b21b0d1c064..cb1f7d337f0 100644
--- a/src/server/game/Time/GameTime.h
+++ b/src/server/game/Time/GameTime.h
@@ -19,7 +19,6 @@
#define __GAMETIME_H
#include "Define.h"
-
#include <chrono>
namespace GameTime
diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.cpp b/src/server/game/Tools/CharacterDatabaseCleaner.cpp
index 86210d8f56e..4f67878885e 100644
--- a/src/server/game/Tools/CharacterDatabaseCleaner.cpp
+++ b/src/server/game/Tools/CharacterDatabaseCleaner.cpp
@@ -18,10 +18,10 @@
#include "Common.h"
#include "CriteriaHandler.h"
#include "CharacterDatabaseCleaner.h"
+#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "Log.h"
#include "World.h"
-#include "Database/DatabaseEnv.h"
#include "SpellMgr.h"
#include "SpellInfo.h"
#include <sstream>
@@ -69,7 +69,7 @@ void CharacterDatabaseCleaner::CleanDatabase()
TC_LOG_INFO("server.loading", ">> Cleaned character database in %u ms", GetMSTimeDiffToNow(oldMSTime));
}
-void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table, bool (*check)(uint32))
+void CharacterDatabaseCleaner::CheckUnique(char const* column, char const* table, bool (*check)(uint32))
{
QueryResult result = CharacterDatabase.PQuery("SELECT DISTINCT %s FROM %s", column, table);
if (!result)
diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.h b/src/server/game/Tools/CharacterDatabaseCleaner.h
index d1cec3575bc..83a639f99ab 100644
--- a/src/server/game/Tools/CharacterDatabaseCleaner.h
+++ b/src/server/game/Tools/CharacterDatabaseCleaner.h
@@ -31,7 +31,7 @@ namespace CharacterDatabaseCleaner
TC_GAME_API void CleanDatabase();
- TC_GAME_API void CheckUnique(const char* column, const char* table, bool (*check)(uint32));
+ TC_GAME_API void CheckUnique(char const* column, char const* table, bool (*check)(uint32));
TC_GAME_API bool AchievementProgressCheck(uint32 criteria);
TC_GAME_API bool SkillCheck(uint32 skill);
diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp
index d8255c96e7a..7e44537215a 100644
--- a/src/server/game/Warden/Warden.cpp
+++ b/src/server/game/Warden/Warden.cpp
@@ -139,7 +139,7 @@ void Warden::EncryptData(uint8* buffer, uint32 length)
_outputCrypto.UpdateData(buffer, length);
}
-bool Warden::IsValidCheckSum(uint32 checksum, const uint8* data, const uint16 length)
+bool Warden::IsValidCheckSum(uint32 checksum, uint8 const* data, const uint16 length)
{
uint32 newChecksum = BuildChecksum(data, length);
@@ -170,7 +170,7 @@ struct keyData {
};
};
-uint32 Warden::BuildChecksum(const uint8* data, uint32 length)
+uint32 Warden::BuildChecksum(uint8 const* data, uint32 length)
{
keyData hash;
SHA1(data, length, hash.bytes.bytes);
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index e7335bb766f..f4a1a4fc2aa 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -60,6 +60,7 @@
#include "IPLocation.h"
#include "Language.h"
#include "LFGMgr.h"
+#include "Log.h"
#include "LootItemStorage.h"
#include "LootMgr.h"
#include "M2Stores.h"
@@ -68,7 +69,6 @@
#include "Metric.h"
#include "MiscPackets.h"
#include "MMapFactory.h"
-#include "Object.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "OutdoorPvPMgr.h"
@@ -1405,7 +1405,7 @@ void World::LoadConfigSettings(bool reload)
#if TRINITY_PLATFORM == TRINITY_PLATFORM_UNIX || TRINITY_PLATFORM == TRINITY_PLATFORM_APPLE
if (dataPath[0] == '~')
{
- const char* home = getenv("HOME");
+ char const* home = getenv("HOME");
if (home)
dataPath.replace(0, 1, home);
}
@@ -2779,7 +2779,7 @@ void World::SendGMText(uint32 string_id, ...)
}
/// DEPRECATED, only for debug purpose. Send a System Message to all players (except self if mentioned)
-void World::SendGlobalText(const char* text, WorldSession* self)
+void World::SendGlobalText(char const* text, WorldSession* self)
{
// need copy to prevent corruption by strtok call in LineFromMessage original string
char* buf = strdup(text);
@@ -2819,7 +2819,7 @@ bool World::SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession
}
/// Send a System Message to all players in the zone (except self if mentioned)
-void World::SendZoneText(uint32 zone, const char* text, WorldSession* self, uint32 team)
+void World::SendZoneText(uint32 zone, char const* text, WorldSession* self, uint32 team)
{
WorldPackets::Chat::Chat packet;
packet.Initialize(CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, text);
@@ -3142,7 +3142,7 @@ void World::SendServerMessage(ServerMessageType messageID, std::string stringPar
chatServerMessage.StringParam = stringParam;
if (player)
- player->GetSession()->SendPacket(chatServerMessage.Write());
+ player->SendDirectMessage(chatServerMessage.Write());
else
SendGlobalMessage(chatServerMessage.Write());
}
@@ -3258,9 +3258,9 @@ void World::_UpdateRealmCharCount(PreparedQueryResult resultCharCount)
void World::InitWeeklyQuestResetTime()
{
- time_t wstime = sWorld->getWorldState(WS_WEEKLY_QUEST_RESET_TIME);
+ time_t wstime = uint64(sWorld->getWorldState(WS_WEEKLY_QUEST_RESET_TIME));
time_t curtime = time(nullptr);
- m_NextWeeklyQuestReset = wstime < curtime ? curtime : wstime;
+ m_NextWeeklyQuestReset = wstime < curtime ? curtime : time_t(wstime);
}
void World::InitDailyQuestResetTime(bool loading)
@@ -3300,16 +3300,16 @@ void World::InitDailyQuestResetTime(bool loading)
void World::InitMonthlyQuestResetTime()
{
- time_t wstime = sWorld->getWorldState(WS_MONTHLY_QUEST_RESET_TIME);
+ time_t wstime = uint64(sWorld->getWorldState(WS_MONTHLY_QUEST_RESET_TIME));
time_t curtime = time(nullptr);
- m_NextMonthlyQuestReset = wstime < curtime ? curtime : wstime;
+ m_NextMonthlyQuestReset = wstime < curtime ? curtime : time_t(wstime);
}
void World::InitRandomBGResetTime()
{
time_t bgtime = sWorld->getWorldState(WS_BG_DAILY_RESET_TIME);
if (!bgtime)
- m_NextRandomBGReset = time(nullptr); // game time not yet init
+ m_NextRandomBGReset = time(nullptr); // game time not yet init
// generate time by config
time_t curTime = time(nullptr);
@@ -3337,7 +3337,7 @@ void World::InitGuildResetTime()
{
time_t gtime = getWorldState(WS_GUILD_DAILY_RESET_TIME);
if (!gtime)
- m_NextGuildReset = time(nullptr); // game time not yet init
+ m_NextGuildReset = time(nullptr); // game time not yet init
// generate time by config
time_t curTime = time(nullptr);
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index cd14025fce1..1f32f9630fb 100644
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -560,13 +560,12 @@ enum WorldStates
/// Storage class for commands issued for delayed execution
struct TC_GAME_API CliCommandHolder
{
- typedef void(*Print)(void*, const char*);
+ typedef void(*Print)(void*, char const*);
typedef void(*CommandFinished)(void*, bool success);
void* m_callbackArg;
- char *m_command;
+ char* m_command;
Print m_print;
-
CommandFinished m_commandFinished;
CliCommandHolder(void* callbackArg, char const* command, Print zprint, CommandFinished commandFinished);
@@ -594,7 +593,7 @@ class TC_GAME_API World
bool RemoveSession(uint32 id);
/// Get the number of current active sessions
void UpdateMaxSessionCounters();
- const SessionMap& GetAllSessions() const { return m_sessions; }
+ SessionMap const& GetAllSessions() const { return m_sessions; }
uint32 GetActiveAndQueuedSessionCount() const { return uint32(m_sessions.size()); }
uint32 GetActiveSessionCount() const { return uint32(m_sessions.size() - m_QueuedPlayer.size()); }
uint32 GetQueuedSessionCount() const { return uint32(m_QueuedPlayer.size()); }
@@ -673,7 +672,7 @@ class TC_GAME_API World
void LoadConfigSettings(bool reload = false);
void SendWorldText(uint32 string_id, ...);
- void SendGlobalText(const char* text, WorldSession* self);
+ void SendGlobalText(char const* text, WorldSession* self);
void SendGMText(uint32 string_id, ...);
void SendServerMessage(ServerMessageType messageID, std::string stringParam = "", Player* player = nullptr);
void SendGlobalMessage(WorldPacket const* packet, WorldSession* self = nullptr, uint32 team = 0);
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index 94ab26f7a99..64a781364b2 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -686,7 +686,7 @@ public:
return false;
}
- // handler->getSession() == NULL only for console
+ // handler->getSession() == nullptr only for console
accountId = (isAccountNameGiven) ? AccountMgr::GetId(accountName) : handler->getSelectedPlayer()->GetSession()->GetAccountId();
int32 realmID = (isAccountNameGiven) ? atoi(arg3) : atoi(arg2);
uint32 playerSecurity;
diff --git a/src/server/scripts/Commands/cs_ahbot.cpp b/src/server/scripts/Commands/cs_ahbot.cpp
index b28508335b3..dcdfb27e013 100644
--- a/src/server/scripts/Commands/cs_ahbot.cpp
+++ b/src/server/scripts/Commands/cs_ahbot.cpp
@@ -21,7 +21,7 @@
#include "Language.h"
#include "RBAC.h"
-static const uint32 ahbotQualityIds[MAX_AUCTION_QUALITY] =
+uint32 const ahbotQualityIds[MAX_AUCTION_QUALITY] =
{
LANG_AHBOT_QUALITY_GRAY, LANG_AHBOT_QUALITY_WHITE,
LANG_AHBOT_QUALITY_GREEN, LANG_AHBOT_QUALITY_BLUE,
@@ -73,7 +73,7 @@ public:
return commandTable;
}
- static bool HandleAHBotItemsAmountCommand(ChatHandler* handler, const char* args)
+ static bool HandleAHBotItemsAmountCommand(ChatHandler* handler, char const* args)
{
uint32 qVals[MAX_AUCTION_QUALITY];
char* arg = strtok((char*)args, " ");
@@ -94,7 +94,7 @@ public:
}
template <AuctionQuality Q>
- static bool HandleAHBotItemsAmountQualityCommand(ChatHandler* handler, const char* args)
+ static bool HandleAHBotItemsAmountQualityCommand(ChatHandler* handler, char const* args)
{
char* arg = strtok((char*)args, " ");
if (!arg)
@@ -108,7 +108,7 @@ public:
return true;
}
- static bool HandleAHBotItemsRatioCommand(ChatHandler* handler, const char* args)
+ static bool HandleAHBotItemsRatioCommand(ChatHandler* handler, char const* args)
{
uint32 rVal[MAX_AUCTION_QUALITY];
char* arg = strtok((char*)args, " ");
@@ -128,7 +128,7 @@ public:
}
template<AuctionHouseType H>
- static bool HandleAHBotItemsRatioHouseCommand(ChatHandler* handler, const char* args)
+ static bool HandleAHBotItemsRatioHouseCommand(ChatHandler* handler, char const* args)
{
char* arg = strtok((char*)args, " ");
if (!arg)
@@ -140,7 +140,7 @@ public:
return true;
}
- static bool HandleAHBotRebuildCommand(ChatHandler* /*handler*/, const char* args)
+ static bool HandleAHBotRebuildCommand(ChatHandler* /*handler*/, char const* args)
{
char* arg = strtok((char*)args, " ");
@@ -152,14 +152,14 @@ public:
return true;
}
- static bool HandleAHBotReloadCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleAHBotReloadCommand(ChatHandler* handler, char const* /*args*/)
{
sAuctionBot->ReloadAllConfig();
handler->SendSysMessage(LANG_AHBOT_RELOAD_OK);
return true;
}
- static bool HandleAHBotStatusCommand(ChatHandler* handler, const char* args)
+ static bool HandleAHBotStatusCommand(ChatHandler* handler, char const* args)
{
char* arg = strtok((char*)args, " ");
if (!arg)
@@ -228,17 +228,17 @@ public:
};
-template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_GRAY>(ChatHandler* handler, const char*);
-template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_WHITE>(ChatHandler* handler, const char*);
-template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_GREEN>(ChatHandler* handler, const char*);
-template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_BLUE>(ChatHandler* handler, const char*);
-template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_PURPLE>(ChatHandler* handler, const char*);
-template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_ORANGE>(ChatHandler* handler, const char*);
-template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_YELLOW>(ChatHandler* handler, const char*);
-
-template bool ahbot_commandscript::HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_ALLIANCE>(ChatHandler* handler, const char*);
-template bool ahbot_commandscript::HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_HORDE>(ChatHandler* handler, const char*);
-template bool ahbot_commandscript::HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_NEUTRAL>(ChatHandler* handler, const char*);
+template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_GRAY>(ChatHandler* handler, char const*);
+template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_WHITE>(ChatHandler* handler, char const*);
+template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_GREEN>(ChatHandler* handler, char const*);
+template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_BLUE>(ChatHandler* handler, char const*);
+template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_PURPLE>(ChatHandler* handler, char const*);
+template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_ORANGE>(ChatHandler* handler, char const*);
+template bool ahbot_commandscript::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_YELLOW>(ChatHandler* handler, char const*);
+
+template bool ahbot_commandscript::HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_ALLIANCE>(ChatHandler* handler, char const*);
+template bool ahbot_commandscript::HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_HORDE>(ChatHandler* handler, char const*);
+template bool ahbot_commandscript::HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_NEUTRAL>(ChatHandler* handler, char const*);
void AddSC_ahbot_commandscript()
{
diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp
index 0954aa9ab7a..cfe151bcde1 100644
--- a/src/server/scripts/Commands/cs_ban.cpp
+++ b/src/server/scripts/Commands/cs_ban.cpp
@@ -22,6 +22,7 @@ Comment: All ban related commands
Category: commandscripts
EndScriptData */
+#include "ScriptMgr.h"
#include "AccountMgr.h"
#include "CharacterCache.h"
#include "Chat.h"
@@ -30,7 +31,6 @@ EndScriptData */
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
-#include "ScriptMgr.h"
#include "World.h"
#include "WorldSession.h"
@@ -429,7 +429,7 @@ public:
Field* fields = result->Fetch();
uint32 accountid = fields[0].GetUInt32();
- QueryResult banResult = LoginDatabase.PQuery("SELECT account.username FROM account, account_banned WHERE account_banned.id='%u' AND account_banned.id=account.id", accountid);
+ QueryResult banResult = LoginDatabase.PQuery("SELECT account.username FROM account, account_banned WHERE account_banned.id='%u' AND account_banned.id = account.id", accountid);
if (banResult)
{
Field* fields2 = banResult->Fetch();
diff --git a/src/server/scripts/Commands/cs_bf.cpp b/src/server/scripts/Commands/cs_bf.cpp
index 93459a006ac..9c4dd466114 100644
--- a/src/server/scripts/Commands/cs_bf.cpp
+++ b/src/server/scripts/Commands/cs_bf.cpp
@@ -49,7 +49,7 @@ public:
return commandTable;
}
- static bool HandleBattlefieldStart(ChatHandler* handler, const char* args)
+ static bool HandleBattlefieldStart(ChatHandler* handler, char const* args)
{
uint32 battleid = 0;
char* battleid_str = strtok((char*)args, " ");
@@ -71,7 +71,7 @@ public:
return true;
}
- static bool HandleBattlefieldEnd(ChatHandler* handler, const char* args)
+ static bool HandleBattlefieldEnd(ChatHandler* handler, char const* args)
{
uint32 battleid = 0;
char* battleid_str = strtok((char*)args, " ");
@@ -93,7 +93,7 @@ public:
return true;
}
- static bool HandleBattlefieldEnable(ChatHandler* handler, const char* args)
+ static bool HandleBattlefieldEnable(ChatHandler* handler, char const* args)
{
uint32 battleid = 0;
char* battleid_str = strtok((char*)args, " ");
@@ -123,7 +123,7 @@ public:
return true;
}
- static bool HandleBattlefieldSwitch(ChatHandler* handler, const char* args)
+ static bool HandleBattlefieldSwitch(ChatHandler* handler, char const* args)
{
uint32 battleid = 0;
char* battleid_str = strtok((char*)args, " ");
@@ -144,7 +144,7 @@ public:
return true;
}
- static bool HandleBattlefieldTimer(ChatHandler* handler, const char* args)
+ static bool HandleBattlefieldTimer(ChatHandler* handler, char const* args)
{
uint32 battleid = 0;
uint32 time = 0;
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp
index 33446f5d83c..f440f0bbff2 100644
--- a/src/server/scripts/Commands/cs_character.cpp
+++ b/src/server/scripts/Commands/cs_character.cpp
@@ -22,6 +22,7 @@ Comment: All character related commands
Category: commandscripts
EndScriptData */
+#include "ScriptMgr.h"
#include "AccountMgr.h"
#include "CharacterCache.h"
#include "Chat.h"
@@ -30,10 +31,9 @@ EndScriptData */
#include "Log.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
-#include "PlayerDump.h"
#include "Player.h"
+#include "PlayerDump.h"
#include "ReputationMgr.h"
-#include "ScriptMgr.h"
#include "World.h"
#include "WorldSession.h"
#include <sstream>
diff --git a/src/server/scripts/Commands/cs_cheat.cpp b/src/server/scripts/Commands/cs_cheat.cpp
index d861cd29184..04850f949c7 100644
--- a/src/server/scripts/Commands/cs_cheat.cpp
+++ b/src/server/scripts/Commands/cs_cheat.cpp
@@ -56,7 +56,7 @@ public:
return commandTable;
}
- static bool HandleGodModeCheatCommand(ChatHandler* handler, const char* args)
+ static bool HandleGodModeCheatCommand(ChatHandler* handler, char const* args)
{
if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
return false;
@@ -82,7 +82,7 @@ public:
return false;
}
- static bool HandleCasttimeCheatCommand(ChatHandler* handler, const char* args)
+ static bool HandleCasttimeCheatCommand(ChatHandler* handler, char const* args)
{
if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
return false;
@@ -108,7 +108,7 @@ public:
return false;
}
- static bool HandleCoolDownCheatCommand(ChatHandler* handler, const char* args)
+ static bool HandleCoolDownCheatCommand(ChatHandler* handler, char const* args)
{
if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
return false;
@@ -134,7 +134,7 @@ public:
return false;
}
- static bool HandlePowerCheatCommand(ChatHandler* handler, const char* args)
+ static bool HandlePowerCheatCommand(ChatHandler* handler, char const* args)
{
if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
return false;
@@ -160,12 +160,12 @@ public:
return false;
}
- static bool HandleCheatStatusCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleCheatStatusCommand(ChatHandler* handler, char const* /*args*/)
{
Player* player = handler->GetSession()->GetPlayer();
- const char* enabled = "ON";
- const char* disabled = "OFF";
+ char const* enabled = "ON";
+ char const* disabled = "OFF";
handler->SendSysMessage(LANG_COMMAND_CHEAT_STATUS);
handler->PSendSysMessage(LANG_COMMAND_CHEAT_GOD, player->GetCommandStatus(CHEAT_GOD) ? enabled : disabled);
@@ -177,7 +177,7 @@ public:
return true;
}
- static bool HandleWaterWalkCheatCommand(ChatHandler* handler, const char* args)
+ static bool HandleWaterWalkCheatCommand(ChatHandler* handler, char const* args)
{
if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
return false;
@@ -206,7 +206,7 @@ public:
return false;
}
- static bool HandleTaxiCheatCommand(ChatHandler* handler, const char* args)
+ static bool HandleTaxiCheatCommand(ChatHandler* handler, char const* args)
{
std::string argstr = (char*)args;
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index cdb52b6fa3a..63efe4fb08e 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -137,6 +137,7 @@ public:
return false;
}
+
// Dump camera locations
if (std::vector<FlyByCamera> const* flyByCameras = GetFlyByCameras(cineSeq->Camera[0]))
{
@@ -145,7 +146,7 @@ public:
for (FlyByCamera const& cam : *flyByCameras)
{
handler->PSendSysMessage("%02u - %7ums [%s (%f degrees)]", count, cam.timeStamp, cam.locations.ToString().c_str(), cam.locations.GetOrientation() * (180 / M_PI));
- count++;
+ ++count;
}
handler->PSendSysMessage(SZFMTD " waypoints dumped", flyByCameras->size());
}
@@ -274,7 +275,6 @@ public:
return true;
}
-
static bool HandleDebugSendPlayerChoiceCommand(ChatHandler* handler, char const* args)
{
if (!*args)
@@ -981,7 +981,7 @@ public:
static bool HandleDebugSendLargePacketCommand(ChatHandler* handler, char const* /*args*/)
{
- const char* stuffingString = "This is a dummy string to push the packet's size beyond 128000 bytes. ";
+ char const* stuffingString = "This is a dummy string to push the packet's size beyond 128000 bytes. ";
std::ostringstream ss;
while (ss.str().size() < 128000)
ss << stuffingString;
@@ -1312,13 +1312,13 @@ public:
if (stricmp(args, "linked"))
{
if (Battleground* bg = player->GetBattleground())
- nearestLoc = bg->GetClosestGraveYard(player);
+ nearestLoc = bg->GetClosestGraveyard(player);
else
{
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetZoneId()))
- nearestLoc = bf->GetClosestGraveYard(player);
+ nearestLoc = bf->GetClosestGraveyard(player);
else
- nearestLoc = sObjectMgr->GetClosestGraveYard(*player, player->GetTeam(), player);
+ nearestLoc = sObjectMgr->GetClosestGraveyard(*player, player->GetTeam(), player);
}
}
else
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index f4c8005fa45..9c076691a18 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -22,6 +22,7 @@ Comment: All gm related commands
Category: commandscripts
EndScriptData */
+#include "ScriptMgr.h"
#include "AccountMgr.h"
#include "Chat.h"
#include "DatabaseEnv.h"
@@ -30,11 +31,10 @@ EndScriptData */
#include "Opcodes.h"
#include "Player.h"
#include "Realm.h"
-#include "ScriptMgr.h"
#include "World.h"
#include "WorldSession.h"
-#include <boost/thread/shared_mutex.hpp>
#include <boost/thread/locks.hpp>
+#include <boost/thread/shared_mutex.hpp>
class gm_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index 4f15fb08a9e..0c5643d4a34 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -71,8 +71,8 @@ public:
{ "near", rbac::RBAC_PERM_COMMAND_GOBJECT_NEAR, false, &HandleGameObjectNearCommand, "" },
{ "target", rbac::RBAC_PERM_COMMAND_GOBJECT_TARGET, false, &HandleGameObjectTargetCommand, "" },
{ "turn", rbac::RBAC_PERM_COMMAND_GOBJECT_TURN, false, &HandleGameObjectTurnCommand, "" },
- { "spawngroup", rbac::RBAC_PERM_COMMAND_GOBJECT_SPAWNGROUP, false, &HandleNpcSpawnGroup, "" },
- { "despawngroup", rbac::RBAC_PERM_COMMAND_GOBJECT_DESPAWNGROUP, false, &HandleNpcDespawnGroup,""},
+ { "spawngroup", rbac::RBAC_PERM_COMMAND_GOBJECT_SPAWNGROUP, false, &HandleNpcSpawnGroup, "" },
+ { "despawngroup", rbac::RBAC_PERM_COMMAND_GOBJECT_DESPAWNGROUP, false, &HandleNpcDespawnGroup, "" },
{ "add", rbac::RBAC_PERM_COMMAND_GOBJECT_ADD, false, nullptr, "", gobjectAddCommandTable },
{ "set", rbac::RBAC_PERM_COMMAND_GOBJECT_SET, false, nullptr, "", gobjectSetCommandTable },
};
diff --git a/src/server/scripts/Commands/cs_group.cpp b/src/server/scripts/Commands/cs_group.cpp
index d8634040b73..2664b3d7246 100644
--- a/src/server/scripts/Commands/cs_group.cpp
+++ b/src/server/scripts/Commands/cs_group.cpp
@@ -342,7 +342,7 @@ public:
ObjectGuid guidTarget;
std::string nameTarget;
std::string zoneName;
- const char* onlineState = "";
+ char const* onlineState = "";
// Parse the guid to uint32...
ObjectGuid parseGUID = ObjectGuid::Create<HighGuid::Player>(strtoull(args, nullptr, 10));
diff --git a/src/server/scripts/Commands/cs_guild.cpp b/src/server/scripts/Commands/cs_guild.cpp
index e050f71a0b5..870089f5da7 100644
--- a/src/server/scripts/Commands/cs_guild.cpp
+++ b/src/server/scripts/Commands/cs_guild.cpp
@@ -26,9 +26,9 @@ EndScriptData */
#include "AchievementMgr.h"
#include "CharacterCache.h"
#include "Chat.h"
-#include "Language.h"
#include "Guild.h"
#include "GuildMgr.h"
+#include "Language.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
diff --git a/src/server/scripts/Commands/cs_honor.cpp b/src/server/scripts/Commands/cs_honor.cpp
index 37db2bf87d2..25873b2963b 100644
--- a/src/server/scripts/Commands/cs_honor.cpp
+++ b/src/server/scripts/Commands/cs_honor.cpp
@@ -25,7 +25,6 @@ EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "Language.h"
-#include "ObjectMgr.h"
#include "Player.h"
#include "RBAC.h"
#include "WorldSession.h"
diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp
index ec1e46f1ffb..90ed94a4d3b 100644
--- a/src/server/scripts/Commands/cs_instance.cpp
+++ b/src/server/scripts/Commands/cs_instance.cpp
@@ -35,6 +35,7 @@ EndScriptData */
#include "Player.h"
#include "RBAC.h"
#include "WorldSession.h"
+#include <sstream>
class instance_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp
index 7533ac38937..c9f78eb61e2 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -288,9 +288,9 @@ public:
static bool HandleLearnAllLangCommand(ChatHandler* handler, char const* /*args*/)
{
- // skipping UNIVERSAL language (0)
- for (uint8 i = 1; i < LANGUAGES_COUNT; ++i)
- handler->GetSession()->GetPlayer()->LearnSpell(lang_description[i].spell_id, false);
+ for (LanguageDesc const& langDesc : lang_description)
+ if (uint32 langSpellId = langDesc.spell_id)
+ handler->GetSession()->GetPlayer()->LearnSpell(langSpellId, false);
handler->SendSysMessage(LANG_COMMAND_LEARN_ALL_LANG);
return true;
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 801d1da66e9..3db136674be 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ScriptMgr.h"
#include "AccountMgr.h"
#include "ArenaTeamMgr.h"
#include "CellImpl.h"
@@ -44,7 +45,6 @@
#include "PhasingHandler.h"
#include "Player.h"
#include "Realm.h"
-#include "ScriptMgr.h"
#include "SpellAuras.h"
#include "SpellHistory.h"
#include "SpellMgr.h"
@@ -55,7 +55,7 @@
#include "World.h"
#include "WorldSession.h"
- // temporary hack until database includes are sorted out (don't want to pull in Windows.h everywhere from mysql.h)
+// temporary hack until includes are sorted out (don't want to pull in Windows.h)
#ifdef GetClassName
#undef GetClassName
#endif
@@ -1103,7 +1103,7 @@ public:
return false;
}
- if (sObjectMgr->AddGraveYardLink(graveyardId, zoneId, team))
+ if (sObjectMgr->AddGraveyardLink(graveyardId, zoneId, team))
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, graveyardId, zoneId);
else
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, graveyardId, zoneId);
@@ -1129,12 +1129,12 @@ public:
Player* player = handler->GetSession()->GetPlayer();
uint32 zone_id = player->GetZoneId();
- WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveYard(*player, team, nullptr);
+ WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveyard(*player, team, nullptr);
if (graveyard)
{
uint32 graveyardId = graveyard->ID;
- GraveYardData const* data = sObjectMgr->FindGraveYardData(graveyardId, zone_id);
+ GraveyardData const* data = sObjectMgr->FindGraveyardData(graveyardId, zone_id);
if (!data)
{
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR, graveyardId);
diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp
index 27598e92309..125bd880ce0 100644
--- a/src/server/scripts/Commands/cs_mmaps.cpp
+++ b/src/server/scripts/Commands/cs_mmaps.cpp
@@ -104,9 +104,9 @@ public:
handler->PSendSysMessage("Building: %s", useStraightPath ? "StraightPath" : useStraightLine ? "Raycast" : "SmoothPath");
handler->PSendSysMessage("Result: %s - Length: %zu - Type: %u", (result ? "true" : "false"), pointPath.size(), path.GetPathType());
- G3D::Vector3 const &start = path.GetStartPosition();
- G3D::Vector3 const &end = path.GetEndPosition();
- G3D::Vector3 const &actualEnd = path.GetActualEndPosition();
+ G3D::Vector3 const& start = path.GetStartPosition();
+ G3D::Vector3 const& end = path.GetEndPosition();
+ G3D::Vector3 const& actualEnd = path.GetActualEndPosition();
handler->PSendSysMessage("StartPosition (%.3f, %.3f, %.3f)", start.x, start.y, start.z);
handler->PSendSysMessage("EndPosition (%.3f, %.3f, %.3f)", end.x, end.y, end.z);
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index 920569dd5be..2e04bbbae40 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -96,7 +96,7 @@ public:
}
}
- static bool CheckModifyResources(ChatHandler* handler, const char* args, Player* target, int32& res, int32& resmax, int8 const multiplier = 1)
+ static bool CheckModifyResources(ChatHandler* handler, char const* args, Player* target, int32& res, int32& resmax, int8 const multiplier = 1)
{
if (!*args)
return false;
@@ -125,7 +125,7 @@ public:
}
//Edit Player HP
- static bool HandleModifyHPCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyHPCommand(ChatHandler* handler, char const* args)
{
int32 hp, hpmax;
Player* target = handler->getSelectedPlayerOrSelf();
@@ -140,7 +140,7 @@ public:
}
//Edit Player Mana
- static bool HandleModifyManaCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyManaCommand(ChatHandler* handler, char const* args)
{
int32 mana, manamax;
Player* target = handler->getSelectedPlayerOrSelf();
@@ -156,7 +156,7 @@ public:
}
//Edit Player Energy
- static bool HandleModifyEnergyCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyEnergyCommand(ChatHandler* handler, char const* args)
{
int32 energy, energymax;
Player* target = handler->getSelectedPlayerOrSelf();
@@ -172,7 +172,7 @@ public:
}
//Edit Player Rage
- static bool HandleModifyRageCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyRageCommand(ChatHandler* handler, char const* args)
{
int32 rage, ragemax;
Player* target = handler->getSelectedPlayerOrSelf();
@@ -188,7 +188,7 @@ public:
}
// Edit Player Runic Power
- static bool HandleModifyRunicPowerCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyRunicPowerCommand(ChatHandler* handler, char const* args)
{
int32 rune, runemax;
Player* target = handler->getSelectedPlayerOrSelf();
@@ -204,7 +204,7 @@ public:
}
//Edit Player Faction
- static bool HandleModifyFactionCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyFactionCommand(ChatHandler* handler, char const* args)
{
char* pfactionid = handler->extractKeyFromLink((char*)args, "Hfaction");
@@ -271,7 +271,7 @@ public:
}
//Edit Player Spell
- static bool HandleModifySpellCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifySpellCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -330,7 +330,7 @@ public:
}
//Edit Player TP
- static bool HandleModifyTalentCommand(ChatHandler* /*handler*/, const char* /*args*/)
+ static bool HandleModifyTalentCommand(ChatHandler* /*handler*/, char const* /*args*/)
{
/* TODO: 6.x remove this
if (!*args)
@@ -376,7 +376,7 @@ public:
return false;
}
- static bool CheckModifySpeed(ChatHandler* handler, const char* args, Unit* target, float& speed, float minimumBound, float maximumBound, bool checkInFlight = true)
+ static bool CheckModifySpeed(ChatHandler* handler, char const* args, Unit* target, float& speed, float minimumBound, float maximumBound, bool checkInFlight = true)
{
if (!*args)
return false;
@@ -414,7 +414,7 @@ public:
}
//Edit Player Aspeed
- static bool HandleModifyASpeedCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyASpeedCommand(ChatHandler* handler, char const* args)
{
float allSpeed;
Player* target = handler->getSelectedPlayerOrSelf();
@@ -431,7 +431,7 @@ public:
}
//Edit Player Speed
- static bool HandleModifySpeedCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifySpeedCommand(ChatHandler* handler, char const* args)
{
float Speed;
Player* target = handler->getSelectedPlayerOrSelf();
@@ -445,7 +445,7 @@ public:
}
//Edit Player Swim Speed
- static bool HandleModifySwimCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifySwimCommand(ChatHandler* handler, char const* args)
{
float swimSpeed;
Player* target = handler->getSelectedPlayerOrSelf();
@@ -459,7 +459,7 @@ public:
}
//Edit Player Backwards Walk Speed
- static bool HandleModifyBWalkCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyBWalkCommand(ChatHandler* handler, char const* args)
{
float backSpeed;
Player* target = handler->getSelectedPlayerOrSelf();
@@ -473,7 +473,7 @@ public:
}
//Edit Player Fly
- static bool HandleModifyFlyCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyFlyCommand(ChatHandler* handler, char const* args)
{
float flySpeed;
Player* target = handler->getSelectedPlayerOrSelf();
@@ -487,7 +487,7 @@ public:
}
//Edit Player or Creature Scale
- static bool HandleModifyScaleCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyScaleCommand(ChatHandler* handler, char const* args)
{
float Scale;
Unit* target = handler->getSelectedUnit();
@@ -504,7 +504,7 @@ public:
}
//Enable Player mount
- static bool HandleModifyMountCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyMountCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -547,7 +547,7 @@ public:
}
//Edit Player money
- static bool HandleModifyMoneyCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyMoneyCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -613,7 +613,7 @@ public:
return true;
}
- static bool HandleModifyHonorCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyHonorCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -639,7 +639,7 @@ public:
return true;
}
- static bool HandleModifyDrunkCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyDrunkCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -654,7 +654,7 @@ public:
return true;
}
- static bool HandleModifyRepCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyRepCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -755,7 +755,7 @@ public:
}
//morph creature or player
- static bool HandleModifyMorphCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyMorphCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -776,7 +776,7 @@ public:
}
// Toggles a phaseid on a player
- static bool HandleModifyPhaseCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyPhaseCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -829,7 +829,7 @@ public:
}
//change standstate
- static bool HandleModifyStandStateCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyStandStateCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -840,7 +840,7 @@ public:
return true;
}
- static bool HandleModifyGenderCommand(ChatHandler* handler, const char* args)
+ static bool HandleModifyGenderCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -901,7 +901,7 @@ public:
return true;
}
//demorph player or unit
- static bool HandleDeMorphCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleDeMorphCommand(ChatHandler* handler, char const* /*args*/)
{
Unit* target = handler->getSelectedUnit();
if (!target)
@@ -944,7 +944,7 @@ public:
}
// mod xp command
- static bool HandleModifyXPCommand(ChatHandler *handler, const char* args)
+ static bool HandleModifyXPCommand(ChatHandler *handler, char const* args)
{
if (!*args)
return false;
diff --git a/src/server/scripts/Commands/cs_pet.cpp b/src/server/scripts/Commands/cs_pet.cpp
index fff051a2872..b282a1a5497 100644
--- a/src/server/scripts/Commands/cs_pet.cpp
+++ b/src/server/scripts/Commands/cs_pet.cpp
@@ -27,7 +27,7 @@
#include "SpellMgr.h"
#include "WorldSession.h"
-static inline Pet* GetSelectedPlayerPetOrOwn(ChatHandler* handler)
+inline Pet* GetSelectedPlayerPetOrOwn(ChatHandler* handler)
{
if (Unit* target = handler->getSelectedUnit())
{
@@ -40,6 +40,7 @@ static inline Pet* GetSelectedPlayerPetOrOwn(ChatHandler* handler)
Player* player = handler->GetSession()->GetPlayer();
return player ? player->GetPet() : nullptr;
}
+
class pet_commandscript : public CommandScript
{
public:
diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp
index 5b00235f334..18840234b31 100644
--- a/src/server/scripts/Commands/cs_quest.cpp
+++ b/src/server/scripts/Commands/cs_quest.cpp
@@ -53,7 +53,7 @@ public:
return commandTable;
}
- static bool HandleQuestAdd(ChatHandler* handler, const char* args)
+ static bool HandleQuestAdd(ChatHandler* handler, char const* args)
{
Player* player = handler->getSelectedPlayerOrSelf();
if (!player)
@@ -101,7 +101,7 @@ public:
return true;
}
- static bool HandleQuestRemove(ChatHandler* handler, const char* args)
+ static bool HandleQuestRemove(ChatHandler* handler, char const* args)
{
Player* player = handler->getSelectedPlayer();
if (!player)
@@ -159,7 +159,7 @@ public:
return true;
}
- static bool HandleQuestComplete(ChatHandler* handler, const char* args)
+ static bool HandleQuestComplete(ChatHandler* handler, char const* args)
{
Player* player = handler->getSelectedPlayerOrSelf();
if (!player)
diff --git a/src/server/scripts/Commands/cs_rbac.cpp b/src/server/scripts/Commands/cs_rbac.cpp
index f17ce428b06..93bf814600b 100644
--- a/src/server/scripts/Commands/cs_rbac.cpp
+++ b/src/server/scripts/Commands/cs_rbac.cpp
@@ -22,13 +22,13 @@ Comment: All role based access control related commands (including account relat
Category: commandscripts
EndScriptData */
+#include "ScriptMgr.h"
#include "AccountMgr.h"
#include "Chat.h"
#include "Config.h"
#include "Language.h"
#include "Player.h"
#include "Realm.h"
-#include "ScriptMgr.h"
#include "World.h"
#include "WorldSession.h"
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index bb65c2da77e..eb1dd09134d 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -22,6 +22,7 @@ Comment: All reload related commands
Category: commandscripts
EndScriptData */
+#include "ScriptMgr.h"
#include "AccountMgr.h"
#include "AchievementMgr.h"
#include "AreaTriggerDataStore.h"
@@ -40,7 +41,6 @@ EndScriptData */
#include "LootMgr.h"
#include "MapManager.h"
#include "ObjectMgr.h"
-#include "ScriptMgr.h"
#include "SkillDiscovery.h"
#include "SkillExtraItems.h"
#include "SmartAI.h"
@@ -171,7 +171,7 @@ public:
}
//reload commands
- static bool HandleReloadSupportSystemCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSupportSystemCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Support System Tables...");
sSupportMgr->LoadBugTickets();
@@ -181,7 +181,7 @@ public:
return true;
}
- static bool HandleReloadAllCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAllCommand(ChatHandler* handler, char const* /*args*/)
{
HandleReloadSkillFishingBaseLevelCommand(handler, "");
@@ -213,14 +213,14 @@ public:
return true;
}
- static bool HandleReloadAllAchievementCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAllAchievementCommand(ChatHandler* handler, char const* /*args*/)
{
HandleReloadCriteriaDataCommand(handler, "");
HandleReloadAchievementRewardCommand(handler, "");
return true;
}
- static bool HandleReloadAllAreaCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAllAreaCommand(ChatHandler* handler, char const* /*args*/)
{
//HandleReloadQuestAreaTriggersCommand(handler, ""); -- reloaded in HandleReloadAllQuestCommand
HandleReloadAreaTriggerTeleportCommand(handler, "");
@@ -229,7 +229,7 @@ public:
return true;
}
- static bool HandleReloadAllLootCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAllLootCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Loot Tables...");
LoadLootTables();
@@ -238,7 +238,7 @@ public:
return true;
}
- static bool HandleReloadAllNpcCommand(ChatHandler* handler, const char* args)
+ static bool HandleReloadAllNpcCommand(ChatHandler* handler, char const* args)
{
if (*args != 'a') // will be reloaded from all_gossips
HandleReloadTrainerCommand(handler, "a");
@@ -248,7 +248,7 @@ public:
return true;
}
- static bool HandleReloadAllQuestCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAllQuestCommand(ChatHandler* handler, char const* /*args*/)
{
HandleReloadQuestAreaTriggersCommand(handler, "a");
HandleReloadQuestGreetingCommand(handler, "a");
@@ -261,7 +261,7 @@ public:
return true;
}
- static bool HandleReloadAllScriptsCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAllScriptsCommand(ChatHandler* handler, char const* /*args*/)
{
if (sMapMgr->IsScriptScheduled())
{
@@ -279,7 +279,7 @@ public:
return true;
}
- static bool HandleReloadAllSpellCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAllSpellCommand(ChatHandler* handler, char const* /*args*/)
{
HandleReloadSkillDiscoveryTemplateCommand(handler, "a");
HandleReloadSkillExtraItemTemplateCommand(handler, "a");
@@ -296,7 +296,7 @@ public:
return true;
}
- static bool HandleReloadAllGossipsCommand(ChatHandler* handler, const char* args)
+ static bool HandleReloadAllGossipsCommand(ChatHandler* handler, char const* args)
{
HandleReloadGossipMenuCommand(handler, "a");
HandleReloadGossipMenuOptionCommand(handler, "a");
@@ -305,14 +305,14 @@ public:
return true;
}
- static bool HandleReloadAllItemCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAllItemCommand(ChatHandler* handler, char const* /*args*/)
{
HandleReloadPageTextsCommand(handler, "a");
HandleReloadItemRandomBonusListTemplatesCommand(handler, "a");
return true;
}
- static bool HandleReloadAllLocalesCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAllLocalesCommand(ChatHandler* handler, char const* /*args*/)
{
HandleReloadLocalesAchievementRewardCommand(handler, "a");
HandleReloadLocalesCreatureCommand(handler, "a");
@@ -325,7 +325,7 @@ public:
return true;
}
- static bool HandleReloadConfigCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadConfigCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading config settings...");
sWorld->LoadConfigSettings(true);
@@ -334,7 +334,7 @@ public:
return true;
}
- static bool HandleReloadAccessRequirementCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAccessRequirementCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Access Requirement definitions...");
sObjectMgr->LoadAccessRequirements();
@@ -342,7 +342,7 @@ public:
return true;
}
- static bool HandleReloadCriteriaDataCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadCriteriaDataCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Additional Criteria Data...");
sCriteriaMgr->LoadCriteriaData();
@@ -350,7 +350,7 @@ public:
return true;
}
- static bool HandleReloadAchievementRewardCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAchievementRewardCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Achievement Reward Data...");
sAchievementMgr->LoadRewards();
@@ -358,7 +358,7 @@ public:
return true;
}
- static bool HandleReloadAreaTriggerTavernCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAreaTriggerTavernCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Tavern Area Triggers...");
sObjectMgr->LoadTavernAreaTriggers();
@@ -366,7 +366,7 @@ public:
return true;
}
- static bool HandleReloadAreaTriggerTeleportCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAreaTriggerTeleportCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading AreaTrigger teleport definitions...");
sObjectMgr->LoadAreaTriggerTeleports();
@@ -374,7 +374,7 @@ public:
return true;
}
- static bool HandleReloadAutobroadcastCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAutobroadcastCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Autobroadcasts...");
sWorld->LoadAutobroadcasts();
@@ -398,14 +398,14 @@ public:
return true;
}
- static bool HandleReloadCommandCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadCommandCommand(ChatHandler* handler, char const* /*args*/)
{
ChatHandler::invalidateCommandTable();
handler->SendGlobalGMSysMessage("DB table `command` will be reloaded at next chat command use.");
return true;
}
- static bool HandleReloadOnKillReputationCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadOnKillReputationCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading creature award reputation definitions...");
sObjectMgr->LoadReputationOnKill();
@@ -413,7 +413,7 @@ public:
return true;
}
- static bool HandleReloadCreatureSummonGroupsCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadCreatureSummonGroupsCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Reloading creature summon groups...");
sObjectMgr->LoadTempSummons();
@@ -421,7 +421,7 @@ public:
return true;
}
- static bool HandleReloadCreatureTemplateCommand(ChatHandler* handler, const char* args)
+ static bool HandleReloadCreatureTemplateCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -462,7 +462,7 @@ public:
return true;
}
- static bool HandleReloadCreatureQuestStarterCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadCreatureQuestStarterCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Loading Quests Relations... (`creature_queststarter`)");
sObjectMgr->LoadCreatureQuestStarters();
@@ -470,7 +470,7 @@ public:
return true;
}
- static bool HandleReloadLinkedRespawnCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLinkedRespawnCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Loading Linked Respawns... (`creature_linked_respawn`)");
sObjectMgr->LoadLinkedRespawn();
@@ -478,7 +478,7 @@ public:
return true;
}
- static bool HandleReloadCreatureQuestEnderCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadCreatureQuestEnderCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Loading Quests Relations... (`creature_questender`)");
sObjectMgr->LoadCreatureQuestEnders();
@@ -486,7 +486,7 @@ public:
return true;
}
- static bool HandleReloadGossipMenuCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadGossipMenuCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading `gossip_menu` Table!");
sObjectMgr->LoadGossipMenu();
@@ -495,7 +495,7 @@ public:
return true;
}
- static bool HandleReloadGossipMenuOptionCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadGossipMenuOptionCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading `gossip_menu_option` Table!");
sObjectMgr->LoadGossipMenuItems();
@@ -504,7 +504,7 @@ public:
return true;
}
- static bool HandleReloadGOQuestStarterCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadGOQuestStarterCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Loading Quests Relations... (`gameobject_queststarter`)");
sObjectMgr->LoadGameobjectQuestStarters();
@@ -512,7 +512,7 @@ public:
return true;
}
- static bool HandleReloadGOQuestEnderCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadGOQuestEnderCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Loading Quests Relations... (`gameobject_questender`)");
sObjectMgr->LoadGameobjectQuestEnders();
@@ -520,7 +520,7 @@ public:
return true;
}
- static bool HandleReloadQuestAreaTriggersCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadQuestAreaTriggersCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Quest Area Triggers...");
sObjectMgr->LoadQuestAreaTriggers();
@@ -528,7 +528,7 @@ public:
return true;
}
- static bool HandleReloadQuestGreetingCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadQuestGreetingCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Quest Greeting ... ");
sObjectMgr->LoadQuestGreetings();
@@ -536,7 +536,7 @@ public:
return true;
}
- static bool HandleReloadQuestTemplateCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadQuestTemplateCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Quest Templates...");
sObjectMgr->LoadQuests();
@@ -550,7 +550,7 @@ public:
return true;
}
- static bool HandleReloadLootTemplatesCreatureCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLootTemplatesCreatureCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`creature_loot_template`)");
LoadLootTemplates_Creature();
@@ -560,7 +560,7 @@ public:
return true;
}
- static bool HandleReloadLootTemplatesDisenchantCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLootTemplatesDisenchantCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`disenchant_loot_template`)");
LoadLootTemplates_Disenchant();
@@ -570,7 +570,7 @@ public:
return true;
}
- static bool HandleReloadLootTemplatesFishingCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLootTemplatesFishingCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`fishing_loot_template`)");
LoadLootTemplates_Fishing();
@@ -580,7 +580,7 @@ public:
return true;
}
- static bool HandleReloadLootTemplatesGameobjectCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLootTemplatesGameobjectCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`gameobject_loot_template`)");
LoadLootTemplates_Gameobject();
@@ -590,7 +590,7 @@ public:
return true;
}
- static bool HandleReloadLootTemplatesItemCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLootTemplatesItemCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`item_loot_template`)");
LoadLootTemplates_Item();
@@ -600,7 +600,7 @@ public:
return true;
}
- static bool HandleReloadLootTemplatesMillingCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLootTemplatesMillingCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`milling_loot_template`)");
LoadLootTemplates_Milling();
@@ -610,7 +610,7 @@ public:
return true;
}
- static bool HandleReloadLootTemplatesPickpocketingCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLootTemplatesPickpocketingCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`pickpocketing_loot_template`)");
LoadLootTemplates_Pickpocketing();
@@ -620,7 +620,7 @@ public:
return true;
}
- static bool HandleReloadLootTemplatesProspectingCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLootTemplatesProspectingCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`prospecting_loot_template`)");
LoadLootTemplates_Prospecting();
@@ -630,7 +630,7 @@ public:
return true;
}
- static bool HandleReloadLootTemplatesMailCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLootTemplatesMailCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`mail_loot_template`)");
LoadLootTemplates_Mail();
@@ -640,7 +640,7 @@ public:
return true;
}
- static bool HandleReloadLootTemplatesReferenceCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLootTemplatesReferenceCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`reference_loot_template`)");
LoadLootTemplates_Reference();
@@ -649,7 +649,7 @@ public:
return true;
}
- static bool HandleReloadLootTemplatesSkinningCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLootTemplatesSkinningCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`skinning_loot_template`)");
LoadLootTemplates_Skinning();
@@ -659,7 +659,7 @@ public:
return true;
}
- static bool HandleReloadLootTemplatesSpellCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLootTemplatesSpellCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`spell_loot_template`)");
LoadLootTemplates_Spell();
@@ -669,7 +669,7 @@ public:
return true;
}
- static bool HandleReloadTrinityStringCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadTrinityStringCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading trinity_string Table!");
sObjectMgr->LoadTrinityStrings();
@@ -677,7 +677,7 @@ public:
return true;
}
- static bool HandleReloadWardenactionCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadWardenactionCommand(ChatHandler* handler, char const* /*args*/)
{
if (!sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED))
{
@@ -692,7 +692,7 @@ public:
return true;
}
- static bool HandleReloadTrainerCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadTrainerCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading `trainer` Table!");
sObjectMgr->LoadTrainers();
@@ -704,7 +704,7 @@ public:
return true;
}
- static bool HandleReloadNpcVendorCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadNpcVendorCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading `npc_vendor` Table!");
sObjectMgr->LoadVendors();
@@ -712,7 +712,7 @@ public:
return true;
}
- static bool HandleReloadPointsOfInterestCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadPointsOfInterestCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading `points_of_interest` Table!");
sObjectMgr->LoadPointsOfInterest();
@@ -720,7 +720,7 @@ public:
return true;
}
- static bool HandleReloadQuestPOICommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadQuestPOICommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Quest POI ..." );
sObjectMgr->LoadQuestPOI();
@@ -729,7 +729,7 @@ public:
return true;
}
- static bool HandleReloadSpellClickSpellsCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSpellClickSpellsCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading `npc_spellclick_spells` Table!");
sObjectMgr->LoadNPCSpellClickSpells();
@@ -737,7 +737,7 @@ public:
return true;
}
- static bool HandleReloadReservedNameCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadReservedNameCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Loading ReservedNames... (`reserved_name`)");
sObjectMgr->LoadReservedPlayersNames();
@@ -745,7 +745,7 @@ public:
return true;
}
- static bool HandleReloadReputationRewardRateCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadReputationRewardRateCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading `reputation_reward_rate` Table!" );
sObjectMgr->LoadReputationRewardRate();
@@ -753,7 +753,7 @@ public:
return true;
}
- static bool HandleReloadReputationSpilloverTemplateCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadReputationSpilloverTemplateCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading `reputation_spillover_template` Table!" );
sObjectMgr->LoadReputationSpilloverTemplate();
@@ -761,7 +761,7 @@ public:
return true;
}
- static bool HandleReloadSkillDiscoveryTemplateCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSkillDiscoveryTemplateCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Skill Discovery Table...");
LoadSkillDiscoveryTable();
@@ -769,7 +769,7 @@ public:
return true;
}
- static bool HandleReloadSkillPerfectItemTemplateCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSkillPerfectItemTemplateCommand(ChatHandler* handler, char const* /*args*/)
{ // latched onto HandleReloadSkillExtraItemTemplateCommand as it's part of that table group (and i don't want to chance all the command IDs)
TC_LOG_INFO("misc", "Re-Loading Skill Perfection Data Table...");
LoadSkillPerfectItemTable();
@@ -777,7 +777,7 @@ public:
return true;
}
- static bool HandleReloadSkillExtraItemTemplateCommand(ChatHandler* handler, const char* args)
+ static bool HandleReloadSkillExtraItemTemplateCommand(ChatHandler* handler, char const* args)
{
TC_LOG_INFO("misc", "Re-Loading Skill Extra Item Table...");
LoadSkillExtraItemTable();
@@ -786,7 +786,7 @@ public:
return HandleReloadSkillPerfectItemTemplateCommand(handler, args);
}
- static bool HandleReloadSkillFishingBaseLevelCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSkillFishingBaseLevelCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Skill Fishing base level requirements...");
sObjectMgr->LoadFishingBaseSkillLevel();
@@ -794,7 +794,7 @@ public:
return true;
}
- static bool HandleReloadSpellAreaCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSpellAreaCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading SpellArea Data...");
sSpellMgr->LoadSpellAreas();
@@ -802,7 +802,7 @@ public:
return true;
}
- static bool HandleReloadSpellRequiredCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSpellRequiredCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Spell Required Data... ");
sSpellMgr->LoadSpellRequired();
@@ -810,7 +810,7 @@ public:
return true;
}
- static bool HandleReloadSpellGroupsCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSpellGroupsCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Spell Groups...");
sSpellMgr->LoadSpellGroups();
@@ -818,7 +818,7 @@ public:
return true;
}
- static bool HandleReloadSpellLearnSpellCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSpellLearnSpellCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Spell Learn Spells...");
sSpellMgr->LoadSpellLearnSpells();
@@ -826,7 +826,7 @@ public:
return true;
}
- static bool HandleReloadSpellLinkedSpellCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSpellLinkedSpellCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Spell Linked Spells...");
sSpellMgr->LoadSpellLinked();
@@ -834,7 +834,7 @@ public:
return true;
}
- static bool HandleReloadSpellProcsCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSpellProcsCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Spell Proc conditions and data...");
sSpellMgr->LoadSpellProcs();
@@ -842,7 +842,7 @@ public:
return true;
}
- static bool HandleReloadSpellTargetPositionCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSpellTargetPositionCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Spell target coordinates...");
sSpellMgr->LoadSpellTargetPositions();
@@ -850,7 +850,7 @@ public:
return true;
}
- static bool HandleReloadSpellThreatsCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSpellThreatsCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Aggro Spells Definitions...");
sSpellMgr->LoadSpellThreats();
@@ -858,7 +858,7 @@ public:
return true;
}
- static bool HandleReloadSpellGroupStackRulesCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSpellGroupStackRulesCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Spell Group Stack Rules...");
sSpellMgr->LoadSpellGroupStackRules();
@@ -866,7 +866,7 @@ public:
return true;
}
- static bool HandleReloadSpellPetAurasCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSpellPetAurasCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Spell pet auras...");
sSpellMgr->LoadSpellPetAuras();
@@ -874,7 +874,7 @@ public:
return true;
}
- static bool HandleReloadPageTextsCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadPageTextsCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Page Text...");
sObjectMgr->LoadPageTexts();
@@ -882,7 +882,7 @@ public:
return true;
}
- static bool HandleReloadItemRandomBonusListTemplatesCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadItemRandomBonusListTemplatesCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Random item bonus list definitions...");
LoadItemRandomBonusListTemplates();
@@ -890,7 +890,7 @@ public:
return true;
}
- static bool HandleReloadEventScriptsCommand(ChatHandler* handler, const char* args)
+ static bool HandleReloadEventScriptsCommand(ChatHandler* handler, char const* args)
{
if (sMapMgr->IsScriptScheduled())
{
@@ -910,7 +910,7 @@ public:
return true;
}
- static bool HandleReloadWpScriptsCommand(ChatHandler* handler, const char* args)
+ static bool HandleReloadWpScriptsCommand(ChatHandler* handler, char const* args)
{
if (sMapMgr->IsScriptScheduled())
{
@@ -930,7 +930,7 @@ public:
return true;
}
- static bool HandleReloadWpCommand(ChatHandler* handler, const char* args)
+ static bool HandleReloadWpCommand(ChatHandler* handler, char const* args)
{
if (*args != 'a')
TC_LOG_INFO("misc", "Re-Loading Waypoints data from 'waypoints_data'");
@@ -943,7 +943,7 @@ public:
return true;
}
- static bool HandleReloadSpellScriptsCommand(ChatHandler* handler, const char* args)
+ static bool HandleReloadSpellScriptsCommand(ChatHandler* handler, char const* args)
{
if (sMapMgr->IsScriptScheduled())
{
@@ -963,7 +963,7 @@ public:
return true;
}
- static bool HandleReloadGameGraveyardZoneCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadGameGraveyardZoneCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Graveyard-zone links...");
@@ -974,7 +974,7 @@ public:
return true;
}
- static bool HandleReloadGameTeleCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadGameTeleCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Game Tele coordinates...");
@@ -985,7 +985,7 @@ public:
return true;
}
- static bool HandleReloadDisablesCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadDisablesCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading disables table...");
DisableMgr::LoadDisables();
@@ -995,7 +995,7 @@ public:
return true;
}
- static bool HandleReloadLocalesAchievementRewardCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLocalesAchievementRewardCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Achievement Reward Data Locale...");
sAchievementMgr->LoadRewardLocales();
@@ -1003,7 +1003,7 @@ public:
return true;
}
- static bool HandleReloadLfgRewardsCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLfgRewardsCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading lfg dungeon rewards...");
sLFGMgr->LoadRewards();
@@ -1011,7 +1011,7 @@ public:
return true;
}
- static bool HandleReloadLocalesCreatureCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLocalesCreatureCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Creature Template Locale...");
sObjectMgr->LoadCreatureLocales();
@@ -1019,7 +1019,7 @@ public:
return true;
}
- static bool HandleReloadLocalesCreatureTextCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLocalesCreatureTextCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Creature Texts Locale...");
sCreatureTextMgr->LoadCreatureTextLocales();
@@ -1027,7 +1027,7 @@ public:
return true;
}
- static bool HandleReloadLocalesGameobjectCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLocalesGameobjectCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Gameobject Template Locale... ");
sObjectMgr->LoadGameObjectLocales();
@@ -1035,7 +1035,7 @@ public:
return true;
}
- static bool HandleReloadLocalesGossipMenuOptionCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLocalesGossipMenuOptionCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Gossip Menu Option Locale... ");
sObjectMgr->LoadGossipMenuItemsLocales();
@@ -1043,7 +1043,7 @@ public:
return true;
}
- static bool HandleReloadLocalesPageTextCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLocalesPageTextCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Page Text Locale... ");
sObjectMgr->LoadPageTextLocales();
@@ -1051,7 +1051,7 @@ public:
return true;
}
- static bool HandleReloadLocalesPointsOfInterestCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadLocalesPointsOfInterestCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Points Of Interest Locale... ");
sObjectMgr->LoadPointOfInterestLocales();
@@ -1059,7 +1059,7 @@ public:
return true;
}
- static bool HandleReloadQuestLocaleCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadQuestLocaleCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Quest Locale ... ");
sObjectMgr->LoadQuestTemplateLocale();
@@ -1075,7 +1075,7 @@ public:
return true;
}
- static bool HandleReloadMailLevelRewardCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadMailLevelRewardCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Player level dependent mail rewards...");
sObjectMgr->LoadMailLevelRewards();
@@ -1083,7 +1083,7 @@ public:
return true;
}
- static bool HandleReloadAuctionsCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAuctionsCommand(ChatHandler* handler, char const* /*args*/)
{
///- Reload dynamic data tables from the database
TC_LOG_INFO("misc", "Re-Loading Auctions...");
@@ -1092,7 +1092,7 @@ public:
return true;
}
- static bool HandleReloadConditions(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadConditions(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Conditions...");
sConditionMgr->LoadConditions(true);
@@ -1100,7 +1100,7 @@ public:
return true;
}
- static bool HandleReloadCreatureText(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadCreatureText(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Creature Texts...");
sCreatureTextMgr->LoadCreatureTexts();
@@ -1108,7 +1108,7 @@ public:
return true;
}
- static bool HandleReloadSmartScripts(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSmartScripts(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Smart Scripts...");
sSmartScriptMgr->LoadSmartAIFromDB();
@@ -1116,7 +1116,7 @@ public:
return true;
}
- static bool HandleReloadVehicleAccessoryCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadVehicleAccessoryCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Reloading vehicle_accessory table...");
sObjectMgr->LoadVehicleAccessories();
@@ -1124,7 +1124,7 @@ public:
return true;
}
- static bool HandleReloadVehicleTemplateAccessoryCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadVehicleTemplateAccessoryCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Reloading vehicle_template_accessory table...");
sObjectMgr->LoadVehicleTemplateAccessories();
@@ -1132,7 +1132,7 @@ public:
return true;
}
- static bool HandleReloadAreaTriggerTemplateCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadAreaTriggerTemplateCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Reloading areatrigger_template table...");
sAreaTriggerDataStore->LoadAreaTriggerTemplates();
@@ -1140,7 +1140,7 @@ public:
return true;
}
- static bool HandleReloadSceneTemplateCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadSceneTemplateCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Reloading scene_template table...");
sObjectMgr->LoadSceneTemplates();
@@ -1148,7 +1148,7 @@ public:
return true;
}
- static bool HandleReloadConversationTemplateCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadConversationTemplateCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Reloading conversation_* tables...");
sConversationDataStore->LoadConversationTemplates();
@@ -1156,7 +1156,7 @@ public:
return true;
}
- static bool HandleReloadRBACCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleReloadRBACCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Reloading RBAC tables...");
sAccountMgr->LoadRBAC();
diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp
index bddc6701ef7..283c4e598f2 100644
--- a/src/server/scripts/Commands/cs_reset.cpp
+++ b/src/server/scripts/Commands/cs_reset.cpp
@@ -35,8 +35,8 @@ EndScriptData */
#include "RBAC.h"
#include "World.h"
#include "WorldSession.h"
-#include <boost/thread/shared_mutex.hpp>
#include <boost/thread/locks.hpp>
+#include <boost/thread/shared_mutex.hpp>
class reset_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp
index a21e868052f..41fcd95647b 100644
--- a/src/server/scripts/Commands/cs_tele.cpp
+++ b/src/server/scripts/Commands/cs_tele.cpp
@@ -58,7 +58,7 @@ public:
return commandTable;
}
- static bool HandleTeleAddCommand(ChatHandler* handler, const char* args)
+ static bool HandleTeleAddCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -98,7 +98,7 @@ public:
return true;
}
- static bool HandleTeleDelCommand(ChatHandler* handler, const char* args)
+ static bool HandleTeleDelCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -118,7 +118,7 @@ public:
}
// teleport player to given game_tele.entry
- static bool HandleTeleNameCommand(ChatHandler* handler, const char* args)
+ static bool HandleTeleNameCommand(ChatHandler* handler, char const* args)
{
char* nameStr;
char* teleStr;
@@ -215,7 +215,7 @@ public:
}
//Teleport group to given game_tele.entry
- static bool HandleTeleGroupCommand(ChatHandler* handler, const char* args)
+ static bool HandleTeleGroupCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -298,7 +298,7 @@ public:
return true;
}
- static bool HandleTeleCommand(ChatHandler* handler, const char* args)
+ static bool HandleTeleCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp
index d116046bdb1..58f3a346b9e 100644
--- a/src/server/scripts/Commands/cs_ticket.cpp
+++ b/src/server/scripts/Commands/cs_ticket.cpp
@@ -22,16 +22,14 @@ Comment: All ticket related commands
Category: commandscripts
EndScriptData */
+#include "ScriptMgr.h"
#include "AccountMgr.h"
#include "CharacterCache.h"
#include "Chat.h"
-#include "Config.h"
#include "Language.h"
#include "ObjectMgr.h"
-#include "Opcodes.h"
#include "Player.h"
#include "Realm.h"
-#include "ScriptMgr.h"
#include "SupportMgr.h"
#include "World.h"
#include "WorldSession.h"
diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp
index 2220beb3412..392ed03f37f 100644
--- a/src/server/scripts/Commands/cs_titles.cpp
+++ b/src/server/scripts/Commands/cs_titles.cpp
@@ -26,7 +26,6 @@ EndScriptData */
#include "Chat.h"
#include "DB2Stores.h"
#include "Language.h"
-#include "ObjectMgr.h"
#include "Player.h"
#include "RBAC.h"
diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp
index 9d793f3082b..69dc1f8c51a 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -81,7 +81,7 @@ public:
*
* @return true - command did succeed, false - something went wrong
*/
- static bool HandleWpAddCommand(ChatHandler* handler, const char* args)
+ static bool HandleWpAddCommand(ChatHandler* handler, char const* args)
{
// optional
char* path_number = nullptr;
@@ -144,7 +144,7 @@ public:
return true;
} // HandleWpAddCommand
- static bool HandleWpLoadCommand(ChatHandler* handler, const char* args)
+ static bool HandleWpLoadCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -225,7 +225,7 @@ public:
return true;
}
- static bool HandleWpReloadCommand(ChatHandler* handler, const char* args)
+ static bool HandleWpReloadCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -240,7 +240,7 @@ public:
return true;
}
- static bool HandleWpUnLoadCommand(ChatHandler* handler, const char* /*args*/)
+ static bool HandleWpUnLoadCommand(ChatHandler* handler, char const* /*args*/)
{
Creature* target = handler->getSelectedCreature();
@@ -285,7 +285,7 @@ public:
return true;
}
- static bool HandleWpEventCommand(ChatHandler* handler, const char* args)
+ static bool HandleWpEventCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -542,7 +542,7 @@ public:
return true;
}
- static bool HandleWpModifyCommand(ChatHandler* handler, const char* args)
+ static bool HandleWpModifyCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -722,7 +722,7 @@ public:
return true;
}
- static bool HandleWpShowCommand(ChatHandler* handler, const char* args)
+ static bool HandleWpShowCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
index c9998ea1547..57e3d8da81c 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
@@ -16,10 +16,9 @@
*/
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
#include "blackrock_depths.h"
-#include "CreatureAIImpl.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "Log.h"
#include "ObjectAccessor.h"
@@ -98,7 +97,7 @@ class at_ring_of_law : public AreaTriggerScript
public:
at_ring_of_law() : AreaTriggerScript("at_ring_of_law") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*areaTrigger*/, bool /*entered*/) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/, bool /*entered*/) override
{
if (InstanceScript* instance = player->GetInstanceScript())
{
@@ -370,7 +369,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_phalanxAI(creature);
+ return GetBlackrockDepthsAI<npc_phalanxAI>(creature);
}
struct npc_phalanxAI : public ScriptedAI
@@ -494,7 +493,7 @@ class npc_lokhtos_darkbargainer : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_lokhtos_darkbargainerAI(creature);
+ return GetBlackrockDepthsAI<npc_lokhtos_darkbargainerAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h
index fc571947ca6..2f5821ec6c2 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h
@@ -20,8 +20,8 @@
#include "CreatureAIImpl.h"
-#define DataHeader "BRD"
#define BRDScriptName "instance_blackrock_depths"
+#define DataHeader "BRD"
enum BRDFactionIds
{
@@ -66,7 +66,7 @@ enum BRDDataTypes
DATA_COREN = 28
};
-template<typename AI, typename T>
+template <class AI, class T>
inline AI* GetBlackrockDepthsAI(T* obj)
{
return GetInstanceAI<AI>(obj, BRDScriptName);
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_ambassador_flamelash.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_ambassador_flamelash.cpp
index 966eb9a625c..de92d16041a 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_ambassador_flamelash.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_ambassador_flamelash.cpp
@@ -16,6 +16,7 @@
*/
#include "ScriptMgr.h"
+#include "blackrock_depths.h"
#include "ScriptedCreature.h"
enum Spells
@@ -89,7 +90,7 @@ class boss_ambassador_flamelash : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new boss_ambassador_flamelashAI(creature);
+ return GetBlackrockDepthsAI<boss_ambassador_flamelashAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp
index 2bb126dbd39..1ac96c8c4a4 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp
@@ -15,6 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ScriptMgr.h"
+#include "blackrock_depths.h"
#include "GameObjectAI.h"
#include "GridNotifiers.h"
#include "Group.h"
@@ -25,11 +27,9 @@
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
-#include "ScriptMgr.h"
#include "SpellAuras.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
-#include "blackrock_depths.h"
enum DirebrewSays
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp
index 9726c2508c1..f9a30d7210c 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp
@@ -16,6 +16,7 @@
*/
#include "ScriptMgr.h"
+#include "blackrock_depths.h"
#include "ScriptedCreature.h"
enum Spells
@@ -130,7 +131,7 @@ class boss_general_angerforge : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new boss_general_angerforgeAI(creature);
+ return GetBlackrockDepthsAI<boss_general_angerforgeAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp
index d2fb95a39e3..c14d56ba7bf 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp
@@ -16,6 +16,7 @@
*/
#include "ScriptMgr.h"
+#include "blackrock_depths.h"
#include "ScriptedCreature.h"
enum Spells
@@ -99,7 +100,7 @@ class boss_high_interrogator_gerstahn : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new boss_high_interrogator_gerstahnAI(creature);
+ return GetBlackrockDepthsAI<boss_high_interrogator_gerstahnAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp
index bc9401e7e16..295f94e71fd 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp
@@ -106,7 +106,7 @@ class boss_magmus : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new boss_magmusAI(creature);
+ return GetBlackrockDepthsAI<boss_magmusAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp
index 097b4a67b82..4b2bee3fc16 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp
@@ -16,6 +16,7 @@
*/
#include "ScriptMgr.h"
+#include "blackrock_depths.h"
#include "ScriptedCreature.h"
enum Spells
@@ -93,7 +94,7 @@ class boss_moira_bronzebeard : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new boss_moira_bronzebeardAI(creature);
+ return GetBlackrockDepthsAI<boss_moira_bronzebeardAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
index be16a653cfa..f6bbc3bd5ea 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
@@ -23,6 +23,7 @@
#include "Map.h"
#include "MotionMaster.h"
#include "ScriptedCreature.h"
+#include <sstream>
#define TIMER_TOMBOFTHESEVEN 15000
#define MAX_ENCOUNTER 6
@@ -133,22 +134,22 @@ public:
{
switch (creature->GetEntry())
{
- case NPC_EMPEROR: EmperorGUID = creature->GetGUID(); break;
- case NPC_PHALANX: PhalanxGUID = creature->GetGUID(); break;
- case NPC_MOIRA: MoiraGUID = creature->GetGUID(); break;
- case NPC_COREN: CorenGUID = creature->GetGUID(); break;
- case NPC_DOOMREL: TombBossGUIDs[0] = creature->GetGUID(); break;
- case NPC_DOPEREL: TombBossGUIDs[1] = creature->GetGUID(); break;
- case NPC_HATEREL: TombBossGUIDs[2] = creature->GetGUID(); break;
- case NPC_VILEREL: TombBossGUIDs[3] = creature->GetGUID(); break;
- case NPC_SEETHREL: TombBossGUIDs[4] = creature->GetGUID(); break;
- case NPC_GLOOMREL: TombBossGUIDs[5] = creature->GetGUID(); break;
- case NPC_ANGERREL: TombBossGUIDs[6] = creature->GetGUID(); break;
- case NPC_MAGMUS:
- MagmusGUID = creature->GetGUID();
- if (!creature->IsAlive())
- HandleGameObject(GetGuidData(DATA_THRONE_DOOR), true); // if Magmus is dead open door to last boss
- break;
+ case NPC_EMPEROR: EmperorGUID = creature->GetGUID(); break;
+ case NPC_PHALANX: PhalanxGUID = creature->GetGUID(); break;
+ case NPC_MOIRA: MoiraGUID = creature->GetGUID(); break;
+ case NPC_COREN: CorenGUID = creature->GetGUID(); break;
+ case NPC_DOOMREL: TombBossGUIDs[0] = creature->GetGUID(); break;
+ case NPC_DOPEREL: TombBossGUIDs[1] = creature->GetGUID(); break;
+ case NPC_HATEREL: TombBossGUIDs[2] = creature->GetGUID(); break;
+ case NPC_VILEREL: TombBossGUIDs[3] = creature->GetGUID(); break;
+ case NPC_SEETHREL: TombBossGUIDs[4] = creature->GetGUID(); break;
+ case NPC_GLOOMREL: TombBossGUIDs[5] = creature->GetGUID(); break;
+ case NPC_ANGERREL: TombBossGUIDs[6] = creature->GetGUID(); break;
+ case NPC_MAGMUS:
+ MagmusGUID = creature->GetGUID();
+ if (!creature->IsAlive())
+ HandleGameObject(GetGuidData(DATA_THRONE_DOOR), true); // if Magmus is dead open door to last boss
+ break;
}
}
@@ -156,33 +157,33 @@ public:
{
switch (go->GetEntry())
{
- case GO_ARENA1: GoArena1GUID = go->GetGUID(); break;
- case GO_ARENA2: GoArena2GUID = go->GetGUID(); break;
- case GO_ARENA3: GoArena3GUID = go->GetGUID(); break;
- case GO_ARENA4: GoArena4GUID = go->GetGUID(); break;
- case GO_SHADOW_LOCK: GoShadowLockGUID = go->GetGUID(); break;
- case GO_SHADOW_MECHANISM: GoShadowMechGUID = go->GetGUID(); break;
- case GO_SHADOW_GIANT_DOOR: GoShadowGiantGUID = go->GetGUID(); break;
- case GO_SHADOW_DUMMY: GoShadowDummyGUID = go->GetGUID(); break;
- case GO_BAR_KEG_SHOT: GoBarKegGUID = go->GetGUID(); break;
- case GO_BAR_KEG_TRAP: GoBarKegTrapGUID = go->GetGUID(); break;
- case GO_BAR_DOOR: GoBarDoorGUID = go->GetGUID(); break;
- case GO_TOMB_ENTER: GoTombEnterGUID = go->GetGUID(); break;
- case GO_TOMB_EXIT:
- GoTombExitGUID = go->GetGUID();
- if (GhostKillCount >= 7)
- HandleGameObject(ObjectGuid::Empty, true, go);
- else
- HandleGameObject(ObjectGuid::Empty, false, go);
- break;
- case GO_LYCEUM: GoLyceumGUID = go->GetGUID(); break;
- case GO_SF_S: GoSFSGUID = go->GetGUID(); break;
- case GO_SF_N: GoSFNGUID = go->GetGUID(); break;
- case GO_GOLEM_ROOM_N: GoGolemNGUID = go->GetGUID(); break;
- case GO_GOLEM_ROOM_S: GoGolemSGUID = go->GetGUID(); break;
- case GO_THRONE_ROOM: GoThroneGUID = go->GetGUID(); break;
- case GO_CHEST_SEVEN: GoChestGUID = go->GetGUID(); break;
- case GO_SPECTRAL_CHALICE: GoSpectralChaliceGUID = go->GetGUID(); break;
+ case GO_ARENA1: GoArena1GUID = go->GetGUID(); break;
+ case GO_ARENA2: GoArena2GUID = go->GetGUID(); break;
+ case GO_ARENA3: GoArena3GUID = go->GetGUID(); break;
+ case GO_ARENA4: GoArena4GUID = go->GetGUID(); break;
+ case GO_SHADOW_LOCK: GoShadowLockGUID = go->GetGUID(); break;
+ case GO_SHADOW_MECHANISM: GoShadowMechGUID = go->GetGUID(); break;
+ case GO_SHADOW_GIANT_DOOR: GoShadowGiantGUID = go->GetGUID(); break;
+ case GO_SHADOW_DUMMY: GoShadowDummyGUID = go->GetGUID(); break;
+ case GO_BAR_KEG_SHOT: GoBarKegGUID = go->GetGUID(); break;
+ case GO_BAR_KEG_TRAP: GoBarKegTrapGUID = go->GetGUID(); break;
+ case GO_BAR_DOOR: GoBarDoorGUID = go->GetGUID(); break;
+ case GO_TOMB_ENTER: GoTombEnterGUID = go->GetGUID(); break;
+ case GO_TOMB_EXIT:
+ GoTombExitGUID = go->GetGUID();
+ if (GhostKillCount >= 7)
+ HandleGameObject(ObjectGuid::Empty, true, go);
+ else
+ HandleGameObject(ObjectGuid::Empty, false, go);
+ break;
+ case GO_LYCEUM: GoLyceumGUID = go->GetGUID(); break;
+ case GO_SF_S: GoSFSGUID = go->GetGUID(); break;
+ case GO_SF_N: GoSFNGUID = go->GetGUID(); break;
+ case GO_GOLEM_ROOM_N: GoGolemNGUID = go->GetGUID(); break;
+ case GO_GOLEM_ROOM_S: GoGolemSGUID = go->GetGUID(); break;
+ case GO_THRONE_ROOM: GoThroneGUID = go->GetGUID(); break;
+ case GO_CHEST_SEVEN: GoChestGUID = go->GetGUID(); break;
+ case GO_SPECTRAL_CHALICE: GoSpectralChaliceGUID = go->GetGUID(); break;
}
}
@@ -208,30 +209,30 @@ public:
switch (type)
{
- case TYPE_RING_OF_LAW:
- encounter[0] = data;
- break;
- case TYPE_VAULT:
- encounter[1] = data;
- break;
- case TYPE_BAR:
- if (data == SPECIAL)
- ++BarAleCount;
- else
- encounter[2] = data;
- break;
- case TYPE_TOMB_OF_SEVEN:
- encounter[3] = data;
- break;
- case TYPE_LYCEUM:
- encounter[4] = data;
- break;
- case TYPE_IRON_HALL:
- encounter[5] = data;
- break;
- case DATA_GHOSTKILL:
- GhostKillCount += data;
- break;
+ case TYPE_RING_OF_LAW:
+ encounter[0] = data;
+ break;
+ case TYPE_VAULT:
+ encounter[1] = data;
+ break;
+ case TYPE_BAR:
+ if (data == SPECIAL)
+ ++BarAleCount;
+ else
+ encounter[2] = data;
+ break;
+ case TYPE_TOMB_OF_SEVEN:
+ encounter[3] = data;
+ break;
+ case TYPE_LYCEUM:
+ encounter[4] = data;
+ break;
+ case TYPE_IRON_HALL:
+ encounter[5] = data;
+ break;
+ case DATA_GHOSTKILL:
+ GhostKillCount += data;
+ break;
}
if (data == DONE || GhostKillCount >= 7)
@@ -253,23 +254,23 @@ public:
{
switch (type)
{
- case TYPE_RING_OF_LAW:
- return encounter[0];
- case TYPE_VAULT:
- return encounter[1];
- case TYPE_BAR:
- if (encounter[2] == IN_PROGRESS && BarAleCount == 3)
- return SPECIAL;
- else
- return encounter[2];
- case TYPE_TOMB_OF_SEVEN:
- return encounter[3];
- case TYPE_LYCEUM:
- return encounter[4];
- case TYPE_IRON_HALL:
- return encounter[5];
- case DATA_GHOSTKILL:
- return GhostKillCount;
+ case TYPE_RING_OF_LAW:
+ return encounter[0];
+ case TYPE_VAULT:
+ return encounter[1];
+ case TYPE_BAR:
+ if (encounter[2] == IN_PROGRESS && BarAleCount == 3)
+ return SPECIAL;
+ else
+ return encounter[2];
+ case TYPE_TOMB_OF_SEVEN:
+ return encounter[3];
+ case TYPE_LYCEUM:
+ return encounter[4];
+ case TYPE_IRON_HALL:
+ return encounter[5];
+ case DATA_GHOSTKILL:
+ return GhostKillCount;
}
return 0;
}
@@ -278,42 +279,42 @@ public:
{
switch (data)
{
- case DATA_EMPEROR:
- return EmperorGUID;
- case DATA_PHALANX:
- return PhalanxGUID;
- case DATA_MOIRA:
- return MoiraGUID;
- case DATA_COREN:
- return CorenGUID;
- case DATA_ARENA1:
- return GoArena1GUID;
- case DATA_ARENA2:
- return GoArena2GUID;
- case DATA_ARENA3:
- return GoArena3GUID;
- case DATA_ARENA4:
- return GoArena4GUID;
- case DATA_GO_BAR_KEG:
- return GoBarKegGUID;
- case DATA_GO_BAR_KEG_TRAP:
- return GoBarKegTrapGUID;
- case DATA_GO_BAR_DOOR:
- return GoBarDoorGUID;
- case DATA_EVENSTARTER:
- return TombEventStarterGUID;
- case DATA_SF_BRAZIER_N:
- return GoSFNGUID;
- case DATA_SF_BRAZIER_S:
- return GoSFSGUID;
- case DATA_THRONE_DOOR:
- return GoThroneGUID;
- case DATA_GOLEM_DOOR_N:
- return GoGolemNGUID;
- case DATA_GOLEM_DOOR_S:
- return GoGolemSGUID;
- case DATA_GO_CHALICE:
- return GoSpectralChaliceGUID;
+ case DATA_EMPEROR:
+ return EmperorGUID;
+ case DATA_PHALANX:
+ return PhalanxGUID;
+ case DATA_MOIRA:
+ return MoiraGUID;
+ case DATA_COREN:
+ return CorenGUID;
+ case DATA_ARENA1:
+ return GoArena1GUID;
+ case DATA_ARENA2:
+ return GoArena2GUID;
+ case DATA_ARENA3:
+ return GoArena3GUID;
+ case DATA_ARENA4:
+ return GoArena4GUID;
+ case DATA_GO_BAR_KEG:
+ return GoBarKegGUID;
+ case DATA_GO_BAR_KEG_TRAP:
+ return GoBarKegTrapGUID;
+ case DATA_GO_BAR_DOOR:
+ return GoBarDoorGUID;
+ case DATA_EVENSTARTER:
+ return TombEventStarterGUID;
+ case DATA_SF_BRAZIER_N:
+ return GoSFNGUID;
+ case DATA_SF_BRAZIER_S:
+ return GoSFSGUID;
+ case DATA_THRONE_DOOR:
+ return GoThroneGUID;
+ case DATA_GOLEM_DOOR_N:
+ return GoGolemNGUID;
+ case DATA_GOLEM_DOOR_S:
+ return GoGolemSGUID;
+ case DATA_GO_CHALICE:
+ return GoSpectralChaliceGUID;
}
return ObjectGuid::Empty;
}
@@ -323,7 +324,7 @@ public:
return str_data;
}
- void Load(const char* in) override
+ void Load(char const* in) override
{
if (!in)
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h
index ef1ee422476..bca9f01839a 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h
@@ -122,10 +122,10 @@ enum BRSGameObjectsIds
GO_PORTCULLIS_TOBOSSROOMS = 175186
};
-template<typename AI>
-inline AI* GetBlackrockSpireAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetBlackrockSpireAI(T* obj)
{
- return GetInstanceAI<AI>(creature, BRSScriptName);
+ return GetInstanceAI<AI>(obj, BRSScriptName);
}
#endif
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp
index 71beb27a282..8b5e4ad3d29 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp
@@ -104,7 +104,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new boss_drakkisathAI(creature);
+ return GetBlackrockSpireAI<boss_drakkisathAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp
index da61c7d00b9..9b82c3292b0 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp
@@ -255,7 +255,7 @@ public:
{
// Check to see if all players in instance have aura SPELL_EMBERSEER_START before starting event
bool _hasAura = true;
- Map::PlayerList const &players = me->GetMap()->GetPlayers();
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (Player* player = itr->GetSource()->ToPlayer())
if (!player->HasAura(SPELL_EMBERSEER_OBJECT_VISUAL))
@@ -441,7 +441,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_blackhand_incarceratorAI(creature);
+ return GetBlackrockSpireAI<npc_blackhand_incarceratorAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp
index c5403ee37ad..0a756cced04 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp
@@ -527,7 +527,7 @@ class at_dragonspire_hall : public AreaTriggerScript
public:
at_dragonspire_hall() : AreaTriggerScript("at_dragonspire_hall") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*areaTrigger*/, bool /*entered*/) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/, bool /*entered*/) override
{
if (player && player->IsAlive())
{
@@ -551,7 +551,7 @@ class at_blackrock_stadium : public AreaTriggerScript
public:
at_blackrock_stadium() : AreaTriggerScript("at_blackrock_stadium") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*areaTrigger*/, bool /*entered*/) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/, bool /*entered*/) override
{
if (player && player->IsAlive())
{
@@ -575,10 +575,12 @@ class at_nearby_scarshield_infiltrator : public AreaTriggerScript
public:
at_nearby_scarshield_infiltrator() : AreaTriggerScript("at_nearby_scarshield_infiltrator") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/, bool /*entered*/) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*at*/, bool /*entered*/) override
{
if (player->IsAlive())
+ {
if (InstanceScript* instance = player->GetInstanceScript())
+ {
if (Creature* infiltrator = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_SCARSHIELD_INFILTRATOR)))
{
if (player->getLevel() >= 57)
@@ -588,6 +590,8 @@ public:
return true;
}
+ }
+ }
return false;
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp
index 9fb0e77caac..9acbe8e6797 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp
@@ -16,8 +16,8 @@
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "blackwing_lair.h"
+#include "ScriptedCreature.h"
enum Say
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp
index 5953adb8105..97a91c81fe3 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp
@@ -240,7 +240,7 @@ public:
break;
case EVENT_AFFLICTION:
{
- Map::PlayerList const &players = me->GetMap()->GetPlayers();
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* player = itr->GetSource()->ToPlayer())
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp
index 447ca2fe1ab..c147fd85548 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp
@@ -16,8 +16,8 @@
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "blackwing_lair.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp
index 97c73b89973..e082f114c10 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp
@@ -16,8 +16,8 @@
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "blackwing_lair.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp
index a54285164d9..ab465de3805 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp
@@ -16,8 +16,8 @@
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "blackwing_lair.h"
+#include "ScriptedCreature.h"
enum Emotes
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp
index 876f32cb89a..52fe779f4c1 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp
@@ -22,10 +22,9 @@ SDComment:
SDCategory: Molten Core
EndScriptData */
-#include "ObjectMgr.h"
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "molten_core.h"
+#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp
index e4b43d27b48..c54b27489bd 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp
@@ -22,10 +22,10 @@ SDComment: Adds NYI
SDCategory: Molten Core
EndScriptData */
-#include "ObjectMgr.h"
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "molten_core.h"
+#include "ObjectMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp
index f4652666abe..00aa6d38079 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp
@@ -22,10 +22,10 @@ SDComment: Adds MC NYI
SDCategory: Molten Core
EndScriptData */
-#include "ObjectMgr.h"
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "molten_core.h"
+#include "ObjectMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp
index 4980fbcdcfc..aeaa706c174 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp
@@ -27,7 +27,6 @@ EndScriptData */
#include "molten_core.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
-#include "TemporarySummon.h"
enum Texts
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp
index a0b70cc8396..fe297f576e6 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp
@@ -22,10 +22,10 @@ SDComment:
SDCategory: Molten Core
EndScriptData */
-#include "ObjectMgr.h"
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "molten_core.h"
+#include "ObjectMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp
index 386de5e94eb..aacf257226c 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp
@@ -22,10 +22,10 @@ SDComment: Adds NYI
SDCategory: Molten Core
EndScriptData */
-#include "ObjectMgr.h"
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "molten_core.h"
+#include "ObjectMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp
index d237c7fe3a6..c82abaa4035 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp
@@ -16,10 +16,10 @@
*/
#include "ScriptMgr.h"
+#include "molten_core.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
-#include "molten_core.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h
index cc3494fe5b6..e8f88b50405 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h
@@ -75,10 +75,10 @@ enum MCData
DATA_RAGNAROS_ADDS = 0,
};
-template<typename AI>
-inline AI* GetMoltenCoreAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetMoltenCoreAI(T* obj)
{
- return GetInstanceAI<AI>(creature, MCScriptName);
+ return GetInstanceAI<AI>(obj, MCScriptName);
}
#endif
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
index 079f14155c1..9b575fd34a9 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
@@ -16,11 +16,7 @@
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "deadmines.h"
-#include "Spell.h"
-#include "Player.h"
-#include "WorldSession.h"
void AddSC_deadmines()
{
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
index 74edaa2b7aa..dfebf706d18 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
+++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
@@ -52,10 +52,10 @@ enum DMGameObjects
GO_MR_SMITE_CHEST = 144111
};
-template<typename AI>
-inline AI* GetDeadminesAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetDeadminesAI(T* obj)
{
- return GetInstanceAI<AI>(creature, DMScriptName);
+ return GetInstanceAI<AI>(obj, DMScriptName);
}
#endif
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
index 1804cf17a52..0587987ece8 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
@@ -196,15 +196,15 @@ class instance_deadmines : public InstanceMapScript
{
switch (type)
{
- case EVENT_STATE:
- if (!DefiasCannonGUID.IsEmpty() && !IronCladDoorGUID.IsEmpty())
- State = data;
- break;
- case EVENT_RHAHKZOR:
- if (data == DONE)
- if (GameObject* go = instance->GetGameObject(FactoryDoorGUID))
- go->SetGoState(GO_STATE_ACTIVE);
- break;
+ case EVENT_STATE:
+ if (!DefiasCannonGUID.IsEmpty() && !IronCladDoorGUID.IsEmpty())
+ State = data;
+ break;
+ case EVENT_RHAHKZOR:
+ if (data == DONE)
+ if (GameObject* go = instance->GetGameObject(FactoryDoorGUID))
+ go->SetGoState(GO_STATE_ACTIVE);
+ break;
}
}
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
index aaa280fdbe1..98f3558d84e 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
@@ -204,7 +204,7 @@ public:
void AggroAllPlayers(Creature* temp)
{
- Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlList = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
{
if (Player* player = i->GetSource())
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h
index e2ac26d6675..2b349789d97 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h
@@ -50,10 +50,10 @@ enum GNOData64
DATA_NPC_BASTMASTER_EMI_SHORTFUSE
};
-template<typename AI>
-inline AI* GetGnomereganAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetGnomereganAI(T* obj)
{
- return GetInstanceAI<AI>(creature, GNOScriptName);
+ return GetInstanceAI<AI>(obj, GNOScriptName);
}
#endif
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp
index 5a583390728..965558131ee 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp
@@ -22,13 +22,14 @@
#include "InstanceScript.h"
#include "Log.h"
#include "Map.h"
+#include <sstream>
#define MAX_ENCOUNTER 1
class instance_gnomeregan : public InstanceMapScript
{
public:
- instance_gnomeregan() : InstanceMapScript("instance_gnomeregan", 90) { }
+ instance_gnomeregan() : InstanceMapScript(GNOScriptName, 90) { }
InstanceScript* GetInstanceScript(InstanceMap* map) const override
{
@@ -50,7 +51,7 @@ public:
ObjectGuid uiBastmasterEmiShortfuseGUID;
- void Load(const char* in) override
+ void Load(char const* in) override
{
if (!in)
{
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
index 1b7ded81966..0edd267c695 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
@@ -18,7 +18,6 @@
#include "ScriptMgr.h"
#include "karazhan.h"
#include "ScriptedCreature.h"
-#include "karazhan.h"
enum CuratorSays
{
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
index b89078fb228..282e1a56ecd 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
@@ -222,7 +222,7 @@ public:
std::bind(&BossAI::DoMeleeAttackIfReady, this));
}
- void SpellHit(Unit* /*source*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*source*/, SpellInfo const* spell) override
{
if (spell->Mechanic == MECHANIC_DISARM)
Talk(SAY_DISARMED);
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
index f612dc03094..539266ffa18 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
@@ -23,8 +23,8 @@ SDCategory: Karazhan
EndScriptData */
#include "ScriptMgr.h"
-#include "InstanceScript.h"
#include "karazhan.h"
+#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
index a4463fe4a7f..2ba6ba50317 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
@@ -15,16 +15,16 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "GameObject.h"
#include "ScriptMgr.h"
+#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "karazhan.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
-#include "SpellScript.h"
#include "SpellAuraEffects.h"
+#include "SpellScript.h"
enum NightbaneSpells
{
@@ -119,11 +119,6 @@ class boss_nightbane : public CreatureScript
public:
boss_nightbane() : CreatureScript("boss_nightbane") { }
- CreatureAI* GetAI(Creature* creature) const override
- {
- return GetKarazhanAI<boss_nightbaneAI>(creature);
- }
-
struct boss_nightbaneAI : public BossAI
{
boss_nightbaneAI(Creature* creature) : BossAI(creature, DATA_NIGHTBANE), _flyCount(0) { }
@@ -381,6 +376,11 @@ public:
private:
uint8 _flyCount;
};
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetKarazhanAI<boss_nightbaneAI>(creature);
+ }
};
// 37098 - Rain of Bones
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
index a70793dd572..e004ebeb87d 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
@@ -23,8 +23,8 @@ SDCategory: Karazhan
EndScriptData */
#include "ScriptMgr.h"
-#include "InstanceScript.h"
#include "karazhan.h"
+#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
@@ -154,7 +154,7 @@ public:
creature->AI()->KilledUnit(who);
}
- void SpellHit(Unit* /*who*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*who*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_INFERNAL_RELAY)
{
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
index 86c733d2e3c..a9eaa863f46 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
@@ -23,11 +23,10 @@ SDCategory: Karazhan
EndScriptData */
#include "ScriptMgr.h"
-#include "GameObject.h"
+#include "karazhan.h"
#include "InstanceScript.h"
+#include "GameObject.h"
#include "Item.h"
-#include "karazhan.h"
-#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
index c639a384374..3150111e30b 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
@@ -16,12 +16,10 @@
*/
#include "ScriptMgr.h"
-#include "InstanceScript.h"
#include "karazhan.h"
#include "ObjectAccessor.h"
#include "PassiveAI.h"
#include "ScriptedCreature.h"
-#include "TemporarySummon.h"
#include "SpellInfo.h"
enum TerestianSays
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
index 32cc678e901..1f5d49a3c6d 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
@@ -372,7 +372,7 @@ public:
me->DespawnOrUnsummon();
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* Spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* Spell) override
{
if ((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand32() % 10)))
{
@@ -1136,7 +1136,7 @@ public:
me->DespawnOrUnsummon();
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* Spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* Spell) override
{
if (Spell->Id == SPELL_DRINK_POISON)
{
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
index b0300ec3b4b..3c7e07505db 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
@@ -309,7 +309,7 @@ public:
{
if (WipeTimer <= diff)
{
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (PlayerList.isEmpty())
return;
@@ -566,7 +566,7 @@ public:
me->SetVisible(false);
me->ClearInCombat();
- InstanceMap::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ InstanceMap::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->GetSource()->IsAlive())
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
index 292dc10e7f8..7483991ca6f 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
@@ -71,8 +71,6 @@ enum Spells
SPELL_POWER_FEEDBACK = 44233 // Stuns him, making him take 50% more damage for 10 seconds. Cast after Gravity Lapse
};
-
-
enum Creatures
{
CREATURE_PHOENIX = 24674,
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
index 0a9062e03f2..e6cac2e0132 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
@@ -23,8 +23,8 @@ SDCategory: Magister's Terrace
EndScriptData */
#include "ScriptMgr.h"
-#include "InstanceScript.h"
#include "magisters_terrace.h"
+#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
@@ -1328,7 +1328,7 @@ public:
//CreatureAI* GetAI(Creature* creature) const override
//{
- // return new npc_high_explosive_sheepAI(creature);
+ // return GetMagistersTerraceAI<npc_high_explosive_sheepAI>(creature);
//};
};
*/
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
index 40e3195326a..b9bdcced9e6 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
@@ -16,9 +16,9 @@
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "magisters_terrace.h"
#include "MotionMaster.h"
+#include "ScriptedCreature.h"
enum Yells
{
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp
index 076520907d4..61507222774 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp
@@ -163,11 +163,13 @@ class instance_magisters_terrace : public InstanceMapScript
Events.Update(diff);
if (Events.ExecuteEvent() == EVENT_SPAWN_KALECGOS)
+ {
if (Creature* kalecgos = instance->SummonCreature(NPC_KALECGOS, KalecgosSpawnPos))
{
kalecgos->GetMotionMaster()->MovePath(PATH_KALECGOS_FLIGHT, false);
kalecgos->AI()->Talk(SAY_KALECGOS_SPAWN);
}
+ }
}
bool SetBossState(uint32 type, EncounterState state) override
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
index 98494d2703c..01879a1f029 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
@@ -154,7 +154,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_kalecgosAI(creature);
+ return GetMagistersTerraceAI<npc_kalecgosAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h
index 664ffd740a0..2a0b8217635 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h
@@ -76,10 +76,10 @@ enum MTMovementData
PATH_KALECGOS_FLIGHT = 248440
};
-template<typename AI>
-inline AI* GetMagistersTerraceAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetMagistersTerraceAI(T* obj)
{
- return GetInstanceAI<AI>(creature, MGTScriptName);
+ return GetInstanceAI<AI>(obj, MGTScriptName);
}
#endif
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
index f26876e8f3f..d4869fb0d10 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
@@ -19,12 +19,12 @@
#include "CombatAI.h"
#include "CreatureTextMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "Log.h"
#include "MotionMaster.h"
#include "MoveSplineInit.h"
#include "ObjectAccessor.h"
#include "PassiveAI.h"
-#include "GameObjectAI.h"
#include "Player.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
@@ -521,7 +521,7 @@ public:
me->AddUnitFlag(UNIT_FLAG_UNK_15);
}
- void SpellHit(Unit* pCaster, const SpellInfo* pSpell) override
+ void SpellHit(Unit* pCaster, SpellInfo const* pSpell) override
{
if (!m_bIsDuelInProgress && pSpell->Id == SPELL_DUEL)
{
@@ -776,7 +776,7 @@ public:
return false;
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id == SPELL_DELIVER_STOLEN_HORSE)
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
index 934de238055..86fc1dc0c90 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
@@ -76,7 +76,7 @@ public:
me->RestoreFaction();
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id == SPELL_PERSUASIVE_STRIKE && caster->GetTypeId() == TYPEID_PLAYER && me->IsAlive() && !speechCounter)
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
index 35ddd4ab784..f9164589cc2 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
@@ -1266,7 +1266,7 @@ public:
// go->SetPhaseMask(0, true);
{
// search players with in 50 yards for quest credit
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (!PlayerList.isEmpty())
{
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp
index 84abf8b6062..eb9e2e4e871 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp
@@ -131,10 +131,11 @@ public:
break;
}
++phase;
- } else FlyBackTimer-=diff;
+ }
+ else
+ FlyBackTimer -= diff;
}
};
-
};
void AddSC_the_scarlet_enclave()
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
index 3b294a6811c..6daedfb4a29 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
@@ -23,8 +23,8 @@ SDCategory: Scarlet Monastery
EndScriptData */
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "Group.h"
#include "InstanceScript.h"
#include "LFGMgr.h"
@@ -187,7 +187,7 @@ public:
DoCast(me, _spell);
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_WISP_FLIGHT_PORT && Creaturetype == 4)
me->SetDisplayId(2027);
@@ -302,7 +302,7 @@ public:
}
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (!withbody)
return;
@@ -540,7 +540,7 @@ public:
Player* SelectRandomPlayer(float range = 0.0f, bool checkLoS = true)
{
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (PlayerList.isEmpty())
return nullptr;
@@ -559,7 +559,7 @@ public:
return nullptr;
}
- void SpellHitTarget(Unit* unit, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* unit, SpellInfo const* spell) override
{
if (spell->Id == SPELL_CONFLAGRATION && unit->HasAura(SPELL_CONFLAGRATION))
SaySound(SAY_CONFLAGRATION, unit);
@@ -585,7 +585,7 @@ public:
}
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (withhead)
return;
@@ -816,7 +816,7 @@ public:
void EnterCombat(Unit* /*who*/) override { }
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_SPROUTING)
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp
index 4e3a71bbe71..75c6ad43263 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp
@@ -23,9 +23,9 @@ SDCategory: Scarlet Monastery
EndScriptData */
#include "ScriptMgr.h"
+#include "scarlet_monastery.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
-#include "scarlet_monastery.h"
enum Says
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp
index fd0a8ec795f..7c5855b4b10 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp
@@ -23,8 +23,8 @@ SDCategory: Scarlet Monastery
EndScriptData */
#include "ScriptMgr.h"
-#include "InstanceScript.h"
#include "scarlet_monastery.h"
+#include "InstanceScript.h"
#include "ScriptedCreature.h"
enum Spells
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp
index 7e4b210f599..224bc488b03 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp
@@ -16,8 +16,8 @@
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "scarlet_monastery.h"
+#include "ScriptedCreature.h"
enum Yells
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
index fbdad6dc712..4714bcb999e 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
@@ -16,9 +16,9 @@
*/
#include "ScriptMgr.h"
+#include "scarlet_monastery.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
-#include "scarlet_monastery.h"
#include "ScriptedCreature.h"
enum Says
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
index 5ae31c00d81..6d976481eca 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
@@ -161,7 +161,7 @@ public:
}
}
- void SpellHit(Unit* /*who*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*who*/, SpellInfo const* spell) override
{
//When hit with resurrection say text
if (spell->Id == SPELL_SCARLETRESURRECTION)
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp
index 6d70f5b762c..8be2b9a6269 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp
@@ -46,26 +46,13 @@ class instance_scarlet_monastery : public InstanceMapScript
void OnGameObjectCreate(GameObject* go) override
{
+ InstanceScript::OnGameObjectCreate(go);
+
switch (go->GetEntry())
{
case GO_PUMPKIN_SHRINE:
PumpkinShrineGUID = go->GetGUID();
break;
- case GO_HIGH_INQUISITORS_DOOR:
- AddDoor(go, true);
- break;
- default:
- break;
- }
- }
-
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_HIGH_INQUISITORS_DOOR:
- AddDoor(go, false);
- break;
default:
break;
}
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h
index c1ba06d446b..36d2569dbf3 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h
@@ -62,7 +62,7 @@ enum SMGameObjectIds
GO_PUMPKIN_SHRINE = 186267
};
-template<class AI, class T>
+template <class AI, class T>
inline AI* GetScarletMonasteryAI(T* obj)
{
return GetInstanceAI<AI>(obj, SMScriptName);
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
index d0e711ae642..77539afa7be 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
@@ -27,8 +27,8 @@ Category: Scholomance
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
-#include "ScriptedCreature.h"
#include "scholomance.h"
+#include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
@@ -171,17 +171,10 @@ class spell_shadow_portal : public SpellScriptLoader
{
PrepareSpellScript(spell_shadow_portal_SpellScript);
- public:
- spell_shadow_portal_SpellScript()
- {
- _instance = nullptr;
- }
-
- private:
bool Load() override
{
_instance = GetCaster()->GetInstanceScript();
- return _instance != nullptr;
+ return InstanceHasScript(GetCaster(), ScholomanceScriptName);
}
void HandleCast(SpellEffIndex /*effIndex*/)
@@ -238,7 +231,7 @@ class spell_shadow_portal : public SpellScriptLoader
OnEffectHitTarget += SpellEffectFn(spell_shadow_portal_SpellScript::HandleCast, EFFECT_0, SPELL_EFFECT_DUMMY);
}
- InstanceScript* _instance;
+ InstanceScript* _instance = nullptr;
};
SpellScript* GetSpellScript() const override
@@ -300,13 +293,6 @@ class spell_shadow_portal_rooms : public SpellScriptLoader
{
PrepareSpellScript(spell_shadow_portal_rooms_SpellScript);
- public:
- spell_shadow_portal_rooms_SpellScript()
- {
- _instance = nullptr;
- }
-
- private:
bool Load() override
{
_instance = GetCaster()->GetInstanceScript();
@@ -380,7 +366,7 @@ class spell_shadow_portal_rooms : public SpellScriptLoader
OnEffectHit += SpellEffectFn(spell_shadow_portal_rooms_SpellScript::HandleSendEvent, EFFECT_1, SPELL_EFFECT_SEND_EVENT);
}
- InstanceScript* _instance;
+ InstanceScript* _instance = nullptr;
};
SpellScript* GetSpellScript() const override
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp
index 3f3ec24913a..2f053417900 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp
@@ -23,8 +23,8 @@ Category: Scholomance
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "scholomance.h"
+#include "ScriptedCreature.h"
enum Say
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp
index 23ba5b24237..99c81366ef5 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp
@@ -23,8 +23,8 @@ Category: Scholomance
*/
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "scholomance.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp
index f7108dc14cd..55c5c442a71 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp
@@ -23,8 +23,8 @@ SDCategory: Scholomance
EndScriptData */
#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
#include "scholomance.h"
+#include "ScriptedCreature.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp
index 2888a9b4135..f8678b1e6ae 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp
@@ -16,8 +16,8 @@
*/
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "MoveSplineInit.h"
@@ -141,9 +141,7 @@ class boss_kirtonos_the_herald : public CreatureScript
void MovementInform(uint32 type, uint32 id) override
{
if (type == WAYPOINT_MOTION_TYPE && id == POINT_KIRTONOS_LAND)
- {
events.ScheduleEvent(INTRO_2, 1500);
- }
}
void UpdateAI(uint32 diff) override
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp
index 5343104dce7..b54c8b40ad6 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp
@@ -22,9 +22,9 @@ SDComment: aura applied/defined in database
SDCategory: Scholomance
EndScriptData */
+#include "scholomance.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
-#include "scholomance.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
index e001036ca65..67df81f9928 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
@@ -22,9 +22,9 @@ Comment:
Category: Scholomance
*/
+#include "scholomance.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
-#include "scholomance.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
index 37189ec6169..d4be3a1c44e 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
@@ -15,8 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptMgr.h"
#include "scholomance.h"
+#include "ScriptMgr.h"
#include "ScriptedCreature.h"
enum Spells
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp
index 1ab11ee1903..2ef20dfa915 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp
@@ -22,9 +22,9 @@ Comment:
Category: Scholomance
*/
+#include "scholomance.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
-#include "scholomance.h"
enum Spells
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp
index 89ba79a8c25..9853500e5ee 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp
@@ -15,8 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptMgr.h"
#include "scholomance.h"
+#include "ScriptMgr.h"
#include "ScriptedCreature.h"
enum Emotes
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp
index 3172c4e71fa..00e9b44d0da 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp
@@ -15,7 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "shadowfang_keep.h"
+#include "ScriptMgr.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
#include "InstanceScript.h"
@@ -25,8 +25,7 @@
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
-#include "ScriptMgr.h"
-#include "SpellAuraEffects.h"
+#include "shadowfang_keep.h"
#include "SpellScript.h"
enum ApothecarySpells
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
index 0872c8cfe0e..2837b3d1b75 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
@@ -23,14 +23,14 @@ SDCategory: Shadowfang Keep
EndScriptData */
#include "ScriptMgr.h"
-#include "Creature.h"
-#include "CreatureAI.h"
+#include "shadowfang_keep.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Log.h"
#include "Map.h"
-#include "shadowfang_keep.h"
+#include "ScriptedCreature.h"
#include "TemporarySummon.h"
+#include <sstream>
#define MAX_ENCOUNTER 4
@@ -217,7 +217,7 @@ public:
return str_data;
}
- void Load(const char* in) override
+ void Load(char const* in) override
{
if (!in)
{
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
index db50a0c8f34..a69238119d4 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
@@ -27,11 +27,11 @@ npc_shadowfang_prisoner
EndContentData */
#include "ScriptMgr.h"
+#include "shadowfang_keep.h"
#include "InstanceScript.h"
#include "Player.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
-#include "shadowfang_keep.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h
index e7163fd64e0..486c9750acc 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h
@@ -33,7 +33,7 @@ enum SKDataTypes
DATA_APOTHECARY_HUMMEL = 6
};
-template<typename AI, typename T>
+template <class AI, class T>
inline AI* GetShadowfangKeepAI(T* obj)
{
return GetInstanceAI<AI>(obj, SFKScriptName);
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
index 64ecf812e66..04268b037b3 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
@@ -31,6 +31,7 @@ EndScriptData */
#include "Map.h"
#include "Player.h"
#include "stratholme.h"
+#include <sstream>
enum Misc
{
@@ -352,7 +353,7 @@ class instance_stratholme : public InstanceMapScript
return saveStream.str();
}
- void Load(const char* in) override
+ void Load(char const* in) override
{
if (!in)
{
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
index 624047a5ab5..ab619c8abba 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
@@ -30,8 +30,8 @@ npc_spectral_ghostly_citizen
EndContentData */
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "Group.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
@@ -116,7 +116,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_restless_soulAI(creature);
+ return GetStratholmeAI<npc_restless_soulAI>(creature);
}
struct npc_restless_soulAI : public ScriptedAI
@@ -144,7 +144,7 @@ public:
void EnterCombat(Unit* /*who*/) override { }
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (Tagged || spell->Id != SPELL_EGAN_BLASTER)
return;
@@ -209,7 +209,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_spectral_ghostly_citizenAI(creature);
+ return GetStratholmeAI<npc_spectral_ghostly_citizenAI>(creature);
}
struct npc_spectral_ghostly_citizenAI : public ScriptedAI
@@ -235,7 +235,7 @@ public:
void EnterCombat(Unit* /*who*/) override { }
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (!Tagged && spell->Id == SPELL_EGAN_BLASTER)
Tagged = true;
diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
index acf914ebba3..448150295a1 100644
--- a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
+++ b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
@@ -50,7 +50,7 @@ enum CreatureIds
class instance_sunken_temple : public InstanceMapScript
{
public:
- instance_sunken_temple() : InstanceMapScript("instance_sunken_temple", 109) { }
+ instance_sunken_temple() : InstanceMapScript(STScriptName, 109) { }
InstanceScript* GetInstanceScript(InstanceMap* map) const override
{
@@ -174,7 +174,7 @@ public:
void UseLastStatue(GameObject* go)
{
for (uint8 i = 0; i < nStatues; ++i)
- go->SummonGameObject(GO_ATALAI_LIGHT2, statuePositions[i], G3D::Quat(), 0);
+ go->SummonGameObject(GO_ATALAI_LIGHT2, statuePositions[i], QuaternionData(), 0);
go->SummonCreature(NPC_ATALALARION, atalalarianPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200);
}
diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp
index 4998861939e..5e0a2fc0a29 100644
--- a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp
+++ b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp
@@ -28,10 +28,10 @@ EndContentData */
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "sunken_temple.h"
/*#####
@@ -43,7 +43,7 @@ class at_malfurion_stormrage : public AreaTriggerScript
public:
at_malfurion_stormrage() : AreaTriggerScript("at_malfurion_stormrage") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*areaTrigger*/, bool /*entered*/) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/, bool /*entered*/) override
{
if (player->GetInstanceScript() && !player->FindNearestCreature(15362, 15))
player->SummonCreature(15362, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), -1.52f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 100000);
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
index 751ff1d16c1..9821ed2edae 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
@@ -24,7 +24,6 @@ EndScriptData */
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "Log.h"
-#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "sunwell_plateau.h"
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
index a6bf0dec111..e733c6810c2 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
@@ -17,7 +17,6 @@
#include "ScriptMgr.h"
#include "InstanceScript.h"
-#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "sunwell_plateau.h"
@@ -162,7 +161,7 @@ public:
me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
}
- void SpellHitTarget(Unit* target, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
switch (spell->Id)
{
@@ -438,7 +437,7 @@ public:
me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
}
- void SpellHitTarget(Unit* target, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
switch (spell->Id)
{
@@ -675,7 +674,7 @@ public:
void EnterCombat(Unit* /*who*/) override { }
- void SpellHitTarget(Unit* target, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
switch (spell->Id)
{
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
index 229e942103e..fb11d19b833 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
@@ -198,7 +198,7 @@ public:
instance->SetBossState(DATA_FELMYST, DONE);
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
// workaround for linked aura
/*if (spell->Id == SPELL_VAPOR_FORCE)
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
index 9ed81e6f526..684b094e06b 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
@@ -26,13 +26,13 @@ EndScriptData */
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "Log.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "sunwell_plateau.h"
#include "TemporarySummon.h"
#include <cmath>
@@ -707,7 +707,7 @@ public:
case TIMER_SPEECH:
if (SpeechBegins)
{
- SpeechBegins=false;
+ SpeechBegins = false;
switch (Phase)
{
case PHASE_NORMAL:
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h
index 1ea9a56f7ec..2ddb4233a18 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h
@@ -116,7 +116,7 @@ enum SWPGameObjectIds
};
template <class AI, class T>
-inline AI* GetSunwellPlateauAI(T* obj)
+AI* GetSunwellPlateauAI(T* obj)
{
return GetInstanceAI<AI>(obj, SunwellPlateauScriptName);
}
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
index 79c8eb1f05b..8a2496b55da 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
@@ -26,14 +26,14 @@ On his death the vault door opens.
EndScriptData */
#include "ScriptMgr.h"
+#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "SpellInfo.h"
#include "uldaman.h"
-#include "GameObject.h"
enum Says
{
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
index 0b6128af171..02b7a121b96 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
@@ -32,6 +32,7 @@ EndScriptData */
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "uldaman.h"
+#include <sstream>
enum Spells
{
@@ -418,7 +419,7 @@ class instance_uldaman : public InstanceMapScript
return str_data;
}
- void Load(const char* in) override
+ void Load(char const* in) override
{
if (!in)
{
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
index becc9fcb5d7..b8539f686bf 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
@@ -30,10 +30,10 @@ EndContentData */
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "uldaman.h"
/*######
@@ -102,7 +102,7 @@ class npc_jadespine_basilisk : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_jadespine_basiliskAI(creature);
+ return GetUldamanAI<npc_jadespine_basiliskAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
index ee4137453df..8db37e7275a 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
@@ -23,11 +23,12 @@
#include "ScriptedCreature.h"
#include "WorldStatePackets.h"
#include "zulaman.h"
+#include <sstream>
class instance_zulaman : public InstanceMapScript
{
public:
- instance_zulaman() : InstanceMapScript(ZulAmanScriptName, 568) { }
+ instance_zulaman() : InstanceMapScript(ZulamanScriptName, 568) { }
struct instance_zulaman_InstanceScript : public InstanceScript
{
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h
index 4c2fadfb49f..5a482417563 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h
+++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h
@@ -21,7 +21,7 @@
#include "CreatureAIImpl.h"
uint32 const EncounterCount = 6;
-#define ZulAmanScriptName "instance_zulaman"
+#define ZulamanScriptName "instance_zulaman"
#define DataHeader "ZA"
enum ZADataTypes
@@ -80,10 +80,10 @@ enum ZAWorldStates
WORLD_STATE_ZULAMAN_TIMER = 3106,
};
-template<typename AI>
-CreatureAI* GetZulAmanAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetZulAmanAI(T* obj)
{
- return GetInstanceAI<AI>(creature, ZulAmanScriptName);
+ return GetInstanceAI<AI>(obj, ZulamanScriptName);
}
#endif
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
index 8ff09f8bb9b..4dfb3a9e2d2 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
@@ -17,7 +17,6 @@
#include "ScriptMgr.h"
#include "Creature.h"
-#include "GameObject.h"
#include "InstanceScript.h"
#include "zulgurub.h"
@@ -84,38 +83,6 @@ class instance_zulgurub : public InstanceMapScript
}
}
- void OnGameObjectCreate(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_VENOXIS_COIL:
- case GO_ARENA_DOOR_1:
- case GO_FORCEFIELD:
- case GO_ZANZIL_DOOR:
- case GO_THE_CACHE_OF_MADNESS_DOOR:
- AddDoor(go, true);
- break;
- default:
- break;
- }
- }
-
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_VENOXIS_COIL:
- case GO_ARENA_DOOR_1:
- case GO_FORCEFIELD:
- case GO_ZANZIL_DOOR:
- case GO_THE_CACHE_OF_MADNESS_DOOR:
- AddDoor(go, false);
- break;
- default:
- break;
- }
- }
-
bool SetBossState(uint32 type, EncounterState state) override
{
if (!InstanceScript::SetBossState(type, state))
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
index d4d2908dec5..517553727e6 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
@@ -20,8 +20,8 @@
#include "CreatureAIImpl.h"
-#define DataHeader "ZG"
#define ZGScriptName "instance_zulgurub"
+#define DataHeader "ZG"
uint32 const EncounterCount = 5;
@@ -89,8 +89,8 @@ enum ZGGameObjectIds
GO_THE_CACHE_OF_MADNESS_DOOR = 208843
};
-template<class AI, class T>
-AI* GetZulGurubAI(T* obj)
+template <class AI, class T>
+inline AI* GetZulGurubAI(T* obj)
{
return GetInstanceAI<AI>(obj, ZGScriptName);
}
diff --git a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp
index 068cfbc74e6..818418e65d9 100644
--- a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp
@@ -146,7 +146,7 @@ class at_twilight_grove : public AreaTriggerScript
public:
at_twilight_grove() : AreaTriggerScript("at_twilight_grove") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*areaTrigger*/, bool /*entered*/) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/, bool /*entered*/) override
{
if (player->GetQuestStatus(QUEST_NIGHTMARES_CORRUPTION) == QUEST_STATUS_INCOMPLETE)
if (!player->FindNearestCreature(NPC_TWILIGHT_CORRUPTER, 500.0f, true))
diff --git a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
index 1751bf9c77c..7c7c2c742c2 100644
--- a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
@@ -28,9 +28,8 @@ EndContentData */
#include "ScriptMgr.h"
#include "MotionMaster.h"
-#include "ScriptedCreature.h"
-#include "ScriptedEscortAI.h"
#include "Player.h"
+#include "ScriptedEscortAI.h"
/*######
## npc_oox09hl
diff --git a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp
index 4ea7686519c..9ffe7b541fc 100644
--- a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp
@@ -73,7 +73,7 @@ public:
me->SetEmoteState(EMOTE_STATE_NONE);
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (bReset || spell->Id != SPELL_YENNIKUS_RELEASE)
return;
diff --git a/src/server/scripts/Events/fireworks_show.cpp b/src/server/scripts/Events/fireworks_show.cpp
index 664bb5b5dff..2d4b9e2ab0b 100644
--- a/src/server/scripts/Events/fireworks_show.cpp
+++ b/src/server/scripts/Events/fireworks_show.cpp
@@ -17,13 +17,13 @@
#include "ScriptMgr.h"
#include "Containers.h"
+#include "CreatureAIImpl.h"
#include "EventMap.h"
+#include "GameEventMgr.h"
#include "GameObject.h"
#include "GameObjectAI.h"
#include "GameTime.h"
-#include "CreatureAIImpl.h"
-#include "GameEventMgr.h"
-#include "World.h"
+#include "Util.h"
enum FireworksShowTypeObjects
{
@@ -79,7 +79,7 @@ enum FireworksZones
STORMWIND = 1519
};
-static const std::vector<Position> BootyBayPos =
+std::vector<Position> const BootyBayPos =
{
{ -14358.03f, 515.058f, 34.2664f, 3.68265f },
{ -14357.49f, 490.8445f, 39.47329f, 0.9773831f },
@@ -108,7 +108,7 @@ static const std::vector<Position> BootyBayPos =
{ -14378.1f, 473.5608f, 40.16786f, 0.9773831f }
};
-static const std::vector<Position> StormwindPos =
+std::vector<Position> const StormwindPos =
{
{ -8823.592f, 470.316f, 179.2295f, 1.239183f },
{ -8883.005f, 590.1927f, 163.1264f, 0.9773831f },
@@ -229,7 +229,7 @@ static const std::vector<Position> StormwindPos =
{ -8872.734375f, 573.338440f, 97.723770f, 1.831103f }
};
-static const std::vector<Position> OrgrimmarPos =
+std::vector<Position> const OrgrimmarPos =
{
{ 1609.075f, -4383.707f, 90.23414f, 0.3665176f },
{ 1469.648f, -4371.285f, 113.8313f, 6.073746f },
@@ -326,7 +326,7 @@ static const std::vector<Position> OrgrimmarPos =
{ 1493.26253f, -4402.19919f, 59.147816f, 2.2917f }
};
-static const std::vector<Position> IronForgePos =
+std::vector<Position> const IronForgePos =
{
{ -5196.038f, -858.4618f, 525.0447f, 6.073746f },
{ -5195.734f, -887.6441f, 534.168f, 3.68265f },
@@ -387,7 +387,7 @@ static const std::vector<Position> IronForgePos =
{ -5194.976f, -759.9896f, 517.6288f, 3.630291f }
};
-static const std::vector<Position> SilvermoonPos =
+std::vector<Position> const SilvermoonPos =
{
{ 9466.583f, -7307.326f, 107.8366f, 0.1047193f },
{ 9411.616f, -7322.223f, 79.95399f, 2.722713f },
@@ -457,7 +457,7 @@ static const std::vector<Position> SilvermoonPos =
{ 9411.504f, -7288.202f, 112.2664f, 2.844883f }
};
-static const std::vector<Position> ExodarPos =
+std::vector<Position> const ExodarPos =
{
{ -3992.465f, -11843.86f, 186.4043f, 2.199115f },
{ -3948.378f, -11854.06f, 135.6206f, 3.47321f },
@@ -519,7 +519,7 @@ static const std::vector<Position> ExodarPos =
{ -4036.461f, -11783.4f, 142.8152f, 4.729844f }
};
-static const std::vector<Position> ThunderBluffPos =
+std::vector<Position> const ThunderBluffPos =
{
{ -1234.804f, -19.72239f, 206.5436f, 0.1396245f },
{ -1244.442f, -35.88308f, 206.82f, 4.729844f },
@@ -581,7 +581,7 @@ static const std::vector<Position> ThunderBluffPos =
{ -1240.617f, -41.39486f, 205.0362f, 5.846854f }
};
-static const std::vector<Position> UndercityPos =
+std::vector<Position> const UndercityPos =
{
{ 1850.231f, 257.0156f, 124.1743f, 4.729844f },
{ 1863.302f, 193.9063f, 114.5829f, 0.9773831f },
@@ -641,7 +641,7 @@ static const std::vector<Position> UndercityPos =
{ 1850.288f, 267.309f, 125.0537f, 3.630291f }
};
-static const std::vector<Position> DarnassusPos =
+std::vector<Position> const DarnassusPos =
{
{ 8578.888f, 975.2604f, 42.48742f, 5.846854f },
{ 8574.236f, 944.2083f, 44.71943f, 4.76475f },
@@ -704,20 +704,20 @@ static const std::vector<Position> DarnassusPos =
{ 8554.825f, 813.0746f, 78.88226f, 6.0912f }
};
-static const std::unordered_map<uint32, std::vector<Position> const&> pos =
+std::unordered_map<uint32, std::vector<Position> const*> const PositionsByZoneMap =
{
- { STRANGLETHORN_VALE, BootyBayPos },
- { STORMWIND, StormwindPos },
- { ORGRIMMAR, OrgrimmarPos },
- { DUROTAR, OrgrimmarPos },
- { DUN_MOROGH, IronForgePos },
- { IRONFORGE, IronForgePos },
- { EVERSONG_WOODS, SilvermoonPos },
- { EXODAR, ExodarPos },
- { THUNDERBLUFF, ThunderBluffPos },
- { UNDERCITY, UndercityPos },
- { TIRISFAL_GLADES, UndercityPos },
- { TELDRASSIL, DarnassusPos }
+ { STRANGLETHORN_VALE, &BootyBayPos },
+ { STORMWIND, &StormwindPos },
+ { ORGRIMMAR, &OrgrimmarPos },
+ { DUROTAR, &OrgrimmarPos },
+ { DUN_MOROGH, &IronForgePos },
+ { IRONFORGE, &IronForgePos },
+ { EVERSONG_WOODS, &SilvermoonPos },
+ { EXODAR, &ExodarPos },
+ { THUNDERBLUFF, &ThunderBluffPos },
+ { UNDERCITY, &UndercityPos },
+ { TIRISFAL_GLADES, &UndercityPos },
+ { TELDRASSIL, &DarnassusPos }
};
class go_cheer_speaker : public GameObjectScript
@@ -733,7 +733,7 @@ public:
_big = true;
}
- uint32 CheerPicker()
+ static uint32 CheerPicker()
{
uint32 newid = RAND(
SOUND_CHEER_1,
@@ -744,7 +744,7 @@ public:
return newid;
}
- uint32 FireworksPicker()
+ static uint32 FireworksPicker()
{
uint32 newid = RAND(
FIREWORK_SHOW_TYPE_1_RED,
@@ -774,7 +774,7 @@ public:
return newid;
}
- uint32 FireworksBIGOnlyPicker()
+ static uint32 FireworksBIGOnlyPicker()
{
uint32 newid = RAND(
FIREWORK_SHOW_TYPE_1_RED_BIG,
@@ -845,45 +845,44 @@ public:
{
switch (eventId)
{
- case EVENT_CHEER:
- {
- me->PlayDistanceSound(CheerPicker());
- break;
- }
- case EVENT_FIRE:
- {
- auto it = pos.find(me->GetZoneId());
- if (it != pos.end())
+ case EVENT_CHEER:
{
- Position const& rndpos = Trinity::Containers::SelectRandomContainerElement(it->second);
- float rndrot = frand(-1.0000000f, 1.0000000f);
- float rndrot2 = frand(-1.0000000f, 1.0000000f);
-
- if (_big)
+ me->PlayDistanceSound(CheerPicker());
+ break;
+ }
+ case EVENT_FIRE:
+ {
+ if (std::vector<Position> const* positions = Trinity::Containers::MapGetValuePtr(PositionsByZoneMap, me->GetZoneId()))
{
- if (GameObject* firework = me->SummonGameObject(FireworksBIGOnlyPicker(), rndpos, QuaternionData(0.f, 0.f, rndrot, rndrot2), 300))
+ Position const& rndpos = Trinity::Containers::SelectRandomContainerElement(*positions);
+ float rndrot = frand(-1.0000000f, 1.0000000f);
+ float rndrot2 = frand(-1.0000000f, 1.0000000f);
+
+ if (_big)
{
- firework->SetRespawnTime(0);
- firework->Delete();
+ if (GameObject* firework = me->SummonGameObject(FireworksBIGOnlyPicker(), rndpos, QuaternionData(0.f, 0.f, rndrot, rndrot2), 300))
+ {
+ firework->SetRespawnTime(0);
+ firework->Delete();
+ }
}
- }
- else
- {
- if (GameObject* firework = me->SummonGameObject(FireworksPicker(), rndpos, QuaternionData(0.f, 0.f, rndrot, rndrot2), 300))
+ else
{
- firework->SetRespawnTime(0);
- firework->Delete();
+ if (GameObject* firework = me->SummonGameObject(FireworksPicker(), rndpos, QuaternionData(0.f, 0.f, rndrot, rndrot2), 300))
+ {
+ firework->SetRespawnTime(0);
+ firework->Delete();
+ }
}
}
- }
- if (_started == true)
- _events.ScheduleEvent(EVENT_FIRE, Seconds(1), Seconds(2));
+ if (_started == true)
+ _events.ScheduleEvent(EVENT_FIRE, Seconds(1), Seconds(2));
- break;
- }
- default:
- break;
+ break;
+ }
+ default:
+ break;
}
}
}
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
index 4dbc0faeefc..3483aa98bbc 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
@@ -17,9 +17,9 @@
#include "ScriptMgr.h"
#include "blackfathom_deeps.h"
-#include "GameObjectAI.h"
-#include "GameObject.h"
#include "InstanceScript.h"
+#include "GameObject.h"
+#include "GameObjectAI.h"
#include "Player.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
@@ -232,7 +232,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_morriduneAI(creature);
+ return GetBlackfathomDeepsAI<npc_morriduneAI>(creature);
}
};
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h
index 06f2481e88d..1645c51d6bc 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h
@@ -70,8 +70,8 @@ enum BFDGameObjectIds
GO_ALTAR_OF_THE_DEEPS = 103016
};
-template<class AI, class T>
-AI* GetBlackfathomDeepsAI(T* obj)
+template <class AI, class T>
+inline AI* GetBlackfathomDeepsAI(T* obj)
{
return GetInstanceAI<AI>(obj, BFDScriptName);
}
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
index 744fe8bbfe8..8995f69e2da 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
@@ -29,7 +29,7 @@ EndScriptData */
#include "InstanceScript.h"
#include "Map.h"
-const Position LorgusPosition[4] =
+Position const LorgusPosition[4] =
{
{ -458.500610f, -38.343079f, -33.474445f, 0.0f },
{ -469.423615f, -88.400513f, -39.265102f, 0.0f },
@@ -37,7 +37,7 @@ const Position LorgusPosition[4] =
{ -759.640564f, 16.658913f, -29.159529f, 0.0f }
};
-const Position SpawnsLocation[] =
+Position const SpawnsLocation[] =
{
{-775.431f, -153.853f, -25.871f, 3.207f},
{-775.404f, -174.132f, -25.871f, 3.185f},
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp
index f0ec8201354..fe9e8751aab 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp
@@ -103,7 +103,7 @@ public:
{
if (waypointId == 7)
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp
index 7bf194886de..92e648bcadf 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp
@@ -141,7 +141,7 @@ public:
{
if (CheckTimer <= diff)
{
- if (Unit* Archimonde = ObjectAccessor::GetUnit(*me, ArchimondeGUID))
+ if (Creature* Archimonde = ObjectAccessor::GetCreature(*me, ArchimondeGUID))
{
if (Archimonde->HealthBelowPct(2) || !Archimonde->IsAlive())
DoCast(me, SPELL_DENOUEMENT_WISP);
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp
index 6c0312e4cc9..3e7aa8ca3bf 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp
@@ -106,7 +106,7 @@ public:
{
if (waypointId == 7 && instance)
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp
index 58ec719171b..ea4adb80dee 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp
@@ -101,7 +101,7 @@ public:
{
if (waypointId == 7 && instance)
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp
index 2bc7280de07..16acd943c7f 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp
@@ -96,7 +96,7 @@ public:
{
if (waypointId == 7 && instance)
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h
index fae71b7ff87..ad4ea550da0 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h
@@ -95,10 +95,10 @@ enum HYGameobjectIds
#define MINRAIDDAMAGE 700000 // minimal damage before trash can drop loot and reputation, resets if faction leader dies
-template<typename AI>
-inline AI* GetHyjalAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetHyjalAI(T* obj)
{
- return GetInstanceAI<AI>(creature, HyjalScriptName);
+ return GetInstanceAI<AI>(obj, HyjalScriptName);
}
#endif
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
index eed14268a3a..82937c6b6af 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
@@ -674,7 +674,7 @@ void hyjalAI::DeSpawnVeins()
{
if (Faction == 1)
{
- Creature* unit=ObjectAccessor::GetCreature((*me), instance->GetGuidData(DATA_JAINAPROUDMOORE));
+ Creature* unit = ObjectAccessor::GetCreature((*me), instance->GetGuidData(DATA_JAINAPROUDMOORE));
if (!unit)return;
hyjalAI* ai = CAST_AI(hyjalAI, unit->AI());
if (!ai)return;
@@ -686,7 +686,7 @@ void hyjalAI::DeSpawnVeins()
}
else if (Faction)
{
- Creature* unit=ObjectAccessor::GetCreature((*me), instance->GetGuidData(DATA_THRALL));
+ Creature* unit = ObjectAccessor::GetCreature((*me), instance->GetGuidData(DATA_THRALL));
if (!unit)
return;
hyjalAI* ai = CAST_AI(hyjalAI, unit->AI());
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h
index 02a08962741..af7643f0c97 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h
@@ -203,6 +203,5 @@ struct hyjalAI : public EscortAI
private:
uint32 SpellTimer[3];
- //std::list<uint64> CreatureList;
};
#endif
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
index 02997808b88..b5e2568bdd2 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
@@ -449,7 +449,7 @@ public:
{
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
@@ -461,8 +461,10 @@ public:
if (Delay <= diff)
{
Delay=0;
- }else{
- Delay-=diff;
+ }
+ else
+ {
+ Delay -= diff;
return;
}
if (!meteor)
@@ -485,7 +487,7 @@ public:
CanMove = true;
if (instance->GetData(DATA_ALLIANCE_RETREAT) && !instance->GetData(DATA_HORDE_RETREAT))
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
} else if (instance->GetData(DATA_ALLIANCE_RETREAT) && instance->GetData(DATA_HORDE_RETREAT)){
@@ -513,7 +515,7 @@ public:
if (!imol)
{
DoCast(me, SPELL_IMMOLATION);
- imol=true;
+ imol = true;
}
if (FlameBuffetTimer <= diff)
{
@@ -562,13 +564,13 @@ public:
{
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
else
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
@@ -660,13 +662,13 @@ public:
{
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
else
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
@@ -770,13 +772,13 @@ public:
{
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
else
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
@@ -883,13 +885,13 @@ public:
{
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
else
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
@@ -979,13 +981,13 @@ public:
{
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
else
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
@@ -1065,13 +1067,13 @@ public:
{
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
else
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
if (target && target->IsAlive())
AddThreat(target, 0.0f);
}
@@ -1157,7 +1159,7 @@ public:
{
if (waypointId == 2 && !IsOverrun)
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL));
if (target && target->IsAlive())
{
AddThreat(target, 0.0f);
@@ -1221,7 +1223,9 @@ public:
{
me->GetMotionMaster()->MoveChase(me->GetVictim());
MoveTimer = 2000;
- } else MoveTimer-=diff;
+ }
+ else
+ MoveTimer -= diff;
}
if (FrostBreathTimer <= diff)
@@ -1233,7 +1237,9 @@ public:
me->GetMotionMaster()->Clear();
FrostBreathTimer = 4000;
}
- } else FrostBreathTimer -= diff;
+ }
+ else
+ FrostBreathTimer -= diff;
}
};
};
@@ -1278,7 +1284,7 @@ public:
{
if (waypointId == 2 && !IsOverrun)
{
- Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
+ Creature* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL));
if (target && target->IsAlive())
{
AddThreat(target, 0.0f);
@@ -1354,12 +1360,14 @@ public:
{
float x, y, z;
me->EnsureVictim()->GetPosition(x, y, z);
- me->GetMotionMaster()->MovePoint(0, x, y, z+Zpos);
+ me->GetMotionMaster()->MovePoint(0, x, y, z + Zpos);
Zpos -= 1.0f;
if (Zpos <= 0)
Zpos = 0;
MoveTimer = 2000;
- } else MoveTimer-=diff;
+ }
+ else
+ MoveTimer -= diff;
}
if (StrikeTimer <= diff)
@@ -1370,8 +1378,12 @@ public:
me->StopMoving();
me->GetMotionMaster()->Clear();
StrikeTimer = 2000 + rand32() % 1000;
- } else StrikeTimer=0;
- } else StrikeTimer -= diff;
+ }
+ else
+ StrikeTimer = 0;
+ }
+ else
+ StrikeTimer -= diff;
}
};
};
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp
index 3a451ed3b80..9796c467438 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp
@@ -30,6 +30,7 @@ EndScriptData */
#include "InstanceScript.h"
#include "Log.h"
#include "Map.h"
+#include <sstream>
/* Battle of Mount Hyjal encounters:
0 - Rage Winterchill event
@@ -279,7 +280,7 @@ public:
return str_data;
}
- void Load(const char* in) override
+ void Load(char const* in) override
{
if (!in)
{
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h
index dd8666c6cff..a9b9f4a9698 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h
@@ -103,10 +103,10 @@ enum CSInstanceEvents
EVENT_INFINITE_TIMER = 1
};
-template<typename AI>
-inline AI* GetCullingOfStratholmeAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetCullingOfStratholmeAI(T* obj)
{
- return GetInstanceAI<AI>(creature, CoSScriptName);
+ return GetInstanceAI<AI>(obj, CoSScriptName);
}
#endif
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp
index a754e1a0a05..e35f6b85741 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp
@@ -24,11 +24,11 @@ EndScriptData */
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "old_hillsbrad.h"
#include "ScriptedEscortAI.h"
-#include "GameObjectAI.h"
/*######
## go_barrel_old_hillsbrad
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
index 3e919e5288e..421de855691 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
@@ -30,9 +30,9 @@ EndContentData */
#include "ScriptMgr.h"
#include "InstanceScript.h"
-#include "Map.h"
#include "ObjectAccessor.h"
#include "old_hillsbrad.h"
+#include "Map.h"
#include "Player.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
@@ -350,7 +350,7 @@ public:
case 106:
{
//trigger taretha to run down outside
- if (Creature* Taretha = instance->instance->GetCreature(instance->GetGuidData(DATA_TARETHA)))
+ if (Creature* Taretha = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_TARETHA)))
{
if (Player* player = GetPlayerForEscort())
ENSURE_AI(EscortAI, (Taretha->AI()))->Start(false, true, player->GetGUID());
@@ -613,7 +613,7 @@ public:
if (instance->GetGuidData(DATA_EPOCH).IsEmpty())
me->SummonCreature(ENTRY_EPOCH, 2639.13f, 698.55f, 65.43f, 4.59f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
- if (Creature* thrall = (ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL))))
+ if (Creature* thrall = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL)))
ENSURE_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, thrall->AI())->StartWP();
}
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h
index 950ea70df57..882b2e398bf 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h
@@ -49,5 +49,4 @@ inline AI* GetOldHillsbradAI(T* obj)
return GetInstanceAI<AI>(obj, OHScriptName);
}
-
#endif
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp
index 8d055a94676..18d41d52417 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp
@@ -85,7 +85,6 @@ public:
}
void MoveInLineOfSight(Unit* who) override
-
{
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER)
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp
index 094d9ebdc5e..1ba5ce96763 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp
@@ -142,7 +142,7 @@ public:
void EnterCombat(Unit* /*who*/) override { }
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (SpellCorrupt_Timer)
return;
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.h b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.h
index 610d2ea87b7..16328a47d19 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.h
@@ -67,10 +67,10 @@ enum TBMCreatureIds
NPC_INFINITE_VANQUISHER = 18995
};
-template<typename AI>
-inline AI* GetBlackMorassAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetBlackMorassAI(T* obj)
{
- return GetInstanceAI<AI>(creature, TBMScriptName);
+ return GetInstanceAI<AI>(obj, TBMScriptName);
}
#endif
diff --git a/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp b/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp
index 94ce548ab26..501c6a60307 100644
--- a/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp
+++ b/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp
@@ -67,7 +67,6 @@ public:
{
return new instance_dire_maul_InstanceMapScript(map);
}
-
};
void AddSC_instance_dire_maul()
diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp
index 4de12767b62..83ecd9ca6c5 100644
--- a/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp
+++ b/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp
@@ -22,6 +22,7 @@
#include "halls_of_origination.h"
#include "InstanceScript.h"
#include "Map.h"
+#include <sstream>
DoorData const doorData[] =
{
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp
index 14d58ae49e5..30f0c91ba4b 100644
--- a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp
+++ b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp
@@ -23,6 +23,7 @@ SDCategory: Maraudon
EndScriptData */
#include "ScriptMgr.h"
+#include "maraudon.h"
#include "ScriptedCreature.h"
enum Spells
@@ -39,7 +40,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new celebras_the_cursedAI(creature);
+ return GetMaraudonAI<celebras_the_cursedAI>(creature);
}
struct celebras_the_cursedAI : public ScriptedAI
diff --git a/src/server/scripts/Kalimdor/Maraudon/maraudon.h b/src/server/scripts/Kalimdor/Maraudon/maraudon.h
index e0dd002ffa9..01226e42411 100644
--- a/src/server/scripts/Kalimdor/Maraudon/maraudon.h
+++ b/src/server/scripts/Kalimdor/Maraudon/maraudon.h
@@ -22,10 +22,10 @@
#define MaraudonScriptName "instance_maraudon"
-template<typename AI>
-inline AI* GetMaraudonAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetMaraudonAI(T* obj)
{
- return GetInstanceAI<AI>(creature, MaraudonScriptName);
+ return GetInstanceAI<AI>(obj, MaraudonScriptName);
}
#endif // maraudon_h__
diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
index 6cb992f3b9b..7acd361d087 100644
--- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
+++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
@@ -27,7 +27,6 @@ EndScriptData */
#include "ScriptMgr.h"
#include "CellImpl.h"
-#include "CreatureAIImpl.h"
#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
@@ -196,7 +195,7 @@ public:
Talk(SAY_KILL);
}
- void SpellHit(Unit* /*pCaster*/, const SpellInfo* Spell) override
+ void SpellHit(Unit* /*pCaster*/, SpellInfo const* Spell) override
{
if (Spell->Id == SPELL_BREATH_EAST_TO_WEST ||
Spell->Id == SPELL_BREATH_WEST_TO_EAST ||
@@ -274,7 +273,7 @@ public:
}
}
- void SpellHitTarget(Unit* target, const SpellInfo* Spell) override
+ void SpellHitTarget(Unit* target, SpellInfo const* Spell) override
{
//Workaround - Couldn't find a way to group this spells (All Eruption)
if (((Spell->Id >= 17086 && Spell->Id <= 17095) ||
@@ -495,7 +494,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return GetInstanceAI<boss_onyxiaAI>(creature, OLScriptName);
+ return GetOnyxiaAI<boss_onyxiaAI>(creature);
}
};
diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp
index d7ff367acde..fe964806ba2 100644
--- a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp
+++ b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp
@@ -39,7 +39,7 @@ BossBoundaryData const boundaries =
class instance_onyxias_lair : public InstanceMapScript
{
public:
- instance_onyxias_lair() : InstanceMapScript(OLScriptName, 249) { }
+ instance_onyxias_lair() : InstanceMapScript(OnyxiaScriptName, 249) { }
InstanceScript* GetInstanceScript(InstanceMap* map) const override
{
diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h
index 5b2d9f21ce0..69fff591ad8 100644
--- a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h
+++ b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h
@@ -18,7 +18,9 @@
#ifndef DEF_ONYXIAS_LAIR_H
#define DEF_ONYXIAS_LAIR_H
-#define OLScriptName "instance_onyxias_lair"
+#include "CreatureAIImpl.h"
+
+#define OnyxiaScriptName "instance_onyxias_lair"
#define DataHeader "OL"
uint32 const EncounterCount = 1;
@@ -70,4 +72,11 @@ enum OLAchievementData
ACHIEV_CRITERIA_DEEP_BREATH_25_PLAYER = 12569, // Criteria for achievement 4407: She Deep Breaths More (25 player) Everybody evade Deep Breath
ACHIEV_TIMED_START_EVENT = 6601, // Timed event for achievement 4402, 4005: More Dots! (10, 25 player) 5 min kill
};
+
+template <class AI, class T>
+inline AI* GetOnyxiaAI(T* obj)
+{
+ return GetInstanceAI<AI>(obj, OnyxiaScriptName);
+}
+
#endif
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
index c93b7c55cf7..11480b6619d 100644
--- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
@@ -28,13 +28,13 @@ EndContentData */
#include "ScriptMgr.h"
#include "CellImpl.h"
+#include "GameObjectAI.h"
#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "Player.h"
#include "razorfen_downs.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "ScriptedGossip.h"
#include "TemporarySummon.h"
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h
index 8d4d3e042bb..1552b273406 100644
--- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h
@@ -63,8 +63,8 @@ enum RFDGameObjectIds
GO_BELNISTRASZS_BRAZIER = 152097
};
-template<class AI, class T>
-AI* GetRazorfenDownsAI(T* obj)
+template <class AI, class T>
+inline AI* GetRazorfenDownsAI(T* obj)
{
return GetInstanceAI<AI>(obj, RFDScriptName);
}
diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h
index eb59999fcf6..c7b3a028281 100644
--- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h
+++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h
@@ -25,10 +25,10 @@
#define EVENT_WARD_KEEPER 1
-template<typename AI>
-inline AI* GetRazorfenKraulAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetRazorfenKraulAI(T* obj)
{
- return GetInstanceAI<AI>(creature, RFKScriptName);
+ return GetInstanceAI<AI>(obj, RFKScriptName);
}
#endif
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp
index 71ffb168471..1dba0df2ab3 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp
@@ -17,7 +17,6 @@
#include "ScriptMgr.h"
#include "InstanceScript.h"
-#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ruins_of_ahnqiraj.h"
@@ -210,7 +209,7 @@ class boss_ayamiss : public CreatureScript
break;
case EVENT_SWARMER_ATTACK:
for (GuidList::iterator i = _swarmers.begin(); i != _swarmers.end(); ++i)
- if (Creature* swarmer = me->GetMap()->GetCreature(*i))
+ if (Creature* swarmer = ObjectAccessor::GetCreature(*me, *i))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
swarmer->AI()->AttackStart(target);
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp
index 4dab5047481..86638522d5d 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp
@@ -16,8 +16,8 @@
*/
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "Map.h"
#include "MiscPackets.h"
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp
index 82f1c796cb3..df644afa51b 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp
@@ -15,9 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptMgr.h"
#include "ruins_of_ahnqiraj.h"
#include "ScriptedCreature.h"
+#include "ScriptMgr.h"
enum Yells
{
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h
index e646a003b2b..0d68d290032 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h
@@ -60,8 +60,8 @@ enum AQRGameObjectIds
GO_OSSIRIAN_CRYSTAL = 180619
};
-template<class AI, class T>
-AI* GetAQ20AI(T* obj)
+template <class AI, class T>
+inline AI* GetAQ20AI(T* obj)
{
return GetInstanceAI<AI>(obj, AQ20ScriptName);
}
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
index 45e50529481..667e36d2d79 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
@@ -590,7 +590,7 @@ public:
if (WisperTimer <= diff)
{
//Play random sound to the zone
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
me->PlayDirectSound(RANDOM_SOUND_WHISPER, itr->GetSource());
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp
index 9a385210578..947e6e771e4 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp
@@ -245,7 +245,7 @@ public:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_GENERIC_DISMOUNT, SPELL_TRUE_FULFILLMENT_2 });
+ return ValidateSpellInfo({ SPELL_TRUE_FULFILLMENT_2, SPELL_GENERIC_DISMOUNT });
}
void HandleEffect(SpellEffIndex /*effIndex*/)
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp
index 7e6a50056ea..cfe528c3b60 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp
@@ -167,7 +167,7 @@ struct boss_twinemperorsAI : public ScriptedAI
}
}
- void SpellHit(Unit* caster, const SpellInfo* entry) override
+ void SpellHit(Unit* caster, SpellInfo const* entry) override
{
if (caster == me)
return;
@@ -382,9 +382,13 @@ struct boss_twinemperorsAI : public ScriptedAI
if (!me->IsNonMeleeSpellCast(true))
{
DoCast(me, SPELL_BERSERK);
- EnrageTimer = 60*60000;
- } else EnrageTimer = 0;
- } else EnrageTimer-=diff;
+ EnrageTimer = 60 * 60000;
+ }
+ else
+ EnrageTimer = 0;
+ }
+ else
+ EnrageTimer -= diff;
}
};
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp
index 3d00417b211..50eb304600c 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp
@@ -70,24 +70,24 @@ class instance_temple_of_ahnqiraj : public InstanceMapScript
{
switch (creature->GetEntry())
{
- case NPC_SKERAM:
- SkeramGUID = creature->GetGUID();
- break;
- case NPC_VEM:
- VemGUID = creature->GetGUID();
- break;
- case NPC_KRI:
- KriGUID = creature->GetGUID();
- break;
- case NPC_VEKLOR:
- VeklorGUID = creature->GetGUID();
- break;
- case NPC_VEKNILASH:
- VeknilashGUID = creature->GetGUID();
- break;
- case NPC_VISCIDUS:
- ViscidusGUID = creature->GetGUID();
- break;
+ case NPC_SKERAM:
+ SkeramGUID = creature->GetGUID();
+ break;
+ case NPC_VEM:
+ VemGUID = creature->GetGUID();
+ break;
+ case NPC_KRI:
+ KriGUID = creature->GetGUID();
+ break;
+ case NPC_VEKLOR:
+ VeklorGUID = creature->GetGUID();
+ break;
+ case NPC_VEKNILASH:
+ VeknilashGUID = creature->GetGUID();
+ break;
+ case NPC_VISCIDUS:
+ ViscidusGUID = creature->GetGUID();
+ break;
}
}
@@ -101,26 +101,26 @@ class instance_temple_of_ahnqiraj : public InstanceMapScript
{
switch (type)
{
- case DATA_VEMISDEAD:
- if (IsBossDied[0])
- return 1;
- break;
-
- case DATA_VEKLORISDEAD:
- if (IsBossDied[1])
- return 1;
- break;
-
- case DATA_VEKNILASHISDEAD:
- if (IsBossDied[2])
- return 1;
- break;
-
- case DATA_BUG_TRIO_DEATH:
- return BugTrioDeathCount;
-
- case DATA_CTHUN_PHASE:
- return CthunPhase;
+ case DATA_VEMISDEAD:
+ if (IsBossDied[0])
+ return 1;
+ break;
+
+ case DATA_VEKLORISDEAD:
+ if (IsBossDied[1])
+ return 1;
+ break;
+
+ case DATA_VEKNILASHISDEAD:
+ if (IsBossDied[2])
+ return 1;
+ break;
+
+ case DATA_BUG_TRIO_DEATH:
+ return BugTrioDeathCount;
+
+ case DATA_CTHUN_PHASE:
+ return CthunPhase;
}
return 0;
}
@@ -129,18 +129,18 @@ class instance_temple_of_ahnqiraj : public InstanceMapScript
{
switch (identifier)
{
- case DATA_SKERAM:
- return SkeramGUID;
- case DATA_VEM:
- return VemGUID;
- case DATA_KRI:
- return KriGUID;
- case DATA_VEKLOR:
- return VeklorGUID;
- case DATA_VEKNILASH:
- return VeknilashGUID;
- case DATA_VISCIDUS:
- return ViscidusGUID;
+ case DATA_SKERAM:
+ return SkeramGUID;
+ case DATA_VEM:
+ return VemGUID;
+ case DATA_KRI:
+ return KriGUID;
+ case DATA_VEKLOR:
+ return VeklorGUID;
+ case DATA_VEKNILASH:
+ return VeknilashGUID;
+ case DATA_VISCIDUS:
+ return ViscidusGUID;
}
return ObjectGuid::Empty;
} // end GetGuidData
@@ -149,25 +149,25 @@ class instance_temple_of_ahnqiraj : public InstanceMapScript
{
switch (type)
{
- case DATA_VEM_DEATH:
- IsBossDied[0] = true;
- break;
+ case DATA_VEM_DEATH:
+ IsBossDied[0] = true;
+ break;
- case DATA_BUG_TRIO_DEATH:
- ++BugTrioDeathCount;
- break;
+ case DATA_BUG_TRIO_DEATH:
+ ++BugTrioDeathCount;
+ break;
- case DATA_VEKLOR_DEATH:
- IsBossDied[1] = true;
- break;
+ case DATA_VEKLOR_DEATH:
+ IsBossDied[1] = true;
+ break;
- case DATA_VEKNILASH_DEATH:
- IsBossDied[2] = true;
- break;
+ case DATA_VEKNILASH_DEATH:
+ IsBossDied[2] = true;
+ break;
- case DATA_CTHUN_PHASE:
- CthunPhase = data;
- break;
+ case DATA_CTHUN_PHASE:
+ CthunPhase = data;
+ break;
}
}
};
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp
index 907b735de86..05af73caed9 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp
@@ -23,8 +23,6 @@ SDCategory: Temple of Ahn'Qiraj
EndScriptData */
#include "ScriptMgr.h"
-#include "CellImpl.h"
-#include "GridNotifiersImpl.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "temple_of_ahnqiraj.h"
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h
index 45903dd5ddf..b70febfb49f 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h
@@ -64,10 +64,10 @@ enum AQTCreatures
NPC_VEKNILASH = 15275
};
-template<typename AI>
-inline AI* GetAQ40AI(Creature* creature)
+template <class AI, class T>
+inline AI* GetAQ40AI(T* obj)
{
- return GetInstanceAI<AI>(creature, AQ40ScriptName);
+ return GetInstanceAI<AI>(obj, AQ40ScriptName);
}
#endif
diff --git a/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp
index 3fa16d392e8..d7730710aa2 100644
--- a/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp
+++ b/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp
@@ -28,6 +28,7 @@ EndScriptData */
#include "Log.h"
#include "Map.h"
#include "wailing_caverns.h"
+#include <sstream>
#define MAX_ENCOUNTER 9
@@ -117,7 +118,7 @@ public:
return saveStream.str();
}
- void Load(const char* in) override
+ void Load(char const* in) override
{
if (!in)
{
diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
index 8de66be387b..61574286512 100644
--- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
+++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
@@ -30,8 +30,8 @@ EndContentData */
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
-#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
+#include "ScriptedGossip.h"
#include "wailing_caverns.h"
/*######
diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h
index 297c14facb3..ffbfd30effb 100644
--- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h
+++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h
@@ -39,10 +39,10 @@ enum WCDataTypes
DATA_NARALEX = 3679,
};
-template<typename AI>
-inline AI* GetWailingCavernsAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetWailingCavernsAI(T* obj)
{
- return GetInstanceAI<AI>(creature, WCScriptName);
+ return GetInstanceAI<AI>(obj, WCScriptName);
}
#endif
diff --git a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp
index bc9819a64a5..0e6f2f9e4d6 100644
--- a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp
+++ b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp
@@ -218,9 +218,9 @@ public:
switch (type)
{
case EVENT_PYRAMID:
- PyramidPhase=data;
+ PyramidPhase = data;
break;
- };
+ }
}
virtual void Update(uint32 diff) override
diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
index 20caee55834..88c44d642ce 100644
--- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
+++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
@@ -29,14 +29,13 @@ EndContentData */
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
-#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
-#include "GameObjectAI.h"
#include "zulfarrak.h"
/*######
@@ -226,7 +225,7 @@ public:
private:
void initBlyCrewMember(uint32 entry, float x, float y, float z)
{
- if (Creature* crew = instance->instance->GetCreature(instance->GetGuidData(entry)))
+ if (Creature* crew = ObjectAccessor::GetCreature(*me, instance->GetGuidData(entry)))
{
crew->SetReactState(REACT_AGGRESSIVE);
crew->SetWalk(true);
@@ -273,7 +272,7 @@ public:
npc_weegli_blastfuseAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
- destroyingDoor=false;
+ destroyingDoor = false;
Bomb_Timer = 10000;
LandMine_Timer = 30000;
}
@@ -348,7 +347,7 @@ public:
me->GetMotionMaster()->MovePoint(0, 1858.57f, 1146.35f, 14.745f);
me->SetHomePosition(1858.57f, 1146.35f, 14.745f, 3.85f); // in case he gets interrupted
Talk(SAY_WEEGLI_OK_I_GO);
- destroyingDoor=true;
+ destroyingDoor = true;
}
}
@@ -429,7 +428,7 @@ public:
GameObjectAI* GetAI(GameObject* go) const override
{
- return new go_shallow_graveAI(go);
+ return GetZulFarrakAI<go_shallow_graveAI>(go);
}
};
@@ -448,7 +447,7 @@ class at_zumrah : public AreaTriggerScript
public:
at_zumrah() : AreaTriggerScript("at_zumrah") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*areaTrigger*/, bool /*entered*/) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/, bool /*entered*/) override
{
Creature* pZumrah = player->FindNearestCreature(ZUMRAH_ID, 30.0f);
diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.h b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.h
index 00563114c00..a4eaca7664d 100644
--- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.h
+++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.h
@@ -56,7 +56,7 @@ enum ZFPyramidPhases
PYRAMID_KILLED_ALL_TROLLS,
};
-template<class AI, class T>
+template <class AI, class T>
inline AI* GetZulFarrakAI(T* obj)
{
return GetInstanceAI<AI>(obj, ZFScriptName);
diff --git a/src/server/scripts/Kalimdor/zone_ashenvale.cpp b/src/server/scripts/Kalimdor/zone_ashenvale.cpp
index dbbc9326969..f4fe4b0d8a9 100644
--- a/src/server/scripts/Kalimdor/zone_ashenvale.cpp
+++ b/src/server/scripts/Kalimdor/zone_ashenvale.cpp
@@ -27,8 +27,8 @@ npc_ruul_snowhoof
EndContentData */
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "Player.h"
#include "ScriptedEscortAI.h"
#include "SpellInfo.h"
diff --git a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp
index 23d0634ec67..26e856b1a84 100644
--- a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp
+++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp
@@ -32,8 +32,8 @@ npc_death_ravager
EndContentData */
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
#include "CellImpl.h"
+#include "GameObjectAI.h"
#include "GridNotifiersImpl.h"
#include "Log.h"
#include "MotionMaster.h"
@@ -107,7 +107,7 @@ public:
}
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->SpellFamilyFlags[2] & 0x80000000 && !_tappedBySpell)
{
diff --git a/src/server/scripts/Kalimdor/zone_durotar.cpp b/src/server/scripts/Kalimdor/zone_durotar.cpp
index 42e2541f477..de3c914722e 100644
--- a/src/server/scripts/Kalimdor/zone_durotar.cpp
+++ b/src/server/scripts/Kalimdor/zone_durotar.cpp
@@ -79,7 +79,7 @@ public:
work = true;
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id != SPELL_AWAKEN_PEON)
return;
@@ -136,16 +136,7 @@ class spell_voodoo : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_BREW,
- SPELL_GHOSTLY,
- SPELL_HEX1,
- SPELL_HEX2,
- SPELL_HEX3,
- SPELL_GROW,
- SPELL_LAUNCH
- });
+ return ValidateSpellInfo({ SPELL_BREW, SPELL_GHOSTLY, SPELL_HEX1, SPELL_HEX2, SPELL_HEX3, SPELL_GROW, SPELL_LAUNCH });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
diff --git a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
index 6fc8ccf9238..6c96f6934d4 100644
--- a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
+++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
@@ -29,7 +29,7 @@ EndContentData */
#include "MotionMaster.h"
#include "Player.h"
#include "QuestDef.h"
-#include "ScriptedEscortAI.h"
+#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellInfo.h"
#include "SpellScript.h"
diff --git a/src/server/scripts/Kalimdor/zone_moonglade.cpp b/src/server/scripts/Kalimdor/zone_moonglade.cpp
index 853c174edb5..0a4bda0cffe 100644
--- a/src/server/scripts/Kalimdor/zone_moonglade.cpp
+++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp
@@ -84,7 +84,7 @@ public:
DoCast(SPELL_OMEN_SUMMON_SPOTLIGHT);
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_ELUNE_CANDLE)
{
diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp
index ebad575fef2..6fc163ad10b 100644
--- a/src/server/scripts/Kalimdor/zone_silithus.cpp
+++ b/src/server/scripts/Kalimdor/zone_silithus.cpp
@@ -35,13 +35,13 @@ go_wind_stone
EndContentData */
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
#include "CreatureAIImpl.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "Group.h"
#include "MotionMaster.h"
-#include "Player.h"
#include "ObjectAccessor.h"
+#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "TemporarySummon.h"
@@ -619,7 +619,7 @@ public:
{
Talk(ARYGOS_YELL_1);
AnachronosQuestTrigger->AI()->EnterEvadeMode();
- eventEnd=true;
+ eventEnd = true;
}
break;
}
diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp
index ec516a0f9b3..04520f7ed09 100644
--- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp
+++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp
@@ -224,7 +224,7 @@ public:
me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY)
{
diff --git a/src/server/scripts/Kalimdor/zone_winterspring.cpp b/src/server/scripts/Kalimdor/zone_winterspring.cpp
index 4aae8ecaffa..50dce2a8864 100644
--- a/src/server/scripts/Kalimdor/zone_winterspring.cpp
+++ b/src/server/scripts/Kalimdor/zone_winterspring.cpp
@@ -29,8 +29,8 @@ go_elune_fire
EndContentData */
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h
index e2e464bc196..f3aa82768d3 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h
@@ -82,7 +82,7 @@ enum AKGameObjectIds
GO_SPHERE_2 = 193094
};
-template<class AI, class T>
+template <class AI, class T>
inline AI* GetAhnKahetAI(T* obj)
{
return GetInstanceAI<AI>(obj, AhnKahetScriptName);
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp
index 5f4a0a1072a..b69f630aa3f 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp
@@ -238,13 +238,6 @@ class spell_ahn_kahet_swarm : public SpellScriptLoader
{
PrepareSpellScript(spell_ahn_kahet_swarm_SpellScript);
- public:
- spell_ahn_kahet_swarm_SpellScript()
- {
- _targetCount = 0;
- }
-
- private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SWARM_BUFF });
@@ -277,7 +270,7 @@ class spell_ahn_kahet_swarm : public SpellScriptLoader
OnEffectHit += SpellEffectFn(spell_ahn_kahet_swarm_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
- uint32 _targetCount;
+ uint32 _targetCount = 0;
};
SpellScript* GetSpellScript() const override
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp
index eb129c37473..04f11878208 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp
@@ -111,7 +111,7 @@ public:
}
}
- void SpellHitTarget(Unit* target, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (spell->Id == SPELL_INSANITY)
{
@@ -136,7 +136,7 @@ public:
return;
// summon twisted party members for this target
- Map::PlayerList const &players = me->GetMap()->GetPlayers();
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{
Player* player = i->GetSource();
@@ -157,7 +157,7 @@ public:
void ResetPlayersPhase()
{
- Map::PlayerList const &players = me->GetMap()->GetPlayers();
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{
Player* player = i->GetSource();
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp
index 7be1553d98e..d64ccae7cd2 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp
@@ -26,7 +26,6 @@
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
-#include "TemporarySummon.h"
enum Yells
{
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
index d75a6942b5e..01ab221855d 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
@@ -18,13 +18,13 @@
#include "ScriptMgr.h"
#include "ahnkahet.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "Spell.h"
#include "SpellScript.h"
@@ -437,12 +437,7 @@ class spell_prince_taldaram_conjure_flame_sphere : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_FLAME_SPHERE_SUMMON_1,
- SPELL_FLAME_SPHERE_SUMMON_2,
- SPELL_FLAME_SPHERE_SUMMON_3
- });
+ return ValidateSpellInfo({ SPELL_FLAME_SPHERE_SUMMON_1, SPELL_FLAME_SPHERE_SUMMON_2, SPELL_FLAME_SPHERE_SUMMON_3 });
}
void HandleScript(SpellEffIndex /*effIndex*/)
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp
index d7317ffc724..41f941299bb 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp
@@ -22,6 +22,7 @@
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
+#include <sstream>
DoorData const doorData[] =
{
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h
index 732fa3aac64..89f32d19db6 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h
@@ -66,10 +66,10 @@ enum ANInstanceActions
ACTION_GATEWATCHER_GREET = 1
};
-template<typename AI>
-inline AI* GetAzjolNerubAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetAzjolNerubAI(T* obj)
{
- return GetInstanceAI<AI>(creature, AzjolNerubScriptName);
+ return GetInstanceAI<AI>(obj, AzjolNerubScriptName);
}
#endif // AZJOL_NERUB_H_
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp
index a3442f83f79..a9b7551f43a 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp
@@ -949,6 +949,7 @@ class spell_hadronox_periodic_summon_template_AuraScript : public AuraScript
spell_hadronox_periodic_summon_template_AuraScript(uint32 topSpellId, uint32 bottomSpellId) : AuraScript(), _topSpellId(topSpellId), _bottomSpellId(bottomSpellId) { }
PrepareAuraScript(spell_hadronox_periodic_summon_template_AuraScript);
+ private:
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ _topSpellId, _bottomSpellId });
@@ -987,7 +988,6 @@ class spell_hadronox_periodic_summon_template_AuraScript : public AuraScript
OnEffectPeriodic += AuraEffectPeriodicFn(spell_hadronox_periodic_summon_template_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
- private:
uint32 _topSpellId;
uint32 _bottomSpellId;
};
@@ -1092,12 +1092,7 @@ class spell_hadronox_web_doors : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_SUMMON_CHAMPION_PERIODIC,
- SPELL_SUMMON_CRYPT_FIEND_PERIODIC,
- SPELL_SUMMON_NECROMANCER_PERIODIC
- });
+ return ValidateSpellInfo({ SPELL_SUMMON_CHAMPION_PERIODIC, SPELL_SUMMON_CRYPT_FIEND_PERIODIC, SPELL_SUMMON_NECROMANCER_PERIODIC });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp
index 7c3eb46d99a..4cb56b57e0a 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp
@@ -19,9 +19,9 @@
* Comment: Find in the future best timers and the event is not implemented.
*/
-#include "Containers.h"
#include "ScriptMgr.h"
#include "azjol_nerub.h"
+#include "Containers.h"
#include "InstanceScript.h"
#include "PassiveAI.h"
#include "ScriptedCreature.h"
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp
index e5b49d744e2..66d888d1adf 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp
@@ -25,34 +25,34 @@
DoorData const doorData[] =
{
{ GO_KRIKTHIR_DOOR, DATA_KRIKTHIR, DOOR_TYPE_PASSAGE },
- { GO_ANUBARAK_DOOR_1, DATA_ANUBARAK, DOOR_TYPE_ROOM },
- { GO_ANUBARAK_DOOR_2, DATA_ANUBARAK, DOOR_TYPE_ROOM },
- { GO_ANUBARAK_DOOR_3, DATA_ANUBARAK, DOOR_TYPE_ROOM },
- { 0, 0, DOOR_TYPE_ROOM } // END
+ { GO_ANUBARAK_DOOR_1, DATA_ANUBARAK, DOOR_TYPE_ROOM },
+ { GO_ANUBARAK_DOOR_2, DATA_ANUBARAK, DOOR_TYPE_ROOM },
+ { GO_ANUBARAK_DOOR_3, DATA_ANUBARAK, DOOR_TYPE_ROOM },
+ { 0, 0, DOOR_TYPE_ROOM } // END
};
ObjectData const creatureData[] =
{
- { NPC_KRIKTHIR, DATA_KRIKTHIR },
- { NPC_HADRONOX, DATA_HADRONOX },
- { NPC_ANUBARAK, DATA_ANUBARAK },
- { NPC_WATCHER_NARJIL, DATA_WATCHER_GASHRA },
- { NPC_WATCHER_GASHRA, DATA_WATCHER_SILTHIK },
- { NPC_WATCHER_SILTHIK, DATA_WATCHER_NARJIL },
- { 0, 0 } // END
+ { NPC_KRIKTHIR, DATA_KRIKTHIR },
+ { NPC_HADRONOX, DATA_HADRONOX },
+ { NPC_ANUBARAK, DATA_ANUBARAK },
+ { NPC_WATCHER_NARJIL, DATA_WATCHER_GASHRA },
+ { NPC_WATCHER_GASHRA, DATA_WATCHER_SILTHIK },
+ { NPC_WATCHER_SILTHIK, DATA_WATCHER_NARJIL },
+ { 0, 0 } // END
};
ObjectData const gameobjectData[] =
{
- { GO_ANUBARAK_DOOR_1, DATA_ANUBARAK_WALL },
+ { GO_ANUBARAK_DOOR_1, DATA_ANUBARAK_WALL },
{ GO_ANUBARAK_DOOR_3, DATA_ANUBARAK_WALL_2 },
- { 0, 0 } // END
+ { 0, 0 } // END
};
BossBoundaryData const boundaries =
{
- { DATA_KRIKTHIR, new RectangleBoundary(400.0f, 580.0f, 623.5f, 810.0f) },
- { DATA_HADRONOX, new ZRangeBoundary(666.0f, 776.0f) },
+ { DATA_KRIKTHIR, new RectangleBoundary(400.0f, 580.0f, 623.5f, 810.0f) },
+ { DATA_HADRONOX, new ZRangeBoundary(666.0f, 776.0f) },
{ DATA_ANUBARAK, new CircleBoundary(Position(550.6178f, 253.5917f), 26.0f) }
};
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
index bc68749811a..c28f227eae7 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
@@ -20,8 +20,8 @@
#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
-#include "obsidian_sanctum.h"
#include "ObjectAccessor.h"
+#include "obsidian_sanctum.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp
index 307d2a9393d..0cfb1059a77 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp
@@ -20,8 +20,8 @@
#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
-#include "obsidian_sanctum.h"
#include "ObjectAccessor.h"
+#include "obsidian_sanctum.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
@@ -737,7 +737,7 @@ class npc_acolyte_of_vesperon : public CreatureScript
vesperon->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP);
}
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (PlayerList.isEmpty())
return;
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h
index 6ba48c640fd..64365ca50b3 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h
+++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h
@@ -48,10 +48,10 @@ enum OSGameObjectIds
GO_TWILIGHT_PORTAL = 193988
};
-template<typename AI>
-inline AI* GetObsidianSanctumAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetObsidianSanctumAI(T* obj)
{
- return GetInstanceAI<AI>(creature, OSScriptName);
+ return GetInstanceAI<AI>(obj, OSScriptName);
}
#endif // OBSIDIAN_SANCTUM_H_
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp
index 2c8a9075d6c..76dea026e36 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp
@@ -15,13 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptedCreature.h"
-#include "InstanceScript.h"
-#include "ObjectAccessor.h"
#include "ScriptMgr.h"
+#include "InstanceScript.h"
+#include "ruby_sanctum.h"
+#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
-#include "ruby_sanctum.h"
enum Texts
{
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp
index a20faea64fb..91968895d25 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp
@@ -20,7 +20,7 @@
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ruby_sanctum.h"
-#include "ScriptedEscortAI.h"
+#include "ScriptedCreature.h"
enum Texts
{
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
index 262782979b6..7c640966554 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
@@ -765,7 +765,7 @@ class npc_halion_controller : public CreatureScript
void DoCheckEvade()
{
- Map::PlayerList const &players = me->GetMap()->GetPlayers();
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
if (Player* player = i->GetSource())
if (player->IsAlive() && CheckBoundary(player) && !player->IsGameMaster())
@@ -1447,7 +1447,8 @@ class spell_halion_combustion_consumption : public SpellScriptLoader
public:
spell_halion_combustion_consumption_AuraScript(uint32 spellID) : AuraScript(), _markSpell(spellID) { }
- bool Validate(SpellInfo const* /*spell*/) override
+ private:
+ bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ _markSpell });
}
@@ -1543,9 +1544,10 @@ class spell_halion_marks : public SpellScriptLoader
spell_halion_marks_AuraScript(uint32 summonSpell, uint32 removeSpell) : AuraScript(),
_summonSpellId(summonSpell), _removeSpellId(removeSpell) { }
+ private:
bool Validate(SpellInfo const* /*spell*/) override
{
- return ValidateSpellInfo({ _summonSpellId });
+ return ValidateSpellInfo({ _summonSpellId, _removeSpellId });
}
/// We were purged. Force removed stacks to zero and trigger the appropriated remove handler.
@@ -1626,7 +1628,7 @@ class spell_halion_damage_aoe_summon : public SpellScriptLoader
class spell_halion_twilight_realm_handlers : public SpellScriptLoader
{
public:
- spell_halion_twilight_realm_handlers(const char* scriptName, uint32 beforeHitSpell, bool isApplyHandler) : SpellScriptLoader(scriptName),
+ spell_halion_twilight_realm_handlers(char const* scriptName, uint32 beforeHitSpell, bool isApplyHandler) : SpellScriptLoader(scriptName),
_beforeHitSpell(beforeHitSpell), _isApplyHandler(isApplyHandler)
{ }
@@ -1639,6 +1641,7 @@ class spell_halion_twilight_realm_handlers : public SpellScriptLoader
_isApply(isApplyHandler), _beforeHitSpellId(beforeHitSpell)
{ }
+ private:
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ _beforeHitSpellId });
@@ -1698,11 +1701,7 @@ class spell_halion_clear_debuffs : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_CLEAR_DEBUFFS,
- SPELL_TWILIGHT_REALM,
- });
+ return ValidateSpellInfo({ SPELL_CLEAR_DEBUFFS, SPELL_TWILIGHT_REALM });
}
void HandleScript(SpellEffIndex effIndex)
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp
index 7500fec1759..7cb74810fee 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp
@@ -20,7 +20,6 @@
#include "MotionMaster.h"
#include "ruby_sanctum.h"
#include "ScriptedCreature.h"
-#include "SpellMgr.h"
#include "SpellScript.h"
enum Texts
@@ -232,10 +231,7 @@ class spell_saviana_conflagration_init : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/) override
{
- if (!sSpellMgr->GetSpellInfo(SPELL_FLAME_BEACON, DIFFICULTY_NONE)
- || !sSpellMgr->GetSpellInfo(SPELL_CONFLAGRATION_2, DIFFICULTY_NONE))
- return false;
- return true;
+ return ValidateSpellInfo({ SPELL_FLAME_BEACON, SPELL_CONFLAGRATION_2 });
}
void FilterTargets(std::list<WorldObject*>& targets)
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
index 708f51879f5..5302117a7e6 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
@@ -72,7 +72,6 @@ ObjectData const gameObjectData[] =
{ 0, 0 } //END
};
-
class instance_ruby_sanctum : public InstanceMapScript
{
public:
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp
index d1fc9f9bbec..0a33d804083 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp
@@ -18,7 +18,6 @@
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
-#include "ObjectAccessor.h"
#include "Player.h"
#include "ruby_sanctum.h"
#include "ScriptedCreature.h"
@@ -206,7 +205,6 @@ class spell_ruby_sanctum_rallying_shout : public SpellScriptLoader
OnEffectHit += SpellEffectFn(spell_ruby_sanctum_rallying_shout_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
- private:
uint32 _targetCount = 0;
};
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
index 63b97d2fb87..095e54609aa 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
@@ -129,7 +129,7 @@ enum RSInstanceSpell
SPELL_BERSERK = 26662
};
-template<typename AI, typename T>
+template <class AI, class T>
inline AI* GetRubySanctumAI(T* obj)
{
return GetInstanceAI<AI>(obj, RSScriptName);
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
index f5aef90a1ae..a672a5ebba7 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
@@ -96,7 +96,7 @@ const Point MovementPoint[] =
*/
void AggroAllPlayers(Creature* temp)
{
- Map::PlayerList const &PlList = temp->GetMap()->GetPlayers();
+ Map::PlayerList const& PlList = temp->GetMap()->GetPlayers();
if (PlList.isEmpty())
return;
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp
index 9e6de98a6e8..af1d910cd26 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp
@@ -31,6 +31,7 @@ EndScriptData */
#include "MotionMaster.h"
#include "Player.h"
#include "trial_of_the_champion.h"
+#include <sstream>
#define MAX_ENCOUNTER 4
@@ -94,7 +95,7 @@ public:
void OnCreatureCreate(Creature* creature) override
{
- Map::PlayerList const &players = instance->GetPlayers();
+ Map::PlayerList const& players = instance->GetPlayers();
uint32 TeamInInstance = 0;
if (!players.isEmpty())
@@ -292,7 +293,7 @@ public:
return str_data;
}
- void Load(const char* in) override
+ void Load(char const* in) override
{
if (!in)
{
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp
index 3ffb9d372f4..9e36ddaa655 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp
@@ -368,8 +368,7 @@ public:
void AggroAllPlayers(Creature* temp)
{
- Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
-
+ Map::PlayerList const& PlList = me->GetMap()->GetPlayers();
if (PlList.isEmpty())
return;
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h
index 8f0af1de250..e802088e7f8 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h
@@ -129,10 +129,10 @@ enum TCVehicles
VEHICLE_BLACK_KNIGHT = 35491
};
-template<class AI>
-inline AI* GetTrialOfTheChampionAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetTrialOfTheChampionAI(T* obj)
{
- return GetInstanceAI<AI>(creature, ToCScriptName);
+ return GetInstanceAI<AI>(obj, ToCScriptName);
}
#endif
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
index d9df4f1abb4..4d1db28dd04 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
@@ -25,8 +25,8 @@
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
-#include "SpellScript.h"
#include "SpellAuraEffects.h"
+#include "SpellScript.h"
#include "TemporarySummon.h"
#include "trial_of_the_crusader.h"
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
index 44afc9f7deb..2f25fa6fec7 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
@@ -23,8 +23,8 @@
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "SpellScript.h"
#include "SpellAuraEffects.h"
+#include "SpellScript.h"
#include "TemporarySummon.h"
#include "trial_of_the_crusader.h"
@@ -343,7 +343,7 @@ enum Events
EVENT_SPELL_LOCK = 2
};
-const Position FactionChampionLoc[] =
+Position const FactionChampionLoc[] =
{
{ 514.231f, 105.569f, 418.234f, 0 }, // 0 - Horde Initial Pos 0
{ 508.334f, 115.377f, 418.234f, 0 }, // 1 - Horde Initial Pos 1
@@ -652,7 +652,7 @@ struct boss_faction_championsAI : public BossAI
{
if (who->GetTypeId() == TYPEID_PLAYER)
{
- Map::PlayerList const &players = me->GetMap()->GetPlayers();
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
uint32 TeamInInstance = 0;
if (!players.isEmpty())
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
index 54378f8b821..b2f6dfcf861 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
@@ -298,7 +298,7 @@ class npc_infernal_volcano : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_infernal_volcanoAI(creature);
+ return GetTrialOfTheCrusaderAI<npc_infernal_volcanoAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
index fa54863673a..eed3903127c 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
@@ -22,8 +22,8 @@
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "SpellScript.h"
#include "SpellAuraEffects.h"
+#include "SpellScript.h"
#include "TemporarySummon.h"
#include "trial_of_the_crusader.h"
#include "Vehicle.h"
@@ -860,7 +860,7 @@ class spell_gormok_fire_bomb : public SpellScriptLoader
void TriggerFireBomb(SpellEffIndex /*effIndex*/)
{
- if (const WorldLocation* pos = GetExplTargetDest())
+ if (WorldLocation const* pos = GetExplTargetDest())
{
if (Unit* caster = GetCaster())
caster->SummonCreature(NPC_FIRE_BOMB, pos->GetPositionX(), pos->GetPositionY(), pos->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30*IN_MILLISECONDS);
@@ -1110,7 +1110,7 @@ class boss_icehowl : public CreatureScript
}
if (events.ExecuteEvent() == EVENT_TRAMPLE)
{
- Map::PlayerList const &lPlayers = me->GetMap()->GetPlayers();
+ Map::PlayerList const& lPlayers = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
{
if (Unit* player = itr->GetSource())
@@ -1364,7 +1364,7 @@ public:
class spell_jormungars_snakes_spray : public SpellScriptLoader
{
public:
- spell_jormungars_snakes_spray(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
+ spell_jormungars_snakes_spray(char const* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
class spell_jormungars_snakes_spray_SpellScript : public SpellScript
{
@@ -1373,6 +1373,7 @@ public:
public:
spell_jormungars_snakes_spray_SpellScript(uint32 spellId) : SpellScript(), _spellId(spellId) { }
+ private:
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ _spellId });
@@ -1389,7 +1390,6 @@ public:
OnEffectHitTarget += SpellEffectFn(spell_jormungars_snakes_spray_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
- private:
uint32 _spellId;
};
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
index 07ff15a8a64..9b2a37ada81 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
@@ -25,7 +25,6 @@
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
-#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellAuraEffects.h"
@@ -632,9 +631,9 @@ class npc_unleashed_light : public CreatureScript
{
DoCastAOE(SPELL_UNLEASHED_LIGHT);
me->GetMotionMaster()->MoveIdle();
- me->DespawnOrUnsummon(1*IN_MILLISECONDS);
+ me->DespawnOrUnsummon(1 * IN_MILLISECONDS);
}
- RangeCheckTimer = 0.5*IN_MILLISECONDS;
+ RangeCheckTimer = IN_MILLISECONDS / 2;
}
else
RangeCheckTimer -= diff;
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp
index 99e94275397..6025618cbf9 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp
@@ -24,14 +24,15 @@
#include "Player.h"
#include "TemporarySummon.h"
#include "trial_of_the_crusader.h"
+#include <sstream>
BossBoundaryData const boundaries =
{
- { BOSS_BEASTS, new CircleBoundary(Position(563.26f, 139.6f), 75.0) },
- { BOSS_JARAXXUS, new CircleBoundary(Position(563.26f, 139.6f), 75.0) },
- { BOSS_CRUSADERS, new CircleBoundary(Position(563.26f, 139.6f), 75.0) },
- { BOSS_VALKIRIES, new CircleBoundary(Position(563.26f, 139.6f), 75.0) },
- { BOSS_ANUBARAK, new EllipseBoundary(Position(746.0f, 135.0f), 100.0, 75.0) }
+ { BOSS_BEASTS, new CircleBoundary(Position(563.26f, 139.6f), 75.0) },
+ { BOSS_JARAXXUS, new CircleBoundary(Position(563.26f, 139.6f), 75.0) },
+ { BOSS_CRUSADERS, new CircleBoundary(Position(563.26f, 139.6f), 75.0) },
+ { BOSS_VALKIRIES, new CircleBoundary(Position(563.26f, 139.6f), 75.0) },
+ { BOSS_ANUBARAK, new EllipseBoundary(Position(746.0f, 135.0f), 100.0, 75.0) }
};
class instance_trial_of_the_crusader : public InstanceMapScript
@@ -350,7 +351,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript
{
--TrialCounter;
// decrease attempt counter at wipe
- Map::PlayerList const &PlayerList = instance->GetPlayers();
+ Map::PlayerList const& PlayerList = instance->GetPlayers();
for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
if (Player* player = itr->GetSource())
player->SendUpdateWorldState(UPDATE_STATE_UI_COUNT, TrialCounter);
@@ -644,7 +645,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript
return SaveDataBuffer;
}
- void Load(const char* strIn) override
+ void Load(char const* strIn) override
{
if (!strIn)
{
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
index 84f1868912c..f0dff06e3d9 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
@@ -93,7 +93,7 @@ Position const ToCSpawnLoc[] =
{ 549.951f, 261.55f, 394.73f, 4.74835f } // 2 Right
};
-Position const ToCCommonLoc[23] =
+Position const ToCCommonLoc[] =
{
{ 559.257996f, 90.266197f, 395.122986f, 0 }, // 0 Barrent
@@ -136,7 +136,7 @@ Position const LichKingLoc[] =
{ 563.547f, 141.613f, 393.908f, 0 } // 1 - Lich king end
};
-Position const AnubarakLoc[6] =
+Position const AnubarakLoc[] =
{
{ 783.9305f, 132.9722f, 142.6711f, 3.141593f }, // 0 - Anub'arak Spawn Location (sniffed)
{ 695.240051f, 137.834824f, 142.200000f, 0 }, // 1 - Anub'arak move point location
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h
index 8a47823687a..2c50de8ae6c 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h
@@ -218,10 +218,10 @@ enum TCRAchievementData
EVENT_START_TWINS_FIGHT = 21853
};
-template<typename AI>
-inline AI* GetTrialOfTheCrusaderAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetTrialOfTheCrusaderAI(T* obj)
{
- return GetInstanceAI<AI>(creature, ToCrScriptName);
+ return GetInstanceAI<AI>(obj, ToCrScriptName);
}
#endif
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
index 2e96274164d..0aa09881f0a 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
@@ -311,7 +311,7 @@ class spell_trollgore_invader_taunt : public SpellScriptLoader
bool Validate(SpellInfo const* spellInfo) override
{
- return spellInfo->GetEffect(EFFECT_0) && ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0)->CalcValue()) });
+ return spellInfo->GetEffect(EFFECT_0) && ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_0)->CalcValue()) });
}
void HandleTaunt(SpellEffIndex /*effIndex*/)
diff --git a/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h b/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h
index 3cda33e5a4e..31165ce9ffd 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h
+++ b/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h
@@ -86,10 +86,10 @@ enum DTKGameObjectIds
GO_NOVOS_CRYSTAL_4 = 189302
};
-template<typename AI>
-inline AI* GetDrakTharonKeepAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetDrakTharonKeepAI(T* obj)
{
- return GetInstanceAI<AI>(creature, DrakTharonKeepScriptName);
+ return GetInstanceAI<AI>(obj, DrakTharonKeepScriptName);
}
#endif // DRAK_THARON_KEEP_H_
diff --git a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp
index 10db14b13c0..6d87399d426 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp
@@ -16,12 +16,11 @@
*/
#include "ScriptMgr.h"
-#include "Creature.h"
-#include "CreatureAI.h"
#include "drak_tharon_keep.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
+#include "ScriptedCreature.h"
class instance_drak_tharon_keep : public InstanceMapScript
{
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
index c78424c0078..bc6edfdc3a9 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
@@ -22,8 +22,8 @@
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
-#include "SpellScript.h"
#include "SpellAuraEffects.h"
+#include "SpellScript.h"
enum Yells
{
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp
index 265db80d353..fbd4a69b490 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp
@@ -220,7 +220,7 @@ class boss_devourer_of_souls : public CreatureScript
}
}
- void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override
{
if (spell->Id == H_SPELL_PHANTOM_BLAST)
threeFaced = false;
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h
index 98ecb92b048..f1338736e6b 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h
@@ -57,10 +57,10 @@ enum FOSCreatures
NPC_CRUCIBLE_OF_SOULS = 37094
};
-template<typename AI>
-inline AI* GetForgeOfSoulsAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetForgeOfSoulsAI(T* obj)
{
- return GetInstanceAI<AI>(creature, FoSScriptName);
+ return GetInstanceAI<AI>(obj, FoSScriptName);
}
#endif // FORGE_OF_SOULS_H_
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp
index a89920f53ac..5774e372d2a 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp
@@ -15,18 +15,17 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "AreaBoundary.h"
#include "ScriptMgr.h"
+#include "AreaBoundary.h"
#include "Creature.h"
#include "forge_of_souls.h"
#include "InstanceScript.h"
#include "Map.h"
#include "Player.h"
-
BossBoundaryData const boundaries =
{
- { DATA_BRONJAHM, new CircleBoundary(Position(5297.3f, 2506.45f), 100.96) },
+ { DATA_BRONJAHM, new CircleBoundary(Position(5297.3f, 2506.45f), 100.96) },
{ DATA_DEVOURER_OF_SOULS, new ParallelogramBoundary(Position(5663.56f, 2570.53f), Position(5724.39f, 2520.45f), Position(5570.36f, 2461.42f)) }
};
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp
index c9f556c401d..b4ad06a5716 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp
@@ -19,7 +19,6 @@
#include "boss_horAI.h"
#include "halls_of_reflection.h"
#include "InstanceScript.h"
-#include "ScriptedCreature.h"
enum Texts
{
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_horAI.h b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_horAI.h
index 734c1980a5c..4d405956976 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_horAI.h
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_horAI.h
@@ -15,6 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifndef boss_horAI_h__
+#define boss_horAI_h__
+
#include "ScriptedCreature.h"
// Base class for FALRIC and MARWYN
@@ -25,3 +28,5 @@ struct boss_horAI : BossAI
void DoAction(int32 actionId) override;
void JustSummoned(Creature* summon) override;
};
+
+#endif // boss_horAI_h__
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp
index 2fd0ff5097a..8528aba9fb7 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp
@@ -19,7 +19,6 @@
#include "boss_horAI.h"
#include "halls_of_reflection.h"
#include "InstanceScript.h"
-#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h
index 01fd75fed8e..acfe6234da1 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h
@@ -221,10 +221,10 @@ class GameObjectDeleteDelayEvent : public BasicEvent
ObjectGuid _gameObjectGUID;
};
-template<typename AI>
-inline AI* GetHallsOfReflectionAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetHallsOfReflectionAI(T* obj)
{
- return GetInstanceAI<AI>(creature, HoRScriptName);
+ return GetInstanceAI<AI>(obj, HoRScriptName);
}
#endif // HALLS_OF_REFLECTION_H_
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp
index 3d83f74d33a..2834bbc7b72 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp
@@ -16,18 +16,16 @@
*/
#include "ScriptMgr.h"
-#include "Containers.h"
-#include "Creature.h"
-#include "CreatureAI.h"
-#include "GameObject.h"
#include "halls_of_reflection.h"
#include "InstanceScript.h"
#include "Map.h"
#include "PhasingHandler.h"
#include "Player.h"
+#include "ScriptedCreature.h"
#include "TemporarySummon.h"
#include "Transport.h"
#include "WorldStatePackets.h"
+#include <sstream>
Position const JainaSpawnPos = { 5236.659f, 1929.894f, 707.7781f, 0.8726646f }; // Jaina Spawn Position
Position const SylvanasSpawnPos = { 5236.667f, 1929.906f, 707.7781f, 0.8377581f }; // Sylvanas Spawn Position (sniffed)
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp
index 3406e2be458..fb6b9c41435 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp
@@ -171,7 +171,7 @@ class boss_garfrost : public CreatureScript
events.ScheduleEvent(EVENT_RESUME_ATTACK, 5000);
}
- void SpellHitTarget(Unit* target, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (spell->Id == SPELL_PERMAFROST_HELPER)
{
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
index 027eb2679dc..6239f430494 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
@@ -23,7 +23,7 @@
#include "pit_of_saron.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "SpellAuraEffects.h"
+#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
#include "Vehicle.h"
@@ -545,7 +545,7 @@ class spell_krick_explosive_barrage : public SpellScriptLoader
if (Unit* caster = GetCaster())
if (caster->GetTypeId() == TYPEID_UNIT)
{
- Map::PlayerList const &players = caster->GetMap()->GetPlayers();
+ Map::PlayerList const& players = caster->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (Player* player = itr->GetSource())
if (player->IsWithinDist(caster, 60.0f)) // don't know correct range
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp
index e21e57e524b..b186f658d27 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp
@@ -428,14 +428,6 @@ class spell_tyrannus_overlord_brand : public SpellScriptLoader
{
PrepareAuraScript(spell_tyrannus_overlord_brand_AuraScript);
- public:
- spell_tyrannus_overlord_brand_AuraScript()
- {
- oldAI = nullptr;
- oldAIState = false;
- }
-
- private:
bool Load() override
{
return GetCaster() && GetCaster()->GetEntry() == NPC_TYRANNUS;
@@ -470,8 +462,8 @@ class spell_tyrannus_overlord_brand : public SpellScriptLoader
AfterEffectRemove += AuraEffectRemoveFn(spell_tyrannus_overlord_brand_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
- PlayerAI* oldAI;
- bool oldAIState;
+ PlayerAI* oldAI = nullptr;
+ bool oldAIState = false;
};
AuraScript* GetAuraScript() const override
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp
index ee5cc0c3269..6afdf400924 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp
@@ -17,7 +17,6 @@
#include "ScriptMgr.h"
#include "Creature.h"
-#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
#include "pit_of_saron.h"
@@ -167,28 +166,6 @@ class instance_pit_of_saron : public InstanceMapScript
}
}
- void OnGameObjectCreate(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_ICE_WALL:
- case GO_HALLS_OF_REFLECTION_PORTCULLIS:
- AddDoor(go, true);
- break;
- }
- }
-
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_ICE_WALL:
- case GO_HALLS_OF_REFLECTION_PORTCULLIS:
- AddDoor(go, false);
- break;
- }
- }
-
bool SetBossState(uint32 type, EncounterState state) override
{
if (!InstanceScript::SetBossState(type, state))
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp
index 6443a2a12ee..043fdc44c4b 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp
@@ -23,7 +23,6 @@
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
-#include "SpellAuraEffects.h"
#include "Vehicle.h"
enum Spells
@@ -116,7 +115,7 @@ class npc_ymirjar_flamebearer : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_ymirjar_flamebearerAI(creature);
+ return GetPitOfSaronAI<npc_ymirjar_flamebearerAI>(creature);
}
};
@@ -170,7 +169,7 @@ class npc_iceborn_protodrake : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_iceborn_protodrakeAI(creature);
+ return GetPitOfSaronAI<npc_iceborn_protodrakeAI>(creature);
}
};
@@ -229,7 +228,7 @@ class npc_geist_ambusher : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_geist_ambusherAI(creature);
+ return GetPitOfSaronAI<npc_geist_ambusherAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h
index 44d3bab4766..e721d9fc9e6 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h
@@ -121,10 +121,10 @@ class ScheduledIcicleSummons : public BasicEvent
Creature* _trigger;
};
-template<typename AI>
-inline AI* GetPitOfSaronAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetPitOfSaronAI(T* obj)
{
- return GetInstanceAI<AI>(creature, PoSScriptName);
+ return GetInstanceAI<AI>(obj, PoSScriptName);
}
#endif // PIT_OF_SARON_H_
diff --git a/src/server/scripts/Northrend/Gundrak/gundrak.h b/src/server/scripts/Northrend/Gundrak/gundrak.h
index db08165451a..8f35724d03e 100644
--- a/src/server/scripts/Northrend/Gundrak/gundrak.h
+++ b/src/server/scripts/Northrend/Gundrak/gundrak.h
@@ -93,7 +93,7 @@ enum GDInstanceMisc
TIMER_STATUE_ACTIVATION = 3500
};
-template<class AI, class T>
+template <class AI, class T>
inline AI* GetGundrakAI(T* obj)
{
return GetInstanceAI<AI>(obj, GundrakScriptName);
diff --git a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp
index 0a509af074b..20ec068009b 100644
--- a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp
+++ b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp
@@ -15,23 +15,24 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptMgr.h"
-#include "GameObjectAI.h"
+#include "InstanceScript.h"
#include "Creature.h"
#include "EventMap.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "gundrak.h"
-#include "InstanceScript.h"
#include "Map.h"
+#include "ScriptMgr.h"
+#include <sstream>
DoorData const doorData[] =
{
{ GO_GAL_DARAH_DOOR_1, DATA_GAL_DARAH, DOOR_TYPE_PASSAGE },
{ GO_GAL_DARAH_DOOR_2, DATA_GAL_DARAH, DOOR_TYPE_PASSAGE },
- { GO_GAL_DARAH_DOOR_3, DATA_GAL_DARAH, DOOR_TYPE_ROOM },
+ { GO_GAL_DARAH_DOOR_3, DATA_GAL_DARAH, DOOR_TYPE_ROOM },
{ GO_ECK_THE_FEROCIOUS_DOOR, DATA_MOORABI, DOOR_TYPE_PASSAGE },
{ GO_ECK_THE_FEROCIOUS_DOOR_BEHIND, DATA_ECK_THE_FEROCIOUS, DOOR_TYPE_PASSAGE },
- { 0, 0, DOOR_TYPE_ROOM } // END
+ { 0, 0, DOOR_TYPE_ROOM } // END
};
ObjectData const creatureData[] =
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
index 1c3728d0d06..46344185df7 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
@@ -20,15 +20,14 @@
#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
+#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "Spell.h"
#include "SpellAuraEffects.h"
-#include "SpellAuras.h"
#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
-#include "PassiveAI.h"
enum Texts
{
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
index 33978ff7e16..33234f60826 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
@@ -24,8 +24,6 @@
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
-#include "SpellAuras.h"
-#include "SpellInfo.h"
#include "SpellMgr.h"
#include "SpellScript.h"
@@ -378,7 +376,7 @@ class boss_blood_queen_lana_thel : public CreatureScript
}
case EVENT_BLOOD_MIRROR:
{
- // victim can be NULL when this is processed in the same update tick as EVENT_AIR_PHASE
+ // victim can be nullptr when this is processed in the same update tick as EVENT_AIR_PHASE
if (me->GetVictim())
{
Player* newOfftank = SelectRandomTarget(true);
@@ -540,12 +538,7 @@ class spell_blood_queen_vampiric_bite : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_PLR,
- SPELL_FRENZIED_BLOODTHIRST,
- SPELL_PRESENCE_OF_THE_DARKFALLEN
- });
+ return ValidateSpellInfo({ SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_PLR, SPELL_FRENZIED_BLOODTHIRST, SPELL_PRESENCE_OF_THE_DARKFALLEN });
}
SpellCastResult CheckTarget()
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
index 1f206826126..6bdfd7296b8 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
@@ -1010,11 +1010,7 @@ class spell_deathbringer_blood_link : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_BLOOD_LINK_POWER,
- SPELL_BLOOD_POWER
- });
+ return ValidateSpellInfo({ SPELL_BLOOD_LINK_POWER, SPELL_BLOOD_POWER });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
index a071eb87f2b..cf899c1915d 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
@@ -18,6 +18,7 @@
#include "icecrown_citadel.h"
#include "CellImpl.h"
#include "CreatureTextMgr.h"
+#include "GossipDef.h"
#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
#include "Map.h"
@@ -26,12 +27,10 @@
#include "MoveSplineInit.h"
#include "ObjectAccessor.h"
#include "PassiveAI.h"
-#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellAuraEffects.h"
#include "SpellHistory.h"
-#include "SpellInfo.h"
#include "SpellMgr.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
@@ -1815,7 +1814,7 @@ class npc_gunship_cannon : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_gunship_cannonAI(creature);
+ return GetIcecrownCitadelAI<npc_gunship_cannonAI>(creature);
}
};
@@ -1830,11 +1829,7 @@ class spell_igb_rocket_pack : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_ROCKET_PACK_DAMAGE,
- SPELL_ROCKET_BURST
- });
+ return ValidateSpellInfo({ SPELL_ROCKET_PACK_DAMAGE, SPELL_ROCKET_BURST });
}
void HandlePeriodic(AuraEffect const* /*aurEff*/)
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
index 51422aefc9b..dffa7af0174 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
@@ -24,7 +24,6 @@
#include "PoolMgr.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
-#include "SpellMgr.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
@@ -454,7 +453,7 @@ class boss_lady_deathwhisper : public CreatureScript
}
}
- void SpellHitTarget(Unit* target, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (spell->Id == SPELL_SUMMON_SPIRITS)
_nextVengefulShadeTargetGUID.push_back(target->GetGUID());
@@ -541,7 +540,7 @@ class boss_lady_deathwhisper : public CreatureScript
}
// helper for summoning wave mobs
- void Summon(uint32 entry, const Position& pos)
+ void Summon(uint32 entry, Position const& pos)
{
if (TempSummon* summon = me->SummonCreature(entry, pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000))
summon->CastSpell(summon, SPELL_TELEPORT_VISUAL);
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
index 55ae1114639..c89db35b38b 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
@@ -17,7 +17,6 @@
#include "icecrown_citadel.h"
#include "DB2Stores.h"
-#include "GameObject.h"
#include "GridNotifiers.h"
#include "Group.h"
#include "InstanceScript.h"
@@ -27,8 +26,6 @@
#include "ScriptedCreature.h"
#include "Spell.h"
#include "SpellAuraEffects.h"
-#include "SpellAuras.h"
-#include "SpellInfo.h"
#include "SpellMgr.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
@@ -892,16 +889,9 @@ class spell_putricide_ooze_channel : public SpellScriptLoader
{
PrepareSpellScript(spell_putricide_ooze_channel_SpellScript);
- public:
- spell_putricide_ooze_channel_SpellScript()
- {
- _target = nullptr;
- }
-
- private:
bool Validate(SpellInfo const* spell) override
{
- return spell->ExcludeTargetAuraSpell && ValidateSpellInfo({ spell->ExcludeTargetAuraSpell });
+ return ValidateSpellInfo({ spell->ExcludeTargetAuraSpell });
}
// set up initial variables and check if caster is creature
@@ -949,7 +939,7 @@ class spell_putricide_ooze_channel : public SpellScriptLoader
AfterHit += SpellHitFn(spell_putricide_ooze_channel_SpellScript::StartAttack);
}
- WorldObject* _target;
+ WorldObject* _target = nullptr;
};
SpellScript* GetSpellScript() const override
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
index c6c3caf5aa8..524bdd671e9 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
@@ -16,14 +16,12 @@
*/
#include "icecrown_citadel.h"
-#include "Containers.h"
#include "GridNotifiers.h"
#include "InstanceScript.h"
#include "Map.h"
#include "ObjectAccessor.h"
-#include "Player.h"
#include "ScriptedCreature.h"
-#include "SpellAuraEffects.h"
+#include "SpellAuras.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
index b33cc623d91..3bfa19fc752 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
@@ -16,14 +16,12 @@
*/
#include "icecrown_citadel.h"
-#include "GameObject.h"
#include "GridNotifiers.h"
#include "InstanceScript.h"
#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
-#include "Player.h"
#include "ScriptedCreature.h"
#include "Spell.h"
#include "SpellAuraEffects.h"
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
index 93d1d6f99a3..2648d8f55ae 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
@@ -18,17 +18,13 @@
#include "icecrown_citadel.h"
#include "CellImpl.h"
#include "CreatureTextMgr.h"
-#include "GameObject.h"
#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
-#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "Spell.h"
#include "SpellAuraEffects.h"
-#include "SpellAuras.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
#include "Vehicle.h"
@@ -2564,13 +2560,6 @@ class spell_the_lich_king_valkyr_target_search : public SpellScriptLoader
{
PrepareSpellScript(spell_the_lich_king_valkyr_target_search_SpellScript);
- public:
- spell_the_lich_king_valkyr_target_search_SpellScript()
- {
- _target = nullptr;
- }
-
- private:
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ SPELL_CHARGE });
@@ -2611,7 +2600,7 @@ class spell_the_lich_king_valkyr_target_search : public SpellScriptLoader
OnEffectHitTarget += SpellEffectFn(spell_the_lich_king_valkyr_target_search_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
- WorldObject* _target;
+ WorldObject* _target = nullptr;
};
SpellScript* GetSpellScript() const override
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
index f8f0afdc9b1..826314e1b41 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
@@ -24,7 +24,6 @@
#include "PhasingHandler.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
enum Texts
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
index 882bf88c363..df11ab7be69 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
@@ -17,17 +17,13 @@
#include "icecrown_citadel.h"
#include "CellImpl.h"
-#include "GameObject.h"
#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "PassiveAI.h"
-#include "PetDefines.h"
-#include "Player.h"
#include "ScriptedEscortAI.h"
#include "SmartAI.h"
-#include "Spell.h"
#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
@@ -737,7 +733,7 @@ class npc_alchemist_adrianna : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_alchemist_adriannaAI(creature);
+ return GetIcecrownCitadelAI<npc_alchemist_adriannaAI>(creature);
}
};
@@ -1680,7 +1676,7 @@ class npc_frostwing_vrykul : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_frostwing_vrykulAI(creature);
+ return GetIcecrownCitadelAI<npc_frostwing_vrykulAI>(creature);
}
};
@@ -1724,7 +1720,7 @@ class npc_impaling_spear : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_impaling_spearAI(creature);
+ return GetIcecrownCitadelAI<npc_impaling_spearAI>(creature);
}
};
@@ -2123,6 +2119,7 @@ public:
spell_trigger_spell_from_caster_SpellScript(uint32 triggerId, TriggerCastFlags triggerFlags)
: SpellScript(), _triggerId(triggerId), _triggerFlags(triggerFlags) { }
+private:
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ _triggerId });
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
index b019ecb8640..fa374e80421 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
@@ -533,8 +533,8 @@ enum ICAreaIds
class spell_trigger_spell_from_caster : public SpellScriptLoader
{
public:
- spell_trigger_spell_from_caster(char const* scriptName, uint32 triggerId);
spell_trigger_spell_from_caster(char const* scriptName, uint32 triggerId, TriggerCastFlags triggerFlags);
+ spell_trigger_spell_from_caster(char const* scriptName, uint32 triggerId);
SpellScript* GetSpellScript() const override;
private:
@@ -542,7 +542,7 @@ class spell_trigger_spell_from_caster : public SpellScriptLoader
TriggerCastFlags _triggerFlags;
};
-template<typename AI, typename T>
+template <class AI, class T>
inline AI* GetIcecrownCitadelAI(T* obj)
{
return GetInstanceAI<AI>(obj, ICCScriptName);
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
index 0a11d6e7830..884299da83c 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
@@ -17,10 +17,7 @@
#include "icecrown_citadel.h"
#include "AreaBoundary.h"
-#include "Creature.h"
#include "CreatureAI.h"
-#include "EventMap.h"
-#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
#include "ObjectMgr.h"
@@ -30,6 +27,7 @@
#include "Transport.h"
#include "TransportMgr.h"
#include "WorldStatePackets.h"
+#include <sstream>
enum EventIds
{
@@ -190,7 +188,7 @@ class instance_icecrown_citadel : public InstanceMapScript
{
if (!TeamInInstance)
{
- Map::PlayerList const &players = instance->GetPlayers();
+ Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (Player* player = players.begin()->GetSource())
TeamInInstance = player->GetTeam();
diff --git a/src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp b/src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp
index 5e07ee5752f..f1572be2825 100644
--- a/src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp
+++ b/src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp
@@ -119,8 +119,8 @@ class npc_ioc_gunship_captain : public CreatureScript
DoCast(me, SPELL_TELEPORT_VISUAL_ONLY);
break;
case EVENT_DESPAWN:
- if (me->GetMap()->ToBattlegroundMap())
- if (Battleground* bgIoC = me->GetMap()->ToBattlegroundMap()->GetBG())
+ if (BattlegroundMap* iocMap = me->GetMap()->ToBattlegroundMap())
+ if (Battleground* bgIoC = iocMap->GetBG())
bgIoC->DelCreature(BG_IC_NPC_GUNSHIP_CAPTAIN_1);
break;
default:
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
index b6783166857..12786c9e7f6 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
@@ -17,8 +17,8 @@
#include "ScriptMgr.h"
#include "InstanceScript.h"
-#include "naxxramas.h"
#include "ObjectAccessor.h"
+#include "naxxramas.h"
#include "Player.h"
#include "ScriptedCreature.h"
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp
index 8e3dbb5a271..bf287b7b417 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp
@@ -22,7 +22,6 @@
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuras.h"
-#include "SpellInfo.h"
enum Yells
{
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
index 6fb81e414cb..2d1d1263978 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
@@ -15,8 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "GameTime.h"
#include "ScriptMgr.h"
+#include "GameTime.h"
#include "InstanceScript.h"
#include "Log.h"
#include "Map.h"
@@ -222,7 +222,7 @@ struct boss_four_horsemen_baseAI : public BossAI
return;
}
instance->SetBossState(BOSS_HORSEMEN, IN_PROGRESS);
- Map::PlayerList const &players = me->GetMap()->GetPlayers();
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
if (players.isEmpty()) // sanity check
ResetEncounter();
@@ -381,7 +381,7 @@ struct boss_four_horsemen_baseAI : public BossAI
private:
const Horseman _which;
- const Position* _initialPath;
+ Position const* _initialPath;
bool _myMovementFinished;
uint8 _nextMovement;
uint32 _timeDied;
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
index 02a0fc01423..9ccf2bc33b6 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
@@ -194,7 +194,7 @@ public:
Creature* zombie = nullptr;
for (SummonList::const_iterator itr = summons.begin(); !zombie && itr != summons.end(); ++itr)
{
- zombie=ObjectAccessor::GetCreature(*me, *itr);
+ zombie = ObjectAccessor::GetCreature(*me, *itr);
if (!zombie || !zombie->IsAlive() || !zombie->IsWithinDistInMap(me, 10.0))
zombie = nullptr;
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
index 328129b166f..002a712d496 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
@@ -233,7 +233,7 @@ class spell_heigan_eruption : public SpellScriptLoader
void HandleScript(SpellEffIndex /*eff*/)
{
Unit* caster = GetCaster();
- if (!caster || !GetHitPlayer())
+ if (!caster || !GetHitUnit())
return;
if (GetHitDamage() >= int32(GetHitUnit()->GetHealth()))
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
index cbf20738444..2203c878b77 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
@@ -948,7 +948,7 @@ class at_kelthuzad_center : public AreaTriggerScript
public:
at_kelthuzad_center() : AreaTriggerScript("at_kelthuzad_center") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/, bool entered) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*at*/, bool entered) override
{
InstanceScript* instance = player->GetInstanceScript();
if (!instance || instance->GetBossState(BOSS_KELTHUZAD) != NOT_STARTED || !entered)
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
index 323fa9dd6ef..81e9f59e578 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
@@ -87,7 +87,7 @@ struct WebTargetSelector : public std::unary_function<Unit*, bool>
}
private:
- const Unit* _maexxna;
+ Unit const* _maexxna;
};
class boss_maexxna : public CreatureScript
diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
index 9c7ae6063a5..04a6e6787f5 100644
--- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
@@ -17,9 +17,7 @@
#include "ScriptMgr.h"
#include "AreaBoundary.h"
-#include "Creature.h"
#include "CreatureAI.h"
-#include "EventMap.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
@@ -479,7 +477,7 @@ class instance_naxxramas : public InstanceMapScript
std::list<TempSummon*> spawns;
instance->SummonCreatureGroup(nextFroggerWave, &spawns);
if (!spawns.empty())
- (*spawns.begin())->GetMotionMaster()->MovePath(10 * NPC_FROGGER + nextFroggerWave, false);
+ spawns.front()->GetMotionMaster()->MovePath(10 * NPC_FROGGER + nextFroggerWave, false);
events.Repeat(Seconds(1) + Milliseconds(666));
nextFroggerWave = (nextFroggerWave+1) % 3;
break;
diff --git a/src/server/scripts/Northrend/Naxxramas/naxxramas.h b/src/server/scripts/Northrend/Naxxramas/naxxramas.h
index 82f148af184..23e2260a563 100644
--- a/src/server/scripts/Northrend/Naxxramas/naxxramas.h
+++ b/src/server/scripts/Northrend/Naxxramas/naxxramas.h
@@ -215,7 +215,8 @@ enum NAXInstanceTexts
SAY_DIALOGUE_SAPPHIRON_LICH_KING2 = 2
};
-template<typename AI, typename T>
+
+template <class AI, class T>
inline AI* GetNaxxramasAI(T* obj)
{
return GetInstanceAI<AI>(obj, NaxxramasScriptName);
diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
index 4e5cb1eb864..f3b22adb5b7 100644
--- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
+++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
@@ -30,7 +30,6 @@ Script Data End */
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "Spell.h"
#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
@@ -1841,7 +1840,7 @@ class spell_malygos_vortex_visual : public SpellScriptLoader
if (InstanceScript* instance = caster->GetInstanceScript())
{
// Teleport spell - I'm not sure but might be it must be cast by each vehicle when it's passenger leaves it.
- if (Creature* trigger = caster->GetMap()->GetCreature(instance->GetGuidData(DATA_TRIGGER)))
+ if (Creature* trigger = ObjectAccessor::GetCreature(*caster, instance->GetGuidData(DATA_TRIGGER)))
trigger->CastSpell(targetPlayer, SPELL_VORTEX_6, true);
}
}
diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h b/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h
index 4c3faf67b5a..df840177a4d 100644
--- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h
+++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h
@@ -87,10 +87,10 @@ enum EOEInstanceSpells
SPELL_SUMMOM_RED_DRAGON_BUDDY = 56070
};
-template<typename AI>
-inline AI* GetEyeOfEternityAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetEyeOfEternityAI(T* obj)
{
- return GetInstanceAI<AI>(creature, EoEScriptName);
+ return GetInstanceAI<AI>(obj, EoEScriptName);
}
#endif
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp
index aa4707ea863..a3d881ec279 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp
@@ -17,12 +17,12 @@
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "nexus.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "SpellScript.h"
enum Spells
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp
index 48b1772ea95..3a250908c7f 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp
@@ -23,7 +23,6 @@
#include "nexus.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
-#include "World.h"
enum Spells
{
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
index 1bc6a8c429e..4ac561a865a 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
@@ -236,7 +236,7 @@ class npc_azure_ring_captain : public CreatureScript
{
switch (action)
{
- case ACTION_CALL_DRAGON_EVENT:
+ case ACTION_CALL_DRAGON_EVENT:
if (Creature* varos = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_VAROS)))
{
if (Unit* victim = varos->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0))
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
index 76914921416..50010ead3d0 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
@@ -18,7 +18,6 @@
#include "ScriptMgr.h"
#include "Creature.h"
#include "CreatureAI.h"
-#include "EventMap.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
@@ -123,11 +122,10 @@ class instance_oculus : public InstanceMapScript
void OnGameObjectCreate(GameObject* go) override
{
+ InstanceScript::OnGameObjectCreate(go);
+
switch (go->GetEntry())
{
- case GO_DRAGON_CAGE_DOOR:
- AddDoor(go, true);
- break;
case GO_EREGOS_CACHE_N:
case GO_EREGOS_CACHE_H:
EregosCacheGUID = go->GetGUID();
@@ -137,18 +135,6 @@ class instance_oculus : public InstanceMapScript
}
}
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_DRAGON_CAGE_DOOR:
- AddDoor(go, false);
- break;
- default:
- break;
- }
- }
-
void OnUnitDeath(Unit* unit) override
{
Creature* creature = unit->ToCreature();
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
index 29962252e21..d0004bf0c9e 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
@@ -26,8 +26,6 @@
#include "ScriptedGossip.h"
#include "Spell.h"
#include "SpellAuraEffects.h"
-#include "SpellAuras.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
enum GossipNPCs
@@ -267,7 +265,7 @@ class npc_ruby_emerald_amber_drake : public CreatureScript
Initialize();
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (Unit* creator = ObjectAccessor::GetUnit(*me, me->GetCreatorGUID()))
if (spell->Id == SPELL_GPS)
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.h b/src/server/scripts/Northrend/Nexus/Oculus/oculus.h
index a5ba299e931..6721a9805f0 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.h
+++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.h
@@ -107,10 +107,10 @@ enum OCMisc
POINT_MOVE_OUT = 1
};
-template<typename AI>
-inline AI* GetOculusAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetOculusAI(T* obj)
{
- return GetInstanceAI<AI>(creature, OculusScriptName);
+ return GetInstanceAI<AI>(obj, OculusScriptName);
}
#endif // OCULUS_H_
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
index df10cc676ed..337ccc79a0e 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
@@ -146,7 +146,7 @@ public:
Talk(SAY_SLAY);
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_DISPERSE)
{
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
index 0bb78ec7d8b..2ebe574753e 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
@@ -436,7 +436,7 @@ public:
}
}
- void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) override
+ void SpellHit(Unit* /*pCaster*/, SpellInfo const* pSpell) override
{
// This is the dummy effect of the spells
if (pSpell->Id == SPELL_SHATTER)
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h
index 360e9316e50..7db29ea3028 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h
@@ -51,10 +51,10 @@ enum HOLGameObjectIds
GO_LOKEN_THRONE = 192654
};
-template<typename AI>
-inline AI* GetHallsOfLightningAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetHallsOfLightningAI(T* obj)
{
- return GetInstanceAI<AI>(creature, HoLScriptName);
+ return GetInstanceAI<AI>(obj, HoLScriptName);
}
#endif // HALLS_OF_LIGHTNING_H_
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp
index d631bdc437a..735d80cdbe1 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp
@@ -27,7 +27,7 @@ DoorData const doorData[] =
{ GO_VOLKHAN_DOOR, DATA_VOLKHAN, DOOR_TYPE_PASSAGE },
{ GO_IONAR_DOOR, DATA_IONAR, DOOR_TYPE_PASSAGE },
{ GO_LOKEN_DOOR, DATA_LOKEN, DOOR_TYPE_PASSAGE },
- { 0, 0, DOOR_TYPE_ROOM } // END
+ { 0, 0, DOOR_TYPE_ROOM } // END
};
class instance_halls_of_lightning : public InstanceMapScript
@@ -67,13 +67,10 @@ class instance_halls_of_lightning : public InstanceMapScript
void OnGameObjectCreate(GameObject* go) override
{
+ InstanceScript::OnGameObjectCreate(go);
+
switch (go->GetEntry())
{
- case GO_VOLKHAN_DOOR:
- case GO_IONAR_DOOR:
- case GO_LOKEN_DOOR:
- AddDoor(go, true);
- break;
case GO_LOKEN_THRONE:
LokenGlobeGUID = go->GetGUID();
break;
@@ -82,20 +79,6 @@ class instance_halls_of_lightning : public InstanceMapScript
}
}
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_VOLKHAN_DOOR:
- case GO_IONAR_DOOR:
- case GO_LOKEN_DOOR:
- AddDoor(go, false);
- break;
- default:
- break;
- }
- }
-
bool SetBossState(uint32 type, EncounterState state) override
{
if (!InstanceScript::SetBossState(type, state))
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp
index dce0790d997..f17ed5148f5 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp
@@ -20,8 +20,8 @@
#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "Player.h"
-#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
+#include "ScriptedGossip.h"
#include "TemporarySummon.h"
enum Texts
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h
index 5b0c203d55d..9cbf93e9866 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h
@@ -69,10 +69,10 @@ enum HOSGameObjectIds
GO_TRIBUNAL_SKY_FLOOR = 191527
};
-template<typename AI>
-inline AI* GetHallsOfStoneAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetHallsOfStoneAI(T* obj)
{
- return GetInstanceAI<AI>(creature, HoSScriptName);
+ return GetInstanceAI<AI>(obj, HoSScriptName);
}
#endif // HALLS_OF_STONE_H_
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp
index 8a63b0e85e4..41853110de9 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp
@@ -74,6 +74,8 @@ class instance_halls_of_stone : public InstanceMapScript
void OnGameObjectCreate(GameObject* go) override
{
+ InstanceScript::OnGameObjectCreate(go);
+
switch (go->GetEntry())
{
case GO_ABEDNEUM:
@@ -97,21 +99,6 @@ class instance_halls_of_stone : public InstanceMapScript
case GO_TRIBUNAL_SKY_FLOOR:
TribunalSkyFloorGUID = go->GetGUID();
break;
- case GO_SJONNIR_DOOR:
- AddDoor(go, true);
- break;
- default:
- break;
- }
- }
-
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_SJONNIR_DOOR:
- AddDoor(go, false);
- break;
default:
break;
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
index 66da79cc0a2..cac88a9edb9 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
@@ -16,14 +16,12 @@
*/
#include "ScriptMgr.h"
-#include "CellImpl.h"
-#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
+#include "Map.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuras.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
#include "ulduar.h"
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
index 7843bbc7e63..09a4081c4f2 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
@@ -19,11 +19,9 @@
#include "InstanceScript.h"
#include "Map.h"
#include "MotionMaster.h"
-#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
#include "ulduar.h"
@@ -280,7 +278,7 @@ class boss_general_vezax : public CreatureScript
/* Player Range Check
Purpose: If there are playersMin people within rangeMin, rangeMax: return a random players in that range.
- If not, return NULL and allow other target selection
+ If not, return nullptr and allow other target selection
*/
Unit* CheckPlayersInRange(uint8 playersMin, float rangeMin, float rangeMax)
{
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
index 38912c91b78..0069920827a 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
@@ -962,7 +962,7 @@ class npc_toasty_fire : public CreatureScript
DoCast(me, SPELL_SINGED, true);
}
- void SpellHit(Unit* /*who*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*who*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_BLOCK_OF_ICE || spell->Id == SPELL_ICE_SHARD || spell->Id == SPELL_ICE_SHARD_HIT)
{
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
index b2c8dcc9022..32ac9ff5833 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
@@ -15,8 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "GameTime.h"
#include "ScriptMgr.h"
+#include "GameTime.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
index 0a2c163906e..4e499f414b0 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
@@ -22,8 +22,6 @@
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
-#include "SpellAuras.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
#include "ulduar.h"
#include "Vehicle.h"
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
index 94fd523542b..91e028c4873 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
@@ -17,6 +17,7 @@
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "GridNotifiers.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
@@ -25,7 +26,6 @@
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
-#include "GameObjectAI.h"
#include "ulduar.h"
#include "Vehicle.h"
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
index ec543fc1768..2973926c8ea 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
@@ -17,16 +17,15 @@
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "MoveSplineInit.h"
#include "ObjectAccessor.h"
-#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellInfo.h"
-#include "GameObjectAI.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
#include "ulduar.h"
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp
index 062e5bdb884..df299a03c50 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp
@@ -15,23 +15,22 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ScriptMgr.h"
+#include "AreaBoundary.h"
+#include "CellImpl.h"
+#include "GridNotifiersImpl.h"
+#include "InstanceScript.h"
+#include "MotionMaster.h"
#include "MoveSplineInit.h"
+#include "ObjectAccessor.h"
#include "Player.h"
-#include "ScriptMgr.h"
#include "ScriptedCreature.h"
-#include "SpellScript.h"
#include "SpellAuraEffects.h"
+#include "SpellMgr.h"
+#include "SpellScript.h"
#include "TypeContainerVisitor.h"
-#include "CellImpl.h"
-#include "GridNotifiersImpl.h"
#include "ulduar.h"
-#include "SpellAuras.h"
-#include "SpellMgr.h"
#include <G3D/Vector3.h>
-#include "AreaBoundary.h"
-#include "InstanceScript.h"
-#include "ObjectAccessor.h"
-#include "MotionMaster.h"
enum Spells
{
@@ -321,8 +320,7 @@ enum DisplayIds
THORIM_WEAPON_DISPLAY_ID = 45900
};
-uint32 const LightningOrbPathSize = 8;
-G3D::Vector3 const LightningOrbPath[LightningOrbPathSize] =
+Position const LightningOrbPath[] =
{
{ 2134.889893f, -298.632996f, 438.247467f },
{ 2134.570068f, -440.317993f, 438.247467f },
@@ -333,6 +331,7 @@ G3D::Vector3 const LightningOrbPath[LightningOrbPathSize] =
{ 2202.208008f, -262.939270f, 412.168976f },
{ 2182.310059f, -263.233093f, 414.739410f }
};
+std::size_t const LightningOrbPathSize = std::extent<decltype(LightningOrbPath)>::value;
// used for trash jump calculation
Position const ArenaCenter = { 2134.77f, -262.307f };
@@ -356,7 +355,7 @@ class HeightPositionCheck
bool operator()(Position const* pos) const
{
- return pos->GetPositionZ() > THORIM_BALCONY_Z_CHECK == _ret;
+ return (pos->GetPositionZ() > THORIM_BALCONY_Z_CHECK) == _ret;
}
private:
@@ -633,9 +632,14 @@ class boss_thorim : public CreatureScript
summon->SetReactState(REACT_PASSIVE);
summon->CastSpell(summon, SPELL_LIGHTNING_DESTRUCTION, true);
- summon->GetMotionMaster()->MovePoint(EVENT_CHARGE_PREPATH, LightningOrbPath[LightningOrbPathSize - 1].x, LightningOrbPath[LightningOrbPathSize - 1].y, LightningOrbPath[LightningOrbPathSize - 1].z, false);
+ summon->GetMotionMaster()->MovePoint(EVENT_CHARGE_PREPATH, LightningOrbPath[LightningOrbPathSize - 1], false);
- Movement::PointsArray path(LightningOrbPath, LightningOrbPath + LightningOrbPathSize);
+ Movement::PointsArray path;
+ path.reserve(LightningOrbPathSize);
+ std::transform(std::begin(LightningOrbPath), std::end(LightningOrbPath), std::back_inserter(path), [](Position const& pos)
+ {
+ return G3D::Vector3(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ());
+ });
Movement::MoveSplineInit init(summon);
init.MovebyPath(path);
@@ -1867,11 +1871,7 @@ class spell_thorim_stormhammer : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_STORMHAMMER_BOOMERANG,
- SPELL_DEAFENING_THUNDER
- });
+ return ValidateSpellInfo({ SPELL_STORMHAMMER_BOOMERANG, SPELL_DEAFENING_THUNDER });
}
void FilterTargets(std::list<WorldObject*>& targets)
@@ -1929,11 +1929,7 @@ class spell_thorim_stormhammer_sif : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_STORMHAMMER_BOOMERANG,
- SPELL_SIF_TRANSFORM
- });
+ return ValidateSpellInfo({ SPELL_STORMHAMMER_BOOMERANG, SPELL_SIF_TRANSFORM });
}
void HandleScript(SpellEffIndex /*effIndex*/)
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
index c6fc0925bf6..ad0105717de 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
@@ -28,7 +28,6 @@
#include "ObjectAccessor.h"
#include "PassiveAI.h"
#include "ScriptedCreature.h"
-#include "Spell.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#include "ulduar.h"
@@ -940,13 +939,7 @@ class spell_xt002_heart_overload_periodic : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_ENERGY_ORB,
- SPELL_RECHARGE_BOOMBOT,
- SPELL_RECHARGE_PUMMELER,
- SPELL_RECHARGE_SCRAPBOT
- });
+ return ValidateSpellInfo({ SPELL_ENERGY_ORB, SPELL_RECHARGE_BOOMBOT, SPELL_RECHARGE_PUMMELER, SPELL_RECHARGE_SCRAPBOT });
}
void HandleScript(SpellEffIndex /*effIndex*/)
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
index 8141e3d66ec..7855902bd8d 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
@@ -27,8 +27,6 @@
#include "ScriptedCreature.h"
#include "Spell.h"
#include "SpellAuraEffects.h"
-#include "SpellAuras.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
#include "ulduar.h"
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
index b22b5d242ff..a8567a60a64 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
@@ -17,18 +17,19 @@
#include "ScriptMgr.h"
#include "AreaBoundary.h"
+#include "CreatureAI.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Item.h"
#include "Map.h"
#include "Player.h"
-#include "ScriptedCreature.h"
#include "Spell.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
#include "ulduar.h"
#include "Vehicle.h"
#include "WorldStatePackets.h"
+#include <sstream>
static BossBoundaryData const boundaries =
{
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h
index 4b2708f8a50..e845a503619 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h
@@ -504,8 +504,6 @@ enum YoggSaronIllusions
STORMWIND_ILLUSION = 2,
};
-#define RegisterUlduarCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetUlduarAI)
-
class KeeperDespawnEvent : public BasicEvent
{
public:
@@ -523,10 +521,12 @@ private:
uint32 _despawnTimer;
};
-template<typename AI, typename T>
+template <class AI, class T>
inline AI* GetUlduarAI(T* obj)
{
- return GetInstanceAI<AI>(obj, UlduarScriptName);
+ return GetInstanceAI<AI, T>(obj, UlduarScriptName);
}
+#define RegisterUlduarCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetUlduarAI)
+
#endif
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp
index fe0396efbb0..d39c822dddb 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp
@@ -28,8 +28,6 @@ EndScriptData */
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "Spell.h"
-#include "SpellAuraEffects.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
#include "utgarde_keep.h"
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp
index 0c9f8d43b28..f6b4c3365fa 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp
@@ -20,6 +20,7 @@
#include "GameObject.h"
#include "InstanceScript.h"
#include "utgarde_keep.h"
+#include <sstream>
DoorData const doorData[] =
{
@@ -88,6 +89,8 @@ class instance_utgarde_keep : public InstanceMapScript
void OnGameObjectCreate(GameObject* go) override
{
+ InstanceScript::OnGameObjectCreate(go);
+
switch (go->GetEntry())
{
case GO_BELLOW_1:
@@ -126,23 +129,6 @@ class instance_utgarde_keep : public InstanceMapScript
Forges[2].AnvilGUID = go->GetGUID();
HandleGameObject(ObjectGuid::Empty, Forges[2].Event != NOT_STARTED, go);
break;
- case GO_GIANT_PORTCULLIS_1:
- case GO_GIANT_PORTCULLIS_2:
- AddDoor(go, true);
- break;
- default:
- break;
- }
- }
-
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_GIANT_PORTCULLIS_1:
- case GO_GIANT_PORTCULLIS_2:
- AddDoor(go, false);
- break;
default:
break;
}
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h
index 01f4cf00551..d23c211b89e 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h
@@ -87,10 +87,10 @@ struct ForgeInfo
uint32 Event;
};
-template<typename AI>
-inline AI* GetUtgardeKeepAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetUtgardeKeepAI(T* obj)
{
- return GetInstanceAI<AI>(creature, UKScriptName);
+ return GetInstanceAI<AI>(obj, UKScriptName);
}
#endif // UTGARDE_KEEP_H_
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
index 19573eb24ff..f23e8fe27dc 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
@@ -16,16 +16,15 @@
*/
#include "ScriptMgr.h"
-#include "GameObject.h"
#include "InstanceScript.h"
+#include "GameObject.h"
+#include "GameObjectAI.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
+#include "SpellScript.h"
#include "TemporarySummon.h"
-#include "GameObjectAI.h"
#include "utgarde_pinnacle.h"
-#include "SpellScript.h"
-#include "SpellAuraEffects.h"
enum Spells
{
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
index 4e35b0b4fc5..4d2315c4348 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
@@ -20,7 +20,6 @@
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "MoveSplineInit.h"
-#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuras.h"
@@ -442,7 +441,7 @@ public:
}
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_LAUNCH_HARPOON)
if (Creature* skadi = _instance->GetCreature(DATA_SKADI_THE_RUTHLESS))
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
index 45c812ff19c..414602ce8b3 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
@@ -20,7 +20,6 @@
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
-#include "SpellScript.h"
#include "TemporarySummon.h"
#include "utgarde_pinnacle.h"
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp
index c5621bc9fe5..47e95d0fc7c 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp
@@ -17,7 +17,6 @@
#include "ScriptMgr.h"
#include "AreaBoundary.h"
-#include "Creature.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "utgarde_pinnacle.h"
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h
index 8fbe9038e66..c5566d9d940 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h
@@ -97,7 +97,7 @@ enum UPGameObjectIds
GO_KING_YMIRON_DOOR = 192174
};
-template<class AI, class T>
+template <class AI, class T>
inline AI* GetUtgardePinnacleAI(T* obj)
{
return GetInstanceAI<AI>(obj, UPScriptName);
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp
index 861e46ab300..6316d4ee2fc 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp
+++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp
@@ -94,7 +94,7 @@ class boss_emalon : public CreatureScript
{
BossAI::JustSummoned(summoned);
- // AttackStart has NULL-check for victim
+ // AttackStart has nullptr-check for victim
if (summoned->AI())
summoned->AI()->AttackStart(me->GetVictim());
}
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h b/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h
index dee2c371360..0a7b7547a4a 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h
+++ b/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h
@@ -52,10 +52,10 @@ enum VAAchievementSpells
SPELL_EARTH_WIND_FIRE_ACHIEVEMENT_CHECK = 68308,
};
-template<typename AI>
-inline AI* GetVaultOfArchavonAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetVaultOfArchavonAI(T* obj)
{
- return GetInstanceAI<AI>(creature, VoAScriptName);
+ return GetInstanceAI<AI>(obj, VoAScriptName);
}
#endif
diff --git a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp
index 8d7231d2ea3..eecd80e777d 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp
@@ -20,7 +20,6 @@
#include "MotionMaster.h"
#include "ScriptedCreature.h"
#include "SpellAuras.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
#include "violet_hold.h"
diff --git a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp
index 647b25e2e15..5046342118e 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp
@@ -19,7 +19,6 @@
#include "InstanceScript.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
#include "violet_hold.h"
diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
index 4cb4a6adee4..3abd0a6703d 100644
--- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
+++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
@@ -25,8 +25,9 @@
#include "Player.h"
#include "TaskScheduler.h"
#include "TemporarySummon.h"
-#include "WorldStatePackets.h"
#include "violet_hold.h"
+#include "WorldStatePackets.h"
+#include <sstream>
/*
* TODO:
diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp
index 5a83845fbe3..7cd5ef0845b 100644
--- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp
+++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp
@@ -23,8 +23,8 @@
#include "MotionMaster.h"
#include "Player.h"
#include "GameObjectAI.h"
-#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
+#include "ScriptedGossip.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
@@ -237,7 +237,7 @@ Position const FifthPortalWPs[] =
//{1827.100342f, 801.605957f, 44.363358f}
};
-Position const SixthPoralWPs[] =
+Position const SixthPortalWPs[] =
{
{1888.861084f, 805.074768f, 38.375790f},
{1869.793823f, 804.135804f, 38.647018f},
@@ -542,7 +542,7 @@ class npc_azure_saboteur : public CreatureScript
_bossId = _instance->GetData(DATA_2ND_BOSS);
}
- template<size_t N>
+ template <size_t N>
void StartSmoothPath(Position const (&path)[N])
{
me->GetMotionMaster()->MoveSmoothPath(POINT_INTRO, &path[0], N, false);
@@ -842,7 +842,7 @@ struct violet_hold_trashAI : public EscortAI
_scheduler.CancelAll();
}
- template<size_t N>
+ template <size_t N>
Position const* GetPathAndInitLastWaypointFrom(Position const (&path)[N])
{
_lastWaypointId = N - 1;
@@ -881,7 +881,7 @@ struct violet_hold_trashAI : public EscortAI
path = GetPathAndInitLastWaypointFrom(FifthPortalWPs);
break;
case 5:
- path = GetPathAndInitLastWaypointFrom(SixthPoralWPs);
+ path = GetPathAndInitLastWaypointFrom(SixthPortalWPs);
break;
default:
path = GetPathAndInitLastWaypointFrom(DefaultPortalWPs);
@@ -1291,7 +1291,7 @@ class npc_violet_hold_defense_system : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_violet_hold_defense_systemAI(creature);
+ return GetVioletHoldAI<npc_violet_hold_defense_systemAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.h b/src/server/scripts/Northrend/VioletHold/violet_hold.h
index 5f0b55490c8..d9202f03383 100644
--- a/src/server/scripts/Northrend/VioletHold/violet_hold.h
+++ b/src/server/scripts/Northrend/VioletHold/violet_hold.h
@@ -155,7 +155,7 @@ enum VHInstanceMisc
POINT_INTRO = 1
};
-template<class AI, class T>
+template <class AI, class T>
inline AI* GetVioletHoldAI(T* obj)
{
return GetInstanceAI<AI>(obj, VioletHoldScriptName);
diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp
index 7901c1fe6e5..6590046a80e 100644
--- a/src/server/scripts/Northrend/zone_borean_tundra.cpp
+++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp
@@ -91,7 +91,7 @@ public:
Initialize();
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (phase || spell->Id != SPELL_SET_CART)
return;
@@ -1458,7 +1458,7 @@ public:
AttackStart(who);
}
- void SpellHit(Unit* pCaster, const SpellInfo* pSpell) override
+ void SpellHit(Unit* pCaster, SpellInfo const* pSpell) override
{
if (pSpell->Id == SPELL_ARCANE_CHAINS && pCaster->GetTypeId() == TYPEID_PLAYER && !HealthAbovePct(50) && !bEnslaved)
{
@@ -1568,7 +1568,7 @@ public:
{
}
- void SpellHit(Unit* unit, const SpellInfo* spell) override
+ void SpellHit(Unit* unit, SpellInfo const* spell) override
{
if (spell->Id == SPELL_NEURAL_NEEDLE && unit->GetTypeId() == TYPEID_PLAYER)
if (Player* player = unit->ToPlayer())
@@ -1646,7 +1646,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
- if (Player* player=GetPlayerForEscort())
+ if (Player* player = GetPlayerForEscort())
player->FailQuest(QUEST_ESCAPING_THE_MIST);
}
@@ -2161,9 +2161,9 @@ enum HiddenCultist
SAY_HIDDEN_CULTIST_4 = 3
};
-const char* GOSSIP_ITEM_TOM_HEGGER = "What do you know about the Cult of the Damned?";
-const char* GOSSIP_ITEM_GUARD_MITCHELLS = "How long have you worked for the Cult of the Damned?";
-const char* GOSSIP_ITEM_SALTY_JOHN_THORPE = "I have a reason to believe you're involved in the cultist activity";
+char const* GOSSIP_ITEM_TOM_HEGGER = "What do you know about the Cult of the Damned?";
+char const* GOSSIP_ITEM_GUARD_MITCHELLS = "How long have you worked for the Cult of the Damned?";
+char const* GOSSIP_ITEM_SALTY_JOHN_THORPE = "I have a reason to believe you're involved in the cultist activity";
class npc_hidden_cultist : public CreatureScript
{
@@ -2291,7 +2291,7 @@ public:
bool GossipHello(Player* player) override
{
uint32 uiGossipText = 0;
- const char* charGossipItem;
+ char const* charGossipItem;
switch (me->GetEntry())
{
diff --git a/src/server/scripts/Northrend/zone_dalaran.cpp b/src/server/scripts/Northrend/zone_dalaran.cpp
index 7d123e54413..fca0eed9bf6 100644
--- a/src/server/scripts/Northrend/zone_dalaran.cpp
+++ b/src/server/scripts/Northrend/zone_dalaran.cpp
@@ -28,9 +28,9 @@ Script Data End */
#include "Mail.h"
#include "Map.h"
#include "MotionMaster.h"
+#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
-#include "Player.h"
/*******************************************************
* npc_mageguard_dalaran
@@ -169,9 +169,8 @@ class npc_minigob_manabonk : public CreatureScript
Player* SelectTargetInDalaran()
{
std::vector<Player*> PlayerInDalaranList;
- PlayerInDalaranList.clear();
- Map::PlayerList const &players = me->GetMap()->GetPlayers();
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (Player* player = itr->GetSource()->ToPlayer())
if (player->GetZoneId() == ZONE_DALARAN && !player->IsFlying() && !player->IsMounted() && !player->IsGameMaster())
diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp
index b55c684e527..906c223a5a3 100644
--- a/src/server/scripts/Northrend/zone_dragonblight.cpp
+++ b/src/server/scripts/Northrend/zone_dragonblight.cpp
@@ -33,7 +33,7 @@ EndContentData */
#include "Player.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
-#include "SpellAuraEffects.h"
+#include "SpellInfo.h"
#include "SpellScript.h"
#include "Vehicle.h"
@@ -640,7 +640,7 @@ class npc_torturer_lecraft : public CreatureScript
Talk (SAY_AGGRO, player);
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id != SPELL_HIGH_EXECUTORS_BRANDING_IRON)
return;
@@ -715,7 +715,7 @@ class at_nearby_messenger_torvus : public AreaTriggerScript
public:
at_nearby_messenger_torvus() : AreaTriggerScript("at_nearby_messenger_torvus") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/, bool entered) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*at*/, bool entered) override
{
if (player->IsAlive() && entered)
if (Quest const* quest = sObjectMgr->GetQuestTemplate(QUEST_MESSAGE_FROM_THE_WEST))
diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
index 4d4f6d74cc3..6394ffffaf2 100644
--- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp
+++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
@@ -298,7 +298,7 @@ public:
_gender = Data;
}
- void SpellHit(Unit* Caster, const SpellInfo* Spell) override
+ void SpellHit(Unit* Caster, SpellInfo const* Spell) override
{
if (Spell->Id == SPELL_OUTHOUSE_GROANS)
{
@@ -493,7 +493,7 @@ public:
me->DespawnOrUnsummon(_despawnTimer);
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id == SPELL_RENEW_SKIRMISHER && caster->GetTypeId() == TYPEID_PLAYER
&& caster->ToPlayer()->GetQuestStatus(QUEST_OVERWHELMED) == QUEST_STATUS_INCOMPLETE)
@@ -953,12 +953,7 @@ public:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_WARHEAD_Z_CHECK,
- SPELL_WARHEAD_SEEKING_LUMBERSHIP,
- SPELL_WARHEAD_FUSE
- });
+ return ValidateSpellInfo({ SPELL_WARHEAD_Z_CHECK, SPELL_WARHEAD_SEEKING_LUMBERSHIP, SPELL_WARHEAD_FUSE });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp
index bae7b81a96c..e84d65c9349 100644
--- a/src/server/scripts/Northrend/zone_storm_peaks.cpp
+++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp
@@ -226,7 +226,7 @@ public:
me->DespawnOrUnsummon();
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id != SPELL_ICE_LANCE)
return;
@@ -1128,13 +1128,6 @@ class spell_close_rift : public SpellScriptLoader
{
PrepareAuraScript(spell_close_rift_AuraScript);
- public:
- spell_close_rift_AuraScript()
- {
- _counter = 0;
- }
-
- private:
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ SPELL_DESPAWN_RIFT });
@@ -1152,7 +1145,7 @@ class spell_close_rift : public SpellScriptLoader
}
private:
- uint8 _counter;
+ uint8 _counter = 0;
};
diff --git a/src/server/scripts/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp
index d778c5201cd..3c612756910 100644
--- a/src/server/scripts/Northrend/zone_wintergrasp.cpp
+++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp
@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ScriptMgr.h"
#include "Battlefield.h"
#include "BattlefieldMgr.h"
#include "BattlefieldWG.h"
@@ -25,7 +26,6 @@
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
-#include "ScriptMgr.h"
#include "ScriptSystem.h"
#include "SpellScript.h"
#include "Vehicle.h"
diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp
index 0c6ffbd4e82..c5340b4e5e7 100644
--- a/src/server/scripts/Northrend/zone_zuldrak.cpp
+++ b/src/server/scripts/Northrend/zone_zuldrak.cpp
@@ -17,9 +17,9 @@
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
-#include "GameObjectAI.h"
#include "Player.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
@@ -89,7 +89,7 @@ public:
me->setDeathState(DEAD);
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id == SPELL_UNLOCK_SHACKLE)
{
@@ -145,7 +145,7 @@ public:
void MoveInLineOfSight(Unit* /*who*/) override { }
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_FREE_RAGECLAW)
{
@@ -653,7 +653,7 @@ class spell_random_ingredient_aura : public SpellScriptLoader
{
SPELL_RANDOM_INGREDIENT_EASY,
SPELL_RANDOM_INGREDIENT_MEDIUM,
- SPELL_RANDOM_INGREDIENT_HARD,
+ SPELL_RANDOM_INGREDIENT_HARD
});
}
@@ -929,7 +929,7 @@ public:
Reset();
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id != GYMERS_GRAB)
return;
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
index 5728331a762..3a52febaafd 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
@@ -22,7 +22,6 @@
#include "Player.h"
#include "WorldStatePackets.h"
-
uint32 const OutdoorPvPHPBuffZonesNum = 6;
// HP, citadel, ramparts, blood furnace, shattered halls, mag's lair
uint32 const OutdoorPvPHPBuffZones[OutdoorPvPHPBuffZonesNum] = { 3483, 3563, 3562, 3713, 3714, 3836 };
@@ -253,7 +252,7 @@ void OPvPCapturePointHP::ChangeState()
break;
}
- Map* map = sMapMgr->FindMap(530, 0);
+ Map* map = m_PvP->GetMap();
auto bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
for (auto itr = bounds.first; itr != bounds.second; ++itr)
itr->second->SetGoArtKit(artkit);
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
index 23aafd28899..5c85f1e6213 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
@@ -18,9 +18,9 @@
#include "ScriptMgr.h"
#include "Creature.h"
#include "GameObject.h"
-#include "MapManager.h"
#include "ObjectMgr.h"
#include "OutdoorPvPNA.h"
+#include "Map.h"
#include "Player.h"
#include "WorldStatePackets.h"
@@ -155,30 +155,30 @@ uint32 OPvPCapturePointNA::GetAliveGuardsCount()
{
switch (itr->first)
{
- case NA_NPC_GUARD_01:
- case NA_NPC_GUARD_02:
- case NA_NPC_GUARD_03:
- case NA_NPC_GUARD_04:
- case NA_NPC_GUARD_05:
- case NA_NPC_GUARD_06:
- case NA_NPC_GUARD_07:
- case NA_NPC_GUARD_08:
- case NA_NPC_GUARD_09:
- case NA_NPC_GUARD_10:
- case NA_NPC_GUARD_11:
- case NA_NPC_GUARD_12:
- case NA_NPC_GUARD_13:
- case NA_NPC_GUARD_14:
- case NA_NPC_GUARD_15:
- {
- auto bounds = m_PvP->GetMap()->GetCreatureBySpawnIdStore().equal_range(itr->second);
- for (auto itr2 = bounds.first; itr2 != bounds.second; ++itr2)
- if (itr2->second->IsAlive())
- ++cnt;
- break;
- }
- default:
- break;
+ case NA_NPC_GUARD_01:
+ case NA_NPC_GUARD_02:
+ case NA_NPC_GUARD_03:
+ case NA_NPC_GUARD_04:
+ case NA_NPC_GUARD_05:
+ case NA_NPC_GUARD_06:
+ case NA_NPC_GUARD_07:
+ case NA_NPC_GUARD_08:
+ case NA_NPC_GUARD_09:
+ case NA_NPC_GUARD_10:
+ case NA_NPC_GUARD_11:
+ case NA_NPC_GUARD_12:
+ case NA_NPC_GUARD_13:
+ case NA_NPC_GUARD_14:
+ case NA_NPC_GUARD_15:
+ {
+ auto bounds = m_PvP->GetMap()->GetCreatureBySpawnIdStore().equal_range(itr->second);
+ for (auto itr2 = bounds.first; itr2 != bounds.second; ++itr2)
+ if (itr2->second->IsAlive())
+ ++cnt;
+ break;
+ }
+ default:
+ break;
}
}
return cnt;
@@ -242,11 +242,11 @@ void OPvPCapturePointNA::DeSpawnGOs()
void OPvPCapturePointNA::FactionTakeOver(uint32 team)
{
if (m_ControllingFaction)
- sObjectMgr->RemoveGraveYardLink(NA_HALAA_GRAVEYARD, NA_HALAA_GRAVEYARD_ZONE, m_ControllingFaction, false);
+ sObjectMgr->RemoveGraveyardLink(NA_HALAA_GRAVEYARD, NA_HALAA_GRAVEYARD_ZONE, m_ControllingFaction, false);
m_ControllingFaction = team;
if (m_ControllingFaction)
- sObjectMgr->AddGraveYardLink(NA_HALAA_GRAVEYARD, NA_HALAA_GRAVEYARD_ZONE, m_ControllingFaction, false);
+ sObjectMgr->AddGraveyardLink(NA_HALAA_GRAVEYARD, NA_HALAA_GRAVEYARD_ZONE, m_ControllingFaction, false);
DeSpawnGOs();
DeSpawnNPCs();
SpawnGOsForTeam(team);
@@ -488,11 +488,11 @@ int32 OPvPCapturePointNA::HandleOpenGo(Player* player, GameObject* go)
int32 retval = OPvPCapturePoint::HandleOpenGo(player, go);
if (retval >= 0)
{
- const go_type * gos = nullptr;
+ go_type const* gos = nullptr;
if (m_ControllingFaction == ALLIANCE)
- gos=AllianceControlGOs;
+ gos = AllianceControlGOs;
else if (m_ControllingFaction == HORDE)
- gos=HordeControlGOs;
+ gos = HordeControlGOs;
else
return -1;
@@ -503,101 +503,101 @@ int32 OPvPCapturePointNA::HandleOpenGo(Player* player, GameObject* go)
switch (retval)
{
- case NA_DESTROYED_ROOST_S:
- del = NA_DESTROYED_ROOST_S;
- add = NA_ROOST_S;
- add2 = NA_BOMB_WAGON_S;
- if (m_ControllingFaction == HORDE)
- m_WyvernStateSouth = WYVERN_ALLIANCE;
- else
- m_WyvernStateSouth = WYVERN_HORDE;
- UpdateWyvernRoostWorldState(NA_ROOST_S);
- break;
- case NA_DESTROYED_ROOST_N:
- del = NA_DESTROYED_ROOST_N;
- add = NA_ROOST_N;
- add2 = NA_BOMB_WAGON_N;
- if (m_ControllingFaction == HORDE)
- m_WyvernStateNorth = WYVERN_ALLIANCE;
- else
- m_WyvernStateNorth = WYVERN_HORDE;
- UpdateWyvernRoostWorldState(NA_ROOST_N);
- break;
- case NA_DESTROYED_ROOST_W:
- del = NA_DESTROYED_ROOST_W;
- add = NA_ROOST_W;
- add2 = NA_BOMB_WAGON_W;
- if (m_ControllingFaction == HORDE)
- m_WyvernStateWest = WYVERN_ALLIANCE;
- else
- m_WyvernStateWest = WYVERN_HORDE;
- UpdateWyvernRoostWorldState(NA_ROOST_W);
- break;
- case NA_DESTROYED_ROOST_E:
- del = NA_DESTROYED_ROOST_E;
- add = NA_ROOST_E;
- add2 = NA_BOMB_WAGON_E;
- if (m_ControllingFaction == HORDE)
- m_WyvernStateEast = WYVERN_ALLIANCE;
- else
- m_WyvernStateEast = WYVERN_HORDE;
- UpdateWyvernRoostWorldState(NA_ROOST_E);
- break;
- case NA_BOMB_WAGON_S:
- del = NA_BOMB_WAGON_S;
- del2 = NA_ROOST_S;
- add = NA_DESTROYED_ROOST_S;
- if (m_ControllingFaction == HORDE)
- m_WyvernStateSouth = WYVERN_NEU_ALLIANCE;
- else
- m_WyvernStateSouth = WYVERN_NEU_HORDE;
- UpdateWyvernRoostWorldState(NA_ROOST_S);
- break;
- case NA_BOMB_WAGON_N:
- del = NA_BOMB_WAGON_N;
- del2 = NA_ROOST_N;
- add = NA_DESTROYED_ROOST_N;
- if (m_ControllingFaction == HORDE)
- m_WyvernStateNorth = WYVERN_NEU_ALLIANCE;
- else
- m_WyvernStateNorth = WYVERN_NEU_HORDE;
- UpdateWyvernRoostWorldState(NA_ROOST_N);
- break;
- case NA_BOMB_WAGON_W:
- del = NA_BOMB_WAGON_W;
- del2 = NA_ROOST_W;
- add = NA_DESTROYED_ROOST_W;
- if (m_ControllingFaction == HORDE)
- m_WyvernStateWest = WYVERN_NEU_ALLIANCE;
- else
- m_WyvernStateWest = WYVERN_NEU_HORDE;
- UpdateWyvernRoostWorldState(NA_ROOST_W);
- break;
- case NA_BOMB_WAGON_E:
- del = NA_BOMB_WAGON_E;
- del2 = NA_ROOST_E;
- add = NA_DESTROYED_ROOST_E;
- if (m_ControllingFaction == HORDE)
- m_WyvernStateEast = WYVERN_NEU_ALLIANCE;
- else
- m_WyvernStateEast = WYVERN_NEU_HORDE;
- UpdateWyvernRoostWorldState(NA_ROOST_E);
- break;
- default:
- return -1;
- break;
+ case NA_DESTROYED_ROOST_S:
+ del = NA_DESTROYED_ROOST_S;
+ add = NA_ROOST_S;
+ add2 = NA_BOMB_WAGON_S;
+ if (m_ControllingFaction == HORDE)
+ m_WyvernStateSouth = WYVERN_ALLIANCE;
+ else
+ m_WyvernStateSouth = WYVERN_HORDE;
+ UpdateWyvernRoostWorldState(NA_ROOST_S);
+ break;
+ case NA_DESTROYED_ROOST_N:
+ del = NA_DESTROYED_ROOST_N;
+ add = NA_ROOST_N;
+ add2 = NA_BOMB_WAGON_N;
+ if (m_ControllingFaction == HORDE)
+ m_WyvernStateNorth = WYVERN_ALLIANCE;
+ else
+ m_WyvernStateNorth = WYVERN_HORDE;
+ UpdateWyvernRoostWorldState(NA_ROOST_N);
+ break;
+ case NA_DESTROYED_ROOST_W:
+ del = NA_DESTROYED_ROOST_W;
+ add = NA_ROOST_W;
+ add2 = NA_BOMB_WAGON_W;
+ if (m_ControllingFaction == HORDE)
+ m_WyvernStateWest = WYVERN_ALLIANCE;
+ else
+ m_WyvernStateWest = WYVERN_HORDE;
+ UpdateWyvernRoostWorldState(NA_ROOST_W);
+ break;
+ case NA_DESTROYED_ROOST_E:
+ del = NA_DESTROYED_ROOST_E;
+ add = NA_ROOST_E;
+ add2 = NA_BOMB_WAGON_E;
+ if (m_ControllingFaction == HORDE)
+ m_WyvernStateEast = WYVERN_ALLIANCE;
+ else
+ m_WyvernStateEast = WYVERN_HORDE;
+ UpdateWyvernRoostWorldState(NA_ROOST_E);
+ break;
+ case NA_BOMB_WAGON_S:
+ del = NA_BOMB_WAGON_S;
+ del2 = NA_ROOST_S;
+ add = NA_DESTROYED_ROOST_S;
+ if (m_ControllingFaction == HORDE)
+ m_WyvernStateSouth = WYVERN_NEU_ALLIANCE;
+ else
+ m_WyvernStateSouth = WYVERN_NEU_HORDE;
+ UpdateWyvernRoostWorldState(NA_ROOST_S);
+ break;
+ case NA_BOMB_WAGON_N:
+ del = NA_BOMB_WAGON_N;
+ del2 = NA_ROOST_N;
+ add = NA_DESTROYED_ROOST_N;
+ if (m_ControllingFaction == HORDE)
+ m_WyvernStateNorth = WYVERN_NEU_ALLIANCE;
+ else
+ m_WyvernStateNorth = WYVERN_NEU_HORDE;
+ UpdateWyvernRoostWorldState(NA_ROOST_N);
+ break;
+ case NA_BOMB_WAGON_W:
+ del = NA_BOMB_WAGON_W;
+ del2 = NA_ROOST_W;
+ add = NA_DESTROYED_ROOST_W;
+ if (m_ControllingFaction == HORDE)
+ m_WyvernStateWest = WYVERN_NEU_ALLIANCE;
+ else
+ m_WyvernStateWest = WYVERN_NEU_HORDE;
+ UpdateWyvernRoostWorldState(NA_ROOST_W);
+ break;
+ case NA_BOMB_WAGON_E:
+ del = NA_BOMB_WAGON_E;
+ del2 = NA_ROOST_E;
+ add = NA_DESTROYED_ROOST_E;
+ if (m_ControllingFaction == HORDE)
+ m_WyvernStateEast = WYVERN_NEU_ALLIANCE;
+ else
+ m_WyvernStateEast = WYVERN_NEU_HORDE;
+ UpdateWyvernRoostWorldState(NA_ROOST_E);
+ break;
+ default:
+ return -1;
+ break;
}
- if (del>-1)
+ if (del > -1)
DelObject(del);
- if (del2>-1)
+ if (del2 > -1)
DelObject(del2);
- if (add>-1)
+ if (add > -1)
AddObject(add, gos[add].entry, gos[add].map, gos[add].pos, gos[add].rot);
- if (add2>-1)
+ if (add2 > -1)
AddObject(add2, gos[add2].entry, gos[add2].map, gos[add2].pos, gos[add2].rot);
return retval;
@@ -678,7 +678,7 @@ void OPvPCapturePointNA::ChangeState()
break;
}
- auto bounds = sMapMgr->FindMap(530, 0)->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
+ auto bounds = m_PvP->GetMap()->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
for (auto itr = bounds.first; itr != bounds.second; ++itr)
itr->second->SetGoArtKit(artkit);
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
index 68d85ababfb..639ab1cd704 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
@@ -17,7 +17,7 @@
#include "ScriptMgr.h"
#include "GameObject.h"
-#include "MapManager.h"
+#include "Map.h"
#include "ObjectAccessor.h"
#include "OutdoorPvPTF.h"
#include "Player.h"
@@ -337,46 +337,46 @@ void OPvPCapturePointTF::ChangeState()
switch (m_State)
{
- case OBJECTIVESTATE_ALLIANCE:
- {
- m_TowerState = TF_TOWERSTATE_A;
- artkit = 2;
- uint32 alliance_towers = ((OutdoorPvPTF*)m_PvP)->GetAllianceTowersControlled();
- if (alliance_towers < TF_TOWER_NUM)
- ((OutdoorPvPTF*)m_PvP)->SetAllianceTowersControlled(++alliance_towers);
-
- m_PvP->SendDefenseMessage(OutdoorPvPTFBuffZones[0], TEXT_SPIRIT_TOWER_TAKEN_ALLIANCE);
-
- for (GuidSet::iterator itr = m_activePlayers[0].begin(); itr != m_activePlayers[0].end(); ++itr)
- if (Player* player = ObjectAccessor::FindPlayer(*itr))
- player->AreaExploredOrEventHappens(TF_ALLY_QUEST);
- break;
- }
- case OBJECTIVESTATE_HORDE:
- {
- m_TowerState = TF_TOWERSTATE_H;
- artkit = 1;
- uint32 horde_towers = ((OutdoorPvPTF*)m_PvP)->GetHordeTowersControlled();
- if (horde_towers < TF_TOWER_NUM)
- ((OutdoorPvPTF*)m_PvP)->SetHordeTowersControlled(++horde_towers);
-
- m_PvP->SendDefenseMessage(OutdoorPvPTFBuffZones[0], TEXT_SPIRIT_TOWER_TAKEN_HORDE);
-
- for (GuidSet::iterator itr = m_activePlayers[1].begin(); itr != m_activePlayers[1].end(); ++itr)
- if (Player* player = ObjectAccessor::FindPlayer(*itr))
- player->AreaExploredOrEventHappens(TF_HORDE_QUEST);
- break;
- }
- case OBJECTIVESTATE_NEUTRAL:
- case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
- case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
- case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
- case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
- m_TowerState = TF_TOWERSTATE_N;
- break;
+ case OBJECTIVESTATE_ALLIANCE:
+ {
+ m_TowerState = TF_TOWERSTATE_A;
+ artkit = 2;
+ uint32 alliance_towers = ((OutdoorPvPTF*)m_PvP)->GetAllianceTowersControlled();
+ if (alliance_towers < TF_TOWER_NUM)
+ ((OutdoorPvPTF*)m_PvP)->SetAllianceTowersControlled(++alliance_towers);
+
+ m_PvP->SendDefenseMessage(OutdoorPvPTFBuffZones[0], TEXT_SPIRIT_TOWER_TAKEN_ALLIANCE);
+
+ for (GuidSet::iterator itr = m_activePlayers[0].begin(); itr != m_activePlayers[0].end(); ++itr)
+ if (Player* player = ObjectAccessor::FindPlayer(*itr))
+ player->AreaExploredOrEventHappens(TF_ALLY_QUEST);
+ break;
+ }
+ case OBJECTIVESTATE_HORDE:
+ {
+ m_TowerState = TF_TOWERSTATE_H;
+ artkit = 1;
+ uint32 horde_towers = ((OutdoorPvPTF*)m_PvP)->GetHordeTowersControlled();
+ if (horde_towers < TF_TOWER_NUM)
+ ((OutdoorPvPTF*)m_PvP)->SetHordeTowersControlled(++horde_towers);
+
+ m_PvP->SendDefenseMessage(OutdoorPvPTFBuffZones[0], TEXT_SPIRIT_TOWER_TAKEN_HORDE);
+
+ for (GuidSet::iterator itr = m_activePlayers[1].begin(); itr != m_activePlayers[1].end(); ++itr)
+ if (Player* player = ObjectAccessor::FindPlayer(*itr))
+ player->AreaExploredOrEventHappens(TF_HORDE_QUEST);
+ break;
+ }
+ case OBJECTIVESTATE_NEUTRAL:
+ case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
+ case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
+ case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
+ case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
+ m_TowerState = TF_TOWERSTATE_N;
+ break;
}
- auto bounds = sMapMgr->FindMap(530, 0)->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
+ auto bounds = m_PvP->GetMap()->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
for (auto itr = bounds.first; itr != bounds.second; ++itr)
itr->second->SetGoArtKit(artkit);
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp
index f680db8eb2c..c181fd53902 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp
@@ -162,11 +162,11 @@ bool OutdoorPvPZM::Update(uint32 diff)
if (changed)
{
if (m_AllianceTowersControlled == ZM_NUM_BEACONS)
- m_GraveYard->SetBeaconState(ALLIANCE);
+ m_Graveyard->SetBeaconState(ALLIANCE);
else if (m_HordeTowersControlled == ZM_NUM_BEACONS)
- m_GraveYard->SetBeaconState(HORDE);
+ m_Graveyard->SetBeaconState(HORDE);
else
- m_GraveYard->SetBeaconState(0);
+ m_Graveyard->SetBeaconState(0);
}
return changed;
}
@@ -175,12 +175,12 @@ void OutdoorPvPZM::HandlePlayerEnterZone(Player* player, uint32 zone)
{
if (player->GetTeam() == ALLIANCE)
{
- if (m_GraveYard->GetGraveYardState() & ZM_GRAVEYARD_A)
+ if (m_Graveyard->GetGraveyardState() & ZM_GRAVEYARD_A)
player->CastSpell(player, ZM_CAPTURE_BUFF, true);
}
else
{
- if (m_GraveYard->GetGraveYardState() & ZM_GRAVEYARD_H)
+ if (m_Graveyard->GetGraveyardState() & ZM_GRAVEYARD_H)
player->CastSpell(player, ZM_CAPTURE_BUFF, true);
}
OutdoorPvP::HandlePlayerEnterZone(player, zone);
@@ -199,7 +199,7 @@ void OutdoorPvPZM::HandlePlayerLeaveZone(Player* player, uint32 zone)
OutdoorPvPZM::OutdoorPvPZM()
{
m_TypeId = OUTDOOR_PVP_ZM;
- m_GraveYard = nullptr;
+ m_Graveyard = nullptr;
m_AllianceTowersControlled = 0;
m_HordeTowersControlled = 0;
}
@@ -217,8 +217,8 @@ bool OutdoorPvPZM::SetupOutdoorPvP()
AddCapturePoint(new OPvPCapturePointZM_Beacon(this, ZM_BEACON_WEST));
AddCapturePoint(new OPvPCapturePointZM_Beacon(this, ZM_BEACON_EAST));
- m_GraveYard = new OPvPCapturePointZM_GraveYard(this);
- AddCapturePoint(m_GraveYard); // though the update function isn't used, the handleusego is!
+ m_Graveyard = new OPvPCapturePointZM_Graveyard(this);
+ AddCapturePoint(m_Graveyard); // though the update function isn't used, the handleusego is!
return true;
}
@@ -234,36 +234,36 @@ void OutdoorPvPZM::HandleKillImpl(Player* player, Unit* killed)
player->CastSpell(player, ZM_HordePlayerKillReward, true);
}
-bool OPvPCapturePointZM_GraveYard::Update(uint32 /*diff*/)
+bool OPvPCapturePointZM_Graveyard::Update(uint32 /*diff*/)
{
bool retval = m_State != m_OldState;
m_State = m_OldState;
return retval;
}
-int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* player, GameObject* go)
+int32 OPvPCapturePointZM_Graveyard::HandleOpenGo(Player* player, GameObject* go)
{
int32 retval = OPvPCapturePoint::HandleOpenGo(player, go);
if (retval >= 0)
{
- if (player->HasAura(ZM_BATTLE_STANDARD_A) && m_GraveYardState != ZM_GRAVEYARD_A)
+ if (player->HasAura(ZM_BATTLE_STANDARD_A) && m_GraveyardState != ZM_GRAVEYARD_A)
{
- m_GraveYardState = ZM_GRAVEYARD_A;
+ m_GraveyardState = ZM_GRAVEYARD_A;
DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant
AddObject(0, ZM_Banner_A.entry, ZM_Banner_A.map, ZM_Banner_A.pos, ZM_Banner_A.rot);
- sObjectMgr->RemoveGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE); // rem gy
- sObjectMgr->AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE, false); // add gy
+ sObjectMgr->RemoveGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE); // rem gy
+ sObjectMgr->AddGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE, false); // add gy
m_PvP->TeamApplyBuff(TEAM_ALLIANCE, ZM_CAPTURE_BUFF);
player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
m_PvP->SendDefenseMessage(ZM_GRAVEYARD_ZONE, TEXT_TWIN_SPIRE_RUINS_TAKEN_ALLIANCE);
}
- else if (player->HasAura(ZM_BATTLE_STANDARD_H) && m_GraveYardState != ZM_GRAVEYARD_H)
+ else if (player->HasAura(ZM_BATTLE_STANDARD_H) && m_GraveyardState != ZM_GRAVEYARD_H)
{
- m_GraveYardState = ZM_GRAVEYARD_H;
+ m_GraveyardState = ZM_GRAVEYARD_H;
DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant
AddObject(0, ZM_Banner_H.entry, ZM_Banner_H.map, ZM_Banner_H.pos, ZM_Banner_H.rot);
- sObjectMgr->RemoveGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE); // rem gy
- sObjectMgr->AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE, false); // add gy
+ sObjectMgr->RemoveGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE); // rem gy
+ sObjectMgr->AddGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE, false); // add gy
m_PvP->TeamApplyBuff(TEAM_HORDE, ZM_CAPTURE_BUFF);
player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
m_PvP->SendDefenseMessage(ZM_GRAVEYARD_ZONE, TEXT_TWIN_SPIRE_RUINS_TAKEN_HORDE);
@@ -273,11 +273,11 @@ int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* player, GameObject* go)
return retval;
}
-OPvPCapturePointZM_GraveYard::OPvPCapturePointZM_GraveYard(OutdoorPvP* pvp)
+OPvPCapturePointZM_Graveyard::OPvPCapturePointZM_Graveyard(OutdoorPvP* pvp)
: OPvPCapturePoint(pvp)
{
m_BothControllingFaction = 0;
- m_GraveYardState = ZM_GRAVEYARD_N;
+ m_GraveyardState = ZM_GRAVEYARD_N;
m_FlagCarrierGUID.Clear();
// add field scouts here
AddCreature(ZM_ALLIANCE_FIELD_SCOUT, ZM_AllianceFieldScout.entry, ZM_AllianceFieldScout.map, ZM_AllianceFieldScout.pos);
@@ -286,11 +286,11 @@ OPvPCapturePointZM_GraveYard::OPvPCapturePointZM_GraveYard(OutdoorPvP* pvp)
AddObject(0, ZM_Banner_N.entry, ZM_Banner_N.map, ZM_Banner_N.pos, ZM_Banner_N.rot);
}
-void OPvPCapturePointZM_GraveYard::UpdateTowerState()
+void OPvPCapturePointZM_Graveyard::UpdateTowerState()
{
- m_PvP->SendUpdateWorldState(ZM_MAP_GRAVEYARD_N, uint32((m_GraveYardState & ZM_GRAVEYARD_N) != 0));
- m_PvP->SendUpdateWorldState(ZM_MAP_GRAVEYARD_H, uint32((m_GraveYardState & ZM_GRAVEYARD_H) != 0));
- m_PvP->SendUpdateWorldState(ZM_MAP_GRAVEYARD_A, uint32((m_GraveYardState & ZM_GRAVEYARD_A) != 0));
+ m_PvP->SendUpdateWorldState(ZM_MAP_GRAVEYARD_N, uint32((m_GraveyardState & ZM_GRAVEYARD_N) != 0));
+ m_PvP->SendUpdateWorldState(ZM_MAP_GRAVEYARD_H, uint32((m_GraveyardState & ZM_GRAVEYARD_H) != 0));
+ m_PvP->SendUpdateWorldState(ZM_MAP_GRAVEYARD_A, uint32((m_GraveyardState & ZM_GRAVEYARD_A) != 0));
m_PvP->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_READY, uint32(m_BothControllingFaction == ALLIANCE));
m_PvP->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_NOT_READY, uint32(m_BothControllingFaction != ALLIANCE));
@@ -298,11 +298,11 @@ void OPvPCapturePointZM_GraveYard::UpdateTowerState()
m_PvP->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_NOT_READY, uint32(m_BothControllingFaction != HORDE));
}
-void OPvPCapturePointZM_GraveYard::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
+void OPvPCapturePointZM_Graveyard::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{
- packet.Worldstates.emplace_back(uint32(ZM_MAP_GRAVEYARD_N), int32((m_GraveYardState & ZM_GRAVEYARD_N) != 0));
- packet.Worldstates.emplace_back(uint32(ZM_MAP_GRAVEYARD_H), int32((m_GraveYardState & ZM_GRAVEYARD_H) != 0));
- packet.Worldstates.emplace_back(uint32(ZM_MAP_GRAVEYARD_A), int32((m_GraveYardState & ZM_GRAVEYARD_A) != 0));
+ packet.Worldstates.emplace_back(uint32(ZM_MAP_GRAVEYARD_N), int32((m_GraveyardState & ZM_GRAVEYARD_N) != 0));
+ packet.Worldstates.emplace_back(uint32(ZM_MAP_GRAVEYARD_H), int32((m_GraveyardState & ZM_GRAVEYARD_H) != 0));
+ packet.Worldstates.emplace_back(uint32(ZM_MAP_GRAVEYARD_A), int32((m_GraveyardState & ZM_GRAVEYARD_A) != 0));
packet.Worldstates.emplace_back(uint32(ZM_MAP_ALLIANCE_FLAG_READY), int32(m_BothControllingFaction == ALLIANCE));
packet.Worldstates.emplace_back(uint32(ZM_MAP_ALLIANCE_FLAG_NOT_READY), int32(m_BothControllingFaction != ALLIANCE));
@@ -310,7 +310,7 @@ void OPvPCapturePointZM_GraveYard::FillInitialWorldStates(WorldPackets::WorldSta
packet.Worldstates.emplace_back(uint32(ZM_MAP_HORDE_FLAG_NOT_READY), int32(m_BothControllingFaction != HORDE));
}
-void OPvPCapturePointZM_GraveYard::SetBeaconState(uint32 controlling_faction)
+void OPvPCapturePointZM_Graveyard::SetBeaconState(uint32 controlling_faction)
{
// nothing to do here
if (m_BothControllingFaction == controlling_faction)
@@ -321,20 +321,20 @@ void OPvPCapturePointZM_GraveYard::SetBeaconState(uint32 controlling_faction)
{
case ALLIANCE:
// if ally already controls the gy and taken back both beacons, return, nothing to do for us
- if (m_GraveYardState & ZM_GRAVEYARD_A)
+ if (m_GraveyardState & ZM_GRAVEYARD_A)
return;
// ally doesn't control the gy, but controls the side beacons -> add gossip option, add neutral banner
break;
case HORDE:
// if horde already controls the gy and taken back both beacons, return, nothing to do for us
- if (m_GraveYardState & ZM_GRAVEYARD_H)
+ if (m_GraveyardState & ZM_GRAVEYARD_H)
return;
// horde doesn't control the gy, but controls the side beacons -> add gossip option, add neutral banner
break;
default:
// if the graveyard is not neutral, then leave it that way
// if the graveyard is neutral, then we have to dispel the buff from the flag carrier
- if (m_GraveYardState & ZM_GRAVEYARD_N)
+ if (m_GraveyardState & ZM_GRAVEYARD_N)
{
// gy was neutral, thus neutral banner was spawned, it is possible that someone was taking the flag to the gy
if (!m_FlagCarrierGUID.IsEmpty())
@@ -355,20 +355,20 @@ void OPvPCapturePointZM_GraveYard::SetBeaconState(uint32 controlling_faction)
UpdateTowerState();
}
-bool OPvPCapturePointZM_GraveYard::CanTalkTo(Player* player, Creature* c, GossipMenuItems const& /*gso*/)
+bool OPvPCapturePointZM_Graveyard::CanTalkTo(Player* player, Creature* c, GossipMenuItems const& /*gso*/)
{
std::map<ObjectGuid::LowType, uint32>::iterator itr = m_CreatureTypes.find(c->GetSpawnId());
if (itr != m_CreatureTypes.end())
{
- if (itr->second == ZM_ALLIANCE_FIELD_SCOUT && player->GetTeam() == ALLIANCE && m_BothControllingFaction == ALLIANCE && !m_FlagCarrierGUID && m_GraveYardState != ZM_GRAVEYARD_A)
+ if (itr->second == ZM_ALLIANCE_FIELD_SCOUT && player->GetTeam() == ALLIANCE && m_BothControllingFaction == ALLIANCE && !m_FlagCarrierGUID && m_GraveyardState != ZM_GRAVEYARD_A)
return true;
- else if (itr->second == ZM_HORDE_FIELD_SCOUT && player->GetTeam() == HORDE && m_BothControllingFaction == HORDE && !m_FlagCarrierGUID && m_GraveYardState != ZM_GRAVEYARD_H)
+ else if (itr->second == ZM_HORDE_FIELD_SCOUT && player->GetTeam() == HORDE && m_BothControllingFaction == HORDE && !m_FlagCarrierGUID && m_GraveyardState != ZM_GRAVEYARD_H)
return true;
}
return false;
}
-bool OPvPCapturePointZM_GraveYard::HandleGossipOption(Player* player, Creature* creature, uint32 /*gossipid*/)
+bool OPvPCapturePointZM_Graveyard::HandleGossipOption(Player* player, Creature* creature, uint32 /*gossipid*/)
{
std::map<ObjectGuid::LowType, uint32>::iterator itr = m_CreatureTypes.find(creature->GetSpawnId());
if (itr != m_CreatureTypes.end())
@@ -393,7 +393,7 @@ bool OPvPCapturePointZM_GraveYard::HandleGossipOption(Player* player, Creature*
return false;
}
-bool OPvPCapturePointZM_GraveYard::HandleDropFlag(Player* /*player*/, uint32 spellId)
+bool OPvPCapturePointZM_Graveyard::HandleDropFlag(Player* /*player*/, uint32 spellId)
{
switch (spellId)
{
@@ -407,9 +407,9 @@ bool OPvPCapturePointZM_GraveYard::HandleDropFlag(Player* /*player*/, uint32 spe
return false;
}
-uint32 OPvPCapturePointZM_GraveYard::GetGraveYardState() const
+uint32 OPvPCapturePointZM_Graveyard::GetGraveyardState() const
{
- return m_GraveYardState;
+ return m_GraveyardState;
}
uint32 OutdoorPvPZM::GetAllianceTowersControlled() const
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
index b1195d5221c..0b6e144af2a 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
@@ -114,17 +114,17 @@ class OPvPCapturePointZM_Beacon : public OPvPCapturePoint
uint32 m_TowerState;
};
-enum ZM_GraveYardState
+enum ZM_GraveyardState
{
ZM_GRAVEYARD_N = 1,
ZM_GRAVEYARD_A = 2,
ZM_GRAVEYARD_H = 4
};
-class OPvPCapturePointZM_GraveYard : public OPvPCapturePoint
+class OPvPCapturePointZM_Graveyard : public OPvPCapturePoint
{
public:
- OPvPCapturePointZM_GraveYard(OutdoorPvP* pvp);
+ OPvPCapturePointZM_Graveyard(OutdoorPvP* pvp);
bool Update(uint32 diff) override;
@@ -144,10 +144,10 @@ class OPvPCapturePointZM_GraveYard : public OPvPCapturePoint
bool CanTalkTo(Player* player, Creature* creature, GossipMenuItems const& gso) override;
- uint32 GetGraveYardState() const;
+ uint32 GetGraveyardState() const;
private:
- uint32 m_GraveYardState;
+ uint32 m_GraveyardState;
protected:
uint32 m_BothControllingFaction;
@@ -180,7 +180,7 @@ class OutdoorPvPZM : public OutdoorPvP
void SetHordeTowersControlled(uint32 count);
private:
- OPvPCapturePointZM_GraveYard * m_GraveYard;
+ OPvPCapturePointZM_Graveyard * m_Graveyard;
uint32 m_AllianceTowersControlled;
uint32 m_HordeTowersControlled;
diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h
index 842f4ca195b..5ea113cc547 100644
--- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h
+++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h
@@ -32,10 +32,10 @@ enum ACDataTypes
DATA_EXARCH_MALADAAR = 1
};
-template<typename AI>
-inline AI* GetAuchenaiCryptsAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetAuchenaiCryptsAI(T* obj)
{
- return GetInstanceAI<AI>(creature, ACScriptName);
+ return GetInstanceAI<AI>(obj, ACScriptName);
}
#endif // AUCHENAI_CRYPTS_H_
diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp
index c07ddb0cb23..0340a4dd2f1 100644
--- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp
+++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp
@@ -57,7 +57,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new boss_shirrak_the_dead_watcherAI(creature);
+ return GetAuchenaiCryptsAI<boss_shirrak_the_dead_watcherAI>(creature);
}
struct boss_shirrak_the_dead_watcherAI : public ScriptedAI
@@ -111,7 +111,7 @@ public:
if (Inhibitmagic_Timer <= diff)
{
float dist;
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* i_pl = i->GetSource())
if (i_pl->IsAlive() && (dist = i_pl->GetDistance(me)) < 45)
@@ -174,7 +174,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_focus_fireAI(creature);
+ return GetAuchenaiCryptsAI<npc_focus_fireAI>(creature);
}
struct npc_focus_fireAI : public ScriptedAI
diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/mana_tombs.h b/src/server/scripts/Outland/Auchindoun/ManaTombs/mana_tombs.h
index 94b178b1e87..2b6844017f0 100644
--- a/src/server/scripts/Outland/Auchindoun/ManaTombs/mana_tombs.h
+++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/mana_tombs.h
@@ -34,10 +34,10 @@ enum MTDataTypes
DATA_YOR = 3
};
-template<typename AI>
-inline AI* GetManaTombsAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetManaTombsAI(T* obj)
{
- return GetInstanceAI<AI>(creature, MTScriptName);
+ return GetInstanceAI<AI>(obj, MTScriptName);
}
#endif // MANA_TOMBS_H_
diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
index 8c9ca995f59..435167bba65 100644
--- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
+++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
@@ -24,7 +24,7 @@
DoorData const doorData[] =
{
{ GO_IKISS_DOOR, DATA_TALON_KING_IKISS, DOOR_TYPE_PASSAGE },
- { 0, 0, DOOR_TYPE_ROOM } // END
+ { 0, 0, DOOR_TYPE_ROOM } // END
};
ObjectData const gameObjectData[] =
diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h b/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h
index b7b168c074e..bf64986f100 100644
--- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h
+++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h
@@ -48,10 +48,10 @@ enum SHGameObjectIds
GO_TALON_KING_COFFER = 187372
};
-template<typename AI>
-inline AI* GetSethekkHallsAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetSethekkHallsAI(T* obj)
{
- return GetInstanceAI<AI>(creature, SHScriptName);
+ return GetInstanceAI<AI>(obj, SHScriptName);
}
#endif // SETHEKK_HALLS_H_
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
index 416eec05c45..529107380fb 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
@@ -186,7 +186,7 @@ class boss_grandmaster_vorpil : public CreatureScript
break;
case EVENT_DRAW_SHADOWS:
{
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* i_pl = i->GetSource())
if (i_pl->IsAlive() && !i_pl->HasAura(SPELL_BANISH))
diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp
index e1615bf2260..647f678fbb8 100644
--- a/src/server/scripts/Outland/BlackTemple/black_temple.cpp
+++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp
@@ -19,8 +19,8 @@
#include "black_temple.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
-#include "SpellScript.h"
#include "SpellAuraEffects.h"
+#include "SpellScript.h"
enum Spells
{
diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.h b/src/server/scripts/Outland/BlackTemple/black_temple.h
index 6e93e0c63c0..10be8f5c633 100644
--- a/src/server/scripts/Outland/BlackTemple/black_temple.h
+++ b/src/server/scripts/Outland/BlackTemple/black_temple.h
@@ -137,7 +137,7 @@ enum BlackTempleMisc
ACTION_OPEN_DOOR = 4
};
-template<class AI, class T>
+template <class AI, class T>
inline AI* GetBlackTempleAI(T* obj)
{
return GetInstanceAI<AI>(obj, BTScriptName);
diff --git a/src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp
index ba8ded29f51..0cbf6010f8d 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp
@@ -16,14 +16,13 @@
*/
#include "ScriptMgr.h"
+#include "black_temple.h"
#include "GridNotifiers.h"
#include "ObjectAccessor.h"
#include "PassiveAI.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
-#include "black_temple.h"
-
enum Says
{
SAY_AGGRO = 0,
diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
index 9de5e595a1e..e1476f65df2 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
@@ -678,7 +678,7 @@ public:
void EnterEvadeModeIfNeeded()
{
- Map::PlayerList const &players = me->GetMap()->GetPlayers();
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
if (Player* player = i->GetSource())
if (player->IsAlive() && !player->IsGameMaster() && CheckBoundary(player))
diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidari_council.cpp
index 90939e47b9d..4acd27f7d32 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_illidari_council.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_illidari_council.cpp
@@ -15,15 +15,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ScriptMgr.h"
+#include "black_temple.h"
#include "CellImpl.h"
#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
#include "PassiveAI.h"
#include "ScriptedCreature.h"
-#include "ScriptMgr.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
-#include "black_temple.h"
enum Says
{
@@ -800,7 +800,7 @@ class spell_illidari_council_reflective_shield : public SpellScriptLoader
return ValidateSpellInfo({ SPELL_REFLECTIVE_SHIELD_DAMAGE });
}
- void OnAbsorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
+ void OnAbsorb(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount)
{
Unit* target = GetTarget();
if (dmgInfo.GetAttacker() == target)
@@ -883,7 +883,11 @@ class spell_illidari_council_seal : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_SEAL_OF_COMMAND, SPELL_SEAL_OF_BLOOD });
+ return ValidateSpellInfo(
+ {
+ SPELL_SEAL_OF_COMMAND,
+ SPELL_SEAL_OF_BLOOD
+ });
}
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
index b640a57a67c..c38bf68ea04 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
@@ -220,7 +220,11 @@ class spell_mother_shahraz_fatal_attraction : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_SABER_LASH_IMMUNITY, SPELL_FATAL_ATTRACTION });
+ return ValidateSpellInfo(
+ {
+ SPELL_SABER_LASH_IMMUNITY,
+ SPELL_FATAL_ATTRACTION
+ });
}
void FilterTargets(std::list<WorldObject*>& targets)
@@ -371,13 +375,7 @@ class spell_mother_shahraz_random_periodic : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_BEAM_SINISTER,
- SPELL_BEAM_VILE,
- SPELL_BEAM_WICKED,
- SPELL_BEAM_SINFUL
- });
+ return ValidateSpellInfo(RandomBeam);
}
void OnPeriodic(AuraEffect const* /*aurEffect*/)
diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
index 50fbd937d53..34a8289629f 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
@@ -20,13 +20,12 @@
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
+#include "Player.h"
#include "ScriptedCreature.h"
#include "Spell.h"
-#include "SpellInfo.h"
-#include "TemporarySummon.h"
-#include "SpellScript.h"
#include "SpellAuraEffects.h"
-#include "Player.h"
+#include "SpellScript.h"
+#include "TemporarySummon.h"
enum Says
{
diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
index a7d20d6dda2..23ba4d03d97 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
@@ -26,7 +26,6 @@
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellAuraEffects.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
@@ -291,7 +290,7 @@ public:
void EnterEvadeModeIfNeeded()
{
- Map::PlayerList const &players = me->GetMap()->GetPlayers();
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
if (Player* player = i->GetSource())
if (player->IsAlive() && !player->IsGameMaster() && CheckBoundary(player))
diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
index 76323235cdf..3544532d8d9 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
@@ -23,8 +23,8 @@
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "SpellScript.h"
#include "SpellAuraEffects.h"
+#include "SpellScript.h"
#include "TemporarySummon.h"
enum Says
@@ -400,13 +400,13 @@ class spell_teron_gorefiend_shadow_of_death : public SpellScriptLoader
{
return ValidateSpellInfo(
{
- SPELL_SUMMON_SPIRIT,
- SPELL_POSSESS_SPIRIT_IMMUNE,
- SPELL_SPIRITUAL_VENGEANCE,
- SPELL_SUMMON_SKELETRON_1,
- SPELL_SUMMON_SKELETRON_2,
- SPELL_SUMMON_SKELETRON_3,
- SPELL_SUMMON_SKELETRON_4
+ SPELL_SUMMON_SPIRIT,
+ SPELL_POSSESS_SPIRIT_IMMUNE,
+ SPELL_SPIRITUAL_VENGEANCE,
+ SPELL_SUMMON_SKELETRON_1,
+ SPELL_SUMMON_SKELETRON_2,
+ SPELL_SUMMON_SKELETRON_3,
+ SPELL_SUMMON_SKELETRON_4
});
}
diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
index f37cc338f65..c3861becf6b 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
@@ -16,8 +16,9 @@
*/
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
#include "black_temple.h"
+#include "GameObjectAI.h"
+#include "GridNotifiers.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
@@ -25,7 +26,6 @@
#include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "SpellScript.h"
-#include "GridNotifiers.h"
enum Texts
{
@@ -91,7 +91,7 @@ public:
Talk(SAY_DEATH);
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_HURL_SPINE && me->HasAura(SPELL_TIDAL_SHIELD))
{
diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
index 51983b77e20..241e8ba3629 100644
--- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
+++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
@@ -19,10 +19,10 @@
#include "AreaBoundary.h"
#include "black_temple.h"
#include "Creature.h"
+#include "CreatureAI.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
-#include "ScriptedCreature.h"
DoorData const doorData[] =
{
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp
index d5ef10dda82..b22c5ae38a4 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp
@@ -221,7 +221,7 @@ public:
if (!beam)
{
SummonBeams();
- beam=true;
+ beam = true;
}
//Return since we have no target
if (!UpdateVictim())
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
index f90d9e27604..6aeb637d172 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
@@ -30,8 +30,8 @@ EndScriptData */
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "Spell.h"
#include "serpent_shrine.h"
+#include "Spell.h"
#include "TemporarySummon.h"
enum LadyVashj
@@ -256,7 +256,7 @@ public:
void EnterCombat(Unit* who) override
{
// remove old tainted cores to prevent cheating in phase 2
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
if (Player* player = itr->GetSource())
player->DestroyItemCount(31088, 1, true);
@@ -326,7 +326,7 @@ public:
}
else
{
- AggroTimer-=diff;
+ AggroTimer -= diff;
return;
}
}
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
index 3e1933cf8c9..d4ffc18fd0e 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
@@ -792,7 +792,7 @@ public:
if (Earthshock_Timer <= diff)
{
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
{
if (Player* i_pl = itr->GetSource())
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
index 1a7e2d4719b..592d2fbbaa2 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
@@ -24,12 +24,12 @@ EndScriptData */
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "Map.h"
#include "MotionMaster.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "serpent_shrine.h"
#include "TemporarySummon.h"
@@ -173,7 +173,6 @@ public:
}
void MoveInLineOfSight(Unit* who) override
-
{
if (!CanStartEvent) // boss is invisible, don't attack
return;
@@ -242,7 +241,9 @@ public:
DoCast(me, SPELL_SUBMERGE);
PhaseTimer = 60000; // 60secs submerged
Submerged = true;
- } else PhaseTimer-=diff;
+ }
+ else
+ PhaseTimer -= diff;
if (SpoutTimer <= diff)
{
@@ -253,19 +254,23 @@ public:
WhirlTimer = 20000; // whirl directly after spout
RotTimer = 20000;
return;
- } else SpoutTimer -= diff;
+ }
+ else
+ SpoutTimer -= diff;
// Whirl directly after a Spout and at random times
if (WhirlTimer <= diff)
{
WhirlTimer = 18000;
DoCast(me, SPELL_WHIRL);
- } else WhirlTimer -= diff;
+ }
+ else
+ WhirlTimer -= diff;
if (CheckTimer <= diff)//check if there are players in melee range
{
InRange = false;
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (!PlayerList.isEmpty())
{
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
@@ -275,11 +280,13 @@ public:
}
}
CheckTimer = 2000;
- } else CheckTimer -= diff;
+ }
+ else
+ CheckTimer -= diff;
if (RotTimer)
{
- Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
+ Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->GetSource() && i->GetSource()->IsAlive() && me->HasInArc(diff/20000.f*float(M_PI)*2.f, i->GetSource()) && me->IsWithinDist(i->GetSource(), SPOUT_DIST) && !i->GetSource()->IsInWater())
@@ -295,7 +302,9 @@ public:
if (RotTimer <= diff)
{
RotTimer = 0;
- } else RotTimer -= diff;
+ }
+ else
+ RotTimer -= diff;
return;
}
@@ -307,7 +316,9 @@ public:
if (target)
DoCast(target, SPELL_GEYSER, true);
GeyserTimer = rand32() % 5000 + 15000;
- } else GeyserTimer -= diff;
+ }
+ else
+ GeyserTimer -= diff;
if (!InRange) // if on players in melee range cast Waterbolt
{
@@ -319,7 +330,9 @@ public:
if (target)
DoCast(target, SPELL_WATERBOLT, true);
WaterboltTimer = 3000;
- } else WaterboltTimer -= diff;
+ }
+ else
+ WaterboltTimer -= diff;
}
if (!UpdateVictim())
@@ -342,7 +355,9 @@ public:
SpoutTimer = 3000; // directly cast Spout after emerging!
PhaseTimer = 120000;
return;
- } else PhaseTimer-=diff;
+ }
+ else
+ PhaseTimer -= diff;
if (!me->IsThreatened()) // check if should evade
{
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
index 590ec8ad523..a86f3c71c2b 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
@@ -24,13 +24,14 @@ EndScriptData */
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "Log.h"
#include "Map.h"
#include "Player.h"
#include "serpent_shrine.h"
#include "TemporarySummon.h"
-#include "GameObjectAI.h"
+#include <sstream>
#define MAX_ENCOUNTER 6
@@ -132,7 +133,7 @@ class instance_serpent_shrine : public InstanceMapScript
else
Water = WATERSTATE_FRENZY;
- Map::PlayerList const &PlayerList = instance->GetPlayers();
+ Map::PlayerList const& PlayerList = instance->GetPlayers();
if (PlayerList.isEmpty())
return;
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
@@ -143,12 +144,11 @@ class instance_serpent_shrine : public InstanceMapScript
{
if (Water == WATERSTATE_SCALDING)
{
-
if (!player->HasAura(SPELL_SCALDINGWATER))
- {
player->CastSpell(player, SPELL_SCALDINGWATER, true);
- }
- } else if (Water == WATERSTATE_FRENZY)
+
+ }
+ else if (Water == WATERSTATE_FRENZY)
{
//spawn frenzy
if (DoSpawnFrenzy)
@@ -392,7 +392,7 @@ class instance_serpent_shrine : public InstanceMapScript
return stream.str();
}
- void Load(const char* in) override
+ void Load(char const* in) override
{
if (!in)
{
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
index 6db0f751512..78e92d7b4f1 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
@@ -149,7 +149,7 @@ public:
Talk(SAY_SLAY);
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
//hack :(
if (spell->Id == SPELL_WARLORDS_RAGE_PROC)
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h
index 22846f6ac82..b153df14d6c 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h
@@ -51,7 +51,7 @@ enum SVGameObjectIds
GO_ACCESS_PANEL_MEK = 184126
};
-template<class AI, class T>
+template <class AI, class T>
inline AI* GetSteamVaultAI(T* obj)
{
return GetInstanceAI<AI>(obj, SteamVaultScriptName);
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp
index b668c1a7989..ce777aa67c7 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp
@@ -18,6 +18,7 @@
#include "ScriptMgr.h"
#include "CreatureTextMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "Group.h"
#include "InstanceScript.h"
#include "LFGMgr.h"
@@ -25,9 +26,8 @@
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
-#include "ScriptedGossip.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
+#include "ScriptedGossip.h"
#include "SpellAuraEffects.h"
#include "SpellInfo.h"
#include "SpellScript.h"
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h
index 398225c4d01..0f0e877425e 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h
@@ -68,7 +68,7 @@ enum SPGameObjectIds
GO_ICE_STONE = 187882
};
-template<class AI, class T>
+template <class AI, class T>
inline AI* GetSlavePensAI(T* obj)
{
return GetInstanceAI<AI>(obj, SPScriptName);
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/the_underbog.h b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/the_underbog.h
index c32c7a05f30..a671d1c5fd0 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/the_underbog.h
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/the_underbog.h
@@ -22,10 +22,10 @@
#define TheUndebogScriptName "instance_the_underbog"
-template<typename AI>
-inline AI* GetTheUnderbogAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetTheUnderbogAI(T* obj)
{
- return GetInstanceAI<AI>(creature, TheUndebogScriptName);
+ return GetInstanceAI<AI>(obj, TheUndebogScriptName);
}
#endif // the_underbog_h__
diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
index fa8a6e81b2b..038dc187265 100644
--- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
+++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
@@ -122,7 +122,7 @@ class boss_gruul : public CreatureScript
Talk(SAY_DEATH);
}
- void SpellHitTarget(Unit* target, const SpellInfo* pSpell) override
+ void SpellHitTarget(Unit* target, SpellInfo const* pSpell) override
{
//This to emulate effect1 (77) of SPELL_GROUND_SLAM, knock back to any direction
//It's initially wrong, since this will cause fall damage, which is by comments, not intended.
diff --git a/src/server/scripts/Outland/GruulsLair/gruuls_lair.h b/src/server/scripts/Outland/GruulsLair/gruuls_lair.h
index abd1fa9aceb..c7939dadc70 100644
--- a/src/server/scripts/Outland/GruulsLair/gruuls_lair.h
+++ b/src/server/scripts/Outland/GruulsLair/gruuls_lair.h
@@ -47,10 +47,10 @@ enum GLGameObjectIds
GO_GRUUL_DOOR = 184662
};
-template<typename AI>
-inline AI* GetGruulsLairAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetGruulsLairAI(T* obj)
{
- return GetInstanceAI<AI>(creature, GLScriptName);
+ return GetInstanceAI<AI>(obj, GLScriptName);
}
#endif // GRUULS_LAIR_H_
diff --git a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
index b413d805e0f..60a2cb6d34d 100644
--- a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
+++ b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
@@ -17,7 +17,6 @@
#include "ScriptMgr.h"
#include "Creature.h"
-#include "GameObject.h"
#include "gruuls_lair.h"
#include "InstanceScript.h"
@@ -55,6 +54,8 @@ class instance_gruuls_lair : public InstanceMapScript
void OnCreatureCreate(Creature* creature) override
{
+ InstanceScript::OnCreatureCreate(creature);
+
switch (creature->GetEntry())
{
case NPC_MAULGAR:
@@ -71,48 +72,6 @@ class instance_gruuls_lair : public InstanceMapScript
}
}
- void OnCreatureRemove(Creature* creature) override
- {
- switch (creature->GetEntry())
- {
- case NPC_MAULGAR:
- case NPC_KROSH_FIREHAND:
- case NPC_OLM_THE_SUMMONER:
- case NPC_KIGGLER_THE_CRAZED:
- case NPC_BLINDEYE_THE_SEER:
- AddMinion(creature, false);
- break;
- default:
- break;
- }
- }
-
- void OnGameObjectCreate(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_MAULGAR_DOOR:
- case GO_GRUUL_DOOR:
- AddDoor(go, true);
- break;
- default:
- break;
- }
- }
-
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_MAULGAR_DOOR:
- case GO_GRUUL_DOOR:
- AddDoor(go, false);
- break;
- default:
- break;
- }
- }
-
ObjectGuid GetGuidData(uint32 type) const override
{
switch (type)
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
index e3fd9704a0b..63c4bef65f2 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
@@ -82,7 +82,7 @@ enum BFActionIds
ACTION_PREPARE_BROGGOK = 3
};
-template<class AI, class T>
+template <class AI, class T>
inline AI* GetBloodFurnaceAI(T* obj)
{
return GetInstanceAI<AI>(obj, BFScriptName);
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
index 9a92c30ecc7..b5cac8fbcd7 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
@@ -18,12 +18,11 @@
#include "ScriptMgr.h"
#include "blood_furnace.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "SpellAuraEffects.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
enum Yells
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
index ebe2a9ebe09..452ce7bd2f1 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
@@ -17,13 +17,10 @@
#include "ScriptMgr.h"
#include "blood_furnace.h"
-#include "Map.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "Spell.h"
#include "SpellAuras.h"
-#include "SpellMgr.h"
-#include "SpellInfo.h"
#include "TemporarySummon.h"
enum Kelidan
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
index 014c4086716..6a5c804d41d 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
@@ -17,11 +17,10 @@
#include "ScriptMgr.h"
#include "blood_furnace.h"
-#include "Creature.h"
-#include "CreatureAI.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
+#include "ScriptedCreature.h"
DoorData const doorData[] =
{
@@ -82,6 +81,8 @@ class instance_blood_furnace : public InstanceMapScript
void OnGameObjectCreate(GameObject* go) override
{
+ InstanceScript::OnGameObjectCreate(go);
+
switch (go->GetEntry())
{
case GO_PRISON_DOOR_04:
@@ -126,23 +127,6 @@ class instance_blood_furnace : public InstanceMapScript
}
}
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_PRISON_DOOR_01:
- case GO_PRISON_DOOR_02:
- case GO_PRISON_DOOR_03:
- case GO_PRISON_DOOR_04:
- case GO_PRISON_DOOR_05:
- case GO_SUMMON_DOOR:
- AddDoor(go, false);
- break;
- default:
- break;
- }
- }
-
ObjectGuid GetGuidData(uint32 type) const override
{
switch (type)
diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp
index 5b2c6d1f6f8..ccec473f24d 100644
--- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp
@@ -110,7 +110,7 @@ class boss_nazan : public CreatureScript
}
}
- void SpellHitTarget(Unit* target, const SpellInfo* entry) override
+ void SpellHitTarget(Unit* target, SpellInfo const* entry) override
{
if (target && entry->Id == uint32(SPELL_FIREBALL))
me->SummonCreature(NPC_LIQUID_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 30000);
diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h
index 3329d011ca7..f3115b745c5 100644
--- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h
+++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h
@@ -48,10 +48,10 @@ enum HRGameobjectIds
GO_FEL_IRON_CHEST_HEROIC = 185169
};
-template<typename AI>
-inline AI* GetHellfireRampartsAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetHellfireRampartsAI(T* obj)
{
- return GetInstanceAI<AI>(creature, HRScriptName);
+ return GetInstanceAI<AI>(obj, HRScriptName);
}
#endif
diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
index bdafad65efa..2e7cf22c93c 100644
--- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
@@ -17,17 +17,15 @@
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "magtheridons_lair.h"
-#include "ObjectAccessor.h"
+#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "TemporarySummon.h"
#include "SpellScript.h"
-#include "SpellAuraEffects.h"
-#include "PassiveAI.h"
-#include "GameObjectAI.h"
enum Yells
{
@@ -460,7 +458,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_magtheridon_roomAI(creature);
+ return GetMagtheridonsLairAI<npc_magtheridon_roomAI>(creature);
}
};
@@ -488,7 +486,7 @@ public:
GameObjectAI* GetAI(GameObject* go) const override
{
- return new go_manticron_cubeAI(go);
+ return GetMagtheridonsLairAI<go_manticron_cubeAI>(go);
}
};
@@ -571,7 +569,11 @@ class spell_magtheridon_shadow_grasp_visual : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_SHADOW_CAGE, SPELL_SHADOW_GRASP_VISUAL });
+ return ValidateSpellInfo(
+ {
+ SPELL_SHADOW_CAGE,
+ SPELL_SHADOW_GRASP_VISUAL
+ });
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
index 233e72b0ad2..0a538face5c 100644
--- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
@@ -15,14 +15,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "AreaBoundary.h"
#include "ScriptMgr.h"
-#include "Creature.h"
-#include "CreatureAI.h"
+#include "AreaBoundary.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "magtheridons_lair.h"
#include "Map.h"
+#include "ScriptedCreature.h"
BossBoundaryData const boundaries =
{
@@ -68,7 +67,7 @@ static MLDataTypes const collapseObjectDatas[] =
class instance_magtheridons_lair : public InstanceMapScript
{
public:
- instance_magtheridons_lair() : InstanceMapScript("instance_magtheridons_lair", 544) { }
+ instance_magtheridons_lair() : InstanceMapScript(MLScriptName, 544) { }
struct instance_magtheridons_lair_InstanceMapScript : public InstanceScript
{
diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h
index 87190d446b0..cd0b441fada 100644
--- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h
+++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h
@@ -18,9 +18,9 @@
#ifndef DEF_MAGTHERIDONS_LAIR_H
#define DEF_MAGTHERIDONS_LAIR_H
-#define MLScriptName "instance_magtheridons_lair"
#include "CreatureAIImpl.h"
+#define MLScriptName "instance_magtheridons_lair"
#define DataHeader "ML"
uint32 const EncounterCount = 1;
@@ -74,10 +74,10 @@ enum MLGameObjectIds
GO_MAGTHERIDON_COLUMN_5 = 184637
};
-template<typename AI>
-inline AI* GetMagtheridonsLairAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetMagtheridonsLairAI(T* obj)
{
- return GetInstanceAI<AI>(creature, MLScriptName);
+ return GetInstanceAI<AI>(obj, MLScriptName);
}
#endif
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
index 27149503712..514300e96af 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
@@ -23,15 +23,14 @@ SDCategory: Hellfire Citadel, Shattered Halls
EndScriptData */
#include "ScriptMgr.h"
-#include "Creature.h"
-#include "CreatureAI.h"
-#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
#include "Player.h"
+#include "ScriptedCreature.h"
#include "shattered_halls.h"
#include "SpellAuras.h"
#include "TemporarySummon.h"
+#include <sstream>
DoorData const doorData[] =
{
@@ -93,35 +92,11 @@ class instance_shattered_halls : public InstanceMapScript
ex->SetDuration(executionTimer);
}
- void OnGameObjectCreate(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_GRAND_WARLOCK_CHAMBER_DOOR_1:
- case GO_GRAND_WARLOCK_CHAMBER_DOOR_2:
- AddDoor(go, true);
- default:
- break;
- }
- }
-
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_GRAND_WARLOCK_CHAMBER_DOOR_1:
- case GO_GRAND_WARLOCK_CHAMBER_DOOR_2:
- AddDoor(go, false);
- default:
- break;
- }
- }
-
void OnCreatureCreate(Creature* creature) override
{
if (!_team)
{
- Map::PlayerList const &players = instance->GetPlayers();
+ Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (Player* player = players.begin()->GetSource())
_team = player->GetTeam();
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.cpp
index 800a1149115..63503c6bbe6 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.cpp
@@ -21,8 +21,8 @@
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
-#include "SpellScript.h"
#include "shattered_halls.h"
+#include "SpellScript.h"
#include "TemporarySummon.h"
class at_nethekurse_exit : public AreaTriggerScript
@@ -110,7 +110,7 @@ class boss_shattered_executioner : public CreatureScript
if (instance->GetData(DATA_PRISONERS_EXECUTED) > 0)
return;
- Map::PlayerList const &players = instance->instance->GetPlayers();
+ Map::PlayerList const& players = instance->instance->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
Player* pl = itr->GetSource();
@@ -129,7 +129,7 @@ class boss_shattered_executioner : public CreatureScript
if (data == 1)
{
- Map::PlayerList const &players = instance->instance->GetPlayers();
+ Map::PlayerList const& players = instance->instance->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
Player* pl = itr->GetSource();
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h
index 008692222e2..b1ec4de98c4 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h
@@ -91,11 +91,11 @@ enum SHActions
ACTION_EXECUTIONER_TAUNT = 1
};
-const Position Executioner = { 152.8524f, -83.63912f, 2.021005f, 0.06981317f };
+Position const Executioner = { 152.8524f, -83.63912f, 2.021005f, 0.06981317f };
struct FactionSpawnerHelper
{
- FactionSpawnerHelper(uint32 allianceEntry, uint32 hordeEntry, const Position& pos) : _allianceNPC(allianceEntry), _hordeNPC(hordeEntry), _spawnPos(pos) { }
+ FactionSpawnerHelper(uint32 allianceEntry, uint32 hordeEntry, Position const& pos) : _allianceNPC(allianceEntry), _hordeNPC(hordeEntry), _spawnPos(pos) { }
inline uint32 operator()(uint32 teamID) const { return teamID == ALLIANCE ? _allianceNPC : _hordeNPC; }
inline Position const& GetPos() const { return _spawnPos; }
@@ -106,17 +106,17 @@ private:
Position const _spawnPos;
};
-const FactionSpawnerHelper executionerVictims[VictimCount] =
+FactionSpawnerHelper const executionerVictims[VictimCount] =
{
{ NPC_CAPTAIN_ALINA, NPC_CAPTAIN_BONESHATTER, { 138.8807f, -84.22707f, 1.992269f, 0.06981317f } },
{ NPC_ALLIANCE_VICTIM_1, NPC_HORDE_VICTIM_1, { 151.2411f, -91.02930f, 2.019741f, 1.57079600f } },
{ NPC_ALLIANCE_VICTIM_2, NPC_HORDE_VICTIM_2, { 151.0459f, -77.51981f, 2.021008f, 4.74729500f } }
};
-template<typename AI>
-inline AI* GetShatteredHallsAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetShatteredHallsAI(T* obj)
{
- return GetInstanceAI<AI>(creature, SHScriptName);
+ return GetInstanceAI<AI>(obj, SHScriptName);
}
#endif
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
index 60343d6be1c..f9ea0cef899 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
@@ -188,13 +188,13 @@ class boss_alar : public CreatureScript
}
}
- void SpellHit(Unit*, const SpellInfo* spell) override
+ void SpellHit(Unit*, SpellInfo const* spell) override
{
if (spell->Id == SPELL_DIVE_BOMB_VISUAL)
{
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
me->SetDisplayId(11686);
- //me->SendUpdateObjectToAllExcept(NULL);
+ //me->SendUpdateObjectToAllExcept(nullptr);
}
}
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
index 7bd397539f0..1e1129b2f7f 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
@@ -28,7 +28,6 @@ EndScriptData */
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "SpellAuras.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
#include "the_eye.h"
@@ -292,7 +291,7 @@ class boss_high_astromancer_solarian : public CreatureScript
//After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind.
me->GetMotionMaster()->Clear();
me->UpdatePosition(CENTER_X, CENTER_Y, CENTER_Z, CENTER_O);
- for (uint8 i=0; i <= 2; ++i)
+ for (uint8 i = 0; i <= 2; ++i)
{
if (!i)
{
@@ -309,15 +308,15 @@ class boss_high_astromancer_solarian : public CreatureScript
}
if ((std::abs(Portals[2][0] - Portals[1][0]) < 7) && (std::abs(Portals[2][1] - Portals[1][1]) < 7))
{
- int i=1;
+ int i = 1;
if (std::abs(CENTER_X + 26.0f - Portals[2][0]) < 7)
i = -1;
- Portals[2][0] = Portals[2][0]+7*i;
+ Portals[2][0] = Portals[2][0] + 7 * i;
Portals[2][1] = Portal_Y(Portals[2][0], LARGE_PORTAL_RADIUS);
}
- for (int i=0; i <= 2; ++i)
+ for (int i = 0; i <= 2; ++i)
{
- if (Creature* Summoned = me->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer+Phase3_Timer+AppearDelay_Timer+1700))
+ if (Creature* Summoned = me->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer + Phase3_Timer + AppearDelay_Timer + 1700))
{
Summoned->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
Summoned->CastSpell(Summoned, SPELL_SPOTLIGHT, false);
@@ -326,7 +325,7 @@ class boss_high_astromancer_solarian : public CreatureScript
AppearDelay = true;
}
else
- Phase1_Timer-=diff;
+ Phase1_Timer -= diff;
}
else if (Phase == 2)
{
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp
index 86ae7f1a454..dcd2df56c41 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp
@@ -106,13 +106,13 @@ class instance_the_eye : public InstanceMapScript
{
switch (identifier)
{
- case DATA_THALADREDTHEDARKENER: return ThaladredTheDarkener;
- case DATA_LORDSANGUINAR: return LordSanguinar;
- case DATA_GRANDASTROMANCERCAPERNIAN: return GrandAstromancerCapernian;
- case DATA_MASTERENGINEERTELONICUS: return MasterEngineerTelonicus;
- case DATA_KAELTHAS: return Kaelthas;
- case DATA_HIGH_ASTROMANCER_SOLARIAN: return Astromancer;
- case DATA_ALAR: return Alar;
+ case DATA_THALADREDTHEDARKENER: return ThaladredTheDarkener;
+ case DATA_LORDSANGUINAR: return LordSanguinar;
+ case DATA_GRANDASTROMANCERCAPERNIAN: return GrandAstromancerCapernian;
+ case DATA_MASTERENGINEERTELONICUS: return MasterEngineerTelonicus;
+ case DATA_KAELTHAS: return Kaelthas;
+ case DATA_HIGH_ASTROMANCER_SOLARIAN: return Astromancer;
+ case DATA_ALAR: return Alar;
}
return ObjectGuid::Empty;
}
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp
index 9dd6bc36fb9..7d1a4c484fd 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp
@@ -104,7 +104,7 @@ class npc_crystalcore_devastator : public CreatureScript
CreatureAI* GetAI(Creature* creature) const override
{
- return new npc_crystalcore_devastatorAI(creature);
+ return GetTheEyeAI<npc_crystalcore_devastatorAI>(creature);
}
};
void AddSC_the_eye()
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h
index 9eb9e5af0e5..f65b6714248 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h
+++ b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h
@@ -65,10 +65,10 @@ enum TEGameObjectIds
GO_ARCANE_DOOR_RIGHT = 184325
};
-template<typename AI>
-inline AI* GetTheEyeAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetTheEyeAI(T* obj)
{
- return GetInstanceAI<AI>(creature, TheEyeScriptName);
+ return GetInstanceAI<AI>(obj, TheEyeScriptName);
}
#endif
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp
index aae21c154b2..c1b6020c8e6 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp
@@ -24,8 +24,8 @@ static DoorData const doorData[] =
{
{ GO_DOOR_MOARG_1, DATA_GATEWATCHER_IRON_HAND, DOOR_TYPE_PASSAGE },
{ GO_DOOR_MOARG_2, DATA_GATEWATCHER_GYROKILL, DOOR_TYPE_PASSAGE },
- { GO_DOOR_NETHERMANCER, DATA_NETHERMANCER_SEPRETHREA, DOOR_TYPE_ROOM },
- { 0, 0, DOOR_TYPE_ROOM }
+ { GO_DOOR_NETHERMANCER, DATA_NETHERMANCER_SEPRETHREA, DOOR_TYPE_ROOM },
+ { 0, 0, DOOR_TYPE_ROOM }
};
class instance_mechanar : public InstanceMapScript
@@ -42,34 +42,6 @@ class instance_mechanar : public InstanceMapScript
LoadDoorData(doorData);
}
- void OnGameObjectCreate(GameObject* gameObject) override
- {
- switch (gameObject->GetEntry())
- {
- case GO_DOOR_MOARG_1:
- case GO_DOOR_MOARG_2:
- case GO_DOOR_NETHERMANCER:
- AddDoor(gameObject, true);
- break;
- default:
- break;
- }
- }
-
- void OnGameObjectRemove(GameObject* gameObject) override
- {
- switch (gameObject->GetEntry())
- {
- case GO_DOOR_MOARG_1:
- case GO_DOOR_MOARG_2:
- case GO_DOOR_NETHERMANCER:
- AddDoor(gameObject, false);
- break;
- default:
- break;
- }
- }
-
bool SetBossState(uint32 type, EncounterState state) override
{
if (!InstanceScript::SetBossState(type, state))
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h b/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h
index a9e82e2402b..beca8bd3849 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h
@@ -41,10 +41,10 @@ enum MRGameobjectIds
GO_DOOR_NETHERMANCER = 184449
};
-template<typename AI>
-inline AI* GetMechanarAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetMechanarAI(T* obj)
{
- return GetInstanceAI<AI>(creature, MechanarScriptName);
+ return GetInstanceAI<AI>(obj, MechanarScriptName);
}
#endif
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h
index fecbdd46d6e..efccf5a958d 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h
@@ -64,10 +64,10 @@ enum AZGameObjectIds
GO_WARDENS_SHIELD = 184802 // shield 'protecting' mellichar
};
-template<typename AI>
-inline AI* GetArcatrazAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetArcatrazAI(T* obj)
{
- return GetInstanceAI<AI>(creature, ArcatrazScriptName);
+ return GetInstanceAI<AI>(obj, ArcatrazScriptName);
}
#endif // ARCATRAZ_H
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
index b3f075e943c..c37580351b6 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
@@ -66,12 +66,10 @@ class instance_arcatraz : public InstanceMapScript
void OnGameObjectCreate(GameObject* go) override
{
+ InstanceScript::OnGameObjectCreate(go);
+
switch (go->GetEntry())
{
- case GO_CONTAINMENT_CORE_SECURITY_FIELD_ALPHA:
- case GO_CONTAINMENT_CORE_SECURITY_FIELD_BETA:
- AddDoor(go, true);
- break;
case GO_STASIS_POD_ALPHA:
StasisPodGUIDs[0] = go->GetGUID();
break;
@@ -95,19 +93,6 @@ class instance_arcatraz : public InstanceMapScript
}
}
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_CONTAINMENT_CORE_SECURITY_FIELD_ALPHA:
- case GO_CONTAINMENT_CORE_SECURITY_FIELD_BETA:
- AddDoor(go, false);
- break;
- default:
- break;
- }
- }
-
void SetData(uint32 type, uint32 data) override
{
switch (type)
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
index f1926cfd9f0..0665d3f3fb7 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
+++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
@@ -96,7 +96,6 @@ class npc_warp_splinter_treant : public CreatureScript
void MoveInLineOfSight(Unit* /*who*/) override { }
-
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim() || !me->GetVictim())
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h b/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h
index 07b6b56c971..4c8fb6ae0d5 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h
+++ b/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h
@@ -43,10 +43,10 @@ enum BCCreatureIds
NPC_WARP_SPLINTER = 17977
};
-template<typename AI>
-inline AI* GetBotanicaAI(Creature* creature)
+template <class AI, class T>
+inline AI* GetBotanicaAI(T* obj)
{
- return GetInstanceAI<AI>(creature, BotanicaScriptName);
+ return GetInstanceAI<AI>(obj, BotanicaScriptName);
}
#endif
diff --git a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp
index 9d1326ede7e..a34b659f2d3 100644
--- a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp
+++ b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp
@@ -31,13 +31,11 @@ EndContentData */
#include "ScriptMgr.h"
#include "CellImpl.h"
#include "CreatureAIImpl.h"
-#include "GameObject.h"
+#include "GameObjectAI.h"
#include "GridNotifiersImpl.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
-#include "Player.h"
#include "ScriptedCreature.h"
-#include "GameObjectAI.h"
#include "ScriptedGossip.h"
#include "SpellInfo.h"
#include "SpellScript.h"
@@ -126,7 +124,7 @@ public:
me->DespawnOrUnsummon(1);
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER)
{
@@ -843,7 +841,7 @@ class npc_simon_bunny : public CreatureScript
}
}
- void SpellHitTarget(Unit* target, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
// Cast SPELL_BAD_PRESS_DAMAGE with scaled basepoints when the visual hits the target.
// Need Fix: When SPELL_BAD_PRESS_TRIGGER hits target it triggers spell SPELL_BAD_PRESS_DAMAGE by itself
diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
index efda058ca6a..90391331d33 100644
--- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
+++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
@@ -34,7 +34,6 @@ EndContentData */
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
-#include "QuestDef.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
diff --git a/src/server/scripts/Outland/zone_nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp
index b4572ce22f7..22bf85cca64 100644
--- a/src/server/scripts/Outland/zone_nagrand.cpp
+++ b/src/server/scripts/Outland/zone_nagrand.cpp
@@ -29,10 +29,9 @@ EndContentData */
#include "ScriptMgr.h"
#include "GameObject.h"
-#include "MotionMaster.h"
#include "GameObjectAI.h"
+#include "MotionMaster.h"
#include "Player.h"
-#include "QuestDef.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "SpellInfo.h"
@@ -144,7 +143,7 @@ public:
}
- void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_CHAIN_LIGHTNING)
{
@@ -517,7 +516,7 @@ public:
summoned->AI()->AttackStart(me);
}
- void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell) override
+ void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_KUR_CHAIN_LIGHTNING)
{
diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp
index 1b7287a7d20..76f8e1d5959 100644
--- a/src/server/scripts/Outland/zone_netherstorm.cpp
+++ b/src/server/scripts/Outland/zone_netherstorm.cpp
@@ -31,11 +31,10 @@ EndContentData */
#include "ScriptMgr.h"
#include "GameObject.h"
+#include "GameObjectAI.h"
#include "Log.h"
#include "ObjectAccessor.h"
-#include "GameObjectAI.h"
#include "Player.h"
-#include "QuestDef.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
@@ -318,7 +317,7 @@ class at_commander_dawnforge : public AreaTriggerScript
public:
at_commander_dawnforge() : AreaTriggerScript("at_commander_dawnforge") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*areaTrigger*/, bool /*entered*/) override
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/, bool /*entered*/) override
{
//if player lost aura or not have at all, we should not try start event.
if (!player->HasAura(SPELL_SUNFURY_DISGUISE))
@@ -409,7 +408,7 @@ public:
PlayerGUID = who->GetGUID();
}
- //void SpellHit(Unit* /*caster*/, const SpellInfo* /*spell*/) override
+ //void SpellHit(Unit* /*caster*/, SpellInfo const* /*spell*/) override
//{
// DoCast(me, SPELL_DE_MATERIALIZE);
//}
@@ -607,7 +606,7 @@ public:
// take the GO -> animation
me->HandleEmoteCommand(EMOTE_STATE_LOOT);
SetEscortPaused(true);
- bTake=true;
+ bTake = true;
}
break;
case 36: //return and quest_complete
@@ -634,7 +633,7 @@ public:
if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_DRAENEI_MACHINE, INTERACTION_DISTANCE))
{
SetEscortPaused(false);
- bTake=false;
+ bTake = false;
uiTakeTimer = 3000;
go->Delete();
}
diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
index a286e2f7ec5..fb702cb6a42 100644
--- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
+++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
@@ -42,7 +42,6 @@ EndContentData */
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
-#include "QuestDef.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "SpellInfo.h"
@@ -163,7 +162,7 @@ public:
caster->AI()->SetData(TYPE_INFERNAL, DATA_DIED);
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_SUMMON_INFERNAL)
{
@@ -383,7 +382,7 @@ public:
me->SetDisableGravity(false);
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (!caster)
return;
@@ -510,7 +509,7 @@ public:
Initialize();
}
- void SpellHit(Unit* caster, const SpellInfo* spell) override
+ void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (!caster)
return;
@@ -1561,7 +1560,7 @@ public:
}
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_WHISTLE)
{
diff --git a/src/server/scripts/Pet/pet_dk.cpp b/src/server/scripts/Pet/pet_dk.cpp
index 767492c2b77..1dbdf9aabcc 100644
--- a/src/server/scripts/Pet/pet_dk.cpp
+++ b/src/server/scripts/Pet/pet_dk.cpp
@@ -26,7 +26,6 @@
#include "GridNotifiersImpl.h"
#include "MotionMaster.h"
#include "ScriptedCreature.h"
-#include "SpellInfo.h"
enum DeathKnightSpells
{
diff --git a/src/server/scripts/Pet/pet_mage.cpp b/src/server/scripts/Pet/pet_mage.cpp
index 04536ec32f3..42716b22dfa 100644
--- a/src/server/scripts/Pet/pet_mage.cpp
+++ b/src/server/scripts/Pet/pet_mage.cpp
@@ -27,7 +27,6 @@
#include "MotionMaster.h"
#include "Pet.h"
#include "PetAI.h"
-#include "Player.h"
#include "ScriptedCreature.h"
enum MageSpells
@@ -102,10 +101,10 @@ class npc_pet_mage_mirror_image : public CreatureScript
}
// Prioritize units with threat referenced to owner
if (highestThreat > 0.0f && highestThreatUnit)
- me->Attack(highestThreatUnit, false);
+ me->Attack(highestThreatUnit, false);
// If there is no such target, try to attack nearest hostile unit if such exists
else if (nearestPlayer)
- me->Attack(nearestPlayer, false);
+ me->Attack(nearestPlayer, false);
}
bool IsInThreatList(Unit* target)
diff --git a/src/server/scripts/ScriptPCH.h b/src/server/scripts/ScriptPCH.h
index 97132f44720..56d5c570636 100644
--- a/src/server/scripts/ScriptPCH.h
+++ b/src/server/scripts/ScriptPCH.h
@@ -1,3 +1,20 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
#include "CreatureAIImpl.h"
#include "InstanceScript.h"
#include "Map.h"
diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp
index 0c1ac135092..2556d465842 100644
--- a/src/server/scripts/Spells/spell_holiday.cpp
+++ b/src/server/scripts/Spells/spell_holiday.cpp
@@ -179,7 +179,11 @@ class spell_hallow_end_candy_pirate : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE, SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE });
+ return ValidateSpellInfo(
+ {
+ SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE,
+ SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE
+ });
}
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -350,7 +354,12 @@ class spell_hallow_end_tricky_treat : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/) override
{
- return ValidateSpellInfo({ SPELL_TRICKY_TREAT_SPEED, SPELL_TRICKY_TREAT_TRIGGER, SPELL_UPSET_TUMMY });
+ return ValidateSpellInfo(
+ {
+ SPELL_TRICKY_TREAT_SPEED,
+ SPELL_TRICKY_TREAT_TRIGGER,
+ SPELL_UPSET_TUMMY
+ });
}
void HandleScript(SpellEffIndex /*effIndex*/)
@@ -468,7 +477,7 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
private:
uint32 const _triggeredSpellId;
public:
- spell_pilgrims_bounty_buff_food(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
+ spell_pilgrims_bounty_buff_food(char const* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
class spell_pilgrims_bounty_buff_food_AuraScript : public AuraScript
{
@@ -668,17 +677,18 @@ class spell_pilgrims_bounty_well_fed : public SpellScriptLoader
uint32 _triggeredSpellId;
public:
- spell_pilgrims_bounty_well_fed(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
+ spell_pilgrims_bounty_well_fed(char const* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
class spell_pilgrims_bounty_well_fed_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pilgrims_bounty_well_fed_SpellScript);
- private:
+
uint32 _triggeredSpellId;
public:
spell_pilgrims_bounty_well_fed_SpellScript(uint32 triggeredSpellId) : SpellScript(), _triggeredSpellId(triggeredSpellId) { }
+ private:
bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ _triggeredSpellId });
@@ -773,13 +783,13 @@ class spell_pilgrims_bounty_on_plate : public SpellScriptLoader
uint32 _triggeredSpellId4;
public:
- spell_pilgrims_bounty_on_plate(const char* name, uint32 triggeredSpellId1, uint32 triggeredSpellId2, uint32 triggeredSpellId3, uint32 triggeredSpellId4) : SpellScriptLoader(name),
+ spell_pilgrims_bounty_on_plate(char const* name, uint32 triggeredSpellId1, uint32 triggeredSpellId2, uint32 triggeredSpellId3, uint32 triggeredSpellId4) : SpellScriptLoader(name),
_triggeredSpellId1(triggeredSpellId1), _triggeredSpellId2(triggeredSpellId2), _triggeredSpellId3(triggeredSpellId3), _triggeredSpellId4(triggeredSpellId4) { }
class spell_pilgrims_bounty_on_plate_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pilgrims_bounty_on_plate_SpellScript);
- private:
+
uint32 _triggeredSpellId1;
uint32 _triggeredSpellId2;
uint32 _triggeredSpellId3;
@@ -789,7 +799,8 @@ class spell_pilgrims_bounty_on_plate : public SpellScriptLoader
spell_pilgrims_bounty_on_plate_SpellScript(uint32 triggeredSpellId1, uint32 triggeredSpellId2, uint32 triggeredSpellId3, uint32 triggeredSpellId4) : SpellScript(),
_triggeredSpellId1(triggeredSpellId1), _triggeredSpellId2(triggeredSpellId2), _triggeredSpellId3(triggeredSpellId3), _triggeredSpellId4(triggeredSpellId4) { }
- bool Validate(SpellInfo const* /*spellInfo*/) override
+ private:
+ bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo(
{
@@ -892,19 +903,19 @@ class spell_pilgrims_bounty_a_serving_of : public SpellScriptLoader
private:
uint32 _triggeredSpellId;
public:
- spell_pilgrims_bounty_a_serving_of(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
+ spell_pilgrims_bounty_a_serving_of(char const* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
class spell_pilgrims_bounty_a_serving_of_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pilgrims_bounty_a_serving_of_AuraScript);
- private:
uint32 _triggeredSpellId;
public:
spell_pilgrims_bounty_a_serving_of_AuraScript(uint32 triggeredSpellId) : AuraScript(), _triggeredSpellId(triggeredSpellId) { }
- bool Validate(SpellInfo const* /*spellInfo*/) override
+ private:
+ bool Validate(SpellInfo const* /*spell*/) override
{
return ValidateSpellInfo({ _triggeredSpellId });
}
@@ -1006,6 +1017,14 @@ enum PX238WinterWondervolt
SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_4 = 26274
};
+uint32 const WonderboltTransformSpells[] =
+{
+ SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_1,
+ SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_2,
+ SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_3,
+ SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_4
+};
+
class spell_winter_veil_px_238_winter_wondervolt : public SpellScriptLoader
{
public:
@@ -1017,34 +1036,20 @@ class spell_winter_veil_px_238_winter_wondervolt : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_1,
- SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_2,
- SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_3,
- SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_4
- });
+ return ValidateSpellInfo(WonderboltTransformSpells);
}
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
- uint32 const spells[4] =
- {
- SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_1,
- SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_2,
- SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_3,
- SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_4
- };
-
if (Unit* target = GetHitUnit())
{
- for (uint8 i = 0; i < 4; ++i)
- if (target->HasAura(spells[i]))
+ for (uint32 spell : WonderboltTransformSpells)
+ if (target->HasAura(spell))
return;
- target->CastSpell(target, spells[urand(0, 3)], true);
+ target->CastSpell(target, Trinity::Containers::SelectRandomContainerElement(WonderboltTransformSpells), true);
}
}
@@ -1552,7 +1557,12 @@ class spell_gen_ribbon_pole_dancer_check : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_HAS_FULL_MIDSUMMER_SET, SPELL_RIBBON_DANCE, SPELL_BURNING_HOT_POLE_DANCE });
+ return ValidateSpellInfo(
+ {
+ SPELL_HAS_FULL_MIDSUMMER_SET,
+ SPELL_RIBBON_DANCE,
+ SPELL_BURNING_HOT_POLE_DANCE
+ });
}
void PeriodicTick(AuraEffect const* /*aurEff*/)
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index bf39b8c83f0..61e551a055b 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -46,17 +46,18 @@ class spell_item_trigger_spell : public SpellScriptLoader
uint32 _triggeredSpellId;
public:
- spell_item_trigger_spell(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
+ spell_item_trigger_spell(char const* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
class spell_item_trigger_spell_SpellScript : public SpellScript
{
PrepareSpellScript(spell_item_trigger_spell_SpellScript);
- private:
+
uint32 _triggeredSpellId;
public:
spell_item_trigger_spell_SpellScript(uint32 triggeredSpellId) : SpellScript(), _triggeredSpellId(triggeredSpellId) { }
+ private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ _triggeredSpellId });
@@ -214,7 +215,7 @@ class spell_item_anger_capacitor : public SpellScriptLoader
caster->RemoveAurasDueToSpell(SPELL_MOTE_OF_ANGER);
uint32 spellId = SPELL_MANIFEST_ANGER_MAIN_HAND;
if (Player* player = caster->ToPlayer())
- if (player->GetWeaponForAttack(OFF_ATTACK, true) && urand(0, 1))
+ if (player->GetWeaponForAttack(OFF_ATTACK, true) && roll_chance_i(50))
spellId = SPELL_MANIFEST_ANGER_OFF_HAND;
caster->CastSpell(target, spellId, true, nullptr, aurEff);
@@ -607,6 +608,7 @@ class spell_item_defibrillate : public SpellScriptLoader
public:
spell_item_defibrillate_SpellScript(uint8 chance, uint32 failSpell) : SpellScript(), _chance(chance), _failSpell(failSpell) { }
+ private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return !_failSpell || ValidateSpellInfo({ _failSpell });
@@ -627,7 +629,6 @@ class spell_item_defibrillate : public SpellScriptLoader
OnEffectHitTarget += SpellEffectFn(spell_item_defibrillate_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_RESURRECT);
}
- private:
uint8 _chance;
uint32 _failSpell;
};
@@ -2982,7 +2983,11 @@ class spell_item_shard_of_the_scale : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ HealProc, DamageProc });
+ return ValidateSpellInfo(
+ {
+ HealProc,
+ DamageProc
+ });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
@@ -3106,14 +3111,9 @@ class spell_item_sunwell_neck : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- if (!sFactionStore.LookupEntry(FACTION_ALDOR) ||
- !sFactionStore.LookupEntry(FACTION_SCRYERS))
- return false;
- return ValidateSpellInfo(
- {
- Aldors,
- Scryers
- });
+ return ValidateSpellInfo({ Aldors, Scryers }) &&
+ sFactionStore.LookupEntry(FACTION_ALDOR) &&
+ sFactionStore.LookupEntry(FACTION_SCRYERS);
}
bool CheckProc(ProcEventInfo& eventInfo)
@@ -3271,6 +3271,7 @@ public:
{
}
+ private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ _stackSpell, _triggerSpell });
@@ -3301,7 +3302,6 @@ public:
OnEffectProc += AuraEffectProcFn(spell_item_trinket_stack_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
- private:
uint32 _stackSpell;
uint32 _triggerSpell;
};
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 75e873604c4..43ae326ade2 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -89,15 +89,8 @@ class spell_pal_ardent_defender : public SpellScriptLoader
{
PrepareAuraScript(spell_pal_ardent_defender_AuraScript);
- public:
- spell_pal_ardent_defender_AuraScript()
- {
- absorbPct = 0;
- healPct = 0;
- }
-
- private:
- uint32 absorbPct, healPct;
+ uint32 _absorbPct = 0;
+ uint32 _healPct = 0;
enum Spell
{
@@ -106,15 +99,13 @@ class spell_pal_ardent_defender : public SpellScriptLoader
bool Validate(SpellInfo const* spellInfo) override
{
- if (!sSpellMgr->GetSpellInfo(PAL_SPELL_ARDENT_DEFENDER_HEAL))
- return false;
- return true;
+ return ValidateSpellInfo({ PAL_SPELL_ARDENT_DEFENDER_HEAL });
}
bool Load() override
{
- healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
- absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
+ _absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
+ _healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
}
@@ -124,7 +115,7 @@ class spell_pal_ardent_defender : public SpellScriptLoader
amount = -1;
}
- void Absorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
+ void Absorb(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount)
{
Unit* victim = GetTarget();
int32 remainingHealth = victim->GetHealth() - dmgInfo.GetDamage();
@@ -135,15 +126,13 @@ class spell_pal_ardent_defender : public SpellScriptLoader
// Cast healing spell, completely avoid damage
absorbAmount = dmgInfo.GetDamage();
- uint32 defenseSkillValue = victim->GetDefenseSkillValue();
+ float defenseSkillValue = victim->GetDefenseSkillValue();
// Max heal when defense skill denies critical hits from raid bosses
// Formula: max defense at level + 140 (raiting from gear)
- uint32 reqDefForMaxHeal = victim->getLevel() * 5 + 140;
- float pctFromDefense = (defenseSkillValue >= reqDefForMaxHeal)
- ? 1.0f
- : float(defenseSkillValue) / float(reqDefForMaxHeal);
+ float reqDefForMaxHeal = victim->GetMaxSkillValueForLevel() + 140.0f;
+ float defenseFactor = std::min(1.0f, defenseSkillValue / reqDefForMaxHeal);
- int32 healAmount = int32(victim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense)));
+ int32 healAmount = int32(victim->CountPctFromMaxHealth(static_cast<uint32>(lroundf(_healPct * defenseFactor))));
victim->CastCustomSpell(victim, PAL_SPELL_ARDENT_DEFENDER_HEAL, &healAmount, nullptr, nullptr, true, nullptr, aurEff);
victim->ToPlayer()->AddSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, time(nullptr) + 120);
}
@@ -153,7 +142,7 @@ class spell_pal_ardent_defender : public SpellScriptLoader
uint32 damageToReduce = (victim->GetHealth() < allowedHealth)
? dmgInfo.GetDamage()
: allowedHealth - remainingHealth;
- absorbAmount = CalculatePct(damageToReduce, absorbPct);
+ absorbAmount = CalculatePct(damageToReduce, _absorbPct);
}
}
@@ -253,7 +242,11 @@ class spell_pal_avenging_wrath : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_PALADIN_SANCTIFIED_WRATH, SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1 });
+ return ValidateSpellInfo(
+ {
+ SPELL_PALADIN_SANCTIFIED_WRATH,
+ SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1
+ });
}
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -870,7 +863,11 @@ class spell_pal_item_t6_trinket : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_PALADIN_ENDURING_LIGHT, SPELL_PALADIN_ENDURING_JUDGEMENT });
+ return ValidateSpellInfo(
+ {
+ SPELL_PALADIN_ENDURING_LIGHT,
+ SPELL_PALADIN_ENDURING_JUDGEMENT
+ });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
@@ -925,6 +922,7 @@ class spell_pal_judgement : public SpellScriptLoader
{
PrepareSpellScript(spell_pal_judgement_SpellScript);
+ private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PALADIN_JUDGEMENT_DAMAGE });
diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp
index 0ff0ebde0e5..e8743fa35fc 100644
--- a/src/server/scripts/Spells/spell_pet.cpp
+++ b/src/server/scripts/Spells/spell_pet.cpp
@@ -1436,13 +1436,6 @@ public:
{
PrepareAuraScript(spell_dk_pet_scaling_01_AuraScript);
- public:
- spell_dk_pet_scaling_01_AuraScript()
- {
- _tempHealth = 0;
- }
-
- private:
bool Load() override
{
if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
@@ -1502,8 +1495,7 @@ public:
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling_01_AuraScript::CalculateStrengthAmount, EFFECT_1, SPELL_AURA_MOD_STAT);
}
- private:
- uint32 _tempHealth;
+ uint32 _tempHealth = 0;
};
AuraScript* GetAuraScript() const override
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index 6e663381abb..f4c9d83f36e 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -604,14 +604,7 @@ class spell_pri_guardian_spirit : public SpellScriptLoader
{
PrepareAuraScript(spell_pri_guardian_spirit_AuraScript);
- public:
- spell_pri_guardian_spirit_AuraScript()
- {
- healPct = 0;
- }
-
- private:
- uint32 healPct;
+ uint32 healPct = 0;
bool Validate(SpellInfo const* /*spellInfo*/) override
{
@@ -869,13 +862,6 @@ class spell_pri_mana_leech : public SpellScriptLoader
{
PrepareAuraScript(spell_pri_mana_leech_AuraScript);
- public:
- spell_pri_mana_leech_AuraScript()
- {
- _procTarget = nullptr;
- }
-
- private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PRIEST_MANA_LEECH_PROC });
@@ -899,8 +885,7 @@ class spell_pri_mana_leech : public SpellScriptLoader
OnEffectProc += AuraEffectProcFn(spell_pri_mana_leech_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
- private:
- Unit* _procTarget;
+ Unit* _procTarget = nullptr;
};
AuraScript* GetAuraScript() const override
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index ff4f58685c0..abf23c8da85 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -21,15 +21,15 @@
* Scriptnames of files in this file should be prefixed with "spell_q#questID_".
*/
+#include "ScriptMgr.h"
#include "CellImpl.h"
#include "CreatureAIImpl.h"
#include "CreatureTextMgr.h"
#include "GridNotifiersImpl.h"
#include "Player.h"
-#include "ScriptMgr.h"
#include "ScriptedCreature.h"
-#include "SpellScript.h"
#include "SpellAuraEffects.h"
+#include "SpellScript.h"
#include "Vehicle.h"
class spell_generic_quest_update_entry_SpellScript : public SpellScript
@@ -1047,13 +1047,7 @@ class spell_q14112_14145_chum_the_water: public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/) override
{
- return ValidateSpellInfo(
- {
- SUMMON_ANGRY_KVALDIR,
- SUMMON_NORTH_SEA_MAKO,
- SUMMON_NORTH_SEA_THRESHER,
- SUMMON_NORTH_SEA_BLUE_SHARK
- });
+ return ValidateSpellInfo({ SUMMON_ANGRY_KVALDIR, SUMMON_NORTH_SEA_MAKO, SUMMON_NORTH_SEA_THRESHER, SUMMON_NORTH_SEA_BLUE_SHARK });
}
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
@@ -1857,9 +1851,8 @@ class spell_q12847_summon_soul_moveto_bunny : public SpellScriptLoader
enum BearFlankMaster
{
- SPELL_BEAR_FLANK_MASTER = 56565,
SPELL_CREATE_BEAR_FLANK = 56566,
- SPELL_BEAR_FLANK_FAIL = 56569
+ SPELL_BEAR_FLANK_FAIL = 56569
};
class spell_q13011_bear_flank_master : public SpellScriptLoader
@@ -1873,7 +1866,11 @@ class spell_q13011_bear_flank_master : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_BEAR_FLANK_MASTER, SPELL_CREATE_BEAR_FLANK });
+ return ValidateSpellInfo(
+ {
+ SPELL_CREATE_BEAR_FLANK,
+ SPELL_BEAR_FLANK_FAIL
+ });
}
bool Load() override
@@ -1919,7 +1916,7 @@ class spell_q13086_cannons_target : public SpellScriptLoader
bool Validate(SpellInfo const* spellInfo) override
{
- return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0)->CalcValue()) });
+ return ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_0)->CalcValue()) });
}
void HandleEffectDummy(SpellEffIndex /*effIndex*/)
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index e4595f56f27..23b05309a3d 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -74,13 +74,6 @@ class spell_rog_blade_flurry : public SpellScriptLoader
{
PrepareAuraScript(spell_rog_blade_flurry_AuraScript);
- public:
- spell_rog_blade_flurry_AuraScript()
- {
- _procTarget = nullptr;
- }
-
- private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK });
@@ -112,8 +105,7 @@ class spell_rog_blade_flurry : public SpellScriptLoader
OnEffectProc += AuraEffectProcFn(spell_rog_blade_flurry_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_MOD_MELEE_HASTE);
}
- private:
- Unit* _procTarget;
+ Unit* _procTarget = nullptr;
};
AuraScript* GetAuraScript() const override
@@ -132,14 +124,7 @@ class spell_rog_cheat_death : public SpellScriptLoader
{
PrepareAuraScript(spell_rog_cheat_death_AuraScript);
- public:
- spell_rog_cheat_death_AuraScript()
- {
- absorbChance = 0;
- }
-
- private:
- uint32 absorbChance;
+ uint32 absorbChance = 0;
bool Validate(SpellInfo const* /*spellInfo*/) override
{
@@ -234,13 +219,6 @@ class spell_rog_deadly_poison : public SpellScriptLoader
{
PrepareSpellScript(spell_rog_deadly_poison_SpellScript);
- public:
- spell_rog_deadly_poison_SpellScript()
- {
- _stackAmount = 0;
- }
-
- private:
bool Load() override
{
// at this point CastItem must already be initialized
@@ -318,7 +296,7 @@ class spell_rog_deadly_poison : public SpellScriptLoader
AfterHit += SpellHitFn(spell_rog_deadly_poison_SpellScript::HandleAfterHit);
}
- uint8 _stackAmount;
+ uint8 _stackAmount = 0;
};
SpellScript* GetSpellScript() const override
@@ -765,16 +743,13 @@ class spell_rog_tricks_of_the_trade : public SpellScriptLoader
{
PrepareAuraScript(spell_rog_tricks_of_the_trade_AuraScript);
- public:
- spell_rog_tricks_of_the_trade_AuraScript()
- {
- _redirectTarget = nullptr;
- }
-
- private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST, SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC });
+ return ValidateSpellInfo(
+ {
+ SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST,
+ SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC
+ });
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -806,8 +781,7 @@ class spell_rog_tricks_of_the_trade : public SpellScriptLoader
OnEffectProc += AuraEffectProcFn(spell_rog_tricks_of_the_trade_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
}
- private:
- Unit* _redirectTarget;
+ Unit* _redirectTarget = nullptr;
};
AuraScript* GetAuraScript() const override
@@ -890,10 +864,7 @@ public:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo(
- {
- SPELL_ROGUE_HONOR_AMONG_THIEVES_ENERGIZE
- });
+ return ValidateSpellInfo({ SPELL_ROGUE_HONOR_AMONG_THIEVES_ENERGIZE });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index 54f2123b64b..5a3f44d8688 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -691,7 +691,11 @@ class spell_sha_item_t6_trinket : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_SHAMAN_ENERGY_SURGE, SPELL_SHAMAN_POWER_SURGE });
+ return ValidateSpellInfo(
+ {
+ SPELL_SHAMAN_ENERGY_SURGE,
+ SPELL_SHAMAN_POWER_SURGE
+ });
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index 3f59c6d2d7f..5f30a1399c0 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -1095,13 +1095,6 @@ class spell_warr_sweeping_strikes : public SpellScriptLoader
{
PrepareAuraScript(spell_warr_sweeping_strikes_AuraScript);
- public:
- spell_warr_sweeping_strikes_AuraScript()
- {
- _procTarget = nullptr;
- }
-
- private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2 });
@@ -1138,8 +1131,7 @@ class spell_warr_sweeping_strikes : public SpellScriptLoader
OnEffectProc += AuraEffectProcFn(spell_warr_sweeping_strikes_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
- private:
- Unit* _procTarget;
+ Unit* _procTarget = nullptr;
};
AuraScript* GetAuraScript() const override
@@ -1337,13 +1329,6 @@ class spell_warr_vigilance : public SpellScriptLoader
{
PrepareAuraScript(spell_warr_vigilance_AuraScript);
- public:
- spell_warr_vigilance_AuraScript()
- {
- _procTarget = nullptr;
- }
-
- private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARRIOR_VENGEANCE });
@@ -1388,8 +1373,7 @@ class spell_warr_vigilance : public SpellScriptLoader
OnEffectRemove += AuraEffectRemoveFn(spell_warr_vigilance_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
- private:
- Unit* _procTarget;
+ Unit* _procTarget = nullptr;
};
AuraScript* GetAuraScript() const override
diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp
index 698554344a1..c6839cdb836 100644
--- a/src/server/scripts/World/boss_emerald_dragons.cpp
+++ b/src/server/scripts/World/boss_emerald_dragons.cpp
@@ -769,7 +769,11 @@ class spell_mark_of_nature : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_MARK_OF_NATURE, SPELL_AURA_OF_NATURE });
+ return ValidateSpellInfo(
+ {
+ SPELL_MARK_OF_NATURE,
+ SPELL_AURA_OF_NATURE
+ });
}
void FilterTargets(std::list<WorldObject*>& targets)
diff --git a/src/server/scripts/World/duel_reset.cpp b/src/server/scripts/World/duel_reset.cpp
index 8abe6773416..58946c4475d 100644
--- a/src/server/scripts/World/duel_reset.cpp
+++ b/src/server/scripts/World/duel_reset.cpp
@@ -15,10 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "GameTime.h"
#include "ScriptMgr.h"
-#include "Player.h"
+#include "GameTime.h"
#include "Pet.h"
+#include "Player.h"
#include "SpellHistory.h"
#include "SpellInfo.h"
#include "SpellMgr.h"
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp
index 2635781f48c..dba64bed1cf 100644
--- a/src/server/scripts/World/go_scripts.cpp
+++ b/src/server/scripts/World/go_scripts.cpp
@@ -46,11 +46,11 @@ EndContentData */
#include "ScriptMgr.h"
#include "DB2Structure.h"
+#include "GameEventMgr.h"
#include "GameObject.h"
#include "GameObjectAI.h"
#include "GameTime.h"
#include "Log.h"
-#include "Map.h"
#include "MotionMaster.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -58,7 +58,6 @@ EndContentData */
#include "TemporarySummon.h"
#include "WorldSession.h"
#include "World.h"
-#include "GameEventMgr.h"
/*######
## go_cat_figurine
@@ -1696,7 +1695,7 @@ public:
break;
std::vector<Player*> playersNearby;
- me->GetPlayerListInGrid(playersNearby, me->GetMap()->GetVisibilityRange());
+ me->GetPlayerListInGrid(playersNearby, me->GetVisibilityRange());
for (Player* player : playersNearby)
{
if (player->GetTeamId() == TEAM_HORDE)
diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp
index 840161f8f9a..ca3b27140e4 100644
--- a/src/server/scripts/World/mob_generic_creature.cpp
+++ b/src/server/scripts/World/mob_generic_creature.cpp
@@ -36,7 +36,7 @@ public:
}
uint32 timer, interval;
- const SpellInfo* spell;
+ SpellInfo const* spell;
void UpdateAI(uint32 diff) override
{
diff --git a/src/server/scripts/World/npc_innkeeper.cpp b/src/server/scripts/World/npc_innkeeper.cpp
index f4e0f3b9361..b994d1a9ee4 100644
--- a/src/server/scripts/World/npc_innkeeper.cpp
+++ b/src/server/scripts/World/npc_innkeeper.cpp
@@ -57,7 +57,7 @@ public:
{
if (IsHolidayActive(HOLIDAY_HALLOWS_END) && !player->HasAura(SPELL_TRICK_OR_TREATED))
{
- const char* localizedEntry;
+ char const* localizedEntry;
switch (player->GetSession()->GetSessionDbcLocale())
{
case LOCALE_frFR: localizedEntry = LOCALE_TRICK_OR_TREAT_2; break;
@@ -76,7 +76,7 @@ public:
if (me->IsInnkeeper())
{
- const char* localizedEntry;
+ char const* localizedEntry;
switch (player->GetSession()->GetSessionDbcLocale())
{
case LOCALE_deDE: localizedEntry = LOCALE_INNKEEPER_3; break;
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 1d47dbe9785..d67f51796c5 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -17,14 +17,15 @@
#include "ScriptMgr.h"
#include "CellImpl.h"
-#include "CreatureTextMgr.h"
#include "CombatAI.h"
+#include "CreatureTextMgr.h"
#include "GameEventMgr.h"
#include "GameObject.h"
#include "GameObjectAI.h"
#include "GridNotifiersImpl.h"
#include "Log.h"
#include "MotionMaster.h"
+#include "MoveSplineInit.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "PassiveAI.h"
@@ -38,7 +39,6 @@
#include "SpellMgr.h"
#include "TemporarySummon.h"
#include "Vehicle.h"
-#include "MoveSplineInit.h"
/*########
# npc_air_force_bots
@@ -110,9 +110,9 @@ public:
SpawnedGUID.Clear();
// find the correct spawnhandling
- static uint32 entryCount = sizeof(spawnAssociations) / sizeof(SpawnAssociation);
+ static uint8 constexpr const EntryCount = uint8(std::extent<decltype(spawnAssociations)>::value);
- for (uint8 i = 0; i < entryCount; ++i)
+ for (uint8 i = 0; i < EntryCount; ++i)
{
if (spawnAssociations[i].thisCreatureEntry == creature->GetEntry())
{
diff --git a/src/server/shared/Dynamic/FactoryHolder.h b/src/server/shared/Dynamic/FactoryHolder.h
index 317d50ea9fc..c3d9901c1ef 100644
--- a/src/server/shared/Dynamic/FactoryHolder.h
+++ b/src/server/shared/Dynamic/FactoryHolder.h
@@ -19,8 +19,8 @@
#define TRINITY_FACTORY_HOLDER
#include "Define.h"
-#include "Dynamic/TypeList.h"
#include "ObjectRegistry.h"
+#include "TypeList.h"
/** FactoryHolder holds a factory object of a specific type
*/
diff --git a/src/server/shared/Dynamic/LinkedList.h b/src/server/shared/Dynamic/LinkedList.h
index a9bcb2ea98f..0e9e44a2da4 100644
--- a/src/server/shared/Dynamic/LinkedList.h
+++ b/src/server/shared/Dynamic/LinkedList.h
@@ -164,7 +164,7 @@ class LinkedListHead
{ // construct with node pointer _Pnode
}
- Iterator& operator=(const_pointer const &_Right)
+ Iterator& operator=(const_pointer const& _Right)
{
_Ptr = pointer(_Right);
return *this;
@@ -206,22 +206,22 @@ class LinkedListHead
return (_Tmp);
}
- bool operator==(Iterator const &_Right) const
+ bool operator==(Iterator const& _Right) const
{ // test for iterator equality
return (_Ptr == _Right._Ptr);
}
- bool operator!=(Iterator const &_Right) const
+ bool operator!=(Iterator const& _Right) const
{ // test for iterator inequality
return (!(*this == _Right));
}
- bool operator==(pointer const &_Right) const
+ bool operator==(pointer const& _Right) const
{ // test for pointer equality
return (_Ptr != _Right);
}
- bool operator!=(pointer const &_Right) const
+ bool operator!=(pointer const& _Right) const
{ // test for pointer equality
return (!(*this == _Right));
}
diff --git a/src/server/shared/Dynamic/ObjectRegistry.h b/src/server/shared/Dynamic/ObjectRegistry.h
index 973c34fda24..8e501db9eef 100644
--- a/src/server/shared/Dynamic/ObjectRegistry.h
+++ b/src/server/shared/Dynamic/ObjectRegistry.h
@@ -81,6 +81,8 @@ class ObjectRegistry final
// non instanceable, only static
ObjectRegistry() { }
~ObjectRegistry() { }
+ ObjectRegistry(ObjectRegistry const&) = delete;
+ ObjectRegistry& operator=(ObjectRegistry const&) = delete;
};
#endif
diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp
index 1c838248eca..997d1488c64 100644
--- a/src/server/shared/Packets/ByteBuffer.cpp
+++ b/src/server/shared/Packets/ByteBuffer.cpp
@@ -69,15 +69,30 @@ uint32 ByteBuffer::ReadPackedTime()
return uint32(mktime(&lt));
}
-void ByteBuffer::append(const uint8 *src, size_t cnt)
+void ByteBuffer::append(uint8 const* src, size_t cnt)
{
ASSERT(src, "Attempted to put a NULL-pointer in ByteBuffer (pos: " SZFMTD " size: " SZFMTD ")", _wpos, size());
ASSERT(cnt, "Attempted to put a zero-sized value in ByteBuffer (pos: " SZFMTD " size: " SZFMTD ")", _wpos, size());
ASSERT(size() < 10000000);
+ size_t const newSize = _wpos + cnt;
+ if (_storage.capacity() < newSize) // custom memory allocation rules
+ {
+ if (newSize < 100)
+ _storage.reserve(300);
+ else if (newSize < 750)
+ _storage.reserve(2500);
+ else if (newSize < 6000)
+ _storage.reserve(10000);
+ else
+ _storage.reserve(400000);
+ }
+
FlushBits();
- _storage.insert(_storage.begin() + _wpos, src, src + cnt);
- _wpos += cnt;
+ if (_storage.size() < newSize)
+ _storage.resize(newSize);
+ std::memcpy(&_storage[_wpos], src, cnt);
+ _wpos = newSize;
}
void ByteBuffer::AppendPackedTime(time_t time)
@@ -87,7 +102,7 @@ void ByteBuffer::AppendPackedTime(time_t time)
append<uint32>((lt.tm_year - 100) << 24 | lt.tm_mon << 20 | (lt.tm_mday - 1) << 14 | lt.tm_wday << 11 | lt.tm_hour << 6 | lt.tm_min);
}
-void ByteBuffer::put(size_t pos, const uint8 *src, size_t cnt)
+void ByteBuffer::put(size_t pos, uint8 const* src, size_t cnt)
{
ASSERT(pos + cnt <= size(), "Attempted to put value with size: " SZFMTD " in ByteBuffer (pos: " SZFMTD " size: " SZFMTD ")", cnt, pos, size());
ASSERT(src, "Attempted to put a NULL-pointer in ByteBuffer (pos: " SZFMTD " size: " SZFMTD ")", pos, size());
diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h
index 13d77b41c14..36cb0f5f970 100644
--- a/src/server/shared/Packets/ByteBuffer.h
+++ b/src/server/shared/Packets/ByteBuffer.h
@@ -563,9 +563,9 @@ class TC_SHARED_API ByteBuffer
return append((const uint8 *)src, cnt * sizeof(T));
}
- void append(const uint8 *src, size_t cnt);
+ void append(uint8 const* src, size_t cnt);
- void append(const ByteBuffer& buffer)
+ void append(ByteBuffer const& buffer)
{
if (!buffer.empty())
append(buffer.contents(), buffer.size());
@@ -622,7 +622,7 @@ class TC_SHARED_API ByteBuffer
void AppendPackedTime(time_t time);
- void put(size_t pos, const uint8 *src, size_t cnt);
+ void put(size_t pos, uint8 const* src, size_t cnt);
void print_storage() const;
diff --git a/src/server/shared/PrecompiledHeaders/sharedPCH.h b/src/server/shared/PrecompiledHeaders/sharedPCH.h
index b2b6b602297..e84a3795df8 100644
--- a/src/server/shared/PrecompiledHeaders/sharedPCH.h
+++ b/src/server/shared/PrecompiledHeaders/sharedPCH.h
@@ -1,3 +1,20 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
//add here most rarely modified headers to speed up debug build compilation
#include "Common.h"
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp
index 5c3f8e25391..200f78f0957 100644
--- a/src/server/worldserver/CommandLine/CliRunnable.cpp
+++ b/src/server/worldserver/CommandLine/CliRunnable.cpp
@@ -38,10 +38,10 @@
#include <readline/readline.h>
#include <readline/history.h>
-char* command_finder(const char* text, int state)
+char* command_finder(char const* text, int state)
{
static size_t idx, len;
- const char* ret;
+ char const* ret;
std::vector<ChatCommand> const& cmd = ChatHandler::getCommandTable();
if (!state)
@@ -68,7 +68,7 @@ char* command_finder(const char* text, int state)
return nullptr;
}
-char** cli_completion(const char* text, int start, int /*end*/)
+char** cli_completion(char const* text, int start, int /*end*/)
{
char** matches = nullptr;
@@ -88,7 +88,7 @@ int cli_hook_func()
#endif
-void utf8print(void* /*arg*/, const char* str)
+void utf8print(void* /*arg*/, char const* str)
{
#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
wchar_t wtemp_buf[6000];
diff --git a/src/server/worldserver/PrecompiledHeaders/worldPCH.h b/src/server/worldserver/PrecompiledHeaders/worldPCH.h
index 6407485f70b..ae91378f782 100644
--- a/src/server/worldserver/PrecompiledHeaders/worldPCH.h
+++ b/src/server/worldserver/PrecompiledHeaders/worldPCH.h
@@ -1,3 +1,20 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
#include "Common.h"
#include "World.h"
#include "Log.h"
diff --git a/src/server/worldserver/RemoteAccess/RASession.cpp b/src/server/worldserver/RemoteAccess/RASession.cpp
index c49863d353c..4a4a22b3c75 100644
--- a/src/server/worldserver/RemoteAccess/RASession.cpp
+++ b/src/server/worldserver/RemoteAccess/RASession.cpp
@@ -39,8 +39,7 @@ void RASession::Start()
if (_socket.available() > 0)
{
// Handle subnegotiation
- char buf[1024];
- memset(buf, 0, sizeof(buf));
+ char buf[1024] = { };
_socket.read_some(boost::asio::buffer(buf));
// Send the end-of-negotiation packet
@@ -91,7 +90,7 @@ void RASession::Start()
_socket.close();
}
-int RASession::Send(const char* data)
+int RASession::Send(char const* data)
{
std::ostream os(&_writeBuffer);
os << data;
@@ -204,7 +203,7 @@ bool RASession::ProcessCommand(std::string& command)
return false;
}
-void RASession::CommandPrint(void* callbackArg, const char* text)
+void RASession::CommandPrint(void* callbackArg, char const* text)
{
if (!text || !*text)
return;
diff --git a/src/server/worldserver/RemoteAccess/RASession.h b/src/server/worldserver/RemoteAccess/RASession.h
index 594f08160ac..e775bed5e33 100644
--- a/src/server/worldserver/RemoteAccess/RASession.h
+++ b/src/server/worldserver/RemoteAccess/RASession.h
@@ -42,13 +42,13 @@ public:
unsigned short GetRemotePort() const { return _socket.remote_endpoint().port(); }
private:
- int Send(const char* data);
+ int Send(char const* data);
std::string ReadString();
bool CheckAccessLevel(const std::string& user);
bool CheckPassword(const std::string& user, const std::string& pass);
bool ProcessCommand(std::string& command);
- static void CommandPrint(void* callbackArg, const char* text);
+ static void CommandPrint(void* callbackArg, char const* text);
static void CommandFinished(void* callbackArg, bool);
tcp::socket _socket;
diff --git a/src/server/worldserver/TCSoap/TCSoap.h b/src/server/worldserver/TCSoap/TCSoap.h
index 88ae3a0a0aa..e45d044983b 100644
--- a/src/server/worldserver/TCSoap/TCSoap.h
+++ b/src/server/worldserver/TCSoap/TCSoap.h
@@ -38,7 +38,7 @@ class SOAPCommand
{
}
- void appendToPrintBuffer(const char* msg)
+ void appendToPrintBuffer(char const* msg)
{
m_printBuffer += msg;
}
@@ -54,7 +54,7 @@ class SOAPCommand
return m_success;
}
- static void print(void* callbackArg, const char* msg)
+ static void print(void* callbackArg, char const* msg)
{
((SOAPCommand*)callbackArg)->appendToPrintBuffer(msg);
}