aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/genrev/CMakeLists.txt2
-rw-r--r--src/server/CMakeLists.txt2
-rw-r--r--src/server/authserver/Authentication/AuthCodes.cpp2
-rw-r--r--src/server/authserver/Authentication/AuthCodes.h2
-rw-r--r--src/server/authserver/Authentication/TOTP.cpp2
-rw-r--r--src/server/authserver/Authentication/TOTP.h2
-rw-r--r--src/server/authserver/CMakeLists.txt2
-rw-r--r--src/server/authserver/Main.cpp4
-rw-r--r--src/server/authserver/Realms/RealmList.cpp2
-rw-r--r--src/server/authserver/Realms/RealmList.h2
-rw-r--r--src/server/authserver/Server/AuthSocket.cpp4
-rw-r--r--src/server/authserver/Server/AuthSocket.h2
-rw-r--r--src/server/authserver/Server/RealmAcceptor.h2
-rw-r--r--src/server/authserver/Server/RealmSocket.cpp2
-rw-r--r--src/server/authserver/Server/RealmSocket.h2
-rw-r--r--src/server/authserver/authserver.rc2
-rw-r--r--src/server/collision/BoundingIntervalHierarchy.cpp2
-rw-r--r--src/server/collision/BoundingIntervalHierarchy.h2
-rw-r--r--src/server/collision/BoundingIntervalHierarchyWrapper.h2
-rw-r--r--src/server/collision/CMakeLists.txt2
-rw-r--r--src/server/collision/DynamicTree.cpp2
-rw-r--r--src/server/collision/DynamicTree.h2
-rw-r--r--src/server/collision/Management/IVMapManager.h2
-rw-r--r--src/server/collision/Management/MMapFactory.cpp2
-rw-r--r--src/server/collision/Management/MMapFactory.h2
-rw-r--r--src/server/collision/Management/MMapManager.cpp2
-rw-r--r--src/server/collision/Management/MMapManager.h2
-rw-r--r--src/server/collision/Management/VMapFactory.cpp2
-rw-r--r--src/server/collision/Management/VMapFactory.h2
-rw-r--r--src/server/collision/Management/VMapManager2.cpp2
-rw-r--r--src/server/collision/Management/VMapManager2.h2
-rw-r--r--src/server/collision/Maps/MapTree.cpp2
-rw-r--r--src/server/collision/Maps/MapTree.h2
-rw-r--r--src/server/collision/Maps/TileAssembler.cpp2
-rw-r--r--src/server/collision/Maps/TileAssembler.h2
-rw-r--r--src/server/collision/Models/GameObjectModel.cpp2
-rw-r--r--src/server/collision/Models/GameObjectModel.h2
-rw-r--r--src/server/collision/Models/ModelInstance.cpp2
-rw-r--r--src/server/collision/Models/ModelInstance.h2
-rw-r--r--src/server/collision/Models/WorldModel.cpp2
-rw-r--r--src/server/collision/Models/WorldModel.h2
-rw-r--r--src/server/collision/VMapDefinitions.h2
-rw-r--r--src/server/collision/VMapTools.h2
-rw-r--r--src/server/game/AI/CoreAI/CombatAI.cpp62
-rw-r--r--src/server/game/AI/CoreAI/CombatAI.h22
-rw-r--r--src/server/game/AI/CoreAI/GameObjectAI.cpp2
-rw-r--r--src/server/game/AI/CoreAI/GameObjectAI.h5
-rw-r--r--src/server/game/AI/CoreAI/GuardAI.cpp2
-rw-r--r--src/server/game/AI/CoreAI/GuardAI.h2
-rw-r--r--src/server/game/AI/CoreAI/PassiveAI.cpp2
-rw-r--r--src/server/game/AI/CoreAI/PassiveAI.h2
-rw-r--r--src/server/game/AI/CoreAI/PetAI.cpp6
-rw-r--r--src/server/game/AI/CoreAI/PetAI.h3
-rw-r--r--src/server/game/AI/CoreAI/ReactorAI.cpp2
-rw-r--r--src/server/game/AI/CoreAI/ReactorAI.h2
-rw-r--r--src/server/game/AI/CoreAI/TotemAI.cpp4
-rw-r--r--src/server/game/AI/CoreAI/TotemAI.h2
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.cpp11
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.h2
-rw-r--r--src/server/game/AI/CreatureAI.cpp6
-rw-r--r--src/server/game/AI/CreatureAI.h4
-rw-r--r--src/server/game/AI/CreatureAIFactory.h2
-rw-r--r--src/server/game/AI/CreatureAIImpl.h2
-rw-r--r--src/server/game/AI/CreatureAIRegistry.cpp2
-rw-r--r--src/server/game/AI/CreatureAIRegistry.h2
-rw-r--r--src/server/game/AI/CreatureAISelector.cpp2
-rw-r--r--src/server/game/AI/CreatureAISelector.h2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.cpp4
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.h2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.h2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedGossip.h2
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp98
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.h15
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp154
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.h9
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp128
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h79
-rw-r--r--src/server/game/Accounts/AccountMgr.cpp2
-rw-r--r--src/server/game/Accounts/AccountMgr.h2
-rw-r--r--src/server/game/Accounts/RBAC.cpp2
-rw-r--r--src/server/game/Accounts/RBAC.h2
-rw-r--r--src/server/game/Achievements/AchievementMgr.cpp19
-rw-r--r--src/server/game/Achievements/AchievementMgr.h2
-rw-r--r--src/server/game/Addons/AddonMgr.cpp2
-rw-r--r--src/server/game/Addons/AddonMgr.h2
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseMgr.cpp2
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseMgr.h2
-rw-r--r--src/server/game/Battlefield/Battlefield.cpp42
-rw-r--r--src/server/game/Battlefield/Battlefield.h4
-rw-r--r--src/server/game/Battlefield/BattlefieldMgr.cpp123
-rw-r--r--src/server/game/Battlefield/BattlefieldMgr.h71
-rw-r--r--src/server/game/Battlefield/Zones/BattlefieldWG.cpp22
-rw-r--r--src/server/game/Battlefield/Zones/BattlefieldWG.h5
-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/ArenaTeamMgr.cpp2
-rw-r--r--src/server/game/Battlegrounds/ArenaTeamMgr.h2
-rw-r--r--src/server/game/Battlegrounds/Battleground.cpp78
-rw-r--r--src/server/game/Battlegrounds/Battleground.h2
-rw-r--r--src/server/game/Battlegrounds/BattlegroundMgr.cpp3
-rw-r--r--src/server/game/Battlegrounds/BattlegroundMgr.h2
-rw-r--r--src/server/game/Battlegrounds/BattlegroundQueue.cpp2
-rw-r--r--src/server/game/Battlegrounds/BattlegroundQueue.h2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp23
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAB.h2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp21
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAV.h2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundBE.h2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp8
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundDS.h4
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp24
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundEY.h2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp8
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundIC.h2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundNA.h2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundRL.h2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp6
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundRV.h2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp18
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundSA.h2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp17
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundWS.h2
-rw-r--r--src/server/game/CMakeLists.txt2
-rw-r--r--src/server/game/Calendar/CalendarMgr.cpp4
-rw-r--r--src/server/game/Calendar/CalendarMgr.h2
-rw-r--r--src/server/game/Chat/Channels/Channel.cpp21
-rw-r--r--src/server/game/Chat/Channels/Channel.h2
-rw-r--r--src/server/game/Chat/Channels/ChannelMgr.cpp2
-rw-r--r--src/server/game/Chat/Channels/ChannelMgr.h2
-rw-r--r--src/server/game/Chat/Chat.cpp162
-rw-r--r--src/server/game/Chat/Chat.h18
-rw-r--r--src/server/game/Chat/ChatLink.cpp2
-rw-r--r--src/server/game/Chat/ChatLink.h6
-rw-r--r--src/server/game/Combat/HostileRefManager.cpp2
-rw-r--r--src/server/game/Combat/HostileRefManager.h2
-rw-r--r--src/server/game/Combat/ThreatManager.cpp2
-rw-r--r--src/server/game/Combat/ThreatManager.h2
-rw-r--r--src/server/game/Combat/UnitEvents.h2
-rw-r--r--src/server/game/Conditions/ConditionMgr.cpp2
-rw-r--r--src/server/game/Conditions/ConditionMgr.h3
-rw-r--r--src/server/game/Conditions/DisableMgr.cpp2
-rw-r--r--src/server/game/Conditions/DisableMgr.h2
-rw-r--r--src/server/game/DataStores/DBCEnums.h62
-rw-r--r--src/server/game/DataStores/DBCStores.cpp5
-rw-r--r--src/server/game/DataStores/DBCStores.h2
-rw-r--r--src/server/game/DataStores/DBCStructure.h2
-rw-r--r--src/server/game/DataStores/DBCfmt.h2
-rw-r--r--src/server/game/DungeonFinding/LFG.cpp2
-rw-r--r--src/server/game/DungeonFinding/LFG.h2
-rw-r--r--src/server/game/DungeonFinding/LFGGroupData.cpp2
-rw-r--r--src/server/game/DungeonFinding/LFGGroupData.h2
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.cpp151
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.h2
-rw-r--r--src/server/game/DungeonFinding/LFGPlayerData.cpp2
-rw-r--r--src/server/game/DungeonFinding/LFGPlayerData.h2
-rw-r--r--src/server/game/DungeonFinding/LFGQueue.cpp44
-rw-r--r--src/server/game/DungeonFinding/LFGQueue.h2
-rw-r--r--src/server/game/DungeonFinding/LFGScripts.cpp2
-rw-r--r--src/server/game/DungeonFinding/LFGScripts.h2
-rw-r--r--src/server/game/Entities/Corpse/Corpse.cpp2
-rw-r--r--src/server/game/Entities/Corpse/Corpse.h8
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp99
-rw-r--r--src/server/game/Entities/Creature/Creature.h34
-rw-r--r--src/server/game/Entities/Creature/CreatureGroups.cpp2
-rw-r--r--src/server/game/Entities/Creature/CreatureGroups.h2
-rw-r--r--src/server/game/Entities/Creature/GossipDef.cpp17
-rw-r--r--src/server/game/Entities/Creature/GossipDef.h4
-rw-r--r--src/server/game/Entities/Creature/TemporarySummon.cpp2
-rw-r--r--src/server/game/Entities/Creature/TemporarySummon.h4
-rw-r--r--src/server/game/Entities/DynamicObject/DynamicObject.cpp2
-rw-r--r--src/server/game/Entities/DynamicObject/DynamicObject.h8
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp6
-rw-r--r--src/server/game/Entities/GameObject/GameObject.h15
-rw-r--r--src/server/game/Entities/Item/Container/Bag.cpp2
-rw-r--r--src/server/game/Entities/Item/Container/Bag.h2
-rw-r--r--src/server/game/Entities/Item/Item.cpp4
-rw-r--r--src/server/game/Entities/Item/Item.h2
-rw-r--r--src/server/game/Entities/Item/ItemEnchantmentMgr.cpp2
-rw-r--r--src/server/game/Entities/Item/ItemEnchantmentMgr.h2
-rw-r--r--src/server/game/Entities/Item/ItemPrototype.h2
-rw-r--r--src/server/game/Entities/Object/Object.cpp130
-rw-r--r--src/server/game/Entities/Object/Object.h22
-rw-r--r--src/server/game/Entities/Object/ObjectDefines.h2
-rw-r--r--src/server/game/Entities/Object/ObjectPosSelector.cpp2
-rw-r--r--src/server/game/Entities/Object/ObjectPosSelector.h2
-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/Object/Updates/UpdateFieldFlags.cpp2
-rw-r--r--src/server/game/Entities/Object/Updates/UpdateFieldFlags.h2
-rw-r--r--src/server/game/Entities/Object/Updates/UpdateFields.h2
-rw-r--r--src/server/game/Entities/Object/Updates/UpdateMask.h2
-rw-r--r--src/server/game/Entities/Pet/Pet.cpp2
-rw-r--r--src/server/game/Entities/Pet/Pet.h4
-rw-r--r--src/server/game/Entities/Pet/PetDefines.h2
-rw-r--r--src/server/game/Entities/Player/Player.cpp320
-rw-r--r--src/server/game/Entities/Player/Player.h16
-rw-r--r--src/server/game/Entities/Player/SocialMgr.cpp2
-rw-r--r--src/server/game/Entities/Player/SocialMgr.h2
-rw-r--r--src/server/game/Entities/Totem/Totem.cpp2
-rw-r--r--src/server/game/Entities/Totem/Totem.h4
-rw-r--r--src/server/game/Entities/Transport/Transport.cpp88
-rw-r--r--src/server/game/Entities/Transport/Transport.h4
-rw-r--r--src/server/game/Entities/Unit/StatSystem.cpp207
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp251
-rw-r--r--src/server/game/Entities/Unit/Unit.h59
-rwxr-xr-xsrc/server/game/Entities/Vehicle/Vehicle.cpp13
-rw-r--r--src/server/game/Entities/Vehicle/Vehicle.h2
-rw-r--r--src/server/game/Entities/Vehicle/VehicleDefines.h2
-rw-r--r--src/server/game/Events/GameEventMgr.cpp4
-rw-r--r--src/server/game/Events/GameEventMgr.h5
-rw-r--r--src/server/game/Globals/ObjectAccessor.cpp2
-rw-r--r--src/server/game/Globals/ObjectAccessor.h2
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp159
-rw-r--r--src/server/game/Globals/ObjectMgr.h4
-rw-r--r--src/server/game/Grids/Cells/Cell.h2
-rw-r--r--src/server/game/Grids/Cells/CellImpl.h2
-rw-r--r--src/server/game/Grids/Grid.h2
-rw-r--r--src/server/game/Grids/GridDefines.h2
-rw-r--r--src/server/game/Grids/GridLoader.h2
-rw-r--r--src/server/game/Grids/GridRefManager.h2
-rw-r--r--src/server/game/Grids/GridReference.h2
-rw-r--r--src/server/game/Grids/GridStates.cpp2
-rw-r--r--src/server/game/Grids/GridStates.h2
-rw-r--r--src/server/game/Grids/NGrid.h2
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.cpp2
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.h2
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiersImpl.h12
-rw-r--r--src/server/game/Grids/ObjectGridLoader.cpp2
-rw-r--r--src/server/game/Grids/ObjectGridLoader.h2
-rw-r--r--src/server/game/Groups/Group.cpp4
-rw-r--r--src/server/game/Groups/Group.h2
-rw-r--r--src/server/game/Groups/GroupMgr.cpp2
-rw-r--r--src/server/game/Groups/GroupMgr.h2
-rw-r--r--src/server/game/Groups/GroupRefManager.h2
-rw-r--r--src/server/game/Groups/GroupReference.cpp2
-rw-r--r--src/server/game/Groups/GroupReference.h2
-rw-r--r--src/server/game/Guilds/Guild.cpp30
-rw-r--r--src/server/game/Guilds/Guild.h6
-rw-r--r--src/server/game/Guilds/GuildMgr.cpp2
-rw-r--r--src/server/game/Guilds/GuildMgr.h2
-rw-r--r--src/server/game/Handlers/AddonHandler.cpp2
-rw-r--r--src/server/game/Handlers/AddonHandler.h2
-rw-r--r--src/server/game/Handlers/ArenaTeamHandler.cpp2
-rw-r--r--src/server/game/Handlers/AuctionHouseHandler.cpp3
-rw-r--r--src/server/game/Handlers/AuthHandler.cpp2
-rw-r--r--src/server/game/Handlers/BattleGroundHandler.cpp2
-rw-r--r--src/server/game/Handlers/BattlefieldHandler.cpp195
-rw-r--r--src/server/game/Handlers/CalendarHandler.cpp22
-rw-r--r--src/server/game/Handlers/ChannelHandler.cpp2
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp15
-rw-r--r--src/server/game/Handlers/ChatHandler.cpp16
-rw-r--r--src/server/game/Handlers/CombatHandler.cpp2
-rw-r--r--src/server/game/Handlers/DuelHandler.cpp2
-rw-r--r--src/server/game/Handlers/GroupHandler.cpp6
-rw-r--r--src/server/game/Handlers/GuildHandler.cpp13
-rw-r--r--src/server/game/Handlers/ItemHandler.cpp20
-rw-r--r--src/server/game/Handlers/LFGHandler.cpp2
-rw-r--r--src/server/game/Handlers/LootHandler.cpp11
-rw-r--r--src/server/game/Handlers/MailHandler.cpp2
-rw-r--r--src/server/game/Handlers/MiscHandler.cpp20
-rw-r--r--src/server/game/Handlers/MovementHandler.cpp5
-rw-r--r--src/server/game/Handlers/NPCHandler.cpp2
-rw-r--r--src/server/game/Handlers/NPCHandler.h2
-rw-r--r--src/server/game/Handlers/PetHandler.cpp2
-rw-r--r--src/server/game/Handlers/PetitionsHandler.cpp2
-rw-r--r--src/server/game/Handlers/QueryHandler.cpp2
-rw-r--r--src/server/game/Handlers/QuestHandler.cpp77
-rw-r--r--src/server/game/Handlers/ReferAFriendHandler.cpp2
-rw-r--r--src/server/game/Handlers/SkillHandler.cpp2
-rw-r--r--src/server/game/Handlers/SpellHandler.cpp14
-rw-r--r--src/server/game/Handlers/TaxiHandler.cpp2
-rw-r--r--src/server/game/Handlers/TicketHandler.cpp2
-rw-r--r--src/server/game/Handlers/TradeHandler.cpp8
-rw-r--r--src/server/game/Handlers/VehicleHandler.cpp2
-rw-r--r--src/server/game/Handlers/VoiceChatHandler.cpp2
-rw-r--r--src/server/game/Instances/InstanceSaveMgr.cpp17
-rw-r--r--src/server/game/Instances/InstanceSaveMgr.h11
-rw-r--r--src/server/game/Instances/InstanceScript.cpp2
-rw-r--r--src/server/game/Instances/InstanceScript.h14
-rw-r--r--src/server/game/Loot/LootMgr.cpp3
-rw-r--r--src/server/game/Loot/LootMgr.h8
-rw-r--r--src/server/game/Mails/Mail.cpp2
-rw-r--r--src/server/game/Mails/Mail.h2
-rw-r--r--src/server/game/Maps/Map.cpp56
-rw-r--r--src/server/game/Maps/Map.h2
-rw-r--r--src/server/game/Maps/MapInstanced.cpp2
-rw-r--r--src/server/game/Maps/MapInstanced.h2
-rw-r--r--src/server/game/Maps/MapManager.cpp37
-rw-r--r--src/server/game/Maps/MapManager.h7
-rw-r--r--src/server/game/Maps/MapRefManager.h2
-rw-r--r--src/server/game/Maps/MapReference.h2
-rw-r--r--src/server/game/Maps/TransportMgr.cpp141
-rw-r--r--src/server/game/Maps/TransportMgr.h5
-rw-r--r--src/server/game/Maps/ZoneScript.h2
-rw-r--r--src/server/game/Miscellaneous/Formulas.h2
-rw-r--r--src/server/game/Miscellaneous/Language.h14
-rw-r--r--src/server/game/Miscellaneous/SharedDefines.h12
-rw-r--r--src/server/game/Movement/FollowerRefManager.h2
-rw-r--r--src/server/game/Movement/FollowerReference.cpp2
-rw-r--r--src/server/game/Movement/FollowerReference.h2
-rw-r--r--src/server/game/Movement/MotionMaster.cpp12
-rw-r--r--src/server/game/Movement/MotionMaster.h26
-rw-r--r--src/server/game/Movement/MovementGenerator.cpp2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerator.h2
-rw-r--r--src/server/game/Movement/MovementGeneratorImpl.h2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h4
-rw-r--r--src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp17
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h2
-rw-r--r--src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp4
-rw-r--r--src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/IdleMovementGenerator.h2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp2
-rw-r--r--src/server/game/Movement/MovementGenerators/PointMovementGenerator.h2
-rw-r--r--src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp2
-rw-r--r--src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h3
-rw-r--r--src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp11
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h6
-rw-r--r--src/server/game/Movement/Spline/MoveSplineInit.cpp50
-rw-r--r--src/server/game/Movement/Spline/MovementPacketBuilder.cpp2
-rw-r--r--src/server/game/Movement/Spline/MovementPacketBuilder.h2
-rw-r--r--src/server/game/Movement/Spline/Spline.cpp2
-rw-r--r--src/server/game/Movement/Spline/Spline.h2
-rw-r--r--src/server/game/Movement/Waypoints/Path.h2
-rw-r--r--src/server/game/Movement/Waypoints/WaypointManager.cpp2
-rw-r--r--src/server/game/Movement/Waypoints/WaypointManager.h2
-rw-r--r--src/server/game/OutdoorPvP/OutdoorPvP.cpp4
-rw-r--r--src/server/game/OutdoorPvP/OutdoorPvP.h2
-rw-r--r--src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp2
-rw-r--r--src/server/game/OutdoorPvP/OutdoorPvPMgr.h2
-rw-r--r--src/server/game/Pools/PoolMgr.cpp4
-rw-r--r--src/server/game/Pools/PoolMgr.h2
-rw-r--r--src/server/game/Quests/QuestDef.cpp2
-rw-r--r--src/server/game/Quests/QuestDef.h7
-rw-r--r--src/server/game/Reputation/ReputationMgr.cpp2
-rw-r--r--src/server/game/Reputation/ReputationMgr.h2
-rw-r--r--src/server/game/Scripting/MapScripts.cpp20
-rw-r--r--src/server/game/Scripting/ScriptLoader.cpp14
-rw-r--r--src/server/game/Scripting/ScriptLoader.h2
-rw-r--r--src/server/game/Scripting/ScriptMgr.cpp8
-rw-r--r--src/server/game/Scripting/ScriptMgr.h7
-rw-r--r--src/server/game/Scripting/ScriptSystem.cpp2
-rw-r--r--src/server/game/Server/Protocol/Opcodes.cpp4
-rw-r--r--src/server/game/Server/Protocol/Opcodes.h2
-rw-r--r--src/server/game/Server/Protocol/PacketLog.cpp2
-rw-r--r--src/server/game/Server/Protocol/PacketLog.h2
-rw-r--r--src/server/game/Server/WorldSession.cpp5
-rw-r--r--src/server/game/Server/WorldSession.h24
-rw-r--r--src/server/game/Server/WorldSocket.cpp2
-rw-r--r--src/server/game/Server/WorldSocket.h2
-rw-r--r--src/server/game/Server/WorldSocketAcceptor.h2
-rw-r--r--src/server/game/Server/WorldSocketMgr.cpp2
-rw-r--r--src/server/game/Server/WorldSocketMgr.h2
-rw-r--r--src/server/game/Skills/SkillDiscovery.cpp2
-rw-r--r--src/server/game/Skills/SkillDiscovery.h2
-rw-r--r--src/server/game/Skills/SkillExtraItems.cpp2
-rw-r--r--src/server/game/Skills/SkillExtraItems.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraDefines.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp67
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp17
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.h4
-rw-r--r--src/server/game/Spells/Spell.cpp93
-rw-r--r--src/server/game/Spells/Spell.h6
-rw-r--r--src/server/game/Spells/SpellEffects.cpp41
-rw-r--r--src/server/game/Spells/SpellInfo.cpp10
-rw-r--r--src/server/game/Spells/SpellInfo.h7
-rw-r--r--src/server/game/Spells/SpellMgr.cpp27
-rw-r--r--src/server/game/Spells/SpellMgr.h2
-rw-r--r--src/server/game/Spells/SpellScript.cpp2
-rw-r--r--src/server/game/Spells/SpellScript.h10
-rw-r--r--src/server/game/Texts/CreatureTextMgr.cpp78
-rw-r--r--src/server/game/Texts/CreatureTextMgr.h22
-rw-r--r--src/server/game/Tickets/TicketMgr.cpp8
-rw-r--r--src/server/game/Tickets/TicketMgr.h2
-rw-r--r--src/server/game/Tools/CharacterDatabaseCleaner.cpp2
-rw-r--r--src/server/game/Tools/CharacterDatabaseCleaner.h2
-rw-r--r--src/server/game/Tools/PlayerDump.cpp2
-rw-r--r--src/server/game/Tools/PlayerDump.h2
-rw-r--r--src/server/game/Warden/Modules/WardenModuleMac.h2
-rw-r--r--src/server/game/Warden/Modules/WardenModuleWin.h2
-rw-r--r--src/server/game/Warden/Warden.cpp10
-rw-r--r--src/server/game/Warden/Warden.h2
-rw-r--r--src/server/game/Warden/WardenCheckMgr.cpp2
-rw-r--r--src/server/game/Warden/WardenCheckMgr.h2
-rw-r--r--src/server/game/Warden/WardenMac.cpp2
-rw-r--r--src/server/game/Warden/WardenMac.h2
-rw-r--r--src/server/game/Warden/WardenWin.cpp4
-rw-r--r--src/server/game/Warden/WardenWin.h2
-rw-r--r--src/server/game/Weather/Weather.cpp2
-rw-r--r--src/server/game/Weather/Weather.h2
-rw-r--r--src/server/game/Weather/WeatherMgr.cpp2
-rw-r--r--src/server/game/Weather/WeatherMgr.h2
-rw-r--r--src/server/game/World/World.cpp59
-rw-r--r--src/server/game/World/World.h4
-rw-r--r--src/server/scripts/CMakeLists.txt2
-rw-r--r--src/server/scripts/Commands/CMakeLists.txt2
-rw-r--r--src/server/scripts/Commands/cs_account.cpp2
-rw-r--r--src/server/scripts/Commands/cs_achievement.cpp2
-rw-r--r--src/server/scripts/Commands/cs_arena.cpp2
-rw-r--r--src/server/scripts/Commands/cs_ban.cpp32
-rw-r--r--src/server/scripts/Commands/cs_bf.cpp2
-rw-r--r--src/server/scripts/Commands/cs_cast.cpp2
-rw-r--r--src/server/scripts/Commands/cs_character.cpp2
-rw-r--r--src/server/scripts/Commands/cs_cheat.cpp2
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp9
-rw-r--r--src/server/scripts/Commands/cs_deserter.cpp2
-rw-r--r--src/server/scripts/Commands/cs_disable.cpp2
-rw-r--r--src/server/scripts/Commands/cs_event.cpp2
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp36
-rw-r--r--src/server/scripts/Commands/cs_go.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.cpp2
-rw-r--r--src/server/scripts/Commands/cs_instance.cpp2
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp2
-rw-r--r--src/server/scripts/Commands/cs_lfg.cpp2
-rw-r--r--src/server/scripts/Commands/cs_list.cpp2
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp2
-rw-r--r--src/server/scripts/Commands/cs_message.cpp2
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp57
-rw-r--r--src/server/scripts/Commands/cs_mmaps.cpp2
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp2
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp19
-rw-r--r--src/server/scripts/Commands/cs_pet.cpp2
-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.cpp2
-rw-r--r--src/server/scripts/Commands/cs_reset.cpp2
-rw-r--r--src/server/scripts/Commands/cs_send.cpp2
-rw-r--r--src/server/scripts/Commands/cs_server.cpp2
-rw-r--r--src/server/scripts/Commands/cs_tele.cpp2
-rw-r--r--src/server/scripts/Commands/cs_ticket.cpp2
-rw-r--r--src/server/scripts/Commands/cs_titles.cpp2
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp14
-rw-r--r--src/server/scripts/Custom/CMakeLists.txt2
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp24
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_ambassador_flamelash.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_anubshiah.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_gorosh_the_dervish.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_grizzle.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp21
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gizrul_the_slavener.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_halycon.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_highlord_omokk.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_lord_valthalak.cpp7
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_mother_smolderweb.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_overlord_wyrmthalak.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp83
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_quartermaster_zigris.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_the_beast.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_urok_doomhowl.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_warmaster_voone.cpp17
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp14
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_magmadar.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp7
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp55
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_shazzrah.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h2
-rw-r--r--src/server/scripts/EasternKingdoms/CMakeLists.txt2
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp15
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/deadmines.h2
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp33
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h2
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp9
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp34
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp28
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp35
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp40
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp32
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp84
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp37
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/karazhan.h2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp18
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp65
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp52
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp13
-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.h2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp204
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp32
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp9
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp44
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp2
-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.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp11
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp4
-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/Scholomance/instance_scholomance.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/scholomance.h2
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp12
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp17
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp13
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp7
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp7
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp42
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp7
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/stratholme.h2
-rw-r--r--src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h2
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp28
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp7
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp21
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp29
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp12
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h2
-rw-r--r--src/server/scripts/EasternKingdoms/TheStockade/instance_the_stockade.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp23
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp18
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/uldaman.h2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp30
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp29
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp39
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp19
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp37
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp15
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp55
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/zulaman.h2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp56
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp15
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp15
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp19
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp174
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp28
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h2
-rw-r--r--src/server/scripts/EasternKingdoms/boss_kruul.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp76
-rw-r--r--src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp87
-rw-r--r--src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp63
-rw-r--r--src/server/scripts/EasternKingdoms/zone_duskwood.cpp136
-rw-r--r--src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_ghostlands.cpp116
-rw-r--r--src/server/scripts/EasternKingdoms/zone_hinterlands.cpp202
-rw-r--r--src/server/scripts/EasternKingdoms/zone_ironforge.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_loch_modan.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp119
-rw-r--r--src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp14
-rw-r--r--src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp82
-rw-r--r--src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_undercity.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/zone_westfall.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/zone_wetlands.cpp2
-rw-r--r--src/server/scripts/Events/CMakeLists.txt2
-rw-r--r--src/server/scripts/Events/childrens_week.cpp2
-rw-r--r--src/server/scripts/Examples/CMakeLists.txt2
-rw-r--r--src/server/scripts/Examples/example_commandscript.cpp2
-rw-r--r--src/server/scripts/Examples/example_creature.cpp6
-rw-r--r--src/server/scripts/Examples/example_escort.cpp12
-rw-r--r--src/server/scripts/Examples/example_gossip_codebox.cpp2
-rw-r--r--src/server/scripts/Examples/example_misc.cpp2
-rw-r--r--src/server/scripts/Examples/example_spell.cpp4
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp7
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h2
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp2
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp13
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp13
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CMakeLists.txt7
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp37
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp39
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp32
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp27
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp27
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp11
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp111
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp249
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp7
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp13
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite_corruptor.cpp13
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp24
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp16
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp16
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp161
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp5
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp4
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp6
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp14
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp16
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_chrono_lord_deja.cpp7
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp7
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp24
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.h2
-rw-r--r--src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp2
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp2
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp2
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp2
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp2
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/instance_maraudon.cpp2
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp34
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp2
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h2
-rw-r--r--src/server/scripts/Kalimdor/RagefireChasm/instance_ragefire_chasm.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp122
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/boss_glutton.cpp103
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/boss_mordresh_fire_eye.cpp136
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/boss_tuten_kash.cpp107
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp272
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp342
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h53
-rw-r--r--src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp23
-rw-r--r--src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h2
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp6
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp8
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp6
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp35
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h2
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp81
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp42
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp2
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp2
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp2
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp4
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp2
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp26
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp9
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp2
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp2
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h2
-rw-r--r--src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp2
-rw-r--r--src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp22
-rw-r--r--src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h2
-rw-r--r--src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp7
-rw-r--r--src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp2
-rw-r--r--src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp46
-rw-r--r--src/server/scripts/Kalimdor/boss_azuregos.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_ashenvale.cpp437
-rw-r--r--src/server/scripts/Kalimdor/zone_azshara.cpp224
-rw-r--r--src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp167
-rw-r--r--src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp88
-rw-r--r--src/server/scripts/Kalimdor/zone_darkshore.cpp189
-rw-r--r--src/server/scripts/Kalimdor/zone_desolace.cpp93
-rw-r--r--src/server/scripts/Kalimdor/zone_durotar.cpp12
-rw-r--r--src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp18
-rw-r--r--src/server/scripts/Kalimdor/zone_felwood.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_feralas.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_moonglade.cpp4
-rw-r--r--src/server/scripts/Kalimdor/zone_mulgore.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_orgrimmar.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_silithus.cpp99
-rw-r--r--src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_tanaris.cpp40
-rw-r--r--src/server/scripts/Kalimdor/zone_teldrassil.cpp4
-rw-r--r--src/server/scripts/Kalimdor/zone_the_barrens.cpp29
-rw-r--r--src/server/scripts/Kalimdor/zone_thousand_needles.cpp6
-rw-r--r--src/server/scripts/Kalimdor/zone_thunder_bluff.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_ungoro_crater.cpp14
-rw-r--r--src/server/scripts/Kalimdor/zone_winterspring.cpp6
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h2
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp2
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp5
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp28
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp62
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp2
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp2
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h2
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp20
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp10
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp13
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp2
-rw-r--r--src/server/scripts/Northrend/CMakeLists.txt3
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp1796
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp157
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp1074
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h33
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp2
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp2
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp6
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp2
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp2
-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_argent_challenge.cpp17
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp7
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp44
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp2
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp28
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h2
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp26
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp70
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp20
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp89
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp56
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp2
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp14
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp4
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp2
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp4
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp2
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h2
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp23
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp8
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp12
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp13
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp13
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp23
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp9
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h2
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp24
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_eck.cpp24
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp13
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp13
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp18
-rw-r--r--src/server/scripts/Northrend/Gundrak/gundrak.h2
-rw-r--r--src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp6
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp8
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp7
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp4
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp15
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp4
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp20
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp231
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp4
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp9
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_noth.cpp70
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp10
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp4
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp46
-rw-r--r--src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/naxxramas.h2
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp59
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h2
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp27
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp25
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp18
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp29
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/nexus.h2
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp9
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp4
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp19
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp14
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/oculus.h2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp35
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp47
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp30
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp22
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp11
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp191
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp154
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp8
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp12
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp12
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp6
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp6
-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.cpp6
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp18
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp20
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp6
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp8
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp20
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp36
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp381
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h2
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp2
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp4
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp2
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp4
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp2
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h2
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp13
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_erekem.cpp59
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp72
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp37
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_moragg.cpp57
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp74
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp57
-rw-r--r--src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp6
-rw-r--r--src/server/scripts/Northrend/VioletHold/violet_hold.cpp50
-rw-r--r--src/server/scripts/Northrend/VioletHold/violet_hold.h2
-rw-r--r--src/server/scripts/Northrend/isle_of_conquest.cpp2
-rw-r--r--src/server/scripts/Northrend/zone_borean_tundra.cpp89
-rw-r--r--src/server/scripts/Northrend/zone_crystalsong_forest.cpp20
-rw-r--r--src/server/scripts/Northrend/zone_dalaran.cpp18
-rw-r--r--src/server/scripts/Northrend/zone_dragonblight.cpp352
-rw-r--r--src/server/scripts/Northrend/zone_grizzly_hills.cpp4
-rw-r--r--src/server/scripts/Northrend/zone_howling_fjord.cpp114
-rw-r--r--src/server/scripts/Northrend/zone_icecrown.cpp2
-rw-r--r--src/server/scripts/Northrend/zone_sholazar_basin.cpp10
-rw-r--r--src/server/scripts/Northrend/zone_storm_peaks.cpp465
-rw-r--r--src/server/scripts/Northrend/zone_wintergrasp.cpp36
-rw-r--r--src/server/scripts/Northrend/zone_zuldrak.cpp18
-rw-r--r--src/server/scripts/OutdoorPvP/CMakeLists.txt2
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp2
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPEP.h2
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp2
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPHP.h2
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp2
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPNA.h2
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp2
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPSI.h2
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp2
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPTF.h2
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp2
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPZM.h2
-rw-r--r--src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h2
-rw-r--r--src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp7
-rw-r--r--src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp4
-rw-r--r--src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/instance_auchenai_crypts.cpp2
-rw-r--r--src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp10
-rw-r--r--src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp4
-rw-r--r--src/server/scripts/Outland/Auchindoun/ManaTombs/instance_mana_tombs.cpp2
-rw-r--r--src/server/scripts/Outland/Auchindoun/ManaTombs/mana_tombs.h2
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_anzu.cpp4
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp4
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp4
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp2
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h2
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp2
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp2
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp2
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp2
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp2
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h2
-rw-r--r--src/server/scripts/Outland/BlackTemple/black_temple.cpp4
-rw-r--r--src/server/scripts/Outland/BlackTemple/black_temple.h2
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp13
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_illidan.cpp78
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp13
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp13
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp41
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_supremus.cpp17
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp13
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp13
-rw-r--r--src/server/scripts/Outland/BlackTemple/illidari_council.cpp54
-rw-r--r--src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp2
-rw-r--r--src/server/scripts/Outland/CMakeLists.txt2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp141
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp13
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp77
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp48
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp23
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp13
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp13
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp15
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp35
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_mennu_the_betrayer.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_quagmirran.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_rokmar_the_crackler.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_hungarfen.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_the_black_stalker.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/instance_the_underbog.cpp2
-rw-r--r--src/server/scripts/Outland/GruulsLair/boss_gruul.cpp2
-rw-r--r--src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp2
-rw-r--r--src/server/scripts/Outland/GruulsLair/gruuls_lair.h2
-rw-r--r--src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h84
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp122
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp59
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp49
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp411
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp4
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp37
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp4
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp33
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp15
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp7
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp17
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp18
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp49
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp10
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/the_eye.h2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp15
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h2
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp11
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h12
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp10
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/boss_zereketh_the_unbound.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp4
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h2
-rw-r--r--src/server/scripts/Outland/boss_doomlord_kazzak.cpp2
-rw-r--r--src/server/scripts/Outland/boss_doomwalker.cpp2
-rw-r--r--src/server/scripts/Outland/zone_blades_edge_mountains.cpp420
-rw-r--r--src/server/scripts/Outland/zone_hellfire_peninsula.cpp375
-rw-r--r--src/server/scripts/Outland/zone_nagrand.cpp4
-rw-r--r--src/server/scripts/Outland/zone_netherstorm.cpp46
-rw-r--r--src/server/scripts/Outland/zone_shadowmoon_valley.cpp94
-rw-r--r--src/server/scripts/Outland/zone_shattrath_city.cpp46
-rw-r--r--src/server/scripts/Outland/zone_terokkar_forest.cpp12
-rw-r--r--src/server/scripts/Outland/zone_zangarmarsh.cpp12
-rw-r--r--src/server/scripts/Pet/CMakeLists.txt2
-rw-r--r--src/server/scripts/Pet/pet_dk.cpp7
-rw-r--r--src/server/scripts/Pet/pet_generic.cpp4
-rw-r--r--src/server/scripts/Pet/pet_hunter.cpp42
-rw-r--r--src/server/scripts/Pet/pet_mage.cpp4
-rw-r--r--src/server/scripts/Pet/pet_priest.cpp2
-rw-r--r--src/server/scripts/Pet/pet_shaman.cpp2
-rw-r--r--src/server/scripts/Spells/CMakeLists.txt2
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp10
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp2
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp30
-rw-r--r--src/server/scripts/Spells/spell_holiday.cpp2
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp2
-rw-r--r--src/server/scripts/Spells/spell_item.cpp2
-rw-r--r--src/server/scripts/Spells/spell_mage.cpp2
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp2
-rw-r--r--src/server/scripts/Spells/spell_pet.cpp2
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp2
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp54
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp2
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp2
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp2
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp2
-rw-r--r--src/server/scripts/World/CMakeLists.txt2
-rw-r--r--src/server/scripts/World/achievement_scripts.cpp2
-rw-r--r--src/server/scripts/World/areatrigger_scripts.cpp6
-rw-r--r--src/server/scripts/World/boss_emerald_dragons.cpp2
-rw-r--r--src/server/scripts/World/chat_log.cpp2
-rw-r--r--src/server/scripts/World/go_scripts.cpp2
-rw-r--r--src/server/scripts/World/guards.cpp8
-rw-r--r--src/server/scripts/World/item_scripts.cpp2
-rw-r--r--src/server/scripts/World/mob_generic_creature.cpp6
-rw-r--r--src/server/scripts/World/npc_innkeeper.cpp2
-rw-r--r--src/server/scripts/World/npc_professions.cpp2
-rw-r--r--src/server/scripts/World/npc_taxi.cpp22
-rw-r--r--src/server/scripts/World/npcs_special.cpp114
-rw-r--r--src/server/shared/AutoPtr.h2
-rw-r--r--src/server/shared/CMakeLists.txt2
-rw-r--r--src/server/shared/Common.cpp2
-rw-r--r--src/server/shared/Common.h2
-rw-r--r--src/server/shared/CompilerDefs.h2
-rw-r--r--src/server/shared/Configuration/Config.cpp2
-rw-r--r--src/server/shared/Configuration/Config.h2
-rw-r--r--src/server/shared/Containers.h2
-rw-r--r--src/server/shared/Cryptography/ARC4.cpp2
-rw-r--r--src/server/shared/Cryptography/ARC4.h2
-rw-r--r--src/server/shared/Cryptography/Authentication/AuthCrypt.cpp2
-rw-r--r--src/server/shared/Cryptography/Authentication/AuthCrypt.h2
-rw-r--r--src/server/shared/Cryptography/BigNumber.cpp2
-rw-r--r--src/server/shared/Cryptography/BigNumber.h2
-rw-r--r--src/server/shared/Cryptography/HMACSHA1.cpp2
-rw-r--r--src/server/shared/Cryptography/HMACSHA1.h2
-rw-r--r--src/server/shared/Cryptography/OpenSSLCrypto.cpp2
-rw-r--r--src/server/shared/Cryptography/OpenSSLCrypto.h2
-rw-r--r--src/server/shared/Cryptography/SHA1.cpp2
-rw-r--r--src/server/shared/Cryptography/SHA1.h2
-rw-r--r--src/server/shared/Cryptography/WardenKeyGeneration.h2
-rw-r--r--src/server/shared/DataStores/DBCFileLoader.cpp2
-rw-r--r--src/server/shared/DataStores/DBCFileLoader.h2
-rw-r--r--src/server/shared/DataStores/DBCStore.h2
-rw-r--r--src/server/shared/Database/AdhocStatement.cpp2
-rw-r--r--src/server/shared/Database/AdhocStatement.h2
-rw-r--r--src/server/shared/Database/DatabaseEnv.h2
-rw-r--r--src/server/shared/Database/DatabaseWorker.cpp2
-rw-r--r--src/server/shared/Database/DatabaseWorker.h2
-rw-r--r--src/server/shared/Database/DatabaseWorkerPool.h2
-rw-r--r--src/server/shared/Database/Field.cpp4
-rw-r--r--src/server/shared/Database/Field.h2
-rw-r--r--src/server/shared/Database/Implementation/CharacterDatabase.cpp2
-rw-r--r--src/server/shared/Database/Implementation/CharacterDatabase.h2
-rw-r--r--src/server/shared/Database/Implementation/LoginDatabase.cpp4
-rw-r--r--src/server/shared/Database/Implementation/LoginDatabase.h2
-rw-r--r--src/server/shared/Database/Implementation/WorldDatabase.cpp2
-rw-r--r--src/server/shared/Database/Implementation/WorldDatabase.h2
-rw-r--r--src/server/shared/Database/MySQLConnection.cpp2
-rw-r--r--src/server/shared/Database/MySQLConnection.h2
-rw-r--r--src/server/shared/Database/MySQLThreading.h2
-rw-r--r--src/server/shared/Database/PreparedStatement.cpp2
-rw-r--r--src/server/shared/Database/PreparedStatement.h2
-rw-r--r--src/server/shared/Database/QueryHolder.cpp2
-rw-r--r--src/server/shared/Database/QueryHolder.h2
-rw-r--r--src/server/shared/Database/QueryResult.cpp2
-rw-r--r--src/server/shared/Database/QueryResult.h2
-rw-r--r--src/server/shared/Database/SQLOperation.h2
-rw-r--r--src/server/shared/Database/Transaction.cpp2
-rw-r--r--src/server/shared/Database/Transaction.h2
-rw-r--r--src/server/shared/Debugging/Errors.cpp2
-rw-r--r--src/server/shared/Debugging/Errors.h2
-rw-r--r--src/server/shared/Debugging/WheatyExceptionReport.cpp25
-rw-r--r--src/server/shared/Debugging/WheatyExceptionReport.h2
-rw-r--r--src/server/shared/Define.h2
-rw-r--r--src/server/shared/Dynamic/FactoryHolder.h2
-rw-r--r--src/server/shared/Dynamic/HashNamespace.h2
-rw-r--r--src/server/shared/Dynamic/LinkedList.h2
-rw-r--r--src/server/shared/Dynamic/LinkedReference/RefManager.h2
-rw-r--r--src/server/shared/Dynamic/LinkedReference/Reference.h2
-rw-r--r--src/server/shared/Dynamic/ObjectRegistry.h2
-rw-r--r--src/server/shared/Dynamic/TypeContainer.h2
-rw-r--r--src/server/shared/Dynamic/TypeContainerFunctions.h2
-rw-r--r--src/server/shared/Dynamic/TypeContainerVisitor.h2
-rw-r--r--src/server/shared/Dynamic/TypeList.h2
-rw-r--r--src/server/shared/Dynamic/UnorderedMap.h2
-rw-r--r--src/server/shared/Dynamic/UnorderedSet.h2
-rw-r--r--src/server/shared/Logging/Appender.cpp2
-rw-r--r--src/server/shared/Logging/Appender.h2
-rw-r--r--src/server/shared/Logging/AppenderConsole.cpp2
-rw-r--r--src/server/shared/Logging/AppenderConsole.h2
-rw-r--r--src/server/shared/Logging/AppenderDB.cpp2
-rw-r--r--src/server/shared/Logging/AppenderDB.h2
-rw-r--r--src/server/shared/Logging/AppenderFile.cpp2
-rw-r--r--src/server/shared/Logging/AppenderFile.h2
-rw-r--r--src/server/shared/Logging/Log.cpp5
-rw-r--r--src/server/shared/Logging/Log.h54
-rw-r--r--src/server/shared/Logging/LogOperation.cpp2
-rw-r--r--src/server/shared/Logging/LogOperation.h2
-rw-r--r--src/server/shared/Logging/LogWorker.cpp2
-rw-r--r--src/server/shared/Logging/LogWorker.h2
-rw-r--r--src/server/shared/Logging/Logger.cpp2
-rw-r--r--src/server/shared/Logging/Logger.h2
-rw-r--r--src/server/shared/Packets/ByteBuffer.cpp2
-rw-r--r--src/server/shared/Packets/ByteBuffer.h2
-rw-r--r--src/server/shared/Packets/WorldPacket.h2
-rw-r--r--src/server/shared/SystemConfig.h2
-rw-r--r--src/server/shared/Threading/Callback.h2
-rw-r--r--src/server/shared/Threading/LockedQueue.h2
-rw-r--r--src/server/shared/Threading/Threading.cpp2
-rw-r--r--src/server/shared/Threading/Threading.h2
-rw-r--r--src/server/shared/Utilities/ByteConverter.h2
-rw-r--r--src/server/shared/Utilities/EventProcessor.cpp2
-rw-r--r--src/server/shared/Utilities/EventProcessor.h9
-rw-r--r--src/server/shared/Utilities/ServiceWin32.cpp2
-rw-r--r--src/server/shared/Utilities/ServiceWin32.h2
-rw-r--r--src/server/shared/Utilities/SignalHandler.h2
-rw-r--r--src/server/shared/Utilities/Timer.h2
-rw-r--r--src/server/shared/Utilities/Util.cpp2
-rw-r--r--src/server/shared/Utilities/Util.h2
-rw-r--r--src/server/worldserver/CMakeLists.txt2
-rw-r--r--src/server/worldserver/CommandLine/CliRunnable.cpp2
-rw-r--r--src/server/worldserver/CommandLine/CliRunnable.h2
-rw-r--r--src/server/worldserver/Main.cpp2
-rw-r--r--src/server/worldserver/Master.cpp8
-rw-r--r--src/server/worldserver/Master.h2
-rw-r--r--src/server/worldserver/RemoteAccess/RARunnable.cpp2
-rw-r--r--src/server/worldserver/RemoteAccess/RARunnable.h2
-rw-r--r--src/server/worldserver/RemoteAccess/RASocket.cpp2
-rw-r--r--src/server/worldserver/RemoteAccess/RASocket.h2
-rw-r--r--src/server/worldserver/TCSoap/TCSoap.cpp2
-rw-r--r--src/server/worldserver/TCSoap/TCSoap.h2
-rw-r--r--src/server/worldserver/WorldThread/WorldRunnable.cpp2
-rw-r--r--src/server/worldserver/WorldThread/WorldRunnable.h2
-rw-r--r--src/server/worldserver/worldserver.conf.dist72
-rw-r--r--src/server/worldserver/worldserver.rc2
-rw-r--r--src/tools/CMakeLists.txt2
-rw-r--r--src/tools/map_extractor/CMakeLists.txt2
-rw-r--r--src/tools/map_extractor/System.cpp2
-rw-r--r--src/tools/map_extractor/adt.cpp2
-rw-r--r--src/tools/map_extractor/adt.h4
-rw-r--r--src/tools/map_extractor/dbcfile.cpp2
-rw-r--r--src/tools/map_extractor/dbcfile.h2
-rw-r--r--src/tools/map_extractor/loadlib.cpp2
-rw-r--r--src/tools/map_extractor/loadlib/loadlib.h2
-rw-r--r--src/tools/map_extractor/mpq_libmpq.cpp2
-rw-r--r--src/tools/map_extractor/mpq_libmpq04.h2
-rw-r--r--src/tools/map_extractor/wdt.cpp2
-rw-r--r--src/tools/map_extractor/wdt.h2
-rw-r--r--src/tools/mesh_extractor/ADT.cpp2
-rw-r--r--src/tools/mesh_extractor/ADT.h2
-rw-r--r--src/tools/mesh_extractor/CMakeLists.txt2
-rw-r--r--src/tools/mesh_extractor/Cache.h2
-rw-r--r--src/tools/mesh_extractor/Chunk.cpp2
-rw-r--r--src/tools/mesh_extractor/Chunk.h2
-rw-r--r--src/tools/mesh_extractor/ChunkedData.cpp2
-rw-r--r--src/tools/mesh_extractor/ChunkedData.h2
-rw-r--r--src/tools/mesh_extractor/Constants.h2
-rw-r--r--src/tools/mesh_extractor/ContinentBuilder.cpp2
-rw-r--r--src/tools/mesh_extractor/ContinentBuilder.h2
-rw-r--r--src/tools/mesh_extractor/DBC.cpp2
-rw-r--r--src/tools/mesh_extractor/DBC.h2
-rw-r--r--src/tools/mesh_extractor/DoodadHandler.cpp2
-rw-r--r--src/tools/mesh_extractor/DoodadHandler.h2
-rw-r--r--src/tools/mesh_extractor/Geometry.cpp2
-rw-r--r--src/tools/mesh_extractor/Geometry.h2
-rw-r--r--src/tools/mesh_extractor/LiquidHandler.cpp2
-rw-r--r--src/tools/mesh_extractor/LiquidHandler.h2
-rw-r--r--src/tools/mesh_extractor/MPQ.cpp2
-rw-r--r--src/tools/mesh_extractor/MPQ.h2
-rw-r--r--src/tools/mesh_extractor/MPQManager.cpp2
-rw-r--r--src/tools/mesh_extractor/MPQManager.h2
-rw-r--r--src/tools/mesh_extractor/MapChunk.cpp2
-rw-r--r--src/tools/mesh_extractor/MapChunk.h2
-rw-r--r--src/tools/mesh_extractor/MeshExtractor.cpp2
-rw-r--r--src/tools/mesh_extractor/Model.cpp2
-rw-r--r--src/tools/mesh_extractor/Model.h2
-rw-r--r--src/tools/mesh_extractor/ObjectDataHandler.cpp2
-rw-r--r--src/tools/mesh_extractor/ObjectDataHandler.h2
-rw-r--r--src/tools/mesh_extractor/TileBuilder.cpp2
-rw-r--r--src/tools/mesh_extractor/TileBuilder.h2
-rw-r--r--src/tools/mesh_extractor/Utils.cpp2
-rw-r--r--src/tools/mesh_extractor/Utils.h2
-rw-r--r--src/tools/mesh_extractor/WDT.cpp2
-rw-r--r--src/tools/mesh_extractor/WDT.h2
-rw-r--r--src/tools/mesh_extractor/WorldModelGroup.cpp2
-rw-r--r--src/tools/mesh_extractor/WorldModelGroup.h2
-rw-r--r--src/tools/mesh_extractor/WorldModelHandler.cpp2
-rw-r--r--src/tools/mesh_extractor/WorldModelHandler.h2
-rw-r--r--src/tools/mesh_extractor/WorldModelRoot.cpp2
-rw-r--r--src/tools/mesh_extractor/WorldModelRoot.h2
-rw-r--r--src/tools/mmaps_generator/CMakeLists.txt2
-rw-r--r--src/tools/mmaps_generator/IntermediateValues.cpp2
-rw-r--r--src/tools/mmaps_generator/IntermediateValues.h2
-rw-r--r--src/tools/mmaps_generator/MapBuilder.cpp2
-rw-r--r--src/tools/mmaps_generator/MapBuilder.h2
-rw-r--r--src/tools/mmaps_generator/PathCommon.h2
-rw-r--r--src/tools/mmaps_generator/PathGenerator.cpp2
-rw-r--r--src/tools/mmaps_generator/TerrainBuilder.cpp2
-rw-r--r--src/tools/mmaps_generator/TerrainBuilder.h2
-rw-r--r--src/tools/mmaps_generator/VMapExtensions.cpp2
-rw-r--r--src/tools/vmap4_assembler/CMakeLists.txt2
-rw-r--r--src/tools/vmap4_assembler/VMapAssembler.cpp2
-rw-r--r--src/tools/vmap4_extractor/CMakeLists.txt2
-rw-r--r--src/tools/vmap4_extractor/adtfile.cpp2
-rw-r--r--src/tools/vmap4_extractor/adtfile.h2
-rw-r--r--src/tools/vmap4_extractor/dbcfile.cpp2
-rw-r--r--src/tools/vmap4_extractor/dbcfile.h2
-rw-r--r--src/tools/vmap4_extractor/gameobject_extract.cpp2
-rw-r--r--src/tools/vmap4_extractor/loadlib/loadlib.h2
-rw-r--r--src/tools/vmap4_extractor/model.cpp2
-rw-r--r--src/tools/vmap4_extractor/model.h2
-rw-r--r--src/tools/vmap4_extractor/modelheaders.h2
-rw-r--r--src/tools/vmap4_extractor/mpq_libmpq.cpp2
-rw-r--r--src/tools/vmap4_extractor/mpq_libmpq04.h2
-rw-r--r--src/tools/vmap4_extractor/vec3d.h2
-rw-r--r--src/tools/vmap4_extractor/vmapexport.cpp2
-rw-r--r--src/tools/vmap4_extractor/vmapexport.h2
-rw-r--r--src/tools/vmap4_extractor/wdtfile.cpp2
-rw-r--r--src/tools/vmap4_extractor/wdtfile.h2
-rw-r--r--src/tools/vmap4_extractor/wmo.cpp2
-rw-r--r--src/tools/vmap4_extractor/wmo.h2
1311 files changed, 11833 insertions, 11448 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 11cd235f366..e7d7576c138 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/genrev/CMakeLists.txt b/src/genrev/CMakeLists.txt
index b54534af827..8acee875bc0 100644
--- a/src/genrev/CMakeLists.txt
+++ b/src/genrev/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt
index 646b89b6f80..05cbe51b15d 100644
--- a/src/server/CMakeLists.txt
+++ b/src/server/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/authserver/Authentication/AuthCodes.cpp b/src/server/authserver/Authentication/AuthCodes.cpp
index b47ef21b24b..1bf5dcad51f 100644
--- a/src/server/authserver/Authentication/AuthCodes.cpp
+++ b/src/server/authserver/Authentication/AuthCodes.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/authserver/Authentication/AuthCodes.h b/src/server/authserver/Authentication/AuthCodes.h
index df7de3ed684..5e6522f8981 100644
--- a/src/server/authserver/Authentication/AuthCodes.h
+++ b/src/server/authserver/Authentication/AuthCodes.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/authserver/Authentication/TOTP.cpp b/src/server/authserver/Authentication/TOTP.cpp
index 51a21822bc0..01842cfe234 100644
--- a/src/server/authserver/Authentication/TOTP.cpp
+++ b/src/server/authserver/Authentication/TOTP.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/authserver/Authentication/TOTP.h b/src/server/authserver/Authentication/TOTP.h
index 3080e7c7787..04b4a8c2110 100644
--- a/src/server/authserver/Authentication/TOTP.h
+++ b/src/server/authserver/Authentication/TOTP.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/authserver/CMakeLists.txt b/src/server/authserver/CMakeLists.txt
index ff3a4cdd67c..4391ac0450a 100644
--- a/src/server/authserver/CMakeLists.txt
+++ b/src/server/authserver/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp
index 80a810e4ce1..28e9f324c19 100644
--- a/src/server/authserver/Main.cpp
+++ b/src/server/authserver/Main.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -229,7 +229,7 @@ extern int main(int argc, char** argv)
{
CPU_ZERO(&mask);
sched_getaffinity(0, sizeof(mask), &mask);
- TC_LOG_INFO("server.authserver", "Using processors (bitmask, hex): %x", *(uint32*)(&mask));
+ TC_LOG_INFO("server.authserver", "Using processors (bitmask, hex): %lx", *(__cpu_mask*)(&mask));
}
}
diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp
index 34120f75e88..4aeecfc0aaa 100644
--- a/src/server/authserver/Realms/RealmList.cpp
+++ b/src/server/authserver/Realms/RealmList.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h
index bf9493ad372..1d76c39e4f0 100644
--- a/src/server/authserver/Realms/RealmList.h
+++ b/src/server/authserver/Realms/RealmList.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp
index 6595b6238b2..67d3975815f 100644
--- a/src/server/authserver/Server/AuthSocket.cpp
+++ b/src/server/authserver/Server/AuthSocket.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -443,7 +443,7 @@ bool AuthSocket::_HandleLogonChallenge()
if (!locked)
{
//set expired bans to inactive
- LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS));
+ LoginDatabase.DirectExecute(LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS));
// If the account is banned, reject the logon attempt
stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BANNED);
diff --git a/src/server/authserver/Server/AuthSocket.h b/src/server/authserver/Server/AuthSocket.h
index c6513eaa5bf..5e04d459ba1 100644
--- a/src/server/authserver/Server/AuthSocket.h
+++ b/src/server/authserver/Server/AuthSocket.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/authserver/Server/RealmAcceptor.h b/src/server/authserver/Server/RealmAcceptor.h
index 39877f71538..e89135c4896 100644
--- a/src/server/authserver/Server/RealmAcceptor.h
+++ b/src/server/authserver/Server/RealmAcceptor.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/authserver/Server/RealmSocket.cpp b/src/server/authserver/Server/RealmSocket.cpp
index 13bc71f99a4..1013639cc50 100644
--- a/src/server/authserver/Server/RealmSocket.cpp
+++ b/src/server/authserver/Server/RealmSocket.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/authserver/Server/RealmSocket.h b/src/server/authserver/Server/RealmSocket.h
index 24f2a5dc109..c1190d638b3 100644
--- a/src/server/authserver/Server/RealmSocket.h
+++ b/src/server/authserver/Server/RealmSocket.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/authserver/authserver.rc b/src/server/authserver/authserver.rc
index acfed6323ae..6ceaa135b42 100644
--- a/src/server/authserver/authserver.rc
+++ b/src/server/authserver/authserver.rc
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/BoundingIntervalHierarchy.cpp b/src/server/collision/BoundingIntervalHierarchy.cpp
index c5ae1f2a265..d90009c03f3 100644
--- a/src/server/collision/BoundingIntervalHierarchy.cpp
+++ b/src/server/collision/BoundingIntervalHierarchy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/BoundingIntervalHierarchy.h b/src/server/collision/BoundingIntervalHierarchy.h
index 997f9c99e5f..4d38bfc18c4 100644
--- a/src/server/collision/BoundingIntervalHierarchy.h
+++ b/src/server/collision/BoundingIntervalHierarchy.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/BoundingIntervalHierarchyWrapper.h b/src/server/collision/BoundingIntervalHierarchyWrapper.h
index 8aafc023a20..955a394fb40 100644
--- a/src/server/collision/BoundingIntervalHierarchyWrapper.h
+++ b/src/server/collision/BoundingIntervalHierarchyWrapper.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/CMakeLists.txt b/src/server/collision/CMakeLists.txt
index f254ffda94c..a83bb9dad1c 100644
--- a/src/server/collision/CMakeLists.txt
+++ b/src/server/collision/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/collision/DynamicTree.cpp b/src/server/collision/DynamicTree.cpp
index 2f4985757db..f6d85df704a 100644
--- a/src/server/collision/DynamicTree.cpp
+++ b/src/server/collision/DynamicTree.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/DynamicTree.h b/src/server/collision/DynamicTree.h
index 8e541fd453a..1657302de5d 100644
--- a/src/server/collision/DynamicTree.h
+++ b/src/server/collision/DynamicTree.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Management/IVMapManager.h b/src/server/collision/Management/IVMapManager.h
index 7269d2e05f4..02c2905345a 100644
--- a/src/server/collision/Management/IVMapManager.h
+++ b/src/server/collision/Management/IVMapManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Management/MMapFactory.cpp b/src/server/collision/Management/MMapFactory.cpp
index 6aa71d77ed8..b08cd92d638 100644
--- a/src/server/collision/Management/MMapFactory.cpp
+++ b/src/server/collision/Management/MMapFactory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Management/MMapFactory.h b/src/server/collision/Management/MMapFactory.h
index 038d44a941c..837c893f038 100644
--- a/src/server/collision/Management/MMapFactory.h
+++ b/src/server/collision/Management/MMapFactory.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Management/MMapManager.cpp b/src/server/collision/Management/MMapManager.cpp
index 4e6b3bb6d10..cbb10923fe0 100644
--- a/src/server/collision/Management/MMapManager.cpp
+++ b/src/server/collision/Management/MMapManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Management/MMapManager.h b/src/server/collision/Management/MMapManager.h
index 9a04d638805..8b0d42b83cd 100644
--- a/src/server/collision/Management/MMapManager.h
+++ b/src/server/collision/Management/MMapManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Management/VMapFactory.cpp b/src/server/collision/Management/VMapFactory.cpp
index 4d3719cf288..f4b92060ba3 100644
--- a/src/server/collision/Management/VMapFactory.cpp
+++ b/src/server/collision/Management/VMapFactory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Management/VMapFactory.h b/src/server/collision/Management/VMapFactory.h
index 1545a8f6977..d09f4c50259 100644
--- a/src/server/collision/Management/VMapFactory.h
+++ b/src/server/collision/Management/VMapFactory.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp
index 975c6777774..813a3c04288 100644
--- a/src/server/collision/Management/VMapManager2.cpp
+++ b/src/server/collision/Management/VMapManager2.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Management/VMapManager2.h b/src/server/collision/Management/VMapManager2.h
index 644e6004201..abddd5d7cc3 100644
--- a/src/server/collision/Management/VMapManager2.h
+++ b/src/server/collision/Management/VMapManager2.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Maps/MapTree.cpp b/src/server/collision/Maps/MapTree.cpp
index 8cb1e3d7064..bb57079c389 100644
--- a/src/server/collision/Maps/MapTree.cpp
+++ b/src/server/collision/Maps/MapTree.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Maps/MapTree.h b/src/server/collision/Maps/MapTree.h
index 1440ee0f250..90d61cbb88b 100644
--- a/src/server/collision/Maps/MapTree.h
+++ b/src/server/collision/Maps/MapTree.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp
index 5b38d9f4e18..f8326e0a8ec 100644
--- a/src/server/collision/Maps/TileAssembler.cpp
+++ b/src/server/collision/Maps/TileAssembler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Maps/TileAssembler.h b/src/server/collision/Maps/TileAssembler.h
index 715f228c3df..26a884551cd 100644
--- a/src/server/collision/Maps/TileAssembler.h
+++ b/src/server/collision/Maps/TileAssembler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp
index 8bba2cf1b1b..d254a640279 100644
--- a/src/server/collision/Models/GameObjectModel.cpp
+++ b/src/server/collision/Models/GameObjectModel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Models/GameObjectModel.h b/src/server/collision/Models/GameObjectModel.h
index 143337e88f9..06a74cc6eb0 100644
--- a/src/server/collision/Models/GameObjectModel.h
+++ b/src/server/collision/Models/GameObjectModel.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Models/ModelInstance.cpp b/src/server/collision/Models/ModelInstance.cpp
index 55759ea20c4..3262c154965 100644
--- a/src/server/collision/Models/ModelInstance.cpp
+++ b/src/server/collision/Models/ModelInstance.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Models/ModelInstance.h b/src/server/collision/Models/ModelInstance.h
index 8ea2792393b..3ea68f57ba4 100644
--- a/src/server/collision/Models/ModelInstance.h
+++ b/src/server/collision/Models/ModelInstance.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp
index fcb28e5e331..99f3782215d 100644
--- a/src/server/collision/Models/WorldModel.cpp
+++ b/src/server/collision/Models/WorldModel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/Models/WorldModel.h b/src/server/collision/Models/WorldModel.h
index 309b6d8051c..8778998a6b7 100644
--- a/src/server/collision/Models/WorldModel.h
+++ b/src/server/collision/Models/WorldModel.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/VMapDefinitions.h b/src/server/collision/VMapDefinitions.h
index f51fdcc2d2b..0bc74df51ec 100644
--- a/src/server/collision/VMapDefinitions.h
+++ b/src/server/collision/VMapDefinitions.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/collision/VMapTools.h b/src/server/collision/VMapTools.h
index 5aefda6deb4..3951955a446 100644
--- a/src/server/collision/VMapTools.h
+++ b/src/server/collision/VMapTools.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp
index 4f015e3f016..943919451a9 100644
--- a/src/server/game/AI/CoreAI/CombatAI.cpp
+++ b/src/server/game/AI/CoreAI/CombatAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -23,6 +23,10 @@
#include "ObjectAccessor.h"
#include "Player.h"
+/////////////////
+// AggressorAI
+/////////////////
+
int AggressorAI::Permissible(const Creature* creature)
{
// have some hostile factions, it will be selected by IsHostileTo check at MoveInLineOfSight
@@ -40,26 +44,9 @@ void AggressorAI::UpdateAI(uint32 /*diff*/)
DoMeleeAttackIfReady();
}
-// some day we will delete these useless things
-int CombatAI::Permissible(const Creature* /*creature*/)
-{
- return PERMIT_BASE_NO;
-}
-
-int ArcherAI::Permissible(const Creature* /*creature*/)
-{
- return PERMIT_BASE_NO;
-}
-
-int TurretAI::Permissible(const Creature* /*creature*/)
-{
- return PERMIT_BASE_NO;
-}
-
-int VehicleAI::Permissible(const Creature* /*creature*/)
-{
- return PERMIT_BASE_NO;
-}
+/////////////////
+// CombatAI
+/////////////////
void CombatAI::InitializeAI()
{
@@ -118,7 +105,7 @@ void CombatAI::SpellInterrupted(uint32 spellId, uint32 unTimeMs)
}
/////////////////
-//CasterAI
+// CasterAI
/////////////////
void CasterAI::InitializeAI()
@@ -182,7 +169,7 @@ void CasterAI::UpdateAI(uint32 diff)
}
//////////////
-//ArcherAI
+// ArcherAI
//////////////
ArcherAI::ArcherAI(Creature* c) : CreatureAI(c)
@@ -231,7 +218,7 @@ void ArcherAI::UpdateAI(uint32 /*diff*/)
}
//////////////
-//TurretAI
+// TurretAI
//////////////
TurretAI::TurretAI(Creature* c) : CreatureAI(c)
@@ -269,17 +256,17 @@ void TurretAI::UpdateAI(uint32 /*diff*/)
}
//////////////
-//VehicleAI
+// VehicleAI
//////////////
-VehicleAI::VehicleAI(Creature* c) : CreatureAI(c), m_IsVehicleInUse(false), m_ConditionsTimer(VEHICLE_CONDITION_CHECK_TIME)
+VehicleAI::VehicleAI(Creature* creature) : CreatureAI(creature), m_ConditionsTimer(VEHICLE_CONDITION_CHECK_TIME)
{
LoadConditions();
m_DoDismiss = false;
m_DismissTimer = VEHICLE_DISMISS_TIME;
}
-//NOTE: VehicleAI::UpdateAI runs even while the vehicle is mounted
+// NOTE: VehicleAI::UpdateAI runs even while the vehicle is mounted
void VehicleAI::UpdateAI(uint32 diff)
{
CheckConditions(diff);
@@ -289,7 +276,6 @@ void VehicleAI::UpdateAI(uint32 diff)
if (m_DismissTimer < diff)
{
m_DoDismiss = false;
- me->SetVisible(false);
me->DespawnOrUnsummon();
}
else
@@ -297,24 +283,16 @@ void VehicleAI::UpdateAI(uint32 diff)
}
}
-void VehicleAI::Reset()
-{
- me->SetVisible(true);
-}
-
void VehicleAI::OnCharmed(bool apply)
{
- if (m_IsVehicleInUse && !apply && !conditions.empty())//was used and has conditions
+ if (!me->GetVehicleKit()->IsVehicleInUse() && !apply && !conditions.empty()) // was used and has conditions
{
- m_DoDismiss = true;//needs reset
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_PLAYER_VEHICLE);
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
+ m_DoDismiss = true; // needs reset
}
else if (apply)
- m_DoDismiss = false;//in use again
+ m_DoDismiss = false; // in use again
- m_DismissTimer = VEHICLE_DISMISS_TIME;//reset timer
- m_IsVehicleInUse = apply;
+ m_DismissTimer = VEHICLE_DISMISS_TIME; // reset timer
}
void VehicleAI::LoadConditions()
@@ -324,7 +302,7 @@ void VehicleAI::LoadConditions()
TC_LOG_DEBUG("condition", "VehicleAI::LoadConditions: loaded %u conditions", uint32(conditions.size()));
}
-void VehicleAI::CheckConditions(const uint32 diff)
+void VehicleAI::CheckConditions(uint32 diff)
{
if (m_ConditionsTimer < diff)
{
@@ -339,7 +317,7 @@ void VehicleAI::CheckConditions(const uint32 diff)
if (!sConditionMgr->IsObjectMeetToConditions(player, me, conditions))
{
player->ExitVehicle();
- return;//check other pessanger in next tick
+ return; // check other pessanger in next tick
}
}
}
diff --git a/src/server/game/AI/CoreAI/CombatAI.h b/src/server/game/AI/CoreAI/CombatAI.h
index 3fac2c78962..f73daa2d720 100644
--- a/src/server/game/AI/CoreAI/CombatAI.h
+++ b/src/server/game/AI/CoreAI/CombatAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -47,7 +47,9 @@ class CombatAI : public CreatureAI
void JustDied(Unit* killer);
void UpdateAI(uint32 diff);
void SpellInterrupted(uint32 spellId, uint32 unTimeMs);
- static int Permissible(const Creature*);
+
+ static int Permissible(Creature const* /*creature*/) { return PERMIT_BASE_NO; }
+
protected:
EventMap events;
SpellVct spells;
@@ -72,7 +74,8 @@ struct ArcherAI : public CreatureAI
void AttackStart(Unit* who);
void UpdateAI(uint32 diff);
- static int Permissible(Creature const*);
+ static int Permissible(Creature const* /*creature*/) { return PERMIT_BASE_NO; }
+
protected:
float m_minRange;
};
@@ -85,29 +88,30 @@ struct TurretAI : public CreatureAI
void AttackStart(Unit* who);
void UpdateAI(uint32 diff);
- static int Permissible(Creature const*);
+ static int Permissible(Creature const* /*creature*/) { return PERMIT_BASE_NO; }
+
protected:
float m_minRange;
};
#define VEHICLE_CONDITION_CHECK_TIME 1000
#define VEHICLE_DISMISS_TIME 5000
+
struct VehicleAI : public CreatureAI
{
public:
- explicit VehicleAI(Creature* c);
+ explicit VehicleAI(Creature* creature);
void UpdateAI(uint32 diff);
- static int Permissible(Creature const*);
- void Reset();
void MoveInLineOfSight(Unit*) { }
void AttackStart(Unit*) { }
void OnCharmed(bool apply);
+ static int Permissible(Creature const* /*creature*/) { return PERMIT_BASE_NO; }
+
private:
- bool m_IsVehicleInUse;
void LoadConditions();
- void CheckConditions(const uint32 diff);
+ void CheckConditions(uint32 diff);
ConditionList conditions;
uint32 m_ConditionsTimer;
bool m_DoDismiss;
diff --git a/src/server/game/AI/CoreAI/GameObjectAI.cpp b/src/server/game/AI/CoreAI/GameObjectAI.cpp
index adc82d7b018..35f1c0ed7b8 100644
--- a/src/server/game/AI/CoreAI/GameObjectAI.cpp
+++ b/src/server/game/AI/CoreAI/GameObjectAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h
index 0d5af4f8802..36ca2c3253f 100644
--- a/src/server/game/AI/CoreAI/GameObjectAI.h
+++ b/src/server/game/AI/CoreAI/GameObjectAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
#include "Define.h"
#include <list>
#include "Object.h"
+#include "QuestDef.h"
#include "GameObject.h"
#include "CreatureAI.h"
@@ -51,7 +52,7 @@ class GameObjectAI
virtual bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, char const* /*code*/) { return false; }
virtual bool QuestAccept(Player* /*player*/, Quest const* /*quest*/) { return false; }
virtual bool QuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) { return false; }
- virtual uint32 GetDialogStatus(Player* /*player*/) { return 100; }
+ virtual uint32 GetDialogStatus(Player* /*player*/) { return DIALOG_STATUS_SCRIPTED_NO_STATUS; }
virtual void Destroyed(Player* /*player*/, uint32 /*eventId*/) { }
virtual uint32 GetData(uint32 /*id*/) const { return 0; }
virtual void SetData64(uint32 /*id*/, uint64 /*value*/) { }
diff --git a/src/server/game/AI/CoreAI/GuardAI.cpp b/src/server/game/AI/CoreAI/GuardAI.cpp
index c38be3aa22a..6a87114171b 100644
--- a/src/server/game/AI/CoreAI/GuardAI.cpp
+++ b/src/server/game/AI/CoreAI/GuardAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/CoreAI/GuardAI.h b/src/server/game/AI/CoreAI/GuardAI.h
index 1a8b220cb43..9af047e8906 100644
--- a/src/server/game/AI/CoreAI/GuardAI.h
+++ b/src/server/game/AI/CoreAI/GuardAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/CoreAI/PassiveAI.cpp b/src/server/game/AI/CoreAI/PassiveAI.cpp
index e3f852d08eb..07987cf8cec 100644
--- a/src/server/game/AI/CoreAI/PassiveAI.cpp
+++ b/src/server/game/AI/CoreAI/PassiveAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/CoreAI/PassiveAI.h b/src/server/game/AI/CoreAI/PassiveAI.h
index 58c9a348fe9..33bfde4f9f2 100644
--- a/src/server/game/AI/CoreAI/PassiveAI.h
+++ b/src/server/game/AI/CoreAI/PassiveAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp
index 1f312de73f6..d6e749b942a 100644
--- a/src/server/game/AI/CoreAI/PetAI.cpp
+++ b/src/server/game/AI/CoreAI/PetAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -131,7 +131,7 @@ void PetAI::UpdateAI(uint32 diff)
HandleReturnMovement();
}
- // Autocast (casted only in combat or persistent spells in any state)
+ // Autocast (cast only in combat or persistent spells in any state)
if (!me->HasUnitState(UNIT_STATE_CASTING))
{
typedef std::vector<std::pair<Unit*, Spell*> > TargetSpellList;
@@ -409,7 +409,7 @@ Unit* PetAI::SelectNextTarget(bool allowAutoSelect) const
if (me->HasReactState(REACT_AGGRESSIVE) && allowAutoSelect)
{
if (!me->GetCharmInfo()->IsReturning() || me->GetCharmInfo()->IsFollowing() || me->GetCharmInfo()->IsAtStay())
- if (Unit* nearTarget = me->ToCreature()->SelectNearestHostileUnitInAggroRange(true))
+ if (Unit* nearTarget = me->SelectNearestHostileUnitInAggroRange(true))
return nearTarget;
}
diff --git a/src/server/game/AI/CoreAI/PetAI.h b/src/server/game/AI/CoreAI/PetAI.h
index 9cce00440e1..450f68443f0 100644
--- a/src/server/game/AI/CoreAI/PetAI.h
+++ b/src/server/game/AI/CoreAI/PetAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -57,7 +57,6 @@ class PetAI : public CreatureAI
void UpdateAllies();
TimeTracker i_tracker;
- bool inCombat;
std::set<uint64> m_AllySet;
uint32 m_updateAlliesTimer;
diff --git a/src/server/game/AI/CoreAI/ReactorAI.cpp b/src/server/game/AI/CoreAI/ReactorAI.cpp
index d749ce91c05..0f94d18acce 100644
--- a/src/server/game/AI/CoreAI/ReactorAI.cpp
+++ b/src/server/game/AI/CoreAI/ReactorAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/CoreAI/ReactorAI.h b/src/server/game/AI/CoreAI/ReactorAI.h
index 42f9c425ceb..417944f9ba2 100644
--- a/src/server/game/AI/CoreAI/ReactorAI.h
+++ b/src/server/game/AI/CoreAI/ReactorAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/CoreAI/TotemAI.cpp b/src/server/game/AI/CoreAI/TotemAI.cpp
index 6f8452176e5..245a47dbe64 100644
--- a/src/server/game/AI/CoreAI/TotemAI.cpp
+++ b/src/server/game/AI/CoreAI/TotemAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
if (me->ToTotem()->GetTotemType() != TOTEM_ACTIVE)
return;
- if (!me->IsAlive() || me->IsNonMeleeSpellCasted(false))
+ if (!me->IsAlive() || me->IsNonMeleeSpellCast(false))
return;
// Search spell
diff --git a/src/server/game/AI/CoreAI/TotemAI.h b/src/server/game/AI/CoreAI/TotemAI.h
index 897cfea1c44..4d5f03566ba 100644
--- a/src/server/game/AI/CoreAI/TotemAI.h
+++ b/src/server/game/AI/CoreAI/TotemAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp
index 9abdf9e8cfc..8bf34527769 100644
--- a/src/server/game/AI/CoreAI/UnitAI.cpp
+++ b/src/server/game/AI/CoreAI/UnitAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
void UnitAI::AttackStart(Unit* victim)
{
+
if (victim && me->Attack(victim, true))
me->GetMotionMaster()->MoveChase(victim);
}
@@ -44,14 +45,18 @@ void UnitAI::DoMeleeAttackIfReady()
return;
Unit* victim = me->GetVictim();
+
+ if (!me->IsWithinMeleeRange(victim))
+ return;
+
//Make sure our attack is ready and we aren't currently casting before checking distance
- if (me->isAttackReady() && me->IsWithinMeleeRange(victim))
+ if (me->isAttackReady())
{
me->AttackerStateUpdate(victim);
me->resetAttackTimer();
}
- if (me->haveOffhandWeapon() && me->isAttackReady(OFF_ATTACK) && me->IsWithinMeleeRange(victim))
+ if (me->haveOffhandWeapon() && me->isAttackReady(OFF_ATTACK))
{
me->AttackerStateUpdate(victim, OFF_ATTACK);
me->resetAttackTimer(OFF_ATTACK);
diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h
index 33a09fd03b0..960d9f8903b 100644
--- a/src/server/game/AI/CoreAI/UnitAI.h
+++ b/src/server/game/AI/CoreAI/UnitAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 2ec0e4ff3ca..07c75eb424f 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -38,9 +38,9 @@ void CreatureAI::OnCharmed(bool /*apply*/)
AISpellInfoType* UnitAI::AISpellInfo;
AISpellInfoType* GetAISpellInfo(uint32 i) { return &CreatureAI::AISpellInfo[i]; }
-void CreatureAI::Talk(uint8 id, uint64 WhisperGuid)
+void CreatureAI::Talk(uint8 id, WorldObject const* whisperTarget /*= NULL*/)
{
- sCreatureTextMgr->SendChat(me, id, WhisperGuid);
+ sCreatureTextMgr->SendChat(me, id, whisperTarget);
}
void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToNearestTarget /* = 50.0f*/)
diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h
index 14cf0a05109..6357ac33f1e 100644
--- a/src/server/game/AI/CreatureAI.h
+++ b/src/server/game/AI/CreatureAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -78,7 +78,7 @@ class CreatureAI : public UnitAI
Creature* DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius = 5.0f, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN);
public:
- void Talk(uint8 id, uint64 WhisperGuid = 0);
+ void Talk(uint8 id, WorldObject const* whisperTarget = NULL);
explicit CreatureAI(Creature* creature) : UnitAI(creature), me(creature), m_MoveInLineOfSight_locked(false) { }
virtual ~CreatureAI() { }
diff --git a/src/server/game/AI/CreatureAIFactory.h b/src/server/game/AI/CreatureAIFactory.h
index 809c17cadb8..fc2d009e673 100644
--- a/src/server/game/AI/CreatureAIFactory.h
+++ b/src/server/game/AI/CreatureAIFactory.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h
index 6b190938596..7447e290ba9 100644
--- a/src/server/game/AI/CreatureAIImpl.h
+++ b/src/server/game/AI/CreatureAIImpl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/AI/CreatureAIRegistry.cpp b/src/server/game/AI/CreatureAIRegistry.cpp
index 8b74db24a42..512ad124bc0 100644
--- a/src/server/game/AI/CreatureAIRegistry.cpp
+++ b/src/server/game/AI/CreatureAIRegistry.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/CreatureAIRegistry.h b/src/server/game/AI/CreatureAIRegistry.h
index 5ffa171fedf..f8106cd0e1a 100644
--- a/src/server/game/AI/CreatureAIRegistry.h
+++ b/src/server/game/AI/CreatureAIRegistry.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp
index 597ad24d4e1..473af0d787e 100644
--- a/src/server/game/AI/CreatureAISelector.cpp
+++ b/src/server/game/AI/CreatureAISelector.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/CreatureAISelector.h b/src/server/game/AI/CreatureAISelector.h
index f399b0985b1..6864c3ba405 100644
--- a/src/server/game/AI/CreatureAISelector.h
+++ b/src/server/game/AI/CreatureAISelector.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
index 68c7869f8b7..36c1d384693 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -156,7 +156,7 @@ void ScriptedAI::DoStopAttack()
void ScriptedAI::DoCastSpell(Unit* target, SpellInfo const* spellInfo, bool triggered)
{
- if (!target || me->IsNonMeleeSpellCasted(false))
+ if (!target || me->IsNonMeleeSpellCast(false))
return;
me->StopMoving();
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
index a111898e3e1..cee6ba3c379 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index dbc8989c530..dcf5bd56fa6 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
index 280990fd648..4aa00d74e4e 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index 5cc128fda5f..0fbfc2cebac 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
index c1fa3275bb8..df435fa5c9a 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/ScriptedAI/ScriptedGossip.h b/src/server/game/AI/ScriptedAI/ScriptedGossip.h
index 5e76c1f83f4..d8797a688c0 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedGossip.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedGossip.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index c367ba0a5ed..a203aeb6b97 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -67,7 +67,10 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
mFollowCredit = 0;
mFollowArrivedEntry = 0;
mFollowCreditType = 0;
+ mFollowArrivedTimer = 0;
mInvincibilityHpLevel = 0;
+
+ mJustReset = false;
}
void SmartAI::UpdateDespawn(const uint32 diff)
@@ -88,13 +91,6 @@ void SmartAI::UpdateDespawn(const uint32 diff)
} else mDespawnTime -= diff;
}
-void SmartAI::Reset()
-{
- if (!HasEscortState(SMART_ESCORT_ESCORTING))//dont mess up escort movement after combat
- SetRun(mRun);
- GetScript()->OnReset();
-}
-
WayPoint* SmartAI::GetNextWayPoint()
{
if (!mWayPoints || mWayPoints->empty())
@@ -343,27 +339,10 @@ void SmartAI::UpdateAI(uint32 diff)
{
if (me->FindNearestCreature(mFollowArrivedEntry, INTERACTION_DISTANCE, true))
{
- if (Player* player = ObjectAccessor::GetPlayer(*me, mFollowGuid))
- {
- if (!mFollowCreditType)
- player->RewardPlayerAndGroupAtEvent(mFollowCredit, me);
- else
- player->GroupEventHappens(mFollowCredit, me);
- }
- mFollowGuid = 0;
- mFollowDist = 0;
- mFollowAngle = 0;
- mFollowCredit = 0;
- mFollowArrivedTimer = 1000;
- mFollowArrivedEntry = 0;
- mFollowCreditType = 0;
- SetDespawnTime(5000);
- me->StopMoving();
- me->GetMotionMaster()->MoveIdle();
- StartDespawn();
- GetScript()->ProcessEventsFor(SMART_EVENT_FOLLOW_COMPLETED);
+ StopFollow();
return;
}
+
mFollowArrivedTimer = 1000;
}
else
@@ -460,6 +439,8 @@ void SmartAI::EnterEvadeMode()
me->LoadCreaturesAddon();
me->SetLootRecipient(NULL);
me->ResetPlayerDamageReq();
+ me->SetLastDamagedTime(0);
+
GetScript()->ProcessEventsFor(SMART_EVENT_EVADE);//must be after aura clear so we can cast spells from db
SetRun(mRun);
@@ -476,7 +457,8 @@ void SmartAI::EnterEvadeMode()
else
me->GetMotionMaster()->MoveTargetedHome();
- Reset();
+ if (!HasEscortState(SMART_ESCORT_ESCORTING))//dont mess up escort movement after combat
+ SetRun(mRun);
}
void SmartAI::MoveInLineOfSight(Unit* who)
@@ -567,7 +549,8 @@ void SmartAI::JustRespawned()
if (me->getFaction() != me->GetCreatureTemplate()->faction_A)
me->RestoreFaction();
GetScript()->ProcessEventsFor(SMART_EVENT_RESPAWN);
- Reset();
+ mJustReset = true;
+ JustReachedHome();
mFollowGuid = 0;//do not reset follower on Reset(), we need it after combat evade
mFollowDist = 0;
mFollowAngle = 0;
@@ -586,10 +569,17 @@ int SmartAI::Permissible(const Creature* creature)
void SmartAI::JustReachedHome()
{
- GetScript()->ProcessEventsFor(SMART_EVENT_REACHED_HOME);
+ GetScript()->OnReset();
+
+ if (!mJustReset)
+ {
+ GetScript()->ProcessEventsFor(SMART_EVENT_REACHED_HOME);
- if (!UpdateVictim() && me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE && me->GetWaypointPath())
- me->ToCreature()->GetMotionMaster()->MovePath(me->GetWaypointPath(), true);
+ if (!UpdateVictim() && me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE && me->GetWaypointPath())
+ me->GetMotionMaster()->MovePath(me->GetWaypointPath(), true);
+ }
+
+ mJustReset = false;
}
void SmartAI::EnterCombat(Unit* enemy)
@@ -597,6 +587,9 @@ void SmartAI::EnterCombat(Unit* enemy)
me->InterruptNonMeleeSpells(false); // must be before ProcessEvents
GetScript()->ProcessEventsFor(SMART_EVENT_AGGRO, enemy);
me->GetPosition(&mLastOOCPos);
+ SetRun(mRun);
+ if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE) == POINT_MOTION_TYPE)
+ me->GetMotionMaster()->MovementExpired();
}
void SmartAI::JustDied(Unit* killer)
@@ -618,16 +611,10 @@ void SmartAI::JustSummoned(Creature* creature)
void SmartAI::AttackStart(Unit* who)
{
- if (who && me->Attack(who, true))
+ if (who && me->Attack(who, me->IsWithinMeleeRange(who)))
{
- SetRun(mRun);
- if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE) == POINT_MOTION_TYPE)
- me->GetMotionMaster()->MovementExpired();
-
if (mCanCombatMove)
me->GetMotionMaster()->MoveChase(who);
-
- me->GetPosition(&mLastOOCPos);
}
}
@@ -692,7 +679,8 @@ void SmartAI::InitializeAI()
{
GetScript()->OnInitialize(me);
if (!me->isDead())
- Reset();
+ mJustReset = true;
+ JustReachedHome();
GetScript()->ProcessEventsFor(SMART_EVENT_RESPAWN);
}
@@ -800,7 +788,11 @@ void SmartAI::SetCombatMove(bool on)
void SmartAI::SetFollow(Unit* target, float dist, float angle, uint32 credit, uint32 end, uint32 creditType)
{
if (!target)
+ {
+ StopFollow();
return;
+ }
+
SetRun(mRun);
mFollowGuid = target->GetGUID();
mFollowDist = dist >= 0.0f ? dist : PET_FOLLOW_DIST;
@@ -812,6 +804,29 @@ void SmartAI::SetFollow(Unit* target, float dist, float angle, uint32 credit, ui
mFollowCreditType = creditType;
}
+void SmartAI::StopFollow()
+{
+ if (Player* player = ObjectAccessor::GetPlayer(*me, mFollowGuid))
+ {
+ if (!mFollowCreditType)
+ player->RewardPlayerAndGroupAtEvent(mFollowCredit, me);
+ else
+ player->GroupEventHappens(mFollowCredit, me);
+ }
+
+ mFollowGuid = 0;
+ mFollowDist = 0;
+ mFollowAngle = 0;
+ mFollowCredit = 0;
+ mFollowArrivedTimer = 1000;
+ mFollowArrivedEntry = 0;
+ mFollowCreditType = 0;
+ SetDespawnTime(5000);
+ me->StopMoving();
+ me->GetMotionMaster()->MoveIdle();
+ StartDespawn();
+ GetScript()->ProcessEventsFor(SMART_EVENT_FOLLOW_COMPLETED);
+}
void SmartAI::SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker)
{
if (invoker)
@@ -891,9 +906,6 @@ bool SmartGameObjectAI::QuestReward(Player* player, Quest const* quest, uint32 o
return false;
}
-// Called when the dialog status between a player and the gameobject is requested.
-uint32 SmartGameObjectAI::GetDialogStatus(Player* /*player*/) { return 100; }
-
// Called when the gameobject is destroyed (destructible buildings only).
void SmartGameObjectAI::Destroyed(Player* player, uint32 eventId)
{
diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h
index 92637b17f25..dcf64b657f8 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.h
+++ b/src/server/game/AI/SmartScripts/SmartAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -63,6 +63,7 @@ class SmartAI : public CreatureAI
void SetCombatMove(bool on);
bool CanCombatMove() { return mCanCombatMove; }
void SetFollow(Unit* target, float dist = 0.0f, float angle = 0.0f, uint32 credit = 0, uint32 end = 0, uint32 creditType = 0);
+ void StopFollow();
void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker);
SmartScript* GetScript() { return &mScript; }
@@ -71,10 +72,7 @@ class SmartAI : public CreatureAI
// Called when creature is spawned or respawned
void JustRespawned();
- // Called after InitializeAI(), EnterEvadeMode() for resetting variables
- void Reset();
-
- // Called at reaching home after evade
+ // Called at reaching home after evade, InitializeAI(), EnterEvadeMode() for resetting variables
void JustReachedHome();
// Called for reaction at enter to combat if not in combat yet (enemy can be NULL)
@@ -232,12 +230,13 @@ class SmartAI : public CreatureAI
uint32 mDespawnState;
void UpdateDespawn(const uint32 diff);
uint32 mEscortInvokerCheckTimer;
+ bool mJustReset;
};
class SmartGameObjectAI : public GameObjectAI
{
public:
- SmartGameObjectAI(GameObject* g) : GameObjectAI(g), go(g) { }
+ SmartGameObjectAI(GameObject* g) : GameObjectAI(g) { }
~SmartGameObjectAI() { }
void UpdateAI(uint32 diff);
@@ -251,7 +250,6 @@ class SmartGameObjectAI : public GameObjectAI
bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/);
bool QuestAccept(Player* player, Quest const* quest);
bool QuestReward(Player* player, Quest const* quest, uint32 opt);
- uint32 GetDialogStatus(Player* /*player*/);
void Destroyed(Player* player, uint32 eventId);
void SetData(uint32 id, uint32 value);
void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker);
@@ -259,8 +257,7 @@ class SmartGameObjectAI : public GameObjectAI
void OnStateChanged(uint32 state, Unit* unit);
void EventInform(uint32 eventId);
- protected:
- GameObject* const go;
+ private:
SmartScript mScript;
};
#endif
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 7555471e091..bd51fe0a85b 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -17,6 +17,7 @@
#include "Cell.h"
#include "CellImpl.h"
+#include "Chat.h"
#include "CreatureTextMgr.h"
#include "DatabaseEnv.h"
#include "GossipDef.h"
@@ -40,41 +41,22 @@
class TrinityStringTextBuilder
{
public:
- TrinityStringTextBuilder(WorldObject* obj, ChatMsg msgtype, int32 id, uint32 language, uint64 targetGUID)
- : _source(obj), _msgType(msgtype), _textId(id), _language(language), _targetGUID(targetGUID)
+ TrinityStringTextBuilder(WorldObject* obj, ChatMsg msgtype, int32 id, uint32 language, WorldObject* target)
+ : _source(obj), _msgType(msgtype), _textId(id), _language(language), _target(target)
{
}
size_t operator()(WorldPacket* data, LocaleConstant locale) const
{
std::string text = sObjectMgr->GetTrinityString(_textId, locale);
- std::string localizedName = _source->GetNameForLocaleIdx(locale);
-
- *data << uint8(_msgType);
- *data << uint32(_language);
- *data << uint64(_source->GetGUID());
- *data << uint32(1); // 2.1.0
- *data << uint32(localizedName.size() + 1);
- *data << localizedName;
- size_t whisperGUIDpos = data->wpos();
- *data << uint64(_targetGUID); // Unit Target
- if (_targetGUID && !IS_PLAYER_GUID(_targetGUID))
- {
- *data << uint32(1); // target name length
- *data << uint8(0); // target name
- }
- *data << uint32(text.length() + 1);
- *data << text;
- *data << uint8(0); // ChatTag
-
- return whisperGUIDpos;
+ return ChatHandler::BuildChatPacket(*data, _msgType, Language(_language), _source, _target, text, 0, "", locale);
}
WorldObject* _source;
ChatMsg _msgType;
int32 _textId;
uint32 _language;
- uint64 _targetGUID;
+ WorldObject* _target;
};
SmartScript::SmartScript()
@@ -87,7 +69,6 @@ SmartScript::SmartScript()
mTargetStorage = new ObjectListMap();
mTextTimer = 0;
mLastTextID = 0;
- mTextGUID = 0;
mUseTextTimer = false;
mTalkerEntry = 0;
mTemplate = SMARTAI_TEMPLATE_BASIC;
@@ -189,17 +170,16 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
mTalkerEntry = talker->GetEntry();
mLastTextID = e.action.talk.textGroupID;
mTextTimer = e.action.talk.duration;
+ Unit* talkTarget = NULL;
if (IsPlayer(GetLastInvoker())) // used for $vars in texts and whisper target
- mTextGUID = GetLastInvoker()->GetGUID();
+ talkTarget = GetLastInvoker();
else if (targetPlayer)
- mTextGUID = targetPlayer->GetGUID();
- else
- mTextGUID = 0;
+ talkTarget = targetPlayer;
mUseTextTimer = true;
- sCreatureTextMgr->SendChat(talker, uint8(e.action.talk.textGroupID), mTextGUID);
+ sCreatureTextMgr->SendChat(talker, uint8(e.action.talk.textGroupID), talkTarget);
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_TALK: talker: %s (GuidLow: %u), textGuid: %u",
- talker->GetName().c_str(), talker->GetGUIDLow(), GUID_LOPART(mTextGUID));
+ talker->GetName().c_str(), talker->GetGUIDLow(), talkTarget ? talkTarget->GetGUIDLow() : 0);
break;
}
case SMART_ACTION_SIMPLE_TALK:
@@ -210,11 +190,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
if (IsCreature(*itr))
- sCreatureTextMgr->SendChat((*itr)->ToCreature(), uint8(e.action.talk.textGroupID), IsPlayer(GetLastInvoker())? GetLastInvoker()->GetGUID() : 0);
+ sCreatureTextMgr->SendChat((*itr)->ToCreature(), uint8(e.action.talk.textGroupID), IsPlayer(GetLastInvoker())? GetLastInvoker() : 0);
else if (IsPlayer(*itr) && me)
{
Unit* templastInvoker = GetLastInvoker();
- sCreatureTextMgr->SendChat(me, uint8(e.action.talk.textGroupID), IsPlayer(templastInvoker) ? templastInvoker->GetGUID() : 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, (*itr)->ToPlayer());
+ sCreatureTextMgr->SendChat(me, uint8(e.action.talk.textGroupID), IsPlayer(templastInvoker) ? templastInvoker : 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, (*itr)->ToPlayer());
}
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_SIMPLE_TALK: talker: %s (GuidLow: %u), textGroupId: %u",
(*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), uint8(e.action.talk.textGroupID));
@@ -367,12 +347,14 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
if (IsPlayer(*itr))
+ {
if (Quest const* q = sObjectMgr->GetQuestTemplate(e.action.quest.quest))
{
- (*itr)->ToPlayer()->AddQuest(q, NULL);
+ (*itr)->ToPlayer()->AddQuestAndCheckCompletion(q, NULL);
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_ADD_QUEST: Player guidLow %u add quest %u",
(*itr)->GetGUIDLow(), e.action.quest.quest);
}
+ }
}
delete targets;
@@ -380,12 +362,19 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
case SMART_ACTION_SET_REACT_STATE:
{
- if (!me)
+ ObjectList* targets = GetTargets(e, unit);
+ if (!targets)
break;
- me->SetReactState(ReactStates(e.action.react.state));
- TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_SET_REACT_STATE: Creature guidLow %u set reactstate %u",
- me->GetGUIDLow(), e.action.react.state);
+ for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
+ {
+ if (!IsCreature(*itr))
+ continue;
+
+ (*itr)->ToCreature()->SetReactState(ReactStates(e.action.react.state));
+ }
+
+ delete targets;
break;
}
case SMART_ACTION_RANDOM_EMOTE:
@@ -525,9 +514,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(e.action.cast.spell);
int32 mana = me->GetPower(POWER_MANA);
- if (me->GetDistance((*itr)->ToUnit()) > spellInfo->GetMaxRange(true) ||
- me->GetDistance((*itr)->ToUnit()) < spellInfo->GetMinRange(true) ||
- !me->ToUnit()->IsWithinLOSInMap((*itr)->ToUnit()) ||
+ if (me->GetDistance(*itr) > spellInfo->GetMaxRange(true) ||
+ me->GetDistance(*itr) < spellInfo->GetMinRange(true) ||
+ !me->IsWithinLOSInMap(*itr) ||
mana < spellInfo->CalcPowerCost(me, spellInfo->GetSchoolMask()))
_allowMove = true;
@@ -540,7 +529,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
me->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags);
}
else
- TC_LOG_DEBUG("scripts.ai", "Spell %u not casted because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId()));
+ TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId()));
}
delete targets;
@@ -571,7 +560,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
tempLastInvoker->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags);
}
else
- TC_LOG_DEBUG("scripts.ai", "Spell %u not casted because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId()));
+ TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId()));
}
delete targets;
@@ -770,7 +759,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
me->DoFleeToGetAssistance();
if (e.action.flee.withEmote)
{
- TrinityStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_FLEE, LANG_UNIVERSAL, 0);
+ TrinityStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_FLEE, LANG_UNIVERSAL, NULL);
sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE);
}
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature %u DoFleeToGetAssistance", me->GetGUIDLow());
@@ -825,7 +814,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
ObjectList* targets = GetTargets(e, unit);
if (!targets)
+ {
+ CAST_AI(SmartAI, me->AI())->StopFollow();
break;
+ }
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -973,12 +965,16 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
case SMART_ACTION_UPDATE_TEMPLATE:
{
- if (!me || me->GetEntry() == e.action.updateTemplate.creature)
+ ObjectList* targets = GetTargets(e, unit);
+
+ if (!targets)
break;
- me->UpdateEntry(e.action.updateTemplate.creature, e.action.updateTemplate.team ? HORDE : ALLIANCE);
- TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_UPDATE_TEMPLATE: Creature %u, Template: %u, Team: %u",
- me->GetGUIDLow(), me->GetEntry(), e.action.updateTemplate.team ? HORDE : ALLIANCE);
+ for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
+ if (IsCreature(*itr))
+ (*itr)->ToCreature()->UpdateEntry(e.action.updateTemplate.creature, e.action.updateTemplate.team ? HORDE : ALLIANCE);
+
+ delete targets;
break;
}
case SMART_ACTION_DIE:
@@ -1006,7 +1002,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
me->CallForHelp((float)e.action.callHelp.range);
if (e.action.callHelp.withEmote)
{
- TrinityStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_CALL_FOR_HELP, LANG_UNIVERSAL, 0);
+ TrinityStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_CALL_FOR_HELP, LANG_UNIVERSAL, NULL);
sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE);
}
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_CALL_FOR_HELP: Creature %u", me->GetGUIDLow());
@@ -1025,25 +1021,44 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
case SMART_ACTION_FORCE_DESPAWN:
{
- if (!IsSmart())
+ ObjectList* targets = GetTargets(e, unit);
+
+ if (!targets)
break;
- // The AI is only updated if the creature is alive
- if (me->IsAlive())
+ for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
- CAST_AI(SmartAI, me->AI())->SetDespawnTime(e.action.forceDespawn.delay + 1); // Next tick
- CAST_AI(SmartAI, me->AI())->StartDespawn();
+ if (!IsCreature(*itr))
+ continue;
+
+ if ((*itr)->ToUnit()->IsAlive() && IsSmart((*itr)->ToCreature()))
+ {
+ CAST_AI(SmartAI, (*itr)->ToCreature()->AI())->SetDespawnTime(e.action.forceDespawn.delay + 1); // Next tick
+ CAST_AI(SmartAI, (*itr)->ToCreature()->AI())->StartDespawn();
+ }
+ else
+ (*itr)->ToCreature()->DespawnOrUnsummon(e.action.forceDespawn.delay);
}
- // Otherwise we call the despawn directly
- else
- me->DespawnOrUnsummon(e.action.forceDespawn.delay);
+ delete targets;
break;
}
case SMART_ACTION_SET_INGAME_PHASE_MASK:
{
- if (GetBaseObject())
- GetBaseObject()->SetPhaseMask(e.action.ingamePhaseMask.mask, true);
+ ObjectList* targets = GetTargets(e, unit);
+
+ if (!targets)
+ break;
+
+ for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
+ {
+ if (IsUnit(*itr))
+ (*itr)->ToUnit()->SetPhaseMask(e.action.ingamePhaseMask.mask, true);
+ else if (IsGameObject(*itr))
+ (*itr)->ToGameObject()->SetPhaseMask(e.action.ingamePhaseMask.mask, true);
+ }
+
+ delete targets;
break;
}
case SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL:
@@ -1088,6 +1103,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
ai->SetInvincibilityHpLevel(me->CountPctFromMaxHealth(e.action.invincHP.percent));
else
ai->SetInvincibilityHpLevel(e.action.invincHP.minHP);
+
break;
}
case SMART_ACTION_SET_DATA:
@@ -1127,6 +1143,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (WorldObject* baseObj = GetBaseObject())
baseObj->setActive(e.action.active.state);
+
break;
}
case SMART_ACTION_ATTACK_START:
@@ -1643,7 +1660,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
- if (IsUnit(*itr))
+ if (IsCreature(*itr))
(*itr)->ToUnit()->SetUInt32Value(UNIT_NPC_FLAGS, e.action.unitFlag.flag);
delete targets;
@@ -1656,7 +1673,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
- if (IsUnit(*itr))
+ if (IsCreature(*itr))
(*itr)->ToUnit()->SetFlag(UNIT_NPC_FLAGS, e.action.unitFlag.flag);
delete targets;
@@ -1669,7 +1686,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
- if (IsUnit(*itr))
+ if (IsCreature(*itr))
(*itr)->ToUnit()->RemoveFlag(UNIT_NPC_FLAGS, e.action.unitFlag.flag);
delete targets;
@@ -1713,7 +1730,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
unit->CastSpell((*it)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED));
}
else
- TC_LOG_DEBUG("scripts.ai", "Spell %u not casted because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*it)->GetGUID(), (*it)->GetEntry(), uint32((*it)->GetTypeId()));
+ TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*it)->GetGUID(), (*it)->GetEntry(), uint32((*it)->GetTypeId()));
}
}
@@ -2534,7 +2551,10 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
{
ObjectListMap::iterator itr = mTargetStorage->find(e.target.stored.id);
if (itr != mTargetStorage->end())
- l->assign(itr->second->begin(), itr->second->end());
+ {
+ ObjectList* objectList = itr->second->GetObjectList();
+ l->assign(objectList->begin(), objectList->end());
+ }
return l;
}
@@ -2714,7 +2734,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
Unit* victim = me->GetVictim();
- if (!victim || !victim->IsNonMeleeSpellCasted(false, false, true))
+ if (!victim || !victim->IsNonMeleeSpellCast(false, false, true))
return;
if (e.event.targetCasting.spellId > 0)
@@ -3140,12 +3160,12 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff)
if (e.GetEventType() == SMART_EVENT_UPDATE_IC && (!me || !me->IsInCombat()))
return;
- if (e.GetEventType() == SMART_EVENT_UPDATE_OOC && (me && me->IsInCombat()))//can be used with me=NULL (go script)
+ if (e.GetEventType() == SMART_EVENT_UPDATE_OOC && (me && me->IsInCombat())) //can be used with me=NULL (go script)
return;
if (e.timer < diff)
{
- // delay spell cast event if another spell is being casted
+ // delay spell cast event if another spell is being cast
if (e.GetActionType() == SMART_ACTION_CAST)
{
if (!(e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS))
diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h
index f9eff2ec96e..2e1068d1bff 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.h
+++ b/src/server/game/AI/SmartScripts/SmartScript.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -99,13 +99,13 @@ class SmartScript
if (mTargetStorage->find(id) != mTargetStorage->end())
{
// check if already stored
- if ((*mTargetStorage)[id] == targets)
+ if ((*mTargetStorage)[id]->Equals(targets))
return;
delete (*mTargetStorage)[id];
}
- (*mTargetStorage)[id] = targets;
+ (*mTargetStorage)[id] = new ObjectGuidList(targets, GetBaseObject());
}
bool IsSmart(Creature* c = NULL)
@@ -141,7 +141,7 @@ class SmartScript
{
ObjectListMap::iterator itr = mTargetStorage->find(id);
if (itr != mTargetStorage->end())
- return (*itr).second;
+ return (*itr).second->GetObjectList();
return NULL;
}
@@ -237,7 +237,6 @@ class SmartScript
uint32 mTextTimer;
uint32 mLastTextID;
- uint64 mTextGUID;
uint32 mTalkerEntry;
bool mUseTextTimer;
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 74d2d5c49a1..543cb9235d3 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -107,6 +107,8 @@ SmartWaypointMgr::~SmartWaypointMgr()
void SmartAIMgr::LoadSmartAIFromDB()
{
+ LoadHelperStores();
+
uint32 oldMSTime = getMSTime();
for (uint8 i = 0; i < SMART_SCRIPT_TYPE_MAX; i++)
@@ -118,7 +120,6 @@ void SmartAIMgr::LoadSmartAIFromDB()
if (!result)
{
TC_LOG_INFO("server.loading", ">> Loaded 0 SmartAI scripts. DB table `smartai_scripts` is empty.");
-
return;
}
@@ -236,6 +237,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
TC_LOG_INFO("server.loading", ">> Loaded %u SmartAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ UnLoadHelperStores();
}
bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
@@ -769,27 +771,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
break;
}
case SMART_ACTION_SUMMON_CREATURE:
+ {
if (!IsCreatureValid(e, e.action.summonCreature.creature))
return false;
- for (uint32 i = 0; i < sSpellMgr->GetSpellInfoStoreSize(); ++i)
- {
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(i);
- if (!spellInfo)
- continue;
-
- for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
- {
- if (spellInfo->Effects[j].Effect == SPELL_EFFECT_SUMMON)
- {
- uint32 creatureSummonEntry = spellInfo->Effects[j].MiscValue;
-
- if (e.action.summonCreature.creature == creatureSummonEntry)
- TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u creature summon: There is a summon spell for creature entry %u (SpellId: %u, effect: %u)",
- e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonCreature.creature, spellInfo->Id, j);
- }
- }
- }
+ CacheSpellContainerBounds sBounds = GetSummonCreatureSpellContainerBounds(e.action.summonCreature.creature);
+ for (CacheSpellContainer::const_iterator itr = sBounds.first; itr != sBounds.second; ++itr)
+ TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u creature summon: There is a summon spell for creature entry %u (SpellId: %u, effect: %u)",
+ e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonCreature.creature, itr->second.first, itr->second.second);
if (e.action.summonCreature.type < TEMPSUMMON_TIMED_OR_DEAD_DESPAWN || e.action.summonCreature.type > TEMPSUMMON_MANUAL_DESPAWN)
{
@@ -797,27 +786,16 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
return false;
}
break;
+ }
case SMART_ACTION_CALL_KILLEDMONSTER:
+ {
if (!IsCreatureValid(e, e.action.killedMonster.creature))
return false;
- for (uint32 i = 0; i < sSpellMgr->GetSpellInfoStoreSize(); ++i)
- {
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(i);
- if (!spellInfo)
- continue;
-
- for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
- {
- if (spellInfo->Effects[j].Effect == SPELL_EFFECT_KILL_CREDIT || spellInfo->Effects[j].Effect == SPELL_EFFECT_KILL_CREDIT2)
- {
- uint32 killCredit = spellInfo->Effects[j].MiscValue;
-
- if (e.action.killedMonster.creature == killCredit)
- TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u Kill Credit: %u has already spell kill credit (SpellId: %u effect: %u)", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.killedMonster.creature, spellInfo->Id, j);
- }
- }
- }
+ CacheSpellContainerBounds sBounds = GetKillCreditSpellContainerBounds(e.action.killedMonster.creature);
+ for (CacheSpellContainer::const_iterator itr = sBounds.first; itr != sBounds.second; ++itr)
+ TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u Kill Credit: There is a killcredit spell for creatureEntry %u (SpellId: %u effect: %u)",
+ e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.killedMonster.creature, itr->second.first, itr->second.second);
if (e.GetTargetType() == SMART_TARGET_POSITION)
{
@@ -825,8 +803,9 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
return false;
}
break;
+ }
case SMART_ACTION_UPDATE_TEMPLATE:
- if (e.action.updateTemplate.creature && !IsCreatureValid(e, e.action.updateTemplate.creature))
+ if (!IsCreatureValid(e, e.action.updateTemplate.creature))
return false;
break;
case SMART_ACTION_SET_SHEATH:
@@ -846,28 +825,16 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
break;
}
case SMART_ACTION_SUMMON_GO:
+ {
if (!IsGameObjectValid(e, e.action.summonGO.entry))
return false;
- for (uint32 i = 0; i < sSpellMgr->GetSpellInfoStoreSize(); ++i)
- {
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(i);
- if (!spellInfo)
- continue;
-
- for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
- {
- if (spellInfo->Effects[j].Effect == SPELL_EFFECT_SUMMON_OBJECT_WILD)
- {
- uint32 goSummonEntry = spellInfo->Effects[j].MiscValue;
-
- if (e.action.summonGO.entry == goSummonEntry)
- TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u gameobject summon: There is a summon spell for gameobject entry %u (SpellId: %u, effect: %u)",
- e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonGO.entry, spellInfo->Id, j);
- }
- }
- }
+ CacheSpellContainerBounds sBounds = GetSummonGameObjectSpellContainerBounds(e.action.summonGO.entry);
+ for (CacheSpellContainer::const_iterator itr = sBounds.first; itr != sBounds.second; ++itr)
+ TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u gameobject summon: There is a summon spell for gameobject entry %u (SpellId: %u, effect: %u)",
+ e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonGO.entry, itr->second.first, itr->second.second);
break;
+ }
case SMART_ACTION_ADD_ITEM:
case SMART_ACTION_REMOVE_ITEM:
if (!IsItemValid(e, e.action.item.entry))
@@ -1073,3 +1040,52 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
return true;
}*/
+
+void SmartAIMgr::LoadHelperStores()
+{
+ uint32 oldMSTime = getMSTime();
+
+ SpellInfo const* spellInfo = NULL;
+ for (uint32 i = 0; i < sSpellMgr->GetSpellInfoStoreSize(); ++i)
+ {
+ spellInfo = sSpellMgr->GetSpellInfo(i);
+ if (!spellInfo)
+ continue;
+
+ for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
+ {
+ if (spellInfo->Effects[j].IsEffect(SPELL_EFFECT_SUMMON))
+ SummonCreatureSpellStore.insert(std::make_pair(uint32(spellInfo->Effects[j].MiscValue), std::make_pair(i, SpellEffIndex(j))));
+
+ else if (spellInfo->Effects[j].IsEffect(SPELL_EFFECT_SUMMON_OBJECT_WILD))
+ SummonGameObjectSpellStore.insert(std::make_pair(uint32(spellInfo->Effects[j].MiscValue), std::make_pair(i, SpellEffIndex(j))));
+
+ else if (spellInfo->Effects[j].IsEffect(SPELL_EFFECT_KILL_CREDIT) || spellInfo->Effects[j].IsEffect(SPELL_EFFECT_KILL_CREDIT2))
+ KillCreditSpellStore.insert(std::make_pair(uint32(spellInfo->Effects[j].MiscValue), std::make_pair(i, SpellEffIndex(j))));
+ }
+ }
+
+ TC_LOG_INFO("server.loading", ">> Loaded SmartAIMgr Helpers in %u ms", GetMSTimeDiffToNow(oldMSTime));
+}
+
+void SmartAIMgr::UnLoadHelperStores()
+{
+ SummonCreatureSpellStore.clear();
+ SummonGameObjectSpellStore.clear();
+ KillCreditSpellStore.clear();
+}
+
+CacheSpellContainerBounds SmartAIMgr::GetSummonCreatureSpellContainerBounds(uint32 creatureEntry) const
+{
+ return SummonCreatureSpellStore.equal_range(creatureEntry);
+}
+
+CacheSpellContainerBounds SmartAIMgr::GetSummonGameObjectSpellContainerBounds(uint32 gameObjectEntry) const
+{
+ return SummonGameObjectSpellStore.equal_range(gameObjectEntry);
+}
+
+CacheSpellContainerBounds SmartAIMgr::GetKillCreditSpellContainerBounds(uint32 killCredit) const
+{
+ return KillCreditSpellStore.equal_range(killCredit);
+}
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index d6bf318b8ac..9ba5ccc578e 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -1036,6 +1036,10 @@ struct SmartTarget
raw.param1 = p1;
raw.param2 = p2;
raw.param3 = p3;
+ x = 0.0f;
+ y = 0.0f;
+ z = 0.0f;
+ o = 0.0f;
}
SMARTAI_TARGETS type;
float x, y, z, o;
@@ -1317,7 +1321,58 @@ struct SmartScriptHolder
typedef UNORDERED_MAP<uint32, WayPoint*> WPPath;
typedef std::list<WorldObject*> ObjectList;
-typedef UNORDERED_MAP<uint32, ObjectList*> ObjectListMap;
+typedef std::list<uint64> GuidList;
+class ObjectGuidList
+{
+ ObjectList* m_objectList;
+ GuidList* m_guidList;
+ WorldObject* m_baseObject;
+
+public:
+ ObjectGuidList(ObjectList* objectList, WorldObject* baseObject)
+ {
+ ASSERT(objectList != NULL);
+ m_objectList = objectList;
+ m_baseObject = baseObject;
+ m_guidList = new GuidList();
+
+ for (ObjectList::iterator itr = objectList->begin(); itr != objectList->end(); ++itr)
+ {
+ m_guidList->push_back((*itr)->GetGUID());
+ }
+ }
+
+ ObjectList* GetObjectList()
+ {
+ if (m_baseObject)
+ {
+ //sanitize list using m_guidList
+ m_objectList->clear();
+
+ for (GuidList::iterator itr = m_guidList->begin(); itr != m_guidList->end(); ++itr)
+ {
+ if (WorldObject* obj = ObjectAccessor::GetWorldObject(*m_baseObject, *itr))
+ m_objectList->push_back(obj);
+ else
+ TC_LOG_DEBUG("scripts.ai", "SmartScript::mTargetStorage stores a guid to an invalid object: " UI64FMTD, *itr);
+ }
+ }
+
+ return m_objectList;
+ }
+
+ bool Equals(ObjectList* objectList)
+ {
+ return m_objectList == objectList;
+ }
+
+ ~ObjectGuidList()
+ {
+ delete m_objectList;
+ delete m_guidList;
+ }
+};
+typedef UNORDERED_MAP<uint32, ObjectGuidList*> ObjectListMap;
class SmartWaypointMgr
{
@@ -1345,12 +1400,16 @@ typedef std::vector<SmartScriptHolder> SmartAIEventList;
// all events for all entries / guids
typedef UNORDERED_MAP<int32, SmartAIEventList> SmartAIEventMap;
+// Helper Stores
+typedef std::map<uint32 /*entry*/, std::pair<uint32 /*spellId*/, SpellEffIndex /*effIndex*/> > CacheSpellContainer;
+typedef std::pair<CacheSpellContainer::const_iterator, CacheSpellContainer::const_iterator> CacheSpellContainerBounds;
+
class SmartAIMgr
{
friend class ACE_Singleton<SmartAIMgr, ACE_Null_Mutex>;
- SmartAIMgr(){ }
+ SmartAIMgr() { }
public:
- ~SmartAIMgr(){ }
+ ~SmartAIMgr() { }
void LoadSmartAIFromDB();
@@ -1505,6 +1564,18 @@ class SmartAIMgr
}
//bool IsTextValid(SmartScriptHolder const& e, uint32 id);
+
+ // Helpers
+ void LoadHelperStores();
+ void UnLoadHelperStores();
+
+ CacheSpellContainerBounds GetSummonCreatureSpellContainerBounds(uint32 creatureEntry) const;
+ CacheSpellContainerBounds GetSummonGameObjectSpellContainerBounds(uint32 gameObjectEntry) const;
+ CacheSpellContainerBounds GetKillCreditSpellContainerBounds(uint32 killCredit) const;
+
+ CacheSpellContainer SummonCreatureSpellStore;
+ CacheSpellContainer SummonGameObjectSpellStore;
+ CacheSpellContainer KillCreditSpellStore;
};
#define sSmartScriptMgr ACE_Singleton<SmartAIMgr, ACE_Null_Mutex>::instance()
diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp
index 4c71a044488..8a5c6937ca0 100644
--- a/src/server/game/Accounts/AccountMgr.cpp
+++ b/src/server/game/Accounts/AccountMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Accounts/AccountMgr.h b/src/server/game/Accounts/AccountMgr.h
index 24bea5c15a9..b3012ace177 100644
--- a/src/server/game/Accounts/AccountMgr.h
+++ b/src/server/game/Accounts/AccountMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Accounts/RBAC.cpp b/src/server/game/Accounts/RBAC.cpp
index 1d42ed819cd..058c6799d94 100644
--- a/src/server/game/Accounts/RBAC.cpp
+++ b/src/server/game/Accounts/RBAC.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h
index 928c9100ca8..90cee269759 100644
--- a/src/server/game/Accounts/RBAC.h
+++ b/src/server/game/Accounts/RBAC.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp
index 0f1dd1c53c6..7d53f481fe8 100644
--- a/src/server/game/Achievements/AchievementMgr.cpp
+++ b/src/server/game/Achievements/AchievementMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -21,6 +21,7 @@
#include "ArenaTeamMgr.h"
#include "Battleground.h"
#include "CellImpl.h"
+#include "Chat.h"
#include "Common.h"
#include "DatabaseEnv.h"
#include "DBCEnums.h"
@@ -48,19 +49,11 @@ namespace Trinity
public:
AchievementChatBuilder(Player const& player, ChatMsg msgtype, int32 textId, uint32 ach_id)
: i_player(player), i_msgtype(msgtype), i_textId(textId), i_achievementId(ach_id) { }
+
void operator()(WorldPacket& data, LocaleConstant loc_idx)
{
- char const* text = sObjectMgr->GetTrinityString(i_textId, loc_idx);
-
- data << uint8(i_msgtype);
- data << uint32(LANG_UNIVERSAL);
- data << uint64(i_player.GetGUID());
- data << uint32(5);
- data << uint64(i_player.GetGUID());
- data << uint32(strlen(text)+1);
- data << text;
- data << uint8(0);
- data << uint32(i_achievementId);
+ std::string text = sObjectMgr->GetTrinityString(i_textId, loc_idx);
+ ChatHandler::BuildChatPacket(data, i_msgtype, LANG_UNIVERSAL, &i_player, &i_player, text, i_achievementId);
}
private:
@@ -778,7 +771,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD: /* FIXME: for online player only currently */
case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT:
case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED:
- case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CAST:
case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED:
// AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
if (!miscValue1)
diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h
index 65a936c3d40..1a6777d1055 100644
--- a/src/server/game/Achievements/AchievementMgr.h
+++ b/src/server/game/Achievements/AchievementMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Addons/AddonMgr.cpp b/src/server/game/Addons/AddonMgr.cpp
index ec78a7565d4..802c649943f 100644
--- a/src/server/game/Addons/AddonMgr.cpp
+++ b/src/server/game/Addons/AddonMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Addons/AddonMgr.h b/src/server/game/Addons/AddonMgr.h
index 35e24e965b5..5b98a1f9be6 100644
--- a/src/server/game/Addons/AddonMgr.h
+++ b/src/server/game/Addons/AddonMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
index ec2dec8df08..29d80f5fa6b 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h
index 4892821cb94..506c4bea0c5 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.h
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp
index 07dfb45150c..d8674ed476b 100644
--- a/src/server/game/Battlefield/Battlefield.cpp
+++ b/src/server/game/Battlefield/Battlefield.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -45,8 +45,10 @@ Battlefield::Battlefield()
m_MapId = 0;
m_MaxPlayer = 0;
m_MinPlayer = 0;
+ m_MinLevel = 0;
m_BattleTime = 0;
m_NoWarBattleTime = 0;
+ m_RestartAfterCrash = 0;
m_TimeForAcceptInvite = 20;
m_uiKickDontAcceptTimer = 1000;
@@ -443,50 +445,18 @@ void Battlefield::BroadcastPacketToWar(WorldPacket& data) const
player->GetSession()->SendPacket(&data);
}
-WorldPacket Battlefield::BuildWarningAnnPacket(std::string const& msg)
-{
- WorldPacket data(SMSG_MESSAGECHAT, 200);
-
- data << uint8(CHAT_MSG_RAID_BOSS_EMOTE);
- data << uint32(LANG_UNIVERSAL);
- data << uint64(0);
- data << uint32(0); // 2.1.0
- data << uint32(1);
- data << uint8(0);
- data << uint64(0);
- data << uint32(msg.length() + 1);
- data << msg;
- data << uint8(0);
-
- return data;
-}
-
void Battlefield::SendWarningToAllInZone(uint32 entry)
{
if (Creature* stalker = GetCreature(StalkerGuid))
// FIXME: replaced CHAT_TYPE_END with CHAT_MSG_BG_SYSTEM_NEUTRAL to fix compile, it's a guessed change :/
- sCreatureTextMgr->SendChat(stalker, (uint8) entry, 0, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_ADDON, TEXT_RANGE_ZONE);
+ sCreatureTextMgr->SendChat(stalker, (uint8) entry, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_ADDON, TEXT_RANGE_ZONE);
}
-/*void Battlefield::SendWarningToAllInWar(int32 entry, ...)
-{
- const char *format = sObjectMgr->GetTrinityStringForDBCLocale(entry);
- va_list ap;
- char str [1024];
- va_start(ap, entry);
- vsnprintf(str, 1024, format, ap);
- va_end(ap);
- std::string msg = (std::string)str;
-
- WorldPacket data = BuildWarningAnnPacket(msg);
- BroadcastPacketWar(data);
-}*/
-
void Battlefield::SendWarningToPlayer(Player* player, uint32 entry)
{
if (player)
if (Creature* stalker = GetCreature(StalkerGuid))
- sCreatureTextMgr->SendChat(stalker, (uint8)entry, player->GetGUID());
+ sCreatureTextMgr->SendChat(stalker, (uint8)entry, player);
}
void Battlefield::SendUpdateWorldState(uint32 field, uint32 value)
@@ -821,7 +791,7 @@ Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl
return 0;
}
- Creature* creature = new Creature;
+ Creature* creature = new Creature();
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, team, x, y, z, o))
{
TC_LOG_ERROR("bg.battlefield", "Battlefield::SpawnCreature: Can't create creature entry: %u", entry);
diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h
index 70805dd3a97..e0e223c9e56 100644
--- a/src/server/game/Battlefield/Battlefield.h
+++ b/src/server/game/Battlefield/Battlefield.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -309,9 +309,7 @@ class Battlefield : public ZoneScript
/// Called when a player enter in battlefield zone
virtual void OnPlayerEnterZone(Player* /*player*/) { }
- WorldPacket BuildWarningAnnPacket(std::string const& msg);
void SendWarningToAllInZone(uint32 entry);
- //void SendWarningToAllInWar(int32 entry, ...); -- UNUSED
void SendWarningToPlayer(Player* player, uint32 entry);
void PlayerAcceptInviteToQueue(Player* player);
diff --git a/src/server/game/Battlefield/BattlefieldMgr.cpp b/src/server/game/Battlefield/BattlefieldMgr.cpp
index 1585724334d..8aa58f0ac4b 100644
--- a/src/server/game/Battlefield/BattlefieldMgr.cpp
+++ b/src/server/game/Battlefield/BattlefieldMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -16,125 +16,130 @@
*/
#include "BattlefieldMgr.h"
-#include "Zones/BattlefieldWG.h"
+#include "BattlefieldWG.h"
#include "ObjectMgr.h"
#include "Player.h"
BattlefieldMgr::BattlefieldMgr()
{
- m_UpdateTimer = 0;
- //TC_LOG_DEBUG("bg.battlefield", "Instantiating BattlefieldMgr");
+ _updateTimer = 0;
}
BattlefieldMgr::~BattlefieldMgr()
{
- //TC_LOG_DEBUG("bg.battlefield", "Deleting BattlefieldMgr");
- for (BattlefieldSet::iterator itr = m_BattlefieldSet.begin(); itr != m_BattlefieldSet.end(); ++itr)
+ for (BattlefieldSet::iterator itr = _battlefieldSet.begin(); itr != _battlefieldSet.end(); ++itr)
delete *itr;
+
+ _battlefieldMap.clear();
}
void BattlefieldMgr::InitBattlefield()
{
- Battlefield* pBf = new BattlefieldWG;
+ Battlefield* wg = new BattlefieldWG();
// respawn, init variables
- if (!pBf->SetupBattlefield())
+ if (!wg->SetupBattlefield())
{
- TC_LOG_INFO("misc", "Battlefield : Wintergrasp init failed.");
- delete pBf;
+ TC_LOG_INFO("bg.battlefield", "Battlefield: Wintergrasp init failed.");
+ delete wg;
}
else
{
- m_BattlefieldSet.push_back(pBf);
- TC_LOG_INFO("misc", "Battlefield : Wintergrasp successfully initiated.");
+ _battlefieldSet.push_back(wg);
+ TC_LOG_INFO("bg.battlefield", "Battlefield: Wintergrasp successfully initiated.");
}
- /* For Cataclysm: Tol Barad
- pBf = new BattlefieldTB;
- // respawn, init variables
- if (!pBf->SetupBattlefield())
- {
- TC_LOG_DEBUG("bg.battlefield", "Battlefield : Tol Barad init failed.");
- delete pBf;
- }
- else
- {
- m_BattlefieldSet.push_back(pBf);
- TC_LOG_DEBUG("bg.battlefield", "Battlefield : Tol Barad successfully initiated.");
- } */
+ /*
+ For Cataclysm: Tol Barad
+ Battlefield* tb = new BattlefieldTB;
+ // respawn, init variables
+ if (!tb->SetupBattlefield())
+ {
+ TC_LOG_DEBUG("bg.battlefield", "Battlefield: Tol Barad init failed.");
+ delete tb;
+ }
+ else
+ {
+ _battlefieldSet.push_back(tb);
+ TC_LOG_DEBUG("bg.battlefield", "Battlefield: Tol Barad successfully initiated.");
+ }
+ */
}
-void BattlefieldMgr::AddZone(uint32 zoneid, Battlefield *handle)
+void BattlefieldMgr::AddZone(uint32 zoneId, Battlefield* bf)
{
- m_BattlefieldMap[zoneid] = handle;
+ _battlefieldMap[zoneId] = bf;
}
-void BattlefieldMgr::HandlePlayerEnterZone(Player* player, uint32 zoneid)
+void BattlefieldMgr::HandlePlayerEnterZone(Player* player, uint32 zoneId)
{
- BattlefieldMap::iterator itr = m_BattlefieldMap.find(zoneid);
- if (itr == m_BattlefieldMap.end())
+ BattlefieldMap::iterator itr = _battlefieldMap.find(zoneId);
+ if (itr == _battlefieldMap.end())
return;
Battlefield* bf = itr->second;
- if (bf->HasPlayer(player) || !bf->IsEnabled())
+ if (!bf->IsEnabled() || bf->HasPlayer(player))
return;
- bf->HandlePlayerEnterZone(player, zoneid);
- TC_LOG_DEBUG("bg.battlefield", "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), bf->GetTypeId());
+ bf->HandlePlayerEnterZone(player, zoneId);
+ TC_LOG_DEBUG("bg.battlefield", "Player %u entered battlefield id %u", player->GetGUIDLow(), bf->GetTypeId());
}
-void BattlefieldMgr::HandlePlayerLeaveZone(Player* player, uint32 zoneid)
+void BattlefieldMgr::HandlePlayerLeaveZone(Player* player, uint32 zoneId)
{
- BattlefieldMap::iterator itr = m_BattlefieldMap.find(zoneid);
- if (itr == m_BattlefieldMap.end())
+ BattlefieldMap::iterator itr = _battlefieldMap.find(zoneId);
+ if (itr == _battlefieldMap.end())
return;
// teleport: remove once in removefromworld, once in updatezone
if (!itr->second->HasPlayer(player))
return;
- itr->second->HandlePlayerLeaveZone(player, zoneid);
- TC_LOG_DEBUG("bg.battlefield", "Player %u left outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId());
+
+ itr->second->HandlePlayerLeaveZone(player, zoneId);
+ TC_LOG_DEBUG("bg.battlefield", "Player %u left battlefield id %u", player->GetGUIDLow(), itr->second->GetTypeId());
}
-Battlefield *BattlefieldMgr::GetBattlefieldToZoneId(uint32 zoneid)
+Battlefield* BattlefieldMgr::GetBattlefieldToZoneId(uint32 zoneId)
{
- BattlefieldMap::iterator itr = m_BattlefieldMap.find(zoneid);
- if (itr == m_BattlefieldMap.end())
+ BattlefieldMap::iterator itr = _battlefieldMap.find(zoneId);
+ if (itr == _battlefieldMap.end())
{
// no handle for this zone, return
return NULL;
}
+
if (!itr->second->IsEnabled())
return NULL;
+
return itr->second;
}
-Battlefield *BattlefieldMgr::GetBattlefieldByBattleId(uint32 battleid)
+Battlefield* BattlefieldMgr::GetBattlefieldByBattleId(uint32 battleId)
{
- for (BattlefieldSet::iterator itr = m_BattlefieldSet.begin(); itr != m_BattlefieldSet.end(); ++itr)
+ for (BattlefieldSet::iterator itr = _battlefieldSet.begin(); itr != _battlefieldSet.end(); ++itr)
{
- if ((*itr)->GetBattleId() == battleid)
- return (*itr);
+ if ((*itr)->GetBattleId() == battleId)
+ return *itr;
}
return NULL;
}
+ZoneScript* BattlefieldMgr::GetZoneScript(uint32 zoneId)
+{
+ BattlefieldMap::iterator itr = _battlefieldMap.find(zoneId);
+ if (itr != _battlefieldMap.end())
+ return itr->second;
+
+ return NULL;
+}
+
void BattlefieldMgr::Update(uint32 diff)
{
- m_UpdateTimer += diff;
- if (m_UpdateTimer > BATTLEFIELD_OBJECTIVE_UPDATE_INTERVAL)
+ _updateTimer += diff;
+ if (_updateTimer > BATTLEFIELD_OBJECTIVE_UPDATE_INTERVAL)
{
- for (BattlefieldSet::iterator itr = m_BattlefieldSet.begin(); itr != m_BattlefieldSet.end(); ++itr)
+ for (BattlefieldSet::iterator itr = _battlefieldSet.begin(); itr != _battlefieldSet.end(); ++itr)
if ((*itr)->IsEnabled())
- (*itr)->Update(m_UpdateTimer);
- m_UpdateTimer = 0;
+ (*itr)->Update(_updateTimer);
+ _updateTimer = 0;
}
}
-
-ZoneScript* BattlefieldMgr::GetZoneScript(uint32 zoneId)
-{
- BattlefieldMap::iterator itr = m_BattlefieldMap.find(zoneId);
- if (itr != m_BattlefieldMap.end())
- return itr->second;
- else
- return NULL;
-}
diff --git a/src/server/game/Battlefield/BattlefieldMgr.h b/src/server/game/Battlefield/BattlefieldMgr.h
index af1cea763df..bb8a076d5d0 100644
--- a/src/server/game/Battlefield/BattlefieldMgr.h
+++ b/src/server/game/Battlefield/BattlefieldMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -19,60 +19,51 @@
#define BATTLEFIELD_MGR_H_
#include "Battlefield.h"
-#include "ace/Singleton.h"
+#include <ace/Singleton.h>
class Player;
-class GameObject;
-class Creature;
class ZoneScript;
-struct GossipMenuItems;
// class to handle player enter / leave / areatrigger / GO use events
class BattlefieldMgr
{
- public:
- // ctor
- BattlefieldMgr();
- // dtor
- ~BattlefieldMgr();
+ public:
+ // ctor
+ BattlefieldMgr();
+ // dtor
+ ~BattlefieldMgr();
- // create battlefield events
- void InitBattlefield();
- // called when a player enters an battlefield area
- void HandlePlayerEnterZone(Player* player, uint32 areaflag);
- // called when player leaves an battlefield area
- void HandlePlayerLeaveZone(Player* player, uint32 areaflag);
- // called when player resurrects
- void HandlePlayerResurrects(Player* player, uint32 areaflag);
- // return assigned battlefield
- Battlefield* GetBattlefieldToZoneId(uint32 zoneid);
- Battlefield* GetBattlefieldByBattleId(uint32 battleid);
+ // create battlefield events
+ void InitBattlefield();
- ZoneScript* GetZoneScript(uint32 zoneId);
+ // called when a player enters an battlefield area
+ void HandlePlayerEnterZone(Player* player, uint32 zoneId);
+ // called when player leaves an battlefield area
+ void HandlePlayerLeaveZone(Player* player, uint32 zoneId);
- void AddZone(uint32 zoneid, Battlefield * handle);
+ // return assigned battlefield
+ Battlefield* GetBattlefieldToZoneId(uint32 zoneId);
+ Battlefield* GetBattlefieldByBattleId(uint32 battleId);
- void Update(uint32 diff);
+ ZoneScript* GetZoneScript(uint32 zoneId);
- void HandleGossipOption(Player* player, uint64 guid, uint32 gossipid);
+ void AddZone(uint32 zoneId, Battlefield* bf);
- bool CanTalkTo(Player* player, Creature* creature, GossipMenuItems gso);
+ void Update(uint32 diff);
- void HandleDropFlag(Player* player, uint32 spellId);
-
- typedef std::vector < Battlefield * >BattlefieldSet;
- typedef std::map < uint32 /* zoneid */, Battlefield * >BattlefieldMap;
- private:
- // contains all initiated battlefield events
- // used when initing / cleaning up
- BattlefieldSet m_BattlefieldSet;
- // maps the zone ids to an battlefield event
- // used in player event handling
- BattlefieldMap m_BattlefieldMap;
- // update interval
- uint32 m_UpdateTimer;
+ private:
+ typedef std::vector<Battlefield*> BattlefieldSet;
+ typedef std::map<uint32 /*zoneId*/, Battlefield*> BattlefieldMap;
+ // contains all initiated battlefield events
+ // used when initing / cleaning up
+ BattlefieldSet _battlefieldSet;
+ // maps the zone ids to an battlefield event
+ // used in player event handling
+ BattlefieldMap _battlefieldMap;
+ // update interval
+ uint32 _updateTimer;
};
#define sBattlefieldMgr ACE_Singleton<BattlefieldMgr, ACE_Null_Mutex>::instance()
-#endif
+#endif // BATTLEFIELD_MGR_H_
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
index fbc27dc47aa..7ec5a09508a 100644
--- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
+++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -30,14 +30,6 @@
#include "Vehicle.h"
#include "WorldSession.h"
-enum WGVehicles
-{
- NPC_WG_SEIGE_ENGINE_ALLIANCE = 28312,
- NPC_WG_SEIGE_ENGINE_HORDE = 32627,
- NPC_WG_DEMOLISHER = 28094,
- NPC_WG_CATAPULT = 27881
-};
-
BattlefieldWG::~BattlefieldWG()
{
for (Workshop::const_iterator itr = WorkshopsList.begin(); itr != WorkshopsList.end(); ++itr)
@@ -192,7 +184,7 @@ bool BattlefieldWG::SetupBattlefield()
if (GameObject* go = SpawnGameObject(WGPortalDefenderData[i].entry, WGPortalDefenderData[i].x, WGPortalDefenderData[i].y, WGPortalDefenderData[i].z, WGPortalDefenderData[i].o))
{
DefenderPortalList.insert(go->GetGUID());
- go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[GetDefenderTeam()]);
+ go->SetFaction(WintergraspFaction[GetDefenderTeam()]);
}
}
@@ -222,7 +214,7 @@ void BattlefieldWG::OnBattleStart()
if (GameObject* relic = SpawnGameObject(GO_WINTERGRASP_TITAN_S_RELIC, 5440.0f, 2840.8f, 430.43f, 0))
{
// Update faction of relic, only attacker can click on
- relic->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[GetAttackerTeam()]);
+ relic->SetFaction(WintergraspFaction[GetAttackerTeam()]);
// Set in use (not allow to click on before last door is broken)
relic->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
m_titansRelicGUID = relic->GetGUID();
@@ -360,7 +352,7 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer)
// Update portal defender faction
for (GuidSet::const_iterator itr = DefenderPortalList.begin(); itr != DefenderPortalList.end(); ++itr)
if (GameObject* portal = GetGameObject(*itr))
- portal->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[GetDefenderTeam()]);
+ portal->SetFaction(WintergraspFaction[GetDefenderTeam()]);
// Saving data
for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr)
@@ -804,7 +796,7 @@ uint32 BattlefieldWG::GetData(uint32 data) const
{
switch (data)
{
- // Used to determine when the phasing spells must be casted
+ // Used to determine when the phasing spells must be cast
// See: SpellArea::IsFitToRequirements
case AREA_THE_SUNKEN_RING:
case AREA_THE_BROKEN_TEMPLATE:
@@ -813,6 +805,9 @@ uint32 BattlefieldWG::GetData(uint32 data) const
// Graveyards and Workshops are controlled by the same team.
if (BfGraveyard const* graveyard = GetGraveyardById(GetSpiritGraveyardId(data)))
return graveyard->GetControlTeamId();
+ break;
+ default:
+ break;
}
return Battlefield::GetData(data);
@@ -1064,4 +1059,5 @@ void WintergraspCapturePoint::ChangeTeam(TeamId /*oldTeam*/)
BfGraveyardWG::BfGraveyardWG(BattlefieldWG* battlefield) : BfGraveyard(battlefield)
{
m_Bf = battlefield;
+ m_GossipTextId = 0;
}
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h
index 683df863a5f..c54d8915a33 100644
--- a/src/server/game/Battlefield/Zones/BattlefieldWG.h
+++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -1133,7 +1133,7 @@ struct BfWGGameObjectBuilding
m_WG->SendUpdateWorldState(m_WorldState, m_State);
}
UpdateCreatureAndGo();
- build->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[m_Team]);
+ build->SetFaction(WintergraspFaction[m_Team]);
}
}
@@ -1481,6 +1481,7 @@ struct WGWorkshop
bf = _bf;
workshopId = _workshopId;
teamControl = BATTLEFIELD_WG_TEAM_NEUTRAL;
+ state = BATTLEFIELD_WG_OBJECTSTATE_NONE;
}
void GiveControlTo(uint8 team, bool init /* for first call in setup*/)
diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp
index 222a3f55387..2ca60534f30 100644
--- a/src/server/game/Battlegrounds/ArenaTeam.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeam.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/ArenaTeam.h b/src/server/game/Battlegrounds/ArenaTeam.h
index 0d37351583d..cd9e2be4318 100644
--- a/src/server/game/Battlegrounds/ArenaTeam.h
+++ b/src/server/game/Battlegrounds/ArenaTeam.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
index ac15440e564..dba891c96db 100644
--- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.h b/src/server/game/Battlegrounds/ArenaTeamMgr.h
index 589877a150d..123cbe2d41b 100644
--- a/src/server/game/Battlegrounds/ArenaTeamMgr.h
+++ b/src/server/game/Battlegrounds/ArenaTeamMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 044036ef860..3fcfab81c73 100644
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -21,6 +21,7 @@
#include "Battleground.h"
#include "BattlegroundMgr.h"
#include "Creature.h"
+#include "Chat.h"
#include "Formulas.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
@@ -65,16 +66,7 @@ namespace Trinity
private:
void do_helper(WorldPacket& data, char const* text)
{
- uint64 target_guid = _source ? _source->GetGUID() : 0;
-
- data << uint8 (_msgtype);
- data << uint32(LANG_UNIVERSAL);
- data << uint64(target_guid); // there 0 for BG messages
- data << uint32(0); // can be chat msg group or something
- data << uint64(target_guid);
- data << uint32(strlen(text) + 1);
- data << text;
- data << uint8 (_source ? _source->GetChatTag() : 0);
+ ChatHandler::BuildChatPacket(data, _msgtype, LANG_UNIVERSAL, _source, _source, text);
}
ChatMsg _msgtype;
@@ -98,16 +90,7 @@ namespace Trinity
char str[2048];
snprintf(str, 2048, text, arg1str, arg2str);
- uint64 target_guid = _source ? _source->GetGUID() : 0;
-
- data << uint8 (_msgtype);
- data << uint32(LANG_UNIVERSAL);
- data << uint64(target_guid); // there 0 for BG messages
- data << uint32(0); // can be chat msg group or something
- data << uint64(target_guid);
- data << uint32(strlen(str) + 1);
- data << str;
- data << uint8 (_source ? _source->GetChatTag() : uint8(0));
+ ChatHandler::BuildChatPacket(data, _msgtype, LANG_UNIVERSAL, _source, _source, str);
}
private:
@@ -146,6 +129,7 @@ Battleground::Battleground()
m_ResetStatTimer = 0;
m_ValidStartPositionTimer = 0;
m_Events = 0;
+ m_StartDelayTime = 0;
m_IsRated = false;
m_BuffChange = false;
m_IsRandom = false;
@@ -163,6 +147,7 @@ Battleground::Battleground()
m_MapId = 0;
m_Map = NULL;
m_StartMaxDist = 0.0f;
+ ScriptId = 0;
m_TeamStartLocX[TEAM_ALLIANCE] = 0;
m_TeamStartLocX[TEAM_HORDE] = 0;
@@ -182,6 +167,9 @@ Battleground::Battleground()
m_ArenaTeamRatingChanges[TEAM_ALLIANCE] = 0;
m_ArenaTeamRatingChanges[TEAM_HORDE] = 0;
+ m_ArenaTeamMMR[TEAM_ALLIANCE] = 0;
+ m_ArenaTeamMMR[TEAM_HORDE] = 0;
+
m_BgRaids[TEAM_ALLIANCE] = NULL;
m_BgRaids[TEAM_HORDE] = NULL;
@@ -192,6 +180,7 @@ Battleground::Battleground()
m_TeamScores[TEAM_HORDE] = 0;
m_PrematureCountDown = false;
+ m_PrematureCountDownTimer = 0;
m_HonorMode = BG_NORMAL;
@@ -691,8 +680,8 @@ void Battleground::YellToAll(Creature* creature, char const* text, uint32 langua
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
if (Player* player = _GetPlayer(itr, "YellToAll"))
{
- WorldPacket data(SMSG_MESSAGECHAT, 200);
- creature->BuildMonsterChat(&data, CHAT_MSG_MONSTER_YELL, text, language, creature->GetName(), itr->first);
+ WorldPacket data;
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_MONSTER_YELL, Language(language), creature, player, text);
player->SendDirectMessage(&data);
}
}
@@ -987,6 +976,8 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
player->SpawnCorpseBones();
}
}
+ else // try to resurrect the offline player. If he is alive nothing will happen
+ sObjectAccessor->ConvertCorpseForPlayer(guid);
RemovePlayer(player, guid, team); // BG subclass specific code
@@ -1574,7 +1565,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
if (!map)
return NULL;
- Creature* creature = new Creature;
+ Creature* creature = new Creature();
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o))
{
TC_LOG_ERROR("bg.battleground", "Battleground::AddCreature: cannot create creature (entry: %u) for BG (map: %u, instance id: %u)!",
@@ -1703,30 +1694,25 @@ void Battleground::SendWarningToAll(int32 entry, ...)
if (!entry)
return;
- char const* format = sObjectMgr->GetTrinityStringForDBCLocale(entry);
-
- char str[1024];
- va_list ap;
- va_start(ap, entry);
- vsnprintf(str, 1024, format, ap);
- va_end(ap);
- std::string msg(str);
-
- WorldPacket data(SMSG_MESSAGECHAT, 200);
-
- data << (uint8)CHAT_MSG_RAID_BOSS_EMOTE;
- data << (uint32)LANG_UNIVERSAL;
- data << (uint64)0;
- data << (uint32)0; // 2.1.0
- data << (uint32)1;
- data << (uint8)0;
- data << (uint64)0;
- data << (uint32)(msg.length() + 1);
- data << msg.c_str();
- data << (uint8)0;
+ std::map<uint32, WorldPacket> localizedPackets;
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)))
- player->SendDirectMessage(&data);
+ {
+ if (localizedPackets.find(player->GetSession()->GetSessionDbLocaleIndex()) == localizedPackets.end())
+ {
+ char const* format = sObjectMgr->GetTrinityString(entry, player->GetSession()->GetSessionDbLocaleIndex());
+
+ char str[1024];
+ va_list ap;
+ va_start(ap, entry);
+ vsnprintf(str, 1024, format, ap);
+ va_end(ap);
+
+ ChatHandler::BuildChatPacket(localizedPackets[player->GetSession()->GetSessionDbLocaleIndex()], CHAT_MSG_RAID_BOSS_EMOTE, LANG_UNIVERSAL, NULL, NULL, str);
+ }
+
+ player->SendDirectMessage(&localizedPackets[player->GetSession()->GetSessionDbLocaleIndex()]);
+ }
}
void Battleground::SendMessage2ToAll(int32 entry, ChatMsg type, Player const* source, int32 arg1, int32 arg2)
diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h
index eebf5bead25..a866f09639a 100644
--- a/src/server/game/Battlegrounds/Battleground.h
+++ b/src/server/game/Battlegrounds/Battleground.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index 6797c1f5e64..9d7a67ee0dc 100644
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -52,6 +52,7 @@
BattlegroundMgr::BattlegroundMgr() :
m_NextRatedArenaUpdate(sWorld->getIntConfig(CONFIG_ARENA_RATED_UPDATE_TIMER)),
+ m_NextAutoDistributionTime(0),
m_AutoDistributionTimeChecker(0), m_ArenaTesting(false), m_Testing(false)
{ }
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h
index c66d9d64ab8..f10614baafc 100644
--- a/src/server/game/Battlegrounds/BattlegroundMgr.h
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
index ae7a8d2e191..547d6e972c5 100644
--- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.h b/src/server/game/Battlegrounds/BattlegroundQueue.h
index 34c9e5ea1c7..37c7928b3de 100644
--- a/src/server/game/Battlegrounds/BattlegroundQueue.h
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
index a26b9dbaa2f..c05bd98b908 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -35,6 +35,27 @@ BattlegroundAB::BattlegroundAB()
BgObjects.resize(BG_AB_OBJECT_MAX);
BgCreatures.resize(BG_AB_ALL_NODES_COUNT + 5);//+5 for aura triggers
+ for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
+ {
+ m_Nodes[i] = 0;
+ m_prevNodes[i] = 0;
+ m_NodeTimers[i] = 0;
+ m_BannerTimers[i].timer = 0;
+ m_BannerTimers[i].type = 0;
+ m_BannerTimers[i].teamIndex = 0;
+ }
+
+ for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i)
+ {
+ m_lastTick[i] = 0;
+ m_HonorScoreTics[i] = 0;
+ m_ReputationScoreTics[i] = 0;
+ m_TeamScores500Disadvantage[i] = false;
+ }
+
+ m_HonorTics = 0;
+ m_ReputationTics = 0;
+
StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_AB_START_TWO_MINUTES;
StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_AB_START_ONE_MINUTE;
StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_AB_START_HALF_MINUTE;
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h
index 81a2e899634..9ed34691adf 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
index 7a54317032b..6256f53f07b 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -33,6 +33,25 @@ BattlegroundAV::BattlegroundAV()
BgObjects.resize(BG_AV_OBJECT_MAX);
BgCreatures.resize(AV_CPLACE_MAX+AV_STATICCPLACE_MAX);
+ for (uint8 i = 0; i < 2; i++)
+ {
+ for (uint8 j = 0; j < 9; j++)
+ m_Team_QuestStatus[i][j] = 0;
+ m_Team_Scores[i] = 0;
+ m_IsInformedNearVictory[i] = false;
+ m_CaptainAlive[i] = true;
+ m_CaptainBuffTimer[i] = 0;
+ m_Mine_Owner[i] = 0;
+ m_Mine_PrevOwner[i] = 0;
+ m_Mine_Reclaim_Timer[i] = 0;
+ }
+
+ m_Mine_Timer = 0;
+ m_MaxLevel = 0;
+
+ for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
+ InitNode(i, 0, false);
+
StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_AV_START_TWO_MINUTES;
StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_AV_START_ONE_MINUTE;
StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_AV_START_HALF_MINUTE;
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
index 439fc656925..716e675a840 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp
index 264f421d9f7..c89fc57b8aa 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBE.h b/src/server/game/Battlegrounds/Zones/BattlegroundBE.h
index f9a3028ddf6..be801dfff2b 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp
index 4eed8b05c25..3eb52945236 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -29,6 +29,12 @@ BattlegroundDS::BattlegroundDS()
BgObjects.resize(BG_DS_OBJECT_MAX);
BgCreatures.resize(BG_DS_NPC_MAX);
+ _waterfallTimer = 0;
+ _waterfallStatus = 0;
+ _waterfallKnockbackTimer = 0;
+ _pipeKnockBackTimer = 0;
+ _pipeKnockBackCount = 0;
+
StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h
index cdfbbc480bb..cb71300dc5d 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@ enum BattlegroundDSCreatures
enum BattlegroundDSSpells
{
BG_DS_SPELL_FLUSH = 57405, // Visual and target selector for the starting knockback from the pipe
- BG_DS_SPELL_FLUSH_KNOCKBACK = 61698, // Knockback effect for previous spell (triggered, not need to be casted)
+ BG_DS_SPELL_FLUSH_KNOCKBACK = 61698, // Knockback effect for previous spell (triggered, not needed to be cast)
BG_DS_SPELL_WATER_SPOUT = 58873 // Knockback effect of the central waterfall
};
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
index d73242388c8..be2684631df 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -43,6 +43,28 @@ BattlegroundEY::BattlegroundEY()
m_Points_Trigger[BLOOD_ELF] = TR_BLOOD_ELF_BUFF;
m_Points_Trigger[DRAENEI_RUINS] = TR_DRAENEI_RUINS_BUFF;
m_Points_Trigger[MAGE_TOWER] = TR_MAGE_TOWER_BUFF;
+ m_HonorScoreTics[TEAM_ALLIANCE] = 0;
+ m_HonorScoreTics[TEAM_HORDE] = 0;
+ m_TeamPointsCount[TEAM_ALLIANCE] = 0;
+ m_TeamPointsCount[TEAM_HORDE] = 0;
+ m_FlagKeeper = 0;
+ m_DroppedFlagGUID = 0;
+ m_FlagCapturedBgObjectType = 0;
+ m_FlagState = BG_EY_FLAG_STATE_ON_BASE;
+ m_FlagsTimer = 0;
+ m_TowerCapCheckTimer = 0;
+ m_PointAddingTimer = 0;
+ m_HonorTics = 0;
+
+ for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
+ {
+ m_PointOwnedByTeam[i] = EY_POINT_NO_OWNER;
+ m_PointState[i] = EY_POINT_STATE_UNCONTROLLED;
+ m_PointBarStatus[i] = BG_EY_PROGRESS_BAR_STATE_MIDDLE;
+ }
+
+ for (uint8 i = 0; i < 2 * EY_POINTS_MAX; ++i)
+ m_CurrentPointPlayersCount[i] = 0;
StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_EY_START_TWO_MINUTES;
StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_EY_START_ONE_MINUTE;
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h
index 26c6d276311..baa75129c1e 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
index aa3568a62d5..590a07541fe 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -397,10 +397,8 @@ bool BattlegroundIC::SetupBattleground()
return false;
}
- //Send transport init packet to all player in map
- for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
- if (Player* player = ObjectAccessor::FindPlayer(itr->first))
- GetBgMap()->SendInitTransports(player);
+ gunshipHorde->EnableMovement(false);
+ gunshipAlliance->EnableMovement(false);
// setting correct factions for Keep Cannons
for (uint8 i = BG_IC_NPC_KEEP_CANNON_1; i < BG_IC_NPC_KEEP_CANNON_12; ++i)
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h
index acb5046444c..5238342ffcb 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp
index a2c1ca42406..70a940ec853 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundNA.h b/src/server/game/Battlegrounds/Zones/BattlegroundNA.h
index e3633197253..dd21e44f593 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundNA.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundNA.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp
index 045e007bdb7..5f77c57c064 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRL.h b/src/server/game/Battlegrounds/Zones/BattlegroundRL.h
index 877e0626271..27974108168 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundRL.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundRL.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp
index 5e5007d18a1..dd61b8b9e6f 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -28,6 +28,10 @@ BattlegroundRV::BattlegroundRV()
{
BgObjects.resize(BG_RV_OBJECT_MAX);
+ Timer = 0;
+ State = 0;
+ PillarCollision = false;
+
StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h
index a836e4e1af3..454ea723f8b 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
index 62c42ff3091..126077f7988 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -37,6 +37,22 @@ BattlegroundSA::BattlegroundSA()
SignaledRoundTwo = false;
SignaledRoundTwoHalfMin = false;
InitSecondRound = false;
+ gateDestroyed = false;
+ Attackers = TEAM_ALLIANCE;
+ TotalTime = 0;
+ EndRoundTimer = 0;
+ ShipsStarted = false;
+ Status = BG_SA_NOTSTARTED;
+
+ for (uint8 i = 0; i < 6; i++)
+ GateStatus[i] = BG_SA_GATE_OK;
+
+ for (uint8 i = 0; i < 2; i++)
+ {
+ RoundScores[i].winner = TEAM_ALLIANCE;
+ RoundScores[i].time = 0;
+ _allVehiclesAlive[i] = true;
+ }
//! This is here to prevent an uninitialised variable warning
//! The warning only occurs when SetUpBattleGround fails though.
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h
index c50721c4591..eb5e54231b5 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
index d035f5a6ca2..92d56bbf5f0 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -54,6 +54,21 @@ BattlegroundWS::BattlegroundWS()
_flagSpellForceTimer = 0;
_bothFlagsKept = false;
_flagDebuffState = 0;
+ m_FlagKeepers[TEAM_ALLIANCE] = 0;
+ m_FlagKeepers[TEAM_HORDE] = 0;
+ m_DroppedFlagGUID[TEAM_ALLIANCE] = 0;
+ m_DroppedFlagGUID[TEAM_HORDE] = 0;
+ _flagState[TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE;
+ _flagState[TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE;
+ _flagsTimer[TEAM_ALLIANCE] = 0;
+ _flagsTimer[TEAM_HORDE] = 0;
+ _flagsDropTimer[TEAM_ALLIANCE] = 0;
+ _flagsDropTimer[TEAM_HORDE] = 0;
+ _lastFlagCaptureTeam = 0;
+ m_ReputationCapture = 0;
+ m_HonorWinKills = 0;
+ m_HonorEndKills = 0;
+ _minutesElapsed = 0;
}
BattlegroundWS::~BattlegroundWS() { }
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h
index 4b95fcf6afd..c6c25ec52de 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/CMakeLists.txt b/src/server/game/CMakeLists.txt
index be3997243e4..bf46c1fd7c6 100644
--- a/src/server/game/CMakeLists.txt
+++ b/src/server/game/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp
index bd3a97adb09..f7a6864fb95 100644
--- a/src/server/game/Calendar/CalendarMgr.cpp
+++ b/src/server/game/Calendar/CalendarMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -34,7 +34,7 @@ CalendarEvent::~CalendarEvent()
sCalendarMgr->FreeEventId(_eventId);
}
-CalendarMgr::CalendarMgr() { }
+CalendarMgr::CalendarMgr() : _maxEventId(0), _maxInviteId(0) { }
CalendarMgr::~CalendarMgr()
{
diff --git a/src/server/game/Calendar/CalendarMgr.h b/src/server/game/Calendar/CalendarMgr.h
index 402a8cb00df..da185d519d5 100644
--- a/src/server/game/Calendar/CalendarMgr.h
+++ b/src/server/game/Calendar/CalendarMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp
index 9e0747c3d11..3f6a40d825d 100644
--- a/src/server/game/Chat/Channels/Channel.cpp
+++ b/src/server/game/Chat/Channels/Channel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -600,10 +600,6 @@ void Channel::Say(uint64 guid, std::string const& what, uint32 lang)
if (what.empty())
return;
- uint8 chatTag = 0;
- if (Player* player = ObjectAccessor::FindPlayer(guid))
- chatTag = player->GetChatTag();
-
// TODO: Add proper RBAC check
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
lang = LANG_UNIVERSAL;
@@ -624,16 +620,11 @@ void Channel::Say(uint64 guid, std::string const& what, uint32 lang)
return;
}
- WorldPacket data(SMSG_MESSAGECHAT, 1 + 4 + 8 + 4 + _name.size() + 8 + 4 + what.size() + 1);
- data << uint8(CHAT_MSG_CHANNEL);
- data << uint32(lang);
- data << uint64(guid);
- data << uint32(0);
- data << _name;
- data << uint64(guid);
- data << uint32(what.size() + 1);
- data << what;
- data << uint8(chatTag);
+ WorldPacket data;
+ if (Player* player = ObjectAccessor::FindPlayer(guid))
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), player, player, what, 0, _name);
+ else
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), guid, guid, what, 0, "", "", 0, false, _name);
SendToAll(&data, !playersStore[guid].IsModerator() ? guid : false);
}
diff --git a/src/server/game/Chat/Channels/Channel.h b/src/server/game/Chat/Channels/Channel.h
index 295c8d5394d..9ad6877d929 100644
--- a/src/server/game/Chat/Channels/Channel.h
+++ b/src/server/game/Chat/Channels/Channel.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp
index 96d28035b29..0975a690889 100644
--- a/src/server/game/Chat/Channels/ChannelMgr.cpp
+++ b/src/server/game/Chat/Channels/ChannelMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Chat/Channels/ChannelMgr.h b/src/server/game/Chat/Channels/ChannelMgr.h
index 74a0d622e80..603eb52f589 100644
--- a/src/server/game/Chat/Channels/ChannelMgr.h
+++ b/src/server/game/Chat/Channels/ChannelMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index 99dd23aa649..d90fd6f8443 100644
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -210,7 +210,7 @@ void ChatHandler::SendSysMessage(const char *str)
while (char* line = LineFromMessage(pos))
{
- FillSystemMessageData(&data, line);
+ BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, NULL, line);
m_session->SendPacket(&data);
}
@@ -228,7 +228,7 @@ void ChatHandler::SendGlobalSysMessage(const char *str)
while (char* line = LineFromMessage(pos))
{
- FillSystemMessageData(&data, line);
+ BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, NULL, line);
sWorld->SendGlobalMessage(&data);
}
@@ -246,9 +246,10 @@ void ChatHandler::SendGlobalGMSysMessage(const char *str)
while (char* line = LineFromMessage(pos))
{
- FillSystemMessageData(&data, line);
+ BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, NULL, line);
sWorld->SendGlobalGMMessage(&data);
- }
+ }
+
free(buf);
}
@@ -628,84 +629,113 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand* table, const char* cmd)
return ShowHelpForSubCommands(table, "", cmd);
}
-//Note: target_guid used only in CHAT_MSG_WHISPER_INFORM mode (in this case channelName ignored)
-void ChatHandler::FillMessageData(WorldPacket* data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit* speaker)
+size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, uint64 senderGUID, uint64 receiverGUID, std::string const& message, uint8 chatTag,
+ std::string const& senderName /*= ""*/, std::string const& receiverName /*= ""*/,
+ uint32 achievementId /*= 0*/, bool gmMessage /*= false*/, std::string const& channelName /*= ""*/)
{
- uint32 messageLength = (message ? strlen(message) : 0) + 1;
-
- data->Initialize(SMSG_MESSAGECHAT, 100); // guess size
- *data << uint8(type);
- if ((type != CHAT_MSG_CHANNEL && type != CHAT_MSG_WHISPER) || language == LANG_ADDON)
- *data << uint32(language);
- else
- *data << uint32(LANG_UNIVERSAL);
-
- switch (type)
+ size_t receiverGUIDPos = 0;
+ data.Initialize(!gmMessage ? SMSG_MESSAGECHAT : SMSG_GM_MESSAGECHAT);
+ data << uint8(chatType);
+ data << int32(language);
+ data << uint64(senderGUID);
+ data << uint32(0); // some flags
+ switch (chatType)
{
- case CHAT_MSG_SAY:
- case CHAT_MSG_PARTY:
- case CHAT_MSG_PARTY_LEADER:
- case CHAT_MSG_RAID:
- case CHAT_MSG_GUILD:
- case CHAT_MSG_OFFICER:
- case CHAT_MSG_YELL:
- case CHAT_MSG_WHISPER:
- case CHAT_MSG_CHANNEL:
- case CHAT_MSG_RAID_LEADER:
- case CHAT_MSG_RAID_WARNING:
- case CHAT_MSG_BG_SYSTEM_NEUTRAL:
- case CHAT_MSG_BG_SYSTEM_ALLIANCE:
- case CHAT_MSG_BG_SYSTEM_HORDE:
- case CHAT_MSG_BATTLEGROUND:
- case CHAT_MSG_BATTLEGROUND_LEADER:
- target_guid = session ? session->GetPlayer()->GetGUID() : 0;
- break;
case CHAT_MSG_MONSTER_SAY:
case CHAT_MSG_MONSTER_PARTY:
case CHAT_MSG_MONSTER_YELL:
case CHAT_MSG_MONSTER_WHISPER:
case CHAT_MSG_MONSTER_EMOTE:
- case CHAT_MSG_RAID_BOSS_WHISPER:
case CHAT_MSG_RAID_BOSS_EMOTE:
+ case CHAT_MSG_RAID_BOSS_WHISPER:
case CHAT_MSG_BATTLENET:
- {
- *data << uint64(speaker->GetGUID());
- *data << uint32(0); // 2.1.0
- *data << uint32(speaker->GetName().size() + 1);
- *data << speaker->GetName();
- *data << uint64(0); // listener_guid
- //if (listener_guid && !IS_PLAYER_GUID(listener_guid))
- //{
- // *data << uint32(1); // string listener_name_length
- // *data << uint8(0); // string listener_name
- //}
- *data << uint32(messageLength);
- *data << message;
- *data << uint8(0);
- return;
- }
+ data << uint32(senderName.length() + 1);
+ data << senderName;
+ receiverGUIDPos = data.wpos();
+ data << uint64(receiverGUID);
+ if (receiverGUID && !IS_PLAYER_GUID(receiverGUID) && !IS_PET_GUID(receiverGUID))
+ {
+ data << uint32(receiverName.length() + 1);
+ data << receiverName;
+ }
+ break;
+ case CHAT_MSG_WHISPER_FOREIGN:
+ data << uint32(senderName.length() + 1);
+ data << senderName;
+ receiverGUIDPos = data.wpos();
+ data << uint64(receiverGUID);
+ break;
+ case CHAT_MSG_BG_SYSTEM_NEUTRAL:
+ case CHAT_MSG_BG_SYSTEM_ALLIANCE:
+ case CHAT_MSG_BG_SYSTEM_HORDE:
+ receiverGUIDPos = data.wpos();
+ data << uint64(receiverGUID);
+ if (receiverGUID && !IS_PLAYER_GUID(receiverGUID))
+ {
+ data << uint32(receiverName.length() + 1);
+ data << receiverName;
+ }
+ break;
+ case CHAT_MSG_ACHIEVEMENT:
+ case CHAT_MSG_GUILD_ACHIEVEMENT:
+ receiverGUIDPos = data.wpos();
+ data << uint64(receiverGUID);
+ break;
default:
- if (type != CHAT_MSG_WHISPER_INFORM && type != CHAT_MSG_IGNORED && type != CHAT_MSG_DND && type != CHAT_MSG_AFK)
- target_guid = 0; // only for CHAT_MSG_WHISPER_INFORM used original value target_guid
+ if (gmMessage)
+ {
+ data << uint32(senderName.length() + 1);
+ data << senderName;
+ }
+
+ if (chatType == CHAT_MSG_CHANNEL)
+ {
+ ASSERT(channelName.length() > 0);
+ data << channelName;
+ }
+
+ receiverGUIDPos = data.wpos();
+ data << uint64(receiverGUID);
break;
}
- *data << uint64(target_guid); // there 0 for BG messages
- *data << uint32(0); // can be chat msg group or something
+ data << uint32(message.length() + 1);
+ data << message;
+ data << uint8(chatTag);
- if (type == CHAT_MSG_CHANNEL)
+ if (chatType == CHAT_MSG_ACHIEVEMENT || chatType == CHAT_MSG_GUILD_ACHIEVEMENT)
+ data << uint32(achievementId);
+
+ return receiverGUIDPos;
+}
+
+size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, WorldObject const* sender, WorldObject const* receiver, std::string const& message,
+ uint32 achievementId /*= 0*/, std::string const& channelName /*= ""*/, LocaleConstant locale /*= DEFAULT_LOCALE*/)
+{
+ uint64 senderGUID = 0;
+ std::string senderName = "";
+ uint8 chatTag = 0;
+ bool gmMessage = false;
+ uint64 receiverGUID = 0;
+ std::string receiverName = "";
+ if (sender)
+ {
+ senderGUID = sender->GetGUID();
+ senderName = sender->GetNameForLocaleIdx(locale);
+ if (Player const* playerSender = sender->ToPlayer())
+ {
+ chatTag = playerSender->GetChatTag();
+ gmMessage = playerSender->GetSession()->HasPermission(rbac::RBAC_PERM_COMMAND_GM_CHAT);
+ }
+ }
+
+ if (receiver)
{
- ASSERT(channelName);
- *data << channelName;
+ receiverGUID = receiver->GetGUID();
+ receiverName = receiver->GetNameForLocaleIdx(locale);
}
- *data << uint64(target_guid);
- *data << uint32(messageLength);
- *data << message;
- if (session != 0 && type != CHAT_MSG_WHISPER_INFORM && type != CHAT_MSG_DND && type != CHAT_MSG_AFK)
- *data << uint8(session->GetPlayer()->GetChatTag());
- else
- *data << uint8(0);
+ return BuildChatPacket(data, chatType, language, senderGUID, receiverGUID, message, chatTag, senderName, receiverName, achievementId, gmMessage, channelName);
}
Player* ChatHandler::getSelectedPlayer()
diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h
index 9574d3b38c3..f9000f636c5 100644
--- a/src/server/game/Chat/Chat.h
+++ b/src/server/game/Chat/Chat.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -53,17 +53,13 @@ class ChatHandler
explicit ChatHandler(WorldSession* session) : m_session(session), sentErrorMessage(false) { }
virtual ~ChatHandler() { }
- static void FillMessageData(WorldPacket* data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit* speaker);
+ // Builds chat packet and returns receiver guid position in the packet to substitute in whisper builders
+ static size_t BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, uint64 senderGUID, uint64 receiverGUID, std::string const& message, uint8 chatTag,
+ std::string const& senderName = "", std::string const& receiverName = "",
+ uint32 achievementId = 0, bool gmMessage = false, std::string const& channelName = "");
- void FillMessageData(WorldPacket* data, uint8 type, uint32 language, uint64 target_guid, const char* message)
- {
- FillMessageData(data, m_session, type, language, NULL, target_guid, message, NULL);
- }
-
- void FillSystemMessageData(WorldPacket* data, const char* message)
- {
- FillMessageData(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, 0, message);
- }
+ // Builds chat packet and returns receiver guid position in the packet to substitute in whisper builders
+ static size_t BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, WorldObject const* sender, WorldObject const* receiver, std::string const& message, uint32 achievementId = 0, std::string const& channelName = "", LocaleConstant locale = DEFAULT_LOCALE);
static char* LineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = NULL; return start; }
diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp
index dd602ea07ab..66758930f7f 100644
--- a/src/server/game/Chat/ChatLink.cpp
+++ b/src/server/game/Chat/ChatLink.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Chat/ChatLink.h b/src/server/game/Chat/ChatLink.h
index c77fcf7ad76..cc86cb538ea 100644
--- a/src/server/game/Chat/ChatLink.h
+++ b/src/server/game/Chat/ChatLink.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -57,7 +57,7 @@ class ItemChatLink : public ChatLink
{
public:
ItemChatLink() : ChatLink(), _item(NULL), _suffix(NULL), _property(NULL)
- {
+ {
memset(_data, 0, sizeof(_data));
}
virtual bool Initialize(std::istringstream& iss);
@@ -102,7 +102,7 @@ class AchievementChatLink : public ChatLink
{
public:
AchievementChatLink() : ChatLink(), _guid(0), _achievement(NULL)
- {
+ {
memset(_data, 0, sizeof(_data));
}
virtual bool Initialize(std::istringstream& iss);
diff --git a/src/server/game/Combat/HostileRefManager.cpp b/src/server/game/Combat/HostileRefManager.cpp
index 1e550596368..e359727ecb7 100644
--- a/src/server/game/Combat/HostileRefManager.cpp
+++ b/src/server/game/Combat/HostileRefManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Combat/HostileRefManager.h b/src/server/game/Combat/HostileRefManager.h
index 84c8db8bff0..495ef23d536 100644
--- a/src/server/game/Combat/HostileRefManager.h
+++ b/src/server/game/Combat/HostileRefManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp
index ed23a72bee1..339ec579b1a 100644
--- a/src/server/game/Combat/ThreatManager.cpp
+++ b/src/server/game/Combat/ThreatManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Combat/ThreatManager.h b/src/server/game/Combat/ThreatManager.h
index 2d13d8b61e2..dd5904ae2ec 100644
--- a/src/server/game/Combat/ThreatManager.h
+++ b/src/server/game/Combat/ThreatManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Combat/UnitEvents.h b/src/server/game/Combat/UnitEvents.h
index 8bb7d95a384..50d4c3ad322 100644
--- a/src/server/game/Combat/UnitEvents.h
+++ b/src/server/game/Combat/UnitEvents.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 2160fbdd173..e76ba18f1e2 100644
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h
index cc2db10e437..876b922d243 100644
--- a/src/server/game/Conditions/ConditionMgr.h
+++ b/src/server/game/Conditions/ConditionMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -192,6 +192,7 @@ struct Condition
SourceType = CONDITION_SOURCE_TYPE_NONE;
SourceGroup = 0;
SourceEntry = 0;
+ SourceId = 0;
ElseGroup = 0;
ConditionType = CONDITION_NONE;
ConditionTarget = 0;
diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp
index c32d4e4120e..b29959cac50 100644
--- a/src/server/game/Conditions/DisableMgr.cpp
+++ b/src/server/game/Conditions/DisableMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Conditions/DisableMgr.h b/src/server/game/Conditions/DisableMgr.h
index 38751b8a89f..0930da78547 100644
--- a/src/server/game/Conditions/DisableMgr.h
+++ b/src/server/game/Conditions/DisableMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h
index 171d0fe8cc2..87397c6685b 100644
--- a/src/server/game/DataStores/DBCEnums.h
+++ b/src/server/game/DataStores/DBCEnums.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -201,7 +201,7 @@ enum AchievementCriteriaTypes
ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT = 101,
ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED = 102,
ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED = 103,
- ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED = 104,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CAST = 104,
ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED = 105,
ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED = 106,
ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED = 107,
@@ -224,35 +224,35 @@ enum AchievementCategory
enum AreaFlags
{
- AREA_FLAG_UNK0 = 0x00000001, // Unknown
- AREA_FLAG_UNK1 = 0x00000002, // Razorfen Downs, Naxxramas and Acherus: The Ebon Hold (3.3.5a)
- AREA_FLAG_UNK2 = 0x00000004, // Only used for areas on map 571 (development before)
- AREA_FLAG_SLAVE_CAPITAL = 0x00000008, // city and city subsones
- AREA_FLAG_UNK3 = 0x00000010, // can't find common meaning
- AREA_FLAG_SLAVE_CAPITAL2 = 0x00000020, // slave capital city flag?
- AREA_FLAG_ALLOW_DUELS = 0x00000040, // allow to duel here
- AREA_FLAG_ARENA = 0x00000080, // arena, both instanced and world arenas
- AREA_FLAG_CAPITAL = 0x00000100, // main capital city flag
- AREA_FLAG_CITY = 0x00000200, // only for one zone named "City" (where it located?)
- AREA_FLAG_OUTLAND = 0x00000400, // expansion zones? (only Eye of the Storm not have this flag, but have 0x00004000 flag)
- AREA_FLAG_SANCTUARY = 0x00000800, // sanctuary area (PvP disabled)
- AREA_FLAG_NEED_FLY = 0x00001000, // Respawn alive at the graveyard without corpse
- AREA_FLAG_UNUSED1 = 0x00002000, // Unused in 3.3.5a
- AREA_FLAG_OUTLAND2 = 0x00004000, // expansion zones? (only Circle of Blood Arena not have this flag, but have 0x00000400 flag)
- AREA_FLAG_OUTDOOR_PVP = 0x00008000, // pvp objective area? (Death's Door also has this flag although it's no pvp object area)
- AREA_FLAG_ARENA_INSTANCE = 0x00010000, // used by instanced arenas only
- AREA_FLAG_UNUSED2 = 0x00020000, // Unused in 3.3.5a
- AREA_FLAG_CONTESTED_AREA = 0x00040000, // On PvP servers these areas are considered contested, even though the zone it is contained in is a Horde/Alliance territory.
- AREA_FLAG_UNK6 = 0x00080000, // Valgarde and Acherus: The Ebon Hold
- AREA_FLAG_LOWLEVEL = 0x00100000, // used for some starting areas with area_level <= 15
- AREA_FLAG_TOWN = 0x00200000, // small towns with Inn
- AREA_FLAG_UNK7 = 0x00400000, // Warsong Hold, Acherus: The Ebon Hold, New Agamand Inn, Vengeance Landing Inn, Sunreaver Pavilion (Something to do with team?)
- AREA_FLAG_UNK8 = 0x00800000, // Valgarde, Acherus: The Ebon Hold, Westguard Inn, Silver Covenant Pavilion (Something to do with team?)
- AREA_FLAG_WINTERGRASP = 0x01000000, // Wintergrasp and it's subzones
- AREA_FLAG_INSIDE = 0x02000000, // used for determinating spell related inside/outside questions in Map::IsOutdoors
- AREA_FLAG_OUTSIDE = 0x04000000, // used for determinating spell related inside/outside questions in Map::IsOutdoors
- AREA_FLAG_WINTERGRASP_2 = 0x08000000, // Can Hearth And Resurrect From Area
- AREA_FLAG_NO_FLY_ZONE = 0x20000000 // Marks zones where you cannot fly
+ AREA_FLAG_UNK0 = 0x00000001, // Unknown
+ AREA_FLAG_UNK1 = 0x00000002, // Razorfen Downs, Naxxramas and Acherus: The Ebon Hold (3.3.5a)
+ AREA_FLAG_UNK2 = 0x00000004, // Only used for areas on map 571 (development before)
+ AREA_FLAG_SLAVE_CAPITAL = 0x00000008, // city and city subsones
+ AREA_FLAG_UNK3 = 0x00000010, // can't find common meaning
+ AREA_FLAG_SLAVE_CAPITAL2 = 0x00000020, // slave capital city flag?
+ AREA_FLAG_ALLOW_DUELS = 0x00000040, // allow to duel here
+ AREA_FLAG_ARENA = 0x00000080, // arena, both instanced and world arenas
+ AREA_FLAG_CAPITAL = 0x00000100, // main capital city flag
+ AREA_FLAG_CITY = 0x00000200, // only for one zone named "City" (where it located?)
+ AREA_FLAG_OUTLAND = 0x00000400, // expansion zones? (only Eye of the Storm not have this flag, but have 0x00004000 flag)
+ AREA_FLAG_SANCTUARY = 0x00000800, // sanctuary area (PvP disabled)
+ AREA_FLAG_NEED_FLY = 0x00001000, // Respawn alive at the graveyard without corpse
+ AREA_FLAG_UNUSED1 = 0x00002000, // Unused in 3.3.5a
+ AREA_FLAG_OUTLAND2 = 0x00004000, // expansion zones? (only Circle of Blood Arena not have this flag, but have 0x00000400 flag)
+ AREA_FLAG_OUTDOOR_PVP = 0x00008000, // pvp objective area? (Death's Door also has this flag although it's no pvp object area)
+ AREA_FLAG_ARENA_INSTANCE = 0x00010000, // used by instanced arenas only
+ AREA_FLAG_UNUSED2 = 0x00020000, // Unused in 3.3.5a
+ AREA_FLAG_CONTESTED_AREA = 0x00040000, // On PvP servers these areas are considered contested, even though the zone it is contained in is a Horde/Alliance territory.
+ AREA_FLAG_UNK4 = 0x00080000, // Valgarde and Acherus: The Ebon Hold
+ AREA_FLAG_LOWLEVEL = 0x00100000, // used for some starting areas with area_level <= 15
+ AREA_FLAG_TOWN = 0x00200000, // small towns with Inn
+ AREA_FLAG_REST_ZONE_HORDE = 0x00400000, // Instead of using areatriggers, the zone will act as one for Horde players (Warsong Hold, Acherus: The Ebon Hold, New Agamand Inn, Vengeance Landing Inn, Sunreaver Pavilion, etc)
+ AREA_FLAG_REST_ZONE_ALLIANCE = 0x00800000, // Instead of using areatriggers, the zone will act as one for Alliance players (Valgarde, Acherus: The Ebon Hold, Westguard Inn, Silver Covenant Pavilion, etc)
+ AREA_FLAG_WINTERGRASP = 0x01000000, // Wintergrasp and it's subzones
+ AREA_FLAG_INSIDE = 0x02000000, // used for determinating spell related inside/outside questions in Map::IsOutdoors
+ AREA_FLAG_OUTSIDE = 0x04000000, // used for determinating spell related inside/outside questions in Map::IsOutdoors
+ AREA_FLAG_WINTERGRASP_2 = 0x08000000, // Can Hearth And Resurrect From Area
+ AREA_FLAG_NO_FLY_ZONE = 0x20000000 // Marks zones where you cannot fly
};
enum Difficulty
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index 1fc2c3ee9f2..a4b3ded80e5 100644
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -482,7 +482,8 @@ void LoadDBCStores(const std::string& dataPath)
continue;
for (int x = 0; x < MAX_DIFFICULTY; ++x)
- sSpellMgr->SetSpellDifficultyId(uint32(newEntry.SpellID[x]), spellDiff->ID);
+ if (newEntry.SpellID[x])
+ sSpellMgr->SetSpellDifficultyId(uint32(newEntry.SpellID[x]), spellDiff->ID);
}
// create talent spells set
diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h
index 808ebb78fa5..fe8fb35220b 100644
--- a/src/server/game/DataStores/DBCStores.h
+++ b/src/server/game/DataStores/DBCStores.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h
index 0c1f6af5506..7fb82ac8e03 100644
--- a/src/server/game/DataStores/DBCStructure.h
+++ b/src/server/game/DataStores/DBCStructure.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h
index 0066db2b049..a1ebaa70018 100644
--- a/src/server/game/DataStores/DBCfmt.h
+++ b/src/server/game/DataStores/DBCfmt.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/DungeonFinding/LFG.cpp b/src/server/game/DungeonFinding/LFG.cpp
index ce16ad5533e..0d4dbe9ea2f 100644
--- a/src/server/game/DungeonFinding/LFG.cpp
+++ b/src/server/game/DungeonFinding/LFG.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/DungeonFinding/LFG.h b/src/server/game/DungeonFinding/LFG.h
index 541e4d6bd43..0030dfa6c4b 100644
--- a/src/server/game/DungeonFinding/LFG.h
+++ b/src/server/game/DungeonFinding/LFG.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/DungeonFinding/LFGGroupData.cpp b/src/server/game/DungeonFinding/LFGGroupData.cpp
index f711514e26d..d7c9efeb70e 100644
--- a/src/server/game/DungeonFinding/LFGGroupData.cpp
+++ b/src/server/game/DungeonFinding/LFGGroupData.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/DungeonFinding/LFGGroupData.h b/src/server/game/DungeonFinding/LFGGroupData.h
index 47e562c37aa..b2bffd5a13b 100644
--- a/src/server/game/DungeonFinding/LFGGroupData.h
+++ b/src/server/game/DungeonFinding/LFGGroupData.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index 783511c8251..2dcba7b6a76 100644
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -238,7 +238,7 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
AreaTrigger const* at = sObjectMgr->GetMapEntranceTrigger(dungeon.map);
if (!at)
{
- TC_LOG_ERROR("lfg", "LFGMgr::LoadLFGDungeons: Failed to load dungeon %s, cant find areatrigger for map %u", dungeon.name.c_str(), dungeon.map);
+ TC_LOG_ERROR("sql.sql", "Failed to load dungeon %s, cant find areatrigger for map %u", dungeon.name.c_str(), dungeon.map);
continue;
}
@@ -325,7 +325,7 @@ void LFGMgr::Update(uint32 diff)
// Check if a proposal can be formed with the new groups being added
for (LfgQueueContainer::iterator it = QueuesStore.begin(); it != QueuesStore.end(); ++it)
if (uint8 newProposals = it->second.FindGroups())
- TC_LOG_DEBUG("lfg", "LFGMgr::Update: Found %u new groups in queue %u", newProposals, it->first);
+ TC_LOG_DEBUG("lfg.update", "Found %u new groups in queue %u", newProposals, it->first);
if (lastProposalId != m_lfgProposalId)
{
@@ -542,7 +542,6 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
isRaid = true;
break;
default:
- TC_LOG_ERROR("lfg", "Wrong dungeon type %u for dungeon %u", type, *it);
joinData.result = LFG_JOIN_DUNGEON_INVALID;
break;
}
@@ -565,7 +564,9 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
// Can't join. Send result
if (joinData.result != LFG_JOIN_OK)
{
- TC_LOG_DEBUG("lfg", "LFGMgr::Join: [" UI64FMTD "] joining with %u members. result: %u", guid, grp ? grp->GetMembersCount() : 1, joinData.result);
+ TC_LOG_DEBUG("lfg.join", "%u joining with %u members. Result: %u, Dungeons: %s",
+ GUID_LOPART(guid), grp ? grp->GetMembersCount() : 1, joinData.result, ConcatenateDungeons(dungeons).c_str());
+
if (!dungeons.empty()) // Only should show lockmap when have no dungeons available
joinData.lockmap.clear();
player->GetSession()->SendLfgJoinResult(joinData);
@@ -576,7 +577,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
if (isRaid)
{
- TC_LOG_DEBUG("lfg", "LFGMgr::Join: [" UI64FMTD "] trying to join raid browser and it's disabled.", guid);
+ TC_LOG_DEBUG("lfg.join", "%u trying to join raid browser and it's disabled.", GUID_LOPART(guid));
return;
}
@@ -642,13 +643,8 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
debugNames.append(player->GetName());
}
- if (sLog->ShouldLog("lfg", LOG_LEVEL_DEBUG))
- {
- std::ostringstream o;
- o << "LFGMgr::Join: [" << guid << "] joined (" << (grp ? "group" : "player") << ") Members: " << debugNames.c_str()
- << ". Dungeons (" << uint32(dungeons.size()) << "): " << ConcatenateDungeons(dungeons);
- TC_LOG_DEBUG("lfg", "%s", o.str().c_str());
- }
+ TC_LOG_DEBUG("lfg.join", "%u joined (%s), Members: %s. Dungeons (%u): %s", GUID_LOPART(guid),
+ grp ? "group" : "player", debugNames.c_str(), uint32(dungeons.size()), ConcatenateDungeons(dungeons).c_str());
}
/**
@@ -659,9 +655,10 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
*/
void LFGMgr::LeaveLfg(uint64 guid)
{
- TC_LOG_DEBUG("lfg", "LFGMgr::LeaveLfg: [" UI64FMTD "]", guid);
-
uint64 gguid = IS_GROUP_GUID(guid) ? guid : GetGroup(guid);
+
+ TC_LOG_DEBUG("lfg.leave", "%u left (%s)", GUID_LOPART(guid), guid == gguid ? "group" : "player");
+
LfgState state = GetState(guid);
switch (state)
{
@@ -1017,7 +1014,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
LfgProposalPlayer& player = itProposalPlayer->second;
player.accept = LfgAnswer(accept);
- TC_LOG_DEBUG("lfg", "LFGMgr::UpdateProposal: Player [" UI64FMTD "] of proposal %u selected: %u", guid, proposalId, accept);
+ TC_LOG_DEBUG("lfg.proposal.update", "Player %u, Proposal %u, Selection: %u", GUID_LOPART(guid), proposalId, accept);
if (!accept)
{
RemoveProposal(itProposal, LFG_UPDATETYPE_PROPOSAL_DECLINED);
@@ -1108,7 +1105,7 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate
LfgProposal& proposal = itProposal->second;
proposal.state = LFG_PROPOSAL_FAILED;
- TC_LOG_DEBUG("lfg", "LFGMgr::RemoveProposal: Proposal %u, state FAILED, UpdateType %u", itProposal->first, type);
+ TC_LOG_DEBUG("lfg.proposal.remove", "Proposal %u, state FAILED, UpdateType %u", itProposal->first, type);
// Mark all people that didn't answered as no accept
if (type == LFG_UPDATETYPE_PROPOSAL_FAILED)
for (LfgProposalPlayerContainer::iterator it = proposal.players.begin(); it != proposal.players.end(); ++it)
@@ -1145,12 +1142,12 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate
if (it->second.accept == LFG_ANSWER_DENY)
{
updateData.updateType = type;
- TC_LOG_DEBUG("lfg", "LFGMgr::RemoveProposal: [" UI64FMTD "] didn't accept. Removing from queue and compatible cache", guid);
+ TC_LOG_DEBUG("lfg.proposal.remove", "%u didn't accept. Removing from queue and compatible cache", GUID_LOPART(guid));
}
else
{
updateData.updateType = LFG_UPDATETYPE_REMOVED_FROM_QUEUE;
- TC_LOG_DEBUG("lfg", "LFGMgr::RemoveProposal: [" UI64FMTD "] in same group that someone that didn't accept. Removing from queue and compatible cache", guid);
+ TC_LOG_DEBUG("lfg.proposal.remove", "%u in same group that someone that didn't accept. Removing from queue and compatible cache", GUID_LOPART(guid));
}
RestoreState(guid, "Proposal Fail (didn't accepted or in group with someone that didn't accept");
@@ -1164,7 +1161,7 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate
}
else
{
- TC_LOG_DEBUG("lfg", "LFGMgr::RemoveProposal: Readding [" UI64FMTD "] to queue.", guid);
+ TC_LOG_DEBUG("lfg.proposal.remove", "Readding %u to queue.", GUID_LOPART(guid));
SetState(guid, LFG_STATE_QUEUED);
if (gguid != guid)
{
@@ -1309,7 +1306,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
if (!dungeon)
{
- TC_LOG_DEBUG("lfg", "TeleportPlayer: Player %s not in group/lfggroup or dungeon not found!",
+ TC_LOG_DEBUG("lfg.teleport", "Player %s not in group/lfggroup or dungeon not found!",
player->GetName().c_str());
player->GetSession()->SendLfgTeleportError(uint8(LFG_TELEPORTERROR_INVALID_LOCATION));
return;
@@ -1317,7 +1314,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
if (out)
{
- TC_LOG_DEBUG("lfg", "TeleportPlayer: Player %s is being teleported out. Current Map %u - Expected Map %u",
+ TC_LOG_DEBUG("lfg.teleport", "Player %s is being teleported out. Current Map %u - Expected Map %u",
player->GetName().c_str(), player->GetMapId(), uint32(dungeon->map));
if (player->GetMapId() == uint32(dungeon->map))
player->TeleportToBGEntryPoint();
@@ -1381,7 +1378,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
if (error != LFG_TELEPORTERROR_OK)
player->GetSession()->SendLfgTeleportError(uint8(error));
- TC_LOG_DEBUG("lfg", "TeleportPlayer: Player %s is being teleported in to map %u "
+ TC_LOG_DEBUG("lfg.teleport", "Player %s is being teleported in to map %u "
"(x: %f, y: %f, z: %f) Result: %u", player->GetName().c_str(), dungeon->map,
dungeon->x, dungeon->y, dungeon->z, error);
}
@@ -1397,13 +1394,13 @@ void LFGMgr::FinishDungeon(uint64 gguid, const uint32 dungeonId)
uint32 gDungeonId = GetDungeon(gguid);
if (gDungeonId != dungeonId)
{
- TC_LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [" UI64FMTD "] Finished dungeon %u but group queued for %u. Ignoring", gguid, dungeonId, gDungeonId);
+ TC_LOG_DEBUG("lfg.dungeon.finish", "Group %u finished dungeon %u but queued for %u", GUID_LOPART(gguid), dungeonId, gDungeonId);
return;
}
if (GetState(gguid) == LFG_STATE_FINISHED_DUNGEON) // Shouldn't happen. Do not reward multiple times
{
- TC_LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [" UI64FMTD "] Already rewarded group. Ignoring", gguid);
+ TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u already rewarded", GUID_LOPART(gguid));
return;
}
@@ -1415,7 +1412,7 @@ void LFGMgr::FinishDungeon(uint64 gguid, const uint32 dungeonId)
uint64 guid = (*it);
if (GetState(guid) == LFG_STATE_FINISHED_DUNGEON)
{
- TC_LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [" UI64FMTD "] Already rewarded player. Ignoring", guid);
+ TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u, Player: %u already rewarded", GUID_LOPART(gguid), GUID_LOPART(guid));
continue;
}
@@ -1431,14 +1428,14 @@ void LFGMgr::FinishDungeon(uint64 gguid, const uint32 dungeonId)
if (!dungeon || (dungeon->type != LFG_TYPE_RANDOM && !dungeon->seasonal))
{
- TC_LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [" UI64FMTD "] dungeon %u is not random or seasonal", guid, rDungeonId);
+ TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u, Player: %u dungeon %u is not random or seasonal", GUID_LOPART(gguid), GUID_LOPART(guid), rDungeonId);
continue;
}
Player* player = ObjectAccessor::FindPlayer(guid);
if (!player || !player->IsInWorld())
{
- TC_LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [" UI64FMTD "] not found in world", guid);
+ TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u, Player: %u not found in world", GUID_LOPART(gguid), GUID_LOPART(guid));
continue;
}
@@ -1447,7 +1444,7 @@ void LFGMgr::FinishDungeon(uint64 gguid, const uint32 dungeonId)
if (player->GetMapId() != mapId)
{
- TC_LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [" UI64FMTD "] is in map %u and should be in %u to get reward", guid, player->GetMapId(), mapId);
+ TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u, Player: %u is in map %u and should be in %u to get reward", GUID_LOPART(gguid), GUID_LOPART(guid), player->GetMapId(), mapId);
continue;
}
@@ -1478,7 +1475,7 @@ void LFGMgr::FinishDungeon(uint64 gguid, const uint32 dungeonId)
}
// Give rewards
- TC_LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [" UI64FMTD "] done dungeon %u, %s previously done.", player->GetGUID(), GetDungeon(gguid), done? " " : " not");
+ TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u, Player: %u done dungeon %u, %s previously done.", GUID_LOPART(gguid), GUID_LOPART(guid), GetDungeon(gguid), done? " " : " not");
LfgPlayerRewardData data = LfgPlayerRewardData(dungeon->Entry(), GetDungeon(gguid, false), done, quest);
player->GetSession()->SendLfgPlayerReward(data);
}
@@ -1542,11 +1539,16 @@ LfgState LFGMgr::GetState(uint64 guid)
{
LfgState state;
if (IS_GROUP_GUID(guid))
+ {
state = GroupsStore[guid].GetState();
+ TC_LOG_TRACE("lfg.data.group.state.get", "Group: %u, State: %u", GUID_LOPART(guid), state);
+ }
else
+ {
state = PlayersStore[guid].GetState();
+ TC_LOG_TRACE("lfg.data.player.state.get", "Player: %u, State: %u", GUID_LOPART(guid), state);
+ }
- TC_LOG_TRACE("lfg", "LFGMgr::GetState: [" UI64FMTD "] = %u", guid, state);
return state;
}
@@ -1554,18 +1556,23 @@ LfgState LFGMgr::GetOldState(uint64 guid)
{
LfgState state;
if (IS_GROUP_GUID(guid))
+ {
state = GroupsStore[guid].GetOldState();
+ TC_LOG_TRACE("lfg.data.group.oldstate.get", "Group: %u, Old state: %u", GUID_LOPART(guid), state);
+ }
else
+ {
state = PlayersStore[guid].GetOldState();
+ TC_LOG_TRACE("lfg.data.player.oldstate.get", "Player: %u, Old state: %u", GUID_LOPART(guid), state);
+ }
- TC_LOG_TRACE("lfg", "LFGMgr::GetOldState: [" UI64FMTD "] = %u", guid, state);
return state;
}
uint32 LFGMgr::GetDungeon(uint64 guid, bool asId /*= true */)
{
uint32 dungeon = GroupsStore[guid].GetDungeon(asId);
- TC_LOG_TRACE("lfg", "LFGMgr::GetDungeon: [" UI64FMTD "] asId: %u = %u", guid, asId, dungeon);
+ TC_LOG_TRACE("lfg.data.group.dungeon.get", "Group: %u, asId: %u, Dungeon: %u", GUID_LOPART(guid), asId, dungeon);
return dungeon;
}
@@ -1577,39 +1584,40 @@ uint32 LFGMgr::GetDungeonMapId(uint64 guid)
if (LFGDungeonData const* dungeon = GetLFGDungeon(dungeonId))
mapId = dungeon->map;
- TC_LOG_TRACE("lfg", "LFGMgr::GetDungeonMapId: [" UI64FMTD "] = %u (DungeonId = %u)", guid, mapId, dungeonId);
+ TC_LOG_TRACE("lfg.data.group.dungeon.map", "Group: %u, MapId: %u (DungeonId: %u)", GUID_LOPART(guid), mapId, dungeonId);
+
return mapId;
}
uint8 LFGMgr::GetRoles(uint64 guid)
{
uint8 roles = PlayersStore[guid].GetRoles();
- TC_LOG_TRACE("lfg", "LFGMgr::GetRoles: [" UI64FMTD "] = %u", guid, roles);
+ TC_LOG_TRACE("lfg.data.player.role.get", "Player: %u, Role: %u", GUID_LOPART(guid), roles);
return roles;
}
const std::string& LFGMgr::GetComment(uint64 guid)
{
- TC_LOG_TRACE("lfg", "LFGMgr::GetComment: [" UI64FMTD "] = %s", guid, PlayersStore[guid].GetComment().c_str());
+ TC_LOG_TRACE("lfg.data.player.comment.get", "Player: %u, Comment: %s", GUID_LOPART(guid), PlayersStore[guid].GetComment().c_str());
return PlayersStore[guid].GetComment();
}
LfgDungeonSet const& LFGMgr::GetSelectedDungeons(uint64 guid)
{
- TC_LOG_TRACE("lfg", "LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid);
+ TC_LOG_TRACE("lfg.data.player.dungeons.selected.get", "Player: %u, Selected Dungeons: %s", GUID_LOPART(guid), ConcatenateDungeons(PlayersStore[guid].GetSelectedDungeons()).c_str());
return PlayersStore[guid].GetSelectedDungeons();
}
LfgLockMap const& LFGMgr::GetLockedDungeons(uint64 guid)
{
- TC_LOG_TRACE("lfg", "LFGMgr::GetLockedDungeons: [" UI64FMTD "]", guid);
+ TC_LOG_TRACE("lfg.data.player.dungeons.locked.get", "Player: %u, LockedDungeons.", GUID_LOPART(guid));
return PlayersStore[guid].GetLockedDungeons();
}
uint8 LFGMgr::GetKicksLeft(uint64 guid)
{
uint8 kicks = GroupsStore[guid].GetKicksLeft();
- TC_LOG_TRACE("lfg", "LFGMgr::GetKicksLeft: [" UI64FMTD "] = %u", guid, kicks);
+ TC_LOG_TRACE("lfg.data.group.kickleft.get", "Group: %u, Kicks left: %u", GUID_LOPART(guid), kicks);
return kicks;
}
@@ -1618,26 +1626,19 @@ void LFGMgr::RestoreState(uint64 guid, char const* debugMsg)
if (IS_GROUP_GUID(guid))
{
LfgGroupData& data = GroupsStore[guid];
- if (sLog->ShouldLog("lfg", LOG_LEVEL_DEBUG))
- {
- std::string const& ps = GetStateString(data.GetState());
- std::string const& os = GetStateString(data.GetOldState());
- TC_LOG_TRACE("lfg", "LFGMgr::RestoreState: Group: [" UI64FMTD "] (%s) State: %s, oldState: %s",
- guid, debugMsg, ps.c_str(), os.c_str());
- }
+ TC_LOG_TRACE("lfg.data.group.state.restore", "Group: %u (%s), State: %s, Old state: %s",
+ GUID_LOPART(guid), debugMsg, GetStateString(data.GetState()).c_str(),
+ GetStateString(data.GetOldState()).c_str());
data.RestoreState();
}
else
{
LfgPlayerData& data = PlayersStore[guid];
- if (sLog->ShouldLog("lfg", LOG_LEVEL_DEBUG))
- {
- std::string const& ps = GetStateString(data.GetState());
- std::string const& os = GetStateString(data.GetOldState());
- TC_LOG_TRACE("lfg", "LFGMgr::RestoreState: Player: [" UI64FMTD "] (%s) State: %s, oldState: %s",
- guid, debugMsg, ps.c_str(), os.c_str());
- }
+ TC_LOG_TRACE("lfg.data.player.state.restore", "Player: %u (%s), State: %s, Old state: %s",
+ GUID_LOPART(guid), debugMsg, GetStateString(data.GetState()).c_str(),
+ GetStateString(data.GetOldState()).c_str());
+
data.RestoreState();
}
}
@@ -1647,70 +1648,62 @@ void LFGMgr::SetState(uint64 guid, LfgState state)
if (IS_GROUP_GUID(guid))
{
LfgGroupData& data = GroupsStore[guid];
- if (sLog->ShouldLog("lfg", LOG_LEVEL_TRACE))
- {
- std::string const& ns = GetStateString(state);
- std::string const& ps = GetStateString(data.GetState());
- std::string const& os = GetStateString(data.GetOldState());
- TC_LOG_TRACE("lfg", "LFGMgr::SetState: Group: [" UI64FMTD "] newState: %s, previous: %s, oldState: %s",
- guid, ns.c_str(), ps.c_str(), os.c_str());
- }
+ TC_LOG_TRACE("lfg.data.group.state.set", "Group: %u, New state: %s, Previous: %s, Old state: %s",
+ GUID_LOPART(guid), GetStateString(state).c_str(), GetStateString(data.GetState()).c_str(),
+ GetStateString(data.GetOldState()).c_str());
+
data.SetState(state);
}
else
{
LfgPlayerData& data = PlayersStore[guid];
- if (sLog->ShouldLog("lfg", LOG_LEVEL_TRACE))
- {
- std::string const& ns = GetStateString(state);
- std::string const& ps = GetStateString(data.GetState());
- std::string const& os = GetStateString(data.GetOldState());
- TC_LOG_TRACE("lfg", "LFGMgr::SetState: Player: [" UI64FMTD "] newState: %s, previous: %s, oldState: %s",
- guid, ns.c_str(), ps.c_str(), os.c_str());
- }
+ TC_LOG_TRACE("lfg.data.player.state.set", "Player: %u, New state: %s, Previous: %s, OldState: %s",
+ GUID_LOPART(guid), GetStateString(state).c_str(), GetStateString(data.GetState()).c_str(),
+ GetStateString(data.GetOldState()).c_str());
+
data.SetState(state);
}
}
void LFGMgr::SetDungeon(uint64 guid, uint32 dungeon)
{
- TC_LOG_TRACE("lfg", "LFGMgr::SetDungeon: [" UI64FMTD "] dungeon %u", guid, dungeon);
+ TC_LOG_TRACE("lfg.data.group.dungeon.set", "Group: %u, Dungeon: %u", GUID_LOPART(guid), dungeon);
GroupsStore[guid].SetDungeon(dungeon);
}
void LFGMgr::SetRoles(uint64 guid, uint8 roles)
{
- TC_LOG_TRACE("lfg", "LFGMgr::SetRoles: [" UI64FMTD "] roles: %u", guid, roles);
+ TC_LOG_TRACE("lfg.data.player.role.set", "Player: %u, Roles: %u", GUID_LOPART(guid), roles);
PlayersStore[guid].SetRoles(roles);
}
void LFGMgr::SetComment(uint64 guid, std::string const& comment)
{
- TC_LOG_TRACE("lfg", "LFGMgr::SetComment: [" UI64FMTD "] comment: %s", guid, comment.c_str());
+ TC_LOG_TRACE("lfg.data.player.comment.set", "Player: %u, Comment: %s", GUID_LOPART(guid), comment.c_str());
PlayersStore[guid].SetComment(comment);
}
void LFGMgr::SetSelectedDungeons(uint64 guid, LfgDungeonSet const& dungeons)
{
- TC_LOG_TRACE("lfg", "LFGMgr::SetSelectedDungeons: [" UI64FMTD "] Dungeons: %s", guid, ConcatenateDungeons(dungeons).c_str());
+ TC_LOG_TRACE("lfg.data.player.dungeon.selected.set", "Player: %u, Dungeons: %s", GUID_LOPART(guid), ConcatenateDungeons(dungeons).c_str());
PlayersStore[guid].SetSelectedDungeons(dungeons);
}
void LFGMgr::SetLockedDungeons(uint64 guid, LfgLockMap const& lock)
{
- TC_LOG_TRACE("lfg", "LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid);
+ TC_LOG_TRACE("lfg.data.player.dungeon.locked.set", "Player: %u, LockedDungeons", GUID_LOPART(guid));
PlayersStore[guid].SetLockedDungeons(lock);
}
void LFGMgr::DecreaseKicksLeft(uint64 guid)
{
- TC_LOG_TRACE("lfg", "LFGMgr::DecreaseKicksLeft: [" UI64FMTD "]", guid);
GroupsStore[guid].DecreaseKicksLeft();
+ TC_LOG_TRACE("lfg.data.group.kicksleft.decrease", "Group: %u, Kicks: %u", GUID_LOPART(guid), GroupsStore[guid].GetKicksLeft());
}
void LFGMgr::RemovePlayerData(uint64 guid)
{
- TC_LOG_TRACE("lfg", "LFGMgr::RemovePlayerData: [" UI64FMTD "]", guid);
+ TC_LOG_TRACE("lfg.data.player.remove", "Player: %u", GUID_LOPART(guid));
LfgPlayerDataContainer::iterator it = PlayersStore.find(guid);
if (it != PlayersStore.end())
PlayersStore.erase(it);
@@ -1718,7 +1711,7 @@ void LFGMgr::RemovePlayerData(uint64 guid)
void LFGMgr::RemoveGroupData(uint64 guid)
{
- TC_LOG_TRACE("lfg", "LFGMgr::RemoveGroupData: [" UI64FMTD "]", guid);
+ TC_LOG_TRACE("lfg.data.group.remove", "Group: %u", GUID_LOPART(guid));
LfgGroupDataContainer::iterator it = GroupsStore.find(guid);
if (it == GroupsStore.end())
return;
@@ -1741,7 +1734,9 @@ void LFGMgr::RemoveGroupData(uint64 guid)
uint8 LFGMgr::GetTeam(uint64 guid)
{
- return PlayersStore[guid].GetTeam();
+ uint8 team = PlayersStore[guid].GetTeam();
+ TC_LOG_TRACE("lfg.data.player.team.get", "Player: %u, Team: %u", GUID_LOPART(guid), team);
+ return team;
}
uint8 LFGMgr::RemovePlayerFromGroup(uint64 gguid, uint64 guid)
diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h
index 83b4142ae36..8e33ba0a2f6 100644
--- a/src/server/game/DungeonFinding/LFGMgr.h
+++ b/src/server/game/DungeonFinding/LFGMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/DungeonFinding/LFGPlayerData.cpp b/src/server/game/DungeonFinding/LFGPlayerData.cpp
index 305263cb73d..0553d4ac4fe 100644
--- a/src/server/game/DungeonFinding/LFGPlayerData.cpp
+++ b/src/server/game/DungeonFinding/LFGPlayerData.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/DungeonFinding/LFGPlayerData.h b/src/server/game/DungeonFinding/LFGPlayerData.h
index a425ce77bad..e20e914a9c9 100644
--- a/src/server/game/DungeonFinding/LFGPlayerData.h
+++ b/src/server/game/DungeonFinding/LFGPlayerData.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/DungeonFinding/LFGQueue.cpp b/src/server/game/DungeonFinding/LFGQueue.cpp
index 2946a5a9c5a..67a9f0afc69 100644
--- a/src/server/game/DungeonFinding/LFGQueue.cpp
+++ b/src/server/game/DungeonFinding/LFGQueue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -88,7 +88,7 @@ void LFGQueue::AddToQueue(uint64 guid)
LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(guid);
if (itQueue == QueueDataStore.end())
{
- TC_LOG_ERROR("lfg", "LFGQueue::AddToQueue: Queue data not found for [" UI64FMTD "]", guid);
+ TC_LOG_ERROR("lfg.queue.add", "Queue data not found for [" UI64FMTD "]", guid);
return;
}
@@ -194,7 +194,7 @@ void LFGQueue::RemoveFromCompatibles(uint64 guid)
out << guid;
std::string strGuid = out.str();
- TC_LOG_DEBUG("lfg", "LFGQueue::RemoveFromCompatibles: Removing [" UI64FMTD "]", guid);
+ TC_LOG_DEBUG("lfg.queue.data.compatibles.remove", "Removing [" UI64FMTD "]", guid);
for (LfgCompatibleContainer::iterator itNext = CompatibleMapStore.begin(); itNext != CompatibleMapStore.end();)
{
LfgCompatibleContainer::iterator it = itNext++;
@@ -251,7 +251,7 @@ uint8 LFGQueue::FindGroups()
while (!newToQueueStore.empty())
{
uint64 frontguid = newToQueueStore.front();
- TC_LOG_DEBUG("lfg", "LFGQueue::FindGroups: checking [" UI64FMTD "] newToQueue(%u), currentQueue(%u)", frontguid, uint32(newToQueueStore.size()), uint32(currentQueueStore.size()));
+ TC_LOG_DEBUG("lfg.queue.match.check.new", "Checking [" UI64FMTD "] newToQueue(%u), currentQueue(%u)", frontguid, uint32(newToQueueStore.size()), uint32(currentQueueStore.size()));
firstNew.clear();
firstNew.push_back(frontguid);
RemoveFromNewQueue(frontguid);
@@ -279,13 +279,13 @@ LfgCompatibility LFGQueue::FindNewGroups(LfgGuidList& check, LfgGuidList& all)
std::string strGuids = ConcatenateGuids(check);
LfgCompatibility compatibles = GetCompatibles(strGuids);
- TC_LOG_DEBUG("lfg", "LFGQueue::FindNewGroup: (%s): %s - all(%s)", strGuids.c_str(), GetCompatibleString(compatibles), ConcatenateGuids(all).c_str());
+ TC_LOG_DEBUG("lfg.queue.match.check", "Guids: (%s): %s - all(%s)", strGuids.c_str(), GetCompatibleString(compatibles), ConcatenateGuids(all).c_str());
if (compatibles == LFG_COMPATIBILITY_PENDING) // Not previously cached, calculate
compatibles = CheckCompatibility(check);
if (compatibles == LFG_COMPATIBLES_BAD_STATES && sLFGMgr->AllQueued(check))
{
- TC_LOG_DEBUG("lfg", "LFGQueue::FindNewGroup: (%s) compatibles (cached) changed from bad states to match", strGuids.c_str());
+ TC_LOG_DEBUG("lfg.queue.match.check", "Guids: (%s) compatibles (cached) changed from bad states to match", strGuids.c_str());
SetCompatibles(strGuids, LFG_COMPATIBLES_MATCH);
return LFG_COMPATIBLES_MATCH;
}
@@ -323,7 +323,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
// Check for correct size
if (check.size() > MAXGROUPSIZE || check.empty())
{
- TC_LOG_DEBUG("lfg", "LFGQueue::CheckCompatibility: (%s): Size wrong - Not compatibles", strGuids.c_str());
+ TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s): Size wrong - Not compatibles", strGuids.c_str());
return LFG_INCOMPATIBLES_WRONG_GROUP_SIZE;
}
@@ -337,7 +337,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
LfgCompatibility child_compatibles = CheckCompatibility(check);
if (child_compatibles < LFG_COMPATIBLES_WITH_LESS_PLAYERS) // Group not compatible
{
- TC_LOG_DEBUG("lfg", "LFGQueue::CheckCompatibility: (%s) child %s not compatibles", strGuids.c_str(), ConcatenateGuids(check).c_str());
+ TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s) child %s not compatibles", strGuids.c_str(), ConcatenateGuids(check).c_str());
SetCompatibles(strGuids, child_compatibles);
return child_compatibles;
}
@@ -353,7 +353,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(guid);
if (itQueue == QueueDataStore.end())
{
- TC_LOG_ERROR("lfg", "LFGQueue::CheckCompatibility: [" UI64FMTD "] is not queued but listed as queued!", guid);
+ TC_LOG_ERROR("lfg.queue.match.compatibility.check", "Guid: [" UI64FMTD "] is not queued but listed as queued!", guid);
RemoveFromQueue(guid);
return LFG_COMPATIBILITY_PENDING;
}
@@ -375,7 +375,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
// Group with less that MAXGROUPSIZE members always compatible
if (check.size() == 1 && numPlayers != MAXGROUPSIZE)
{
- TC_LOG_DEBUG("lfg", "LFGQueue::CheckCompatibility: (%s) sigle group. Compatibles", strGuids.c_str());
+ TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s) sigle group. Compatibles", strGuids.c_str());
LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(check.front());
LfgCompatibilityData data(LFG_COMPATIBLES_WITH_LESS_PLAYERS);
@@ -389,14 +389,14 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
if (numLfgGroups > 1)
{
- TC_LOG_DEBUG("lfg", "LFGQueue::CheckCompatibility: (%s) More than one Lfggroup (%u)", strGuids.c_str(), numLfgGroups);
+ TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s) More than one Lfggroup (%u)", strGuids.c_str(), numLfgGroups);
SetCompatibles(strGuids, LFG_INCOMPATIBLES_MULTIPLE_LFG_GROUPS);
return LFG_INCOMPATIBLES_MULTIPLE_LFG_GROUPS;
}
if (numPlayers > MAXGROUPSIZE)
{
- TC_LOG_DEBUG("lfg", "LFGQueue::CheckCompatibility: (%s) Too much players (%u)", strGuids.c_str(), numPlayers);
+ TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s) Too much players (%u)", strGuids.c_str(), numPlayers);
SetCompatibles(strGuids, LFG_INCOMPATIBLES_TOO_MUCH_PLAYERS);
return LFG_INCOMPATIBLES_TOO_MUCH_PLAYERS;
}
@@ -413,7 +413,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
for (itPlayer = proposalRoles.begin(); itPlayer != proposalRoles.end(); ++itPlayer)
{
if (itRoles->first == itPlayer->first)
- TC_LOG_ERROR("lfg", "LFGQueue::CheckCompatibility: ERROR! Player multiple times in queue! [" UI64FMTD "]", itRoles->first);
+ TC_LOG_ERROR("lfg.queue.match.compatibility.check", "Guids: ERROR! Player multiple times in queue! [" UI64FMTD "]", itRoles->first);
else if (sLFGMgr->HasIgnore(itRoles->first, itPlayer->first))
break;
}
@@ -424,7 +424,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
if (uint8 playersize = numPlayers - proposalRoles.size())
{
- TC_LOG_DEBUG("lfg", "LFGQueue::CheckCompatibility: (%s) not compatible, %u players are ignoring each other", strGuids.c_str(), playersize);
+ TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s) not compatible, %u players are ignoring each other", strGuids.c_str(), playersize);
SetCompatibles(strGuids, LFG_INCOMPATIBLES_HAS_IGNORES);
return LFG_INCOMPATIBLES_HAS_IGNORES;
}
@@ -436,7 +436,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
for (LfgRolesMap::const_iterator it = debugRoles.begin(); it != debugRoles.end(); ++it)
o << ", " << it->first << ": " << GetRolesString(it->second);
- TC_LOG_DEBUG("lfg", "LFGQueue::CheckCompatibility: (%s) Roles not compatible%s", strGuids.c_str(), o.str().c_str());
+ TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s) Roles not compatible%s", strGuids.c_str(), o.str().c_str());
SetCompatibles(strGuids, LFG_INCOMPATIBLES_NO_ROLES);
return LFG_INCOMPATIBLES_NO_ROLES;
}
@@ -456,7 +456,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
if (proposalDungeons.empty())
{
- TC_LOG_DEBUG("lfg", "LFGQueue::CheckCompatibility: (%s) No compatible dungeons%s", strGuids.c_str(), o.str().c_str());
+ TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s) No compatible dungeons%s", strGuids.c_str(), o.str().c_str());
SetCompatibles(strGuids, LFG_INCOMPATIBLES_NO_DUNGEONS);
return LFG_INCOMPATIBLES_NO_DUNGEONS;
}
@@ -473,7 +473,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
// Enough players?
if (numPlayers != MAXGROUPSIZE)
{
- TC_LOG_DEBUG("lfg", "LFGQueue::CheckCompatibility: (%s) Compatibles but not enough players(%u)", strGuids.c_str(), numPlayers);
+ TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s) Compatibles but not enough players(%u)", strGuids.c_str(), numPlayers);
LfgCompatibilityData data(LFG_COMPATIBLES_WITH_LESS_PLAYERS);
data.roles = proposalRoles;
@@ -490,7 +490,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
if (!sLFGMgr->AllQueued(check))
{
- TC_LOG_DEBUG("lfg", "LFGQueue::CheckCompatibility: (%s) Group MATCH but can't create proposal!", strGuids.c_str());
+ TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s) Group MATCH but can't create proposal!", strGuids.c_str());
SetCompatibles(strGuids, LFG_COMPATIBLES_BAD_STATES);
return LFG_COMPATIBLES_BAD_STATES;
}
@@ -532,14 +532,14 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
sLFGMgr->AddProposal(proposal);
- TC_LOG_DEBUG("lfg", "LFGQueue::CheckCompatibility: (%s) MATCH! Group formed", strGuids.c_str());
+ TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s) MATCH! Group formed", strGuids.c_str());
SetCompatibles(strGuids, LFG_COMPATIBLES_MATCH);
return LFG_COMPATIBLES_MATCH;
}
void LFGQueue::UpdateQueueTimers(time_t currTime)
{
- TC_LOG_TRACE("lfg", "Updating queue timers...");
+ TC_LOG_TRACE("lfg.queue.timers.update", "Updating queue timers...");
for (LfgQueueDataContainer::iterator itQueue = QueueDataStore.begin(); itQueue != QueueDataStore.end(); ++itQueue)
{
LfgQueueData& queueinfo = itQueue->second;
@@ -631,7 +631,7 @@ std::string LFGQueue::DumpCompatibleInfo(bool full /* = false */) const
void LFGQueue::FindBestCompatibleInQueue(LfgQueueDataContainer::iterator itrQueue)
{
- TC_LOG_DEBUG("lfg", "LFGQueue::FindBestCompatibleInQueue: " UI64FMTD, itrQueue->first);
+ TC_LOG_DEBUG("lfg.queue.compatibles.find", "Guid: " UI64FMTD, itrQueue->first);
std::ostringstream o;
o << itrQueue->first;
std::string sguid = o.str();
@@ -656,7 +656,7 @@ void LFGQueue::UpdateBestCompatibleInQueue(LfgQueueDataContainer::iterator itrQu
if (size <= storedSize)
return;
- TC_LOG_DEBUG("lfg", "LFGQueue::UpdateBestCompatibleInQueue: Changed (%s) to (%s) as best compatible group for " UI64FMTD,
+ TC_LOG_DEBUG("lfg.queue.compatibles.update", "Changed (%s) to (%s) as best compatible group for " UI64FMTD,
queueData.bestCompatible.c_str(), key.c_str(), itrQueue->first);
queueData.bestCompatible = key;
diff --git a/src/server/game/DungeonFinding/LFGQueue.h b/src/server/game/DungeonFinding/LFGQueue.h
index 128b2aa2f0b..b66121802c6 100644
--- a/src/server/game/DungeonFinding/LFGQueue.h
+++ b/src/server/game/DungeonFinding/LFGQueue.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp
index 5f4e5c664a0..1f182ce0761 100644
--- a/src/server/game/DungeonFinding/LFGScripts.cpp
+++ b/src/server/game/DungeonFinding/LFGScripts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/DungeonFinding/LFGScripts.h b/src/server/game/DungeonFinding/LFGScripts.h
index bb1900cad93..c4e1cf0a203 100644
--- a/src/server/game/DungeonFinding/LFGScripts.h
+++ b/src/server/game/DungeonFinding/LFGScripts.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp
index 9d3ee045c61..e41426edb3d 100644
--- a/src/server/game/Entities/Corpse/Corpse.cpp
+++ b/src/server/game/Entities/Corpse/Corpse.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Corpse/Corpse.h b/src/server/game/Entities/Corpse/Corpse.h
index 30b15108cf2..def84dd93a9 100644
--- a/src/server/game/Entities/Corpse/Corpse.h
+++ b/src/server/game/Entities/Corpse/Corpse.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -77,12 +77,6 @@ class Corpse : public WorldObject, public GridObject<Corpse>
Player* lootRecipient;
bool lootForBody;
- void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId, language, TargetGuid); }
- void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId, language, TargetGuid); }
- void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId, TargetGuid); }
- void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId, receiver); }
- void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId, language, TargetGuid); }
-
bool IsExpired(time_t t) const;
private:
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 7974e07fe33..e4bdc2d58fe 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -147,7 +147,7 @@ m_PlayerDamageReq(0), m_lootRecipient(0), m_lootRecipientGroup(0), m_corpseRemov
m_respawnDelay(300), m_corpseDelay(60), m_respawnradius(0.0f), m_reactState(REACT_AGGRESSIVE),
m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_originalEquipmentId(0), m_AlreadyCallAssistance(false),
m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),
-m_creatureInfo(NULL), m_creatureData(NULL), m_path_id(0), m_formation(NULL)
+m_originalEntry(0), m_homePosition(), m_transportHomePosition(), m_creatureInfo(NULL), m_creatureData(NULL), m_waypointID(0), m_path_id(0), m_formation(NULL)
{
m_regenTimer = CREATURE_REGEN_INTERVAL;
m_valuesCount = UNIT_END;
@@ -182,8 +182,8 @@ void Creature::AddToWorld()
///- Register the creature for guid lookup
if (!IsInWorld())
{
- if (m_zoneScript)
- m_zoneScript->OnCreatureCreate(this);
+ if (GetZoneScript())
+ GetZoneScript()->OnCreatureCreate(this);
sObjectAccessor->AddObject(this);
Unit::AddToWorld();
SearchFormation();
@@ -197,8 +197,8 @@ void Creature::RemoveFromWorld()
{
if (IsInWorld())
{
- if (m_zoneScript)
- m_zoneScript->OnCreatureRemove(this);
+ if (GetZoneScript())
+ GetZoneScript()->OnCreatureRemove(this);
if (m_formation)
sFormationMgr->RemoveCreatureFromGroup(m_formation, this);
Unit::RemoveFromWorld();
@@ -312,7 +312,7 @@ bool Creature::InitEntry(uint32 entry, uint32 /*team*/, const CreatureData* data
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
if (!minfo) // Cancel load if no model defined
{
- TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", entry);
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has invalid model %u defined in table `creature_template`, can't load.", entry, displayID);
return false;
}
@@ -367,7 +367,6 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data)
if (!GetCreatureAddon())
SetSheath(SHEATH_STATE_MELEE);
- SelectLevel(GetCreatureTemplate());
if (team == HORDE)
setFaction(cInfo->faction_H);
else
@@ -381,10 +380,6 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data)
else
SetUInt32Value(UNIT_NPC_FLAGS, npcflag);
- SetAttackTime(BASE_ATTACK, cInfo->baseattacktime);
- SetAttackTime(OFF_ATTACK, cInfo->baseattacktime);
- SetAttackTime(RANGED_ATTACK, cInfo->rangeattacktime);
-
SetUInt32Value(UNIT_FIELD_FLAGS, unit_flags);
SetUInt32Value(UNIT_FIELD_FLAGS_2, cInfo->unit_flags2);
@@ -392,6 +387,12 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data)
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ SetAttackTime(BASE_ATTACK, cInfo->baseattacktime);
+ SetAttackTime(OFF_ATTACK, cInfo->baseattacktime);
+ SetAttackTime(RANGED_ATTACK, cInfo->rangeattacktime);
+
+ SelectLevel();
+
SetMeleeDamageSchool(SpellSchools(cInfo->dmgschool));
CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(getLevel(), cInfo->unit_class);
float armor = (float)stats->GenerateArmor(cInfo); /// @todo Why is this treated as uint32 when it's a float?
@@ -726,16 +727,16 @@ bool Creature::AIM_Initialize(CreatureAI* ai)
void Creature::Motion_Initialize()
{
if (!m_formation)
- i_motionMaster.Initialize();
+ GetMotionMaster()->Initialize();
else if (m_formation->getLeader() == this)
{
m_formation->FormationReset(false);
- i_motionMaster.Initialize();
+ GetMotionMaster()->Initialize();
}
else if (m_formation->isFormed())
- i_motionMaster.MoveIdle(); //wait the order of leader
+ GetMotionMaster()->MoveIdle(); //wait the order of leader
else
- i_motionMaster.Initialize();
+ GetMotionMaster()->Initialize();
}
bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 vehId, uint32 team, float x, float y, float z, float ang, const CreatureData* data)
@@ -1038,22 +1039,24 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
WorldDatabase.CommitTransaction(trans);
}
-void Creature::SelectLevel(const CreatureTemplate* cinfo)
+void Creature::SelectLevel()
{
- uint32 rank = IsPet()? 0 : cinfo->rank;
+ CreatureTemplate const* cInfo = GetCreatureTemplate();
+
+ uint32 rank = IsPet() ? 0 : cInfo->rank;
// level
- uint8 minlevel = std::min(cinfo->maxlevel, cinfo->minlevel);
- uint8 maxlevel = std::max(cinfo->maxlevel, cinfo->minlevel);
+ uint8 minlevel = std::min(cInfo->maxlevel, cInfo->minlevel);
+ uint8 maxlevel = std::max(cInfo->maxlevel, cInfo->minlevel);
uint8 level = minlevel == maxlevel ? minlevel : urand(minlevel, maxlevel);
SetLevel(level);
- CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(level, cinfo->unit_class);
+ CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(level, cInfo->unit_class);
// health
float healthmod = _GetHealthMod(rank);
- uint32 basehp = stats->GenerateHealth(cinfo);
+ uint32 basehp = stats->GenerateHealth(cInfo);
uint32 health = uint32(basehp * healthmod);
SetCreateHealth(health);
@@ -1062,10 +1065,10 @@ void Creature::SelectLevel(const CreatureTemplate* cinfo)
ResetPlayerDamageReq();
// mana
- uint32 mana = stats->GenerateMana(cinfo);
+ uint32 mana = stats->GenerateMana(cInfo);
SetCreateMana(mana);
- SetMaxPower(POWER_MANA, mana); //MAX Mana
+ SetMaxPower(POWER_MANA, mana); // MAX Mana
SetPower(POWER_MANA, mana);
/// @todo set UNIT_FIELD_POWER*, for some creature class case (energy, etc)
@@ -1073,17 +1076,24 @@ void Creature::SelectLevel(const CreatureTemplate* cinfo)
SetModifierValue(UNIT_MOD_HEALTH, BASE_VALUE, (float)health);
SetModifierValue(UNIT_MOD_MANA, BASE_VALUE, (float)mana);
- //damage
- float damagemod = 1.0f;//_GetDamageMod(rank);
+ // damage
+
+ float basedamage = stats->GenerateBaseDamage(cInfo);
- SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg * damagemod);
- SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg * damagemod);
+ float weaponBaseMinDamage = basedamage;
+ float weaponBaseMaxDamage = basedamage * 1.5;
- SetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, cinfo->minrangedmg * damagemod);
- SetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, cinfo->maxrangedmg * damagemod);
+ SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, weaponBaseMinDamage);
+ SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, weaponBaseMaxDamage);
- SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, cinfo->attackpower * damagemod);
+ SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, weaponBaseMinDamage);
+ SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, weaponBaseMaxDamage);
+ SetBaseWeaponDamage(RANGED_ATTACK, MINDAMAGE, weaponBaseMinDamage);
+ SetBaseWeaponDamage(RANGED_ATTACK, MAXDAMAGE, weaponBaseMaxDamage);
+
+ SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, stats->AttackPower);
+ SetModifierValue(UNIT_MOD_ATTACK_POWER_RANGED, BASE_VALUE, stats->RangedAttackPower);
}
float Creature::_GetHealthMod(int32 Rank)
@@ -1152,9 +1162,9 @@ float Creature::GetSpellDamageMod(int32 Rank) const
bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint32 team, const CreatureData* data)
{
SetZoneScript();
- if (m_zoneScript && data)
+ if (GetZoneScript() && data)
{
- Entry = m_zoneScript->GetCreatureEntry(guidlow, data);
+ Entry = GetZoneScript()->GetCreatureEntry(guidlow, data);
if (!Entry)
return false;
}
@@ -1256,6 +1266,12 @@ bool Creature::LoadCreatureFromDB(uint32 guid, Map* map, bool addToMap)
return true;
}
+void Creature::SetCanDualWield(bool value)
+{
+ Unit::SetCanDualWield(value);
+ UpdateDamagePhysical(OFF_ATTACK);
+}
+
void Creature::LoadEquipment(int8 id, bool force /*= true*/)
{
if (id == 0)
@@ -1337,7 +1353,7 @@ bool Creature::IsInvisibleDueToDespawn() const
if (Unit::IsInvisibleDueToDespawn())
return true;
- if (IsAlive() || m_corpseRemoveTime > time(NULL))
+ if (IsAlive() || isDying() || m_corpseRemoveTime > time(NULL))
return false;
return true;
@@ -1461,7 +1477,7 @@ void Creature::setDeathState(DeathState s)
m_formation->FormationReset(true);
if ((CanFly() || IsFlying()))
- i_motionMaster.MoveFall();
+ GetMotionMaster()->MoveFall();
Unit::setDeathState(CORPSE);
}
@@ -1477,7 +1493,7 @@ void Creature::setDeathState(DeathState s)
CreatureTemplate const* cinfo = GetCreatureTemplate();
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
- ClearUnitState(uint32(UNIT_STATE_ALL_STATE));
+ ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~UNIT_STATE_IGNORE_PATHFINDING));
SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));
LoadCreaturesAddon(true);
Motion_Initialize();
@@ -1515,8 +1531,7 @@ void Creature::Respawn(bool force)
if (m_originalEntry != GetEntry())
UpdateEntry(m_originalEntry);
- CreatureTemplate const* cinfo = GetCreatureTemplate();
- SelectLevel(cinfo);
+ SelectLevel();
setDeathState(JUST_RESPAWNED);
@@ -1533,7 +1548,11 @@ void Creature::Respawn(bool force)
//Call AI respawn virtual function
if (IsAIEnabled)
+ {
+ //reset the AI to be sure no dirty or uninitialized values will be used till next tick
+ AI()->Reset();
TriggerJustRespawned = true;//delay event to next tick so all creatures are created on the map before processing
+ }
uint32 poolid = GetDBTableGUIDLow() ? sPoolMgr->IsPartOfAPool<Creature>(GetDBTableGUIDLow()) : 0;
if (poolid)
@@ -1959,7 +1978,7 @@ bool Creature::CanCreatureAttack(Unit const* victim, bool /*force*/) const
if (IsAIEnabled && !AI()->CanAIAttack(victim))
return false;
- if (sMapStore.LookupEntry(GetMapId())->IsDungeon())
+ if (GetMap()->IsDungeon())
return true;
//Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick.
@@ -2421,7 +2440,7 @@ void Creature::SetPosition(float x, float y, float z, float o)
return;
}
- GetMap()->CreatureRelocation(ToCreature(), x, y, z, o);
+ GetMap()->CreatureRelocation(this, x, y, z, o);
if (IsVehicle())
GetVehicleKit()->RelocatePassengers();
}
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index cab00be9446..737e3072091 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -173,10 +173,6 @@ struct CreatureTemplate
// Benchmarked: Faster than std::map (insert/find)
typedef UNORDERED_MAP<uint32, CreatureTemplate> CreatureTemplateContainer;
-// Represents max amount of expansions.
-/// @todo: Add MAX_EXPANSION constant.
-#define MAX_CREATURE_BASE_HP 3
-
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform
#if defined(__GNUC__)
#pragma pack(1)
@@ -184,12 +180,15 @@ typedef UNORDERED_MAP<uint32, CreatureTemplate> CreatureTemplateContainer;
#pragma pack(push, 1)
#endif
-// Defines base stats for creatures (used to calculate HP/mana/armor).
+// Defines base stats for creatures (used to calculate HP/mana/armor/attackpower/rangedattackpower/all damage).
struct CreatureBaseStats
{
- uint32 BaseHealth[MAX_CREATURE_BASE_HP];
+ uint32 BaseHealth[MAX_EXPANSIONS];
uint32 BaseMana;
uint32 BaseArmor;
+ uint32 AttackPower;
+ uint32 RangedAttackPower;
+ float BaseDamage[MAX_EXPANSIONS];
// Helpers
@@ -212,6 +211,11 @@ struct CreatureBaseStats
return uint32(ceil(BaseArmor * info->ModArmor));
}
+ float GenerateBaseDamage(CreatureTemplate const* info) const
+ {
+ return BaseDamage[info->expansion];
+ }
+
static CreatureBaseStats const* GetBaseStats(uint8 level, uint8 unitClass);
};
@@ -246,7 +250,10 @@ typedef UNORDERED_MAP<uint32, EquipmentInfoContainerInternal> EquipmentInfoConta
// from `creature` table
struct CreatureData
{
- CreatureData() : dbData(true) { }
+ CreatureData() : id(0), mapid(0), phaseMask(0), displayid(0), equipmentId(0),
+ posX(0.0f), posY(0.0f), posZ(0.0f), orientation(0.0f), spawntimesecs(0),
+ spawndist(0.0f), currentwaypoint(0), curhealth(0), curmana(0), movementType(0),
+ spawnMask(0), npcflag(0), unit_flags(0), dynamicflags(0), dbData(true) { }
uint32 id; // entry in creature_template
uint16 mapid;
uint32 phaseMask;
@@ -432,7 +439,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
bool Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 vehId, uint32 team, float x, float y, float z, float ang, const CreatureData* data = NULL);
bool LoadCreaturesAddon(bool reload = false);
- void SelectLevel(const CreatureTemplate* cinfo);
+ void SelectLevel();
void LoadEquipment(int8 id = 1, bool force = false);
uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; }
@@ -509,8 +516,9 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
void UpdateMaxHealth();
void UpdateMaxPower(Powers power);
void UpdateAttackPowerAndDamage(bool ranged = false);
- void UpdateDamagePhysical(WeaponAttackType attType);
+ void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage) OVERRIDE;
+ void SetCanDualWield(bool value) OVERRIDE;
int8 GetOriginalEquipmentId() const { return m_originalEquipmentId; }
uint8 GetCurrentEquipmentId() { return m_equipmentId; }
void SetCurrentEquipmentId(uint8 id) { m_equipmentId = id; }
@@ -531,12 +539,6 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
std::string GetScriptName() const;
uint32 GetScriptId() const;
- void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId, language, TargetGuid); }
- void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId, language, TargetGuid); }
- void TextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false) { MonsterTextEmote(textId, TargetGuid, IsBossEmote); }
- void Whisper(int32 textId, uint64 receiver, bool IsBossWhisper = false) { MonsterWhisper(textId, receiver, IsBossWhisper); }
- void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId, language, TargetGuid); }
-
// override WorldObject function for proper name localization
std::string const& GetNameForLocaleIdx(LocaleConstant locale_idx) const;
diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp
index fc56fc011d4..14a76ae07ce 100644
--- a/src/server/game/Entities/Creature/CreatureGroups.cpp
+++ b/src/server/game/Entities/Creature/CreatureGroups.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Creature/CreatureGroups.h b/src/server/game/Entities/Creature/CreatureGroups.h
index ea115bd2efd..846b05abc17 100644
--- a/src/server/game/Entities/Creature/CreatureGroups.h
+++ b/src/server/game/Entities/Creature/CreatureGroups.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp
index 84cd2d41c1f..ffb28849925 100644
--- a/src/server/game/Entities/Creature/GossipDef.cpp
+++ b/src/server/game/Entities/Creature/GossipDef.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
GossipMenu::GossipMenu()
{
_menuId = 0;
+ _locale = DEFAULT_LOCALE;
}
GossipMenu::~GossipMenu()
@@ -296,7 +297,7 @@ void QuestMenu::ClearMenu()
_questMenuItems.clear();
}
-void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title, uint64 npcGUID)
+void PlayerMenu::SendQuestGiverQuestList(QEmote const& eEmote, const std::string& Title, uint64 npcGUID)
{
WorldPacket data(SMSG_QUESTGIVER_QUEST_LIST, 100); // guess size
data << uint64(npcGUID);
@@ -435,8 +436,8 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID,
// rewarded honor points. Multiply with 10 to satisfy client
data << uint32(10 * quest->CalculateHonorGain(_session->GetPlayer()->GetQuestLevel(quest)));
data << float(0.0f); // unk, honor multiplier?
- data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0)
- data << int32(quest->GetRewSpellCast()); // casted spell
+ data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (cast if RewSpellCast == 0)
+ data << int32(quest->GetRewSpellCast()); // cast spell
data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
data << uint32(quest->GetBonusTalents()); // bonus talents
data << uint32(quest->GetRewArenaPoints()); // reward arena points
@@ -516,8 +517,8 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
data << uint32(quest->GetRewOrReqMoney()); // reward money (below max lvl)
data << uint32(quest->GetRewMoneyMaxLevel()); // used in XP calculation at client
- data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0)
- data << int32(quest->GetRewSpellCast()); // casted spell
+ data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (cast if RewSpellCast == 0)
+ data << int32(quest->GetRewSpellCast()); // cast spell
// rewarded honor points
data << uint32(quest->GetRewHonorAddition());
@@ -673,8 +674,8 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b
data << uint32(10 * quest->CalculateHonorGain(_session->GetPlayer()->GetQuestLevel(quest)));
data << float(0.0f); // unk, honor multiplier?
data << uint32(0x08); // unused by client?
- data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0)
- data << int32(quest->GetRewSpellCast()); // casted spell
+ data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (cast if RewSpellCast == 0)
+ data << int32(quest->GetRewSpellCast()); // cast spell
data << uint32(0); // unknown
data << uint32(quest->GetBonusTalents()); // bonus talents
data << uint32(quest->GetRewArenaPoints()); // arena points
diff --git a/src/server/game/Entities/Creature/GossipDef.h b/src/server/game/Entities/Creature/GossipDef.h
index b43ab8ec332..9a30fdeee2b 100644
--- a/src/server/game/Entities/Creature/GossipDef.h
+++ b/src/server/game/Entities/Creature/GossipDef.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -273,7 +273,7 @@ class PlayerMenu
/*********************************************************/
void SendQuestGiverStatus(uint8 questStatus, uint64 npcGUID) const;
- void SendQuestGiverQuestList(QEmote eEmote, const std::string& Title, uint64 npcGUID);
+ void SendQuestGiverQuestList(QEmote const& eEmote, const std::string& Title, uint64 npcGUID);
void SendQuestQueryResponse(Quest const* quest) const;
void SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, bool activateAccept) const;
diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp
index 9fee6b8237d..d31117c8381 100644
--- a/src/server/game/Entities/Creature/TemporarySummon.cpp
+++ b/src/server/game/Entities/Creature/TemporarySummon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h
index 03fcd4cd74d..e93f66ed726 100644
--- a/src/server/game/Entities/Creature/TemporarySummon.h
+++ b/src/server/game/Entities/Creature/TemporarySummon.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -95,7 +95,7 @@ class Guardian : public Minion
void UpdateMaxHealth();
void UpdateMaxPower(Powers power);
void UpdateAttackPowerAndDamage(bool ranged = false);
- void UpdateDamagePhysical(WeaponAttackType attType);
+ void UpdateDamagePhysical(WeaponAttackType attType) OVERRIDE;
int32 GetBonusDamage() const { return m_bonusSpellDamage; }
void SetBonusDamage(int32 damage);
diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp
index ec90ad7cb48..f4e956e8839 100644
--- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp
+++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.h b/src/server/game/Entities/DynamicObject/DynamicObject.h
index 0522bc67aff..5b68bf377b9 100644
--- a/src/server/game/Entities/DynamicObject/DynamicObject.h
+++ b/src/server/game/Entities/DynamicObject/DynamicObject.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -58,12 +58,6 @@ class DynamicObject : public WorldObject, public GridObject<DynamicObject>
uint64 GetCasterGUID() const { return GetUInt64Value(DYNAMICOBJECT_CASTER); }
float GetRadius() const { return GetFloatValue(DYNAMICOBJECT_RADIUS); }
- void Say(int32 textId, uint32 language, uint64 targetGuid) { MonsterSay(textId, language, targetGuid); }
- void Yell(int32 textId, uint32 language, uint64 targetGuid) { MonsterYell(textId, language, targetGuid); }
- void TextEmote(int32 textId, uint64 targetGuid) { MonsterTextEmote(textId, targetGuid); }
- void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId, receiver); }
- void YellToZone(int32 textId, uint32 language, uint64 targetGuid) { MonsterYellToZone(textId, language, targetGuid); }
-
protected:
Aura* _aura;
Aura* _removedAura;
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 3c44c8e6035..21d5ba0d21a 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -651,7 +651,7 @@ void GameObject::Update(uint32 diff)
void GameObject::Refresh()
{
- // not refresh despawned not casted GO (despawned casted GO destroyed in all cases anyway)
+ // Do not refresh despawned GO from spellcast (GO's from spellcast are destroyed after despawn)
if (m_respawnTime > 0 && m_spawnedByDefault)
return;
@@ -1485,7 +1485,7 @@ void GameObject::Use(Unit* user)
if (spellId == 62330) // GO store nonexistent spell, replace by expected
{
// spell have reagent and mana cost but it not expected use its
- // it triggered spell in fact casted at currently channeled GO
+ // it triggered spell in fact cast at currently channeled GO
spellId = 61993;
triggered = true;
}
diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h
index 27ea15c38ff..0ef03723cb4 100644
--- a/src/server/game/Entities/GameObject/GameObject.h
+++ b/src/server/game/Entities/GameObject/GameObject.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -589,7 +589,9 @@ enum GOState
// from `gameobject`
struct GameObjectData
{
- explicit GameObjectData() : dbData(true) { }
+ explicit GameObjectData() : id(0), mapid(0), phaseMask(0), posX(0.0f), posY(0.0f), posZ(0.0f), orientation(0.0f),
+ rotation0(0.0f), rotation1(0.0f), rotation2(0.0f), rotation3(0.0f), spawntimesecs(0),
+ animprogress(0), go_state(GO_STATE_ACTIVE), spawnMask(0), artKit(0), dbData(true) { }
uint32 id; // entry in gamobject_template
uint16 mapid;
uint32 phaseMask;
@@ -654,12 +656,6 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map
void UpdateRotationFields(float rotation2 = 0.0f, float rotation3 = 0.0f);
- void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId, language, TargetGuid); }
- void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId, language, TargetGuid); }
- void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId, TargetGuid); }
- void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId, receiver); }
- void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId, language, TargetGuid); }
-
// overwrite WorldObject function for proper name localization
std::string const& GetNameForLocaleIdx(LocaleConstant locale_idx) const;
@@ -820,6 +816,9 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map
void SetDisplayId(uint32 displayid);
uint32 GetDisplayId() const { return GetUInt32Value(GAMEOBJECT_DISPLAYID); }
+ uint32 GetFaction() const { return GetUInt32Value(GAMEOBJECT_FACTION); }
+ void SetFaction(uint32 faction) { SetUInt32Value(GAMEOBJECT_FACTION, faction); }
+
GameObjectModel* m_model;
void GetRespawnPosition(float &x, float &y, float &z, float* ori = NULL) const;
diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp
index 56c29c1d1c7..39f2c59fc29 100644
--- a/src/server/game/Entities/Item/Container/Bag.cpp
+++ b/src/server/game/Entities/Item/Container/Bag.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Item/Container/Bag.h b/src/server/game/Entities/Item/Container/Bag.h
index 259d22d1682..1e39e5a41ad 100644
--- a/src/server/game/Entities/Item/Container/Bag.h
+++ b/src/server/game/Entities/Item/Container/Bag.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 747884e197c..ee389ed7311 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -102,7 +102,7 @@ void AddItemsSetItem(Player* player, Item* item)
break;
}
- // spell casted only if fit form requirement, in other case will casted at form change
+ // spell cast only if fit form requirement, in other case will cast at form change
player->ApplyEquipSpell(spellInfo, NULL, true);
eff->spells[y] = spellInfo;
break;
diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h
index b18dfe694d6..a65579cc134 100644
--- a/src/server/game/Entities/Item/Item.h
+++ b/src/server/game/Entities/Item/Item.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
index 527329a9d61..3e31347a496 100644
--- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
+++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.h b/src/server/game/Entities/Item/ItemEnchantmentMgr.h
index c55537426db..a263ec0dae4 100644
--- a/src/server/game/Entities/Item/ItemEnchantmentMgr.h
+++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h
index 5fc49c99f0a..d411af218b1 100644
--- a/src/server/game/Entities/Item/ItemPrototype.h
+++ b/src/server/game/Entities/Item/ItemPrototype.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index 675504cd668..8af48f277bd 100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -50,6 +50,7 @@
#include "Group.h"
#include "Battlefield.h"
#include "BattlefieldMgr.h"
+#include "Chat.h"
uint32 GuidHigh2TypeId(uint32 guid_hi)
{
@@ -479,7 +480,10 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
{
/// @todo Allow players to aquire this updateflag.
*data << uint32(unit->GetVehicleKit()->GetVehicleInfo()->m_ID);
- *data << float(unit->GetOrientation());
+ if (unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ *data << float(unit->GetTransOffsetO());
+ else
+ *data << float(unit->GetOrientation());
}
// 0x200
@@ -1082,7 +1086,7 @@ void MovementInfo::OutDebug()
TC_LOG_INFO("misc", "splineElevation: %f", splineElevation);
}
-WorldObject::WorldObject(bool isWorldObject): WorldLocation(),
+WorldObject::WorldObject(bool isWorldObject) : WorldLocation(), LastUsedScriptID(0),
m_name(""), m_isActive(false), m_isWorldObject(isWorldObject), m_zoneScript(NULL),
m_transport(NULL), m_currMap(NULL), m_InstanceId(0),
m_phaseMask(PHASEMASK_NORMAL), m_notifyflags(0), m_executed_notifies(0)
@@ -1555,6 +1559,10 @@ void WorldObject::UpdateGroundPositionZ(float x, float y, float &z) const
void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
{
+ // TODO: Allow transports to be part of dynamic vmap tree
+ if (GetTransport())
+ return;
+
switch (GetTypeId())
{
case TYPEID_UNIT:
@@ -1880,180 +1888,142 @@ namespace Trinity
class MonsterChatBuilder
{
public:
- MonsterChatBuilder(WorldObject const& obj, ChatMsg msgtype, int32 textId, uint32 language, uint64 targetGUID)
- : i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(language), i_targetGUID(targetGUID) { }
+ MonsterChatBuilder(WorldObject const* obj, ChatMsg msgtype, int32 textId, uint32 language, WorldObject const* target)
+ : i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(Language(language)), i_target(target) { }
void operator()(WorldPacket& data, LocaleConstant loc_idx)
{
char const* text = sObjectMgr->GetTrinityString(i_textId, loc_idx);
-
- /// @todo i_object.GetName() also must be localized?
- i_object.BuildMonsterChat(&data, i_msgtype, text, i_language, i_object.GetNameForLocaleIdx(loc_idx), i_targetGUID);
+ ChatHandler::BuildChatPacket(data, i_msgtype, i_language, i_object, i_target, text, 0, "", loc_idx);
}
private:
- WorldObject const& i_object;
+ WorldObject const* i_object;
ChatMsg i_msgtype;
int32 i_textId;
- uint32 i_language;
- uint64 i_targetGUID;
+ Language i_language;
+ WorldObject const* i_target;
};
class MonsterCustomChatBuilder
{
public:
- MonsterCustomChatBuilder(WorldObject const& obj, ChatMsg msgtype, const char* text, uint32 language, uint64 targetGUID)
- : i_object(obj), i_msgtype(msgtype), i_text(text), i_language(language), i_targetGUID(targetGUID) { }
+ MonsterCustomChatBuilder(WorldObject const* obj, ChatMsg msgtype, const char* text, uint32 language, WorldObject const* target)
+ : i_object(obj), i_msgtype(msgtype), i_text(text), i_language(Language(language)), i_target(target)
+ {}
void operator()(WorldPacket& data, LocaleConstant loc_idx)
{
- /// @todo i_object.GetName() also must be localized?
- i_object.BuildMonsterChat(&data, i_msgtype, i_text, i_language, i_object.GetNameForLocaleIdx(loc_idx), i_targetGUID);
+ ChatHandler::BuildChatPacket(data, i_msgtype, i_language, i_object, i_target, i_text, 0, "", loc_idx);
}
private:
- WorldObject const& i_object;
+ WorldObject const* i_object;
ChatMsg i_msgtype;
const char* i_text;
- uint32 i_language;
- uint64 i_targetGUID;
+ Language i_language;
+ WorldObject const* i_target;
};
} // namespace Trinity
-void WorldObject::MonsterSay(const char* text, uint32 language, uint64 TargetGuid)
+void WorldObject::MonsterSay(const char* text, uint32 language, WorldObject const* target)
{
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
Cell cell(p);
cell.SetNoCreate();
- Trinity::MonsterCustomChatBuilder say_build(*this, CHAT_MSG_MONSTER_SAY, text, language, TargetGuid);
+ Trinity::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, text, language, target);
Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> say_do(say_build);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
}
-void WorldObject::MonsterSay(int32 textId, uint32 language, uint64 TargetGuid)
+void WorldObject::MonsterSay(int32 textId, uint32 language, WorldObject const* target)
{
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
Cell cell(p);
cell.SetNoCreate();
- Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_SAY, textId, language, TargetGuid);
+ Trinity::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, textId, language, target);
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
}
-void WorldObject::MonsterYell(const char* text, uint32 language, uint64 TargetGuid)
+void WorldObject::MonsterYell(const char* text, uint32 language, WorldObject const* target)
{
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
Cell cell(p);
cell.SetNoCreate();
- Trinity::MonsterCustomChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, text, language, TargetGuid);
+ Trinity::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, text, language, target);
Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> say_do(say_build);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
}
-void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid)
+void WorldObject::MonsterYell(int32 textId, uint32 language, WorldObject const* target)
{
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
Cell cell(p);
cell.SetNoCreate();
- Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId, language, TargetGuid);
+ Trinity::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, textId, language, target);
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
}
-void WorldObject::MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid)
-{
- Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId, language, TargetGuid);
- Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
-
- uint32 zoneid = GetZoneId();
-
- Map::PlayerList const& pList = GetMap()->GetPlayers();
- for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
- if (itr->GetSource()->GetZoneId() == zoneid)
- say_do(itr->GetSource());
-}
-
-void WorldObject::MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsBossEmote)
+void WorldObject::MonsterTextEmote(const char* text, WorldObject const* target, bool IsBossEmote)
{
- WorldPacket data(SMSG_MESSAGECHAT, 200);
- BuildMonsterChat(&data, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, text, LANG_UNIVERSAL, GetName(), TargetGuid);
+ WorldPacket data;
+ ChatHandler::BuildChatPacket(data, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, LANG_UNIVERSAL,
+ this, target, text);
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true);
}
-void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote)
+void WorldObject::MonsterTextEmote(int32 textId, WorldObject const* target, bool IsBossEmote)
{
CellCoord p = Trinity::ComputeCellCoord(GetPositionX(), GetPositionY());
Cell cell(p);
cell.SetNoCreate();
- Trinity::MonsterChatBuilder say_build(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId, LANG_UNIVERSAL, TargetGuid);
+ Trinity::MonsterChatBuilder say_build(this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId, LANG_UNIVERSAL, target);
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), say_do);
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
}
-void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper)
+void WorldObject::MonsterWhisper(const char* text, Player const* target, bool IsBossWhisper)
{
- Player* player = ObjectAccessor::FindPlayer(receiver);
- if (!player || !player->GetSession())
+ if (!target)
return;
- LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex();
-
- WorldPacket data(SMSG_MESSAGECHAT, 200);
- BuildMonsterChat(&data, IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, text, LANG_UNIVERSAL, GetNameForLocaleIdx(loc_idx), receiver);
-
- player->GetSession()->SendPacket(&data);
+ LocaleConstant loc_idx = target->GetSession()->GetSessionDbLocaleIndex();
+ WorldPacket data;
+ ChatHandler::BuildChatPacket(data, IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, LANG_UNIVERSAL, this, target, text, 0, "", loc_idx);
+ target->GetSession()->SendPacket(&data);
}
-void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper)
+void WorldObject::MonsterWhisper(int32 textId, Player const* target, bool IsBossWhisper)
{
- Player* player = ObjectAccessor::FindPlayer(receiver);
- if (!player || !player->GetSession())
+ if (!target)
return;
- LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex();
+ LocaleConstant loc_idx = target->GetSession()->GetSessionDbLocaleIndex();
char const* text = sObjectMgr->GetTrinityString(textId, loc_idx);
+ WorldPacket data;
+ ChatHandler::BuildChatPacket(data, IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, LANG_UNIVERSAL, this, target, text, 0, "", loc_idx);
- WorldPacket data(SMSG_MESSAGECHAT, 200);
- BuildMonsterChat(&data, IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, text, LANG_UNIVERSAL, GetNameForLocaleIdx(loc_idx), receiver);
-
- player->GetSession()->SendPacket(&data);
-}
-
-void WorldObject::BuildMonsterChat(WorldPacket* data, uint8 msgtype, char const* text, uint32 language, std::string const &name, uint64 targetGuid) const
-{
- *data << (uint8)msgtype;
- *data << (uint32)language;
- *data << (uint64)GetGUID();
- *data << (uint32)0; // 2.1.0
- *data << (uint32)(name.size()+1);
- *data << name;
- *data << (uint64)targetGuid; // Unit Target
- if (targetGuid && !IS_PLAYER_GUID(targetGuid))
- {
- *data << (uint32)1; // target name length
- *data << (uint8)0; // target name
- }
- *data << (uint32)(strlen(text)+1);
- *data << text;
- *data << (uint8)0; // ChatTag
+ target->GetSession()->SendPacket(&data);
}
void Unit::BuildHeartBeatMsg(WorldPacket* data) const
diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h
index aeeb1d691f0..8d3b1ff9554 100644
--- a/src/server/game/Entities/Object/Object.h
+++ b/src/server/game/Entities/Object/Object.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -537,7 +537,7 @@ class MapObject
protected:
MapObject() : _moveState(MAP_OBJECT_CELL_MOVE_NONE)
- {
+ {
_newPosition.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
}
@@ -637,16 +637,14 @@ class WorldObject : public Object, public WorldLocation
virtual uint8 getLevelForTarget(WorldObject const* /*target*/) const { return 1; }
- void MonsterSay(const char* text, uint32 language, uint64 TargetGuid);
- void MonsterYell(const char* text, uint32 language, uint64 TargetGuid);
- void MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsBossEmote = false);
- void MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper = false);
- void MonsterSay(int32 textId, uint32 language, uint64 TargetGuid);
- void MonsterYell(int32 textId, uint32 language, uint64 TargetGuid);
- void MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false);
- void MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper = false);
- void MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid);
- void BuildMonsterChat(WorldPacket* data, uint8 msgtype, char const* text, uint32 language, std::string const& name, uint64 TargetGuid) const;
+ void MonsterSay(const char* text, uint32 language, WorldObject const* target);
+ void MonsterYell(const char* text, uint32 language, WorldObject const* target);
+ void MonsterTextEmote(const char* text, WorldObject const* target, bool IsBossEmote = false);
+ void MonsterWhisper(const char* text, Player const* target, bool IsBossWhisper = false);
+ void MonsterSay(int32 textId, uint32 language, WorldObject const* target);
+ void MonsterYell(int32 textId, uint32 language, WorldObject const* target);
+ void MonsterTextEmote(int32 textId, WorldObject const* target, bool IsBossEmote = false);
+ void MonsterWhisper(int32 textId, Player const* target, bool IsBossWhisper = false);
void PlayDistanceSound(uint32 sound_id, Player* target = NULL);
void PlayDirectSound(uint32 sound_id, Player* target = NULL);
diff --git a/src/server/game/Entities/Object/ObjectDefines.h b/src/server/game/Entities/Object/ObjectDefines.h
index d0b9819b0a3..236f77caf5a 100644
--- a/src/server/game/Entities/Object/ObjectDefines.h
+++ b/src/server/game/Entities/Object/ObjectDefines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Object/ObjectPosSelector.cpp b/src/server/game/Entities/Object/ObjectPosSelector.cpp
index 5ad3086c2b6..fa7c5dffafa 100644
--- a/src/server/game/Entities/Object/ObjectPosSelector.cpp
+++ b/src/server/game/Entities/Object/ObjectPosSelector.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Object/ObjectPosSelector.h b/src/server/game/Entities/Object/ObjectPosSelector.h
index d3f43654969..5bac179880f 100644
--- a/src/server/game/Entities/Object/ObjectPosSelector.h
+++ b/src/server/game/Entities/Object/ObjectPosSelector.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Object/Updates/UpdateData.cpp b/src/server/game/Entities/Object/Updates/UpdateData.cpp
index be04a38c2d0..e996db52c38 100644
--- a/src/server/game/Entities/Object/Updates/UpdateData.cpp
+++ b/src/server/game/Entities/Object/Updates/UpdateData.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Object/Updates/UpdateData.h b/src/server/game/Entities/Object/Updates/UpdateData.h
index 654db149ca0..16bdec46aba 100644
--- a/src/server/game/Entities/Object/Updates/UpdateData.h
+++ b/src/server/game/Entities/Object/Updates/UpdateData.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Object/Updates/UpdateFieldFlags.cpp b/src/server/game/Entities/Object/Updates/UpdateFieldFlags.cpp
index 64b5037048b..5629fef7d0c 100644
--- a/src/server/game/Entities/Object/Updates/UpdateFieldFlags.cpp
+++ b/src/server/game/Entities/Object/Updates/UpdateFieldFlags.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Entities/Object/Updates/UpdateFieldFlags.h b/src/server/game/Entities/Object/Updates/UpdateFieldFlags.h
index 6053b361905..6d168cd56c4 100644
--- a/src/server/game/Entities/Object/Updates/UpdateFieldFlags.h
+++ b/src/server/game/Entities/Object/Updates/UpdateFieldFlags.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Entities/Object/Updates/UpdateFields.h b/src/server/game/Entities/Object/Updates/UpdateFields.h
index 9e659c0f581..2838ee31d81 100644
--- a/src/server/game/Entities/Object/Updates/UpdateFields.h
+++ b/src/server/game/Entities/Object/Updates/UpdateFields.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Object/Updates/UpdateMask.h b/src/server/game/Entities/Object/Updates/UpdateMask.h
index 72c9e9945d0..3c5708fb117 100644
--- a/src/server/game/Entities/Object/Updates/UpdateMask.h
+++ b/src/server/game/Entities/Object/Updates/UpdateMask.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index b019cd7e423..c218c3c645f 100644
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h
index e0afef2b8e3..ef5e792e939 100644
--- a/src/server/game/Entities/Pet/Pet.h
+++ b/src/server/game/Entities/Pet/Pet.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -95,7 +95,7 @@ class Pet : public Guardian
void UpdateMaxHealth();
void UpdateMaxPower(Powers power);
void UpdateAttackPowerAndDamage(bool ranged = false);
- void UpdateDamagePhysical(WeaponAttackType attType);
+ void UpdateDamagePhysical(WeaponAttackType attType) OVERRIDE;
*/
void ToggleAutocast(SpellInfo const* spellInfo, bool apply);
diff --git a/src/server/game/Entities/Pet/PetDefines.h b/src/server/game/Entities/Pet/PetDefines.h
index 34cde3af33a..f590bef233e 100644
--- a/src/server/game/Entities/Pet/PetDefines.h
+++ b/src/server/game/Entities/Pet/PetDefines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 2eed8e95e53..1dea84d0279 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -77,6 +77,7 @@
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
+#include "GameObjectAI.h"
#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS)
@@ -663,6 +664,7 @@ Player::Player(WorldSession* session): Unit(true)
m_session = session;
m_divider = 0;
+ m_ingametime = 0;
m_ExtraFlags = 0;
@@ -689,6 +691,7 @@ Player::Player(WorldSession* session): Unit(true)
m_zoneUpdateTimer = 0;
m_areaUpdateId = 0;
+ m_team = 0;
m_nextSave = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE);
@@ -750,11 +753,12 @@ Player::Player(WorldSession* session): Unit(true)
m_logintime = time(NULL);
m_Last_tick = m_logintime;
+ m_Played_time[PLAYED_TIME_TOTAL] = 0;
+ m_Played_time[PLAYED_TIME_LEVEL] = 0;
m_WeaponProficiency = 0;
m_ArmorProficiency = 0;
m_canParry = false;
m_canBlock = false;
- m_canDualWield = false;
m_canTitanGrip = false;
m_ammoDPS = 0.0f;
@@ -795,6 +799,7 @@ Player::Player(WorldSession* session): Unit(true)
m_InstanceValid = true;
m_dungeonDifficulty = DUNGEON_DIFFICULTY_NORMAL;
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
+ m_raidMapDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
m_lastPotionId = 0;
@@ -840,6 +845,18 @@ Player::Player(WorldSession* session): Unit(true)
m_movedPlayer = this;
m_seer = this;
+ m_recallMap = 0;
+ m_recallX = 0;
+ m_recallY = 0;
+ m_recallZ = 0;
+ m_recallO = 0;
+
+ m_homebindMapId = 0;
+ m_homebindAreaId = 0;
+ m_homebindX = 0;
+ m_homebindY = 0;
+ m_homebindZ = 0;
+
m_contestedPvPTimer = 0;
m_declinedname = NULL;
@@ -859,6 +876,11 @@ Player::Player(WorldSession* session): Unit(true)
m_ChampioningFaction = 0;
+ m_timeSyncCounter = 0;
+ m_timeSyncTimer = 0;
+ m_timeSyncClient = 0;
+ m_timeSyncServer = 0;
+
for (uint8 i = 0; i < MAX_POWERS; ++i)
m_powerFraction[i] = 0;
@@ -2157,7 +2179,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
SetSemaphoreTeleportFar(false);
//setup delayed teleport flag
SetDelayedTeleportFlag(IsCanDelayTeleport());
- //if teleport spell is casted in Unit::Update() func
+ //if teleport spell is cast in Unit::Update() func
//then we need to delay it until update process will be finished
if (IsHasDelayedTeleport())
{
@@ -2221,7 +2243,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
SetSemaphoreTeleportNear(false);
//setup delayed teleport flag
SetDelayedTeleportFlag(IsCanDelayTeleport());
- //if teleport spell is casted in Unit::Update() func
+ //if teleport spell is cast in Unit::Update() func
//then we need to delay it until update process will be finished
if (IsHasDelayedTeleport())
{
@@ -2267,7 +2289,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
// stop spellcasting
// not attempt interrupt teleportation spell at caster teleport
if (!(options & TELE_TO_SPELL))
- if (IsNonMeleeSpellCasted(true))
+ if (IsNonMeleeSpellCast(true))
InterruptNonMeleeSpells(true);
//remove auras before removing from map...
@@ -5105,7 +5127,10 @@ void Player::BuildPlayerRepop()
// BG - remove insignia related
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
-// SendCorpseReclaimDelay();
+ int32 corpseReclaimDelay = CalculateCorpseReclaimDelay();
+
+ if (corpseReclaimDelay >= 0)
+ SendCorpseReclaimDelay(corpseReclaimDelay);
// to prevent cheating
corpse->ResetGhostTime();
@@ -5197,7 +5222,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
void Player::KillPlayer()
{
if (IsFlying() && !GetTransport())
- i_motionMaster.MoveFall();
+ GetMotionMaster()->MoveFall();
SetMovement(MOVE_ROOT);
@@ -5213,7 +5238,11 @@ void Player::KillPlayer()
m_deathTimer = 6 * MINUTE * IN_MILLISECONDS;
UpdateCorpseReclaimDelay(); // dependent at use SetDeathPvP() call before kill
- SendCorpseReclaimDelay();
+
+ int32 corpseReclaimDelay = CalculateCorpseReclaimDelay();
+
+ if (corpseReclaimDelay >= 0)
+ SendCorpseReclaimDelay(corpseReclaimDelay);
// don't create corpse at this moment, player might be falling
@@ -7261,8 +7290,8 @@ bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvpto
{
// Check if allowed to receive it in current map
uint8 MapType = sWorld->getIntConfig(CONFIG_PVP_TOKEN_MAP_TYPE);
- if ((MapType == 1 && !InBattleground() && !HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
- || (MapType == 2 && !HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
+ if ((MapType == 1 && !InBattleground() && !IsFFAPvP())
+ || (MapType == 2 && !IsFFAPvP())
|| (MapType == 3 && !InBattleground()))
return true;
@@ -8399,7 +8428,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
if (!spellInfo)
{
- TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell(GUID: %u, name: %s, enchant: %i): unknown spell %i is casted, ignoring...",
+ TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell(GUID: %u, name: %s, enchant: %i): unknown spell %i is cast, ignoring...",
GetGUIDLow(), GetName().c_str(), pEnchant->ID, pEnchant->spellid[s]);
continue;
}
@@ -8460,7 +8489,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
// use triggered flag only for items with many spell casts and for not first cast
uint8 count = 0;
- // item spells casted at use
+ // item spells cast at use
for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
{
_Spell const& spellData = proto->Spells[i];
@@ -8489,7 +8518,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
++count;
}
- // Item enchantments spells casted at use
+ // Item enchantments spells cast at use
for (uint8 e_slot = 0; e_slot < MAX_ENCHANTMENT_SLOT; ++e_slot)
{
uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(e_slot));
@@ -11531,7 +11560,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
if (IsInCombat()&& (pProto->Class == ITEM_CLASS_WEAPON || pProto->InventoryType == INVTYPE_RELIC) && m_weaponChangeTimer != 0)
return EQUIP_ERR_CANT_DO_RIGHT_NOW; // maybe exist better err
- if (IsNonMeleeSpellCasted(false))
+ if (IsNonMeleeSpellCast(false))
return EQUIP_ERR_CANT_DO_RIGHT_NOW;
}
@@ -14748,11 +14777,7 @@ void Player::SendPreparedQuest(uint64 guid)
}
if (quest->IsAutoAccept() && CanAddQuest(quest, true) && CanTakeQuest(quest, true))
- {
- AddQuest(quest, object);
- if (CanCompleteQuest(questId))
- CompleteQuest(questId);
- }
+ AddQuestAndCheckCompletion(quest, object);
if ((quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly()) || quest->HasFlag(QUEST_FLAGS_AUTOCOMPLETE))
PlayerTalkClass->SendQuestGiverRequestItems(quest, guid, CanCompleteRepeatableQuest(quest), true);
@@ -15020,17 +15045,64 @@ bool Player::CanRewardQuest(Quest const* quest, bool msg)
return true;
}
+void Player::AddQuestAndCheckCompletion(Quest const* quest, Object* questGiver)
+{
+ AddQuest(quest, questGiver);
+
+ if (CanCompleteQuest(quest->GetQuestId()))
+ CompleteQuest(quest->GetQuestId());
+
+ if (!questGiver)
+ return;
+
+ switch (questGiver->GetTypeId())
+ {
+ case TYPEID_UNIT:
+ sScriptMgr->OnQuestAccept(this, (questGiver->ToCreature()), quest);
+ questGiver->ToCreature()->AI()->sQuestAccept(this, quest);
+ break;
+ case TYPEID_ITEM:
+ case TYPEID_CONTAINER:
+ {
+ Item* item = (Item*)questGiver;
+ sScriptMgr->OnQuestAccept(this, item, quest);
+
+ // destroy not required for quest finish quest starting item
+ bool destroyItem = true;
+ for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
+ {
+ if (quest->RequiredItemId[i] == item->GetEntry() && item->GetTemplate()->MaxCount > 0)
+ {
+ destroyItem = false;
+ break;
+ }
+ }
+
+ if (destroyItem)
+ DestroyItem(item->GetBagSlot(), item->GetSlot(), true);
+
+ break;
+ }
+ case TYPEID_GAMEOBJECT:
+ sScriptMgr->OnQuestAccept(this, questGiver->ToGameObject(), quest);
+ questGiver->ToGameObject()->AI()->QuestAccept(this, quest);
+ break;
+ default:
+ break;
+ }
+}
+
bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg)
{
// prevent receive reward with quest items in bank or for not completed quest
if (!CanRewardQuest(quest, msg))
return false;
+ ItemPosCountVec dest;
if (quest->GetRewChoiceItemsCount() > 0)
{
if (quest->RewardChoiceItemId[reward])
{
- ItemPosCountVec dest;
InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewardChoiceItemId[reward], quest->RewardChoiceItemCount[reward]);
if (res != EQUIP_ERR_OK)
{
@@ -15046,7 +15118,6 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg)
{
if (quest->RewardItemId[i])
{
- ItemPosCountVec dest;
InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewardItemId[i], quest->RewardItemIdCount[i]);
if (res != EQUIP_ERR_OK)
{
@@ -15313,7 +15384,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
if (quest->GetRewSpellCast() > 0)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(quest->GetRewSpellCast());
- if (questGiver->isType(TYPEMASK_UNIT) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL))
+ if (questGiver->isType(TYPEMASK_UNIT) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL) && !spellInfo->HasEffect(SPELL_EFFECT_CREATE_ITEM))
{
if (Creature* creature = GetMap()->GetCreature(questGiver->GetGUID()))
creature->CastSpell(this, quest->GetRewSpellCast(), true);
@@ -15324,7 +15395,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
else if (quest->GetRewSpell() > 0)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(quest->GetRewSpell());
- if (questGiver->isType(TYPEMASK_UNIT) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL))
+ if (questGiver->isType(TYPEMASK_UNIT) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL) && !spellInfo->HasEffect(SPELL_EFFECT_CREATE_ITEM))
{
if (Creature* creature = GetMap()->GetCreature(questGiver->GetGUID()))
creature->CastSpell(this, quest->GetRewSpell(), true);
@@ -17280,49 +17351,56 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
// NOW player must have valid map
// load the player's map here if it's not already loaded
Map* map = sMapMgr->CreateMap(mapId, this);
+ AreaTrigger const* areaTrigger = NULL;
+ bool check = false;
if (!map)
{
- instanceId = 0;
- AreaTrigger const* at = sObjectMgr->GetGoBackTrigger(mapId);
- if (at)
+ areaTrigger = sObjectMgr->GetGoBackTrigger(mapId);
+ check = true;
+ }
+ else if (map->IsDungeon()) // if map is dungeon...
+ {
+ if (!((InstanceMap*)map)->CanEnter(this)) // ... and can't enter map, then look for entry point.
{
- TC_LOG_ERROR("entities.player", "Player (guidlow %d) is teleported to gobacktrigger (Map: %u X: %f Y: %f Z: %f O: %f).", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
- Relocate(at->target_X, at->target_Y, at->target_Z, GetOrientation());
- mapId = at->target_mapId;
+ areaTrigger = sObjectMgr->GetGoBackTrigger(mapId);
+ check = true;
}
- else
+ else if (instanceId && !sInstanceSaveMgr->GetInstanceSave(instanceId)) // ... and instance is reseted then look for entrance.
{
- TC_LOG_ERROR("entities.player", "Player (guidlow %d) is teleported to home (Map: %u X: %f Y: %f Z: %f O: %f).", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
- RelocateToHomebind();
+ areaTrigger = sObjectMgr->GetMapEntranceTrigger(mapId);
+ check = true;
}
+ }
- map = sMapMgr->CreateMap(mapId, this);
- if (!map)
+ if (check) // in case of special event when creating map...
+ {
+ if (areaTrigger) // ... if we have an areatrigger, then relocate to new map/coordinates.
{
- PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
- mapId = info->mapId;
- Relocate(info->positionX, info->positionY, info->positionZ, 0.0f);
- TC_LOG_ERROR("entities.player", "Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
- map = sMapMgr->CreateMap(mapId, this);
- if (!map)
+ Relocate(areaTrigger->target_X, areaTrigger->target_Y, areaTrigger->target_Z, GetOrientation());
+ if (mapId != areaTrigger->target_mapId)
{
- TC_LOG_ERROR("entities.player", "Player (guidlow %d) has invalid default map coordinates (X: %f Y: %f Z: %f O: %f). or instance couldn't be created", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
- return false;
+ mapId = areaTrigger->target_mapId;
+ map = sMapMgr->CreateMap(mapId, this);
}
}
+ else
+ {
+ TC_LOG_ERROR("entities.player", "Player %s (guid: %d) Map: %u, X: %f, Y: %f, Z: %f, O: %f. Areatrigger not found.", m_name.c_str(), guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ map = NULL;
+ }
}
- // if the player is in an instance and it has been reset in the meantime teleport him to the entrance
- if (instanceId && !sInstanceSaveMgr->GetInstanceSave(instanceId) && !map->IsBattlegroundOrArena())
+ if (!map)
{
- AreaTrigger const* at = sObjectMgr->GetMapEntranceTrigger(mapId);
- if (at)
- Relocate(at->target_X, at->target_Y, at->target_Z, at->target_Orientation);
- else
+ PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
+ mapId = info->mapId;
+ Relocate(info->positionX, info->positionY, info->positionZ, 0.0f);
+ map = sMapMgr->CreateMap(mapId, this);
+ if (!map)
{
- TC_LOG_ERROR("entities.player", "Player %s(GUID: %u) logged in to a reset instance (map: %u) and there is no area-trigger leading to this map. Thus he can't be ported back to the entrance. This _might_ be an exploit attempt.", GetName().c_str(), GetGUIDLow(), mapId);
- RelocateToHomebind();
+ TC_LOG_ERROR("entities.player", "Player %s (guid: %d) Map: %u, X: %f, Y: %f, Z: %f, O: %f. Invalid default map coordinates or instance couldn't be created.", m_name.c_str(), guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ return false;
}
}
@@ -17369,6 +17447,12 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
m_atLoginFlags = fields[33].GetUInt16();
+ if (HasAtLoginFlag(AT_LOGIN_RENAME))
+ {
+ TC_LOG_ERROR("entities.player", "Player (GUID: %u) tried to login while forced to rename, can't load.'", GetGUIDLow());
+ return false;
+ }
+
// Honor system
// Update Honor kills data
m_lastHonorUpdateTime = logoutTime;
@@ -20287,25 +20371,13 @@ void Player::StopCastingCharm()
}
}
-inline void Player::BuildPlayerChat(WorldPacket* data, uint8 msgtype, const std::string& text, uint32 language) const
-{
- *data << uint8(msgtype);
- *data << uint32(language);
- *data << uint64(GetGUID());
- *data << uint32(0); // constant unknown time
- *data << uint64(GetGUID());
- *data << uint32(text.length() + 1);
- *data << text;
- *data << uint8(GetChatTag());
-}
-
void Player::Say(const std::string& text, const uint32 language)
{
std::string _text(text);
sScriptMgr->OnPlayerChat(this, CHAT_MSG_SAY, language, _text);
- WorldPacket data(SMSG_MESSAGECHAT, 200);
- BuildPlayerChat(&data, CHAT_MSG_SAY, _text, language);
+ WorldPacket data;
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_SAY, Language(language), this, this, text);
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true);
}
@@ -20314,8 +20386,8 @@ void Player::Yell(const std::string& text, const uint32 language)
std::string _text(text);
sScriptMgr->OnPlayerChat(this, CHAT_MSG_YELL, language, _text);
- WorldPacket data(SMSG_MESSAGECHAT, 200);
- BuildPlayerChat(&data, CHAT_MSG_YELL, _text, language);
+ WorldPacket data;
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_YELL, Language(language), this, this, text);
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), true);
}
@@ -20324,8 +20396,8 @@ void Player::TextEmote(const std::string& text)
std::string _text(text);
sScriptMgr->OnPlayerChat(this, CHAT_MSG_EMOTE, LANG_UNIVERSAL, _text);
- WorldPacket data(SMSG_MESSAGECHAT, 200);
- BuildPlayerChat(&data, CHAT_MSG_EMOTE, _text, LANG_UNIVERSAL);
+ WorldPacket data;
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_EMOTE, LANG_UNIVERSAL, this, this, text);
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true, !GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHAT));
}
@@ -20341,16 +20413,15 @@ void Player::Whisper(const std::string& text, uint32 language, uint64 receiver)
std::string _text(text);
sScriptMgr->OnPlayerChat(this, CHAT_MSG_WHISPER, language, _text, rPlayer);
- WorldPacket data(SMSG_MESSAGECHAT, 200);
- BuildPlayerChat(&data, CHAT_MSG_WHISPER, _text, language);
+ WorldPacket data;
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, Language(language), this, this, text);
rPlayer->GetSession()->SendPacket(&data);
// rest stuff shouldn't happen in case of addon message
if (isAddonMessage)
return;
- data.Initialize(SMSG_MESSAGECHAT, 200);
- rPlayer->BuildPlayerChat(&data, CHAT_MSG_WHISPER_INFORM, _text, language);
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER_INFORM, Language(language), rPlayer, rPlayer, text);
GetSession()->SendPacket(&data);
if (!isAcceptWhispers() && !IsGameMaster() && !rPlayer->IsGameMaster())
@@ -20709,13 +20780,15 @@ void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId, Aura* aura)
if (!spell || spell->m_appliedMods.empty())
return;
+ std::list<Aura*> aurasQueue;
+
for (uint8 i=0; i<MAX_SPELLMOD; ++i)
{
for (SpellModList::iterator itr = m_spellMods[i].begin(); itr != m_spellMods[i].end(); ++itr)
{
SpellModifier* mod = *itr;
- // spellmods without aura set cannot be charged
+ // Spellmods without aura set cannot be charged
if (!mod->ownerAura || !mod->ownerAura->IsUsingCharges())
continue;
@@ -20726,17 +20799,20 @@ void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId, Aura* aura)
if (aura && mod->ownerAura != aura)
continue;
- // check if mod affected this spell
- // first, check if the mod aura applied at least one spellmod to this spell
+ // Check if mod affected this spell
+ // First, check if the mod aura applied at least one spellmod to this spell
Spell::UsedSpellMods::iterator iterMod = spell->m_appliedMods.find(mod->ownerAura);
if (iterMod == spell->m_appliedMods.end())
continue;
- // secondly, check if the current mod is one of the spellmods applied by the mod aura
+ // Second, check if the current mod is one of those applied by the mod aura
if (!(mod->mask & spell->m_spellInfo->SpellFamilyFlags))
continue;
- // remove from list
- spell->m_appliedMods.erase(iterMod);
+ // remove from list - This will be done after all mods have been gone through
+ // to ensure we iterate over all mods of an aura before removing said aura
+ // from applied mods (Else, an aura with two mods on the current spell would
+ // only see the first of its modifier restored)
+ aurasQueue.push_back(mod->ownerAura);
// add mod charges back to mod
if (mod->charges == -1)
@@ -20744,15 +20820,22 @@ void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId, Aura* aura)
else
mod->charges++;
- // Do not set more spellmods than avalible
+ // Do not set more spellmods than available
if (mod->ownerAura->GetCharges() < mod->charges)
mod->charges = mod->ownerAura->GetCharges();
// Skip this check for now - aura charges may change due to various reason
- /// @todo trac these changes correctly
+ /// @todo track these changes correctly
//ASSERT (mod->ownerAura->GetCharges() <= mod->charges);
}
}
+
+ for (std::list<Aura*>::iterator itr = aurasQueue.begin(); itr != aurasQueue.end(); ++itr)
+ {
+ Spell::UsedSpellMods::iterator iterMod = spell->m_appliedMods.find(*itr);
+ if (iterMod != spell->m_appliedMods.end())
+ spell->m_appliedMods.erase(iterMod);
+ }
}
void Player::RestoreAllSpellMods(uint32 ownerAuraId, Aura* aura)
@@ -20987,7 +21070,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
}
// not let cheating with start flight in time of logout process || if casting not finished || while in combat || if not use Spell's with EffectSendTaxi
- if (IsNonMeleeSpellCasted(false))
+ if (IsNonMeleeSpellCast(false))
{
GetSession()->SendActivateTaxiReply(ERR_TAXIPLAYERBUSY);
return false;
@@ -21609,14 +21692,14 @@ void Player::UpdatePvPState(bool onlyFFA)
if (!pvpInfo.IsInNoPvPArea && !IsGameMaster()
&& (pvpInfo.IsInFFAPvPArea || sWorld->IsFFAPvPRealm()))
{
- if (!HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
+ if (!IsFFAPvP())
{
SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
for (ControlList::iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
(*itr)->SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
}
}
- else if (HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
+ else if (IsFFAPvP())
{
RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
for (ControlList::iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
@@ -23479,7 +23562,7 @@ void Player::RemoveItemDependentAurasAndCasts(Item* pItem)
RemoveOwnedAura(itr);
}
- // currently casted spells can be dependent from item
+ // currently cast spells can be dependent from item
for (uint32 i = 0; i < CURRENT_MAX_SPELL; ++i)
if (Spell* spell = GetCurrentSpell(CurrentSpellTypes(i)))
if (spell->getState() != SPELL_STATE_DELAYED && !HasItemFitToSpellRequirements(spell->m_spellInfo, pItem))
@@ -23692,14 +23775,18 @@ void Player::ResurectUsingRequestData()
SpawnCorpseBones();
}
-void Player::SetClientControl(Unit* target, uint8 allowMove)
+void Player::SetClientControl(Unit* target, bool allowMove)
{
WorldPacket data(SMSG_CLIENT_CONTROL_UPDATE, target->GetPackGUID().size()+1);
data.append(target->GetPackGUID());
- data << uint8(allowMove);
+ data << uint8(allowMove ? 1 : 0);
GetSession()->SendPacket(&data);
- if (target == this)
- SetMover(this);
+
+ if (this != target)
+ SetViewpoint(target, allowMove);
+
+ if (allowMove)
+ SetMover(target);
}
void Player::SetMover(Unit* target)
@@ -23764,7 +23851,7 @@ uint32 Player::GetCorpseReclaimDelay(bool pvp) const
time_t now = time(NULL);
// 0..2 full period
// should be ceil(x)-1 but not floor(x)
- uint64 count = (now < m_deathExpireTime - 1) ? (m_deathExpireTime - 1 - now)/DEATH_EXPIRE_STEP : 0;
+ uint64 count = (now < m_deathExpireTime - 1) ? (m_deathExpireTime - 1 - now) / DEATH_EXPIRE_STEP : 0;
return copseReclaimDelay[count];
}
@@ -23777,65 +23864,66 @@ void Player::UpdateCorpseReclaimDelay()
return;
time_t now = time(NULL);
+
if (now < m_deathExpireTime)
{
// full and partly periods 1..3
- uint64 count = (m_deathExpireTime - now)/DEATH_EXPIRE_STEP +1;
+ uint64 count = (m_deathExpireTime - now) / DEATH_EXPIRE_STEP + 1;
+
if (count < MAX_DEATH_COUNT)
- m_deathExpireTime = now+(count+1)*DEATH_EXPIRE_STEP;
+ m_deathExpireTime = now+(count + 1) * DEATH_EXPIRE_STEP;
else
- m_deathExpireTime = now+MAX_DEATH_COUNT*DEATH_EXPIRE_STEP;
+ m_deathExpireTime = now + MAX_DEATH_COUNT*DEATH_EXPIRE_STEP;
}
else
- m_deathExpireTime = now+DEATH_EXPIRE_STEP;
+ m_deathExpireTime = now + DEATH_EXPIRE_STEP;
}
-void Player::SendCorpseReclaimDelay(bool load)
+int32 Player::CalculateCorpseReclaimDelay(bool load)
{
Corpse* corpse = GetCorpse();
+
if (load && !corpse)
- return;
+ return -1;
- bool pvp;
- if (corpse)
- pvp = (corpse->GetType() == CORPSE_RESURRECTABLE_PVP);
- else
- pvp = (m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH);
+ bool pvp = corpse ? corpse->GetType() == CORPSE_RESURRECTABLE_PVP : m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH;
+
+ uint32 delay;
- time_t delay;
if (load)
{
if (corpse->GetGhostTime() > m_deathExpireTime)
- return;
+ return -1;
+
+ uint64 count = 0;
- uint64 count;
if ((pvp && sWorld->getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
(!pvp && sWorld->getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE)))
{
- count = (m_deathExpireTime-corpse->GetGhostTime())/DEATH_EXPIRE_STEP;
+ count = (m_deathExpireTime - corpse->GetGhostTime()) / DEATH_EXPIRE_STEP;
+
if (count >= MAX_DEATH_COUNT)
- count = MAX_DEATH_COUNT-1;
+ count = MAX_DEATH_COUNT - 1;
}
- else
- count=0;
-
- time_t expected_time = corpse->GetGhostTime()+copseReclaimDelay[count];
+ time_t expected_time = corpse->GetGhostTime() + copseReclaimDelay[count];
time_t now = time(NULL);
+
if (now >= expected_time)
- return;
+ return -1;
- delay = expected_time-now;
+ delay = expected_time - now;
}
else
delay = GetCorpseReclaimDelay(pvp);
- if (!delay)
- return;
+ return delay * IN_MILLISECONDS;
+}
- //! corpse reclaim delay 30 * 1000ms or longer at often deaths
+void Player::SendCorpseReclaimDelay(uint32 delay)
+{
WorldPacket data(SMSG_CORPSE_RECLAIM_DELAY, 4);
- data << uint32(delay*IN_MILLISECONDS);
+ data << uint32(delay);
GetSession()->SendPacket(&data);
}
@@ -25740,7 +25828,7 @@ void Player::ActivateSpec(uint8 spec)
if (spec > GetSpecsCount())
return;
- if (IsNonMeleeSpellCasted(false))
+ if (IsNonMeleeSpellCast(false))
InterruptNonMeleeSpells(false);
SQLTransaction trans = CharacterDatabase.BeginTransaction();
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 6aa19b5395a..1f5f9fee7d4 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -1021,7 +1021,7 @@ class TradeData
uint32 m_money; // m_player place money to trade
uint32 m_spell; // m_player apply spell to non-traded slot item
- uint64 m_spellCastItem; // applied spell casted by item use
+ uint64 m_spellCastItem; // applied spell cast by item use
uint64 m_items[TRADE_SLOT_COUNT]; // traded items from m_player side including non-traded slot
};
@@ -1187,8 +1187,6 @@ class Player : public Unit, public GridObject<Player>
void TextEmote(std::string const& text);
/// Handles whispers from Addons and players based on sender, receiver's guid and language.
void Whisper(std::string const& text, const uint32 language, uint64 receiver);
- /// Constructs the player Chat data for the specific functions to use
- void BuildPlayerChat(WorldPacket* data, uint8 msgtype, std::string const& text, uint32 language) const;
/*********************************************************/
/*** STORAGE SYSTEM ***/
@@ -1357,6 +1355,7 @@ class Player : public Unit, public GridObject<Player>
bool CanCompleteRepeatableQuest(Quest const* quest);
bool CanRewardQuest(Quest const* quest, bool msg);
bool CanRewardQuest(Quest const* quest, uint32 reward, bool msg);
+ void AddQuestAndCheckCompletion(Quest const* quest, Object* questGiver);
void AddQuest(Quest const* quest, Object* questGiver);
void CompleteQuest(uint32 quest_id);
void IncompleteQuest(uint32 quest_id);
@@ -1644,6 +1643,7 @@ class Player : public Unit, public GridObject<Player>
void RemoveAllSpellCooldown();
void _LoadSpellCooldowns(PreparedQueryResult result);
void _SaveSpellCooldowns(SQLTransaction& trans);
+ uint32 GetLastPotionId() { return m_lastPotionId; }
void SetLastPotionId(uint32 item_id) { m_lastPotionId = item_id; }
void UpdatePotionCooldown(Spell* spell = NULL);
@@ -1748,14 +1748,13 @@ class Player : public Unit, public GridObject<Player>
void ApplyFeralAPBonus(int32 amount, bool apply);
void UpdateAttackPowerAndDamage(bool ranged = false);
void UpdateShieldBlockValue();
- void UpdateDamagePhysical(WeaponAttackType attType);
void ApplySpellPowerBonus(int32 amount, bool apply);
void UpdateSpellDamageAndHealingBonus();
void ApplyRatingMod(CombatRating cr, int32 value, bool apply);
void UpdateRating(CombatRating cr);
void UpdateAllRatings();
- void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& min_damage, float& max_damage);
+ void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage) OVERRIDE;
void UpdateDefenseBonusesMod();
inline void RecalculateRating(CombatRating cr) { ApplyRatingMod(cr, 0, true);}
@@ -1937,7 +1936,8 @@ class Player : public Unit, public GridObject<Player>
uint32 GetDeathTimer() const { return m_deathTimer; }
uint32 GetCorpseReclaimDelay(bool pvp) const;
void UpdateCorpseReclaimDelay();
- void SendCorpseReclaimDelay(bool load = false);
+ int32 CalculateCorpseReclaimDelay(bool load = false);
+ void SendCorpseReclaimDelay(uint32 delay);
uint32 GetShieldBlockValue() const; // overwrite Unit version (virtual)
bool CanParry() const { return m_canParry; }
@@ -2089,7 +2089,7 @@ class Player : public Unit, public GridObject<Player>
bool IsKnowHowFlyIn(uint32 mapid, uint32 zone) const;
- void SetClientControl(Unit* target, uint8 allowMove);
+ void SetClientControl(Unit* target, bool allowMove);
void SetMover(Unit* target);
diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp
index e7cc8f92ce2..8c8e470f80b 100644
--- a/src/server/game/Entities/Player/SocialMgr.cpp
+++ b/src/server/game/Entities/Player/SocialMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Player/SocialMgr.h b/src/server/game/Entities/Player/SocialMgr.h
index 4f2a4fdde72..910c9164738 100644
--- a/src/server/game/Entities/Player/SocialMgr.h
+++ b/src/server/game/Entities/Player/SocialMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Totem/Totem.cpp b/src/server/game/Entities/Totem/Totem.cpp
index ddea24c6439..b8f5fd1833d 100644
--- a/src/server/game/Entities/Totem/Totem.cpp
+++ b/src/server/game/Entities/Totem/Totem.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Totem/Totem.h b/src/server/game/Entities/Totem/Totem.h
index 48cb71c4918..6364157982e 100644
--- a/src/server/game/Entities/Totem/Totem.h
+++ b/src/server/game/Entities/Totem/Totem.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@ class Totem : public Minion
void UpdateMaxHealth() { }
void UpdateMaxPower(Powers /*power*/) { }
void UpdateAttackPowerAndDamage(bool /*ranged*/) { }
- void UpdateDamagePhysical(WeaponAttackType /*attType*/) { }
+ void UpdateDamagePhysical(WeaponAttackType /*attType*/) OVERRIDE { }
bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const;
diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp
index 386a36ae1f0..f8c38d32390 100644
--- a/src/server/game/Entities/Transport/Transport.cpp
+++ b/src/server/game/Entities/Transport/Transport.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -90,8 +90,7 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa
SetPeriod(tInfo->pathTime);
SetEntry(goinfo->entry);
SetDisplayId(goinfo->displayId);
- SetGoState(GO_STATE_READY);
- _pendingStop = goinfo->moTransport.canBeStopped != 0;
+ SetGoState(!goinfo->moTransport.canBeStopped ? GO_STATE_READY : GO_STATE_ACTIVE);
SetGoType(GAMEOBJECT_TYPE_MO_TRANSPORT);
SetGoAnimProgress(animprogress);
SetName(goinfo->name);
@@ -111,7 +110,8 @@ void Transport::Update(uint32 diff)
if (GetKeyFrames().size() <= 1)
return;
- m_goValue.Transport.PathProgress += diff;
+ if (IsMoving() || !_pendingStop)
+ m_goValue.Transport.PathProgress += diff;
uint32 timer = m_goValue.Transport.PathProgress % GetPeriod();
@@ -132,31 +132,23 @@ void Transport::Update(uint32 diff)
if (timer < _currentFrame->DepartureTime)
{
SetMoving(false);
- if (_pendingStop)
+ if (_pendingStop && GetGoState() != GO_STATE_READY)
+ {
SetGoState(GO_STATE_READY);
+ m_goValue.Transport.PathProgress = (m_goValue.Transport.PathProgress / GetPeriod());
+ m_goValue.Transport.PathProgress *= GetPeriod();
+ m_goValue.Transport.PathProgress += _currentFrame->ArriveTime;
+ }
break; // its a stop frame and we are waiting
}
}
- if (_pendingStop && timer >= _currentFrame->DepartureTime && GetGoState() == GO_STATE_READY)
- {
- m_goValue.Transport.PathProgress = (m_goValue.Transport.PathProgress / GetPeriod());
- m_goValue.Transport.PathProgress *= GetPeriod();
- m_goValue.Transport.PathProgress += _currentFrame->ArriveTime;
- break;
- }
-
if (timer >= _currentFrame->DepartureTime && !_triggeredDepartureEvent)
{
DoEventIfAny(*_currentFrame, true); // departure event
_triggeredDepartureEvent = true;
}
- if (timer >= _currentFrame->DepartureTime && timer < _currentFrame->NextArriveTime)
- break; // found current waypoint
-
- MoveToNextWaypoint();
-
// not waiting anymore
SetMoving(true);
@@ -164,13 +156,18 @@ void Transport::Update(uint32 diff)
if (GetGOInfo()->moTransport.canBeStopped)
SetGoState(GO_STATE_ACTIVE);
+ if (timer >= _currentFrame->DepartureTime && timer < _currentFrame->NextArriveTime)
+ break; // found current waypoint
+
+ MoveToNextWaypoint();
+
sScriptMgr->OnRelocate(this, _currentFrame->Node->index, _currentFrame->Node->mapid, _currentFrame->Node->x, _currentFrame->Node->y, _currentFrame->Node->z);
TC_LOG_DEBUG("entities.transport", "Transport %u (%s) moved to node %u %u %f %f %f", GetEntry(), GetName().c_str(), _currentFrame->Node->index, _currentFrame->Node->mapid, _currentFrame->Node->x, _currentFrame->Node->y, _currentFrame->Node->z);
// Departure event
if (_currentFrame->IsTeleportFrame())
- if (TeleportTransport(_nextFrame->Node->mapid, _nextFrame->Node->x, _nextFrame->Node->y, _nextFrame->Node->z))
+ if (TeleportTransport(_nextFrame->Node->mapid, _nextFrame->Node->x, _nextFrame->Node->y, _nextFrame->Node->z, _nextFrame->InitialOrientation))
return; // Update more in new map thread
}
@@ -185,7 +182,18 @@ void Transport::Update(uint32 diff)
G3D::Vector3 pos, dir;
_currentFrame->Spline->evaluate_percent(_currentFrame->Index, t, pos);
_currentFrame->Spline->evaluate_derivative(_currentFrame->Index, t, dir);
- UpdatePosition(pos.x, pos.y, pos.z, atan2(dir.x, dir.y));
+ UpdatePosition(pos.x, pos.y, pos.z, atan2(dir.y, dir.x) + M_PI);
+ }
+ else
+ {
+ /* There are four possible scenarios that trigger loading/unloading passengers:
+ 1. transport moves from inactive to active grid
+ 2. the grid that transport is currently in becomes active
+ 3. transport moves from active to inactive grid
+ 4. the grid that transport is currently in unloads
+ */
+ if (_staticPassengers.empty() && GetMap()->IsGridLoaded(GetPositionX(), GetPositionY())) // 2.
+ LoadStaticPassengers();
}
}
@@ -314,7 +322,7 @@ void Transport::UpdatePosition(float x, float y, float z, float o)
3. transport moves from active to inactive grid
4. the grid that transport is currently in unloads
*/
- if (_staticPassengers.empty() && newActive) // 1. and 2.
+ if (_staticPassengers.empty() && newActive) // 1.
LoadStaticPassengers();
else if (!_staticPassengers.empty() && !newActive && Cell(x, y).DiffGrid(Cell(GetPositionX(), GetPositionY()))) // 3.
UnloadStaticPassengers();
@@ -404,52 +412,24 @@ float Transport::CalculateSegmentPos(float now)
return segmentPos / frame.NextDistFromPrev;
}
-bool Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
+bool Transport::TeleportTransport(uint32 newMapid, float x, float y, float z, float o)
{
Map const* oldMap = GetMap();
if (oldMap->GetId() != newMapid)
{
Map* newMap = sMapMgr->CreateBaseMap(newMapid);
- Map::PlayerList const& oldPlayers = GetMap()->GetPlayers();
- if (!oldPlayers.isEmpty())
- {
- UpdateData data;
- BuildOutOfRangeUpdateBlock(&data);
- WorldPacket packet;
- data.BuildPacket(&packet);
- for (Map::PlayerList::const_iterator itr = oldPlayers.begin(); itr != oldPlayers.end(); ++itr)
- if (itr->GetSource()->GetTransport() != this)
- itr->GetSource()->SendDirectMessage(&packet);
- }
-
UnloadStaticPassengers();
GetMap()->RemoveFromMap<Transport>(this, false);
SetMap(newMap);
- Map::PlayerList const& newPlayers = GetMap()->GetPlayers();
- if (!newPlayers.isEmpty())
- {
- for (Map::PlayerList::const_iterator itr = newPlayers.begin(); itr != newPlayers.end(); ++itr)
- {
- if (itr->GetSource()->GetTransport() != this)
- {
- UpdateData data;
- BuildCreateUpdateBlockForPlayer(&data, itr->GetSource());
- WorldPacket packet;
- data.BuildPacket(&packet);
- itr->GetSource()->SendDirectMessage(&packet);
- }
- }
- }
-
for (std::set<WorldObject*>::iterator itr = _passengers.begin(); itr != _passengers.end();)
{
WorldObject* obj = (*itr++);
float destX, destY, destZ, destO;
obj->m_movementInfo.transport.pos.GetPosition(destX, destY, destZ, destO);
- TransportBase::CalculatePassengerPosition(destX, destY, destZ, &destO, x, y, z, GetOrientation());
+ TransportBase::CalculatePassengerPosition(destX, destY, destZ, &destO, x, y, z, o);
switch (obj->GetTypeId())
{
@@ -475,7 +455,7 @@ bool Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
}
}
- Relocate(x, y, z, GetOrientation());
+ Relocate(x, y, z, o);
GetMap()->AddToMap<Transport>(this);
return true;
}
@@ -488,13 +468,13 @@ bool Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
{
float destX, destY, destZ, destO;
(*itr)->m_movementInfo.transport.pos.GetPosition(destX, destY, destZ, destO);
- TransportBase::CalculatePassengerPosition(destX, destY, destZ, &destO, x, y, z, GetOrientation());
+ TransportBase::CalculatePassengerPosition(destX, destY, destZ, &destO, x, y, z, o);
(*itr)->ToUnit()->NearTeleportTo(destX, destY, destZ, destO);
}
}
- UpdatePosition(x, y, z, GetOrientation());
+ UpdatePosition(x, y, z, o);
return false;
}
}
diff --git a/src/server/game/Entities/Transport/Transport.h b/src/server/game/Entities/Transport/Transport.h
index e290a5d5e00..55f4daddecc 100644
--- a/src/server/game/Entities/Transport/Transport.h
+++ b/src/server/game/Entities/Transport/Transport.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -78,7 +78,7 @@ class Transport : public GameObject, public TransportBase
private:
void MoveToNextWaypoint();
float CalculateSegmentPos(float perc);
- bool TeleportTransport(uint32 newMapid, float x, float y, float z);
+ bool TeleportTransport(uint32 newMapid, float x, float y, float z, float o);
void UpdatePassengerPositions(std::set<WorldObject*>& passengers);
void DoEventIfAny(KeyFrame const& node, bool departure);
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
index d2b7fc6d8af..3afa6b016d2 100644
--- a/src/server/game/Entities/Unit/StatSystem.cpp
+++ b/src/server/game/Entities/Unit/StatSystem.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -48,6 +48,43 @@ inline bool _ModifyUInt32(bool apply, uint32& baseValue, int32& amount)
/*#######################################
######## ########
+######## UNIT STAT SYSTEM ########
+######## ########
+#######################################*/
+
+void Unit::UpdateAllResistances()
+{
+ for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
+ UpdateResistances(i);
+}
+
+void Unit::UpdateDamagePhysical(WeaponAttackType attType)
+{
+ float minDamage = 0.0f;
+ float maxDamage = 0.0f;
+
+ CalculateMinMaxDamage(attType, false, true, minDamage, maxDamage);
+
+ switch (attType)
+ {
+ case BASE_ATTACK:
+ default:
+ SetStatFloatValue(UNIT_FIELD_MINDAMAGE, minDamage);
+ SetStatFloatValue(UNIT_FIELD_MAXDAMAGE, maxDamage);
+ break;
+ case OFF_ATTACK:
+ SetStatFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, minDamage);
+ SetStatFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, maxDamage);
+ break;
+ case RANGED_ATTACK:
+ SetStatFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, minDamage);
+ SetStatFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, maxDamage);
+ break;
+ }
+}
+
+/*#######################################
+######## ########
######## PLAYERS STAT SYSTEM ########
######## ########
#######################################*/
@@ -178,8 +215,7 @@ bool Player::UpdateAllStats()
UpdateExpertise(BASE_ATTACK);
UpdateExpertise(OFF_ATTACK);
RecalculateRating(CR_ARMOR_PENETRATION);
- for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
- UpdateResistances(i);
+ UpdateAllResistances();
return true;
}
@@ -477,7 +513,7 @@ void Player::UpdateShieldBlockValue()
SetUInt32Value(PLAYER_SHIELD_BLOCK, GetShieldBlockValue());
}
-void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& min_damage, float& max_damage)
+void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage)
{
UnitMods unitMod;
@@ -495,70 +531,45 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo
break;
}
- float att_speed = GetAPMultiplier(attType, normalized);
+ float attackSpeedMod = GetAPMultiplier(attType, normalized);
- float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType)/ 14.0f * att_speed;
- float base_pct = GetModifierValue(unitMod, BASE_PCT);
- float total_value = GetModifierValue(unitMod, TOTAL_VALUE);
- float total_pct = addTotalPct ? GetModifierValue(unitMod, TOTAL_PCT) : 1.0f;
+ float baseValue = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType) / 14.0f * attackSpeedMod;
+ float basePct = GetModifierValue(unitMod, BASE_PCT);
+ float totalValue = GetModifierValue(unitMod, TOTAL_VALUE);
+ float totalPct = addTotalPct ? GetModifierValue(unitMod, TOTAL_PCT) : 1.0f;
- float weapon_mindamage = GetWeaponDamageRange(attType, MINDAMAGE);
- float weapon_maxdamage = GetWeaponDamageRange(attType, MAXDAMAGE);
+ float weaponMinDamage = GetWeaponDamageRange(attType, MINDAMAGE);
+ float weaponMaxDamage = GetWeaponDamageRange(attType, MAXDAMAGE);
- if (IsInFeralForm()) //check if player is druid and in cat or bear forms
+ if (IsInFeralForm()) // check if player is druid and in cat or bear forms
{
uint8 lvl = getLevel();
if (lvl > 60)
lvl = 60;
- weapon_mindamage = lvl*0.85f*att_speed;
- weapon_maxdamage = lvl*1.25f*att_speed;
+ weaponMinDamage = lvl * 0.85f * attackSpeedMod;
+ weaponMaxDamage = lvl * 1.25f * attackSpeedMod;
}
- else if (!CanUseAttackType(attType)) //check if player not in form but still can't use (disarm case)
+ else if (!CanUseAttackType(attType)) // check if player not in form but still can't use (disarm case)
{
- //cannot use ranged/off attack, set values to 0
+ // cannot use ranged/off attack, set values to 0
if (attType != BASE_ATTACK)
{
- min_damage = 0;
- max_damage = 0;
+ minDamage = 0;
+ maxDamage = 0;
return;
}
- weapon_mindamage = BASE_MINDAMAGE;
- weapon_maxdamage = BASE_MAXDAMAGE;
+ weaponMinDamage = BASE_MINDAMAGE;
+ weaponMaxDamage = BASE_MAXDAMAGE;
}
- else if (attType == RANGED_ATTACK) //add ammo DPS to ranged damage
+ else if (attType == RANGED_ATTACK) // add ammo DPS to ranged damage
{
- weapon_mindamage += GetAmmoDPS() * att_speed;
- weapon_maxdamage += GetAmmoDPS() * att_speed;
+ weaponMinDamage += GetAmmoDPS() * attackSpeedMod;
+ weaponMaxDamage += GetAmmoDPS() * attackSpeedMod;
}
- min_damage = ((base_value + weapon_mindamage) * base_pct + total_value) * total_pct;
- max_damage = ((base_value + weapon_maxdamage) * base_pct + total_value) * total_pct;
-}
-
-void Player::UpdateDamagePhysical(WeaponAttackType attType)
-{
- float mindamage;
- float maxdamage;
-
- CalculateMinMaxDamage(attType, false, true, mindamage, maxdamage);
-
- switch (attType)
- {
- case BASE_ATTACK:
- default:
- SetStatFloatValue(UNIT_FIELD_MINDAMAGE, mindamage);
- SetStatFloatValue(UNIT_FIELD_MAXDAMAGE, maxdamage);
- break;
- case OFF_ATTACK:
- SetStatFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, mindamage);
- SetStatFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, maxdamage);
- break;
- case RANGED_ATTACK:
- SetStatFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, mindamage);
- SetStatFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, maxdamage);
- break;
- }
+ minDamage = ((weaponMinDamage + baseValue) * basePct + totalValue) * totalPct;
+ maxDamage = ((weaponMaxDamage + baseValue) * basePct + totalValue) * totalPct;
}
void Player::UpdateDefenseBonusesMod()
@@ -841,9 +852,14 @@ void Player::UpdateExpertise(WeaponAttackType attack)
switch (attack)
{
- case BASE_ATTACK: SetUInt32Value(PLAYER_EXPERTISE, expertise); break;
- case OFF_ATTACK: SetUInt32Value(PLAYER_OFFHAND_EXPERTISE, expertise); break;
- default: break;
+ case BASE_ATTACK:
+ SetUInt32Value(PLAYER_EXPERTISE, expertise);
+ break;
+ case OFF_ATTACK:
+ SetUInt32Value(PLAYER_OFFHAND_EXPERTISE, expertise);
+ break;
+ default:
+ break;
}
}
@@ -950,8 +966,7 @@ bool Creature::UpdateAllStats()
for (uint8 i = POWER_MANA; i < MAX_POWERS; ++i)
UpdateMaxPower(Powers(i));
- for (int8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
- UpdateResistances(i);
+ UpdateAllResistances();
return true;
}
@@ -976,7 +991,7 @@ void Creature::UpdateArmor()
void Creature::UpdateMaxHealth()
{
float value = GetTotalAuraModValue(UNIT_MOD_HEALTH);
- SetMaxHealth((uint32)value);
+ SetMaxHealth(uint32(value));
}
void Creature::UpdateMaxPower(Powers power)
@@ -992,25 +1007,25 @@ void Creature::UpdateAttackPowerAndDamage(bool ranged)
UnitMods unitMod = ranged ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER;
uint16 index = UNIT_FIELD_ATTACK_POWER;
- uint16 index_mod = UNIT_FIELD_ATTACK_POWER_MODS;
- uint16 index_mult = UNIT_FIELD_ATTACK_POWER_MULTIPLIER;
+ uint16 indexMod = UNIT_FIELD_ATTACK_POWER_MODS;
+ uint16 indexMulti = UNIT_FIELD_ATTACK_POWER_MULTIPLIER;
if (ranged)
{
index = UNIT_FIELD_RANGED_ATTACK_POWER;
- index_mod = UNIT_FIELD_RANGED_ATTACK_POWER_MODS;
- index_mult = UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER;
+ indexMod = UNIT_FIELD_RANGED_ATTACK_POWER_MODS;
+ indexMulti = UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER;
}
- float base_attPower = GetModifierValue(unitMod, BASE_VALUE) * GetModifierValue(unitMod, BASE_PCT);
- float attPowerMod = GetModifierValue(unitMod, TOTAL_VALUE);
- float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;
+ float baseAttackPower = GetModifierValue(unitMod, BASE_VALUE) * GetModifierValue(unitMod, BASE_PCT);
+ float attackPowerMod = GetModifierValue(unitMod, TOTAL_VALUE);
+ float attackPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;
- SetInt32Value(index, (uint32)base_attPower); //UNIT_FIELD_(RANGED)_ATTACK_POWER field
- SetInt32Value(index_mod, (uint32)attPowerMod); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field
- SetFloatValue(index_mult, attPowerMultiplier); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field
+ SetInt32Value(index, uint32(baseAttackPower)); // UNIT_FIELD_(RANGED)_ATTACK_POWER
+ SetInt32Value(indexMod, uint32(attackPowerMod)); // UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS
+ SetFloatValue(indexMulti, attackPowerMultiplier); // UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER
- //automatically update weapon damage after attack power modification
+ // automatically update weapon damage after attack power modification
if (ranged)
UpdateDamagePhysical(RANGED_ATTACK);
else
@@ -1020,7 +1035,7 @@ void Creature::UpdateAttackPowerAndDamage(bool ranged)
}
}
-void Creature::UpdateDamagePhysical(WeaponAttackType attType)
+void Creature::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage)
{
UnitMods unitMod;
switch (attType)
@@ -1037,44 +1052,32 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType)
break;
}
- //float att_speed = float(GetAttackTime(attType))/1000.0f;
-
- float weapon_mindamage = GetWeaponDamageRange(attType, MINDAMAGE);
- float weapon_maxdamage = GetWeaponDamageRange(attType, MAXDAMAGE);
-
- /* difference in AP between current attack power and base value from DB */
- float att_pwr_change = GetTotalAttackPowerValue(attType) - GetCreatureTemplate()->attackpower;
- float base_value = GetModifierValue(unitMod, BASE_VALUE) + (att_pwr_change * GetAPMultiplier(attType, false) / 14.0f);
- float base_pct = GetModifierValue(unitMod, BASE_PCT);
- float total_value = GetModifierValue(unitMod, TOTAL_VALUE);
- float total_pct = GetModifierValue(unitMod, TOTAL_PCT);
- float dmg_multiplier = GetCreatureTemplate()->dmg_multiplier;
-
- if (!CanUseAttackType(attType))
+ if (attType == OFF_ATTACK && !haveOffhandWeapon())
{
- weapon_mindamage = 0;
- weapon_maxdamage = 0;
+ minDamage = 0.0f;
+ maxDamage = 0.0f;
+ return;
}
- float mindamage = ((base_value + weapon_mindamage) * dmg_multiplier * base_pct + total_value) * total_pct;
- float maxdamage = ((base_value + weapon_maxdamage) * dmg_multiplier * base_pct + total_value) * total_pct;
+ float weaponMinDamage = GetWeaponDamageRange(attType, MINDAMAGE);
+ float weaponMaxDamage = GetWeaponDamageRange(attType, MAXDAMAGE);
- switch (attType)
+ if (!CanUseAttackType(attType)) // disarm case
{
- case BASE_ATTACK:
- default:
- SetStatFloatValue(UNIT_FIELD_MINDAMAGE, mindamage);
- SetStatFloatValue(UNIT_FIELD_MAXDAMAGE, maxdamage);
- break;
- case OFF_ATTACK:
- SetStatFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, mindamage);
- SetStatFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, maxdamage);
- break;
- case RANGED_ATTACK:
- SetStatFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, mindamage);
- SetStatFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, maxdamage);
- break;
+ weaponMinDamage = 0.0f;
+ weaponMaxDamage = 0.0f;
}
+
+ float attackPower = GetTotalAttackPowerValue(attType);
+ float attackSpeedMulti = GetAPMultiplier(attType, normalized);
+ float baseValue = GetModifierValue(unitMod, BASE_VALUE) + (attackPower / 14.0f);
+ float basePct = GetModifierValue(unitMod, BASE_PCT) * attackSpeedMulti;
+ float totalValue = GetModifierValue(unitMod, TOTAL_VALUE);
+ float totalPct = addTotalPct ? GetModifierValue(unitMod, TOTAL_PCT) : 1.0f;
+ float dmgMultiplier = GetCreatureTemplate()->dmg_multiplier; // = dmg_multiplier * _GetDamageMod(rank);
+
+ minDamage = ((weaponMinDamage + baseValue) * dmgMultiplier * basePct + totalValue) * totalPct;
+ maxDamage = ((weaponMaxDamage + baseValue) * dmgMultiplier * basePct + totalValue) * totalPct;
}
/*#######################################
@@ -1197,8 +1200,7 @@ bool Guardian::UpdateAllStats()
for (uint8 i = POWER_MANA; i < MAX_POWERS; ++i)
UpdateMaxPower(Powers(i));
- for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
- UpdateResistances(i);
+ UpdateAllResistances();
return true;
}
@@ -1436,6 +1438,7 @@ void Guardian::UpdateDamagePhysical(WeaponAttackType attType)
}
}
+ /// @todo: remove this
Unit::AuraEffectList const& mDummy = GetAuraEffectsByType(SPELL_AURA_MOD_ATTACKSPEED);
for (Unit::AuraEffectList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr)
{
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 54db2da73df..3de062148e9 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -165,7 +165,7 @@ Unit::Unit(bool isWorldObject) :
IsAIEnabled(false), NeedChangeAI(false), LastCharmerGUID(0),
m_ControlledByPlayer(false), movespline(new Movement::MoveSpline()),
i_AI(NULL), i_disabledAI(NULL), m_AutoRepeatFirstCast(false), m_procDeep(0),
- m_removedAurasCount(0), i_motionMaster(this), m_ThreatManager(this),
+ m_removedAurasCount(0), i_motionMaster(new MotionMaster(this)), m_regenTimer(0), m_ThreatManager(this),
m_vehicle(NULL), m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE),
m_HostileRefManager(this), _lastDamagedTime(0)
{
@@ -258,6 +258,8 @@ Unit::Unit(bool isWorldObject) :
m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE);
_lastLiquid = NULL;
+
+ _oldFactionId = 0;
_isWalkingBeforeCharm = false;
}
@@ -293,6 +295,7 @@ Unit::~Unit()
_DeleteRemovedAuras();
+ delete i_motionMaster;
delete m_charmInfo;
delete movespline;
@@ -362,15 +365,15 @@ void Unit::Update(uint32 p_time)
}
UpdateSplineMovement(p_time);
- i_motionMaster.UpdateMotion(p_time);
+ i_motionMaster->UpdateMotion(p_time);
}
bool Unit::haveOffhandWeapon() const
{
- if (GetTypeId() == TYPEID_PLAYER)
- return ToPlayer()->GetWeaponForAttack(OFF_ATTACK, true);
- else
- return m_canDualWield;
+ if (Player const* player = ToPlayer())
+ return player->GetWeaponForAttack(OFF_ATTACK, true);
+
+ return CanDualWield();
}
void Unit::MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath, bool forceDestination)
@@ -404,7 +407,7 @@ void Unit::UpdateSplinePosition()
m_movesplineTimer.Reset(positionUpdateDelay);
Movement::Location loc = movespline->ComputePosition();
- if (HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (movespline->onTransport)
{
Position& pos = m_movementInfo.transport.pos;
pos.m_positionX = loc.x;
@@ -957,6 +960,8 @@ void Unit::CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castI
uint32 Unit::SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID);
+ if (!spellInfo)
+ return 0;
SpellNonMeleeDamage damageInfo(this, victim, spellInfo->Id, spellInfo->SchoolMask);
damage = SpellDamageBonusDone(victim, spellInfo, damage, SPELL_DIRECT_DAMAGE);
damage = victim->SpellDamageBonusTaken(this, spellInfo, damage, SPELL_DIRECT_DAMAGE);
@@ -1933,7 +1938,7 @@ void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool ext
if (attType != BASE_ATTACK && attType != OFF_ATTACK)
return; // ignore ranged case
- // melee attack spell casted at main hand attack only - no normal melee dmg dealt
+ // melee attack spell cast at main hand attack only - no normal melee dmg dealt
if (attType == BASE_ATTACK && m_currentSpells[CURRENT_MELEE_SPELL] && !extra)
m_currentSpells[CURRENT_MELEE_SPELL]->cast();
else
@@ -2157,41 +2162,39 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
uint32 Unit::CalculateDamage(WeaponAttackType attType, bool normalized, bool addTotalPct)
{
- float min_damage, max_damage;
+ float minDamage = 0.0f;
+ float maxDamage = 0.0f;
- if (GetTypeId() == TYPEID_PLAYER && (normalized || !addTotalPct))
- ToPlayer()->CalculateMinMaxDamage(attType, normalized, addTotalPct, min_damage, max_damage);
+ if (normalized || !addTotalPct)
+ CalculateMinMaxDamage(attType, normalized, addTotalPct, minDamage, maxDamage);
else
{
switch (attType)
{
case RANGED_ATTACK:
- min_damage = GetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE);
- max_damage = GetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE);
+ minDamage = GetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE);
+ maxDamage = GetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE);
break;
case BASE_ATTACK:
- min_damage = GetFloatValue(UNIT_FIELD_MINDAMAGE);
- max_damage = GetFloatValue(UNIT_FIELD_MAXDAMAGE);
+ minDamage = GetFloatValue(UNIT_FIELD_MINDAMAGE);
+ maxDamage = GetFloatValue(UNIT_FIELD_MAXDAMAGE);
break;
case OFF_ATTACK:
- min_damage = GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE);
- max_damage = GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE);
+ minDamage = GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE);
+ maxDamage = GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE);
break;
- // Just for good manner
default:
- min_damage = 0.0f;
- max_damage = 0.0f;
break;
}
}
- if (min_damage > max_damage)
- std::swap(min_damage, max_damage);
+ if (minDamage > maxDamage)
+ std::swap(minDamage, maxDamage);
- if (max_damage == 0.0f)
- max_damage = 5.0f;
+ if (maxDamage == 0.0f)
+ maxDamage = 5.0f;
- return urand((uint32)min_damage, (uint32)max_damage);
+ return urand(uint32(minDamage), uint32(maxDamage));
}
float Unit::CalculateLevelPenalty(SpellInfo const* spellProto) const
@@ -2670,7 +2673,7 @@ uint32 Unit::GetDefenseSkillValue(Unit const* target) const
float Unit::GetUnitDodgeChance() const
{
- if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED))
+ if (IsNonMeleeSpellCast(false) || HasUnitState(UNIT_STATE_CONTROLLED))
return 0.0f;
if (GetTypeId() == TYPEID_PLAYER)
@@ -2690,7 +2693,7 @@ float Unit::GetUnitDodgeChance() const
float Unit::GetUnitParryChance() const
{
- if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED))
+ if (IsNonMeleeSpellCast(false) || HasUnitState(UNIT_STATE_CONTROLLED))
return 0.0f;
float chance = 0.0f;
@@ -2736,7 +2739,7 @@ float Unit::GetUnitMissChance(WeaponAttackType attType) const
float Unit::GetUnitBlockChance() const
{
- if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED))
+ if (IsNonMeleeSpellCast(false) || HasUnitState(UNIT_STATE_CONTROLLED))
return 0.0f;
if (Player const* player = ToPlayer())
@@ -2928,7 +2931,7 @@ void Unit::_UpdateSpells(uint32 time)
void Unit::_UpdateAutoRepeatSpell()
{
// check "realtime" interrupts
- if ((GetTypeId() == TYPEID_PLAYER && ToPlayer()->isMoving()) || IsNonMeleeSpellCasted(false, false, true, m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id == 75))
+ if ((GetTypeId() == TYPEID_PLAYER && ToPlayer()->isMoving()) || IsNonMeleeSpellCast(false, false, true, m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id == 75))
{
// cancel wand shoot
if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75)
@@ -2961,7 +2964,7 @@ void Unit::_UpdateAutoRepeatSpell()
}
}
-void Unit::SetCurrentCastedSpell(Spell* pSpell)
+void Unit::SetCurrentCastSpell(Spell* pSpell)
{
ASSERT(pSpell); // NULL may be never passed here, use InterruptSpell or InterruptNonMeleeSpells
@@ -3074,16 +3077,16 @@ void Unit::FinishSpell(CurrentSpellTypes spellType, bool ok /*= true*/)
spell->finish(ok);
}
-bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skipAutorepeat, bool isAutoshoot, bool skipInstant) const
+bool Unit::IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled, bool skipAutorepeat, bool isAutoshoot, bool skipInstant) const
{
// We don't do loop here to explicitly show that melee spell is excluded.
// Maybe later some special spells will be excluded too.
- // if skipInstant then instant spells shouldn't count as being casted
+ // if skipInstant then instant spells shouldn't count as being cast
if (skipInstant && m_currentSpells[CURRENT_GENERIC_SPELL] && !m_currentSpells[CURRENT_GENERIC_SPELL]->GetCastTime())
return false;
- // generic spells are casted when they are not finished and not delayed
+ // generic spells are cast when they are not finished and not delayed
if (m_currentSpells[CURRENT_GENERIC_SPELL] &&
(m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_FINISHED) &&
(withDelayed || m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_DELAYED))
@@ -3091,14 +3094,14 @@ bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skip
if (!isAutoshoot || !(m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS))
return true;
}
- // channeled spells may be delayed, but they are still considered casted
+ // channeled spells may be delayed, but they are still considered cast
else if (!skipChanneled && m_currentSpells[CURRENT_CHANNELED_SPELL] &&
(m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED))
{
if (!isAutoshoot || !(m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS))
return true;
}
- // autorepeat spells may be finished or delayed, but they are still considered casted
+ // autorepeat spells may be finished or delayed, but they are still considered cast
else if (!skipAutorepeat && m_currentSpells[CURRENT_AUTOREPEAT_SPELL])
return true;
@@ -4829,7 +4832,7 @@ GameObject* Unit::GetGameObject(uint32 spellId) const
void Unit::AddGameObject(GameObject* gameObj)
{
- if (!gameObj || !gameObj->GetOwnerGUID() == 0)
+ if (!gameObj || gameObj->GetOwnerGUID() != 0)
return;
m_gameObj.push_back(gameObj);
@@ -5679,7 +5682,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
// Second Wind
if (dummySpell->SpellIconID == 1697)
{
- // only for spells and hit/crit (trigger start always) and not start from self casted spells (5530 Mace Stun Effect for example)
+ // only for spells and hit/crit (trigger start always) and not start from self cast spells (5530 Mace Stun Effect for example)
if (procSpell == 0 || !(procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) || this == victim)
return false;
// Need stun or root mechanic
@@ -6349,7 +6352,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
{
if (Player* member = itr->GetSource())
{
- // check if it was heal by paladin which casted this beacon of light
+ // check if it was heal by paladin which cast this beacon of light
if (member->GetAura(53563, victim->GetGUID()))
{
// do not proc when target of beacon of light is healed
@@ -7301,7 +7304,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
// Runic Power Back on Snare/Root
if (dummySpell->Id == 61257)
{
- // only for spells and hit/crit (trigger start always) and not start from self casted spells
+ // only for spells and hit/crit (trigger start always) and not start from self cast spells
if (procSpell == 0 || !(procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) || this == victim)
return false;
// Need snare or root mechanic
@@ -8023,7 +8026,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
{
if (!procSpell)
return false;
- // procspell is triggered spell but we need mana cost of original casted spell
+ // procspell is triggered spell but we need mana cost of original cast spell
uint32 originalSpellId = procSpell->Id;
// Holy Shock heal
if (procSpell->SpellFamilyFlags[1] & 0x00010000)
@@ -9047,7 +9050,7 @@ bool Unit::AttackStop()
void Unit::CombatStop(bool includingCast)
{
- if (includingCast && IsNonMeleeSpellCasted(false))
+ if (includingCast && IsNonMeleeSpellCast(false))
InterruptNonMeleeSpells(false);
AttackStop();
@@ -9218,17 +9221,17 @@ void Unit::SetOwnerGUID(uint64 owner)
Unit* Unit::GetOwner() const
{
- if (uint64 ownerid = GetOwnerGUID())
- {
- return ObjectAccessor::GetUnit(*this, ownerid);
- }
+ if (uint64 ownerGUID = GetOwnerGUID())
+ return ObjectAccessor::GetUnit(*this, ownerGUID);
+
return NULL;
}
Unit* Unit::GetCharmer() const
{
- if (uint64 charmerid = GetCharmerGUID())
- return ObjectAccessor::GetUnit(*this, charmerid);
+ if (uint64 charmerGUID = GetCharmerGUID())
+ return ObjectAccessor::GetUnit(*this, charmerGUID);
+
return NULL;
}
@@ -9564,8 +9567,8 @@ void Unit::SetCharm(Unit* charm, bool apply)
}
if (charm->GetTypeId() == TYPEID_PLAYER
- || !charm->ToCreature()->HasUnitTypeMask(UNIT_MASK_MINION)
- || charm->GetOwnerGUID() != GetGUID())
+ || !charm->ToCreature()->HasUnitTypeMask(UNIT_MASK_MINION)
+ || charm->GetOwnerGUID() != GetGUID())
{
m_Controlled.erase(charm);
}
@@ -9602,7 +9605,7 @@ int32 Unit::DealHeal(Unit* victim, uint32 addhealth)
if (gain)
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, gain, 0, victim);
- player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED, addhealth);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CAST, addhealth);
}
if (Player* player = victim->ToPlayer())
@@ -11625,7 +11628,7 @@ bool Unit::IsServiceProvider() const
void Unit::SetInCombatWith(Unit* enemy)
{
Unit* eOwner = enemy->GetCharmerOrOwnerOrSelf();
- if (eOwner->IsPvP())
+ if (eOwner->IsPvP() || eOwner->IsFFAPvP())
{
SetInCombatState(true, enemy);
return;
@@ -12391,6 +12394,9 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
void Unit::setDeathState(DeathState s)
{
+ // Death state needs to be updated before RemoveAllAurasOnDeath() is called, to prevent entering combat
+ m_deathState = s;
+
if (s != ALIVE && s != JUST_RESPAWNED)
{
CombatStop();
@@ -12398,7 +12404,7 @@ void Unit::setDeathState(DeathState s)
getHostileRefManager().deleteReferences();
ClearComboPointHolders(); // any combo points pointed to unit lost at it death
- if (IsNonMeleeSpellCasted(false))
+ if (IsNonMeleeSpellCast(false))
InterruptNonMeleeSpells(false);
ExitVehicle(); // Exit vehicle before calling RemoveAllControlled
@@ -12439,8 +12445,6 @@ void Unit::setDeathState(DeathState s)
}
else if (s == JUST_RESPAWNED)
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground)
-
- m_deathState = s;
}
/*########################################
@@ -12448,14 +12452,14 @@ void Unit::setDeathState(DeathState s)
######## AGGRO SYSTEM ########
######## ########
########################################*/
-bool Unit::CanHaveThreatList() const
+bool Unit::CanHaveThreatList(bool skipAliveCheck) const
{
// only creatures can have threat list
if (GetTypeId() != TYPEID_UNIT)
return false;
// only alive units can have threat list
- if (!IsAlive() || isDying())
+ if (!skipAliveCheck && !IsAlive())
return false;
// totems can not have threat list
@@ -12498,7 +12502,7 @@ void Unit::AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask, Sp
void Unit::DeleteThreatList()
{
- if (CanHaveThreatList() && !m_ThreatManager.isThreatListEmpty())
+ if (CanHaveThreatList(true) && !m_ThreatManager.isThreatListEmpty())
SendClearThreatListOpcode();
m_ThreatManager.clearReferences();
}
@@ -12819,7 +12823,7 @@ int32 Unit::ModSpellDuration(SpellInfo const* spellProto, Unit const* target, in
}
}
- // Glyphs which increase duration of selfcasted buffs
+ // Glyphs which increase duration of selfcast buffs
if (target == this)
{
switch (spellProto->SpellFamilyName)
@@ -12880,7 +12884,7 @@ DiminishingLevels Unit::GetDiminishing(DiminishingGroup group)
if (!i->hitTime)
return DIMINISHING_LEVEL_1;
- // If last spell was casted more than 15 seconds ago - reset the count.
+ // If last spell was cast more than 15 seconds ago - reset the count.
if (i->stack == 0 && getMSTimeDiff(i->hitTime, getMSTime()) > 15000)
{
i->hitCount = DIMINISHING_LEVEL_1;
@@ -13491,7 +13495,7 @@ void Unit::CleanupBeforeRemoveFromMap(bool finalCleanup)
if (finalCleanup)
m_cleanupDone = true;
- m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList
+ m_Events.KillAllEvents(false); // non-delatable (currently cast spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList
CombatStop();
ClearComboPointHolders();
DeleteThreatList();
@@ -13557,8 +13561,8 @@ void Unit::DeleteCharmInfo()
}
CharmInfo::CharmInfo(Unit* unit)
-: _unit(unit), _CommandState(COMMAND_FOLLOW), _petnumber(0), _barInit(false),
- _isCommandAttack(false), _isAtStay(false), _isFollowing(false), _isReturning(false),
+: _unit(unit), _CommandState(COMMAND_FOLLOW), _petnumber(0), _barInit(false), _oldReactState(REACT_PASSIVE),
+ _isCommandAttack(false), _isCommandFollow(false), _isAtStay(false), _isFollowing(false), _isReturning(false),
_stayX(0.0f), _stayY(0.0f), _stayZ(0.0f)
{
for (uint8 i = 0; i < MAX_SPELL_CHARM; ++i)
@@ -13575,9 +13579,8 @@ CharmInfo::~CharmInfo() { }
void CharmInfo::RestoreState()
{
- if (_unit->GetTypeId() == TYPEID_UNIT)
- if (Creature* creature = _unit->ToCreature())
- creature->SetReactState(_oldReactState);
+ if (Creature* creature = _unit->ToCreature())
+ creature->SetReactState(_oldReactState);
}
void CharmInfo::InitPetActionBar()
@@ -13607,9 +13610,22 @@ void CharmInfo::InitEmptyActionBar(bool withAttack)
void CharmInfo::InitPossessCreateSpells()
{
- InitEmptyActionBar();
if (_unit->GetTypeId() == TYPEID_UNIT)
{
+ // Adding switch until better way is found. Malcrom
+ // Adding entrys to this switch will prevent COMMAND_ATTACK being added to pet bar.
+ switch (_unit->GetEntry())
+ {
+ case 23575: // Mindless Abomination
+ case 24783: // Trained Rock Falcon
+ case 27664: // Crashin' Thrashin' Racer
+ case 40281: // Crashin' Thrashin' Racer
+ break;
+ default:
+ InitEmptyActionBar();
+ break;
+ }
+
for (uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
{
uint32 spellId = _unit->ToCreature()->m_spells[i];
@@ -13623,6 +13639,8 @@ void CharmInfo::InitPossessCreateSpells()
}
}
}
+ else
+ InitEmptyActionBar();
}
void CharmInfo::InitCharmCreateSpells()
@@ -14633,7 +14651,7 @@ void Unit::ApplyCastTimePercentMod(float val, bool apply)
uint32 Unit::GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const
{
- // Not apply this to creature casted spells with casttime == 0
+ // Not apply this to creature cast spells with casttime == 0
if (CastingTime == 0 && GetTypeId() == TYPEID_UNIT && !ToCreature()->IsPet())
return 3500;
@@ -15507,7 +15525,7 @@ void Unit::SetStunned(bool apply)
// Creature specific
if (GetTypeId() != TYPEID_PLAYER)
- ToCreature()->StopMoving();
+ StopMoving();
else
SetStandState(UNIT_STAND_STATE_STAND);
@@ -15565,7 +15583,7 @@ void Unit::SetRooted(bool apply)
WorldPacket data(SMSG_SPLINE_MOVE_ROOT, 8);
data.append(GetPackGUID());
SendMessageToSet(&data, true);
- ToCreature()->StopMoving();
+ StopMoving();
}
}
else
@@ -15616,8 +15634,8 @@ void Unit::SetFeared(bool apply)
}
}
- if (GetTypeId() == TYPEID_PLAYER)
- ToPlayer()->SetClientControl(this, !apply);
+ if (Player* player = ToPlayer())
+ player->SetClientControl(this, !apply);
}
void Unit::SetConfused(bool apply)
@@ -15638,8 +15656,8 @@ void Unit::SetConfused(bool apply)
}
}
- if (GetTypeId() == TYPEID_PLAYER)
- ToPlayer()->SetClientControl(this, !apply);
+ if (Player* player = ToPlayer())
+ player->SetClientControl(this, !apply);
}
bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* aurApp)
@@ -15685,11 +15703,13 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
CombatStop(); /// @todo CombatStop(true) may cause crash (interrupt spells)
DeleteThreatList();
+ Player* playerCharmer = charmer->ToPlayer();
+
// Charmer stop charming
- if (charmer->GetTypeId() == TYPEID_PLAYER)
+ if (playerCharmer)
{
- charmer->ToPlayer()->StopCastingCharm();
- charmer->ToPlayer()->StopCastingBindSight();
+ playerCharmer->StopCastingCharm();
+ playerCharmer->StopCastingBindSight();
}
// Charmed stop charming
@@ -15711,11 +15731,10 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
if (aurApp && aurApp->GetRemoveMode())
return false;
- // Set charmed
- Map* map = GetMap();
- if (!IsVehicle() || (IsVehicle() && map && !map->IsBattleground()))
- setFaction(charmer->getFaction());
+ _oldFactionId = getFaction();
+ setFaction(charmer->getFaction());
+ // Set charmed
charmer->SetCharm(this, true);
if (GetTypeId() == TYPEID_UNIT)
@@ -15728,7 +15747,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
Player* player = ToPlayer();
if (player->isAFK())
player->ToggleAFK();
- player->SetClientControl(this, 0);
+ player->SetClientControl(this, false);
}
// charm is set by aura, and aura effect remove handler was called during apply handler execution
@@ -15746,25 +15765,21 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
GetCharmInfo()->InitCharmCreateSpells();
}
- if (charmer->GetTypeId() == TYPEID_PLAYER)
+ if (playerCharmer)
{
switch (type)
{
case CHARM_TYPE_VEHICLE:
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
- charmer->ToPlayer()->SetClientControl(this, 1);
- charmer->ToPlayer()->SetMover(this);
- charmer->ToPlayer()->SetViewpoint(this, true);
- charmer->ToPlayer()->VehicleSpellInitialize();
+ playerCharmer->SetClientControl(this, true);
+ playerCharmer->VehicleSpellInitialize();
break;
case CHARM_TYPE_POSSESS:
AddUnitState(UNIT_STATE_POSSESSED);
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
charmer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- charmer->ToPlayer()->SetClientControl(this, 1);
- charmer->ToPlayer()->SetMover(this);
- charmer->ToPlayer()->SetViewpoint(this, true);
- charmer->ToPlayer()->PossessSpellInitialize();
+ playerCharmer->SetClientControl(this, true);
+ playerCharmer->PossessSpellInitialize();
break;
case CHARM_TYPE_CHARM:
if (GetTypeId() == TYPEID_UNIT && charmer->getClass() == CLASS_WARLOCK)
@@ -15783,7 +15798,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped
}
}
- charmer->ToPlayer()->CharmSpellInitialize();
+ playerCharmer->CharmSpellInitialize();
break;
default:
case CHARM_TYPE_CONVERT:
@@ -15820,16 +15835,16 @@ void Unit::RemoveCharmedBy(Unit* charmer)
CombatStop(); /// @todo CombatStop(true) may cause crash (interrupt spells)
getHostileRefManager().deleteReferences();
DeleteThreatList();
- Map* map = GetMap();
- if (!IsVehicle() || (IsVehicle() && map && !map->IsBattleground()))
- RestoreFaction();
- GetMotionMaster()->InitDefault();
- if (type == CHARM_TYPE_POSSESS)
+ if (_oldFactionId)
{
- ClearUnitState(UNIT_STATE_POSSESSED);
- RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
+ setFaction(_oldFactionId);
+ _oldFactionId = 0;
}
+ else
+ RestoreFaction();
+
+ GetMotionMaster()->InitDefault();
if (Creature* creature = ToCreature())
{
@@ -15841,8 +15856,6 @@ void Unit::RemoveCharmedBy(Unit* charmer)
if (type != CHARM_TYPE_VEHICLE)
LastCharmerGUID = charmer->GetGUID();
}
- else
- ToPlayer()->SetClientControl(this, 1);
// If charmer still exists
if (!charmer)
@@ -15853,24 +15866,23 @@ void Unit::RemoveCharmedBy(Unit* charmer)
charmer->SetCharm(this, false);
- if (charmer->GetTypeId() == TYPEID_PLAYER)
+ Player* playerCharmer = charmer->ToPlayer();
+
+ if (playerCharmer)
{
switch (type)
{
case CHARM_TYPE_VEHICLE:
- charmer->ToPlayer()->SetClientControl(charmer, 1);
- charmer->ToPlayer()->SetViewpoint(this, false);
- charmer->ToPlayer()->SetClientControl(this, 0);
- if (GetTypeId() == TYPEID_PLAYER)
- ToPlayer()->SetMover(this);
+ playerCharmer->SetClientControl(this, false);
+ playerCharmer->SetClientControl(charmer, true);
+ RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
break;
case CHARM_TYPE_POSSESS:
- charmer->ToPlayer()->SetClientControl(charmer, 1);
- charmer->ToPlayer()->SetViewpoint(this, false);
- charmer->ToPlayer()->SetClientControl(this, 0);
+ playerCharmer->SetClientControl(this, false);
+ playerCharmer->SetClientControl(charmer, true);
charmer->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- if (GetTypeId() == TYPEID_PLAYER)
- ToPlayer()->SetMover(this);
+ RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
+ ClearUnitState(UNIT_STATE_POSSESSED);
break;
case CHARM_TYPE_CHARM:
if (GetTypeId() == TYPEID_UNIT && charmer->getClass() == CLASS_WARLOCK)
@@ -15886,15 +15898,17 @@ void Unit::RemoveCharmedBy(Unit* charmer)
}
}
break;
- default:
case CHARM_TYPE_CONVERT:
break;
}
}
+ if (Player* player = ToPlayer())
+ player->SetClientControl(this, true);
+
// a guardian should always have charminfo
- if (charmer->GetTypeId() == TYPEID_PLAYER && this != charmer->GetFirstControlled())
- charmer->ToPlayer()->SendRemoveControlBar();
+ if (playerCharmer && this != charmer->GetFirstControlled())
+ playerCharmer->SendRemoveControlBar();
else if (GetTypeId() == TYPEID_PLAYER || (GetTypeId() == TYPEID_UNIT && !ToCreature()->IsGuardian()))
DeleteCharmInfo();
}
@@ -15951,8 +15965,7 @@ void Unit::RemoveVehicleKit()
m_updateFlag &= ~UPDATEFLAG_VEHICLE;
m_unitTypeMask &= ~UNIT_MASK_VEHICLE;
- RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
- RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_PLAYER_VEHICLE);
+ RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK | UNIT_NPC_FLAG_PLAYER_VEHICLE);
}
bool Unit::IsOnVehicle(const Unit* vehicle) const
@@ -17156,7 +17169,7 @@ void Unit::StopAttackFaction(uint32 faction_id)
if (victim->GetFactionTemplateEntry()->faction == faction_id)
{
AttackStop();
- if (IsNonMeleeSpellCasted(false))
+ if (IsNonMeleeSpellCast(false))
InterruptNonMeleeSpells(false);
// melee and ranged forced attack cancel
@@ -17187,7 +17200,7 @@ void Unit::OutDebugInfo() const
{
TC_LOG_ERROR("entities.unit", "Unit::OutDebugInfo");
TC_LOG_INFO("entities.unit", "GUID " UI64FMTD ", entry %u, type %u, name %s", GetGUID(), GetEntry(), (uint32)GetTypeId(), GetName().c_str());
- TC_LOG_INFO("entities.unit", "OwnerGUID " UI64FMTD ", MinionGUID " UI64FMTD ", CharmerGUID " UI64FMTD ", CharmedGUID "UI64FMTD, GetOwnerGUID(), GetMinionGUID(), GetCharmerGUID(), GetCharmGUID());
+ TC_LOG_INFO("entities.unit", "OwnerGUID " UI64FMTD ", MinionGUID " UI64FMTD ", CharmerGUID " UI64FMTD ", CharmedGUID " UI64FMTD, GetOwnerGUID(), GetMinionGUID(), GetCharmerGUID(), GetCharmGUID());
TC_LOG_INFO("entities.unit", "In world %u, unit type mask %u", (uint32)(IsInWorld() ? 1 : 0), m_unitTypeMask);
if (IsInWorld())
TC_LOG_INFO("entities.unit", "Mapid %u", GetMapId());
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 84c687a2cce..151f20d09f9 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -1292,7 +1292,7 @@ class Unit : public WorldObject
bool isAttackReady(WeaponAttackType type = BASE_ATTACK) const { return m_attackTimer[type] == 0; }
bool haveOffhandWeapon() const;
bool CanDualWield() const { return m_canDualWield; }
- void SetCanDualWield(bool value) { m_canDualWield = value; }
+ virtual void SetCanDualWield(bool value) { m_canDualWield = value; }
float GetCombatReach() const { return m_floatValues[UNIT_FIELD_COMBATREACH]; }
float GetMeleeReach() const;
bool IsWithinCombatRange(const Unit* obj, float dist2compare) const;
@@ -1404,6 +1404,7 @@ class Unit : public WorldObject
void GetPartyMembers(std::list<Unit*> &units);
bool IsContestedGuard() const;
bool IsPvP() const { return HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP); }
+ bool IsFFAPvP() const { return HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); }
void SetPvP(bool state);
uint32 GetCreatureType() const;
uint32 GetCreatureTypeMask() const;
@@ -1816,15 +1817,15 @@ class Unit : public WorldObject
float GetNegStat(Stats stat) const { return GetFloatValue(UNIT_FIELD_NEGSTAT0+stat); }
float GetCreateStat(Stats stat) const { return m_createStats[stat]; }
- void SetCurrentCastedSpell(Spell* pSpell);
+ void SetCurrentCastSpell(Spell* pSpell);
virtual void ProhibitSpellSchool(SpellSchoolMask /*idSchoolMask*/, uint32 /*unTimeMs*/) { }
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed = true, bool withInstant = true);
void FinishSpell(CurrentSpellTypes spellType, bool ok = true);
- // set withDelayed to true to account delayed spells as casted
- // delayed+channeled spells are always accounted as casted
+ // set withDelayed to true to account delayed spells as cast
+ // delayed+channeled spells are always accounted as cast
// we can skip channeled or delayed checks using flags
- bool IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled = false, bool skipAutorepeat = false, bool isAutoshoot = false, bool skipInstant = true) const;
+ bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled = false, bool skipAutorepeat = false, bool isAutoshoot = false, bool skipInstant = true) const;
// set withDelayed to true to interrupt delayed spells too
// delayed+channeled spells are always interrupted
@@ -1870,14 +1871,18 @@ class Unit : public WorldObject
virtual bool UpdateStats(Stats stat) = 0;
virtual bool UpdateAllStats() = 0;
virtual void UpdateResistances(uint32 school) = 0;
+ virtual void UpdateAllResistances();
virtual void UpdateArmor() = 0;
virtual void UpdateMaxHealth() = 0;
virtual void UpdateMaxPower(Powers power) = 0;
virtual void UpdateAttackPowerAndDamage(bool ranged = false) = 0;
- virtual void UpdateDamagePhysical(WeaponAttackType attType) = 0;
+ virtual void UpdateDamagePhysical(WeaponAttackType attType);
float GetTotalAttackPowerValue(WeaponAttackType attType) const;
float GetWeaponDamageRange(WeaponAttackType attType, WeaponDamageRange type) const;
void SetBaseWeaponDamage(WeaponAttackType attType, WeaponDamageRange damageRange, float value) { m_weaponDamage[attType][damageRange] = value; }
+ virtual void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage) = 0;
+ uint32 CalculateDamage(WeaponAttackType attType, bool normalized, bool addTotalPct);
+ float GetAPMultiplier(WeaponAttackType attType, bool normalized);
bool isInFrontInMap(Unit const* target, float distance, float arc = M_PI) const;
bool isInBackInMap(Unit const* target, float distance, float arc = M_PI) const;
@@ -1894,7 +1899,7 @@ class Unit : public WorldObject
uint32 m_lastSanctuaryTime;
// Threat related methods
- bool CanHaveThreatList() const;
+ bool CanHaveThreatList(bool skipAliveCheck = false) const;
void AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL);
float ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL);
void DeleteThreatList();
@@ -1935,8 +1940,6 @@ class Unit : public WorldObject
void RemoveGameObject(uint32 spellid, bool del);
void RemoveAllGameObjects();
- uint32 CalculateDamage(WeaponAttackType attType, bool normalized, bool addTotalPct);
- float GetAPMultiplier(WeaponAttackType attType, bool normalized);
void ModifyAuraState(AuraStateType flag, bool apply);
uint32 BuildAuraStateUpdateForTarget(Unit* target) const;
bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = NULL) const;
@@ -1956,7 +1959,6 @@ class Unit : public WorldObject
uint32 MeleeDamageBonusDone(Unit* pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const* spellProto = NULL);
uint32 MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const* spellProto = NULL);
-
bool isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType = BASE_ATTACK);
bool isBlockCritical();
bool isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK) const;
@@ -2005,8 +2007,8 @@ class Unit : public WorldObject
static Player* GetPlayer(WorldObject& object, uint64 guid);
static Creature* GetCreature(WorldObject& object, uint64 guid);
- MotionMaster* GetMotionMaster() { return &i_motionMaster; }
- const MotionMaster* GetMotionMaster() const { return &i_motionMaster; }
+ MotionMaster* GetMotionMaster() { return i_motionMaster; }
+ const MotionMaster* GetMotionMaster() const { return i_motionMaster; }
bool IsStopped() const { return !(HasUnitState(UNIT_STATE_MOVING)); }
void StopMoving();
@@ -2170,8 +2172,8 @@ class Unit : public WorldObject
uint32 m_removedAurasCount;
AuraEffectList m_modAuras[TOTAL_AURAS];
- AuraList m_scAuras; // casted singlecast auras
- AuraApplicationList m_interruptableAuras; // auras which have interrupt mask applied on unit
+ AuraList m_scAuras; // cast singlecast auras
+ AuraApplicationList m_interruptableAuras; // auras which have interrupt mask applied on unit
AuraStateAurasMap m_auraStateAuras; // Used for improve performance of aura state checks on aura apply/remove
uint32 m_interruptMask;
@@ -2187,7 +2189,7 @@ class Unit : public WorldObject
virtual SpellSchoolMask GetMeleeDamageSchoolMask() const;
- MotionMaster i_motionMaster;
+ MotionMaster* i_motionMaster;
uint32 m_reactiveTimer[MAX_REACTIVE];
uint32 m_regenTimer;
@@ -2245,7 +2247,8 @@ class Unit : public WorldObject
bool m_cleanupDone; // lock made to not add stuff after cleanup before delete
bool m_duringRemoveFromWorld; // lock made to not add stuff after begining removing from world
- bool _isWalkingBeforeCharm; // Are we walking before we were charmed?
+ uint32 _oldFactionId; ///< faction before charm
+ bool _isWalkingBeforeCharm; ///< Are we walking before we were charmed?
time_t _lastDamagedTime; // Part of Evade mechanics
};
@@ -2256,31 +2259,31 @@ namespace Trinity
class PowerPctOrderPred
{
public:
- PowerPctOrderPred(Powers power, bool ascending = true) : m_power(power), m_ascending(ascending) { }
- bool operator() (const Unit* a, const Unit* b) const
+ PowerPctOrderPred(Powers power, bool ascending = true) : _power(power), _ascending(ascending) { }
+ bool operator() (Unit const* a, Unit const* b) const
{
- float rA = a->GetMaxPower(m_power) ? float(a->GetPower(m_power)) / float(a->GetMaxPower(m_power)) : 0.0f;
- float rB = b->GetMaxPower(m_power) ? float(b->GetPower(m_power)) / float(b->GetMaxPower(m_power)) : 0.0f;
- return m_ascending ? rA < rB : rA > rB;
+ float rA = a->GetMaxPower(_power) ? float(a->GetPower(_power)) / float(a->GetMaxPower(_power)) : 0.0f;
+ float rB = b->GetMaxPower(_power) ? float(b->GetPower(_power)) / float(b->GetMaxPower(_power)) : 0.0f;
+ return _ascending ? rA < rB : rA > rB;
}
private:
- const Powers m_power;
- const bool m_ascending;
+ Powers const _power;
+ bool const _ascending;
};
// Binary predicate for sorting Units based on percent value of health
class HealthPctOrderPred
{
public:
- HealthPctOrderPred(bool ascending = true) : m_ascending(ascending) { }
- bool operator() (const Unit* a, const Unit* b) const
+ HealthPctOrderPred(bool ascending = true) : _ascending(ascending) { }
+ bool operator() (Unit const* a, Unit const* b) const
{
float rA = a->GetMaxHealth() ? float(a->GetHealth()) / float(a->GetMaxHealth()) : 0.0f;
float rB = b->GetMaxHealth() ? float(b->GetHealth()) / float(b->GetMaxHealth()) : 0.0f;
- return m_ascending ? rA < rB : rA > rB;
+ return _ascending ? rA < rB : rA > rB;
}
private:
- const bool m_ascending;
+ bool const _ascending;
};
}
#endif
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp
index d5ab2057d81..fae4f0c6b6a 100755
--- a/src/server/game/Entities/Vehicle/Vehicle.cpp
+++ b/src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
#include "Battleground.h"
Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) :
-UsableSeatNum(0), _me(unit), _vehicleInfo(vehInfo), _creatureEntry(creatureEntry), _status(STATUS_NONE)
+UsableSeatNum(0), _me(unit), _vehicleInfo(vehInfo), _creatureEntry(creatureEntry), _status(STATUS_NONE), _lastShootPos()
{
for (uint32 i = 0; i < MAX_VEHICLE_SEATS; ++i)
{
@@ -521,8 +521,13 @@ Vehicle* Vehicle::RemovePassenger(Unit* unit)
if (_me->IsInWorld())
{
- unit->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- unit->m_movementInfo.transport.Reset();
+ if (!_me->GetTransport())
+ {
+ unit->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ unit->m_movementInfo.transport.Reset();
+ }
+ else
+ unit->m_movementInfo.transport = _me->m_movementInfo.transport;
}
// only for flyable vehicles
diff --git a/src/server/game/Entities/Vehicle/Vehicle.h b/src/server/game/Entities/Vehicle/Vehicle.h
index 7dc9c36ecef..36119fa0027 100644
--- a/src/server/game/Entities/Vehicle/Vehicle.h
+++ b/src/server/game/Entities/Vehicle/Vehicle.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Entities/Vehicle/VehicleDefines.h b/src/server/game/Entities/Vehicle/VehicleDefines.h
index 0290ecf7859..4acd1fe209a 100644
--- a/src/server/game/Entities/Vehicle/VehicleDefines.h
+++ b/src/server/game/Entities/Vehicle/VehicleDefines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp
index b0428de6e28..95d4c7e2503 100644
--- a/src/server/game/Events/GameEventMgr.cpp
+++ b/src/server/game/Events/GameEventMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -1180,7 +1180,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
// We use spawn coords to spawn
if (!map->Instanceable() && map->IsGridLoaded(data->posX, data->posY))
{
- Creature* creature = new Creature;
+ Creature* creature = new Creature();
//TC_LOG_DEBUG("misc", "Spawning creature %u", *itr);
if (!creature->LoadCreatureFromDB(*itr, map))
delete creature;
diff --git a/src/server/game/Events/GameEventMgr.h b/src/server/game/Events/GameEventMgr.h
index d25da0db89d..ea6f9359ea3 100644
--- a/src/server/game/Events/GameEventMgr.h
+++ b/src/server/game/Events/GameEventMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -55,7 +55,8 @@ typedef std::map<uint32 /*condition id*/, GameEventFinishCondition> GameEventCon
struct GameEventData
{
- GameEventData() : start(1), end(0), nextstart(0), occurence(0), length(0), holiday_id(HOLIDAY_NONE), state(GAMEEVENT_NORMAL) { }
+ GameEventData() : start(1), end(0), nextstart(0), occurence(0), length(0), holiday_id(HOLIDAY_NONE), state(GAMEEVENT_NORMAL),
+ announce(0) { }
time_t start; // occurs after this time
time_t end; // occurs before this time
time_t nextstart; // after this time the follow-up events count this phase completed
diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp
index cf1a813d287..ca173865570 100644
--- a/src/server/game/Globals/ObjectAccessor.cpp
+++ b/src/server/game/Globals/ObjectAccessor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Globals/ObjectAccessor.h b/src/server/game/Globals/ObjectAccessor.h
index 4e5c12104ed..4943c648b93 100644
--- a/src/server/game/Globals/ObjectAccessor.h
+++ b/src/server/game/Globals/ObjectAccessor.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 3d56225bc00..04f3395653d 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -638,6 +638,24 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
if (!ok2)
continue;
+ if (cInfo->expansion > difficultyInfo->expansion)
+ {
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, expansion %u) has different `expansion` in difficulty %u mode (Entry: %u, expansion %u).",
+ cInfo->Entry, cInfo->expansion, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->expansion);
+ }
+
+ if (cInfo->faction_A != difficultyInfo->faction_A)
+ {
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, faction_A %u) has different `faction_A` in difficulty %u mode (Entry: %u, faction_A %u).",
+ cInfo->Entry, cInfo->faction_A, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->faction_A);
+ }
+
+ if (cInfo->faction_H != difficultyInfo->faction_H)
+ {
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, faction_H %u) has different `faction_H` in difficulty %u mode (Entry: %u, faction_H %u).",
+ cInfo->Entry, cInfo->faction_H, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->faction_H);
+ }
+
if (cInfo->unit_class != difficultyInfo->unit_class)
{
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, class %u) has different `unit_class` in difficulty %u mode (Entry: %u, class %u).",
@@ -651,6 +669,12 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
continue;
}
+ if (cInfo->family != difficultyInfo->family)
+ {
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, family %u) has different `family` in difficulty %u mode (Entry: %u, family %u).",
+ cInfo->Entry, cInfo->family, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->family);
+ }
+
if (cInfo->trainer_class != difficultyInfo->trainer_class)
{
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has different `trainer_class` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
@@ -675,6 +699,24 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
continue;
}
+ if (cInfo->type != difficultyInfo->type)
+ {
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, type %u) has different `type` in difficulty %u mode (Entry: %u, type %u).",
+ cInfo->Entry, cInfo->type, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->type);
+ }
+
+ if (cInfo->type_flags != difficultyInfo->type_flags)
+ {
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, type_flags %u) has different `type_flags` in difficulty %u mode (Entry: %u, type_flags %u).",
+ cInfo->Entry, cInfo->type_flags, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->type_flags);
+ }
+
+ if (!cInfo->VehicleId && difficultyInfo->VehicleId)
+ {
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, VehicleId %u) has different `VehicleId` in difficulty %u mode (Entry: %u, VehicleId %u).",
+ cInfo->Entry, cInfo->VehicleId, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->VehicleId);
+ }
+
if (!difficultyInfo->AIName.empty())
{
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) lists difficulty %u mode entry %u with `AIName` filled in. `AIName` of difficulty 0 mode creature is always used instead.",
@@ -883,7 +925,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
const_cast<CreatureTemplate*>(cInfo)->scale = 1.0f;
}
- if (cInfo->expansion > (MAX_CREATURE_BASE_HP - 1))
+ if (cInfo->expansion > (MAX_EXPANSIONS - 1))
{
TC_LOG_ERROR("sql.sql", "Table `creature_template` lists creature (Entry: %u) with expansion %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansion);
const_cast<CreatureTemplate*>(cInfo)->expansion = 0;
@@ -1601,7 +1643,8 @@ void ObjectMgr::LoadCreatures()
continue;
}
- if (data.spawnMask & ~spawnMasks[data.mapid])
+ // Skip spawnMask check for transport maps
+ if (!_transportMaps.count(data.mapid) && data.spawnMask & ~spawnMasks[data.mapid])
TC_LOG_ERROR("sql.sql", "Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u).", guid, data.spawnMask, data.mapid);
bool ok = true;
@@ -1771,7 +1814,7 @@ bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, const Position& pos)
// We use spawn coords to spawn
if (!map->Instanceable() && map->IsGridLoaded(data.posX, data.posY))
{
- Creature* creature = new Creature;
+ Creature* creature = new Creature();
if (!creature->LoadCreatureFromDB(guid, map))
{
TC_LOG_ERROR("misc", "MoveCreData: Cannot add creature guid %u to map", guid);
@@ -1823,7 +1866,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float
// We use spawn coords to spawn
if (!map->Instanceable() && !map->IsRemovalGrid(x, y))
{
- Creature* creature = new Creature;
+ Creature* creature = new Creature();
if (!creature->LoadCreatureFromDB(guid, map))
{
TC_LOG_ERROR("misc", "AddCreature: Cannot add creature entry %u to map", entry);
@@ -1936,7 +1979,7 @@ void ObjectMgr::LoadGameobjects()
data.spawnMask = fields[14].GetUInt8();
- if (data.spawnMask & ~spawnMasks[data.mapid])
+ if (!_transportMaps.count(data.mapid) && data.spawnMask & ~spawnMasks[data.mapid])
TC_LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including not supported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid);
data.phaseMask = fields[15].GetUInt32();
@@ -3043,8 +3086,8 @@ void ObjectMgr::LoadPetLevelInfo()
{
if (pInfo[level].health == 0)
{
- TC_LOG_ERROR("sql.sql", "Creature %u has no data for Level %i pet stats data, using data of Level %i.", itr->first, level+1, level);
- pInfo[level] = pInfo[level-1];
+ TC_LOG_ERROR("sql.sql", "Creature %u has no data for Level %i pet stats data, using data of Level %i.", itr->first, level + 1, level);
+ pInfo[level] = pInfo[level - 1];
}
}
}
@@ -3265,7 +3308,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
- TC_LOG_ERROR("server.loading", ">> Loaded 0 player create spells. DB table `%s` is empty.", sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS) ? "playercreateinfo_spell_custom" : "playercreateinfo_spell");
+ TC_LOG_ERROR("server.loading", ">> Loaded 0 player create spells. DB table `%s` is empty.", tableName.c_str());
}
else
{
@@ -3280,13 +3323,13 @@ void ObjectMgr::LoadPlayerInfo()
if (raceMask != 0 && !(raceMask & RACEMASK_ALL_PLAYABLE))
{
- TC_LOG_ERROR("sql.sql", "Wrong race mask %u in `playercreateinfo_spell` table, ignoring.", raceMask);
+ TC_LOG_ERROR("sql.sql", "Wrong race mask %u in `%s` table, ignoring.", raceMask, tableName.c_str());
continue;
}
if (classMask != 0 && !(classMask & CLASSMASK_ALL_PLAYABLE))
{
- TC_LOG_ERROR("sql.sql", "Wrong class mask %u in `playercreateinfo_spell` table, ignoring.", classMask);
+ TC_LOG_ERROR("sql.sql", "Wrong class mask %u in `%s` table, ignoring.", classMask, tableName.c_str());
continue;
}
@@ -3306,7 +3349,7 @@ void ObjectMgr::LoadPlayerInfo()
// We need something better here, the check is not accounting for spells used by multiple races/classes but not all of them.
// Either split the masks per class, or per race, which kind of kills the point yet.
// else if (raceMask != 0 && classMask != 0)
- // TC_LOG_ERROR("sql.sql", "Racemask/classmask (%u/%u) combination was found containing an invalid race/class combination (%u/%u) in `playercreateinfo_spell` (Spell %u), ignoring.", raceMask, classMask, raceIndex, classIndex, spellId);
+ // TC_LOG_ERROR("sql.sql", "Racemask/classmask (%u/%u) combination was found containing an invalid race/class combination (%u/%u) in `%s` (Spell %u), ignoring.", raceMask, classMask, raceIndex, classIndex, tableName.c_str(), spellId);
}
}
}
@@ -3373,7 +3416,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
- TC_LOG_ERROR("server.loading", ">> Loaded 0 level health/mana definitions. DB table `game_event_condition` is empty.");
+ TC_LOG_ERROR("server.loading", ">> Loaded 0 level health/mana definitions. DB table `player_classlevelstats` is empty.");
exit(1);
}
@@ -3436,8 +3479,8 @@ void ObjectMgr::LoadPlayerInfo()
{
if (pClassInfo->levelInfo[level].basehealth == 0)
{
- TC_LOG_ERROR("sql.sql", "Class %i Level %i does not have health/mana data. Using stats data of level %i.", class_, level+1, level);
- pClassInfo->levelInfo[level] = pClassInfo->levelInfo[level-1];
+ TC_LOG_ERROR("sql.sql", "Class %i Level %i does not have health/mana data. Using stats data of level %i.", class_, level + 1, level);
+ pClassInfo->levelInfo[level] = pClassInfo->levelInfo[level - 1];
}
}
}
@@ -3497,9 +3540,9 @@ void ObjectMgr::LoadPlayerInfo()
if (!info->levelInfo)
info->levelInfo = new PlayerLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)];
- PlayerLevelInfo& levelInfo = info->levelInfo[current_level-1];
+ PlayerLevelInfo& levelInfo = info->levelInfo[current_level - 1];
for (int i = 0; i < MAX_STATS; i++)
- levelInfo.stats[i] = fields[i+3].GetUInt8();
+ levelInfo.stats[i] = fields[i + 3].GetUInt8();
}
++count;
@@ -3524,11 +3567,11 @@ void ObjectMgr::LoadPlayerInfo()
continue;
// skip expansion races if not playing with expansion
- if (sWorld->getIntConfig(CONFIG_EXPANSION) < 1 && (race == RACE_BLOODELF || race == RACE_DRAENEI))
+ if (sWorld->getIntConfig(CONFIG_EXPANSION) < EXPANSION_THE_BURNING_CRUSADE && (race == RACE_BLOODELF || race == RACE_DRAENEI))
continue;
// skip expansion classes if not playing with expansion
- if (sWorld->getIntConfig(CONFIG_EXPANSION) < 2 && class_ == CLASS_DEATH_KNIGHT)
+ if (sWorld->getIntConfig(CONFIG_EXPANSION) < EXPANSION_WRATH_OF_THE_LICH_KING && class_ == CLASS_DEATH_KNIGHT)
continue;
// fatal error if no level 1 data
@@ -3543,8 +3586,8 @@ void ObjectMgr::LoadPlayerInfo()
{
if (info->levelInfo[level].stats[0] == 0)
{
- TC_LOG_ERROR("sql.sql", "Race %i Class %i Level %i does not have stats data. Using stats data of level %i.", race, class_, level+1, level);
- info->levelInfo[level] = info->levelInfo[level-1];
+ TC_LOG_ERROR("sql.sql", "Race %i Class %i Level %i does not have stats data. Using stats data of level %i.", race, class_, level + 1, level);
+ info->levelInfo[level] = info->levelInfo[level - 1];
}
}
}
@@ -3602,8 +3645,8 @@ void ObjectMgr::LoadPlayerInfo()
{
if (_playerXPperLevel[level] == 0)
{
- TC_LOG_ERROR("sql.sql", "Level %i does not have XP for level data. Using data of level [%i] + 100.", level+1, level);
- _playerXPperLevel[level] = _playerXPperLevel[level-1]+100;
+ TC_LOG_ERROR("sql.sql", "Level %i does not have XP for level data. Using data of level [%i] + 100.", level + 1, level);
+ _playerXPperLevel[level] = _playerXPperLevel[level - 1] + 100;
}
}
@@ -4234,21 +4277,21 @@ void ObjectMgr::LoadQuests()
{
TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.",
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
- qinfo->RewardSpellCast = 0; // no spell will be casted on player
+ qinfo->RewardSpellCast = 0; // no spell will be cast on player
}
else if (!SpellMgr::IsSpellValid(spellInfo))
{
TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSpellCast` = %u but spell %u is broken, quest will not have a spell reward.",
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
- qinfo->RewardSpellCast = 0; // no spell will be casted on player
+ qinfo->RewardSpellCast = 0; // no spell will be cast on player
}
else if (GetTalentSpellCost(qinfo->RewardSpellCast))
{
TC_LOG_ERROR("sql.sql", "Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
- qinfo->RewardSpellCast = 0; // no spell will be casted on player
+ qinfo->RewardSpellCast = 0; // no spell will be cast on player
}
}
@@ -6480,6 +6523,8 @@ void ObjectMgr::LoadGameObjectTemplate()
TC_LOG_ERROR("sql.sql", "GameObject (Entry: %u GoType: %u) have data0=%u but TaxiPath (Id: %u) not exist.",
entry, got.type, got.moTransport.taxiPathId, got.moTransport.taxiPathId);
}
+ if (uint32 transportMap = got.moTransport.mapID)
+ _transportMaps.insert(transportMap);
break;
}
case GAMEOBJECT_TYPE_SUMMONING_RITUAL: //18
@@ -7046,9 +7091,13 @@ void ObjectMgr::LoadQuestPOI()
uint32 unk4 = fields[7].GetUInt32();
QuestPOI POI(id, objIndex, mapId, WorldMapAreaId, FloorId, unk3, unk4);
- POI.points = POIs[questId][id];
-
- _questPOIStore[questId].push_back(POI);
+ if (questId < POIs.size() && id < POIs[questId].size())
+ {
+ POI.points = POIs[questId][id];
+ _questPOIStore[questId].push_back(POI);
+ }
+ else
+ TC_LOG_ERROR("server.loading", "Table quest_poi references unknown quest points for quest %u POI id %u", questId, id);
++count;
} while (result->NextRow());
@@ -7461,9 +7510,9 @@ void ObjectMgr::LoadGameObjectForQuests()
{
switch (itr->second.type)
{
- // scan GO chest with loot including quest items
case GAMEOBJECT_TYPE_CHEST:
{
+ // scan GO chest with loot including quest items
uint32 loot_id = (itr->second.GetLootId());
// find quest loot for GO
@@ -7479,7 +7528,7 @@ void ObjectMgr::LoadGameObjectForQuests()
if (itr->second._generic.questID > 0) //quests objects
{
_gameObjectForQuestStore.insert(itr->second.entry);
- count++;
+ ++count;
}
break;
}
@@ -7488,7 +7537,7 @@ void ObjectMgr::LoadGameObjectForQuests()
if (itr->second.goober.questId > 0) //quests objects
{
_gameObjectForQuestStore.insert(itr->second.entry);
- count++;
+ ++count;
}
break;
}
@@ -8512,20 +8561,25 @@ CreatureBaseStats const* ObjectMgr::GetCreatureBaseStats(uint8 level, uint8 unit
DefaultCreatureBaseStats()
{
BaseArmor = 1;
- for (uint8 j = 0; j < MAX_CREATURE_BASE_HP; ++j)
+ for (uint8 j = 0; j < MAX_EXPANSIONS; ++j)
+ {
BaseHealth[j] = 1;
+ BaseDamage[j] = 0.0f;
+ }
BaseMana = 0;
+ AttackPower = 0;
+ RangedAttackPower = 0;
}
};
- static const DefaultCreatureBaseStats def_stats;
- return &def_stats;
+ static const DefaultCreatureBaseStats defStats;
+ return &defStats;
}
void ObjectMgr::LoadCreatureClassLevelStats()
{
uint32 oldMSTime = getMSTime();
- QueryResult result = WorldDatabase.Query("SELECT level, class, basehp0, basehp1, basehp2, basemana, basearmor FROM creature_classlevelstats");
+ QueryResult result = WorldDatabase.Query("SELECT level, class, basehp0, basehp1, basehp2, basemana, basearmor, attackpower, rangedattackpower, damage_base, damage_exp1, damage_exp2 FROM creature_classlevelstats");
if (!result)
{
@@ -8538,29 +8592,38 @@ void ObjectMgr::LoadCreatureClassLevelStats()
{
Field* fields = result->Fetch();
- uint8 Level = fields[0].GetInt8();
- uint8 Class = fields[1].GetInt8();
-
- CreatureBaseStats stats;
-
- for (uint8 i = 0; i < MAX_CREATURE_BASE_HP; ++i)
- stats.BaseHealth[i] = fields[i + 2].GetInt16();
-
- stats.BaseMana = fields[5].GetInt16();
- stats.BaseArmor = fields[6].GetInt16();
+ uint8 Level = fields[0].GetUInt8();
+ uint8 Class = fields[1].GetUInt8();
if (!Class || ((1 << (Class - 1)) & CLASSMASK_ALL_CREATURES) == 0)
TC_LOG_ERROR("sql.sql", "Creature base stats for level %u has invalid class %u", Level, Class);
- for (uint8 i = 0; i < MAX_CREATURE_BASE_HP; ++i)
+ CreatureBaseStats stats;
+
+ for (uint8 i = 0; i < MAX_EXPANSIONS; ++i)
{
- if (stats.BaseHealth[i] < 1)
+ stats.BaseHealth[i] = fields[2 + i].GetUInt16();
+
+ if (stats.BaseHealth[i] == 0)
{
TC_LOG_ERROR("sql.sql", "Creature base stats for class %u, level %u has invalid zero base HP[%u] - set to 1", Class, Level, i);
stats.BaseHealth[i] = 1;
}
+
+ stats.BaseDamage[i] = fields[9 + i].GetFloat();
+ if (stats.BaseDamage[i] < 0.0f)
+ {
+ TC_LOG_ERROR("sql.sql", "Creature base stats for class %u, level %u has invalid negative base damage[%u] - set to 0.0", Class, Level, i);
+ stats.BaseDamage[i] = 0.0f;
+ }
}
+ stats.BaseMana = fields[5].GetUInt16();
+ stats.BaseArmor = fields[6].GetUInt16();
+
+ stats.AttackPower = fields[7].GetUInt16();
+ stats.RangedAttackPower = fields[8].GetUInt16();
+
_creatureBaseStatsStore[MAKE_PAIR16(Level, Class)] = stats;
++count;
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index bf835ed6c4e..b1f80af0567 100644
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -1384,6 +1384,8 @@ class ObjectMgr
GO_TO_GO,
GO_TO_CREATURE // GO is dependant on creature
};
+
+ std::set<uint32> _transportMaps; // Helper container storing map ids that are for transports only, loaded from gameobject_template
};
#define sObjectMgr ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance()
diff --git a/src/server/game/Grids/Cells/Cell.h b/src/server/game/Grids/Cells/Cell.h
index ecfdfd6ce05..b1a13558d3d 100644
--- a/src/server/game/Grids/Cells/Cell.h
+++ b/src/server/game/Grids/Cells/Cell.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Grids/Cells/CellImpl.h b/src/server/game/Grids/Cells/CellImpl.h
index b399155b476..ac015c382ea 100644
--- a/src/server/game/Grids/Cells/CellImpl.h
+++ b/src/server/game/Grids/Cells/CellImpl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Grids/Grid.h b/src/server/game/Grids/Grid.h
index 57f79538e2b..2d5ca74b818 100644
--- a/src/server/game/Grids/Grid.h
+++ b/src/server/game/Grids/Grid.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h
index 7ddb4647afe..5279f437f89 100644
--- a/src/server/game/Grids/GridDefines.h
+++ b/src/server/game/Grids/GridDefines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Grids/GridLoader.h b/src/server/game/Grids/GridLoader.h
index 2c10118fcad..3ec8a5a60b4 100644
--- a/src/server/game/Grids/GridLoader.h
+++ b/src/server/game/Grids/GridLoader.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Grids/GridRefManager.h b/src/server/game/Grids/GridRefManager.h
index 61f476577e0..1d79cd770e4 100644
--- a/src/server/game/Grids/GridRefManager.h
+++ b/src/server/game/Grids/GridRefManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Grids/GridReference.h b/src/server/game/Grids/GridReference.h
index 18403e27a45..57929bc2de1 100644
--- a/src/server/game/Grids/GridReference.h
+++ b/src/server/game/Grids/GridReference.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Grids/GridStates.cpp b/src/server/game/Grids/GridStates.cpp
index cc6ceae6996..8b57c382cd7 100644
--- a/src/server/game/Grids/GridStates.cpp
+++ b/src/server/game/Grids/GridStates.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Grids/GridStates.h b/src/server/game/Grids/GridStates.h
index 38728d11757..016df4dc3d4 100644
--- a/src/server/game/Grids/GridStates.h
+++ b/src/server/game/Grids/GridStates.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Grids/NGrid.h b/src/server/game/Grids/NGrid.h
index 2e244ecbc62..2590e85e5d3 100644
--- a/src/server/game/Grids/NGrid.h
+++ b/src/server/game/Grids/NGrid.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp
index 00b1e82a0ea..472497ea5f2 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index 24c44eb0c56..f5138845012 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h
index dc0e99aaded..77b49fdfc8b 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -517,15 +517,17 @@ void Trinity::LocalizedPacketDo<Builder>::operator()(Player* p)
WorldPacket* data;
// create if not cached yet
- if (i_data_cache.size() < cache_idx+1 || !i_data_cache[cache_idx])
+ if (i_data_cache.size() < cache_idx + 1 || !i_data_cache[cache_idx])
{
- if (i_data_cache.size() < cache_idx+1)
- i_data_cache.resize(cache_idx+1);
+ if (i_data_cache.size() < cache_idx + 1)
+ i_data_cache.resize(cache_idx + 1);
- data = new WorldPacket(SMSG_MESSAGECHAT, 200);
+ data = new WorldPacket();
i_builder(*data, loc_idx);
+ ASSERT(data->GetOpcode() != MSG_NULL_ACTION);
+
i_data_cache[cache_idx] = data;
}
else
diff --git a/src/server/game/Grids/ObjectGridLoader.cpp b/src/server/game/Grids/ObjectGridLoader.cpp
index 5c4366e0c25..51a1f2215f8 100644
--- a/src/server/game/Grids/ObjectGridLoader.cpp
+++ b/src/server/game/Grids/ObjectGridLoader.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Grids/ObjectGridLoader.h b/src/server/game/Grids/ObjectGridLoader.h
index da3baa9c03c..2ddc51848a8 100644
--- a/src/server/game/Grids/ObjectGridLoader.h
+++ b/src/server/game/Grids/ObjectGridLoader.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 272fd89f0a6..354f00a9e91 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -1960,7 +1960,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo)
if (isEmpty || method == INSTANCE_RESET_GROUP_DISBAND || method == INSTANCE_RESET_CHANGE_DIFFICULTY)
{
// do not reset the instance, just unbind if others are permanently bound to it
- if (instanceSave->CanReset())
+ if (isEmpty && instanceSave->CanReset())
instanceSave->DeleteFromDB();
else
{
diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h
index 0f55aba464c..6336a1bb30c 100644
--- a/src/server/game/Groups/Group.h
+++ b/src/server/game/Groups/Group.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp
index 762199f21d5..20e6a0671a5 100644
--- a/src/server/game/Groups/GroupMgr.cpp
+++ b/src/server/game/Groups/GroupMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Groups/GroupMgr.h b/src/server/game/Groups/GroupMgr.h
index 3b3371bb17e..a805b7514da 100644
--- a/src/server/game/Groups/GroupMgr.h
+++ b/src/server/game/Groups/GroupMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Groups/GroupRefManager.h b/src/server/game/Groups/GroupRefManager.h
index 99fdcd31cd7..d286a19cbfd 100644
--- a/src/server/game/Groups/GroupRefManager.h
+++ b/src/server/game/Groups/GroupRefManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Groups/GroupReference.cpp b/src/server/game/Groups/GroupReference.cpp
index c2f3332f408..4dda580bd5f 100644
--- a/src/server/game/Groups/GroupReference.cpp
+++ b/src/server/game/Groups/GroupReference.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Groups/GroupReference.h b/src/server/game/Groups/GroupReference.h
index 6e323eefa27..df5683b3edf 100644
--- a/src/server/game/Groups/GroupReference.h
+++ b/src/server/game/Groups/GroupReference.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index 10bce9e2d51..f448fbb9f19 100644
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -701,7 +701,7 @@ bool Guild::Member::CheckStats() const
return true;
}
-void Guild::Member::WritePacket(WorldPacket& data) const
+void Guild::Member::WritePacket(WorldPacket& data, bool sendOfficerNote) const
{
data << uint64(m_guid)
<< uint8(m_flags)
@@ -715,8 +715,12 @@ void Guild::Member::WritePacket(WorldPacket& data) const
if (!m_flags)
data << float(float(::time(NULL) - m_logoutTime) / DAY);
- data << m_publicNote
- << m_officerNote;
+ data << m_publicNote;
+
+ if (sendOfficerNote)
+ data << m_officerNote;
+ else
+ data << "";
}
// Decreases amount of money/slots left for today.
@@ -1299,7 +1303,7 @@ bool Guild::SetName(std::string const& name)
return true;
}
-void Guild::HandleRoster(WorldSession* session /*= NULL*/)
+void Guild::HandleRoster(WorldSession* session)
{
// Guess size
WorldPacket data(SMSG_GUILD_ROSTER, (4 + m_motd.length() + 1 + m_info.length() + 1 + 4 + _GetRanksSize() * (4 + 4 + GUILD_BANK_MAX_TABS * (4 + 4)) + m_members.size() * 50));
@@ -1312,18 +1316,10 @@ void Guild::HandleRoster(WorldSession* session /*= NULL*/)
ritr->WritePacket(data);
for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
- itr->second->WritePacket(data);
+ itr->second->WritePacket(data, _HasRankRight(session->GetPlayer(), GR_RIGHT_VIEWOFFNOTE));
- if (session)
- {
- TC_LOG_DEBUG("guild", "SMSG_GUILD_ROSTER [%s]", session->GetPlayerInfo().c_str());
- session->SendPacket(&data);
- }
- else
- {
- TC_LOG_DEBUG("guild", "SMSG_GUILD_ROSTER [Broadcast]");
- BroadcastPacket(&data);
- }
+ TC_LOG_DEBUG("guild", "SMSG_GUILD_ROSTER [%s]", session->GetPlayerInfo().c_str());
+ session->SendPacket(&data);
}
void Guild::HandleQuery(WorldSession* session)
@@ -2151,7 +2147,7 @@ void Guild::BroadcastToGuild(WorldSession* session, bool officerOnly, std::strin
if (session && session->GetPlayer() && _HasRankRight(session->GetPlayer(), officerOnly ? GR_RIGHT_OFFCHATSPEAK : GR_RIGHT_GCHATSPEAK))
{
WorldPacket data;
- ChatHandler::FillMessageData(&data, session, officerOnly ? CHAT_MSG_OFFICER : CHAT_MSG_GUILD, language, NULL, 0, msg.c_str(), NULL);
+ ChatHandler::BuildChatPacket(data, officerOnly ? CHAT_MSG_OFFICER : CHAT_MSG_GUILD, Language(language), session->GetPlayer(), NULL, msg);
for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
if (Player* player = itr->second->FindPlayer())
if (player->GetSession() && _HasRankRight(player, officerOnly ? GR_RIGHT_OFFCHATLISTEN : GR_RIGHT_GCHATLISTEN) &&
diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h
index c695d141afe..fca483e92c3 100644
--- a/src/server/game/Guilds/Guild.h
+++ b/src/server/game/Guilds/Guild.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -315,7 +315,7 @@ private:
bool LoadFromDB(Field* fields);
void SaveToDB(SQLTransaction& trans) const;
- void WritePacket(WorldPacket& data) const;
+ void WritePacket(WorldPacket& data, bool sendOfficerNote) const;
uint64 GetGUID() const { return m_guid; }
std::string const& GetName() const { return m_name; }
@@ -661,7 +661,7 @@ public:
bool SetName(std::string const& name);
// Handle client commands
- void HandleRoster(WorldSession* session = NULL); // NULL = broadcast
+ void HandleRoster(WorldSession* session);
void HandleQuery(WorldSession* session);
void HandleSetMOTD(WorldSession* session, std::string const& motd);
void HandleSetInfo(WorldSession* session, std::string const& info);
diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp
index 66a763110c1..b9cb7d6dce9 100644
--- a/src/server/game/Guilds/GuildMgr.cpp
+++ b/src/server/game/Guilds/GuildMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Guilds/GuildMgr.h b/src/server/game/Guilds/GuildMgr.h
index 0c99fde2ecc..3d07059000b 100644
--- a/src/server/game/Guilds/GuildMgr.h
+++ b/src/server/game/Guilds/GuildMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Handlers/AddonHandler.cpp b/src/server/game/Handlers/AddonHandler.cpp
index 3a5a5ba8bf0..3c9a66bedb5 100644
--- a/src/server/game/Handlers/AddonHandler.cpp
+++ b/src/server/game/Handlers/AddonHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Handlers/AddonHandler.h b/src/server/game/Handlers/AddonHandler.h
index 33afe989da1..97a541753d0 100644
--- a/src/server/game/Handlers/AddonHandler.h
+++ b/src/server/game/Handlers/AddonHandler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Handlers/ArenaTeamHandler.cpp b/src/server/game/Handlers/ArenaTeamHandler.cpp
index 824c5631da0..f3aedeeeb48 100644
--- a/src/server/game/Handlers/ArenaTeamHandler.cpp
+++ b/src/server/game/Handlers/ArenaTeamHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp
index 8e86f43f19f..d9e4feb7f85 100644
--- a/src/server/game/Handlers/AuctionHouseHandler.cpp
+++ b/src/server/game/Handlers/AuctionHouseHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -332,6 +332,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
item2->DeleteFromInventoryDB(trans);
item2->DeleteFromDB(trans);
CharacterDatabase.CommitTransaction(trans);
+ delete item2;
}
else // Item stack count is bigger than required count, update item stack count and save to database - cloned item will be used for auction
{
diff --git a/src/server/game/Handlers/AuthHandler.cpp b/src/server/game/Handlers/AuthHandler.cpp
index 880937c2c39..70b0d541e6c 100644
--- a/src/server/game/Handlers/AuthHandler.cpp
+++ b/src/server/game/Handlers/AuthHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp
index a88c2e146a1..0dfe396b65a 100644
--- a/src/server/game/Handlers/BattleGroundHandler.cpp
+++ b/src/server/game/Handlers/BattleGroundHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Handlers/BattlefieldHandler.cpp b/src/server/game/Handlers/BattlefieldHandler.cpp
index c81822152d8..b0580681f91 100644
--- a/src/server/game/Handlers/BattlefieldHandler.cpp
+++ b/src/server/game/Handlers/BattlefieldHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -15,136 +15,173 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "Common.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
+#include "Opcodes.h"
+#include "Player.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "Battlefield.h"
#include "BattlefieldMgr.h"
-#include "Opcodes.h"
-#include "Player.h"
-//This send to player windows for invite player to join the war
-//Param1:(BattleId) the BattleId of Bf
-//Param2:(ZoneId) the zone where the battle is (4197 for wg)
-//Param3:(time) Time in second that the player have for accept
-void WorldSession::SendBfInvitePlayerToWar(uint32 BattleId, uint32 ZoneId, uint32 p_time)
+/**
+ * @fn void WorldSession::SendBfInvitePlayerToWar(uint32 battleId, uint32 zoneId, uint32 acceptTime)
+ *
+ * @brief This send to player windows for invite player to join the war.
+ *
+ * @param battleId The BattleId of Bf
+ * @param zoneId The zone where the battle is (4197 for wg)
+ * @param acceptTime Time in second that the player have for accept
+ */
+void WorldSession::SendBfInvitePlayerToWar(uint32 battleId, uint32 zoneId, uint32 acceptTime)
{
- //Send packet
WorldPacket data(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, 12);
- data << uint32(BattleId);
- data << uint32(ZoneId);
- data << uint32((time(NULL) + p_time));
-
- //Sending the packet to player
+ data << uint32(battleId);
+ data << uint32(zoneId);
+ data << uint32(time(NULL) + acceptTime);
SendPacket(&data);
}
-//This send invitation to player to join the queue
-//Param1:(BattleId) the BattleId of Bf
-void WorldSession::SendBfInvitePlayerToQueue(uint32 BattleId)
+/**
+ * @fn void WorldSession::SendBfInvitePlayerToQueue(uint32 battleId)
+ *
+ * @brief This send invitation to player to join the queue.
+ *
+ * @param battleId The BattleId of Bf
+ */
+void WorldSession::SendBfInvitePlayerToQueue(uint32 battleId)
{
WorldPacket data(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE, 5);
-
- data << uint32(BattleId);
- data << uint8(1); //warmup ? used ?
-
- //Sending packet to player
+ data << uint32(battleId);
+ data << uint8(1); // warmup ? used ?
SendPacket(&data);
}
-//This send packet for inform player that he join queue
-//Param1:(BattleId) the BattleId of Bf
-//Param2:(ZoneId) the zone where the battle is (4197 for wg)
-//Param3:(CanQueue) if able to queue
-//Param4:(Full) on log in is full
-void WorldSession::SendBfQueueInviteResponse(uint32 BattleId, uint32 ZoneId, bool CanQueue, bool Full)
+/**
+ * @fn void WorldSession::SendBfQueueInviteResponse(uint32 battleId, uint32 zoneId, bool canQueue, bool full)
+ *
+ * @brief This send packet for inform player that he join queue.
+ *
+ * @param battleId The BattleId of Bf
+ * @param zoneId The zone where the battle is (4197 for wg)
+ * @param canQueue if able to queue
+ * @param full on log in is full
+ */
+void WorldSession::SendBfQueueInviteResponse(uint32 battleId, uint32 zoneId, bool canQueue, bool full)
{
WorldPacket data(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, 11);
- data << uint32(BattleId);
- data << uint32(ZoneId);
- data << uint8((CanQueue ? 1 : 0)); //Accepted //0 you cannot queue wg //1 you are queued
- data << uint8((Full ? 0 : 1)); //Logging In //0 wg full //1 queue for upcoming
- data << uint8(1); //Warmup
+ data << uint32(battleId);
+ data << uint32(zoneId);
+ data << uint8(canQueue ? 1 : 0); // Accepted // 0 you cannot queue wg // 1 you are queued
+ data << uint8(full ? 0 : 1); // Logging In // 0 wg full // 1 queue for upcoming
+ data << uint8(1); // Warmup
SendPacket(&data);
}
-//This is call when player accept to join war
-//Param1:(BattleId) the BattleId of Bf
-void WorldSession::SendBfEntered(uint32 BattleId)
+/**
+ * @fn void WorldSession::SendBfEntered(uint32 battleId)
+ *
+ * @brief This is call when player accept to join war.
+ *
+ * @param battleId The BattleId of Bf
+ */
+void WorldSession::SendBfEntered(uint32 battleId)
{
-// m_PlayerInWar[player->GetTeamId()].insert(player->GetGUID());
WorldPacket data(SMSG_BATTLEFIELD_MGR_ENTERED, 7);
- data << uint32(BattleId);
- data << uint8(1); //unk
- data << uint8(1); //unk
- data << uint8(_player->isAFK() ? 1 : 0); //Clear AFK
+ data << uint32(battleId);
+ data << uint8(1); // unk
+ data << uint8(1); // unk
+ data << uint8(_player->isAFK() ? 1 : 0); // Clear AFK
SendPacket(&data);
}
-void WorldSession::SendBfLeaveMessage(uint32 BattleId, BFLeaveReason reason)
+/**
+ * @fn void WorldSession::SendBfLeaveMessage(uint32 battleId, BFLeaveReason reason)
+ *
+ * @brief This is call when player leave battlefield zone.
+ *
+ * @param battleId The BattleId of Bf
+ * @param reason Reason why player left battlefield
+ */
+void WorldSession::SendBfLeaveMessage(uint32 battleId, BFLeaveReason reason /*= BF_LEAVE_REASON_EXITED*/)
{
WorldPacket data(SMSG_BATTLEFIELD_MGR_EJECTED, 7);
- data << uint32(BattleId);
- data << uint8(reason);//byte Reason
- data << uint8(2);//byte BattleStatus
- data << uint8(0);//bool Relocated
+ data << uint32(battleId);
+ data << uint8(reason); // byte Reason
+ data << uint8(2); // byte BattleStatus
+ data << uint8(0); // bool Relocated
SendPacket(&data);
}
-//Send by client when he click on accept for queue
-void WorldSession::HandleBfQueueInviteResponse(WorldPacket & recvData)
+/**
+ * @fn void WorldSession::HandleBfQueueInviteResponse(WorldPacket& recvData)
+ *
+ * @brief Send by client when he click on accept for queue.
+ */
+void WorldSession::HandleBfQueueInviteResponse(WorldPacket& recvData)
{
- uint32 BattleId;
- uint8 Accepted;
+ uint32 battleId;
+ uint8 accepted;
+
+ recvData >> battleId >> accepted;
- recvData >> BattleId >> Accepted;
- TC_LOG_DEBUG("misc", "HandleQueueInviteResponse: BattleID:%u Accepted:%u", BattleId, Accepted);
- Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId);
- if (!Bf)
+ TC_LOG_DEBUG("misc", "HandleBfQueueInviteResponse: BattleID:%u Accepted:%u", battleId, accepted);
+
+ Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleId);
+ if (!bf)
return;
- if (Accepted)
- {
- Bf->PlayerAcceptInviteToQueue(_player);
- }
+ if (accepted)
+ bf->PlayerAcceptInviteToQueue(_player);
}
-//Send by client on clicking in accept or refuse of invitation windows for join game
-void WorldSession::HandleBfEntryInviteResponse(WorldPacket & recvData)
+/**
+ * @fn void WorldSession::HandleBfEntryInviteResponse(WorldPacket& recvData)
+ *
+ * @brief Send by client on clicking in accept or refuse of invitation windows for join game.
+ */
+void WorldSession::HandleBfEntryInviteResponse(WorldPacket& recvData)
{
- uint32 BattleId;
- uint8 Accepted;
+ uint32 battleId;
+ uint8 accepted;
+
+ recvData >> battleId >> accepted;
+
+ TC_LOG_DEBUG("misc", "HandleBfEntryInviteResponse: battleId: %u, accepted: %u", battleId, accepted);
- recvData >> BattleId >> Accepted;
- TC_LOG_DEBUG("misc", "HandleBattlefieldInviteResponse: BattleID:%u Accepted:%u", BattleId, Accepted);
- Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId);
- if (!Bf)
+ Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleId);
+ if (!bf)
return;
- //If player accept invitation
- if (Accepted)
+ // If player accept invitation
+ if (accepted)
{
- Bf->PlayerAcceptInviteToWar(_player);
+ bf->PlayerAcceptInviteToWar(_player);
}
else
{
- if (_player->GetZoneId() == Bf->GetZoneId())
- Bf->KickPlayerFromBattlefield(_player->GetGUID());
+ if (_player->GetZoneId() == bf->GetZoneId())
+ bf->KickPlayerFromBattlefield(_player->GetGUID());
}
}
-void WorldSession::HandleBfExitRequest(WorldPacket & recvData)
+/**
+ * @fn void WorldSession::HandleBfExitRequest(WorldPacket& recvData)
+ *
+ * @brief Send by client when exited battlefield
+ */
+void WorldSession::HandleBfExitRequest(WorldPacket& recvData)
{
- uint32 BattleId;
+ uint32 battleId;
+
+ recvData >> battleId;
+
+ TC_LOG_DEBUG("misc", "HandleBfExitRequest: battleId: %u ", battleId);
- recvData >> BattleId;
- TC_LOG_DEBUG("misc", "HandleBfExitRequest: BattleID:%u ", BattleId);
- Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId);
- if (!Bf)
+ Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleId);
+ if (!bf)
return;
- Bf->AskToLeaveQueue(_player);
+ bf->AskToLeaveQueue(_player);
}
diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp
index b5887ea7c00..45d4d221d06 100644
--- a/src/server/game/Handlers/CalendarHandler.cpp
+++ b/src/server/game/Handlers/CalendarHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -235,18 +235,20 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recvData)
recvData.ReadPackedTime(unkPackedTime);
recvData >> flags;
- CalendarEvent* calendarEvent = new CalendarEvent(sCalendarMgr->GetFreeEventId(), guid, 0, CalendarEventType(type), dungeonId,
+ CalendarEvent calendarEvent(sCalendarMgr->GetFreeEventId(), guid, 0, CalendarEventType(type), dungeonId,
time_t(eventPackedTime), flags, time_t(unkPackedTime), title, description);
- if (calendarEvent->IsGuildEvent() || calendarEvent->IsGuildAnnouncement())
+ if (calendarEvent.IsGuildEvent() || calendarEvent.IsGuildAnnouncement())
if (Player* creator = ObjectAccessor::FindPlayer(guid))
- calendarEvent->SetGuildId(creator->GetGuildId());
+ calendarEvent.SetGuildId(creator->GetGuildId());
- if (calendarEvent->IsGuildAnnouncement())
+ if (calendarEvent.IsGuildAnnouncement())
{
// 946684800 is 01/01/2000 00:00:00 - default response time
- CalendarInvite* invite = new CalendarInvite(0, calendarEvent->GetEventId(), 0, guid, 946684800, CALENDAR_STATUS_NOT_SIGNED_UP, CALENDAR_RANK_PLAYER, "");
- sCalendarMgr->AddInvite(calendarEvent, invite);
+ CalendarInvite invite(0, calendarEvent.GetEventId(), 0, guid, 946684800, CALENDAR_STATUS_NOT_SIGNED_UP, CALENDAR_RANK_PLAYER, "");
+ // WARNING: By passing pointer to a local variable, the underlying method(s) must NOT perform any kind
+ // of storage of the pointer as it will lead to memory corruption
+ sCalendarMgr->AddInvite(&calendarEvent, &invite);
}
else
{
@@ -262,12 +264,12 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recvData)
recvData >> status >> rank;
// 946684800 is 01/01/2000 00:00:00 - default response time
- CalendarInvite* invite = new CalendarInvite(sCalendarMgr->GetFreeInviteId(), calendarEvent->GetEventId(), invitee, guid, 946684800, CalendarInviteStatus(status), CalendarModerationRank(rank), "");
- sCalendarMgr->AddInvite(calendarEvent, invite);
+ CalendarInvite* invite = new CalendarInvite(sCalendarMgr->GetFreeInviteId(), calendarEvent.GetEventId(), invitee, guid, 946684800, CalendarInviteStatus(status), CalendarModerationRank(rank), "");
+ sCalendarMgr->AddInvite(&calendarEvent, invite);
}
}
- sCalendarMgr->AddEvent(calendarEvent, CALENDAR_SENDTYPE_ADD);
+ sCalendarMgr->AddEvent(new CalendarEvent(calendarEvent, calendarEvent.GetEventId()), CALENDAR_SENDTYPE_ADD);
}
void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recvData)
diff --git a/src/server/game/Handlers/ChannelHandler.cpp b/src/server/game/Handlers/ChannelHandler.cpp
index 12f6b52bf0a..c95eadc7d90 100644
--- a/src/server/game/Handlers/ChannelHandler.cpp
+++ b/src/server/game/Handlers/ChannelHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index 25164b82936..4c7d1669233 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -1590,9 +1590,6 @@ void WorldSession::HandleEquipmentSetDelete(WorldPacket &recvData)
void WorldSession::HandleEquipmentSetUse(WorldPacket &recvData)
{
- if (_player->IsInCombat())
- return;
-
TC_LOG_DEBUG("network", "CMSG_EQUIPMENT_SET_USE");
for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i)
@@ -1609,6 +1606,10 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recvData)
if (itemGuid == 1)
continue;
+ // Only equip weapons in combat
+ if (_player->IsInCombat() && i != EQUIPMENT_SLOT_MAINHAND && i != EQUIPMENT_SLOT_OFFHAND && i != EQUIPMENT_SLOT_RANGED)
+ continue;
+
Item* item = _player->GetItemByGuid(itemGuid);
uint16 dstpos = i | (INVENTORY_SLOT_BAG_0 << 8);
@@ -1919,6 +1920,8 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
if (result)
if (Guild* guild = sGuildMgr->GetGuildById((result->Fetch()[0]).GetUInt32()))
guild->DeleteMember(MAKE_NEW_GUID(lowGuid, 0, HIGHGUID_PLAYER), false, false, true);
+
+ Player::LeaveAllArenaTeams(guid);
}
if (!HasPermission(rbac::RBAC_PERM_TWO_SIDE_ADD_FRIEND))
@@ -1931,12 +1934,8 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_FRIEND);
stmt->setUInt32(0, lowGuid);
trans->Append(stmt);
-
}
- // Leave Arena Teams
- Player::LeaveAllArenaTeams(guid);
-
// Reset homebind and position
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_HOMEBIND);
stmt->setUInt32(0, lowGuid);
diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp
index bea3fc76cf2..b45840ab190 100644
--- a/src/server/game/Handlers/ChatHandler.cpp
+++ b/src/server/game/Handlers/ChatHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -313,7 +313,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
WorldPacket data;
- ChatHandler::FillMessageData(&data, this, uint8(type), lang, NULL, 0, msg.c_str(), NULL);
+ ChatHandler::BuildChatPacket(data, ChatMsg(type), Language(lang), _player, NULL, msg);
group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetGUID()));
} break;
case CHAT_MSG_GUILD:
@@ -354,7 +354,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
WorldPacket data;
- ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID, lang, "", 0, msg.c_str(), NULL);
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID, Language(lang), _player, NULL, msg);
group->BroadcastPacket(&data, false);
} break;
case CHAT_MSG_RAID_LEADER:
@@ -371,7 +371,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
WorldPacket data;
- ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_LEADER, lang, "", 0, msg.c_str(), NULL);
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_LEADER, Language(lang), _player, NULL, msg);
group->BroadcastPacket(&data, false);
} break;
case CHAT_MSG_RAID_WARNING:
@@ -384,7 +384,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
WorldPacket data;
//in battleground, raid warning is sent only to players in battleground - code is ok
- ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_WARNING, lang, "", 0, msg.c_str(), NULL);
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_WARNING, Language(lang), _player, NULL, msg);
group->BroadcastPacket(&data, false);
} break;
case CHAT_MSG_BATTLEGROUND:
@@ -397,7 +397,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
WorldPacket data;
- ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND, lang, "", 0, msg.c_str(), NULL);
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_BATTLEGROUND, Language(lang), _player, NULL, msg);
group->BroadcastPacket(&data, false);
} break;
case CHAT_MSG_BATTLEGROUND_LEADER:
@@ -410,7 +410,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
WorldPacket data;
- ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND_LEADER, lang, "", 0, msg.c_str(), NULL);
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_BATTLEGROUND_LEADER, Language(lang), _player, NULL, msg);;
group->BroadcastPacket(&data, false);
} break;
case CHAT_MSG_CHANNEL:
@@ -605,7 +605,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recvData)
return;
WorldPacket data;
- ChatHandler::FillMessageData(&data, this, CHAT_MSG_IGNORED, LANG_UNIVERSAL, NULL, GetPlayer()->GetGUID(), GetPlayer()->GetName().c_str(), NULL);
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_IGNORED, LANG_UNIVERSAL, _player, _player, GetPlayer()->GetName());
player->GetSession()->SendPacket(&data);
}
diff --git a/src/server/game/Handlers/CombatHandler.cpp b/src/server/game/Handlers/CombatHandler.cpp
index 3c5bdfd1f58..47ffc2578bd 100644
--- a/src/server/game/Handlers/CombatHandler.cpp
+++ b/src/server/game/Handlers/CombatHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Handlers/DuelHandler.cpp b/src/server/game/Handlers/DuelHandler.cpp
index 01c2257c3dc..b07df587fbf 100644
--- a/src/server/game/Handlers/DuelHandler.cpp
+++ b/src/server/game/Handlers/DuelHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp
index 4333f4f75d4..6404d3c8e41 100644
--- a/src/server/game/Handlers/GroupHandler.cpp
+++ b/src/server/game/Handlers/GroupHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -741,7 +741,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke
playerStatus |= MEMBER_STATUS_DEAD;
}
- if (player->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
+ if (player->IsFFAPvP())
playerStatus |= MEMBER_STATUS_PVP_FFA;
if (player->isAFK())
@@ -943,7 +943,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recvData)
playerStatus |= MEMBER_STATUS_DEAD;
}
- if (player->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
+ if (player->IsFFAPvP())
playerStatus |= MEMBER_STATUS_PVP_FFA;
if (player->isAFK())
diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp
index 96f1ce49d47..9df633a4c5e 100644
--- a/src/server/game/Handlers/GuildHandler.cpp
+++ b/src/server/game/Handlers/GuildHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -43,19 +43,10 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket)
void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket)
{
- TC_LOG_DEBUG("network", "WORLD: Received CMSG_GUILD_CREATE");
-
std::string name;
recvPacket >> name;
- if (!GetPlayer()->GetGuildId()) // Player cannot be in guild
- {
- Guild* guild = new Guild();
- if (guild->Create(GetPlayer(), name))
- sGuildMgr->AddGuild(guild);
- else
- delete guild;
- }
+ TC_LOG_ERROR("guild", "CMSG_GUILD_CREATE: Possible hacking-attempt: %s tried to create a guild [Name: %s] using cheats", GetPlayerInfo().c_str(), name.c_str());
}
void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index ad99c009a4f..3571410fd5c 100644
--- a/src/server/game/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -991,9 +991,9 @@ void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket)
void WorldSession::HandleSetAmmoOpcode(WorldPacket& recvData)
{
- if (!GetPlayer()->IsAlive())
+ if (!_player->IsAlive())
{
- GetPlayer()->SendEquipError(EQUIP_ERR_YOU_ARE_DEAD, NULL, NULL);
+ _player->SendEquipError(EQUIP_ERR_YOU_ARE_DEAD, NULL, NULL);
return;
}
@@ -1002,10 +1002,18 @@ void WorldSession::HandleSetAmmoOpcode(WorldPacket& recvData)
recvData >> item;
- if (!item)
- GetPlayer()->RemoveAmmo();
+ if (item)
+ {
+ if (!_player->GetItemCount(item))
+ {
+ _player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
+ return;
+ }
+
+ _player->SetAmmo(item);
+ }
else
- GetPlayer()->SetAmmo(item);
+ _player->RemoveAmmo();
}
void WorldSession::SendEnchantmentLog(uint64 target, uint64 caster, uint32 itemId, uint32 enchantId)
diff --git a/src/server/game/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp
index b0780873e87..a984c033872 100644
--- a/src/server/game/Handlers/LFGHandler.cpp
+++ b/src/server/game/Handlers/LFGHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp
index 9a371178044..4fd912298ec 100644
--- a/src/server/game/Handlers/LootHandler.cpp
+++ b/src/server/game/Handlers/LootHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -229,7 +229,7 @@ void WorldSession::HandleLootOpcode(WorldPacket& recvData)
GetPlayer()->SendLoot(guid, LOOT_CORPSE);
// interrupt cast
- if (GetPlayer()->IsNonMeleeSpellCasted(false))
+ if (GetPlayer()->IsNonMeleeSpellCast(false))
GetPlayer()->InterruptNonMeleeSpells(false);
}
@@ -419,6 +419,13 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData)
if (_player->GetLootGUID() != lootguid)
return;
+ if (!_player->IsInRaidWith(target) || !_player->IsInMap(target))
+ {
+ TC_LOG_INFO("loot", "MasterLootItem: Player %s tried to give an item to ineligible player %s !", GetPlayer()->GetName().c_str(), target->GetName().c_str());
+ return;
+ }
+
+
Loot* loot = NULL;
if (IS_CRE_OR_VEH_GUID(GetPlayer()->GetLootGUID()))
diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp
index 574756d8fcd..4cb06a1d469 100644
--- a/src/server/game/Handlers/MailHandler.cpp
+++ b/src/server/game/Handlers/MailHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp
index 4da0d829bae..fcec4f38852 100644
--- a/src/server/game/Handlers/MiscHandler.cpp
+++ b/src/server/game/Handlers/MiscHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -734,34 +734,34 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket& recvData)
uint64 guid;
recvData >> guid;
- if (GetPlayer()->IsAlive())
+ if (_player->IsAlive())
return;
// do not allow corpse reclaim in arena
- if (GetPlayer()->InArena())
+ if (_player->InArena())
return;
// body not released yet
- if (!GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
+ if (!_player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
return;
- Corpse* corpse = GetPlayer()->GetCorpse();
+ Corpse* corpse = _player->GetCorpse();
if (!corpse)
return;
// prevent resurrect before 30-sec delay after body release not finished
- if (time_t(corpse->GetGhostTime() + GetPlayer()->GetCorpseReclaimDelay(corpse->GetType() == CORPSE_RESURRECTABLE_PVP)) > time_t(time(NULL)))
+ if (time_t(corpse->GetGhostTime() + _player->GetCorpseReclaimDelay(corpse->GetType() == CORPSE_RESURRECTABLE_PVP)) > time_t(time(NULL)))
return;
- if (!corpse->IsWithinDistInMap(GetPlayer(), CORPSE_RECLAIM_RADIUS, true))
+ if (!corpse->IsWithinDistInMap(_player, CORPSE_RECLAIM_RADIUS, true))
return;
// resurrect
- GetPlayer()->ResurrectPlayer(GetPlayer()->InBattleground() ? 1.0f : 0.5f);
+ _player->ResurrectPlayer(_player->InBattleground() ? 1.0f : 0.5f);
// spawn bones
- GetPlayer()->SpawnCorpseBones();
+ _player->SpawnCorpseBones();
}
void WorldSession::HandleResurrectResponseOpcode(WorldPacket& recvData)
@@ -1721,7 +1721,7 @@ void WorldSession::HandleHearthAndResurrect(WorldPacket& /*recvData*/)
return;
_player->BuildPlayerRepop();
- _player->ResurrectPlayer(100);
+ _player->ResurrectPlayer(1.0f);
_player->TeleportTo(_player->m_homebindMapId, _player->m_homebindX, _player->m_homebindY, _player->m_homebindZ, _player->GetOrientation());
}
diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp
index 4b53dedc363..0c2eae849b8 100644
--- a/src/server/game/Handlers/MovementHandler.cpp
+++ b/src/server/game/Handlers/MovementHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -381,6 +381,9 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData)
if (plrMover) // nothing is charmed, or player charmed
{
+ if (plrMover->IsSitState() && (movementInfo.flags & (MOVEMENTFLAG_MASK_MOVING | MOVEMENTFLAG_MASK_TURNING)))
+ plrMover->SetStandState(UNIT_STAND_STATE_STAND);
+
plrMover->UpdateFallInformationIfNeed(movementInfo, opcode);
if (movementInfo.pos.GetPositionZ() < -500.0f)
diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp
index 081548d23f7..4d78064423c 100644
--- a/src/server/game/Handlers/NPCHandler.cpp
+++ b/src/server/game/Handlers/NPCHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Handlers/NPCHandler.h b/src/server/game/Handlers/NPCHandler.h
index bc7cc93a3c7..8aa34eaafa7 100644
--- a/src/server/game/Handlers/NPCHandler.h
+++ b/src/server/game/Handlers/NPCHandler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp
index d57308d359a..550cb74cffa 100644
--- a/src/server/game/Handlers/PetHandler.cpp
+++ b/src/server/game/Handlers/PetHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp
index 23cd0bdfd94..d02b8986e08 100644
--- a/src/server/game/Handlers/PetitionsHandler.cpp
+++ b/src/server/game/Handlers/PetitionsHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp
index 01dbf201a82..e30260d34e2 100644
--- a/src/server/game/Handlers/QueryHandler.cpp
+++ b/src/server/game/Handlers/QueryHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp
index 1e2d3aff4ee..e8d43b55fd8 100644
--- a/src/server/game/Handlers/QuestHandler.cpp
+++ b/src/server/game/Handlers/QuestHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -36,8 +36,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket& recvData)
{
uint64 guid;
recvData >> guid;
- uint8 questStatus = DIALOG_STATUS_NONE;
- uint8 defstatus = DIALOG_STATUS_NONE;
+ uint32 questStatus = DIALOG_STATUS_NONE;
Object* questgiver = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
if (!questgiver)
@@ -50,23 +49,23 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket& recvData)
{
case TYPEID_UNIT:
{
- TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u", uint32(GUID_LOPART(guid)));
- Creature* cr_questgiver=questgiver->ToCreature();
+ TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u", questgiver->GetGUIDLow());
+ Creature* cr_questgiver = questgiver->ToCreature();
if (!cr_questgiver->IsHostileTo(_player)) // do not show quest status to enemies
{
questStatus = sScriptMgr->GetDialogStatus(_player, cr_questgiver);
- if (questStatus > 6)
- questStatus = getDialogStatus(_player, cr_questgiver, defstatus);
+ if (questStatus == DIALOG_STATUS_SCRIPTED_NO_STATUS)
+ questStatus = getDialogStatus(_player, cr_questgiver);
}
break;
}
case TYPEID_GAMEOBJECT:
{
- TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u", uint32(GUID_LOPART(guid)));
- GameObject* go_questgiver=(GameObject*)questgiver;
+ TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u", questgiver->GetGUIDLow());
+ GameObject* go_questgiver = questgiver->ToGameObject();
questStatus = sScriptMgr->GetDialogStatus(_player, go_questgiver);
- if (questStatus > 6)
- questStatus = getDialogStatus(_player, go_questgiver, defstatus);
+ if (questStatus == DIALOG_STATUS_SCRIPTED_NO_STATUS)
+ questStatus = getDialogStatus(_player, go_questgiver);
break;
}
default:
@@ -75,7 +74,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket& recvData)
}
//inform client about status of quest
- _player->PlayerTalkClass->SendQuestGiverStatus(questStatus, guid);
+ _player->PlayerTalkClass->SendQuestGiverStatus(uint8(questStatus), guid);
}
void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket& recvData)
@@ -239,6 +238,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket& recvData)
default:
break;
}
+
_player->PlayerTalkClass->SendCloseGossip();
if (quest->GetSrcSpell() > 0)
@@ -278,11 +278,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket& recvData)
return;
if (quest->IsAutoAccept() && _player->CanAddQuest(quest, true))
- {
- _player->AddQuest(quest, object);
- if (_player->CanCompleteQuest(questId))
- _player->CompleteQuest(questId);
- }
+ _player->AddQuestAndCheckCompletion(quest, object);
if (quest->HasFlag(QUEST_FLAGS_AUTOCOMPLETE))
_player->PlayerTalkClass->SendQuestGiverRequestItems(quest, object->GetGUID(), _player->CanCompleteQuest(quest->GetQuestId()), true);
@@ -348,11 +344,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData)
if (Quest const* nextQuest = _player->GetNextQuest(guid, quest))
{
if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(nextQuest, true))
- {
- _player->AddQuest(nextQuest, object);
- if (_player->CanCompleteQuest(nextQuest->GetQuestId()))
- _player->CompleteQuest(nextQuest->GetQuestId());
- }
+ _player->AddQuestAndCheckCompletion(nextQuest, object);
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true);
}
@@ -367,11 +359,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData)
if (Quest const* nextQuest = _player->GetNextQuest(guid, quest))
{
if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(nextQuest, true))
- {
- _player->AddQuest(nextQuest, object);
- if (_player->CanCompleteQuest(nextQuest->GetQuestId()))
- _player->CompleteQuest(nextQuest->GetQuestId());
- }
+ _player->AddQuestAndCheckCompletion(nextQuest, object);
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true);
}
@@ -494,7 +482,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData)
return;
if (_player->CanAddQuest(quest, true))
- _player->AddQuest(quest, NULL); // NULL, this prevent DB script from duplicate running
+ _player->AddQuestAndCheckCompletion(quest, NULL); // NULL, this prevent DB script from duplicate running
_player->SetDivider(0);
}
@@ -615,11 +603,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_SHARING_QUEST);
if (quest->IsAutoAccept() && receiver->CanAddQuest(quest, true) && receiver->CanTakeQuest(quest, true))
- {
- receiver->AddQuest(quest, sender);
- if (receiver->CanCompleteQuest(questId))
- receiver->CompleteQuest(questId);
- }
+ receiver->AddQuestAndCheckCompletion(quest, sender);
if ((quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly()) || quest->HasFlag(QUEST_FLAGS_AUTOCOMPLETE))
receiver->PlayerTalkClass->SendQuestGiverRequestItems(quest, sender->GetGUID(), receiver->CanCompleteRepeatableQuest(quest), true);
@@ -654,9 +638,9 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket)
}
}
-uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver, uint32 defstatus)
+uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver)
{
- uint32 result = defstatus;
+ uint32 result = DIALOG_STATUS_NONE;
QuestRelationBounds qr;
QuestRelationBounds qir;
@@ -697,7 +681,7 @@ uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver, uint32
if ((status == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(quest_id)) ||
(quest->IsAutoComplete() && player->CanTakeQuest(quest, false)))
{
- if (quest->IsAutoComplete() && quest->IsRepeatable())
+ if (quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly())
result2 = DIALOG_STATUS_REWARD_REP;
else
result2 = DIALOG_STATUS_REWARD;
@@ -728,11 +712,11 @@ uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver, uint32
{
if (player->SatisfyQuestLevel(quest, false))
{
- if (quest->IsAutoComplete() || (quest->IsRepeatable() && player->IsQuestRewarded(quest_id)))
+ if (quest->IsAutoComplete())
result2 = DIALOG_STATUS_REWARD_REP;
else if (player->getLevel() <= ((player->GetQuestLevel(quest) == -1) ? player->getLevel() : player->GetQuestLevel(quest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF)))
{
- if (quest->HasFlag(QUEST_FLAGS_DAILY) || quest->HasFlag(QUEST_FLAGS_WEEKLY))
+ if (quest->IsDaily())
result2 = DIALOG_STATUS_AVAILABLE_REP;
else
result2 = DIALOG_STATUS_AVAILABLE;
@@ -763,8 +747,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket
for (Player::ClientGUIDs::const_iterator itr = _player->m_clientGUIDs.begin(); itr != _player->m_clientGUIDs.end(); ++itr)
{
- uint8 questStatus = DIALOG_STATUS_NONE;
- uint8 defstatus = DIALOG_STATUS_NONE;
+ uint32 questStatus = DIALOG_STATUS_NONE;
if (IS_CRE_OR_VEH_OR_PET_GUID(*itr))
{
@@ -774,9 +757,10 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket
continue;
if (!questgiver->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER))
continue;
+
questStatus = sScriptMgr->GetDialogStatus(_player, questgiver);
- if (questStatus > 6)
- questStatus = getDialogStatus(_player, questgiver, defstatus);
+ if (questStatus == DIALOG_STATUS_SCRIPTED_NO_STATUS)
+ questStatus = getDialogStatus(_player, questgiver);
data << uint64(questgiver->GetGUID());
data << uint8(questStatus);
@@ -785,13 +769,12 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket
else if (IS_GAMEOBJECT_GUID(*itr))
{
GameObject* questgiver = GetPlayer()->GetMap()->GetGameObject(*itr);
- if (!questgiver)
- continue;
- if (questgiver->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
+ if (!questgiver || questgiver->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
continue;
+
questStatus = sScriptMgr->GetDialogStatus(_player, questgiver);
- if (questStatus > 6)
- questStatus = getDialogStatus(_player, questgiver, defstatus);
+ if (questStatus == DIALOG_STATUS_SCRIPTED_NO_STATUS)
+ questStatus = getDialogStatus(_player, questgiver);
data << uint64(questgiver->GetGUID());
data << uint8(questStatus);
diff --git a/src/server/game/Handlers/ReferAFriendHandler.cpp b/src/server/game/Handlers/ReferAFriendHandler.cpp
index 9e0b877f64b..3b348b6e214 100644
--- a/src/server/game/Handlers/ReferAFriendHandler.cpp
+++ b/src/server/game/Handlers/ReferAFriendHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp
index 7e2bc11e1b2..bbbe1a4987f 100644
--- a/src/server/game/Handlers/SkillHandler.cpp
+++ b/src/server/game/Handlers/SkillHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp
index b264b0d2fff..75a98247186 100644
--- a/src/server/game/Handlers/SpellHandler.cpp
+++ b/src/server/game/Handlers/SpellHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -67,10 +67,10 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
return;
uint8 bagIndex, slot, castFlags;
- uint8 castCount; // next cast if exists (single or not)
+ uint8 castCount; // next cast if exists (single or not)
uint64 itemGUID;
uint32 glyphIndex; // something to do with glyphs?
- uint32 spellId; // casted spell id
+ uint32 spellId; // cast spell id
recvPacket >> bagIndex >> slot >> castCount >> spellId >> itemGUID >> glyphIndex >> castFlags;
@@ -357,7 +357,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
return;
}
- // Client is resending autoshot cast opcode when other spell is casted during shoot rotation
+ // Client is resending autoshot cast opcode when other spell is cast during shoot rotation
// Skip it to prevent "interrupt" message
if (spellInfo->IsAutoRepeatRangedSpell() && caster->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL)
&& caster->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL)->m_spellInfo == spellInfo)
@@ -383,7 +383,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
{
SpellInfo const* actualSpellInfo = spellInfo->GetAuraRankForLevel(targets.GetUnitTarget()->getLevel());
- // if rank not found then function return NULL but in explicit cast case original spell can be casted and later failed with appropriate error message
+ // if rank not found then function return NULL but in explicit cast case original spell can be cast and later failed with appropriate error message
if (actualSpellInfo)
spellInfo = actualSpellInfo;
}
@@ -400,7 +400,7 @@ void WorldSession::HandleCancelCastOpcode(WorldPacket& recvPacket)
recvPacket.read_skip<uint8>(); // counter, increments with every CANCEL packet, don't use for now
recvPacket >> spellId;
- if (_player->IsNonMeleeSpellCasted(false))
+ if (_player->IsNonMeleeSpellCast(false))
_player->InterruptNonMeleeSpells(false, spellId, false);
}
@@ -417,7 +417,7 @@ void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket)
if (spellInfo->Attributes & SPELL_ATTR0_CANT_CANCEL)
return;
- // channeled spell case (it currently casted then)
+ // channeled spell case (it currently cast then)
if (spellInfo->IsChanneled())
{
if (Spell* curSpell = _player->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp
index 6b42c1a8011..4487ae7b15f 100644
--- a/src/server/game/Handlers/TaxiHandler.cpp
+++ b/src/server/game/Handlers/TaxiHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Handlers/TicketHandler.cpp b/src/server/game/Handlers/TicketHandler.cpp
index ceeac75e34e..b9949ac631d 100644
--- a/src/server/game/Handlers/TicketHandler.cpp
+++ b/src/server/game/Handlers/TicketHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp
index 8befde46550..28a511ad9d3 100644
--- a/src/server/game/Handlers/TradeHandler.cpp
+++ b/src/server/game/Handlers/TradeHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -90,7 +90,7 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/)
data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = next field in most cases
data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = prev field in most cases
data << uint32(view_trade->GetMoney()); // trader gold
- data << uint32(view_trade->GetSpell()); // spell casted on lowest slot item
+ data << uint32(view_trade->GetSpell()); // spell cast on lowest slot item
for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i)
{
@@ -351,7 +351,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
Spell* his_spell = NULL;
SpellCastTargets his_targets;
- // not accept if spell can't be casted now (cheating)
+ // not accept if spell can't be cast now (cheating)
if (uint32 my_spell_id = my_trade->GetSpell())
{
SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(my_spell_id);
@@ -386,7 +386,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
}
}
- // not accept if spell can't be casted now (cheating)
+ // not accept if spell can't be cast now (cheating)
if (uint32 his_spell_id = his_trade->GetSpell())
{
SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(his_spell_id);
diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp
index a0beadc644c..3973b23eab4 100644
--- a/src/server/game/Handlers/VehicleHandler.cpp
+++ b/src/server/game/Handlers/VehicleHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Handlers/VoiceChatHandler.cpp b/src/server/game/Handlers/VoiceChatHandler.cpp
index 456848bf6cc..af2d8e20757 100644
--- a/src/server/game/Handlers/VoiceChatHandler.cpp
+++ b/src/server/game/Handlers/VoiceChatHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp
index ee962621048..c46d9002604 100644
--- a/src/server/game/Instances/InstanceSaveMgr.cpp
+++ b/src/server/game/Instances/InstanceSaveMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -161,6 +161,16 @@ void InstanceSaveManager::RemoveInstanceSave(uint32 InstanceId)
}
}
+void InstanceSaveManager::UnloadInstanceSave(uint32 InstanceId)
+{
+ if (InstanceSave* save = GetInstanceSave(InstanceId))
+ {
+ save->UnloadIfEmpty();
+ if (save->m_toDelete)
+ delete save;
+ }
+}
+
InstanceSave::InstanceSave(uint16 MapId, uint32 InstanceId, Difficulty difficulty, time_t resetTime, bool canReset)
: m_resetTime(resetTime), m_instanceid(InstanceId), m_mapid(MapId),
m_difficulty(difficulty), m_canReset(canReset), m_toDelete(false) { }
@@ -232,6 +242,11 @@ bool InstanceSave::UnloadIfEmpty()
{
if (m_playerList.empty() && m_groupList.empty())
{
+ // don't remove the save if there are still players inside the map
+ if (Map* map = sMapMgr->FindMap(GetMapId(), GetInstanceId()))
+ if (map->HavePlayers())
+ return true;
+
if (!sInstanceSaveMgr->lock_instLists)
sInstanceSaveMgr->RemoveInstanceSave(GetInstanceId());
diff --git a/src/server/game/Instances/InstanceSaveMgr.h b/src/server/game/Instances/InstanceSaveMgr.h
index 5dda4eb620e..1d753ebaa48 100644
--- a/src/server/game/Instances/InstanceSaveMgr.h
+++ b/src/server/game/Instances/InstanceSaveMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -115,16 +115,16 @@ class InstanceSave
but that would depend on a lot of things that can easily change in future */
Difficulty GetDifficulty() const { return m_difficulty; }
+ typedef std::list<Player*> PlayerListType;
+ typedef std::list<Group*> GroupListType;
+ private:
+ bool UnloadIfEmpty();
/* used to flag the InstanceSave as to be deleted, so the caller can delete it */
void SetToDelete(bool toDelete)
{
m_toDelete = toDelete;
}
- typedef std::list<Player*> PlayerListType;
- typedef std::list<Group*> GroupListType;
- private:
- bool UnloadIfEmpty();
/* the only reason the instSave-object links are kept is because
the object-instSave links need to be broken at reset time */
/// @todo: Check if maybe it's enough to just store the number of players/groups
@@ -195,6 +195,7 @@ class InstanceSaveManager
InstanceSave* AddInstanceSave(uint32 mapId, uint32 instanceId, Difficulty difficulty, time_t resetTime,
bool canReset, bool load = false);
void RemoveInstanceSave(uint32 InstanceId);
+ void UnloadInstanceSave(uint32 InstanceId);
static void DeleteInstanceFromDB(uint32 instanceid);
InstanceSave* GetInstanceSave(uint32 InstanceId);
diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp
index 2e5ed1d487e..d21ebca9a91 100644
--- a/src/server/game/Instances/InstanceScript.cpp
+++ b/src/server/game/Instances/InstanceScript.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h
index acc8012bbbc..3050443edc0 100644
--- a/src/server/game/Instances/InstanceScript.h
+++ b/src/server/game/Instances/InstanceScript.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -243,6 +243,16 @@ AI* GetInstanceAI(T* obj, char const* scriptName)
return new AI(obj);
return NULL;
-}
+};
+
+template<class AI, class T>
+AI* GetInstanceAI(T* obj)
+{
+ if (InstanceMap* instance = obj->GetMap()->ToInstanceMap())
+ if (instance->GetInstanceScript())
+ return new AI(obj);
+
+ return NULL;
+};
#endif // TRINITY_INSTANCE_DATA_H
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 3505722b08b..bb7f679b7cd 100644
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -364,6 +364,7 @@ LootItem::LootItem(LootStoreItem const& li)
randomSuffix = GenerateEnchSuffixFactor(itemid);
randomPropertyId = Item::GenerateItemRandomPropertyId(itemid);
+ count = 0;
is_looted = 0;
is_blocked = 0;
is_underthreshold = 0;
diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h
index 895d09fe7ad..96af1919e90 100644
--- a/src/server/game/Loot/LootMgr.h
+++ b/src/server/game/Loot/LootMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -148,7 +148,9 @@ struct LootItem
explicit LootItem(LootStoreItem const& li);
// Empty constructor for creating an empty LootItem to be filled in with DB data
- LootItem() : canSave(true){ };
+ LootItem() : itemid(0), randomSuffix(0), randomPropertyId(0), count(0), is_looted(false), is_blocked(false),
+ freeforall(false), is_underthreshold(false), is_counted(false), needs_quest(false), follow_loot_rules(false),
+ canSave(true){ };
// Basic checks for player/item compatibility - if false no chance to see the item in the loot
bool AllowedForPlayer(Player const* player) const;
@@ -303,7 +305,7 @@ struct Loot
// Only set for inventory items that can be right-click looted
uint32 containerID;
- Loot(uint32 _gold = 0) : gold(_gold), unlootedCount(0), loot_type(LOOT_CORPSE), maxDuplicates(1), containerID(0) { }
+ Loot(uint32 _gold = 0) : gold(_gold), unlootedCount(0), roundRobinPlayer(0), loot_type(LOOT_CORPSE), maxDuplicates(1), containerID(0) { }
~Loot() { clear(); }
// For deleting items at loot removal since there is no backward interface to the Item()
diff --git a/src/server/game/Mails/Mail.cpp b/src/server/game/Mails/Mail.cpp
index 2b47348e5f6..8c82ef8f45b 100644
--- a/src/server/game/Mails/Mail.cpp
+++ b/src/server/game/Mails/Mail.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Mails/Mail.h b/src/server/game/Mails/Mail.h
index d4553233b64..e3fc42f3f9e 100644
--- a/src/server/game/Mails/Mail.h
+++ b/src/server/game/Mails/Mail.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 6f99ee07c05..21e282cfcf4 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -63,19 +63,6 @@ Map::~Map()
obj->ResetMap();
}
- for (TransportsContainer::iterator itr = _transports.begin(); itr != _transports.end();)
- {
- Transport* transport = *itr;
- ++itr;
-
- // Destroy local transports
- if (transport->GetTransportTemplate()->inInstance)
- {
- transport->RemoveFromWorld();
- delete transport;
- }
- }
-
if (!m_scriptSchedule.empty())
sScriptMgr->DecreaseScheduledScriptCount(m_scriptSchedule.size());
@@ -566,6 +553,22 @@ bool Map::AddToMap(Transport* obj)
obj->AddToWorld();
_transports.insert(obj);
+ // Broadcast creation to players
+ if (!GetPlayers().isEmpty())
+ {
+ for (Map::PlayerList::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
+ {
+ if (itr->GetSource()->GetTransport() != obj)
+ {
+ UpdateData data;
+ obj->BuildCreateUpdateBlockForPlayer(&data, itr->GetSource());
+ WorldPacket packet;
+ data.BuildPacket(&packet);
+ itr->GetSource()->SendDirectMessage(&packet);
+ }
+ }
+ }
+
return true;
}
@@ -814,6 +817,18 @@ void Map::RemoveFromMap(Transport* obj, bool remove)
{
obj->RemoveFromWorld();
+ Map::PlayerList const& players = GetPlayers();
+ if (!players.isEmpty())
+ {
+ UpdateData data;
+ obj->BuildOutOfRangeUpdateBlock(&data);
+ WorldPacket packet;
+ data.BuildPacket(&packet);
+ for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
+ if (itr->GetSource()->GetTransport() != obj)
+ itr->GetSource()->SendDirectMessage(&packet);
+ }
+
if (_transportsUpdateIter != _transports.end())
{
TransportsContainer::iterator itr = _transports.find(obj);
@@ -1361,6 +1376,17 @@ void Map::UnloadAll()
++i;
UnloadGrid(grid, true); // deletes the grid and removes it from the GridRefManager
}
+
+ for (TransportsContainer::iterator itr = _transports.begin(); itr != _transports.end();)
+ {
+ Transport* transport = *itr;
+ ++itr;
+
+ transport->RemoveFromWorld();
+ delete transport;
+ }
+
+ _transports.clear();
}
// *****************************
@@ -1375,6 +1401,7 @@ GridMap::GridMap()
// Height level data
_gridHeight = INVALID_HEIGHT;
_gridGetHeight = &GridMap::getHeightFromFlat;
+ _gridIntHeightMultiplier = 0;
m_V9 = NULL;
m_V8 = NULL;
// Liquid data
@@ -2836,6 +2863,7 @@ void InstanceMap::RemovePlayerFromMap(Player* player, bool remove)
Map::RemovePlayerFromMap(player, remove);
// for normal instances schedule the reset after all players have left
SetResetSchedule(true);
+ sInstanceSaveMgr->UnloadInstanceSave(GetInstanceId());
}
void InstanceMap::CreateInstanceData(bool load)
diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h
index 932f3e213ae..8e7886dc5d2 100644
--- a/src/server/game/Maps/Map.h
+++ b/src/server/game/Maps/Map.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp
index 667f94fb53a..e914a5c3eee 100644
--- a/src/server/game/Maps/MapInstanced.cpp
+++ b/src/server/game/Maps/MapInstanced.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Maps/MapInstanced.h b/src/server/game/Maps/MapInstanced.h
index 0955acc1432..aa2b5f95d3f 100644
--- a/src/server/game/Maps/MapInstanced.h
+++ b/src/server/game/Maps/MapInstanced.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp
index 2e034f5a254..2e10fdc374b 100644
--- a/src/server/game/Maps/MapManager.cpp
+++ b/src/server/game/Maps/MapManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -37,12 +37,11 @@
#include "WorldSession.h"
#include "Opcodes.h"
-extern GridState* si_GridStates[]; // debugging code, should be deleted some day
-
MapManager::MapManager()
{
i_gridCleanUpDelay = sWorld->getIntConfig(CONFIG_INTERVAL_GRIDCLEAN);
i_timer.SetInterval(sWorld->getIntConfig(CONFIG_INTERVAL_MAPUPDATE));
+ _nextInstanceId = 0;
}
MapManager::~MapManager() { }
@@ -51,13 +50,6 @@ void MapManager::Initialize()
{
Map::InitStateMachine();
- // debugging code, should be deleted some day
- {
- for (uint8 i = 0; i < MAX_GRID_STATE; ++i)
- i_GridStates[i] = si_GridStates[i];
-
- i_GridStateErrorCount = 0;
- }
int num_threads(sWorld->getIntConfig(CONFIG_NUMTHREADS));
// Start mtmaps if needed.
if (num_threads > 0 && m_updater.activate(num_threads) == -1)
@@ -70,31 +62,6 @@ void MapManager::InitializeVisibilityDistanceInfo()
(*iter).second->InitVisibilityDistance();
}
-// debugging code, should be deleted some day
-void MapManager::checkAndCorrectGridStatesArray()
-{
- bool ok = true;
- for (int i=0; i<MAX_GRID_STATE; i++)
- {
- if (i_GridStates[i] != si_GridStates[i])
- {
- TC_LOG_ERROR("maps", "MapManager::checkGridStates(), GridState: si_GridStates is currupt !!!");
- ok = false;
- si_GridStates[i] = i_GridStates[i];
- }
- #ifdef TRINITY_DEBUG
- // inner class checking only when compiled with debug
- if (!si_GridStates[i]->checkMagic())
- {
- ok = false;
- si_GridStates[i]->setMagic();
- }
- #endif
- }
- if (!ok)
- ++i_GridStateErrorCount;
-}
-
Map* MapManager::CreateBaseMap(uint32 id)
{
Map* map = FindBaseMap(id);
diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h
index 230b4648f4a..98a5f8c7180 100644
--- a/src/server/game/Maps/MapManager.h
+++ b/src/server/game/Maps/MapManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -129,11 +129,6 @@ class MapManager
typedef UNORDERED_MAP<uint32, Map*> MapMapType;
typedef std::vector<bool> InstanceIds;
- // debugging code, should be deleted some day
- void checkAndCorrectGridStatesArray(); // just for debugging to find some memory overwrites
- GridState* i_GridStates[MAX_GRID_STATE]; // shadow entries to the global array in Map.cpp
- int i_GridStateErrorCount;
-
MapManager();
~MapManager();
diff --git a/src/server/game/Maps/MapRefManager.h b/src/server/game/Maps/MapRefManager.h
index 0ef57b5e238..a04b76c8dc0 100644
--- a/src/server/game/Maps/MapRefManager.h
+++ b/src/server/game/Maps/MapRefManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Maps/MapReference.h b/src/server/game/Maps/MapReference.h
index 25c4b3870c5..fe5ceb714c5 100644
--- a/src/server/game/Maps/MapReference.h
+++ b/src/server/game/Maps/MapReference.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Maps/TransportMgr.cpp b/src/server/game/Maps/TransportMgr.cpp
index 11798201397..28869d264c4 100644
--- a/src/server/game/Maps/TransportMgr.cpp
+++ b/src/server/game/Maps/TransportMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -87,28 +87,60 @@ void TransportMgr::LoadTransportTemplates()
TC_LOG_INFO("server.loading", ">> Loaded %u transport templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
+class SplineRawInitializer
+{
+public:
+ SplineRawInitializer(Movement::PointsArray& points) : _points(points) { }
+
+ void operator()(uint8& mode, bool& cyclic, Movement::PointsArray& points, int& lo, int& hi) const
+ {
+ mode = Movement::SplineBase::ModeCatmullrom;
+ cyclic = false;
+ points.assign(_points.begin(), _points.end());
+ lo = 1;
+ hi = points.size() - 2;
+ }
+
+ Movement::PointsArray& _points;
+};
+
void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTemplate* transport)
{
uint32 pathId = goInfo->moTransport.taxiPathId;
TaxiPathNodeList const& path = sTaxiPathNodesByPath[pathId];
std::vector<KeyFrame>& keyFrames = transport->keyFrames;
- Movement::PointsArray splinePath;
+ Movement::PointsArray splinePath, allPoints;
bool mapChange = false;
- bool cyclic = true;
+ for (size_t i = 0; i < path.size(); ++i)
+ allPoints.push_back(G3D::Vector3(path[i].x, path[i].y, path[i].z));
+
+ // Add extra points to allow derivative calculations for all path nodes
+ allPoints.insert(allPoints.begin(), allPoints.front().lerp(allPoints[1], -0.2f));
+ allPoints.push_back(allPoints.back().lerp(allPoints[allPoints.size() - 2], -0.2f));
+ allPoints.push_back(allPoints.back().lerp(allPoints[allPoints.size() - 2], -1.0f));
+
+ SplineRawInitializer initer(allPoints);
+ TransportSpline orientationSpline;
+ orientationSpline.init_spline_custom(initer);
+ orientationSpline.initLengths();
+
for (size_t i = 0; i < path.size(); ++i)
{
if (!mapChange)
{
TaxiPathNodeEntry const& node_i = path[i];
- if (i != path.size() - 1 && (node_i.actionFlag == 1 || node_i.mapid != path[i + 1].mapid))
+ if (i != path.size() - 1 && (node_i.actionFlag & 1 || node_i.mapid != path[i + 1].mapid))
{
- cyclic = false;
keyFrames.back().Teleport = true;
mapChange = true;
}
else
{
KeyFrame k(node_i);
+ G3D::Vector3 h;
+ orientationSpline.evaluate_derivative(i + 1, 0.0f, h);
+ k.InitialOrientation = Position::NormalizeOrientation(atan2(h.y, h.x) + M_PI);
+
keyFrames.push_back(k);
splinePath.push_back(G3D::Vector3(node_i.x, node_i.y, node_i.z));
transport->mapsUsed.insert(k.Node->mapid);
@@ -118,16 +150,15 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl
mapChange = false;
}
- // Not sure if data8 means the transport can be stopped or that its path in dbc does not contain extra spline points
- if (!goInfo->moTransport.canBeStopped && splinePath.size() >= 2)
+ if (splinePath.size() >= 2)
{
// Remove special catmull-rom spline points
- splinePath.erase(splinePath.begin());
- keyFrames.erase(keyFrames.begin());
- splinePath.pop_back();
- keyFrames.pop_back();
- // Cyclic spline has one more extra point
- if (cyclic && !splinePath.empty())
+ if (!keyFrames.front().IsStopFrame() && !keyFrames.front().Node->arrivalEventID && !keyFrames.front().Node->departureEventID)
+ {
+ splinePath.erase(splinePath.begin());
+ keyFrames.erase(keyFrames.begin());
+ }
+ if (!keyFrames.back().IsStopFrame() && !keyFrames.back().Node->arrivalEventID && !keyFrames.back().Node->departureEventID)
{
splinePath.pop_back();
keyFrames.pop_back();
@@ -170,67 +201,41 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl
// find the rest of the distances between key points
// Every path segment has its own spline
- if (cyclic)
- {
- TransportSpline* spline = new TransportSpline();
- spline->init_cyclic_spline(&splinePath[0], splinePath.size(), Movement::SplineBase::ModeCatmullrom, 0);
- spline->initLengths();
- keyFrames[0].DistFromPrev = spline->length(spline->last() - 2, spline->last() - 1);
- keyFrames[0].Spline = spline;
- for (size_t i = 0; i < keyFrames.size(); ++i)
- {
- keyFrames[i].Index = i + 1;
- keyFrames[i].DistFromPrev = spline->length(i, i + 1);
- if (i > 0)
- keyFrames[i - 1].NextDistFromPrev = keyFrames[i].DistFromPrev;
- keyFrames[i].Spline = spline;
- if (keyFrames[i].IsStopFrame())
- {
- // remember first stop frame
- if (firstStop == -1)
- firstStop = i;
- lastStop = i;
- }
- }
- }
- else
+ size_t start = 0;
+ for (size_t i = 1; i < keyFrames.size(); ++i)
{
- size_t start = 0;
- for (size_t i = 1; i < keyFrames.size(); ++i)
+ if (keyFrames[i - 1].Teleport || i + 1 == keyFrames.size())
{
- if (keyFrames[i - 1].Teleport || i + 1 == keyFrames.size())
+ size_t extra = !keyFrames[i - 1].Teleport ? 1 : 0;
+ TransportSpline* spline = new TransportSpline();
+ spline->init_spline(&splinePath[start], i - start + extra, Movement::SplineBase::ModeCatmullrom);
+ spline->initLengths();
+ for (size_t j = start; j < i + extra; ++j)
{
- size_t extra = !keyFrames[i - 1].Teleport ? 1 : 0;
- TransportSpline* spline = new TransportSpline();
- spline->init_spline(&splinePath[start], i - start + extra, Movement::SplineBase::ModeCatmullrom);
- spline->initLengths();
- for (size_t j = start; j < i + extra; ++j)
- {
- keyFrames[j].Index = j - start + 1;
- keyFrames[j].DistFromPrev = spline->length(j - start, j + 1 - start);
- if (j > 0)
- keyFrames[j - 1].NextDistFromPrev = keyFrames[j].DistFromPrev;
- keyFrames[j].Spline = spline;
- }
-
- if (keyFrames[i - 1].Teleport)
- {
- keyFrames[i].Index = i - start + 1;
- keyFrames[i].DistFromPrev = 0.0f;
- keyFrames[i - 1].NextDistFromPrev = 0.0f;
- keyFrames[i].Spline = spline;
- }
-
- start = i;
+ keyFrames[j].Index = j - start + 1;
+ keyFrames[j].DistFromPrev = spline->length(j - start, j + 1 - start);
+ if (j > 0)
+ keyFrames[j - 1].NextDistFromPrev = keyFrames[j].DistFromPrev;
+ keyFrames[j].Spline = spline;
}
- if (keyFrames[i].IsStopFrame())
+ if (keyFrames[i - 1].Teleport)
{
- // remember first stop frame
- if (firstStop == -1)
- firstStop = i;
- lastStop = i;
+ keyFrames[i].Index = i - start + 1;
+ keyFrames[i].DistFromPrev = 0.0f;
+ keyFrames[i - 1].NextDistFromPrev = 0.0f;
+ keyFrames[i].Spline = spline;
}
+
+ start = i;
+ }
+
+ if (keyFrames[i].IsStopFrame())
+ {
+ // remember first stop frame
+ if (firstStop == -1)
+ firstStop = i;
+ lastStop = i;
}
}
@@ -373,7 +378,7 @@ Transport* TransportMgr::CreateTransport(uint32 entry, uint32 guid /*= 0*/, Map*
float x = startNode->x;
float y = startNode->y;
float z = startNode->z;
- float o = 0.0f;
+ float o = tInfo->keyFrames.begin()->InitialOrientation;
// initialize the gameobject base
uint32 guidLow = guid ? guid : sObjectMgr->GenerateLowGuid(HIGHGUID_MO_TRANSPORT);
diff --git a/src/server/game/Maps/TransportMgr.h b/src/server/game/Maps/TransportMgr.h
index 205a614eabb..a207522c4df 100644
--- a/src/server/game/Maps/TransportMgr.h
+++ b/src/server/game/Maps/TransportMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -38,7 +38,7 @@ typedef UNORDERED_MAP<uint32, std::set<uint32> > TransportInstanceMap;
struct KeyFrame
{
- explicit KeyFrame(TaxiPathNodeEntry const& _node) : Index(0), Node(&_node),
+ explicit KeyFrame(TaxiPathNodeEntry const& _node) : Index(0), Node(&_node), InitialOrientation(0.0f),
DistSinceStop(-1.0f), DistUntilStop(-1.0f), DistFromPrev(-1.0f), TimeFrom(0.0f), TimeTo(0.0f),
Teleport(false), ArriveTime(0), DepartureTime(0), Spline(NULL), NextDistFromPrev(0.0f), NextArriveTime(0)
{
@@ -46,6 +46,7 @@ struct KeyFrame
uint32 Index;
TaxiPathNodeEntry const* Node;
+ float InitialOrientation;
float DistSinceStop;
float DistUntilStop;
float DistFromPrev;
diff --git a/src/server/game/Maps/ZoneScript.h b/src/server/game/Maps/ZoneScript.h
index a745b94f466..5925806db75 100644
--- a/src/server/game/Maps/ZoneScript.h
+++ b/src/server/game/Maps/ZoneScript.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h
index 715a1f5f2c0..8d0e97dc765 100644
--- a/src/server/game/Miscellaneous/Formulas.h
+++ b/src/server/game/Miscellaneous/Formulas.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index 327d7ed69fd..3102e2c6854 100644
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -1215,6 +1215,18 @@ enum TrinityStrings
LANG_AUTO_BROADCAST = 11000,
LANG_INVALID_REALMID = 11001,
+ // Show Kick in world
+ LANG_COMMAND_KICKMESSAGE_WORLD = 11002,
+
+ // Show Mute in world
+ LANG_COMMAND_MUTEMESSAGE_WORLD = 11003,
+
+ // Show Ban in world
+ LANG_BAN_CHARACTER_YOUBANNEDMESSAGE_WORLD = 11004,
+ LANG_BAN_CHARACTER_YOUPERMBANNEDMESSAGE_WORLD = 11005,
+ LANG_BAN_ACCOUNT_YOUBANNEDMESSAGE_WORLD = 11006,
+ LANG_BAN_ACCOUNT_YOUPERMBANNEDMESSAGE_WORLD = 11007,
+
// NOT RESERVED IDS 12000-1999999999
// `db_script_string` table index 2000000000-2000009999 (MIN_DB_SCRIPT_STRING_ID-MAX_DB_SCRIPT_STRING_ID)
// For other tables maybe 2000010000-2147483647 (max index)
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index a3be268110c..e5d3a5312de 100644
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -44,6 +44,14 @@ enum LootModes
LOOT_MODE_HARD_MODE_4 = 0x10
};
+enum Expansions
+{
+ EXPANSION_CLASSIC = 0,
+ EXPANSION_THE_BURNING_CRUSADE = 1,
+ EXPANSION_WRATH_OF_THE_LICH_KING = 2,
+ MAX_EXPANSIONS = 3
+};
+
enum Gender
{
GENDER_MALE = 0,
@@ -386,7 +394,7 @@ enum SpellAttr3
SPELL_ATTR3_ONLY_TARGET_PLAYERS = 0x00000100, // 8 can only target players
SPELL_ATTR3_TRIGGERED_CAN_TRIGGER_PROC_2 = 0x00000200, // 9 triggered from effect?
SPELL_ATTR3_MAIN_HAND = 0x00000400, // 10 Main hand weapon required
- SPELL_ATTR3_BATTLEGROUND = 0x00000800, // 11 Can casted only on battleground
+ SPELL_ATTR3_BATTLEGROUND = 0x00000800, // 11 Can only be cast in battleground
SPELL_ATTR3_ONLY_TARGET_GHOSTS = 0x00001000, // 12
SPELL_ATTR3_UNK13 = 0x00002000, // 13
SPELL_ATTR3_IS_HONORLESS_TARGET = 0x00004000, // 14 "Honorless Target" only this spells have this flag
diff --git a/src/server/game/Movement/FollowerRefManager.h b/src/server/game/Movement/FollowerRefManager.h
index 92904f8e4af..136b5703fc9 100644
--- a/src/server/game/Movement/FollowerRefManager.h
+++ b/src/server/game/Movement/FollowerRefManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/FollowerReference.cpp b/src/server/game/Movement/FollowerReference.cpp
index 84c6c266cea..e46abf3285c 100644
--- a/src/server/game/Movement/FollowerReference.cpp
+++ b/src/server/game/Movement/FollowerReference.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/FollowerReference.h b/src/server/game/Movement/FollowerReference.h
index 43ad7e7fa58..a97104ce72c 100644
--- a/src/server/game/Movement/FollowerReference.h
+++ b/src/server/game/Movement/FollowerReference.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp
index 60855710218..d224c21efe8 100644
--- a/src/server/game/Movement/MotionMaster.cpp
+++ b/src/server/game/Movement/MotionMaster.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -72,7 +72,8 @@ MotionMaster::~MotionMaster()
{
MovementGenerator *curr = top();
pop();
- if (curr) DirectDelete(curr);
+ if (curr && !isStatic(curr))
+ delete curr; // Skip finalizing on delete, it might launch new movement
}
}
@@ -129,6 +130,9 @@ void MotionMaster::DirectClean(bool reset)
if (curr) DirectDelete(curr);
}
+ if (empty())
+ return;
+
if (needInitTop())
InitTop();
else if (reset)
@@ -155,7 +159,7 @@ void MotionMaster::DirectExpire(bool reset)
DirectDelete(curr);
}
- while (!top())
+ while (!empty() && !top())
--_top;
if (empty())
@@ -175,7 +179,7 @@ void MotionMaster::DelayedExpire()
DelayedDelete(curr);
}
- while (!top())
+ while (!empty() && !top())
--_top;
}
diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h
index 156813f56fb..aabb117ef50 100644
--- a/src/server/game/Movement/MotionMaster.h
+++ b/src/server/game/Movement/MotionMaster.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -87,13 +87,21 @@ class MotionMaster //: private std::stack<MovementGenerator *>
void pop()
{
+ if (empty())
+ return;
+
Impl[_top] = NULL;
- while (!top())
+ while (!empty() && !top())
--_top;
}
void push(_Ty _Val) { ++_top; Impl[_top] = _Val; }
- bool needInitTop() const { return _needInit[_top]; }
+ bool needInitTop() const
+ {
+ if (empty())
+ return false;
+ return _needInit[_top];
+ }
void InitTop();
public:
@@ -112,8 +120,16 @@ class MotionMaster //: private std::stack<MovementGenerator *>
bool empty() const { return (_top < 0); }
int size() const { return _top + 1; }
- _Ty top() const { return Impl[_top]; }
- _Ty GetMotionSlot(int slot) const { return Impl[slot]; }
+ _Ty top() const
+ {
+ ASSERT(!empty());
+ return Impl[_top];
+ }
+ _Ty GetMotionSlot(int slot) const
+ {
+ ASSERT(slot >= 0);
+ return Impl[slot];
+ }
void DirectDelete(_Ty curr);
void DelayedDelete(_Ty curr);
diff --git a/src/server/game/Movement/MovementGenerator.cpp b/src/server/game/Movement/MovementGenerator.cpp
index b102f554c2f..930669e8cf1 100644
--- a/src/server/game/Movement/MovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/MovementGenerator.h b/src/server/game/Movement/MovementGenerator.h
index 92195037e23..f545f9fd314 100755
--- a/src/server/game/Movement/MovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/MovementGeneratorImpl.h b/src/server/game/Movement/MovementGeneratorImpl.h
index b77db7b5b9d..2c3d9bdeea0 100644
--- a/src/server/game/Movement/MovementGeneratorImpl.h
+++ b/src/server/game/Movement/MovementGeneratorImpl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
index ef24b112253..61f3a04bc5d 100755
--- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h
index 1fa9465d6e8..923c1475718 100755
--- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@ template<class T>
class ConfusedMovementGenerator : public MovementGeneratorMedium< T, ConfusedMovementGenerator<T> >
{
public:
- explicit ConfusedMovementGenerator() : i_nextMoveTime(0) { }
+ explicit ConfusedMovementGenerator() : i_nextMoveTime(0), i_x(0), i_y(0), i_z(0) { }
void DoInitialize(T*);
void DoFinalize(T*);
diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
index f78411fc547..572d65b07c7 100644
--- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
#include "MoveSplineInit.h"
#include "MoveSpline.h"
#include "Player.h"
+#include "VMapFactory.h"
#define MIN_QUIET_DISTANCE 28.0f
#define MAX_QUIET_DISTANCE 43.0f
@@ -43,6 +44,20 @@ void FleeingMovementGenerator<T>::_setTargetLocation(T* owner)
float x, y, z;
_getPoint(owner, x, y, z);
+ // Add LOS check for target point
+ Position mypos;
+ owner->GetPosition(&mypos);
+ bool isInLOS = VMAP::VMapFactory::createOrGetVMapManager()->isInLineOfSight(owner->GetMapId(),
+ mypos.m_positionX,
+ mypos.m_positionY,
+ mypos.m_positionZ + 2.0f,
+ x, y, z + 2.0f);
+ if (!isInLOS)
+ {
+ i_nextCheckTime.Reset(200);
+ return;
+ }
+
PathGenerator path(owner);
path.SetPathLengthLimit(30.0f);
bool result = path.CalculatePath(x, y, z);
diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h
index b44bebdbfdf..ba8e228873f 100755
--- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
index 2d9fe4dd27f..986014e1095 100644
--- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature* owner)
arrived = false;
- owner->ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE));
+ owner->ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~(UNIT_STATE_EVADE | UNIT_STATE_IGNORE_PATHFINDING)));
}
bool HomeMovementGenerator<Creature>::DoUpdate(Creature* owner, const uint32 /*time_diff*/)
diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h
index c5bf8879b7b..abe97e21536 100644
--- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp
index 3cba9068139..0a8a9f267dd 100755
--- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h
index 3c5b9c6d20f..bdf9d52b93a 100755
--- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
index f4968b21bd8..0f69ed3b8f7 100755
--- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
index 35e4afacb1a..c596b406cf3 100644
--- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
index 24fd38a3a8f..95c342b70b3 100644
--- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
index ef2807a5f48..a4a8137546d 100644
--- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -37,7 +37,6 @@ class RandomMovementGenerator : public MovementGeneratorMedium< T, RandomMovemen
private:
TimeTrackerSmall i_nextMoveTime;
- uint32 i_nextMove;
float wander_distance;
};
#endif
diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
index f71eddd2f89..f1656592000 100644
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
index 6358aa19cde..1a465097170 100755
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
index 45b61c828f9..c181750a414 100755
--- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -74,19 +74,24 @@ void WaypointMovementGenerator<Creature>::OnArrived(Creature* creature)
if (m_isArrivalDone)
return;
- creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
m_isArrivalDone = true;
if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance)
{
TC_LOG_DEBUG("maps.script", "Creature movement start script %u at point %u for " UI64FMTD ".", i_path->at(i_currentNode)->event_id, i_currentNode, creature->GetGUID());
+ creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
creature->GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, creature, NULL);
}
// Inform script
MovementInform(creature);
creature->UpdateWaypointID(i_currentNode);
- Stop(i_path->at(i_currentNode)->delay);
+
+ if (i_path->at(i_currentNode)->delay)
+ {
+ creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
+ Stop(i_path->at(i_currentNode)->delay);
+ }
}
bool WaypointMovementGenerator<Creature>::StartMove(Creature* creature)
diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
index c22b0c5296f..9b5fe14b9d6 100755
--- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -117,6 +117,10 @@ class FlightPathMovementGenerator : public MovementGeneratorMedium< Player, Flig
{
i_path = &pathnodes;
i_currentNode = startNode;
+ _endGridX = 0.0f;
+ _endGridY = 0.0f;
+ _endMapId = 0;
+ _preloadTargetNode = 0;
}
void DoInitialize(Player*);
void DoReset(Player*);
diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp
index f6ef219522c..87d8e4a0c34 100644
--- a/src/server/game/Movement/Spline/MoveSplineInit.cpp
+++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp
@@ -60,23 +60,27 @@ namespace Movement
{
MoveSpline& move_spline = *unit->movespline;
- bool transport = false;
- Location real_position(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZMinusOffset(), unit->GetOrientation());
- // Elevators also use MOVEMENTFLAG_ONTRANSPORT but we do not keep track of their position changes
- if (unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && unit->GetTransGUID())
- {
- transport = true;
- real_position.x = unit->GetTransOffsetX();
- real_position.y = unit->GetTransOffsetY();
- real_position.z = unit->GetTransOffsetZ();
- real_position.orientation = unit->GetTransOffsetO();
- }
-
+ // Elevators also use MOVEMENTFLAG_ONTRANSPORT but we do not keep track of their position changes (movementInfo.transport.guid is 0 in that case)
+ bool transport = unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && unit->GetTransGUID();
+ Location real_position;
// there is a big chance that current position is unknown if current state is not finalized, need compute it
// this also allows CalculatePath spline position and update map position in much greater intervals
// Don't compute for transport movement if the unit is in a motion between two transports
if (!move_spline.Finalized() && move_spline.onTransport == transport)
real_position = move_spline.ComputePosition();
+ else
+ {
+ Position const* pos;
+ if (!transport)
+ pos = unit;
+ else
+ pos = &unit->m_movementInfo.transport.pos;
+
+ real_position.x = pos->GetPositionX();
+ real_position.y = pos->GetPositionY();
+ real_position.z = pos->GetPositionZ();
+ real_position.orientation = unit->GetOrientation();
+ }
// should i do the things that user should do? - no.
if (args.path.empty())
@@ -135,14 +139,32 @@ namespace Movement
if (move_spline.Finalized())
return;
- Location loc = move_spline.ComputePosition();
+ bool transport = unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && unit->GetTransGUID();
+ Location loc;
+ if (move_spline.onTransport == transport)
+ loc = move_spline.ComputePosition();
+ else
+ {
+ Position const* pos;
+ if (!transport)
+ pos = unit;
+ else
+ pos = &unit->m_movementInfo.transport.pos;
+
+ loc.x = pos->GetPositionX();
+ loc.y = pos->GetPositionY();
+ loc.z = pos->GetPositionZ();
+ loc.orientation = unit->GetOrientation();
+ }
+
args.flags = MoveSplineFlag::Done;
unit->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_SPLINE_ENABLED);
+ move_spline.onTransport = transport;
move_spline.Initialize(args);
WorldPacket data(SMSG_MONSTER_MOVE, 64);
data.append(unit->GetPackGUID());
- if (unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && unit->GetTransGUID())
+ if (transport)
{
data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT);
data.appendPackGUID(unit->GetTransGUID());
diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp
index ae62dc8b447..51932877666 100644
--- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp
+++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.h b/src/server/game/Movement/Spline/MovementPacketBuilder.h
index 3643abd2eca..d1ad3d61eec 100644
--- a/src/server/game/Movement/Spline/MovementPacketBuilder.h
+++ b/src/server/game/Movement/Spline/MovementPacketBuilder.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/server/game/Movement/Spline/Spline.cpp b/src/server/game/Movement/Spline/Spline.cpp
index 887541e2289..6424afc5d6e 100644
--- a/src/server/game/Movement/Spline/Spline.cpp
+++ b/src/server/game/Movement/Spline/Spline.cpp
@@ -156,7 +156,7 @@ float SplineBase::SegLengthLinear(index_type index) const
return (points[index] - points[index+1]).length();
}
-float SplineBase::SegLengthCatmullRom( index_type index ) const
+float SplineBase::SegLengthCatmullRom(index_type index) const
{
ASSERT(index >= index_lo && index < index_hi);
diff --git a/src/server/game/Movement/Spline/Spline.h b/src/server/game/Movement/Spline/Spline.h
index dab31e957f1..1444b2872d1 100644
--- a/src/server/game/Movement/Spline/Spline.h
+++ b/src/server/game/Movement/Spline/Spline.h
@@ -118,7 +118,7 @@ public:
/** As i can see there are a lot of ways how spline can be initialized
would be no harm to have some custom initializers. */
- template<class Init> inline void init_spline(Init& initializer)
+ template<class Init> inline void init_spline_custom(Init& initializer)
{
initializer(m_mode, cyclic, points, index_lo, index_hi);
}
diff --git a/src/server/game/Movement/Waypoints/Path.h b/src/server/game/Movement/Waypoints/Path.h
index 9814d1c65e1..4c275cbc15d 100644
--- a/src/server/game/Movement/Waypoints/Path.h
+++ b/src/server/game/Movement/Waypoints/Path.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp
index 7fc8ae1a63c..f7cb147a148 100644
--- a/src/server/game/Movement/Waypoints/WaypointManager.cpp
+++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Movement/Waypoints/WaypointManager.h b/src/server/game/Movement/Waypoints/WaypointManager.h
index b17714f1a51..fe7ca5ec931 100644
--- a/src/server/game/Movement/Waypoints/WaypointManager.h
+++ b/src/server/game/Movement/Waypoints/WaypointManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp
index 8daafc44d3a..01ee5238789 100644
--- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp
+++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -231,7 +231,7 @@ void OutdoorPvP::DeleteSpawns()
m_capturePoints.clear();
}
-OutdoorPvP::OutdoorPvP() : m_sendUpdate(true) { }
+OutdoorPvP::OutdoorPvP() : m_TypeId(0), m_sendUpdate(true) { }
OutdoorPvP::~OutdoorPvP()
{
diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.h b/src/server/game/OutdoorPvP/OutdoorPvP.h
index 30b9d5c58fc..9ea81ded055 100644
--- a/src/server/game/OutdoorPvP/OutdoorPvP.h
+++ b/src/server/game/OutdoorPvP/OutdoorPvP.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
index c5e441e079d..2b05f7255f6 100644
--- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
+++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h
index 2d8acb56252..54ea2f3ba1d 100644
--- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h
+++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp
index d4211f83a11..b12b5f187ad 100644
--- a/src/server/game/Pools/PoolMgr.cpp
+++ b/src/server/game/Pools/PoolMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -364,7 +364,7 @@ void PoolGroup<Creature>::Spawn1Object(PoolObject* obj)
// We use spawn coords to spawn
if (!map->Instanceable() && map->IsGridLoaded(data->posX, data->posY))
{
- Creature* creature = new Creature;
+ Creature* creature = new Creature();
//TC_LOG_DEBUG("pool", "Spawning creature %u", guid);
if (!creature->LoadCreatureFromDB(obj->guid, map))
{
diff --git a/src/server/game/Pools/PoolMgr.h b/src/server/game/Pools/PoolMgr.h
index c5ded289215..2bc404b3a36 100644
--- a/src/server/game/Pools/PoolMgr.h
+++ b/src/server/game/Pools/PoolMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://www.mangosproject.org/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp
index f2e80bdb996..9b3732d232b 100644
--- a/src/server/game/Quests/QuestDef.cpp
+++ b/src/server/game/Quests/QuestDef.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h
index 88a4ddfcad9..995396c37f5 100644
--- a/src/server/game/Quests/QuestDef.h
+++ b/src/server/game/Quests/QuestDef.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -118,7 +118,10 @@ enum QuestGiverStatus
DIALOG_STATUS_AVAILABLE_REP = 7,
DIALOG_STATUS_AVAILABLE = 8,
DIALOG_STATUS_REWARD2 = 9, // no yellow dot on minimap
- DIALOG_STATUS_REWARD = 10 // yellow dot on minimap
+ DIALOG_STATUS_REWARD = 10, // yellow dot on minimap
+
+ // Custom value meaning that script call did not return any valid quest status
+ DIALOG_STATUS_SCRIPTED_NO_STATUS = 0x1000,
};
enum QuestFlags
diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp
index 272e1bd7a1e..69e677bd89d 100644
--- a/src/server/game/Reputation/ReputationMgr.cpp
+++ b/src/server/game/Reputation/ReputationMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Reputation/ReputationMgr.h b/src/server/game/Reputation/ReputationMgr.h
index e02cc5b62e0..4164dd8ff11 100644
--- a/src/server/game/Reputation/ReputationMgr.h
+++ b/src/server/game/Reputation/ReputationMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp
index 41c18b850a1..58ad725d570 100644
--- a/src/server/game/Scripting/MapScripts.cpp
+++ b/src/server/game/Scripting/MapScripts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -166,7 +166,7 @@ inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* s
{
unit = obj->ToUnit();
if (!unit)
- TC_LOG_ERROR("scripts", "%s %s object could not be casted to unit.",
+ TC_LOG_ERROR("scripts", "%s %s object could not be cast to unit.",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
}
return unit;
@@ -242,7 +242,7 @@ inline void Map::_ScriptProcessDoor(Object* source, Object* target, const Script
{
WorldObject* wSource = dynamic_cast <WorldObject*> (source);
if (!wSource)
- TC_LOG_ERROR("scripts", "%s source object could not be casted to world object (TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ TC_LOG_ERROR("scripts", "%s source object could not be cast to world object (TypeId: %u, Entry: %u, GUID: %u), skipping.",
scriptInfo->GetDebugInfo().c_str(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
else
{
@@ -335,7 +335,7 @@ void Map::ScriptsProcess()
}
}
- Object* target = NULL;
+ WorldObject* target = NULL;
if (step.targetGUID)
{
switch (GUID_HIPART(step.targetGUID))
@@ -421,28 +421,28 @@ void Map::ScriptsProcess()
switch (step.script->Talk.ChatType)
{
case CHAT_TYPE_SAY:
- cSource->Say(step.script->Talk.TextID, LANG_UNIVERSAL, targetGUID);
+ cSource->MonsterSay(step.script->Talk.TextID, LANG_UNIVERSAL, target);
break;
case CHAT_TYPE_YELL:
- cSource->Yell(step.script->Talk.TextID, LANG_UNIVERSAL, targetGUID);
+ cSource->MonsterYell(step.script->Talk.TextID, LANG_UNIVERSAL, target);
break;
case CHAT_TYPE_TEXT_EMOTE:
- cSource->TextEmote(step.script->Talk.TextID, targetGUID);
+ cSource->MonsterTextEmote(step.script->Talk.TextID, target);
break;
case CHAT_TYPE_BOSS_EMOTE:
- cSource->MonsterTextEmote(step.script->Talk.TextID, targetGUID, true);
+ cSource->MonsterTextEmote(step.script->Talk.TextID, target, true);
break;
case CHAT_TYPE_WHISPER:
if (!targetGUID || !IS_PLAYER_GUID(targetGUID))
TC_LOG_ERROR("scripts", "%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
else
- cSource->Whisper(step.script->Talk.TextID, targetGUID);
+ cSource->MonsterWhisper(step.script->Talk.TextID, target->ToPlayer());
break;
case CHAT_MSG_RAID_BOSS_WHISPER:
if (!targetGUID || !IS_PLAYER_GUID(targetGUID))
TC_LOG_ERROR("scripts", "%s attempt to raidbosswhisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
else
- cSource->MonsterWhisper(step.script->Talk.TextID, targetGUID, true);
+ cSource->MonsterWhisper(step.script->Talk.TextID, target->ToPlayer(), true);
break;
default:
break; // must be already checked at load
diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp
index 28fe883feb9..8da94ef2852 100644
--- a/src/server/game/Scripting/ScriptLoader.cpp
+++ b/src/server/game/Scripting/ScriptLoader.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -321,7 +321,10 @@ void AddSC_boss_ptheradras();
void AddSC_instance_maraudon();
void AddSC_boss_onyxia(); //Onyxia's Lair
void AddSC_instance_onyxias_lair();
-void AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs
+void AddSC_boss_tuten_kash(); //Razorfen Downs
+void AddSC_boss_mordresh_fire_eye();
+void AddSC_boss_glutton();
+void AddSC_boss_amnennar_the_coldbringer();
void AddSC_razorfen_downs();
void AddSC_instance_razorfen_downs();
void AddSC_razorfen_kraul(); //Razorfen Kraul
@@ -446,6 +449,7 @@ void AddSC_oculus();
void AddSC_boss_malygos(); // The Nexus: Eye of Eternity
void AddSC_instance_eye_of_eternity();
void AddSC_boss_sartharion(); //Obsidian Sanctum
+void AddSC_obsidian_sanctum();
void AddSC_instance_obsidian_sanctum();
void AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning
void AddSC_boss_loken();
@@ -1032,7 +1036,10 @@ void AddKalimdorScripts()
AddSC_instance_maraudon();
AddSC_boss_onyxia(); //Onyxia's Lair
AddSC_instance_onyxias_lair();
- AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs
+ AddSC_boss_tuten_kash(); //Razorfen Downs
+ AddSC_boss_mordresh_fire_eye();
+ AddSC_boss_glutton();
+ AddSC_boss_amnennar_the_coldbringer();
AddSC_razorfen_downs();
AddSC_instance_razorfen_downs();
AddSC_razorfen_kraul(); //Razorfen Kraul
@@ -1281,6 +1288,7 @@ void AddNorthrendScripts()
AddSC_boss_malygos(); // The Nexus: Eye of Eternity
AddSC_instance_eye_of_eternity();
AddSC_boss_sartharion(); //Obsidian Sanctum
+ AddSC_obsidian_sanctum();
AddSC_instance_obsidian_sanctum();
AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning
AddSC_boss_loken();
diff --git a/src/server/game/Scripting/ScriptLoader.h b/src/server/game/Scripting/ScriptLoader.h
index 79e2454518f..db4c5b0cf46 100644
--- a/src/server/game/Scripting/ScriptLoader.h
+++ b/src/server/game/Scripting/ScriptLoader.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index 3674f8fe15e..d7a2c147edb 100644
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -778,8 +778,7 @@ uint32 ScriptMgr::GetDialogStatus(Player* player, Creature* creature)
ASSERT(player);
ASSERT(creature);
- /// @todo 100 is a funny magic number to have hanging around here...
- GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, 100);
+ GET_SCRIPT_RET(CreatureScript, creature->GetScriptId(), tmpscript, DIALOG_STATUS_SCRIPTED_NO_STATUS);
player->PlayerTalkClass->ClearMenus();
return tmpscript->GetDialogStatus(player, creature);
}
@@ -864,8 +863,7 @@ uint32 ScriptMgr::GetDialogStatus(Player* player, GameObject* go)
ASSERT(player);
ASSERT(go);
- /// @todo 100 is a funny magic number to have hanging around here...
- GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, 100);
+ GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, DIALOG_STATUS_SCRIPTED_NO_STATUS);
player->PlayerTalkClass->ClearMenus();
return tmpscript->GetDialogStatus(player, go);
}
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index 401be45a4e1..a0724ac47fb 100644
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
#include <ace/Atomic_Op.h>
#include "DBCStores.h"
+#include "QuestDef.h"
#include "SharedDefines.h"
#include "World.h"
#include "Weather.h"
@@ -447,7 +448,7 @@ class CreatureScript : public UnitScript, public UpdatableScript<Creature>
virtual bool OnQuestReward(Player* /*player*/, Creature* /*creature*/, Quest const* /*quest*/, uint32 /*opt*/) { return false; }
// Called when the dialog status between a player and the creature is requested.
- virtual uint32 GetDialogStatus(Player* /*player*/, Creature* /*creature*/) { return 100; }
+ virtual uint32 GetDialogStatus(Player* /*player*/, Creature* /*creature*/) { return DIALOG_STATUS_SCRIPTED_NO_STATUS; }
// Called when a CreatureAI object is needed for the creature.
virtual CreatureAI* GetAI(Creature* /*creature*/) const { return NULL; }
@@ -482,7 +483,7 @@ class GameObjectScript : public ScriptObject, public UpdatableScript<GameObject>
virtual bool OnQuestReward(Player* /*player*/, GameObject* /*go*/, Quest const* /*quest*/, uint32 /*opt*/) { return false; }
// Called when the dialog status between a player and the gameobject is requested.
- virtual uint32 GetDialogStatus(Player* /*player*/, GameObject* /*go*/) { return 100; }
+ virtual uint32 GetDialogStatus(Player* /*player*/, GameObject* /*go*/) { return DIALOG_STATUS_SCRIPTED_NO_STATUS; }
// Called when the game object is destroyed (destructible buildings only).
virtual void OnDestroyed(GameObject* /*go*/, Player* /*player*/) { }
diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp
index 921ae7cbda6..8094da2e105 100644
--- a/src/server/game/Scripting/ScriptSystem.cpp
+++ b/src/server/game/Scripting/ScriptSystem.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp
index 065b80cb08f..97e81de7ecf 100644
--- a/src/server/game/Server/Protocol/Opcodes.cpp
+++ b/src/server/game/Server/Protocol/Opcodes.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -526,7 +526,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
/*0x1F1*/ { "MSG_SAVE_GUILD_EMBLEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode },
/*0x1F2*/ { "MSG_TABARDVENDOR_ACTIVATE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode},
/*0x1F3*/ { "SMSG_PLAY_SPELL_VISUAL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
- /*0x1F4*/ { "CMSG_ZONEUPDATE", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode },
+ /*0x1F4*/ { "CMSG_ZONEUPDATE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleZoneUpdateOpcode },
/*0x1F5*/ { "SMSG_PARTYKILLLOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
/*0x1F6*/ { "SMSG_COMPRESSED_UPDATE_OBJECT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
/*0x1F7*/ { "SMSG_PLAY_SPELL_IMPACT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h
index 254f9fe5350..e581d7d1544 100644
--- a/src/server/game/Server/Protocol/Opcodes.h
+++ b/src/server/game/Server/Protocol/Opcodes.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Server/Protocol/PacketLog.cpp b/src/server/game/Server/Protocol/PacketLog.cpp
index aeeb0a285a4..ed5a3b52871 100644
--- a/src/server/game/Server/Protocol/PacketLog.cpp
+++ b/src/server/game/Server/Protocol/PacketLog.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Server/Protocol/PacketLog.h b/src/server/game/Server/Protocol/PacketLog.h
index 2c2e0a8766c..9c60655e627 100644
--- a/src/server/game/Server/Protocol/PacketLog.h
+++ b/src/server/game/Server/Protocol/PacketLog.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp
index 82cc1c963a6..58e7ba02f47 100644
--- a/src/server/game/Server/WorldSession.cpp
+++ b/src/server/game/Server/WorldSession.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -100,6 +100,7 @@ WorldSession::WorldSession(uint32 id, WorldSocket* sock, AccountTypes sec, uint8
m_muteTime(mute_time),
m_timeOutTime(0),
AntiDOS(this),
+ m_GUIDLow(0),
_player(NULL),
m_Socket(sock),
_security(sec),
@@ -122,6 +123,8 @@ WorldSession::WorldSession(uint32 id, WorldSocket* sock, AccountTypes sec, uint8
timeLastWhoCommand(0),
_RBACData(NULL)
{
+ memset(m_Tutorials, 0, sizeof(m_Tutorials));
+
if (sock)
{
m_Address = sock->GetRemoteAddress();
diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h
index a24316eec1d..904006e174d 100644
--- a/src/server/game/Server/WorldSession.h
+++ b/src/server/game/Server/WorldSession.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -359,7 +359,7 @@ class WorldSession
uint32 GetLatency() const { return m_latency; }
void SetLatency(uint32 latency) { m_latency = latency; }
void ResetClientTimeDelay() { m_clientTimeDelay = 0; }
- uint32 getDialogStatus(Player* player, Object* questgiver, uint32 defstatus);
+ uint32 getDialogStatus(Player* player, Object* questgiver);
ACE_Atomic_Op<ACE_Thread_Mutex, time_t> m_timeOutTime;
void UpdateTimeOutTime(uint32 diff)
@@ -759,6 +759,16 @@ class WorldSession
void HandleBattlemasterJoinArena(WorldPacket& recvData);
void HandleReportPvPAFK(WorldPacket& recvData);
+ // Battlefield
+ void SendBfInvitePlayerToWar(uint32 battleId, uint32 zoneId, uint32 time);
+ void SendBfInvitePlayerToQueue(uint32 battleId);
+ void SendBfQueueInviteResponse(uint32 battleId, uint32 zoneId, bool canQueue = true, bool full = false);
+ void SendBfEntered(uint32 battleId);
+ void SendBfLeaveMessage(uint32 battleId, BFLeaveReason reason = BF_LEAVE_REASON_EXITED);
+ void HandleBfQueueInviteResponse(WorldPacket& recvData);
+ void HandleBfEntryInviteResponse(WorldPacket& recvData);
+ void HandleBfExitRequest(WorldPacket& recvData);
+
void HandleWardenDataOpcode(WorldPacket& recvData);
void HandleWorldTeleportOpcode(WorldPacket& recvData);
void HandleMinimapPingOpcode(WorldPacket& recvData);
@@ -775,16 +785,6 @@ class WorldSession
void HandleHearthAndResurrect(WorldPacket& recvData);
void HandleInstanceLockResponse(WorldPacket& recvPacket);
- // Battlefield
- void SendBfInvitePlayerToWar(uint32 battleId, uint32 zoneId, uint32 time);
- void SendBfInvitePlayerToQueue(uint32 battleId);
- void SendBfQueueInviteResponse(uint32 battleId, uint32 zoneId, bool canQueue = true, bool full = false);
- void SendBfEntered(uint32 battleId);
- void SendBfLeaveMessage(uint32 battleId, BFLeaveReason reason = BF_LEAVE_REASON_EXITED);
- void HandleBfQueueInviteResponse(WorldPacket& recvData);
- void HandleBfEntryInviteResponse(WorldPacket& recvData);
- void HandleBfExitRequest(WorldPacket& recvData);
-
// Looking for Dungeon/Raid
void HandleLfgSetCommentOpcode(WorldPacket& recvData);
void HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& recvData);
diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp
index 1384ba3cc4b..605b863bfa1 100644
--- a/src/server/game/Server/WorldSocket.cpp
+++ b/src/server/game/Server/WorldSocket.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Server/WorldSocket.h b/src/server/game/Server/WorldSocket.h
index 2d5762ef60e..103d60346e8 100644
--- a/src/server/game/Server/WorldSocket.h
+++ b/src/server/game/Server/WorldSocket.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Server/WorldSocketAcceptor.h b/src/server/game/Server/WorldSocketAcceptor.h
index 518cf90d17f..0b07196a0cd 100644
--- a/src/server/game/Server/WorldSocketAcceptor.h
+++ b/src/server/game/Server/WorldSocketAcceptor.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Server/WorldSocketMgr.cpp b/src/server/game/Server/WorldSocketMgr.cpp
index 5b7b24666e2..7880552ffa1 100644
--- a/src/server/game/Server/WorldSocketMgr.cpp
+++ b/src/server/game/Server/WorldSocketMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Server/WorldSocketMgr.h b/src/server/game/Server/WorldSocketMgr.h
index d7adc79bef8..fb8ddb42b9e 100644
--- a/src/server/game/Server/WorldSocketMgr.h
+++ b/src/server/game/Server/WorldSocketMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp
index d911a20081a..5e272edb531 100644
--- a/src/server/game/Skills/SkillDiscovery.cpp
+++ b/src/server/game/Skills/SkillDiscovery.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Skills/SkillDiscovery.h b/src/server/game/Skills/SkillDiscovery.h
index 84c17665f45..42c7eabf5fc 100644
--- a/src/server/game/Skills/SkillDiscovery.h
+++ b/src/server/game/Skills/SkillDiscovery.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Skills/SkillExtraItems.cpp b/src/server/game/Skills/SkillExtraItems.cpp
index fec0c1c7c88..a979e2fa58f 100644
--- a/src/server/game/Skills/SkillExtraItems.cpp
+++ b/src/server/game/Skills/SkillExtraItems.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Skills/SkillExtraItems.h b/src/server/game/Skills/SkillExtraItems.h
index 507d513dd02..d1cc4acbbd2 100644
--- a/src/server/game/Skills/SkillExtraItems.h
+++ b/src/server/game/Skills/SkillExtraItems.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h
index 3969dfbab98..aa1f6a49413 100644
--- a/src/server/game/Spells/Auras/SpellAuraDefines.h
+++ b/src/server/game/Spells/Auras/SpellAuraDefines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 2a6d53089b9..1273b92596f 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -709,7 +709,7 @@ void AuraEffect::ApplySpellMod(Unit* target, bool apply)
{
Aura* aura = iter->second->GetBase();
// only passive and permament auras-active auras should have amount set on spellcast and not be affected
- // if aura is casted by others, it will not be affected
+ // if aura is cast by others, it will not be affected
if ((aura->IsPassive() || aura->IsPermanent()) && aura->GetCasterGUID() == guid && aura->GetSpellInfo()->IsAffectedBySpellMod(m_spellmod))
{
if (GetMiscValue() == SPELLMOD_ALL_EFFECTS)
@@ -2214,26 +2214,26 @@ void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode,
WeaponAttackType attType;
switch (type)
{
- case SPELL_AURA_MOD_DISARM:
- field=UNIT_FIELD_FLAGS;
- flag=UNIT_FLAG_DISARMED;
- slot=EQUIPMENT_SLOT_MAINHAND;
- attType=BASE_ATTACK;
- break;
- case SPELL_AURA_MOD_DISARM_OFFHAND:
- field=UNIT_FIELD_FLAGS_2;
- flag=UNIT_FLAG2_DISARM_OFFHAND;
- slot=EQUIPMENT_SLOT_OFFHAND;
- attType=OFF_ATTACK;
- break;
- case SPELL_AURA_MOD_DISARM_RANGED:
- field=UNIT_FIELD_FLAGS_2;
- flag=UNIT_FLAG2_DISARM_RANGED;
- slot=EQUIPMENT_SLOT_RANGED;
- attType=RANGED_ATTACK;
- break;
- default:
- return;
+ case SPELL_AURA_MOD_DISARM:
+ field = UNIT_FIELD_FLAGS;
+ flag = UNIT_FLAG_DISARMED;
+ slot = EQUIPMENT_SLOT_MAINHAND;
+ attType = BASE_ATTACK;
+ break;
+ case SPELL_AURA_MOD_DISARM_OFFHAND:
+ field = UNIT_FIELD_FLAGS_2;
+ flag = UNIT_FLAG2_DISARM_OFFHAND;
+ slot = EQUIPMENT_SLOT_OFFHAND;
+ attType = OFF_ATTACK;
+ break;
+ case SPELL_AURA_MOD_DISARM_RANGED:
+ field = UNIT_FIELD_FLAGS_2;
+ flag = UNIT_FLAG2_DISARM_RANGED;
+ slot = EQUIPMENT_SLOT_RANGED;
+ attType = RANGED_ATTACK;
+ break;
+ default:
+ return;
}
// if disarm aura is to be removed, remove the flag first to reapply damage/aura mods
@@ -4112,7 +4112,7 @@ void AuraEffect::HandleModAttackSpeed(AuraApplication const* aurApp, uint8 mode,
Unit* target = aurApp->GetTarget();
- target->ApplyAttackTimePercentMod(BASE_ATTACK, (float)GetAmount(), apply);
+ target->ApplyAttackTimePercentMod(BASE_ATTACK, float(GetAmount()), apply);
target->UpdateDamagePhysical(BASE_ATTACK);
}
@@ -4123,8 +4123,8 @@ void AuraEffect::HandleModMeleeSpeedPct(AuraApplication const* aurApp, uint8 mod
Unit* target = aurApp->GetTarget();
- target->ApplyAttackTimePercentMod(BASE_ATTACK, (float)GetAmount(), apply);
- target->ApplyAttackTimePercentMod(OFF_ATTACK, (float)GetAmount(), apply);
+ target->ApplyAttackTimePercentMod(BASE_ATTACK, float(GetAmount()), apply);
+ target->ApplyAttackTimePercentMod(OFF_ATTACK, float(GetAmount()), apply);
}
void AuraEffect::HandleAuraModRangedHaste(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -4371,9 +4371,9 @@ void AuraEffect::HandleModDamagePercentDone(AuraApplication const* aurApp, uint8
if ((GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) && (GetSpellInfo()->EquippedItemClass == -1 || target->GetTypeId() != TYPEID_PLAYER))
{
- target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, float (GetAmount()), apply);
- target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float (GetAmount()), apply);
- target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_PCT, float (GetAmount()), apply);
+ target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, float(GetAmount()), apply);
+ target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(GetAmount()), apply);
+ target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_PCT, float(GetAmount()), apply);
if (target->GetTypeId() == TYPEID_PLAYER)
target->ToPlayer()->ApplyPercentModFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, float (GetAmount()), apply);
@@ -4531,7 +4531,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (target->GetTypeId() != TYPEID_PLAYER)
return;
// ..while they are casting
- if (target->IsNonMeleeSpellCasted(false, false, true, false, true))
+ if (target->IsNonMeleeSpellCast(false, false, true, false, true))
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARRIOR, 2775, 0))
switch (aurEff->GetId())
{
@@ -4727,7 +4727,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
case 42783: // Wrath of the Astromancer
target->CastSpell(target, GetAmount(), true, NULL, this);
break;
- case 46308: // Burning Winds casted only at creatures at spawn
+ case 46308: // Burning Winds cast only at creatures at spawn
target->CastSpell(target, 47287, true, NULL, this);
break;
case 52172: // Coyote Spirit Despawn Aura
@@ -5684,9 +5684,6 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
case 46284:
target->CastCustomSpell(triggerSpellId, SPELLVALUE_MAX_TARGETS, m_tickNumber / 10 + 1, NULL, true, NULL, this);
return;
- // Poison (Grobbulus)
- case 28158:
- case 54362:
// Slime Pool (Dreadscale & Acidmaw)
case 66882:
target->CastCustomSpell(triggerSpellId, SPELLVALUE_RADIUS_MOD, (int32)((((float)m_tickNumber / 60) * 0.9f + 0.1f) * 10000 * 2 / 3), NULL, true, NULL, this);
@@ -6109,8 +6106,10 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
if (target != caster && GetSpellInfo()->AttributesEx2 & SPELL_ATTR2_HEALTH_FUNNEL)
{
uint32 funnelDamage = GetSpellInfo()->ManaPerSecond; // damage is not affected by spell power
- if ((int32)funnelDamage > gain)
+
+ if ((int32)funnelDamage > gain && gain > 0)
funnelDamage = gain;
+
uint32 funnelAbsorb = 0;
caster->DealDamageMods(caster, funnelDamage, &funnelAbsorb);
caster->SendSpellNonMeleeDamageLog(caster, GetId(), funnelDamage, GetSpellInfo()->GetSchoolMask(), funnelAbsorb, 0, false, 0, false);
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index ddd6c1127e1..0887ce123e2 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index efacdd151db..9c7fff612b7 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -114,12 +114,12 @@ void AuraApplication::_Remove()
void AuraApplication::_InitFlags(Unit* caster, uint8 effMask)
{
- // mark as selfcasted if needed
+ // mark as selfcast if needed
_flags |= (GetBase()->GetCasterGUID() == GetTarget()->GetGUID()) ? AFLAG_CASTER : AFLAG_NONE;
- // aura is casted by self or an enemy
+ // aura is cast by self or an enemy
// one negative effect and we know aura is negative
- if (IsSelfcasted() || !caster || !caster->IsFriendlyTo(GetTarget()))
+ if (IsSelfcast() || !caster || !caster->IsFriendlyTo(GetTarget()))
{
bool negativeFound = false;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
@@ -132,7 +132,7 @@ void AuraApplication::_InitFlags(Unit* caster, uint8 effMask)
}
_flags |= negativeFound ? AFLAG_NEGATIVE : AFLAG_POSITIVE;
}
- // aura is casted by friend
+ // aura is cast by friend
// one positive effect and we know aura is positive
else
{
@@ -306,7 +306,7 @@ Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owne
// check if aura can be owned by owner
if (owner->isType(TYPEMASK_UNIT))
if (!owner->IsInWorld() || ((Unit*)owner)->IsDuringRemoveFromWorld())
- // owner not in world so don't allow to own not self casted single target auras
+ // owner not in world so don't allow to own not self cast single target auras
if (casterGUID != owner->GetGUID() && spellproto->IsSingleTarget())
return NULL;
@@ -344,6 +344,7 @@ m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false)
m_duration = m_maxDuration;
m_procCharges = CalcMaxCharges(caster);
m_isUsingCharges = m_procCharges != 0;
+ memset(m_effects, 0, sizeof(m_effects));
// m_casterLevel = cast item level/caster level, caster level should be saved to db, confirmed with sniffs
}
@@ -1278,7 +1279,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
}
break;
case SPELLFAMILY_ROGUE:
- // Sprint (skip non player casted spells by category)
+ // Sprint (skip non player cast spells by category)
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x40 && GetSpellInfo()->GetCategory() == 44)
// in official maybe there is only one icon?
if (target->HasAura(58039)) // Glyph of Blurred Speed
@@ -1674,7 +1675,7 @@ bool Aura::CanBeAppliedOn(Unit* target)
// area auras mustn't be applied
if (GetOwner() != target)
return false;
- // not selfcasted single target auras mustn't be applied
+ // do not apply non-selfcast single target auras
if (GetCasterGUID() != GetOwner()->GetGUID() && GetSpellInfo()->IsSingleTarget())
return false;
return true;
diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h
index 9e7d0cce82c..f62b1ff47b4 100644
--- a/src/server/game/Spells/Auras/SpellAuras.h
+++ b/src/server/game/Spells/Auras/SpellAuras.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -69,7 +69,7 @@ class AuraApplication
uint8 GetEffectMask() const { return _flags & (AFLAG_EFF_INDEX_0 | AFLAG_EFF_INDEX_1 | AFLAG_EFF_INDEX_2); }
bool HasEffect(uint8 effect) const { ASSERT(effect < MAX_SPELL_EFFECTS); return _flags & (1<<effect); }
bool IsPositive() const { return _flags & AFLAG_POSITIVE; }
- bool IsSelfcasted() const { return _flags & AFLAG_CASTER; }
+ bool IsSelfcast() const { return _flags & AFLAG_CASTER; }
uint8 GetEffectsToApply() const { return _effectsToApply; }
void SetRemoveMode(AuraRemoveMode mode) { _removeMode = mode; }
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index c6ac5c21d55..49eed70f57d 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -70,12 +70,14 @@ SpellDestination::SpellDestination(float x, float y, float z, float orientation,
_position.Relocate(x, y, z, orientation);
_transportGUID = 0;
_position.m_mapId = mapId;
+ _transportOffset.Relocate(0, 0, 0, 0);
}
SpellDestination::SpellDestination(Position const& pos)
{
_position.Relocate(pos);
_transportGUID = 0;
+ _transportOffset.Relocate(0, 0, 0, 0);
}
SpellDestination::SpellDestination(WorldObject const& wObj)
@@ -502,6 +504,7 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme
m_applyMultiplierMask = 0;
m_auraScaleMask = 0;
+ memset(m_damageMultipliers, 0, sizeof(m_damageMultipliers));
// Get data for type of attack
switch (m_spellInfo->DmgClass)
@@ -557,6 +560,16 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme
unitTarget = NULL;
itemTarget = NULL;
gameObjTarget = NULL;
+ destTarget = NULL;
+ damage = 0;
+ effectHandleMode = SPELL_EFFECT_HANDLE_LAUNCH;
+ m_diminishLevel = DIMINISHING_LEVEL_1;
+ m_diminishGroup = DIMINISHING_NONE;
+ m_damage = 0;
+ m_healing = 0;
+ m_procAttacker = 0;
+ m_procVictim = 0;
+ m_procEx = 0;
focusObject = NULL;
m_cast_count = 0;
m_glyphIndex = 0;
@@ -572,6 +585,8 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme
m_casttime = 0; // setup to correct value in Spell::prepare, must not be used before.
m_timer = 0; // will set to castime in prepare
+ m_immediateHandled = false;
+
m_channelTargetEffectMask = 0;
// Determine if spell can be reflected back to the caster
@@ -2397,7 +2412,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
m_spellAura = NULL; // Set aura to null for every target-make sure that pointer is not used for unit without aura applied
- //Spells with this flag cannot trigger if effect is casted on self
+ //Spells with this flag cannot trigger if effect is cast on self
bool canEffectTrigger = !(m_spellInfo->AttributesEx3 & SPELL_ATTR3_CANT_TRIGGER_PROC) && unitTarget->CanProc() && CanExecuteTriggersOnHit(mask);
Unit* spellHitTarget = NULL;
@@ -2992,7 +3007,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
m_caster->m_Events.AddEvent(Event, m_caster->m_Events.CalculateTime(1));
//Prevent casting at cast another spell (ServerSide check)
- if (!(_triggeredCastFlags & TRIGGERED_IGNORE_CAST_IN_PROGRESS) && m_caster->IsNonMeleeSpellCasted(false, true, true) && m_cast_count)
+ if (!(_triggeredCastFlags & TRIGGERED_IGNORE_CAST_IN_PROGRESS) && m_caster->IsNonMeleeSpellCast(false, true, true) && m_cast_count)
{
SendCastResult(SPELL_FAILED_SPELL_IN_PROGRESS);
finish(false);
@@ -3055,7 +3070,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
else
m_casttime = m_spellInfo->CalcCastTime(this);
- // don't allow channeled spells / spells with cast time to be casted while moving
+ // don't allow channeled spells / spells with cast time to be cast while moving
// (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in)
if ((m_spellInfo->IsChanneled() || m_casttime) && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->isMoving() && m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT)
{
@@ -3070,7 +3085,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
TC_LOG_DEBUG("spells", "Spell::prepare: spell id %u source %u caster %d customCastFlags %u mask %u", m_spellInfo->Id, m_caster->GetEntry(), m_originalCaster ? m_originalCaster->GetEntry() : -1, _triggeredCastFlags, m_targets.GetTargetMask());
//Containers for channeled spells have to be set
- /// @todoApply this to all casted spells if needed
+ /// @todoApply this to all cast spells if needed
// Why check duration? 29350: channelled triggers channelled
if ((_triggeredCastFlags & TRIGGERED_CAST_DIRECTLY) && (!m_spellInfo->IsChanneled() || !m_spellInfo->GetMaxDuration()))
cast(true);
@@ -3089,7 +3104,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
}
}
- m_caster->SetCurrentCastedSpell(this);
+ m_caster->SetCurrentCastSpell(this);
SendSpellStart();
// set target for proper facing
@@ -3199,7 +3214,7 @@ void Spell::cast(bool skipCheck)
if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
// Set spell which will drop charges for triggered cast spells
- // if not successfully casted, will be remove in finish(false)
+ // if not successfully cast, will be remove in finish(false)
m_caster->ToPlayer()->SetSpellModTakingSpell(this, true);
}
@@ -3236,7 +3251,7 @@ void Spell::cast(bool skipCheck)
{
if (!my_trade->IsInAcceptProcess())
{
- // Spell will be casted at completing the trade. Silently ignore at this place
+ // Spell will be cast after completing the trade. Silently ignore at this place
my_trade->SetSpell(m_spellInfo->Id, m_CastItem);
SendCastResult(SPELL_FAILED_DONT_REPORT);
SendInterrupted(0);
@@ -3326,7 +3341,7 @@ void Spell::cast(bool skipCheck)
m_spellState = SPELL_STATE_DELAYED;
SetDelayStart(0);
- if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
+ if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCast(false, false, true))
m_caster->ClearUnitState(UNIT_STATE_CASTING);
}
else
@@ -3648,7 +3663,7 @@ void Spell::finish(bool ok)
if (m_spellInfo->IsChanneled())
m_caster->UpdateInterruptMask();
- if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
+ if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCast(false, false, true))
m_caster->ClearUnitState(UNIT_STATE_CASTING);
// Unsummon summon as possessed creatures on spell cancel
@@ -3984,7 +3999,7 @@ void Spell::SendSpellGo()
if (castFlags & CAST_FLAG_RUNE_LIST) // rune cooldowns list
{
- /// @todo There is a crash caused by a spell with CAST_FLAG_RUNE_LIST casted by a creature
+ /// @todo There is a crash caused by a spell with CAST_FLAG_RUNE_LIST cast by a creature
//The creature is the mover of a player, so HandleCastSpellOpcode uses it as the caster
if (Player* player = m_caster->ToPlayer())
{
@@ -4745,6 +4760,10 @@ SpellCastResult Spell::CheckCast(bool strict)
else
return SPELL_FAILED_NOT_READY;
}
+
+ // check if we are using a potion in combat for the 2nd+ time. Cooldown is added only after caster gets out of combat
+ if (m_caster->ToPlayer()->GetLastPotionId() && m_CastItem && (m_CastItem->IsPotion() || m_spellInfo->IsCooldownStartedOnEvent()))
+ return SPELL_FAILED_NOT_READY;
}
if (m_spellInfo->AttributesEx7 & SPELL_ATTR7_IS_CHEAT_SPELL && !m_caster->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_CHEAT_SPELLS))
@@ -4905,7 +4924,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if ((m_spellInfo->AttributesCu & SPELL_ATTR0_CU_REQ_TARGET_FACING_CASTER) && !target->HasInArc(static_cast<float>(M_PI), m_caster))
return SPELL_FAILED_NOT_INFRONT;
- if (m_caster->GetEntry() != WORLD_TRIGGER) // Ignore LOS for gameobjects casts (wrongly casted by a trigger)
+ if (m_caster->GetEntry() != WORLD_TRIGGER) // Ignore LOS for gameobjects casts (wrongly cast by a trigger)
if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, m_spellInfo->Id, NULL, SPELL_DISABLE_LOS) && !m_caster->IsWithinLOSInMap(target))
return SPELL_FAILED_LINE_OF_SIGHT;
}
@@ -4937,7 +4956,7 @@ SpellCastResult Spell::CheckCast(bool strict)
}
}
- // Spell casted only on battleground
+ // Spell cast only in battleground
if ((m_spellInfo->AttributesEx3 & SPELL_ATTR3_BATTLEGROUND) && m_caster->GetTypeId() == TYPEID_PLAYER)
if (!m_caster->ToPlayer()->InBattleground())
return SPELL_FAILED_ONLY_BATTLEGROUNDS;
@@ -5486,7 +5505,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (!m_targets.GetUnitTarget())
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
- // can be casted at non-friendly unit or own pet/charm
+ // can be cast at non-friendly unit or own pet/charm
if (m_caster->IsFriendlyTo(m_targets.GetUnitTarget()))
return SPELL_FAILED_TARGET_FRIENDLY;
@@ -5714,7 +5733,7 @@ SpellCastResult Spell::CheckCasterAuras() const
}
}
}
- // You are prevented from casting and the spell casted does not grant immunity. Return a failed error.
+ // You are prevented from casting and the spell cast does not grant immunity. Return a failed error.
else
return prevented_reason;
}
@@ -6108,19 +6127,39 @@ SpellCastResult Spell::CheckItems()
}
}
- SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(m_spellInfo->Effects[i].MiscValue);
+ SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(m_spellInfo->Effects[i].MiscValue);
// do not allow adding usable enchantments to items that have use effect already
- if (pEnchant && isItemUsable)
+ if (enchantEntry)
+ {
for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
- if (pEnchant->type[s] == ITEM_ENCHANTMENT_TYPE_USE_SPELL)
- return SPELL_FAILED_ON_USE_ENCHANT;
+ {
+ switch (enchantEntry->type[s])
+ {
+ case ITEM_ENCHANTMENT_TYPE_USE_SPELL:
+ if (isItemUsable)
+ return SPELL_FAILED_ON_USE_ENCHANT;
+ break;
+ case ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET:
+ {
+ uint32 numSockets = 0;
+ for (uint32 socket = 0; socket < MAX_ITEM_PROTO_SOCKETS; ++socket)
+ if (targetItem->GetTemplate()->Socket[socket].Color)
+ ++numSockets;
+
+ if (numSockets == MAX_ITEM_PROTO_SOCKETS || targetItem->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT))
+ return SPELL_FAILED_MAX_SOCKETS;
+ break;
+ }
+ }
+ }
+ }
// Not allow enchant in trade slot for some enchant type
if (targetItem->GetOwner() != m_caster)
{
- if (!pEnchant)
+ if (!enchantEntry)
return SPELL_FAILED_ERROR;
- if (pEnchant->slot & ENCHANTMENT_CAN_SOULBOUND)
+ if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND)
return SPELL_FAILED_NOT_TRADEABLE;
}
break;
@@ -6630,11 +6669,11 @@ bool SpellEvent::Execute(uint64 e_time, uint32 p_time)
/*
if (m_Spell->m_spellInfo->IsChanneled())
{
- // evented channeled spell is processed separately, casted once after delay, and not destroyed till finish
+ // evented channeled spell is processed separately, cast once after delay, and not destroyed till finish
// check, if we have casting anything else except this channeled spell and autorepeat
- if (m_Spell->GetCaster()->IsNonMeleeSpellCasted(false, true, true))
+ if (m_Spell->GetCaster()->IsNonMeleeSpellCast(false, true, true))
{
- // another non-melee non-delayed spell is casted now, abort
+ // another non-melee non-delayed spell is cast now, abort
m_Spell->cancel();
}
else
@@ -6863,7 +6902,7 @@ SpellCastResult Spell::CanOpenLock(uint32 effIndex, uint32 lockId, SkillType& sk
0 : m_caster->ToPlayer()->GetSkillValue(skillId);
// skill bonus provided by casting spell (mostly item spells)
- // add the effect base points modifier from the spell casted (cheat lock / skeleton key etc.)
+ // add the effect base points modifier from the spell cast (cheat lock / skeleton key etc.)
if (m_spellInfo->Effects[effIndex].TargetA.GetTarget() == TARGET_GAMEOBJECT_ITEM_TARGET || m_spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_GAMEOBJECT_ITEM_TARGET)
skillValue += m_spellInfo->Effects[effIndex].CalcValue();
@@ -7164,7 +7203,7 @@ bool Spell::CheckScriptEffectImplicitTargets(uint32 effIndex, uint32 effIndexToC
bool Spell::CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* triggeredByAura) const
{
bool only_on_caster = (triggeredByAura && (triggeredByAura->AttributesEx4 & SPELL_ATTR4_PROC_ONLY_ON_CASTER));
- // If triggeredByAura has SPELL_ATTR4_PROC_ONLY_ON_CASTER then it can only proc on a casted spell with TARGET_UNIT_CASTER
+ // If triggeredByAura has SPELL_ATTR4_PROC_ONLY_ON_CASTER then it can only proc on a cast spell with TARGET_UNIT_CASTER
for (uint8 i = 0;i < MAX_SPELL_EFFECTS; ++i)
{
if ((effMask & (1 << i)) && (!only_on_caster || (m_spellInfo->Effects[i].TargetA.GetTarget() == TARGET_UNIT_CASTER)))
@@ -7254,7 +7293,7 @@ void Spell::TriggerGlobalCooldown()
return;
// Global cooldown can't leave range 1..1.5 secs
- // There are some spells (mostly not casted directly by player) that have < 1 sec and > 1.5 sec global cooldowns
+ // There are some spells (mostly not cast directly by player) that have < 1 sec and > 1.5 sec global cooldowns
// but as tests show are not affected by any spell mods.
if (m_spellInfo->StartRecoveryTime >= MIN_GCD && m_spellInfo->StartRecoveryTime <= MAX_GCD)
{
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index 927ecd32f29..72bc195aec7 100644
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -209,7 +209,7 @@ enum SpellEffectHandleMode
class Spell
{
- friend void Unit::SetCurrentCastedSpell(Spell* pSpell);
+ friend void Unit::SetCurrentCastSpell(Spell* pSpell);
friend class SpellScript;
public:
@@ -301,7 +301,7 @@ class Spell
void EffectKnockBack(SpellEffIndex effIndex);
void EffectPullTowards(SpellEffIndex effIndex);
void EffectDispelMechanic(SpellEffIndex effIndex);
- void EffectSummonDeadPet(SpellEffIndex effIndex);
+ void EffectResurrectPet(SpellEffIndex effIndex);
void EffectDestroyAllTotems(SpellEffIndex effIndex);
void EffectDurabilityDamage(SpellEffIndex effIndex);
void EffectSkill(SpellEffIndex effIndex);
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 868dc3f941c..1369d915773 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -175,7 +175,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectSummonObject, //106 SPELL_EFFECT_SUMMON_OBJECT_SLOT3
&Spell::EffectSummonObject, //107 SPELL_EFFECT_SUMMON_OBJECT_SLOT4
&Spell::EffectDispelMechanic, //108 SPELL_EFFECT_DISPEL_MECHANIC
- &Spell::EffectSummonDeadPet, //109 SPELL_EFFECT_SUMMON_DEAD_PET
+ &Spell::EffectResurrectPet, //109 SPELL_EFFECT_RESURRECT_PET
&Spell::EffectDestroyAllTotems, //110 SPELL_EFFECT_DESTROY_ALL_TOTEMS
&Spell::EffectDurabilityDamage, //111 SPELL_EFFECT_DURABILITY_DAMAGE
&Spell::EffectUnused, //112 SPELL_EFFECT_112
@@ -2326,7 +2326,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
if (!summon || !summon->HasUnitTypeMask(UNIT_MASK_MINION))
return;
- summon->SelectLevel(summon->GetCreatureTemplate()); // some summoned creaters have different from 1 DB data for level/hp
+ summon->SelectLevel(); // some summoned creaters have different from 1 DB data for level/hp
summon->SetUInt32Value(UNIT_NPC_FLAGS, summon->GetCreatureTemplate()->npcflag);
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
@@ -2538,8 +2538,6 @@ void Spell::EffectDualWield(SpellEffIndex /*effIndex*/)
return;
unitTarget->SetCanDualWield(true);
- if (unitTarget->GetTypeId() == TYPEID_UNIT)
- unitTarget->ToCreature()->UpdateDamagePhysical(OFF_ATTACK);
}
void Spell::EffectPull(SpellEffIndex effIndex)
@@ -3833,7 +3831,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
if (m_caster->getGender() > 0)
gender = "her";
sprintf(buf, "%s rubs %s [Decahedral Dwarven Dice] between %s hands and rolls. One %u and one %u.", m_caster->GetName().c_str(), gender, gender, urand(1, 10), urand(1, 10));
- m_caster->MonsterTextEmote(buf, 0);
+ m_caster->MonsterTextEmote(buf, NULL);
break;
}
// Roll 'dem Bones - Worn Troll Dice
@@ -3844,7 +3842,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
if (m_caster->getGender() > 0)
gender = "her";
sprintf(buf, "%s causually tosses %s [Worn Troll Dice]. One %u and one %u.", m_caster->GetName().c_str(), gender, urand(1, 6), urand(1, 6));
- m_caster->MonsterTextEmote(buf, 0);
+ m_caster->MonsterTextEmote(buf, NULL);
break;
}
// Death Knight Initiate Visual
@@ -4901,8 +4899,8 @@ void Spell::EffectKnockBack(SpellEffIndex effIndex)
if (unitTarget->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
return;
- // Instantly interrupt non melee spells being casted
- if (unitTarget->IsNonMeleeSpellCasted(true))
+ // Instantly interrupt non melee spells being cast
+ if (unitTarget->IsNonMeleeSpellCast(true))
unitTarget->InterruptNonMeleeSpells(true);
float ratio = 0.1f;
@@ -5003,8 +5001,6 @@ void Spell::EffectPullTowards(SpellEffIndex effIndex)
if (!unitTarget)
return;
- float speedZ = (float)(m_spellInfo->Effects[effIndex].CalcValue() / 10);
- float speedXY = (float)(m_spellInfo->Effects[effIndex].MiscValue/10);
Position pos;
if (m_spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_PULL_TOWARDS_DEST)
{
@@ -5018,6 +5014,9 @@ void Spell::EffectPullTowards(SpellEffIndex effIndex)
pos.Relocate(m_caster);
}
+ float speedXY = float(m_spellInfo->Effects[effIndex].MiscValue) * 0.1f;
+ float speedZ = unitTarget->GetDistance(pos) / speedXY * 0.5f * Movement::gravity;
+
unitTarget->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), speedXY, speedZ);
}
@@ -5050,7 +5049,7 @@ void Spell::EffectDispelMechanic(SpellEffIndex effIndex)
}
}
-void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
+void Spell::EffectResurrectPet(SpellEffIndex /*effIndex*/)
{
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
return;
@@ -5062,9 +5061,9 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
if (!player)
return;
-
// Maybe player dismissed dead pet or pet despawned?
bool hadPet = true;
+
if (!player->GetPet())
{
// Position passed to SummonPet is irrelevant with current implementation,
@@ -5075,11 +5074,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
// TODO: Better to fail Hunter's "Revive Pet" at cast instead of here when casting ends
Pet* pet = player->GetPet(); // Attempt to get current pet
- if (!pet)
- return;
-
- // TODO: Better to fail Hunter's "Revive Pet" at cast instead of here when casting ends
- if (pet->IsAlive())
+ if (!pet || pet->IsAlive())
return;
// If player did have a pet before reviving, teleport it
@@ -5595,12 +5590,8 @@ void Spell::EffectQuestStart(SpellEffIndex effIndex)
Player* player = unitTarget->ToPlayer();
if (Quest const* qInfo = sObjectMgr->GetQuestTemplate(m_spellInfo->Effects[effIndex].MiscValue))
- {
if (player->CanTakeQuest(qInfo, false) && player->CanAddQuest(qInfo, false))
- {
- player->AddQuest(qInfo, NULL);
- }
- }
+ player->AddQuestAndCheckCompletion(qInfo, NULL);
}
void Spell::EffectActivateRune(SpellEffIndex effIndex)
@@ -5822,11 +5813,11 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const*
{
if (uint32 weapon = m_caster->GetUInt32Value(PLAYER_VISIBLE_ITEM_16_ENTRYID))
{
- summon->SetDisplayId(11686);
+ summon->SetDisplayId(11686); // modelid2
summon->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, weapon);
}
else
- summon->SetDisplayId(1126);
+ summon->SetDisplayId(1126); // modelid1
}
summon->AI()->EnterEvadeMode();
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 6b54df27596..21c36510a32 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -1311,10 +1311,10 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
uint32 stanceMask = (form ? 1 << (form - 1) : 0);
- if (stanceMask & StancesNot) // can explicitly not be casted in this stance
+ if (stanceMask & StancesNot) // can explicitly not be cast in this stance
return SPELL_FAILED_NOT_SHAPESHIFT;
- if (stanceMask & Stances) // can explicitly be casted in this stance
+ if (stanceMask & Stances) // can explicitly be cast in this stance
return SPELL_CAST_OK;
bool actAsShifted = false;
@@ -2518,12 +2518,12 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
case SPELL_AURA_PREVENT_RESURRECTION:
return false;
case SPELL_AURA_PERIODIC_DAMAGE: // used in positive spells also.
- // part of negative spell if casted at self (prevent cancel)
+ // part of negative spell if cast at self (prevent cancel)
if (Effects[effIndex].TargetA.GetTarget() == TARGET_UNIT_CASTER)
return false;
break;
case SPELL_AURA_MOD_DECREASE_SPEED: // used in positive spells also
- // part of positive spell if casted at self
+ // part of positive spell if cast at self
if (Effects[effIndex].TargetA.GetTarget() != TARGET_UNIT_CASTER)
return false;
// but not this if this first effect (didn't find better check)
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index 2b1dd6a147a..562e0371fe1 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -250,7 +250,10 @@ public:
flag96 SpellClassMask;
std::list<Condition*>* ImplicitTargetConditions;
- SpellEffectInfo() { }
+ SpellEffectInfo() : _spellInfo(NULL), _effIndex(0), Effect(0), ApplyAuraName(0), Amplitude(0), DieSides(0),
+ RealPointsPerLevel(0), BasePoints(0), PointsPerComboPoint(0), ValueMultiplier(0), DamageMultiplier(0),
+ BonusMultiplier(0), MiscValue(0), MiscValueB(0), Mechanic(MECHANIC_NONE), RadiusEntry(NULL), ChainTarget(0),
+ ItemType(0), TriggerSpell(0), ImplicitTargetConditions(NULL) {}
SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex);
bool IsEffect() const;
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 241df021a6c..d51be9b04b5 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -455,6 +455,8 @@ uint32 SpellMgr::GetSpellDifficultyId(uint32 spellId) const
void SpellMgr::SetSpellDifficultyId(uint32 spellId, uint32 id)
{
+ if (uint32 i = GetSpellDifficultyId(spellId))
+ TC_LOG_ERROR("spells", "SpellMgr::SetSpellDifficultyId: Spell %u has already spellDifficultyId %u. Will override with spellDifficultyId %u.", spellId, i, id);
mSpellDifficultySearcherMap[spellId] = id;
}
@@ -480,7 +482,7 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con
SpellDifficultyEntry const* difficultyEntry = sSpellDifficultyStore.LookupEntry(difficultyId);
if (!difficultyEntry)
{
- TC_LOG_DEBUG("spells", "SpellMgr::GetSpellIdForDifficulty: SpellDifficultyEntry not found for spell %u. This should never happen.", spellId);
+ TC_LOG_ERROR("spells", "SpellMgr::GetSpellIdForDifficulty: SpellDifficultyEntry not found for spell %u. This should never happen.", spellId);
return spellId; //return source spell
}
@@ -1534,8 +1536,8 @@ void SpellMgr::LoadSpellLearnSpells()
if (!GetSpellInfo(dbc_node.spell))
continue;
- // talent or passive spells or skill-step spells auto-casted and not need dependent learning,
- // pet teaching spells must not be dependent learning (casted)
+ // talent or passive spells or skill-step spells auto-cast and not need dependent learning,
+ // pet teaching spells must not be dependent learning (cast)
// other required explicit dependent learning
dbc_node.autoLearned = entry->Effects[i].TargetA.GetTarget() == TARGET_UNIT_PET || GetTalentSpellCost(spell) > 0 || entry->IsPassive() || entry->HasEffect(SPELL_EFFECT_SKILL_STEP);
@@ -3042,6 +3044,9 @@ void SpellMgr::LoadSpellInfoCorrections()
case 42730:
spellInfo->Effects[EFFECT_1].TriggerSpell = 42739;
break;
+ case 42436: // Drink! (Brewfest)
+ spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
+ break;
case 59735:
spellInfo->Effects[EFFECT_1].TriggerSpell = 59736;
break;
@@ -3393,6 +3398,11 @@ void SpellMgr::LoadSpellInfoCorrections()
case 34471: // The Beast Within
spellInfo->AttributesEx5 |= SPELL_ATTR5_USABLE_WHILE_CONFUSED | SPELL_ATTR5_USABLE_WHILE_FEARED | SPELL_ATTR5_USABLE_WHILE_STUNNED;
break;
+ case 56606: // Ride Jokkum
+ case 61791: // Ride Vehicle (Yogg-Saron)
+ /// @todo: remove this when basepoints of all Ride Vehicle auras are calculated correctly
+ spellInfo->Effects[EFFECT_0].BasePoints = 1;
+ break;
// ULDUAR SPELLS
//
case 62374: // Pursued (Flame Leviathan)
@@ -3431,10 +3441,6 @@ void SpellMgr::LoadSpellInfoCorrections()
// that will be clear if we get more spells with problem like this
spellInfo->AttributesEx |= SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY;
break;
- case 61791: // Ride Vehicle (Yogg-Saron)
- // TODO: remove this when basepoints of all Ride Vehicle auras are calculated correctly
- spellInfo->Effects[EFFECT_0].BasePoints = 1;
- break;
case 64468: // Empowering Shadows (Yogg-Saron)
case 64486: // Empowering Shadows (Yogg-Saron)
spellInfo->MaxAffectedTargets = 3; // same for both modes?
@@ -3689,6 +3695,9 @@ void SpellMgr::LoadSpellInfoCorrections()
//
// RUBY SANCTUM SPELLS
//
+ case 74799: // Soul Consumption
+ spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_12_YARDS);
+ break;
case 74769: // Twilight Cutter
case 77844: // Twilight Cutter
case 77845: // Twilight Cutter
@@ -3718,7 +3727,7 @@ void SpellMgr::LoadSpellInfoCorrections()
break;
// This would never crit on retail and it has attribute for SPELL_ATTR3_NO_DONE_BONUS because is handled from player,
// until someone figures how to make scions not critting without hack and without making them main casters this should stay here.
- case 63934: // Arcane Barrage (casted by players and NONMELEEDAMAGELOG with caster Scion of Eternity (original caster)).
+ case 63934: // Arcane Barrage (cast by players and NONMELEEDAMAGELOG with caster Scion of Eternity (original caster)).
spellInfo->AttributesEx2 |= SPELL_ATTR2_CANT_CRIT;
break;
// ENDOF EYE OF ETERNITY SPELLS
diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h
index 677a6e2f758..01fe7708db2 100644
--- a/src/server/game/Spells/SpellMgr.h
+++ b/src/server/game/Spells/SpellMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp
index 3eae3f3d698..7301e693978 100644
--- a/src/server/game/Spells/SpellScript.cpp
+++ b/src/server/game/Spells/SpellScript.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h
index fe5f102dbe9..75cf63b495b 100644
--- a/src/server/game/Spells/SpellScript.h
+++ b/src/server/game/Spells/SpellScript.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -60,7 +60,7 @@ class _SpellScript
virtual bool _Validate(SpellInfo const* entry);
public:
- _SpellScript() : m_currentScriptState(SPELL_SCRIPT_STATE_NONE) { }
+ _SpellScript() : m_currentScriptState(SPELL_SCRIPT_STATE_NONE), m_scriptName(NULL), m_scriptSpellId(0) {}
virtual ~_SpellScript() { }
virtual void _Register();
virtual void _Unload();
@@ -775,11 +775,11 @@ class AuraScript : public _SpellScript
// returns spellid of the spell
uint32 GetId() const;
- // returns guid of object which casted the aura (m_originalCaster of the Spell class)
+ // returns guid of object which cast the aura (m_originalCaster of the Spell class)
uint64 GetCasterGUID() const;
- // returns unit which casted the aura or NULL if not avalible (caster logged out for example)
+ // returns unit which cast the aura or NULL if not avalible (caster logged out for example)
Unit* GetCaster() const;
- // returns object on which aura was casted, target for non-area auras, area aura source for area auras
+ // returns object on which aura was cast, target for non-area auras, area aura source for area auras
WorldObject* GetOwner() const;
// returns owner if it's unit or unit derived object, NULL otherwise (only for persistent area auras NULL is returned)
Unit* GetUnitOwner() const;
diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp
index 264b69750f0..46cb7a46773 100644
--- a/src/server/game/Texts/CreatureTextMgr.cpp
+++ b/src/server/game/Texts/CreatureTextMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -20,6 +20,7 @@
#include "ObjectMgr.h"
#include "Cell.h"
#include "CellImpl.h"
+#include "Chat.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "CreatureTextMgr.h"
@@ -27,34 +28,16 @@
class CreatureTextBuilder
{
public:
- CreatureTextBuilder(WorldObject* obj, ChatMsg msgtype, uint8 textGroup, uint32 id, uint32 language, uint64 targetGUID)
- : _source(obj), _msgType(msgtype), _textGroup(textGroup), _textId(id), _language(language), _targetGUID(targetGUID)
+ CreatureTextBuilder(WorldObject* obj, ChatMsg msgtype, uint8 textGroup, uint32 id, uint32 language, WorldObject const* target)
+ : _source(obj), _msgType(msgtype), _textGroup(textGroup), _textId(id), _language(language), _target(target)
{
}
size_t operator()(WorldPacket* data, LocaleConstant locale) const
{
std::string const& text = sCreatureTextMgr->GetLocalizedChatString(_source->GetEntry(), _textGroup, _textId, locale);
- std::string const& localizedName = _source->GetNameForLocaleIdx(locale);
-
- *data << uint8(_msgType);
- *data << uint32(_language);
- *data << uint64(_source->GetGUID());
- *data << uint32(1); // 2.1.0
- *data << uint32(localizedName.size() + 1);
- *data << localizedName;
- size_t whisperGUIDpos = data->wpos();
- *data << uint64(_targetGUID); // Unit Target
- if (_targetGUID && !IS_PLAYER_GUID(_targetGUID))
- {
- *data << uint32(1); // target name length
- *data << uint8(0); // target name
- }
- *data << uint32(text.length() + 1);
- *data << text;
- *data << uint8(0); // ChatTag
- return whisperGUIDpos;
+ return ChatHandler::BuildChatPacket(*data, _msgType, Language(_language), _source, _target, text, 0, "", locale);
}
WorldObject* _source;
@@ -62,14 +45,14 @@ class CreatureTextBuilder
uint8 _textGroup;
uint32 _textId;
uint32 _language;
- uint64 _targetGUID;
+ WorldObject const* _target;
};
class PlayerTextBuilder
{
public:
- PlayerTextBuilder(WorldObject* obj, WorldObject* speaker, ChatMsg msgtype, uint8 textGroup, uint32 id, uint32 language, uint64 targetGUID)
- : _source(obj), _talker(speaker), _msgType(msgtype), _textGroup(textGroup), _textId(id), _language(language), _targetGUID(targetGUID)
+ PlayerTextBuilder(WorldObject* obj, WorldObject* speaker, ChatMsg msgtype, uint8 textGroup, uint32 id, uint32 language, WorldObject const* target)
+ : _source(obj), _talker(speaker), _msgType(msgtype), _textGroup(textGroup), _textId(id), _language(language), _target(target)
{
}
@@ -77,24 +60,7 @@ class PlayerTextBuilder
{
std::string const& text = sCreatureTextMgr->GetLocalizedChatString(_source->GetEntry(), _textGroup, _textId, locale);
- *data << uint8(_msgType);
- *data << uint32(_language);
- *data << uint64(_talker->GetGUID());
- *data << uint32(1); // 2.1.0
- *data << uint32(_talker->GetName().size() + 1);
- *data << _talker->GetName();
- size_t whisperGUIDpos = data->wpos();
- *data << uint64(_targetGUID); // Unit Target
- if (_targetGUID && !IS_PLAYER_GUID(_targetGUID))
- {
- *data << uint32(1); // target name length
- *data << uint8(0); // target name
- }
- *data << uint32(text.length() + 1);
- *data << text;
- *data << uint8(0); // ChatTag
-
- return whisperGUIDpos;
+ return ChatHandler::BuildChatPacket(*data, _msgType, Language(_language), _talker, _target, text, 0, "", locale);
}
WorldObject* _source;
@@ -103,7 +69,7 @@ class PlayerTextBuilder
uint8 _textGroup;
uint32 _textId;
uint32 _language;
- uint64 _targetGUID;
+ WorldObject const* _target;
};
void CreatureTextMgr::LoadCreatureTexts()
@@ -211,7 +177,7 @@ void CreatureTextMgr::LoadCreatureTextLocales()
}
-uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid /*= 0*/, ChatMsg msgType /*= CHAT_MSG_ADDON*/, Language language /*= LANG_ADDON*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, uint32 sound /*= 0*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/, Player* srcPlr /*= NULL*/)
+uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject const* whisperTarget /*= NULL*/, ChatMsg msgType /*= CHAT_MSG_ADDON*/, Language language /*= LANG_ADDON*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, uint32 sound /*= 0*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/, Player* srcPlr /*= NULL*/)
{
if (!source)
return 0;
@@ -293,7 +259,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisp
uint32 finalSound = sound ? sound : iter->sound;
if (finalSound)
- SendSound(source, finalSound, finalType, whisperGuid, range, team, gmOnly);
+ SendSound(source, finalSound, finalType, whisperTarget, range, team, gmOnly);
Unit* finalSource = source;
if (srcPlr)
@@ -304,13 +270,13 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisp
if (srcPlr)
{
- PlayerTextBuilder builder(source, finalSource, finalType, iter->group, iter->id, finalLang, whisperGuid);
- SendChatPacket(finalSource, builder, finalType, whisperGuid, range, team, gmOnly);
+ PlayerTextBuilder builder(source, finalSource, finalType, iter->group, iter->id, finalLang, whisperTarget);
+ SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly);
}
else
{
- CreatureTextBuilder builder(finalSource, finalType, iter->group, iter->id, finalLang, whisperGuid);
- SendChatPacket(finalSource, builder, finalType, whisperGuid, range, team, gmOnly);
+ CreatureTextBuilder builder(finalSource, finalType, iter->group, iter->id, finalLang, whisperTarget);
+ SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly);
}
if (isEqualChanced || (!isEqualChanced && totalChance == 100.0f))
SetRepeatId(source, textGroup, iter->id);
@@ -337,17 +303,17 @@ float CreatureTextMgr::GetRangeForChatType(ChatMsg msgType) const
return dist;
}
-void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType, uint64 whisperGuid, CreatureTextRange range, Team team, bool gmOnly)
+void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType, WorldObject const* whisperTarget, CreatureTextRange range, Team team, bool gmOnly)
{
if (!sound || !source)
return;
WorldPacket data(SMSG_PLAY_SOUND, 4);
data << uint32(sound);
- SendNonChatPacket(source, &data, msgType, whisperGuid, range, team, gmOnly);
+ SendNonChatPacket(source, &data, msgType, whisperTarget, range, team, gmOnly);
}
-void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, uint64 whisperGuid, CreatureTextRange range, Team team, bool gmOnly) const
+void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, WorldObject const* whisperTarget, CreatureTextRange range, Team team, bool gmOnly) const
{
float dist = GetRangeForChatType(msgType);
@@ -358,10 +324,10 @@ void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket* data,
{
if (range == TEXT_RANGE_NORMAL)//ignores team and gmOnly
{
- Player* player = ObjectAccessor::FindPlayer(whisperGuid);
- if (!player || !player->GetSession())
+ if (!whisperTarget || whisperTarget->GetTypeId() != TYPEID_PLAYER)
return;
- player->GetSession()->SendPacket(data);
+
+ whisperTarget->ToPlayer()->GetSession()->SendPacket(data);
return;
}
break;
diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h
index 198877bfe86..12236844828 100644
--- a/src/server/game/Texts/CreatureTextMgr.h
+++ b/src/server/game/Texts/CreatureTextMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -90,21 +90,21 @@ class CreatureTextMgr
void LoadCreatureTextLocales();
CreatureTextMap const& GetTextMap() const { return mTextMap; }
- void SendSound(Creature* source, uint32 sound, ChatMsg msgType, uint64 whisperGuid, CreatureTextRange range, Team team, bool gmOnly);
+ void SendSound(Creature* source, uint32 sound, ChatMsg msgType, WorldObject const* whisperTarget, CreatureTextRange range, Team team, bool gmOnly);
void SendEmote(Unit* source, uint32 emote);
//if sent, returns the 'duration' of the text else 0 if error
- uint32 SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid = 0, ChatMsg msgType = CHAT_MSG_ADDON, Language language = LANG_ADDON, CreatureTextRange range = TEXT_RANGE_NORMAL, uint32 sound = 0, Team team = TEAM_OTHER, bool gmOnly = false, Player* srcPlr = NULL);
+ uint32 SendChat(Creature* source, uint8 textGroup, WorldObject const* whisperTarget = NULL, ChatMsg msgType = CHAT_MSG_ADDON, Language language = LANG_ADDON, CreatureTextRange range = TEXT_RANGE_NORMAL, uint32 sound = 0, Team team = TEAM_OTHER, bool gmOnly = false, Player* srcPlr = NULL);
bool TextExist(uint32 sourceEntry, uint8 textGroup);
std::string GetLocalizedChatString(uint32 entry, uint8 textGroup, uint32 id, LocaleConstant locale) const;
- template<class Builder>
- void SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, uint64 whisperGuid = 0, CreatureTextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false) const;
+ template<class Builder> void SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* whisperTarget = NULL, CreatureTextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false) const;
+
private:
CreatureTextRepeatIds GetRepeatGroup(Creature* source, uint8 textGroup);
void SetRepeatId(Creature* source, uint8 textGroup, uint8 id);
- void SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, uint64 whisperGuid, CreatureTextRange range, Team team, bool gmOnly) const;
+ void SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, WorldObject const* whisperTarget, CreatureTextRange range, Team team, bool gmOnly) const;
float GetRangeForChatType(ChatMsg msgType) const;
CreatureTextMap mTextMap;
@@ -142,8 +142,9 @@ class CreatureTextLocalizer
// create if not cached yet
if (!_packetCache[loc_idx])
{
- messageTemplate = new WorldPacket(SMSG_MESSAGECHAT, 200);
+ messageTemplate = new WorldPacket();
whisperGUIDpos = _builder(messageTemplate, loc_idx);
+ ASSERT(messageTemplate->GetOpcode() != MSG_NULL_ACTION);
_packetCache[loc_idx] = new std::pair<WorldPacket*, size_t>(messageTemplate, whisperGUIDpos);
}
else
@@ -173,7 +174,7 @@ class CreatureTextLocalizer
};
template<class Builder>
-void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, uint64 whisperGuid, CreatureTextRange range, Team team, bool gmOnly) const
+void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* whisperTarget /*= NULL*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/) const
{
if (!source)
return;
@@ -187,11 +188,10 @@ void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder
{
if (range == TEXT_RANGE_NORMAL) //ignores team and gmOnly
{
- Player* player = ObjectAccessor::FindPlayer(whisperGuid);
- if (!player || !player->GetSession())
+ if (!whisperTarget || whisperTarget->GetTypeId() != TYPEID_PLAYER)
return;
- localizer(player);
+ localizer(const_cast<Player*>(whisperTarget->ToPlayer()));
return;
}
break;
diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp
index 03e8401ce63..83c049363d4 100644
--- a/src/server/game/Tickets/TicketMgr.cpp
+++ b/src/server/game/Tickets/TicketMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -32,9 +32,11 @@ inline float GetAge(uint64 t) { return float(time(NULL) - t) / DAY; }
///////////////////////////////////////////////////////////////////////////////////////////////////
// GM ticket
-GmTicket::GmTicket() { }
+GmTicket::GmTicket() : _id(0), _playerGuid(0), _posX(0), _posY(0), _posZ(0), _mapId(0), _createTime(0), _lastModifiedTime(0),
+ _closedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED), _viewed(false),
+ _needResponse(false), _haveTicket(false) { }
-GmTicket::GmTicket(Player* player, WorldPacket& recvData) : _createTime(time(NULL)), _lastModifiedTime(time(NULL)), _closedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED), _haveTicket(false)
+GmTicket::GmTicket(Player* player, WorldPacket& recvData) : _createTime(time(NULL)), _lastModifiedTime(time(NULL)), _closedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED), _viewed(false), _haveTicket(false)
{
_id = sTicketMgr->GenerateTicketId();
_playerName = player->GetName();
diff --git a/src/server/game/Tickets/TicketMgr.h b/src/server/game/Tickets/TicketMgr.h
index 91ef98dda23..3dd048189d7 100644
--- a/src/server/game/Tickets/TicketMgr.h
+++ b/src/server/game/Tickets/TicketMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.cpp b/src/server/game/Tools/CharacterDatabaseCleaner.cpp
index 9f3787e5943..758c78b685d 100644
--- a/src/server/game/Tools/CharacterDatabaseCleaner.cpp
+++ b/src/server/game/Tools/CharacterDatabaseCleaner.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.h b/src/server/game/Tools/CharacterDatabaseCleaner.h
index 83ac25cdf11..94d17d45c47 100644
--- a/src/server/game/Tools/CharacterDatabaseCleaner.h
+++ b/src/server/game/Tools/CharacterDatabaseCleaner.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp
index 087233c5c80..55d70514594 100644
--- a/src/server/game/Tools/PlayerDump.cpp
+++ b/src/server/game/Tools/PlayerDump.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Tools/PlayerDump.h b/src/server/game/Tools/PlayerDump.h
index 4fd411d02ac..ece2c0693e2 100644
--- a/src/server/game/Tools/PlayerDump.h
+++ b/src/server/game/Tools/PlayerDump.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Warden/Modules/WardenModuleMac.h b/src/server/game/Warden/Modules/WardenModuleMac.h
index 8a71606cd4d..5489d9ce5fd 100644
--- a/src/server/game/Warden/Modules/WardenModuleMac.h
+++ b/src/server/game/Warden/Modules/WardenModuleMac.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Warden/Modules/WardenModuleWin.h b/src/server/game/Warden/Modules/WardenModuleWin.h
index fd369802bf6..9efd60b1daa 100644
--- a/src/server/game/Warden/Modules/WardenModuleWin.h
+++ b/src/server/game/Warden/Modules/WardenModuleWin.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp
index f7f71647d71..4611a4da884 100644
--- a/src/server/game/Warden/Warden.cpp
+++ b/src/server/game/Warden/Warden.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -30,7 +30,13 @@
#include "Warden.h"
#include "AccountMgr.h"
-Warden::Warden() : _inputCrypto(16), _outputCrypto(16), _checkTimer(10000/*10 sec*/), _clientResponseTimer(0), _dataSent(false), _initialized(false) { }
+Warden::Warden() : _session(NULL), _inputCrypto(16), _outputCrypto(16), _checkTimer(10000/*10 sec*/), _clientResponseTimer(0),
+ _dataSent(false), _previousTimestamp(0), _module(NULL), _initialized(false)
+{
+ memset(_inputKey, 0, sizeof(_inputKey));
+ memset(_outputKey, 0, sizeof(_outputKey));
+ memset(_seed, 0, sizeof(_seed));
+}
Warden::~Warden()
{
diff --git a/src/server/game/Warden/Warden.h b/src/server/game/Warden/Warden.h
index b9470b0c8a7..ec5bfba85cc 100644
--- a/src/server/game/Warden/Warden.h
+++ b/src/server/game/Warden/Warden.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp
index 0aac3711137..44bab1d31b3 100644
--- a/src/server/game/Warden/WardenCheckMgr.cpp
+++ b/src/server/game/Warden/WardenCheckMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Warden/WardenCheckMgr.h b/src/server/game/Warden/WardenCheckMgr.h
index d2d6236fc65..8f2fa37400d 100644
--- a/src/server/game/Warden/WardenCheckMgr.h
+++ b/src/server/game/Warden/WardenCheckMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp
index a232a0e0b39..092bb19de07 100644
--- a/src/server/game/Warden/WardenMac.cpp
+++ b/src/server/game/Warden/WardenMac.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Warden/WardenMac.h b/src/server/game/Warden/WardenMac.h
index 2cfb7c66df7..3ea509c75ef 100644
--- a/src/server/game/Warden/WardenMac.h
+++ b/src/server/game/Warden/WardenMac.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp
index ca20f4ca8e3..18bf2897358 100644
--- a/src/server/game/Warden/WardenWin.cpp
+++ b/src/server/game/Warden/WardenWin.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
#include "WardenCheckMgr.h"
#include "AccountMgr.h"
-WardenWin::WardenWin() : Warden() { }
+WardenWin::WardenWin() : Warden(), _serverTicks(0) {}
WardenWin::~WardenWin() { }
diff --git a/src/server/game/Warden/WardenWin.h b/src/server/game/Warden/WardenWin.h
index 1b1cc6746f4..47487ba65a2 100644
--- a/src/server/game/Warden/WardenWin.h
+++ b/src/server/game/Warden/WardenWin.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Weather/Weather.cpp b/src/server/game/Weather/Weather.cpp
index 5c03c816e6d..b9133c9d0b1 100644
--- a/src/server/game/Weather/Weather.cpp
+++ b/src/server/game/Weather/Weather.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Weather/Weather.h b/src/server/game/Weather/Weather.h
index 2645d3f2067..0bdd6af6dc5 100644
--- a/src/server/game/Weather/Weather.h
+++ b/src/server/game/Weather/Weather.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Weather/WeatherMgr.cpp b/src/server/game/Weather/WeatherMgr.cpp
index 1b36bc4653c..e327836fa4a 100644
--- a/src/server/game/Weather/WeatherMgr.cpp
+++ b/src/server/game/Weather/WeatherMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/Weather/WeatherMgr.h b/src/server/game/Weather/WeatherMgr.h
index 3f680b383b5..9c03fa513d0 100644
--- a/src/server/game/Weather/WeatherMgr.h
+++ b/src/server/game/Weather/WeatherMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index d8dc19c5dcd..d5bd0974922 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -109,16 +109,28 @@ World::World()
m_MaxPlayerCount = 0;
m_NextDailyQuestReset = 0;
m_NextWeeklyQuestReset = 0;
+ m_NextMonthlyQuestReset = 0;
+ m_NextRandomBGReset = 0;
+ m_NextGuildReset = 0;
m_defaultDbcLocale = LOCALE_enUS;
m_availableDbcLocaleMask = 0;
+ mail_timer = 0;
+ mail_timer_expires = 0;
+ m_updateTime = 0;
m_updateTimeSum = 0;
m_updateTimeCount = 0;
+ m_currentTime = 0;
m_isClosed = false;
m_CleaningFlags = 0;
+
+ memset(rate_values, 0, sizeof(rate_values));
+ memset(m_int_configs, 0, sizeof(m_int_configs));
+ memset(m_bool_configs, 0, sizeof(m_bool_configs));
+ memset(m_float_configs, 0, sizeof(m_float_configs));
}
/// World destructor
@@ -419,27 +431,27 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_ENABLE_SINFO_LOGIN] = sConfigMgr->GetIntDefault("Server.LoginInfo", 0);
///- Read all rates from the config file
- rate_values[RATE_HEALTH] = sConfigMgr->GetFloatDefault("Rate.Health", 1);
+ rate_values[RATE_HEALTH] = sConfigMgr->GetFloatDefault("Rate.Health", 1.0f);
if (rate_values[RATE_HEALTH] < 0)
{
TC_LOG_ERROR("server.loading", "Rate.Health (%f) must be > 0. Using 1 instead.", rate_values[RATE_HEALTH]);
rate_values[RATE_HEALTH] = 1;
}
- rate_values[RATE_POWER_MANA] = sConfigMgr->GetFloatDefault("Rate.Mana", 1);
+ rate_values[RATE_POWER_MANA] = sConfigMgr->GetFloatDefault("Rate.Mana", 1.0f);
if (rate_values[RATE_POWER_MANA] < 0)
{
TC_LOG_ERROR("server.loading", "Rate.Mana (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_MANA]);
rate_values[RATE_POWER_MANA] = 1;
}
- rate_values[RATE_POWER_RAGE_INCOME] = sConfigMgr->GetFloatDefault("Rate.Rage.Income", 1);
- rate_values[RATE_POWER_RAGE_LOSS] = sConfigMgr->GetFloatDefault("Rate.Rage.Loss", 1);
+ rate_values[RATE_POWER_RAGE_INCOME] = sConfigMgr->GetFloatDefault("Rate.Rage.Income", 1.0f);
+ rate_values[RATE_POWER_RAGE_LOSS] = sConfigMgr->GetFloatDefault("Rate.Rage.Loss", 1.0f);
if (rate_values[RATE_POWER_RAGE_LOSS] < 0)
{
TC_LOG_ERROR("server.loading", "Rate.Rage.Loss (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RAGE_LOSS]);
rate_values[RATE_POWER_RAGE_LOSS] = 1;
}
- rate_values[RATE_POWER_RUNICPOWER_INCOME] = sConfigMgr->GetFloatDefault("Rate.RunicPower.Income", 1);
- rate_values[RATE_POWER_RUNICPOWER_LOSS] = sConfigMgr->GetFloatDefault("Rate.RunicPower.Loss", 1);
+ rate_values[RATE_POWER_RUNICPOWER_INCOME] = sConfigMgr->GetFloatDefault("Rate.RunicPower.Income", 1.0f);
+ rate_values[RATE_POWER_RUNICPOWER_LOSS] = sConfigMgr->GetFloatDefault("Rate.RunicPower.Loss", 1.0f);
if (rate_values[RATE_POWER_RUNICPOWER_LOSS] < 0)
{
TC_LOG_ERROR("server.loading", "Rate.RunicPower.Loss (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RUNICPOWER_LOSS]);
@@ -633,8 +645,8 @@ void World::LoadConfigSettings(bool reload)
m_float_configs[CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE] = sConfigMgr->GetFloatDefault("MaxRecruitAFriendBonusDistance", 100.0f);
/// @todo Add MonsterSight and GuarderSight (with meaning) in worldserver.conf or put them as define
- m_float_configs[CONFIG_SIGHT_MONSTER] = sConfigMgr->GetFloatDefault("MonsterSight", 50);
- m_float_configs[CONFIG_SIGHT_GUARDER] = sConfigMgr->GetFloatDefault("GuarderSight", 50);
+ m_float_configs[CONFIG_SIGHT_MONSTER] = sConfigMgr->GetFloatDefault("MonsterSight", 50.0f);
+ m_float_configs[CONFIG_SIGHT_GUARDER] = sConfigMgr->GetFloatDefault("GuarderSight", 50.0f);
if (reload)
{
@@ -935,12 +947,12 @@ void World::LoadConfigSettings(bool reload)
if (reload)
{
- uint32 val = sConfigMgr->GetIntDefault("Expansion", 1);
+ uint32 val = sConfigMgr->GetIntDefault("Expansion", 2);
if (val != m_int_configs[CONFIG_EXPANSION])
TC_LOG_ERROR("server.loading", "Expansion option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_EXPANSION]);
}
else
- m_int_configs[CONFIG_EXPANSION] = sConfigMgr->GetIntDefault("Expansion", 1);
+ m_int_configs[CONFIG_EXPANSION] = sConfigMgr->GetIntDefault("Expansion", 2);
m_int_configs[CONFIG_CHATFLOOD_MESSAGE_COUNT] = sConfigMgr->GetIntDefault("ChatFlood.MessageCount", 10);
m_int_configs[CONFIG_CHATFLOOD_MESSAGE_DELAY] = sConfigMgr->GetIntDefault("ChatFlood.MessageDelay", 1);
@@ -1161,6 +1173,8 @@ void World::LoadConfigSettings(bool reload)
m_bool_configs[CONFIG_NO_RESET_TALENT_COST] = sConfigMgr->GetBoolDefault("NoResetTalentsCost", false);
m_bool_configs[CONFIG_SHOW_KICK_IN_WORLD] = sConfigMgr->GetBoolDefault("ShowKickInWorld", false);
+ m_bool_configs[CONFIG_SHOW_MUTE_IN_WORLD] = sConfigMgr->GetBoolDefault("ShowMuteInWorld", false);
+ m_bool_configs[CONFIG_SHOW_BAN_IN_WORLD] = sConfigMgr->GetBoolDefault("ShowBanInWorld", false);
m_int_configs[CONFIG_INTERVAL_LOG_UPDATE] = sConfigMgr->GetIntDefault("RecordUpdateTimeDiffInterval", 60000);
m_int_configs[CONFIG_MIN_LOG_UPDATE] = sConfigMgr->GetIntDefault("MinRecordUpdateTimeDiff", 100);
m_int_configs[CONFIG_NUMTHREADS] = sConfigMgr->GetIntDefault("MapUpdate.Threads", 1);
@@ -2187,23 +2201,10 @@ namespace Trinity
void do_helper(WorldPacketList& data_list, char* text)
{
char* pos = text;
-
while (char* line = lineFromMessage(pos))
{
WorldPacket* data = new WorldPacket();
-
- uint32 lineLength = strlen(line) + 1;
-
- data->Initialize(SMSG_MESSAGECHAT, 100); // guess size
- *data << uint8(CHAT_MSG_SYSTEM);
- *data << uint32(LANG_UNIVERSAL);
- *data << uint64(0);
- *data << uint32(0); // can be chat msg group or something
- *data << uint64(0);
- *data << uint32(lineLength);
- *data << line;
- *data << uint8(0);
-
+ ChatHandler::BuildChatPacket(*data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, NULL, line);
data_list.push_back(data);
}
}
@@ -2269,7 +2270,7 @@ void World::SendGlobalText(const char* text, WorldSession* self)
while (char* line = ChatHandler::LineFromMessage(pos))
{
- ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, 0, line, NULL);
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, NULL, line);
SendGlobalMessage(&data, self);
}
@@ -2298,7 +2299,7 @@ void World::SendZoneMessage(uint32 zone, WorldPacket* packet, WorldSession* self
void World::SendZoneText(uint32 zone, const char* text, WorldSession* self, uint32 team)
{
WorldPacket data;
- ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, 0, text, NULL);
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, NULL, text);
SendZoneMessage(zone, &data, self, team);
}
@@ -3168,6 +3169,10 @@ void World::UpdateCharacterNameData(uint32 guid, std::string const& name, uint8
if (race != RACE_NONE)
itr->second.m_race = race;
+
+ WorldPacket data(SMSG_INVALIDATE_PLAYER, 8);
+ data << MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER);
+ SendGlobalMessage(&data);
}
void World::UpdateCharacterNameDataLevel(uint32 guid, uint8 level)
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index 9422566b707..8c8aebf97d9 100644
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -137,6 +137,8 @@ enum WorldBoolConfigs
CONFIG_PVP_TOKEN_ENABLE,
CONFIG_NO_RESET_TALENT_COST,
CONFIG_SHOW_KICK_IN_WORLD,
+ CONFIG_SHOW_MUTE_IN_WORLD,
+ CONFIG_SHOW_BAN_IN_WORLD,
CONFIG_CHATLOG_CHANNEL,
CONFIG_CHATLOG_WHISPER,
CONFIG_CHATLOG_SYSCHAN,
diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt
index 20e4c4c7fdd..c1a9435de52 100644
--- a/src/server/scripts/CMakeLists.txt
+++ b/src/server/scripts/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt
index c38789ed90a..6f969030606 100644
--- a/src/server/scripts/Commands/CMakeLists.txt
+++ b/src/server/scripts/Commands/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index 6e9dbea8b21..ec3d34332b0 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_achievement.cpp b/src/server/scripts/Commands/cs_achievement.cpp
index 86c5e1c51c2..041b6c86881 100644
--- a/src/server/scripts/Commands/cs_achievement.cpp
+++ b/src/server/scripts/Commands/cs_achievement.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_arena.cpp b/src/server/scripts/Commands/cs_arena.cpp
index 42cfa50bc05..e3e726eb348 100644
--- a/src/server/scripts/Commands/cs_arena.cpp
+++ b/src/server/scripts/Commands/cs_arena.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp
index 477f8e0ed72..b1a3dd4bca5 100644
--- a/src/server/scripts/Commands/cs_ban.cpp
+++ b/src/server/scripts/Commands/cs_ban.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -114,9 +114,19 @@ public:
case BAN_SUCCESS:
{
if (atoi(durationStr) > 0)
- handler->PSendSysMessage(LANG_BAN_YOUBANNED, name.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr);
+ {
+ if (sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
+ sWorld->SendWorldText(LANG_BAN_CHARACTER_YOUBANNEDMESSAGE_WORLD, (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "Server"), name.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr);
+ else
+ handler->PSendSysMessage(LANG_BAN_YOUBANNED, name.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr);
+ }
else
- handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, name.c_str(), reasonStr);
+ {
+ if (sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
+ sWorld->SendWorldText(LANG_BAN_CHARACTER_YOUPERMBANNEDMESSAGE_WORLD, (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "Server"), name.c_str(), reasonStr);
+ else
+ handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, name.c_str(), reasonStr);
+ }
break;
}
case BAN_NOTFOUND:
@@ -189,9 +199,19 @@ public:
{
case BAN_SUCCESS:
if (atoi(durationStr) > 0)
- handler->PSendSysMessage(LANG_BAN_YOUBANNED, nameOrIP.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr);
- else
- handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, nameOrIP.c_str(), reasonStr);
+ {
+ if (sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
+ sWorld->SendWorldText(LANG_BAN_ACCOUNT_YOUBANNEDMESSAGE_WORLD, (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "Server"), nameOrIP.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr);
+ else
+ handler->PSendSysMessage(LANG_BAN_YOUBANNED, nameOrIP.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr);
+ }
+ else
+ {
+ if (sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
+ sWorld->SendWorldText(LANG_BAN_ACCOUNT_YOUPERMBANNEDMESSAGE_WORLD, (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "Server"), nameOrIP.c_str(), reasonStr);
+ else
+ handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, nameOrIP.c_str(), reasonStr);
+ }
break;
case BAN_SYNTAX_ERROR:
return false;
diff --git a/src/server/scripts/Commands/cs_bf.cpp b/src/server/scripts/Commands/cs_bf.cpp
index 65c4d3d23f9..2bc962f0768 100644
--- a/src/server/scripts/Commands/cs_bf.cpp
+++ b/src/server/scripts/Commands/cs_bf.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_cast.cpp b/src/server/scripts/Commands/cs_cast.cpp
index 7ba44b6a558..545ae405c20 100644
--- a/src/server/scripts/Commands/cs_cast.cpp
+++ b/src/server/scripts/Commands/cs_cast.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp
index e35b7f08444..f9ef827e8c3 100644
--- a/src/server/scripts/Commands/cs_character.cpp
+++ b/src/server/scripts/Commands/cs_character.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_cheat.cpp b/src/server/scripts/Commands/cs_cheat.cpp
index 3490145c044..bf51141ba4f 100644
--- a/src/server/scripts/Commands/cs_cheat.cpp
+++ b/src/server/scripts/Commands/cs_cheat.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index a4ccbc40211..597823abc13 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -481,7 +481,7 @@ public:
char const* msg = "testtest";
uint8 type = atoi(args);
WorldPacket data;
- ChatHandler::FillMessageData(&data, handler->GetSession(), type, 0, "chan", handler->GetSession()->GetPlayer()->GetGUID(), msg, handler->GetSession()->GetPlayer());
+ ChatHandler::BuildChatPacket(data, ChatMsg(type), LANG_UNIVERSAL, handler->GetSession()->GetPlayer(), handler->GetSession()->GetPlayer(), msg, 0, "chan");
handler->GetSession()->SendPacket(&data);
return true;
}
@@ -923,7 +923,7 @@ public:
if (!ve)
return false;
- Creature* v = new Creature;
+ Creature* v = new Creature();
Map* map = handler->GetSession()->GetPlayer()->GetMap();
@@ -1382,7 +1382,10 @@ public:
}
else
{
+ Position pos;
+ transport->GetPosition(&pos);
handler->PSendSysMessage("Transport %s is %s", transport->GetName().c_str(), transport->GetGoState() == GO_STATE_READY ? "stopped" : "moving");
+ handler->PSendSysMessage("Transport position: %s", pos.ToString().c_str());
return true;
}
diff --git a/src/server/scripts/Commands/cs_deserter.cpp b/src/server/scripts/Commands/cs_deserter.cpp
index 2a052c00459..5a9c799a4a8 100644
--- a/src/server/scripts/Commands/cs_deserter.cpp
+++ b/src/server/scripts/Commands/cs_deserter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_disable.cpp b/src/server/scripts/Commands/cs_disable.cpp
index 27990597656..5d7296ca495 100644
--- a/src/server/scripts/Commands/cs_disable.cpp
+++ b/src/server/scripts/Commands/cs_disable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_event.cpp b/src/server/scripts/Commands/cs_event.cpp
index 0fb57a3315a..849a8b5634e 100644
--- a/src/server/scripts/Commands/cs_event.cpp
+++ b/src/server/scripts/Commands/cs_event.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index 6884db18b98..498ee68ba11 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -198,33 +198,34 @@ public:
//Enable\Disable Invisible mode
static bool HandleGMVisibleCommand(ChatHandler* handler, char const* args)
{
+ Player* _player = handler->GetSession()->GetPlayer();
+
if (!*args)
{
- handler->PSendSysMessage(LANG_YOU_ARE, handler->GetSession()->GetPlayer()->isGMVisible() ? handler->GetTrinityString(LANG_VISIBLE) : handler->GetTrinityString(LANG_INVISIBLE));
+ handler->PSendSysMessage(LANG_YOU_ARE, _player->isGMVisible() ? handler->GetTrinityString(LANG_VISIBLE) : handler->GetTrinityString(LANG_INVISIBLE));
return true;
}
const uint32 VISUAL_AURA = 37800;
std::string param = (char*)args;
- Player* player = handler->GetSession()->GetPlayer();
if (param == "on")
{
- if (player->HasAura(VISUAL_AURA, 0))
- player->RemoveAurasDueToSpell(VISUAL_AURA);
+ if (_player->HasAura(VISUAL_AURA, 0))
+ _player->RemoveAurasDueToSpell(VISUAL_AURA);
- player->SetGMVisible(true);
+ _player->SetGMVisible(true);
+ _player->UpdateObjectVisibility();
handler->GetSession()->SendNotification(LANG_INVISIBLE_VISIBLE);
return true;
}
if (param == "off")
{
+ _player->AddAura(VISUAL_AURA, _player);
+ _player->SetGMVisible(false);
+ _player->UpdateObjectVisibility();
handler->GetSession()->SendNotification(LANG_INVISIBLE_INVISIBLE);
- player->SetGMVisible(false);
-
- player->AddAura(VISUAL_AURA, player);
-
return true;
}
@@ -236,12 +237,11 @@ public:
//Enable\Disable GM Mode
static bool HandleGMCommand(ChatHandler* handler, char const* args)
{
+ Player* _player = handler->GetSession()->GetPlayer();
+
if (!*args)
{
- if (handler->GetSession()->GetPlayer()->IsGameMaster())
- handler->GetSession()->SendNotification(LANG_GM_ON);
- else
- handler->GetSession()->SendNotification(LANG_GM_OFF);
+ handler->GetSession()->SendNotification(_player->IsGameMaster() ? LANG_GM_ON : LANG_GM_OFF);
return true;
}
@@ -249,9 +249,9 @@ public:
if (param == "on")
{
- handler->GetSession()->GetPlayer()->SetGameMaster(true);
+ _player->SetGameMaster(true);
handler->GetSession()->SendNotification(LANG_GM_ON);
- handler->GetSession()->GetPlayer()->UpdateTriggerVisibility();
+ _player->UpdateTriggerVisibility();
#ifdef _DEBUG_VMAPS
VMAP::IVMapManager* vMapManager = VMAP::VMapFactory::createOrGetVMapManager();
vMapManager->processCommand("stoplog");
@@ -261,9 +261,9 @@ public:
if (param == "off")
{
- handler->GetSession()->GetPlayer()->SetGameMaster(false);
+ _player->SetGameMaster(false);
handler->GetSession()->SendNotification(LANG_GM_OFF);
- handler->GetSession()->GetPlayer()->UpdateTriggerVisibility();
+ _player->UpdateTriggerVisibility();
#ifdef _DEBUG_VMAPS
VMAP::IVMapManager* vMapManager = VMAP::VMapFactory::createOrGetVMapManager();
vMapManager->processCommand("startlog");
diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp
index 5bc59bb74d3..fecb4edf968 100644
--- a/src/server/scripts/Commands/cs_go.cpp
+++ b/src/server/scripts/Commands/cs_go.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -112,7 +112,7 @@ public:
{
std::string name = param1;
WorldDatabase.EscapeString(name);
- whereClause << ", creature_template WHERE creature.id = creature_template.entry AND creature_template.name "_LIKE_" '" << name << '\'';
+ whereClause << ", creature_template WHERE creature.id = creature_template.entry AND creature_template.name " _LIKE_" '" << name << '\'';
}
else
whereClause << "WHERE guid = '" << guid << '\'';
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index 6bb927fec5e..423a47eb3c8 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -238,7 +238,7 @@ public:
WorldDatabase.EscapeString(name);
result = WorldDatabase.PQuery(
"SELECT guid, id, position_x, position_y, position_z, orientation, map, phaseMask, (POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ "
- "FROM gameobject, gameobject_template WHERE gameobject_template.entry = gameobject.id AND map = %i AND name "_LIKE_" "_CONCAT3_("'%%'", "'%s'", "'%%'")" ORDER BY order_ ASC LIMIT 1",
+ "FROM gameobject, gameobject_template WHERE gameobject_template.entry = gameobject.id AND map = %i AND name " _LIKE_" " _CONCAT3_("'%%'", "'%s'", "'%%'")" ORDER BY order_ ASC LIMIT 1",
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), name.c_str());
}
}
diff --git a/src/server/scripts/Commands/cs_group.cpp b/src/server/scripts/Commands/cs_group.cpp
index fda34586f0c..c236af40e45 100644
--- a/src/server/scripts/Commands/cs_group.cpp
+++ b/src/server/scripts/Commands/cs_group.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_guild.cpp b/src/server/scripts/Commands/cs_guild.cpp
index f9d5d101838..4627f6b022e 100644
--- a/src/server/scripts/Commands/cs_guild.cpp
+++ b/src/server/scripts/Commands/cs_guild.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_honor.cpp b/src/server/scripts/Commands/cs_honor.cpp
index 76561cc9d84..40663ca5a10 100644
--- a/src/server/scripts/Commands/cs_honor.cpp
+++ b/src/server/scripts/Commands/cs_honor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp
index 6c576c2c368..93cabaeeca7 100644
--- a/src/server/scripts/Commands/cs_instance.cpp
+++ b/src/server/scripts/Commands/cs_instance.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp
index 48d809097ca..113f6da2e31 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_lfg.cpp b/src/server/scripts/Commands/cs_lfg.cpp
index 707ac79ccc3..2c6534be8a2 100644
--- a/src/server/scripts/Commands/cs_lfg.cpp
+++ b/src/server/scripts/Commands/cs_lfg.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp
index 9037999d71a..1ee92625735 100644
--- a/src/server/scripts/Commands/cs_list.cpp
+++ b/src/server/scripts/Commands/cs_list.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp
index f2ce4ed8a85..f2b4f54363b 100644
--- a/src/server/scripts/Commands/cs_lookup.cpp
+++ b/src/server/scripts/Commands/cs_lookup.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_message.cpp b/src/server/scripts/Commands/cs_message.cpp
index 51f711894ed..dd1366ac09c 100644
--- a/src/server/scripts/Commands/cs_message.cpp
+++ b/src/server/scripts/Commands/cs_message.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 7e28046d1e2..094e45d91a2 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -809,12 +809,16 @@ public:
if (handler->HasLowerSecurity(target, 0))
return false;
- if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD))
- sWorld->SendWorldText(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
- else
- handler->PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
+ char const* kickReason = strtok(NULL, "\r");
+ std::string kickReasonStr = "No reason";
+ if (kickReason != NULL)
+ kickReasonStr = kickReason;
- target->GetSession()->KickPlayer();
+ if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD))
+ sWorld->SendWorldText(LANG_COMMAND_KICKMESSAGE_WORLD, (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "Server"), playerName.c_str(), kickReasonStr.c_str());
+ else
+ handler->PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
+ target->GetSession()->KickPlayer();
return true;
}
@@ -1334,23 +1338,20 @@ public:
return false;
}
- std::string tNameLink = handler->GetNameLink(target);
-
- if (!target->GetSkillValue(skill))
- {
- handler->PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, skillLine->name[handler->GetSessionDbcLocale()]);
- handler->SetSentErrorMessage(true);
- return false;
- }
+ bool targetHasSkill = target->GetSkillValue(skill);
- uint16 max = maxPureSkill ? atol (maxPureSkill) : target->GetPureMaxSkillValue(skill);
+ // If our target does not yet have the skill they are trying to add to them, the chosen level also becomes
+ // the max level of the new profession.
+ uint16 max = maxPureSkill ? atol (maxPureSkill) : targetHasSkill ? target->GetPureMaxSkillValue(skill) : uint16(level);
if (level <= 0 || level > max || max <= 0)
return false;
- target->SetSkill(skill, target->GetSkillStep(skill), level, max);
- handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name[handler->GetSessionDbcLocale()], tNameLink.c_str(), level, max);
-
+ // If the player has the skill, we get the current skill step. If they don't have the skill, we
+ // add the skill to the player's book with step 1 (which is the first rank, in most cases something
+ // like 'Apprentice <skill>'.
+ target->SetSkill(skill, targetHasSkill ? target->GetSkillStep(skill) : 1, level, max);
+ handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name[handler->GetSessionDbcLocale()], handler->GetNameLink(target).c_str(), level, max);
return true;
}
@@ -1836,7 +1837,17 @@ public:
int64 muteTime = time(NULL) + notSpeakTime * MINUTE;
target->GetSession()->m_muteTime = muteTime;
stmt->setInt64(0, muteTime);
- ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteBy.c_str(), muteReasonStr.c_str());
+ std::string nameLink = handler->playerLink(targetName);
+
+ if (sWorld->getBoolConfig(CONFIG_SHOW_MUTE_IN_WORLD))
+ {
+ sWorld->SendWorldText(LANG_COMMAND_MUTEMESSAGE_WORLD, (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "Server"), nameLink.c_str(), notSpeakTime, muteReasonStr.c_str());
+ ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteBy.c_str(), muteReasonStr.c_str());
+ }
+ else
+ {
+ ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteBy.c_str(), muteReasonStr.c_str());
+ }
}
else
{
@@ -1851,8 +1862,10 @@ public:
LoginDatabase.Execute(stmt);
std::string nameLink = handler->playerLink(targetName);
- handler->PSendSysMessage(target ? LANG_YOU_DISABLE_CHAT : LANG_COMMAND_DISABLE_CHAT_DELAYED, nameLink.c_str(), notSpeakTime, muteReasonStr.c_str());
-
+ if (sWorld->getBoolConfig(CONFIG_SHOW_MUTE_IN_WORLD) && !target)
+ sWorld->SendWorldText(LANG_COMMAND_MUTEMESSAGE_WORLD, handler->GetSession()->GetPlayerName().c_str(), nameLink.c_str(), notSpeakTime, muteReasonStr.c_str());
+ else
+ handler->PSendSysMessage(target ? LANG_YOU_DISABLE_CHAT : LANG_COMMAND_DISABLE_CHAT_DELAYED, nameLink.c_str(), notSpeakTime, muteReasonStr.c_str());
return true;
}
@@ -2281,7 +2294,7 @@ public:
// stop combat + make player unattackable + duel stop + stop some spells
player->setFaction(35);
player->CombatStop();
- if (player->IsNonMeleeSpellCasted(true))
+ if (player->IsNonMeleeSpellCast(true))
player->InterruptNonMeleeSpells(true);
player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp
index 690988ebac1..61598bf0945 100644
--- a/src/server/scripts/Commands/cs_mmaps.cpp
+++ b/src/server/scripts/Commands/cs_mmaps.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index 4aa7c19fea6..c2d6bf47154 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index b472ba48a5c..a5b13301403 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -275,7 +275,11 @@ public:
uint32 db_guid = creature->GetDBTableGUIDLow();
- // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
+ // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells()
+ // current "creature" variable is deleted and created fresh new, otherwise old values might trigger asserts or cause undefined behavior
+ creature->CleanupsBeforeDelete();
+ delete creature;
+ creature = new Creature();
if (!creature->LoadCreatureFromDB(db_guid, map))
{
delete creature;
@@ -740,7 +744,7 @@ public:
for (uint8 i = 0; i < NPCFLAG_COUNT; i++)
if (npcflags & npcFlagTexts[i].Value)
- handler->PSendSysMessage(npcFlagTexts[i].Name);
+ handler->PSendSysMessage(npcFlagTexts[i].Name, npcFlagTexts[i].Value);
handler->PSendSysMessage(LANG_NPCINFO_MECHANIC_IMMUNE, mechanicImmuneMask);
for (uint8 i = 0; i < MAX_MECHANIC; ++i)
@@ -1204,7 +1208,7 @@ public:
return false;
}
- creature->MonsterSay(args, LANG_UNIVERSAL, 0);
+ creature->MonsterSay(args, LANG_UNIVERSAL, NULL);
// make some emotes
char lastchar = args[strlen(args) - 1];
@@ -1291,10 +1295,11 @@ public:
uint64 receiver_guid = atol(receiver_str);
// check online security
- if (handler->HasLowerSecurity(ObjectAccessor::FindPlayer(receiver_guid), 0))
+ Player* receiver = ObjectAccessor::FindPlayer(receiver_guid);
+ if (handler->HasLowerSecurity(receiver, 0))
return false;
- creature->MonsterWhisper(text, receiver_guid);
+ creature->MonsterWhisper(text, receiver);
return true;
}
@@ -1311,7 +1316,7 @@ public:
return false;
}
- creature->MonsterYell(args, LANG_UNIVERSAL, 0);
+ creature->MonsterYell(args, LANG_UNIVERSAL, NULL);
// make an emote
creature->HandleEmoteCommand(EMOTE_ONESHOT_SHOUT);
diff --git a/src/server/scripts/Commands/cs_pet.cpp b/src/server/scripts/Commands/cs_pet.cpp
index 9a61250d193..1a5df88f144 100644
--- a/src/server/scripts/Commands/cs_pet.cpp
+++ b/src/server/scripts/Commands/cs_pet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp
index 84adeb3417c..01e28b0910d 100644
--- a/src/server/scripts/Commands/cs_quest.cpp
+++ b/src/server/scripts/Commands/cs_quest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -92,7 +92,7 @@ public:
// ok, normal (creature/GO starting) quest
if (player->CanAddQuest(quest, true))
{
- player->AddQuest(quest, NULL);
+ player->AddQuestAndCheckCompletion(quest, NULL);
if (player->CanCompleteQuest(entry))
player->CompleteQuest(entry);
@@ -201,7 +201,7 @@ public:
}
}
- // All creature/GO slain/casted (not required, but otherwise it will display "Creature slain 0/10")
+ // All creature/GO slain/cast (not required, but otherwise it will display "Creature slain 0/10")
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
{
int32 creature = quest->RequiredNpcOrGo[i];
diff --git a/src/server/scripts/Commands/cs_rbac.cpp b/src/server/scripts/Commands/cs_rbac.cpp
index 1f946fe80ad..df4ce993433 100644
--- a/src/server/scripts/Commands/cs_rbac.cpp
+++ b/src/server/scripts/Commands/cs_rbac.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index 59477c6684f..7e759a788f5 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp
index 2b27fcf56fd..4299e690989 100644
--- a/src/server/scripts/Commands/cs_reset.cpp
+++ b/src/server/scripts/Commands/cs_reset.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_send.cpp b/src/server/scripts/Commands/cs_send.cpp
index 7ac0940ec77..58970a91e20 100644
--- a/src/server/scripts/Commands/cs_send.cpp
+++ b/src/server/scripts/Commands/cs_send.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp
index a43f3bccf8d..4cd5e1f6274 100644
--- a/src/server/scripts/Commands/cs_server.cpp
+++ b/src/server/scripts/Commands/cs_server.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp
index ca9f4a59045..f6618227ae6 100644
--- a/src/server/scripts/Commands/cs_tele.cpp
+++ b/src/server/scripts/Commands/cs_tele.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp
index 304bec9fee9..2f0b53bff68 100644
--- a/src/server/scripts/Commands/cs_ticket.cpp
+++ b/src/server/scripts/Commands/cs_ticket.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp
index 7654336533a..20bffdbb792 100644
--- a/src/server/scripts/Commands/cs_titles.cpp
+++ b/src/server/scripts/Commands/cs_titles.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp
index dc731985588..9b20383e94a 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -214,7 +214,7 @@ public:
target->LoadPath(pathid);
target->SetDefaultMovementType(WAYPOINT_MOTION_TYPE);
target->GetMotionMaster()->Initialize();
- target->MonsterSay("Path loaded.", 0, 0);
+ target->MonsterSay("Path loaded.", LANG_UNIVERSAL, NULL);
return true;
}
@@ -270,7 +270,7 @@ public:
target->SetDefaultMovementType(IDLE_MOTION_TYPE);
target->GetMotionMaster()->MoveTargetedHome();
target->GetMotionMaster()->Initialize();
- target->MonsterSay("Path unloaded.", 0, 0);
+ target->MonsterSay("Path unloaded.", LANG_UNIVERSAL, NULL);
return true;
}
handler->PSendSysMessage("%s%s|r", "|cffff33ff", "Target have no loaded path.");
@@ -689,7 +689,7 @@ public:
wpCreature->AddObjectToRemoveList();
}
// re-create
- Creature* wpCreature2 = new Creature;
+ Creature* wpCreature2 = new Creature();
if (!wpCreature2->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
@@ -913,7 +913,7 @@ public:
Map* map = chr->GetMap();
float o = chr->GetOrientation();
- Creature* wpCreature = new Creature;
+ Creature* wpCreature = new Creature();
if (!wpCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
@@ -977,7 +977,7 @@ public:
float o = chr->GetOrientation();
Map* map = chr->GetMap();
- Creature* creature = new Creature;
+ Creature* creature = new Creature();
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
@@ -1026,7 +1026,7 @@ public:
Player* chr = handler->GetSession()->GetPlayer();
Map* map = chr->GetMap();
- Creature* creature = new Creature;
+ Creature* creature = new Creature();
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id);
diff --git a/src/server/scripts/Custom/CMakeLists.txt b/src/server/scripts/Custom/CMakeLists.txt
index 99cf026f776..78db719ae6e 100644
--- a/src/server/scripts/Custom/CMakeLists.txt
+++ b/src/server/scripts/Custom/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp
index 7bc08b9a7c6..3859555a90c 100644
--- a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp
+++ b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp
index 6dbcdffca72..ab135a2fd78 100644
--- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp
+++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -60,6 +60,7 @@ public:
{
waterBoltTimer = 3 * IN_MILLISECONDS;
resetTimer = 5 * IN_MILLISECONDS;
+ balindaGUID = 0;
}
void UpdateAI(uint32 diff) OVERRIDE
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp
index 7559d71bf78..2f48ca4a3b6 100644
--- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp
+++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp
index 4f91e57be50..aa852ffd30c 100644
--- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp
+++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp
index 0e5370f0f07..4e7c2abcdcc 100644
--- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp
+++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
index ee8f22ca66c..55a89d062e8 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -117,7 +117,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_grimstoneAI(creature);
+ return GetInstanceAI<npc_grimstoneAI>(creature);
}
struct npc_grimstoneAI : public npc_escortAI
@@ -207,12 +207,9 @@ public:
Event_Timer = 5000;
break;
case 5:
- if (instance)
- {
- instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me);
- instance->SetData(TYPE_RING_OF_LAW, DONE);
- TC_LOG_DEBUG("scripts", "npc_grimstone: event reached end and set complete.");
- }
+ instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me);
+ instance->SetData(TYPE_RING_OF_LAW, DONE);
+ TC_LOG_DEBUG("scripts", "npc_grimstone: event reached end and set complete.");
break;
}
}
@@ -224,9 +221,6 @@ public:
void UpdateAI(uint32 diff) OVERRIDE
{
- if (!instance)
- return;
-
if (MobDeath_Timer)
{
if (MobDeath_Timer <= diff)
@@ -1237,7 +1231,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_rocknotAI(creature);
+ return GetInstanceAI<npc_rocknotAI>(creature);
}
struct npc_rocknotAI : public npc_escortAI
@@ -1269,9 +1263,6 @@ public:
void WaypointReached(uint32 waypointId) OVERRIDE
{
- if (!instance)
- return;
-
switch (waypointId)
{
case 1:
@@ -1295,9 +1286,6 @@ public:
void UpdateAI(uint32 diff) OVERRIDE
{
- if (!instance)
- return;
-
if (BreakKeg_Timer)
{
if (BreakKeg_Timer <= diff)
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h
index b279012bbf7..ea3fd59490a 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
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 75f85ace2bd..5201e06aa17 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_ambassador_flamelash.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_ambassador_flamelash.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_anubshiah.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_anubshiah.cpp
index 84964ba375a..33e0484c0d5 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_anubshiah.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_anubshiah.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp
index 25f93a2b6b7..845db0cac1c 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_draganthaurissanAI(creature);
+ return GetInstanceAI<boss_draganthaurissanAI>(creature);
}
struct boss_draganthaurissanAI : public ScriptedAI
@@ -92,7 +92,7 @@ public:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_HANDOFTHAURISSAN);
- //3 Hands of Thaurissan will be casted
+ //3 Hands of Thaurissan will be cast
//if (Counter < 3)
//{
// HandOfThaurissan_Timer = 1000;
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 869479a7ae0..258dfd5db07 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_gorosh_the_dervish.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_gorosh_the_dervish.cpp
index f865a6f6742..acc739425ee 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_gorosh_the_dervish.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_gorosh_the_dervish.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_grizzle.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_grizzle.cpp
index 1c2953a6a22..9bd36203dd2 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_grizzle.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_grizzle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
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 86748977749..65a3fd35d48 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp
index f4c63f630c3..ce3a11d817b 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
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 c647737bea9..21c887ac7d6 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp
index 55e6862bda7..f432d71ff68 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -140,7 +140,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_doomrelAI(creature);
+ return GetInstanceAI<boss_doomrelAI>(creature);
}
struct boss_doomrelAI : public ScriptedAI
@@ -170,13 +170,10 @@ public:
// was set before event start, so set again
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
- if (instance)
- {
- if (instance->GetData(DATA_GHOSTKILL) >= 7)
- me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
- else
- me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- }
+ if (instance->GetData(DATA_GHOSTKILL) >= 7)
+ me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
+ else
+ me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -192,14 +189,12 @@ public:
if (me->IsAlive())
me->GetMotionMaster()->MoveTargetedHome();
me->SetLootRecipient(NULL);
- if (instance)
- instance->SetData64(DATA_EVENSTARTER, 0);
+ instance->SetData64(DATA_EVENSTARTER, 0);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_GHOSTKILL, 1);
+ instance->SetData(DATA_GHOSTKILL, 1);
}
void UpdateAI(uint32 diff) OVERRIDE
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 f1ccf35e490..42c7c046d48 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h
index e2295521a5b..2199e52129c 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp
index 009c22e40b3..32b87a94ae4 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gizrul_the_slavener.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gizrul_the_slavener.cpp
index 9f22c2c1e85..1c6c0a5aa62 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gizrul_the_slavener.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gizrul_the_slavener.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp
index dbc3056b1ff..96582fdf6fe 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -162,7 +162,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_gythAI(creature);
+ return GetInstanceAI<boss_gythAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_halycon.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_halycon.cpp
index b79a6e4733e..482cc9cf81a 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_halycon.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_halycon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_highlord_omokk.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_highlord_omokk.cpp
index 5b5e9bc082a..590c025388b 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_highlord_omokk.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_highlord_omokk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_lord_valthalak.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_lord_valthalak.cpp
index 26540eb38a6..41e0fb61018 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_lord_valthalak.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_lord_valthalak.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -64,8 +64,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_LORD_VALTHALAK, DONE);
+ instance->SetData(DATA_LORD_VALTHALAK, DONE);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -128,7 +127,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_lord_valthalakAI(creature);
+ return GetInstanceAI<boss_lord_valthalakAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_mother_smolderweb.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_mother_smolderweb.cpp
index f9b0441af77..ed1916b90d6 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_mother_smolderweb.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_mother_smolderweb.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_overlord_wyrmthalak.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_overlord_wyrmthalak.cpp
index 2a448898813..8db2065b3ea 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_overlord_wyrmthalak.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_overlord_wyrmthalak.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
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 1c40385c0fd..7f5cd93a5b1 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -79,23 +79,20 @@ public:
void Reset() OVERRIDE
{
- if (instance)
- {
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
- events.Reset();
- // Apply auras on spawn and reset
- // DoCast(me, SPELL_FIRE_SHIELD_TRIGGER); // Need to find this in old DBC if possible
- me->RemoveAura(SPELL_EMBERSEER_FULL_STRENGTH);
- me->RemoveAura(SPELL_EMBERSEER_GROWING);
- me->RemoveAura(SPELL_EMBERSEER_GROWING_TRIGGER);
- events.ScheduleEvent(EVENT_RESPAWN, 5000);
- // Hack for missing trigger spell
- events.ScheduleEvent(EVENT_FIRE_SHIELD, 3000);
-
- // Open doors on reset
- if (instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS)
- OpenDoors(false); // Opens 2 entrance doors
- }
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
+ events.Reset();
+ // Apply auras on spawn and reset
+ // DoCast(me, SPELL_FIRE_SHIELD_TRIGGER); // Need to find this in old DBC if possible
+ me->RemoveAura(SPELL_EMBERSEER_FULL_STRENGTH);
+ me->RemoveAura(SPELL_EMBERSEER_GROWING);
+ me->RemoveAura(SPELL_EMBERSEER_GROWING_TRIGGER);
+ events.ScheduleEvent(EVENT_RESPAWN, 5000);
+ // Hack for missing trigger spell
+ events.ScheduleEvent(EVENT_FIRE_SHIELD, 3000);
+
+ // Open doors on reset
+ if (instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS)
+ OpenDoors(false); // Opens 2 entrance doors
}
void SetData(uint32 /*type*/, uint32 data) OVERRIDE
@@ -132,15 +129,12 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- {
- // Activate all the runes
- UpdateRunes(GO_STATE_READY);
- // Opens all 3 doors
- OpenDoors(true);
- // Complete encounter
- instance->SetBossState(DATA_PYROGAURD_EMBERSEER, DONE);
- }
+ // Activate all the runes
+ UpdateRunes(GO_STATE_READY);
+ // Opens all 3 doors
+ OpenDoors(true);
+ // Complete encounter
+ instance->SetBossState(DATA_PYROGAURD_EMBERSEER, DONE);
}
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) OVERRIDE
@@ -185,24 +179,21 @@ public:
void UpdateRunes(GOState state)
{
- if (instance)
- {
- // update all runes
- if (GameObject* rune1 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_1)))
- rune1->SetGoState(state);
- if (GameObject* rune2 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_2)))
- rune2->SetGoState(state);
- if (GameObject* rune3 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_3)))
- rune3->SetGoState(state);
- if (GameObject* rune4 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_4)))
- rune4->SetGoState(state);
- if (GameObject* rune5 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_5)))
- rune5->SetGoState(state);
- if (GameObject* rune6 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_6)))
- rune6->SetGoState(state);
- if (GameObject* rune7 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_7)))
- rune7->SetGoState(state);
- }
+ // update all runes
+ if (GameObject* rune1 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_1)))
+ rune1->SetGoState(state);
+ if (GameObject* rune2 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_2)))
+ rune2->SetGoState(state);
+ if (GameObject* rune3 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_3)))
+ rune3->SetGoState(state);
+ if (GameObject* rune4 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_4)))
+ rune4->SetGoState(state);
+ if (GameObject* rune5 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_5)))
+ rune5->SetGoState(state);
+ if (GameObject* rune6 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_6)))
+ rune6->SetGoState(state);
+ if (GameObject* rune7 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_7)))
+ rune7->SetGoState(state);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -316,7 +307,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_pyroguard_emberseerAI(creature);
+ return GetInstanceAI<boss_pyroguard_emberseerAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_quartermaster_zigris.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_quartermaster_zigris.cpp
index 4dbade9e07b..27229b6ba71 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_quartermaster_zigris.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_quartermaster_zigris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp
index 275b3802764..fe38377341b 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -171,6 +171,7 @@ public:
_Reset();
gythEvent = false;
victorGUID = 0;
+ portcullisGUID = 0;
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -437,7 +438,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_rend_blackhandAI(creature);
+ return GetInstanceAI<boss_rend_blackhandAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp
index 7fcb201a5ad..dac7e8f50ba 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_the_beast.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_the_beast.cpp
index 8cb0dfbce64..0c9c66b83f3 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_the_beast.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_the_beast.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_urok_doomhowl.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_urok_doomhowl.cpp
index 76b673eed06..a525e0395d1 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_urok_doomhowl.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_urok_doomhowl.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_warmaster_voone.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_warmaster_voone.cpp
index ccd74b204ce..dc84aba0ee3 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_warmaster_voone.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_warmaster_voone.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -23,11 +23,11 @@
enum Spells
{
SPELL_SNAPKICK = 15618,
- SPELL_CLEAVE = 15579,
+ SPELL_CLEAVE = 15284,
SPELL_UPPERCUT = 10966,
SPELL_MORTALSTRIKE = 16856,
SPELL_PUMMEL = 15615,
- SPELL_THROWAXE = 16075,
+ SPELL_THROWAXE = 16075
};
enum Events
@@ -37,7 +37,7 @@ enum Events
EVENT_UPPERCUT = 3,
EVENT_MORTAL_STRIKE = 4,
EVENT_PUMMEL = 5,
- EVENT_THROW_AXE = 6,
+ EVENT_THROW_AXE = 6
};
class boss_warmaster_voone : public CreatureScript
@@ -45,11 +45,6 @@ class boss_warmaster_voone : public CreatureScript
public:
boss_warmaster_voone() : CreatureScript("boss_warmaster_voone") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new boss_warmastervooneAI(creature);
- }
-
struct boss_warmastervooneAI : public BossAI
{
boss_warmastervooneAI(Creature* creature) : BossAI(creature, DATA_WARMASTER_VOONE) { }
@@ -119,6 +114,10 @@ public:
}
};
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new boss_warmastervooneAI(creature);
+ }
};
void AddSC_boss_warmastervoone()
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 a1bbad7ee1c..d335ebccb6c 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h
index acdbf0cd483..e07d1d987fc 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 c9dc3d8f134..307f5e24619 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -116,7 +116,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_broodlordAI(creature);
+ return GetInstanceAI<boss_broodlordAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp
index 05effabe557..d292e5f7701 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -282,7 +282,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_chromaggusAI(creature);
+ return GetInstanceAI<boss_chromaggusAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp
index 0d79f3faeee..b8a3c157c52 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -92,7 +92,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_ebonrocAI(creature);
+ return GetInstanceAI<boss_ebonrocAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp
index 369e4e02f5a..706f376e882 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -94,7 +94,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_firemawAI(creature);
+ return GetInstanceAI<boss_firemawAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp
index 060bfeb60b3..e262cba1978 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -100,7 +100,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_flamegorAI(creature);
+ return GetInstanceAI<boss_flamegorAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
index 4e0c79509fc..945d8b40d32 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -170,11 +170,12 @@ public:
void Reset() OVERRIDE
{
+ SpawnedAdds = 0;
+
if (me->GetMapId() == 469)
{
if (!me->FindNearestCreature(NPC_NEFARIAN, 1000.0f, true))
_Reset();
- SpawnedAdds = 0;
me->SetVisible(true);
me->SetPhaseMask(1, true);
@@ -376,7 +377,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_victor_nefariusAI(creature);
+ return GetInstanceAI<boss_victor_nefariusAI>(creature);
}
};
@@ -423,7 +424,7 @@ public:
if (rand()%5)
return;
- Talk(SAY_SLAY, victim->GetGUID());
+ Talk(SAY_SLAY, victim);
}
void MovementInform(uint32 type, uint32 id) OVERRIDE
@@ -443,8 +444,7 @@ public:
{
if (canDespawn && DespawnTimer <= diff)
{
- if (instance)
- instance->SetBossState(BOSS_NEFARIAN, FAIL);
+ instance->SetBossState(BOSS_NEFARIAN, FAIL);
std::list<Creature*> constructList;
me->GetCreatureListWithEntryInGrid(constructList, NPC_BONE_CONSTRUCT, 500.0f);
@@ -572,7 +572,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_nefarianAI(creature);
+ return GetInstanceAI<boss_nefarianAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp
index caf2719eff9..b1bc34b0437 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -75,8 +75,7 @@ public:
_Reset();
secondPhase = false;
- if (instance)
- instance->SetData(DATA_EGG_EVENT, NOT_STARTED);
+ instance->SetData(DATA_EGG_EVENT, NOT_STARTED);
}
void JustDied(Unit* /*killer*/) OVERRIDE
@@ -84,8 +83,7 @@ public:
_JustDied();
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_EGG_EVENT, NOT_STARTED);
+ instance->SetData(DATA_EGG_EVENT, NOT_STARTED);
}
void DoChangePhase()
@@ -156,7 +154,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_razorgoreAI(creature);
+ return GetInstanceAI<boss_razorgoreAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp
index c595f3acaff..f8e00e4ed74 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -114,7 +114,7 @@ public:
if (rand()%5)
return;
- Talk(SAY_KILLTARGET, victim->GetGUID());
+ Talk(SAY_KILLTARGET, victim);
}
void UpdateAI(uint32 diff) OVERRIDE
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp
index 622c34d3358..39d2a6d87d5 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -63,6 +63,7 @@ public:
{
// Razorgore
EggCount = 0;
+ EggEvent = 0;
RazorgoreTheUntamedGUID = 0;
RazorgoreDoorGUID = 0;
EggList.clear();
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 e9ac15147f9..334f055b748 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp
index 420c9fcc290..da72f9f5b5c 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp
index 15079953a34..b1ee30b1cf2 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp
index 0fdb88923b3..57922d7f7d9 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -179,7 +179,7 @@ class npc_core_rager : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_core_ragerAI(creature);
+ return GetInstanceAI<npc_core_ragerAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp
index 31f4e40552f..fa6f5bab928 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_magmadar.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_magmadar.cpp
index 7d40b9630ae..d674ab876f0 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_magmadar.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_magmadar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
index 1001516d42e..294b662aea7 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -161,8 +161,7 @@ class boss_majordomo : public CreatureScript
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
break;
case EVENT_OUTRO_2:
- if (instance)
- instance->instance->SummonCreature(NPC_RAGNAROS, RagnarosSummonPos);
+ instance->instance->SummonCreature(NPC_RAGNAROS, RagnarosSummonPos);
break;
case EVENT_OUTRO_3:
Talk(SAY_ARRIVAL2_MAJ);
@@ -207,7 +206,7 @@ class boss_majordomo : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_majordomoAI(creature);
+ return GetInstanceAI<boss_majordomoAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp
index d03f756f366..4e135ad513a 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -147,9 +147,8 @@ class boss_ragnaros : public CreatureScript
break;
case EVENT_INTRO_4:
Talk(SAY_ARRIVAL5_RAG);
- if (instance)
- if (Creature* executus = Unit::GetCreature(*me, instance->GetData64(BOSS_MAJORDOMO_EXECUTUS)))
- me->Kill(executus);
+ if (Creature* executus = Unit::GetCreature(*me, instance->GetData64(BOSS_MAJORDOMO_EXECUTUS)))
+ me->Kill(executus);
break;
case EVENT_INTRO_5:
me->SetReactState(REACT_AGGRESSIVE);
@@ -163,29 +162,26 @@ class boss_ragnaros : public CreatureScript
}
else
{
- if (instance)
+ if (_isBanished && ((_emergeTimer <= diff) || (instance->GetData(DATA_RAGNAROS_ADDS)) > 8))
{
- if (_isBanished && ((_emergeTimer <= diff) || (instance->GetData(DATA_RAGNAROS_ADDS)) > 8))
- {
- //Become unbanished again
- me->SetReactState(REACT_AGGRESSIVE);
- me->setFaction(14);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
- me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- AttackStart(target);
- instance->SetData(DATA_RAGNAROS_ADDS, 0);
-
- //DoCast(me, SPELL_RAGEMERGE); //"phase spells" didnt worked correctly so Ive commented them and wrote solution witch doesnt need core support
- _isBanished = false;
- }
- else if (_isBanished)
- {
- _emergeTimer -= diff;
- //Do nothing while banished
- return;
- }
+ //Become unbanished again
+ me->SetReactState(REACT_AGGRESSIVE);
+ me->setFaction(14);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ AttackStart(target);
+ instance->SetData(DATA_RAGNAROS_ADDS, 0);
+
+ //DoCast(me, SPELL_RAGEMERGE); //"phase spells" didnt worked correctly so Ive commented them and wrote solution witch doesnt need core support
+ _isBanished = false;
+ }
+ else if (_isBanished)
+ {
+ _emergeTimer -= diff;
+ //Do nothing while banished
+ return;
}
//Return since we have no target
@@ -306,7 +302,7 @@ class boss_ragnaros : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_ragnarosAI(creature);
+ return GetInstanceAI<boss_ragnarosAI>(creature);
}
};
@@ -324,8 +320,7 @@ class npc_son_of_flame : public CreatureScript
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_RAGNAROS_ADDS, 1);
+ instance->SetData(DATA_RAGNAROS_ADDS, 1);
}
void UpdateAI(uint32 /*diff*/) OVERRIDE
@@ -342,7 +337,7 @@ class npc_son_of_flame : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_son_of_flameAI(creature);
+ return GetInstanceAI<npc_son_of_flameAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_shazzrah.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_shazzrah.cpp
index 7c1d1af7d29..4ca66a1c856 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_shazzrah.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_shazzrah.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
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 681f4f72bc6..ddb079b7b3d 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
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 73ea15be261..587ea51fc76 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h
index 407e3ee5204..39d6cf40a8a 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt
index 8622949b3fe..4adb087921b 100644
--- a/src/server/scripts/EasternKingdoms/CMakeLists.txt
+++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
index 8a7836b310e..af8d1253dd8 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -45,7 +45,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_mr_smiteAI(creature);
+ return GetInstanceAI<boss_mr_smiteAI>(creature);
}
struct boss_mr_smiteAI : public ScriptedAI
@@ -127,12 +127,11 @@ public:
++uiHealth;
DoCastAOE(SPELL_SMITE_STOMP, false);
SetCombatMovement(false);
- if (instance)
- if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_SMITE_CHEST)))
- {
- me->GetMotionMaster()->Clear();
- me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 3.0f, go->GetPositionY(), go->GetPositionZ());
- }
+ if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_SMITE_CHEST)))
+ {
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 3.0f, go->GetPositionY(), go->GetPositionZ());
+ }
}
if (uiPhase)
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
index 38d10107094..f48314ea220 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
index ee3b710df4e..c3b09c76c68 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
+++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
index f029e8505d4..a2369f290f1 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@ class instance_deadmines : public InstanceMapScript
CannonBlast_Timer = DATA_CANNON_BLAST_TIMER;
// it's a hack - Mr. Smite should do that but his too far away
pIronCladDoor->SetName("Mr. Smite");
- pIronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM1, LANG_UNIVERSAL, 0);
+ pIronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM1, LANG_UNIVERSAL, NULL);
DoPlaySound(pIronCladDoor, SOUND_MR_SMITE_ALARM1);
State = CANNON_BLAST_INITIATED;
break;
@@ -113,7 +113,7 @@ class instance_deadmines : public InstanceMapScript
ShootCannon();
BlastOutDoor();
LeverStucked();
- pIronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM2, LANG_UNIVERSAL, 0);
+ pIronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM2, LANG_UNIVERSAL, NULL);
DoPlaySound(pIronCladDoor, SOUND_MR_SMITE_ALARM2);
State = PIRATES_ATTACK;
} else CannonBlast_Timer -= diff;
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
index 46683442a60..d26458be82e 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -90,7 +90,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_blastmaster_emi_shortfuseAI(creature);
+ return GetInstanceAI<npc_blastmaster_emi_shortfuseAI>(creature);
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
@@ -186,20 +186,15 @@ public:
if (bBool)
{
- if (instance)
- if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
- instance->HandleGameObject(0, false, go);
+ if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
+ instance->HandleGameObject(0, false, go);
}else
- if (instance)
- if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT)))
- instance->HandleGameObject(0, false, go);
+ if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT)))
+ instance->HandleGameObject(0, false, go);
}
void SetInFace(bool bBool)
{
- if (!instance)
- return;
-
if (bBool)
{
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
@@ -211,9 +206,6 @@ public:
void RestoreAll()
{
- if (!instance)
- return;
-
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
instance->HandleGameObject(0, false, go);
@@ -318,9 +310,6 @@ public:
NextStep(2000, true);
break;
case 2:
- if (!instance)
- return;
-
switch (uiValue)
{
case 1:
@@ -441,9 +430,8 @@ public:
SetInFace(true);
Talk(SAY_BLASTMASTER_5);
Summon(1);
- if (instance)
- if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
- instance->HandleGameObject(0, true, go);
+ if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
+ instance->HandleGameObject(0, true, go);
NextStep(3000, true);
break;
case 7:
@@ -488,9 +476,8 @@ public:
case 16:
Talk(SAY_BLASTMASTER_14);
SetInFace(false);
- if (instance)
- if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT)))
- instance->HandleGameObject(0, true, go);
+ if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT)))
+ instance->HandleGameObject(0, true, go);
NextStep(2000, true);
break;
case 17:
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h
index c0d4f1d57cf..096b8910d5a 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp
index bd24c87539e..9dde2d91d1a 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
index 04b9ebffbf7..a16cec93da7 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp
index a04953cb3f5..5ac7cedd6af 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
index 071a5e83d2f..14cc3083d59 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -82,6 +82,7 @@ public:
void Reset() OVERRIDE
{
ResetTimer = 0;
+ Midnight = 0;
}
void EnterEvadeMode() OVERRIDE
@@ -149,7 +150,7 @@ public:
if (Phase == 2)
{
if (Unit* unit = Unit::GetUnit(*me, Attumen))
- Talk(SAY_MIDNIGHT_KILL, unit->GetGUID());
+ Talk(SAY_MIDNIGHT_KILL, unit);
}
}
@@ -166,7 +167,7 @@ public:
Attumen = attumen->GetGUID();
attumen->AI()->AttackStart(me->GetVictim());
SetMidnight(attumen, me->GetGUID());
- Talk(SAY_APPEAR, Attumen);
+ Talk(SAY_APPEAR, attumen);
}
}
else if (Phase == 2 && HealthBelowPct(25))
@@ -204,7 +205,7 @@ public:
void Mount(Unit* pAttumen)
{
- Talk(SAY_MOUNT, pAttumen->GetGUID());
+ Talk(SAY_MOUNT, pAttumen);
Phase = 3;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
index fc37c42be85..36bb2e32cb6 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -98,7 +98,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_moroesAI(creature);
+ return GetInstanceAI<boss_moroesAI>(creature);
}
struct boss_moroesAI : public ScriptedAI
@@ -138,14 +138,12 @@ public:
if (me->IsAlive())
SpawnAdds();
- if (instance)
- instance->SetData(TYPE_MOROES, NOT_STARTED);
+ instance->SetData(TYPE_MOROES, NOT_STARTED);
}
void StartEvent()
{
- if (instance)
- instance->SetData(TYPE_MOROES, IN_PROGRESS);
+ instance->SetData(TYPE_MOROES, IN_PROGRESS);
DoZoneInCombat();
}
@@ -168,14 +166,12 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(TYPE_MOROES, DONE);
+ instance->SetData(TYPE_MOROES, DONE);
DeSpawnAdds();
//remove aura from spell Garrote when Moroes dies
- if (instance)
- instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_GARROTE);
+ instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_GARROTE);
}
void SpawnAdds()
@@ -349,15 +345,11 @@ struct boss_moroes_guestAI : public ScriptedAI
void Reset() OVERRIDE
{
- if (instance)
- instance->SetData(TYPE_MOROES, NOT_STARTED);
+ instance->SetData(TYPE_MOROES, NOT_STARTED);
}
void AcquireGUID()
{
- if (!instance)
- return;
-
if (Creature* Moroes = Unit::GetCreature(*me, instance->GetData64(DATA_MOROES)))
for (uint8 i = 0; i < 4; ++i)
if (uint64 GUID = CAST_AI(boss_moroes::boss_moroesAI, Moroes->AI())->AddGUID[i])
@@ -393,7 +385,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_baroness_dorothea_millstipeAI(creature);
+ return GetInstanceAI<boss_baroness_dorothea_millstipeAI>(creature);
}
struct boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI
@@ -456,7 +448,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_baron_rafe_dreugerAI(creature);
+ return GetInstanceAI<boss_baron_rafe_dreugerAI>(creature);
}
struct boss_baron_rafe_dreugerAI : public boss_moroes_guestAI
@@ -513,7 +505,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_lady_catriona_von_indiAI(creature);
+ return GetInstanceAI<boss_lady_catriona_von_indiAI>(creature);
}
struct boss_lady_catriona_von_indiAI : public boss_moroes_guestAI
@@ -583,7 +575,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_lady_keira_berrybuckAI(creature);
+ return GetInstanceAI<boss_lady_keira_berrybuckAI>(creature);
}
struct boss_lady_keira_berrybuckAI : public boss_moroes_guestAI
@@ -657,7 +649,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_lord_robin_darisAI(creature);
+ return GetInstanceAI<boss_lord_robin_darisAI>(creature);
}
struct boss_lord_robin_darisAI : public boss_moroes_guestAI
@@ -713,7 +705,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_lord_crispin_ferenceAI(creature);
+ return GetInstanceAI<boss_lord_crispin_ferenceAI>(creature);
}
struct boss_lord_crispin_ferenceAI : public boss_moroes_guestAI
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp
index f80ff5b6028..1b9ef055b8c 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_netherspiteAI(creature);
+ return GetInstanceAI<boss_netherspiteAI>(creature);
}
struct boss_netherspiteAI : public ScriptedAI
@@ -172,7 +172,7 @@ public:
for (int j=0; j<3; ++j) // j = color
if (Creature* portal = Unit::GetCreature(*me, PortalGUID[j]))
{
- // the one who's been casted upon before
+ // the one who's been cast upon before
Unit* current = Unit::GetUnit(*portal, BeamTarget[j]);
// temporary store for the best suitable beam reciever
Unit* target = me;
@@ -308,7 +308,7 @@ public:
if (PhaseTimer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
SwitchToBanishPhase();
return;
@@ -327,7 +327,7 @@ public:
if (PhaseTimer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
SwitchToPortalPhase();
return;
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
index 984ef902f05..fe0bd23c755 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_nightbaneAI(creature);
+ return GetInstanceAI<boss_nightbaneAI>(creature);
}
struct boss_nightbaneAI : public ScriptedAI
@@ -131,13 +131,10 @@ public:
me->SetWalk(false);
me->setActive(true);
- if (instance)
- {
- if (instance->GetData(TYPE_NIGHTBANE) == DONE || instance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS)
- me->DisappearAndDie();
- else
- instance->SetData(TYPE_NIGHTBANE, NOT_STARTED);
- }
+ if (instance->GetData(TYPE_NIGHTBANE) == DONE || instance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS)
+ me->DisappearAndDie();
+ else
+ instance->SetData(TYPE_NIGHTBANE, NOT_STARTED);
HandleTerraceDoors(true);
@@ -153,17 +150,13 @@ public:
void HandleTerraceDoors(bool open)
{
- if (instance)
- {
- instance->HandleGameObject(instance->GetData64(DATA_MASTERS_TERRACE_DOOR_1), open);
- instance->HandleGameObject(instance->GetData64(DATA_MASTERS_TERRACE_DOOR_2), open);
- }
+ instance->HandleGameObject(instance->GetData64(DATA_MASTERS_TERRACE_DOOR_1), open);
+ instance->HandleGameObject(instance->GetData64(DATA_MASTERS_TERRACE_DOOR_2), open);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetData(TYPE_NIGHTBANE, IN_PROGRESS);
+ instance->SetData(TYPE_NIGHTBANE, IN_PROGRESS);
HandleTerraceDoors(false);
Talk(YELL_AGGRO);
@@ -177,8 +170,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(TYPE_NIGHTBANE, DONE);
+ instance->SetData(TYPE_NIGHTBANE, DONE);
HandleTerraceDoors(true);
}
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
index 7c6cdd4cb3e..bde326a5c37 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -179,7 +179,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_malchezaarAI(creature);
+ return GetInstanceAI<boss_malchezaarAI>(creature);
}
struct boss_malchezaarAI : public ScriptedAI
@@ -239,8 +239,7 @@ public:
SunderArmorTimer = urand(5000, 10000);
phase = 1;
- if (instance)
- instance->HandleGameObject(instance->GetData64(DATA_GO_NETHER_DOOR), true);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_NETHER_DOOR), true);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -260,16 +259,14 @@ public:
for (uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
positions.push_back(&InfernalPoints[i]);
- if (instance)
- instance->HandleGameObject(instance->GetData64(DATA_GO_NETHER_DOOR), true);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_NETHER_DOOR), true);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->HandleGameObject(instance->GetData64(DATA_GO_NETHER_DOOR), false); // Open the door leading further in
+ instance->HandleGameObject(instance->GetData64(DATA_GO_NETHER_DOOR), false); // Open the door leading further in
}
void InfernalCleanup()
@@ -300,12 +297,7 @@ public:
void ClearWeapons()
{
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
-
- //damage
- const CreatureTemplate* cinfo = me->GetCreatureTemplate();
- me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg);
- me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg);
- me->UpdateDamagePhysical(BASE_ATTACK);
+ me->SetCanDualWield(false);
}
void EnfeebleHealthEffect()
@@ -422,19 +414,8 @@ public:
//models
SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE);
- //damage
- const CreatureTemplate* cinfo = me->GetCreatureTemplate();
- me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg);
- me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg);
- me->UpdateDamagePhysical(BASE_ATTACK);
-
- me->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg);
- me->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg);
- //Sigh, updating only works on main attack, do it manually ....
- me->SetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, cinfo->mindmg);
- me->SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, cinfo->maxdmg);
-
me->SetAttackTime(OFF_ATTACK, (me->GetAttackTime(BASE_ATTACK)*150)/100);
+ me->SetCanDualWield(true);
}
}
else if (phase == 2)
@@ -569,7 +550,7 @@ public:
void DoMeleeAttacksIfReady()
{
- if (me->IsWithinMeleeRange(me->GetVictim()) && !me->IsNonMeleeSpellCasted(false))
+ if (me->IsWithinMeleeRange(me->GetVictim()) && !me->IsNonMeleeSpellCast(false))
{
//Check for base attack
if (me->isAttackReady() && me->GetVictim())
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 2d3fabb810b..69f852f158c 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -86,7 +86,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_aranAI(creature);
+ return GetInstanceAI<boss_aranAI>(creature);
}
struct boss_aranAI : public ScriptedAI
@@ -147,12 +147,9 @@ public:
Drinking = false;
DrinkInturrupted = false;
- if (instance)
- {
- // Not in progress
- instance->SetData(TYPE_ARAN, NOT_STARTED);
- instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), true);
- }
+ // Not in progress
+ instance->SetData(TYPE_ARAN, NOT_STARTED);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), true);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -164,22 +161,16 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- {
- instance->SetData(TYPE_ARAN, DONE);
- instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), true);
- }
+ instance->SetData(TYPE_ARAN, DONE);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), true);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- {
- instance->SetData(TYPE_ARAN, IN_PROGRESS);
- instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), false);
- }
+ instance->SetData(TYPE_ARAN, IN_PROGRESS);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), false);
}
void FlameWreathEffect()
@@ -226,11 +217,8 @@ public:
{
if (CloseDoorTimer <= diff)
{
- if (instance)
- {
- instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), false);
- CloseDoorTimer = 0;
- }
+ instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), false);
+ CloseDoorTimer = 0;
} else CloseDoorTimer -= diff;
}
@@ -305,7 +293,7 @@ public:
//Normal casts
if (NormalCastTimer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (!target)
@@ -486,10 +474,10 @@ public:
void SpellHit(Unit* /*pAttacker*/, const SpellInfo* Spell) OVERRIDE
{
- //We only care about interrupt effects and only if they are durring a spell currently being casted
+ //We only care about interrupt effects and only if they are durring a spell currently being cast
if ((Spell->Effects[0].Effect != SPELL_EFFECT_INTERRUPT_CAST &&
Spell->Effects[1].Effect != SPELL_EFFECT_INTERRUPT_CAST &&
- Spell->Effects[2].Effect != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCasted(false))
+ Spell->Effects[2].Effect != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCast(false))
return;
//Interrupt effect
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
index 9e7897cd56a..22398314a41 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -72,7 +72,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_kilrekAI(creature);
+ return GetInstanceAI<npc_kilrekAI>(creature);
}
struct npc_kilrekAI : public ScriptedAI
@@ -96,25 +96,17 @@ public:
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (!instance)
- {
- ERROR_INST_DATA(me);
- return;
- }
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
+ uint64 TerestianGUID = instance->GetData64(DATA_TERESTIAN);
+ if (TerestianGUID)
{
- uint64 TerestianGUID = instance->GetData64(DATA_TERESTIAN);
- if (TerestianGUID)
- {
- Unit* Terestian = Unit::GetUnit(*me, TerestianGUID);
- if (Terestian && Terestian->IsAlive())
- DoCast(Terestian, SPELL_BROKEN_PACT, true);
- }
- } else ERROR_INST_DATA(me);
+ Unit* Terestian = Unit::GetUnit(*me, TerestianGUID);
+ if (Terestian && Terestian->IsAlive())
+ DoCast(Terestian, SPELL_BROKEN_PACT, true);
+ }
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -257,7 +249,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_terestianAI(creature);
+ return GetInstanceAI<boss_terestianAI>(creature);
}
struct boss_terestianAI : public ScriptedAI
@@ -307,8 +299,7 @@ public:
SummonedPortals = false;
Berserk = false;
- if (instance)
- instance->SetData(TYPE_TERESTIAN, NOT_STARTED);
+ instance->SetData(TYPE_TERESTIAN, NOT_STARTED);
me->RemoveAurasDueToSpell(SPELL_BROKEN_PACT);
@@ -363,8 +354,7 @@ public:
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(TYPE_TERESTIAN, DONE);
+ instance->SetData(TYPE_TERESTIAN, DONE);
}
void UpdateAI(uint32 diff) OVERRIDE
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
index 504b3bc6e97..108aceebb90 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -118,7 +118,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_dorotheeAI(creature);
+ return GetInstanceAI<boss_dorotheeAI>(creature);
}
struct boss_dorotheeAI : public ScriptedAI
@@ -167,8 +167,7 @@ public:
{
Talk(SAY_DOROTHEE_DEATH);
- if (instance)
- SummonCroneIfReady(instance, me);
+ SummonCroneIfReady(instance, me);
}
void AttackStart(Unit* who) OVERRIDE
@@ -259,7 +258,7 @@ public:
if (Dorothee && Dorothee->IsAlive())
{
CAST_AI(boss_dorothee::boss_dorotheeAI, Dorothee->AI())->TitoDied = true;
- Talk(SAY_DOROTHEE_TITO_DEATH, Dorothee->GetGUID());
+ Talk(SAY_DOROTHEE_TITO_DEATH, Dorothee);
}
}
}
@@ -299,7 +298,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_strawmanAI(creature);
+ return GetInstanceAI<boss_strawmanAI>(creature);
}
struct boss_strawmanAI : public ScriptedAI
@@ -366,8 +365,7 @@ public:
{
Talk(SAY_STRAWMAN_DEATH);
- if (instance)
- SummonCroneIfReady(instance, me);
+ SummonCroneIfReady(instance, me);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -414,7 +412,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_tinheadAI(creature);
+ return GetInstanceAI<boss_tinheadAI>(creature);
}
struct boss_tinheadAI : public ScriptedAI
@@ -472,8 +470,7 @@ public:
{
Talk(SAY_TINHEAD_DEATH);
- if (instance)
- SummonCroneIfReady(instance, me);
+ SummonCroneIfReady(instance, me);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -524,7 +521,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_roarAI(creature);
+ return GetInstanceAI<boss_roarAI>(creature);
}
struct boss_roarAI : public ScriptedAI
@@ -580,8 +577,7 @@ public:
{
Talk(SAY_ROAR_DEATH);
- if (instance)
- SummonCroneIfReady(instance, me);
+ SummonCroneIfReady(instance, me);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -633,7 +629,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_croneAI(creature);
+ return GetInstanceAI<boss_croneAI>(creature);
}
struct boss_croneAI : public ScriptedAI
@@ -675,15 +671,12 @@ public:
{
Talk(SAY_CRONE_DEATH);
- if (instance)
- {
- instance->SetData(TYPE_OPERA, DONE);
- instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
- instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
+ instance->SetData(TYPE_OPERA, DONE);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
- if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
- pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
- }
+ if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
+ pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -813,7 +806,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_bigbadwolfAI(creature);
+ return GetInstanceAI<boss_bigbadwolfAI>(creature);
}
struct boss_bigbadwolfAI : public ScriptedAI
@@ -865,15 +858,12 @@ public:
{
DoPlaySoundToSet(me, SOUND_WOLF_DEATH);
- if (instance)
- {
- instance->SetData(TYPE_OPERA, DONE);
- instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
- instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
+ instance->SetData(TYPE_OPERA, DONE);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
- if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
- pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
- }
+ if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
+ pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -1015,7 +1005,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_julianneAI(creature);
+ return GetInstanceAI<boss_julianneAI>(creature);
}
struct boss_julianneAI : public ScriptedAI
@@ -1112,14 +1102,11 @@ public:
{
Talk(SAY_JULIANNE_DEATH02);
- if (instance)
- {
- instance->SetData(TYPE_OPERA, DONE);
- instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
- instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
- if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
- pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
- }
+ instance->SetData(TYPE_OPERA, DONE);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
+ if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
+ pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -1138,7 +1125,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_romuloAI(creature);
+ return GetInstanceAI<boss_romuloAI>(creature);
}
struct boss_romuloAI : public ScriptedAI
@@ -1267,15 +1254,12 @@ public:
{
Talk(SAY_ROMULO_DEATH);
- if (instance)
- {
- instance->SetData(TYPE_OPERA, DONE);
- instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
- instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
+ instance->SetData(TYPE_OPERA, DONE);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
- if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
- pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
- }
+ if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
+ pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp
index bf213e68f10..2e4f1eaca10 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
index 91127f2db0d..f667394f29c 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -158,15 +158,11 @@ public:
PerformanceReady = false;
- if (instance)
- m_uiEventId = instance->GetData(DATA_OPERA_PERFORMANCE);
+ m_uiEventId = instance->GetData(DATA_OPERA_PERFORMANCE);
}
void StartEvent()
{
- if (!instance)
- return;
-
instance->SetData(TYPE_OPERA, IN_PROGRESS);
//resets count for this event, in case earlier failed
@@ -180,9 +176,6 @@ public:
void WaypointReached(uint32 waypointId) OVERRIDE
{
- if (!instance)
- return;
-
switch (waypointId)
{
case 0:
@@ -412,7 +405,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_barnesAI(creature);
+ return GetInstanceAI<npc_barnesAI>(creature);
}
};
@@ -476,7 +469,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_image_of_medivhAI(creature);
+ return GetInstanceAI<npc_image_of_medivhAI>(creature);
}
struct npc_image_of_medivhAI : public ScriptedAI
@@ -500,6 +493,8 @@ public:
void Reset() OVERRIDE
{
ArcanagosGUID = 0;
+ EventStarted = false;
+ YellTimer = 0;
if (instance && instance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0)
{
@@ -535,7 +530,7 @@ public:
return;
ArcanagosGUID = Arcanagos->GetGUID();
Arcanagos->SetDisableGravity(true);
- (*Arcanagos).GetMotionMaster()->MovePoint(0, ArcanagosPos[0], ArcanagosPos[1], ArcanagosPos[2]);
+ Arcanagos->GetMotionMaster()->MovePoint(0, ArcanagosPos[0], ArcanagosPos[1], ArcanagosPos[2]);
Arcanagos->SetOrientation(ArcanagosPos[3]);
me->SetOrientation(MedivPos[3]);
YellTimer = 10000;
@@ -549,25 +544,25 @@ public:
{
case 0: return 9999999;
case 1:
- me->MonsterYell(SAY_DIALOG_MEDIVH_1, LANG_UNIVERSAL, 0);
+ me->MonsterYell(SAY_DIALOG_MEDIVH_1, LANG_UNIVERSAL, NULL);
return 10000;
case 2:
if (arca)
- arca->MonsterYell(SAY_DIALOG_ARCANAGOS_2, LANG_UNIVERSAL, 0);
+ arca->MonsterYell(SAY_DIALOG_ARCANAGOS_2, LANG_UNIVERSAL, NULL);
return 20000;
case 3:
- me->MonsterYell(SAY_DIALOG_MEDIVH_3, LANG_UNIVERSAL, 0);
+ me->MonsterYell(SAY_DIALOG_MEDIVH_3, LANG_UNIVERSAL, NULL);
return 10000;
case 4:
if (arca)
- arca->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, 0);
+ arca->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, NULL);
return 20000;
case 5:
- me->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, 0);
+ me->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, NULL);
return 20000;
case 6:
if (arca)
- arca->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, 0);
+ arca->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, NULL);
return 10000;
case 7:
FireArcanagosTimer = 500;
@@ -577,7 +572,7 @@ public:
DoCast(me, SPELL_MANA_SHIELD);
return 10000;
case 9:
- me->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false);
+ me->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, NULL, false);
return 10000;
case 10:
if (arca)
@@ -585,7 +580,7 @@ public:
return 1000;
case 11:
if (arca)
- arca->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, 0);
+ arca->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, NULL);
return 5000;
case 12:
arca->GetMotionMaster()->MovePoint(0, -11010.82f, -1761.18f, 156.47f);
@@ -594,7 +589,7 @@ public:
arca->SetSpeed(MOVE_FLIGHT, 2.0f);
return 10000;
case 13:
- me->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, 0);
+ me->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL);
return 10000;
case 14:
me->SetVisible(false);
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h
index f47d2aa46fb..3812e06b442 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h
+++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
index 074ad3f1b96..6c15fdc77fa 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -96,7 +96,7 @@ public:
CreatureAI* GetAI(Creature* c) const OVERRIDE
{
- return new boss_felblood_kaelthasAI(c);
+ return GetInstanceAI<boss_felblood_kaelthasAI>(c);
}
struct boss_felblood_kaelthasAI : public ScriptedAI
@@ -150,17 +150,13 @@ public:
Phase = 0;
- if (instance)
- instance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED);
+ instance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
Talk(SAY_DEATH);
- if (!instance)
- return;
-
instance->SetData(DATA_KAELTHAS_EVENT, DONE);
// Enable the Translocation Orb Exit
@@ -176,9 +172,6 @@ public:
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (!instance)
- return;
-
instance->SetData(DATA_KAELTHAS_EVENT, IN_PROGRESS);
}
@@ -371,8 +364,7 @@ public:
Talk(SAY_GRAVITY_LAPSE);
FirstGravityLapse = false;
- if (instance)
- instance->SetData(DATA_KAELTHAS_STATUES, 1);
+ instance->SetData(DATA_KAELTHAS_STATUES, 1);
}
else
Talk(SAY_RECAST_GRAVITY);
@@ -482,7 +474,7 @@ public:
CreatureAI* GetAI(Creature* c) const OVERRIDE
{
- return new npc_felkael_phoenixAI(c);
+ return GetInstanceAI<npc_felkael_phoenixAI>(c);
}
struct npc_felkael_phoenixAI : public ScriptedAI
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
index c8ab4a147ff..8592120f94a 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -110,7 +110,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_priestess_delrissaAI(creature);
+ return GetInstanceAI<boss_priestess_delrissaAI>(creature);
}
struct boss_priestess_delrissaAI : public ScriptedAI
@@ -153,8 +153,7 @@ public:
//this mean she at some point evaded
void JustReachedHome() OVERRIDE
{
- if (instance)
- instance->SetData(DATA_DELRISSA_EVENT, FAIL);
+ instance->SetData(DATA_DELRISSA_EVENT, FAIL);
}
void EnterCombat(Unit* who) OVERRIDE
@@ -173,8 +172,7 @@ public:
}
}
- if (instance)
- instance->SetData(DATA_DELRISSA_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_DELRISSA_EVENT, IN_PROGRESS);
}
void InitializeLackeys()
@@ -241,9 +239,6 @@ public:
{
Talk(SAY_DEATH);
- if (!instance)
- return;
-
if (instance->GetData(DATA_DELRISSA_DEATH_COUNT) == MAX_ACTIVE_LACKEY)
instance->SetData(DATA_DELRISSA_EVENT, DONE);
else
@@ -393,36 +388,30 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
if (!who)
return;
- if (instance)
+ for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
{
- for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
+ if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUIDs[i]))
{
- if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUIDs[i]))
+ if (!pAdd->GetVictim() && pAdd != me)
{
- if (!pAdd->GetVictim() && pAdd != me)
- {
- who->SetInCombatWith(pAdd);
- pAdd->AddThreat(who, 0.0f);
- }
+ who->SetInCombatWith(pAdd);
+ pAdd->AddThreat(who, 0.0f);
}
}
+ }
- if (Creature* pDelrissa = Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA)))
+ if (Creature* pDelrissa = Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA)))
+ {
+ if (pDelrissa->IsAlive() && !pDelrissa->GetVictim())
{
- if (pDelrissa->IsAlive() && !pDelrissa->GetVictim())
- {
- who->SetInCombatWith(pDelrissa);
- pDelrissa->AddThreat(who, 0.0f);
- }
+ who->SetInCombatWith(pDelrissa);
+ pDelrissa->AddThreat(who, 0.0f);
}
}
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (!instance)
- return;
-
Creature* pDelrissa = Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA));
uint32 uiLackeyDeathCount = instance->GetData(DATA_DELRISSA_DEATH_COUNT);
@@ -452,18 +441,12 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
void KilledUnit(Unit* victim) OVERRIDE
{
- if (!instance)
- return;
-
if (Creature* Delrissa = Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA)))
Delrissa->AI()->KilledUnit(victim);
}
void AcquireGUIDs()
{
- if (!instance)
- return;
-
if (Creature* Delrissa = (Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA))))
{
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
@@ -504,7 +487,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_kagani_nightstrikeAI(creature);
+ return GetInstanceAI<boss_kagani_nightstrikeAI>(creature);
}
struct boss_kagani_nightstrikeAI : public boss_priestess_lackey_commonAI
@@ -608,7 +591,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_ellris_duskhallowAI(creature);
+ return GetInstanceAI<boss_ellris_duskhallowAI>(creature);
}
struct boss_ellris_duskhallowAI : public boss_priestess_lackey_commonAI
@@ -699,7 +682,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_eramas_brightblazeAI(creature);
+ return GetInstanceAI<boss_eramas_brightblazeAI>(creature);
}
struct boss_eramas_brightblazeAI : public boss_priestess_lackey_commonAI
@@ -760,7 +743,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_yazzaiAI(creature);
+ return GetInstanceAI<boss_yazzaiAI>(creature);
}
struct boss_yazzaiAI : public boss_priestess_lackey_commonAI
@@ -890,7 +873,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_warlord_salarisAI(creature);
+ return GetInstanceAI<boss_warlord_salarisAI>(creature);
}
struct boss_warlord_salarisAI : public boss_priestess_lackey_commonAI
@@ -1010,7 +993,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_garaxxasAI(creature);
+ return GetInstanceAI<boss_garaxxasAI>(creature);
}
struct boss_garaxxasAI : public boss_priestess_lackey_commonAI
@@ -1068,7 +1051,7 @@ public:
if (Freezing_Trap_Timer <= diff)
{
- //attempt find go summoned from spell (casted by me)
+ //attempt find go summoned from spell (cast by me)
GameObject* go = me->GetGameObject(SPELL_FREEZING_TRAP);
//if we have a go, we need to wait (only one trap at a time)
@@ -1121,7 +1104,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_apokoAI(creature);
+ return GetInstanceAI<boss_apokoAI>(creature);
}
struct boss_apokoAI : public boss_priestess_lackey_commonAI
@@ -1219,7 +1202,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_zelfanAI(creature);
+ return GetInstanceAI<boss_zelfanAI>(creature);
}
struct boss_zelfanAI : public boss_priestess_lackey_commonAI
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp
index 849713d72bf..758ecb996f4 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_selin_fireheartAI(creature);
+ return GetInstanceAI<boss_selin_fireheartAI>(creature);
};
struct boss_selin_fireheartAI : public ScriptedAI
@@ -77,16 +77,13 @@ public:
Crystals.clear();
//GUIDs per instance is static, so we only need to load them once.
- if (instance)
+ uint32 size = instance->GetData(DATA_FEL_CRYSTAL_SIZE);
+ for (uint8 i = 0; i < size; ++i)
{
- uint32 size = instance->GetData(DATA_FEL_CRYSTAL_SIZE);
- for (uint8 i = 0; i < size; ++i)
- {
- instance->SetData64(DATA_FEL_CRYSTAL, i);
- uint64 guid = instance->GetData64(DATA_FEL_CRYSTAL);
- TC_LOG_DEBUG("scripts", "Selin: Adding Fel Crystal " UI64FMTD " to list", guid);
- Crystals.push_back(guid);
- }
+ instance->SetData64(DATA_FEL_CRYSTAL, i);
+ uint64 guid = instance->GetData64(DATA_FEL_CRYSTAL);
+ TC_LOG_DEBUG("scripts", "Selin: Adding Fel Crystal " UI64FMTD " to list", guid);
+ Crystals.push_back(guid);
}
}
@@ -107,25 +104,22 @@ public:
void Reset() OVERRIDE
{
- if (instance)
+ //for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
+ for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
{
- //for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
- for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
+ //Unit* unit = Unit::GetUnit(*me, FelCrystals[i]);
+ if (Creature* creature = Unit::GetCreature(*me, *itr))
{
- //Unit* unit = Unit::GetUnit(*me, FelCrystals[i]);
- if (Creature* creature = Unit::GetCreature(*me, *itr))
- {
- if (!creature->IsAlive())
- creature->Respawn(); // Let the core handle setting death state, etc.
+ if (!creature->IsAlive())
+ creature->Respawn(); // Let the core handle setting death state, etc.
- // Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here.
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
+ // Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here.
+ creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
+ }
- // Set Inst data for encounter
- instance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
- } else TC_LOG_ERROR("scripts", ERROR_INST_DATA);
+ // Set Inst data for encounter
+ instance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
DrainLifeTimer = urand(3000, 7000);
DrainManaTimer = DrainLifeTimer + 5000;
@@ -200,8 +194,7 @@ public:
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_SELIN_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_SELIN_EVENT, IN_PROGRESS);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -235,9 +228,6 @@ public:
{
Talk(SAY_DEATH);
- if (!instance)
- return;
-
instance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete!
ShatterRemainingCrystals();
}
@@ -271,7 +261,7 @@ public:
if (FelExplosionTimer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
DoCast(me, SPELL_FEL_EXPLOSION);
FelExplosionTimer = 2000;
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
index 24b48112bb6..95bfcb93878 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -76,7 +76,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_vexallusAI(creature);
+ return GetInstanceAI<boss_vexallusAI>(creature);
};
struct boss_vexallusAI : public BossAI
@@ -103,8 +103,7 @@ public:
IntervalHealthAmount = 1;
Enraged = false;
- if (instance)
- instance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
+ instance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -115,16 +114,14 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
summons.DespawnAll();
- if (instance)
- instance->SetData(DATA_VEXALLUS_EVENT, DONE);
+ instance->SetData(DATA_VEXALLUS_EVENT, DONE);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
}
void JustSummoned(Creature* summoned) OVERRIDE
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp
index 41261549e38..5183efea521 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
index c9e530bce56..ed5d9d4ec6f 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h
index e010eb91522..ddfaa91bc98 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
index 4dc62cc431d..a3d4d6669a3 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -144,7 +144,7 @@ public:
me->CastSpell(me, SPELL_DK_INITIATE_VISUAL, true);
if (Player* starter = ObjectAccessor::GetPlayer(*me, playerGUID))
- sCreatureTextMgr->SendChat(me, SAY_EVENT_ATTACK, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, starter);
+ sCreatureTextMgr->SendChat(me, SAY_EVENT_ATTACK, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, starter);
phase = PHASE_TO_ATTACK;
}
@@ -371,7 +371,7 @@ public:
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15);
- sCreatureTextMgr->SendChat(creature, SAY_DUEL, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player);
+ sCreatureTextMgr->SendChat(creature, SAY_DUEL, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player);
player->CastSpell(creature, SPELL_DUEL, false);
player->CastSpell(player, SPELL_DUEL_FLAG, true);
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
index 20a7ccedb17..153e995e590 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -83,7 +83,7 @@ public:
me->SetReactState(REACT_PASSIVE);
DoCastAOE(SPELL_THREAT_PULSE, true);
- sCreatureTextMgr->SendChat(me, SAY_PERSUADE_RAND, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player);
+ sCreatureTextMgr->SendChat(me, SAY_PERSUADE_RAND, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player);
Talk(SAY_CRUSADER);
}
}
@@ -126,7 +126,7 @@ public:
break;
case 5:
- sCreatureTextMgr->SendChat(me, SAY_PERSUADED5, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player);
+ sCreatureTextMgr->SendChat(me, SAY_PERSUADED5, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player);
speechTimer = 8000;
break;
@@ -698,25 +698,25 @@ public:
case RACE_HUMAN:
switch (ExecuteSpeech_Counter)
{
- case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break;
+ case 0: Talk(SAY_EXEC_START_1, player); break;
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
- case 2: Talk(SAY_EXEC_PROG_5, player->GetGUID()); break;
- case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break;
- case 4: Talk(SAY_EXEC_RECOG_1, player->GetGUID()); break;
- case 5: Talk(SAY_EXEC_NOREM_5, player->GetGUID()); break;
- case 6: Talk(SAY_EXEC_THINK_7, player->GetGUID()); break;
- case 7: Talk(SAY_EXEC_LISTEN_1, player->GetGUID()); break;
+ case 2: Talk(SAY_EXEC_PROG_5, player); break;
+ case 3: Talk(SAY_EXEC_NAME_1, player); break;
+ case 4: Talk(SAY_EXEC_RECOG_1, player); break;
+ case 5: Talk(SAY_EXEC_NOREM_5, player); break;
+ case 6: Talk(SAY_EXEC_THINK_7, player); break;
+ case 7: Talk(SAY_EXEC_LISTEN_1, player); break;
case 8:
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
- Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID());
+ Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
break;
case 9:
- Talk(SAY_EXEC_TIME_6, player->GetGUID());
+ Talk(SAY_EXEC_TIME_6, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10:
- Talk(SAY_EXEC_WAITING, player->GetGUID());
+ Talk(SAY_EXEC_WAITING, player);
break;
case 11:
Talk(EMOTE_DIES);
@@ -728,25 +728,25 @@ public:
case RACE_ORC:
switch (ExecuteSpeech_Counter)
{
- case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break;
+ case 0: Talk(SAY_EXEC_START_1, player); break;
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
- case 2: Talk(SAY_EXEC_PROG_6, player->GetGUID()); break;
- case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break;
- case 4: Talk(SAY_EXEC_RECOG_1, player->GetGUID()); break;
- case 5: Talk(SAY_EXEC_NOREM_7, player->GetGUID()); break;
- case 6: Talk(SAY_EXEC_THINK_8, player->GetGUID()); break;
- case 7: Talk(SAY_EXEC_LISTEN_1, player->GetGUID()); break;
+ case 2: Talk(SAY_EXEC_PROG_6, player); break;
+ case 3: Talk(SAY_EXEC_NAME_1, player); break;
+ case 4: Talk(SAY_EXEC_RECOG_1, player); break;
+ case 5: Talk(SAY_EXEC_NOREM_7, player); break;
+ case 6: Talk(SAY_EXEC_THINK_8, player); break;
+ case 7: Talk(SAY_EXEC_LISTEN_1, player); break;
case 8:
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
- Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID());
+ Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
break;
case 9:
- Talk(SAY_EXEC_TIME_8, player->GetGUID());
+ Talk(SAY_EXEC_TIME_8, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10:
- Talk(SAY_EXEC_WAITING, player->GetGUID());
+ Talk(SAY_EXEC_WAITING, player);
break;
case 11:
Talk(EMOTE_DIES);
@@ -758,25 +758,25 @@ public:
case RACE_DWARF:
switch (ExecuteSpeech_Counter)
{
- case 0: Talk(SAY_EXEC_START_2, player->GetGUID()); break;
+ case 0: Talk(SAY_EXEC_START_2, player); break;
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
- case 2: Talk(SAY_EXEC_PROG_2, player->GetGUID()); break;
- case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break;
- case 4: Talk(SAY_EXEC_RECOG_3, player->GetGUID()); break;
- case 5: Talk(SAY_EXEC_NOREM_2, player->GetGUID()); break;
- case 6: Talk(SAY_EXEC_THINK_5, player->GetGUID()); break;
- case 7: Talk(SAY_EXEC_LISTEN_2, player->GetGUID()); break;
+ case 2: Talk(SAY_EXEC_PROG_2, player); break;
+ case 3: Talk(SAY_EXEC_NAME_1, player); break;
+ case 4: Talk(SAY_EXEC_RECOG_3, player); break;
+ case 5: Talk(SAY_EXEC_NOREM_2, player); break;
+ case 6: Talk(SAY_EXEC_THINK_5, player); break;
+ case 7: Talk(SAY_EXEC_LISTEN_2, player); break;
case 8:
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
- Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID());
+ Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
break;
case 9:
- Talk(SAY_EXEC_TIME_3, player->GetGUID());
+ Talk(SAY_EXEC_TIME_3, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10:
- Talk(SAY_EXEC_WAITING, player->GetGUID());
+ Talk(SAY_EXEC_WAITING, player);
break;
case 11:
Talk(EMOTE_DIES);
@@ -788,25 +788,25 @@ public:
case RACE_NIGHTELF:
switch (ExecuteSpeech_Counter)
{
- case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break;
+ case 0: Talk(SAY_EXEC_START_1, player); break;
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
- case 2: Talk(SAY_EXEC_PROG_5, player->GetGUID()); break;
- case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break;
- case 4: Talk(SAY_EXEC_RECOG_1, player->GetGUID()); break;
- case 5: Talk(SAY_EXEC_NOREM_6, player->GetGUID()); break;
- case 6: Talk(SAY_EXEC_THINK_2, player->GetGUID()); break;
- case 7: Talk(SAY_EXEC_LISTEN_1, player->GetGUID()); break;
+ case 2: Talk(SAY_EXEC_PROG_5, player); break;
+ case 3: Talk(SAY_EXEC_NAME_1, player); break;
+ case 4: Talk(SAY_EXEC_RECOG_1, player); break;
+ case 5: Talk(SAY_EXEC_NOREM_6, player); break;
+ case 6: Talk(SAY_EXEC_THINK_2, player); break;
+ case 7: Talk(SAY_EXEC_LISTEN_1, player); break;
case 8:
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
- Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID());
+ Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
break;
case 9:
- Talk(SAY_EXEC_TIME_7, player->GetGUID());
+ Talk(SAY_EXEC_TIME_7, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10:
- Talk(SAY_EXEC_WAITING, player->GetGUID());
+ Talk(SAY_EXEC_WAITING, player);
break;
case 11:
Talk(EMOTE_DIES);
@@ -818,25 +818,25 @@ public:
case RACE_UNDEAD_PLAYER:
switch (ExecuteSpeech_Counter)
{
- case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break;
+ case 0: Talk(SAY_EXEC_START_1, player); break;
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
- case 2: Talk(SAY_EXEC_PROG_3, player->GetGUID()); break;
- case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break;
- case 4: Talk(SAY_EXEC_RECOG_4, player->GetGUID()); break;
- case 5: Talk(SAY_EXEC_NOREM_3, player->GetGUID()); break;
- case 6: Talk(SAY_EXEC_THINK_1, player->GetGUID()); break;
- case 7: Talk(SAY_EXEC_LISTEN_3, player->GetGUID()); break;
+ case 2: Talk(SAY_EXEC_PROG_3, player); break;
+ case 3: Talk(SAY_EXEC_NAME_1, player); break;
+ case 4: Talk(SAY_EXEC_RECOG_4, player); break;
+ case 5: Talk(SAY_EXEC_NOREM_3, player); break;
+ case 6: Talk(SAY_EXEC_THINK_1, player); break;
+ case 7: Talk(SAY_EXEC_LISTEN_3, player); break;
case 8:
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
- Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID());
+ Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
break;
case 9:
- Talk(SAY_EXEC_TIME_4, player->GetGUID());
+ Talk(SAY_EXEC_TIME_4, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10:
- Talk(SAY_EXEC_WAITING, player->GetGUID());
+ Talk(SAY_EXEC_WAITING, player);
break;
case 11:
Talk(EMOTE_DIES);
@@ -848,25 +848,25 @@ public:
case RACE_TAUREN:
switch (ExecuteSpeech_Counter)
{
- case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break;
+ case 0: Talk(SAY_EXEC_START_1, player); break;
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
- case 2: Talk(SAY_EXEC_PROG_1, player->GetGUID()); break;
- case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break;
- case 4: Talk(SAY_EXEC_RECOG_5, player->GetGUID()); break;
- case 5: Talk(SAY_EXEC_NOREM_8, player->GetGUID()); break;
- case 6: Talk(SAY_EXEC_THINK_9, player->GetGUID()); break;
- case 7: Talk(SAY_EXEC_LISTEN_1, player->GetGUID()); break;
+ case 2: Talk(SAY_EXEC_PROG_1, player); break;
+ case 3: Talk(SAY_EXEC_NAME_1, player); break;
+ case 4: Talk(SAY_EXEC_RECOG_5, player); break;
+ case 5: Talk(SAY_EXEC_NOREM_8, player); break;
+ case 6: Talk(SAY_EXEC_THINK_9, player); break;
+ case 7: Talk(SAY_EXEC_LISTEN_1, player); break;
case 8:
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
- Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID());
+ Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
break;
case 9:
- Talk(SAY_EXEC_TIME_9, player->GetGUID());
+ Talk(SAY_EXEC_TIME_9, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10:
- Talk(SAY_EXEC_WAITING, player->GetGUID());
+ Talk(SAY_EXEC_WAITING, player);
break;
case 11:
Talk(EMOTE_DIES);
@@ -878,25 +878,25 @@ public:
case RACE_GNOME:
switch (ExecuteSpeech_Counter)
{
- case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break;
+ case 0: Talk(SAY_EXEC_START_1, player); break;
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
- case 2: Talk(SAY_EXEC_PROG_4, player->GetGUID()); break;
- case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break;
- case 4: Talk(SAY_EXEC_RECOG_1, player->GetGUID()); break;
- case 5: Talk(SAY_EXEC_NOREM_4, player->GetGUID()); break;
- case 6: Talk(SAY_EXEC_THINK_6, player->GetGUID()); break;
- case 7: Talk(SAY_EXEC_LISTEN_1, player->GetGUID()); break;
+ case 2: Talk(SAY_EXEC_PROG_4, player); break;
+ case 3: Talk(SAY_EXEC_NAME_1, player); break;
+ case 4: Talk(SAY_EXEC_RECOG_1, player); break;
+ case 5: Talk(SAY_EXEC_NOREM_4, player); break;
+ case 6: Talk(SAY_EXEC_THINK_6, player); break;
+ case 7: Talk(SAY_EXEC_LISTEN_1, player); break;
case 8:
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
- Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID());
+ Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
break;
case 9:
- Talk(SAY_EXEC_TIME_5, player->GetGUID());
+ Talk(SAY_EXEC_TIME_5, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10:
- Talk(SAY_EXEC_WAITING, player->GetGUID());
+ Talk(SAY_EXEC_WAITING, player);
break;
case 11:
Talk(EMOTE_DIES);
@@ -908,25 +908,25 @@ public:
case RACE_TROLL:
switch (ExecuteSpeech_Counter)
{
- case 0: Talk(SAY_EXEC_START_3, player->GetGUID()); break;
+ case 0: Talk(SAY_EXEC_START_3, player); break;
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
- case 2: Talk(SAY_EXEC_PROG_7, player->GetGUID()); break;
- case 3: Talk(SAY_EXEC_NAME_2, player->GetGUID()); break;
- case 4: Talk(SAY_EXEC_RECOG_6, player->GetGUID()); break;
- case 5: Talk(SAY_EXEC_NOREM_9, player->GetGUID()); break;
- case 6: Talk(SAY_EXEC_THINK_10, player->GetGUID()); break;
- case 7: Talk(SAY_EXEC_LISTEN_4, player->GetGUID()); break;
+ case 2: Talk(SAY_EXEC_PROG_7, player); break;
+ case 3: Talk(SAY_EXEC_NAME_2, player); break;
+ case 4: Talk(SAY_EXEC_RECOG_6, player); break;
+ case 5: Talk(SAY_EXEC_NOREM_9, player); break;
+ case 6: Talk(SAY_EXEC_THINK_10, player); break;
+ case 7: Talk(SAY_EXEC_LISTEN_4, player); break;
case 8:
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
- Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID());
+ Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
break;
case 9:
- Talk(SAY_EXEC_TIME_10, player->GetGUID());
+ Talk(SAY_EXEC_TIME_10, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10:
- Talk(SAY_EXEC_WAITING, player->GetGUID());
+ Talk(SAY_EXEC_WAITING, player);
break;
case 11:
Talk(EMOTE_DIES);
@@ -938,25 +938,25 @@ public:
case RACE_BLOODELF:
switch (ExecuteSpeech_Counter)
{
- case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break;
+ case 0: Talk(SAY_EXEC_START_1, player); break;
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
- case 2: Talk(SAY_EXEC_PROG_1, player->GetGUID()); break;
- case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break;
- case 4: Talk(SAY_EXEC_RECOG_1, player->GetGUID()); break;
+ case 2: Talk(SAY_EXEC_PROG_1, player); break;
+ case 3: Talk(SAY_EXEC_NAME_1, player); break;
+ case 4: Talk(SAY_EXEC_RECOG_1, player); break;
//case 5: //unknown
- case 6: Talk(SAY_EXEC_THINK_3, player->GetGUID()); break;
- case 7: Talk(SAY_EXEC_LISTEN_1, player->GetGUID()); break;
+ case 6: Talk(SAY_EXEC_THINK_3, player); break;
+ case 7: Talk(SAY_EXEC_LISTEN_1, player); break;
case 8:
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
- Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID());
+ Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
break;
case 9:
- Talk(SAY_EXEC_TIME_1, player->GetGUID());
+ Talk(SAY_EXEC_TIME_1, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10:
- Talk(SAY_EXEC_WAITING, player->GetGUID());
+ Talk(SAY_EXEC_WAITING, player);
break;
case 11:
Talk(EMOTE_DIES);
@@ -968,25 +968,25 @@ public:
case RACE_DRAENEI:
switch (ExecuteSpeech_Counter)
{
- case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break;
+ case 0: Talk(SAY_EXEC_START_1, player); break;
case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break;
- case 2: Talk(SAY_EXEC_PROG_1, player->GetGUID()); break;
- case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break;
- case 4: Talk(SAY_EXEC_RECOG_2, player->GetGUID()); break;
- case 5: Talk(SAY_EXEC_NOREM_1, player->GetGUID()); break;
- case 6: Talk(SAY_EXEC_THINK_4, player->GetGUID()); break;
- case 7: Talk(SAY_EXEC_LISTEN_1, player->GetGUID()); break;
+ case 2: Talk(SAY_EXEC_PROG_1, player); break;
+ case 3: Talk(SAY_EXEC_NAME_1, player); break;
+ case 4: Talk(SAY_EXEC_RECOG_2, player); break;
+ case 5: Talk(SAY_EXEC_NOREM_1, player); break;
+ case 6: Talk(SAY_EXEC_THINK_4, player); break;
+ case 7: Talk(SAY_EXEC_LISTEN_1, player); break;
case 8:
if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f))
- Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID());
+ Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player);
break;
case 9:
- Talk(SAY_EXEC_TIME_2, player->GetGUID());
+ Talk(SAY_EXEC_TIME_2, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10:
- Talk(SAY_EXEC_WAITING, player->GetGUID());
+ Talk(SAY_EXEC_WAITING, player);
break;
case 11:
Talk(EMOTE_DIES);
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
index 97359ba65a9..75ed7b82406 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 2bb187692fa..cdc37b40521 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -103,7 +103,7 @@ public:
{
me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_01);
DoCast(player, SPELL_REVIVE, true);
- Talk(WHISPER_REVIVE, player->GetGUID());
+ Talk(WHISPER_REVIVE, player);
}
FlyBackTimer = 5000;
break;
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp
index 694fdf9d84e..5370adf8384 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -93,7 +93,7 @@ public:
if (!bShielded && !HealthAbovePct(50))
{
//wait if we already casting
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
return;
Talk(SAY_SPECIALAE);
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp
index 6f028e33726..edcc78ca8fe 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@ public:
return;
//If we are <50% hp cast Soul Siphon rank 1
- if (!HealthAbovePct(50) && !me->IsNonMeleeSpellCasted(false))
+ if (!HealthAbovePct(50) && !me->IsNonMeleeSpellCast(false))
{
//SoulSiphon_Timer
if (SoulSiphon_Timer <= diff)
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp
index b3375d9448f..a7db667ecfd 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
index 463e88b670b..31219e18121 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -258,10 +258,7 @@ public:
void SaySound(uint8 textEntry, Unit* target = 0)
{
- if (target)
- Talk(textEntry, target->GetGUID());
- else
- Talk(textEntry);
+ Talk(textEntry, target);
//DoCast(me, SPELL_HEAD_SPEAKS, true);
if (Creature* speaker = DoSpawnCreature(HELPER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 1000))
@@ -348,7 +345,7 @@ public:
Creature* speaker = DoSpawnCreature(HELPER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 1000);
if (speaker)
speaker->CastSpell(speaker, SPELL_HEAD_SPEAKS, false);
- me->MonsterTextEmote(EMOTE_LAUGHS, 0);
+ me->MonsterTextEmote(EMOTE_LAUGHS, NULL);
}
else laugh -= diff;
}
@@ -377,7 +374,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_headless_horsemanAI(creature);
+ return GetInstanceAI<boss_headless_horsemanAI>(creature);
}
struct boss_headless_horsemanAI : public ScriptedAI
@@ -385,6 +382,7 @@ public:
boss_headless_horsemanAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
+ headGUID = 0;
}
InstanceScript* instance;
@@ -437,8 +435,7 @@ public:
}
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
- //if (instance)
- // instance->SetData(DATA_HORSEMAN_EVENT, NOT_STARTED);
+ //instance->SetData(DATA_HORSEMAN_EVENT, NOT_STARTED);
}
void FlyMode()
@@ -474,8 +471,7 @@ public:
break;
}
case 6:
- if (instance)
- instance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject
+ instance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject
break;
case 19:
me->SetDisableGravity(false);
@@ -497,8 +493,7 @@ public:
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS);
DoZoneInCombat();
}
@@ -528,10 +523,7 @@ public:
void SaySound(uint8 textEntry, Unit* target = 0)
{
- if (target)
- Talk(textEntry, target->GetGUID());
- else
- Talk(textEntry);
+ Talk(textEntry, target);
laugh += 4000;
}
@@ -575,8 +567,7 @@ public:
flame->CastSpell(flame, SPELL_BODY_FLAME, false);
if (Creature* wisp = DoSpawnCreature(WISP_INVIS, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 60000))
CAST_AI(npc_wisp_invis::npc_wisp_invisAI, wisp->AI())->SetType(4);
- if (instance)
- instance->SetData(DATA_HORSEMAN_EVENT, DONE);
+ instance->SetData(DATA_HORSEMAN_EVENT, DONE);
Map::PlayerList const& players = me->GetMap()->GetPlayers();
if (!players.isEmpty())
@@ -728,7 +719,7 @@ public:
if (laugh <= diff)
{
laugh = urand(11000, 22000);
- me->MonsterTextEmote(EMOTE_LAUGHS, 0);
+ me->MonsterTextEmote(EMOTE_LAUGHS, NULL);
DoPlaySoundToSet(me, RandomLaugh[rand()%3]);
}
else laugh -= diff;
@@ -806,6 +797,7 @@ public:
float x, y, z;
me->GetPosition(x, y, z); //this visual aura some under ground
me->SetPosition(x, y, z + 0.35f, 0.0f);
+ debuffGUID = 0;
Despawn();
Creature* debuff = DoSpawnCreature(HELPER, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 14500);
if (debuff)
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp
index 40fe93155a5..da9d8345e77 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -99,7 +99,7 @@ public:
return;
//If we are <30% hp goes Enraged
- if (!Enrage && !HealthAbovePct(30) && !me->IsNonMeleeSpellCasted(false))
+ if (!Enrage && !HealthAbovePct(30) && !me->IsNonMeleeSpellCast(false))
{
Talk(EMOTE_ENRAGE);
Talk(SAY_ENRAGE);
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 46680730f7e..ee5ac9b0620 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -83,7 +83,7 @@ public:
return;
//If we are <25% hp cast Heal
- if (!HealthAbovePct(25) && !me->IsNonMeleeSpellCasted(false) && Heal_Timer <= diff)
+ if (!HealthAbovePct(25) && !me->IsNonMeleeSpellCast(false) && Heal_Timer <= diff)
{
DoCast(me, SPELL_HEAL);
Heal_Timer = 30000;
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp
index 4a0d8ff4796..c8afa26ca4f 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
index a57c237c21a..60164977735 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_interrogator_vishasAI(creature);
+ return GetInstanceAI<boss_interrogator_vishasAI>(creature);
}
struct boss_interrogator_vishasAI : public ScriptedAI
@@ -67,6 +67,8 @@ public:
void Reset() OVERRIDE
{
ShadowWordPain_Timer = 5000;
+ Yell60 = false;
+ Yell30 = false;
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -81,9 +83,6 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (!instance)
- return;
-
//Any other Actions to do with vorrel? setStandState?
if (Creature* vorrel = Creature::GetCreature(*me, instance->GetData64(DATA_VORREL)))
vorrel->AI()->Talk(SAY_TRIGGER_VORREL);
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 403416bb202..0d62d47a5d6 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -65,7 +65,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_scarlet_commander_mograineAI(creature);
+ return GetInstanceAI<boss_scarlet_commander_mograineAI>(creature);
}
struct boss_scarlet_commander_mograineAI : public ScriptedAI
@@ -94,9 +94,8 @@ public:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetStandState(UNIT_STAND_STATE_STAND);
- if (instance)
- if (me->IsAlive())
- instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
+ if (me->IsAlive())
+ instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
_bHasDied = false;
_bHeal = false;
@@ -105,11 +104,8 @@ public:
void JustReachedHome() OVERRIDE
{
- if (instance)
- {
- if (instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != NOT_STARTED)
- instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL);
- }
+ if (instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != NOT_STARTED)
+ instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -130,9 +126,6 @@ public:
if (damage < me->GetHealth() || _bHasDied || _bFakeDeath)
return;
- if (!instance)
- return;
-
//On first death, fake death and open door, as well as initiate whitemane if exist
if (Unit* Whitemane = Unit::GetUnit(*me, instance->GetData64(DATA_WHITEMANE)))
{
@@ -145,7 +138,7 @@ public:
me->SetHealth(0);
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(false);
me->ClearComboPointHolders();
@@ -170,8 +163,7 @@ public:
Talk(SAY_MO_RESSURECTED);
_bFakeDeath = false;
- if (instance)
- instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL);
+ instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL);
}
}
@@ -231,7 +223,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_high_inquisitor_whitemaneAI(creature);
+ return GetInstanceAI<boss_high_inquisitor_whitemaneAI>(creature);
}
struct boss_high_inquisitor_whitemaneAI : public ScriptedAI
@@ -261,9 +253,8 @@ public:
_bCanResurrectCheck = false;
_bCanResurrect = false;
- if (instance)
- if (me->IsAlive())
- instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
+ if (me->IsAlive())
+ instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
}
void AttackStart(Unit* who) OVERRIDE
@@ -313,7 +304,7 @@ public:
//Cast Deep sleep when health is less than 50%
if (!_bCanResurrectCheck && !HealthAbovePct(50))
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(false);
DoCastVictim(SPELL_DEEPSLEEP);
@@ -334,14 +325,11 @@ public:
if (!HealthAbovePct(75))
target = me;
- if (instance)
+ if (Creature* mograine = Unit::GetCreature((*me), instance->GetData64(DATA_MOGRAINE)))
{
- if (Creature* mograine = Unit::GetCreature((*me), instance->GetData64(DATA_MOGRAINE)))
- {
- // checking _bCanResurrectCheck prevents her healing Mograine while he is "faking death"
- if (_bCanResurrectCheck && mograine->IsAlive() && !mograine->HealthAbovePct(75))
- target = mograine;
- }
+ // checking _bCanResurrectCheck prevents her healing Mograine while he is "faking death"
+ if (_bCanResurrectCheck && mograine->IsAlive() && !mograine->HealthAbovePct(75))
+ target = mograine;
}
if (target)
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp
index b2289f324f3..5215fbda633 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp
index b91a54e5afc..4de9c2c80bf 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h
index fbbca46738c..cd5a74ee478 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
index 2277c53ae6b..37484f1c210 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -128,7 +128,7 @@ class boss_darkmaster_gandling : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_darkmaster_gandlingAI(creature);
+ return GetInstanceAI<boss_darkmaster_gandlingAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp
index 108dcc92f22..d2e4601c244 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
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 bcf5e82bc66..931e21f98bf 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp
index c3255ba9c65..9d3c862a3ad 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp
index 88f95df69c4..6e0c2aab115 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -99,7 +99,7 @@ class boss_instructor_malicia : public CreatureScript
events.ScheduleEvent(EVENT_RENEW, 10000);
break;
case EVENT_FLASHHEAL:
- //5 Flashheals will be casted
+ //5 Flashheals will be cast
DoCast(me, SPELL_FLASHHEAL);
if (FlashCounter < 2)
{
@@ -113,7 +113,7 @@ class boss_instructor_malicia : public CreatureScript
}
break;
case EVENT_HEALINGTOUCH:
- //3 Healing Touch will be casted
+ //3 Healing Touch will be cast
DoCast(me, SPELL_HEALINGTOUCH);
if (TouchCounter < 2)
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp
index 2663146317a..448ceaa3371 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@ enum Spells
//SPELL_ILLUSION = 17773,
// Spells of Illusion of Jandice Barov
- SPELL_CLEAVE = 15584
+ SPELL_CLEAVE = 15284
};
class boss_jandice_barov : public CreatureScript
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 2433390f8f5..369ee3842d9 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -253,7 +253,7 @@ class boss_kirtonos_the_herald : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_kirtonos_the_heraldAI(creature);
+ return GetInstanceAI<boss_kirtonos_the_heraldAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp
index 57cfeb7dc33..334e7935183 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
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 e06c0d6bfbb..c167f7d8641 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -28,8 +28,9 @@ EndScriptData */
enum Spells
{
- SPELL_IMMOLATE = 20294, // Old ID was 15570
- SPELL_VEILOFSHADOW = 17820
+ SPELL_IMMOLATE = 20294,
+ SPELL_VEILOFSHADOW = 17820,
+ SPELL_UNHOLY_AURA = 17467
};
enum Events
@@ -49,7 +50,9 @@ class boss_lord_alexei_barov : public CreatureScript
void Reset() OVERRIDE
{
_Reset();
- me->LoadCreaturesAddon();
+
+ if (!me->HasAura(SPELL_UNHOLY_AURA))
+ DoCast(me, SPELL_UNHOLY_AURA);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
index f41f456d24a..2005ac58446 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
index 451fd46938d..68d70e63ca6 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -69,7 +69,7 @@ public:
DoCast(me, SPELL_ICEARMOR, true);
}
- void EnterCombat(Unit* /*who*/)OVERRIDE { }
+ void EnterCombat(Unit* /*who*/) OVERRIDE { }
void UpdateAI(uint32 diff) OVERRIDE
{
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp
index 9af473d4b4c..3df675edd3e 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp
index 395581b3562..a91b1aef13c 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp
index ad0ae3998f1..a3d9ff4bb22 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h
index 5c38cc39e3d..9eb7c5e8f86 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h
+++ b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
index 8c022c98ba7..6f0ea518fd2 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
index 8d89592090e..eb7295f72d0 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -72,7 +72,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_shadowfang_prisonerAI(creature);
+ return GetInstanceAI<npc_shadowfang_prisonerAI>(creature);
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
@@ -135,8 +135,7 @@ public:
else
Talk(SAY_POST1_DOOR_AD);
- if (instance)
- instance->SetData(TYPE_FREE_NPC, DONE);
+ instance->SetData(TYPE_FREE_NPC, DONE);
break;
case 13:
if (me->GetEntry() != NPC_ASH)
@@ -158,7 +157,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_arugal_voidwalkerAI(creature);
+ return GetInstanceAI<npc_arugal_voidwalkerAI>(creature);
}
struct npc_arugal_voidwalkerAI : public ScriptedAI
@@ -196,8 +195,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(TYPE_FENRUS, instance->GetData(TYPE_FENRUS) + 1);
+ instance->SetData(TYPE_FENRUS, instance->GetData(TYPE_FENRUS) + 1);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h
index 1823d24ab2e..0b399dc4050 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp
index 16ec442d963..fe0e3a050c8 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -68,7 +68,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_baron_rivendareAI(creature);
+ return GetInstanceAI<boss_baron_rivendareAI>(creature);
}
struct boss_baron_rivendareAI : public ScriptedAI
@@ -99,8 +99,8 @@ public:
void AttackStart(Unit* who) OVERRIDE
{
- if (instance)//can't use entercombat(), boss' dmg aura sets near players in combat, before entering the room's door
- instance->SetData(TYPE_BARON, IN_PROGRESS);
+ //can't use entercombat(), boss' dmg aura sets near players in combat, before entering the room's door
+ instance->SetData(TYPE_BARON, IN_PROGRESS);
ScriptedAI::AttackStart(who);
}
@@ -110,11 +110,10 @@ public:
summoned->AI()->AttackStart(target);
}
- void JustDied(Unit* /*killer*/) OVERRIDE
- {
- if (instance)
- instance->SetData(TYPE_BARON, DONE);
- }
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ instance->SetData(TYPE_BARON, DONE);
+ }
void UpdateAI(uint32 diff) OVERRIDE
{
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp
index 1812e2efd8d..6a0794ec586 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_baroness_anastariAI(creature);
+ return GetInstanceAI<boss_baroness_anastariAI>(creature);
}
struct boss_baroness_anastariAI : public ScriptedAI
@@ -71,11 +71,10 @@ public:
{
}
- void JustDied(Unit* /*killer*/) OVERRIDE
- {
- if (instance)
- instance->SetData(TYPE_BARONESS, IN_PROGRESS);
- }
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ instance->SetData(TYPE_BARONESS, IN_PROGRESS);
+ }
void UpdateAI(uint32 diff) OVERRIDE
{
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp
index 42714c3f12e..dd5d2f7347c 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp
index 5847f7b132b..44e641bc9b8 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -162,7 +162,7 @@ public:
//BalnazzarTransform
if (HealthBelowPct(40))
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(false);
//restore hp, mana and stun
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp
index 150d134da07..eb552c503eb 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp
index 0f8340891a8..ae07d5347b9 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -43,7 +43,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_maleki_the_pallidAI(creature);
+ return GetInstanceAI<boss_maleki_the_pallidAI>(creature);
}
struct boss_maleki_the_pallidAI : public ScriptedAI
@@ -72,8 +72,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(TYPE_PALLID, IN_PROGRESS);
+ instance->SetData(TYPE_PALLID, IN_PROGRESS);
}
void UpdateAI(uint32 diff) OVERRIDE
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp
index 2cacf80e27c..9bc263f36e7 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_nerubenkanAI(creature);
+ return GetInstanceAI<boss_nerubenkanAI>(creature);
}
struct boss_nerubenkanAI : public ScriptedAI
@@ -73,8 +73,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(TYPE_NERUB, IN_PROGRESS);
+ instance->SetData(TYPE_NERUB, IN_PROGRESS);
}
void RaiseUndeadScarab(Unit* victim)
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp
index 706c2e7b6fb..c26754c483b 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_silver_hand_bossesAI(creature);
+ return GetInstanceAI<boss_silver_hand_bossesAI>(creature);
}
struct boss_silver_hand_bossesAI : public ScriptedAI
@@ -78,26 +78,23 @@ public:
HolyLight_Timer = 20000;
DivineShield_Timer = 20000;
- if (instance)
+ switch (me->GetEntry())
{
- switch (me->GetEntry())
- {
- case SH_AELMAR:
- instance->SetData(TYPE_SH_AELMAR, 0);
- break;
- case SH_CATHELA:
- instance->SetData(TYPE_SH_CATHELA, 0);
- break;
- case SH_GREGOR:
- instance->SetData(TYPE_SH_GREGOR, 0);
- break;
- case SH_NEMAS:
- instance->SetData(TYPE_SH_NEMAS, 0);
- break;
- case SH_VICAR:
- instance->SetData(TYPE_SH_VICAR, 0);
- break;
- }
+ case SH_AELMAR:
+ instance->SetData(TYPE_SH_AELMAR, 0);
+ break;
+ case SH_CATHELA:
+ instance->SetData(TYPE_SH_CATHELA, 0);
+ break;
+ case SH_GREGOR:
+ instance->SetData(TYPE_SH_GREGOR, 0);
+ break;
+ case SH_NEMAS:
+ instance->SetData(TYPE_SH_NEMAS, 0);
+ break;
+ case SH_VICAR:
+ instance->SetData(TYPE_SH_VICAR, 0);
+ break;
}
}
@@ -107,9 +104,6 @@ public:
void JustDied(Unit* killer) OVERRIDE
{
- if (!instance)
- return;
-
switch (me->GetEntry())
{
case SH_AELMAR:
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp
index b67c039ec74..1f6b823de70 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp
index 79b8dd7dfe2..ad4d8787f01 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_ramstein_the_gorgerAI(creature);
+ return GetInstanceAI<boss_ramstein_the_gorgerAI>(creature);
}
struct boss_ramstein_the_gorgerAI : public ScriptedAI
@@ -78,8 +78,7 @@ public:
mob->AI()->AttackStart(me->SelectNearestTarget(100.0f));
}
- if (instance)
- instance->SetData(TYPE_RAMSTEIN, DONE);
+ instance->SetData(TYPE_RAMSTEIN, DONE);
}
void UpdateAI(uint32 diff) OVERRIDE
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp
index 6d4ba8a1631..f0e3bdf7668 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
index 732cdd0d4f4..d8518085b26 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
index 1b15f30353b..3b622885ce7 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h
index fc7630d7403..9e4c88f5856 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h
+++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
index b2afee86774..d395bfd6e0c 100644
--- a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
+++ b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp
index ac0c3a556f3..80a9f1600b6 100644
--- a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp
+++ b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h
index 57d073380bc..394b1e3e8ae 100644
--- a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h
+++ b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
index 3fd346d6816..a52ddcea3b0 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -190,12 +190,12 @@ public:
case 1:
me->SetInFront(Madrigosa);
Madrigosa->SetInFront(me);
- Madrigosa->AI()->Talk(YELL_MADR_INTRO, me->GetGUID());
+ Madrigosa->AI()->Talk(YELL_MADR_INTRO, me);
IntroPhaseTimer = 9000;
++IntroPhase;
break;
case 2:
- Talk(YELL_INTRO, Madrigosa->GetGUID());
+ Talk(YELL_INTRO, Madrigosa);
IntroPhaseTimer = 13000;
++IntroPhase;
break;
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
index e68d834b20d..73e218a6e35 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -217,7 +217,7 @@ public:
{
if (ConflagrationTimer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
me->InterruptSpell(CURRENT_GENERIC_SPELL);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
@@ -230,7 +230,7 @@ public:
{
if (ShadownovaTimer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
@@ -239,7 +239,7 @@ public:
if (!SisterDeath)
{
if (target)
- Talk(EMOTE_SHADOW_NOVA, target->GetGUID());
+ Talk(EMOTE_SHADOW_NOVA, target);
Talk(YELL_SHADOW_NOVA);
}
ShadownovaTimer = 30000+(rand()%5000);
@@ -249,7 +249,7 @@ public:
if (ConfoundingblowTimer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_CONFOUNDING_BLOW);
@@ -276,7 +276,7 @@ public:
if (ShadowbladesTimer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
DoCast(me, SPELL_SHADOW_BLADES);
ShadowbladesTimer = 10000;
@@ -291,7 +291,7 @@ public:
Enraged = true;
} else EnrageTimer -= diff;
- if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
+ if (me->isAttackReady() && !me->IsNonMeleeSpellCast(false))
{
//If we are within range melee the target
if (me->IsWithinMeleeRange(me->GetVictim()))
@@ -548,7 +548,7 @@ public:
{
if (ShadownovaTimer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_SHADOW_NOVA);
@@ -560,7 +560,7 @@ public:
{
if (ConflagrationTimer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
me->InterruptSpell(CURRENT_GENERIC_SPELL);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
@@ -571,7 +571,7 @@ public:
if (!SisterDeath)
{
if (target)
- Talk(EMOTE_CONFLAGRATION, target->GetGUID());
+ Talk(EMOTE_CONFLAGRATION, target);
Talk(YELL_CANFLAGRATION);
}
@@ -582,7 +582,7 @@ public:
if (FlamesearTimer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
DoCast(me, SPELL_FLAME_SEAR);
FlamesearTimer = 15000;
@@ -591,7 +591,7 @@ public:
if (PyrogenicsTimer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
DoCast(me, SPELL_PYROGENICS, true);
PyrogenicsTimer = 15000;
@@ -600,7 +600,7 @@ public:
if (BlazeTimer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
DoCastVictim(SPELL_BLAZE);
BlazeTimer = 3800;
@@ -691,7 +691,7 @@ public:
if (DarkstrikeTimer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
//If we are within range melee the target
if (me->IsWithinMeleeRange(me->GetVictim()))
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
index ca5dcf5360e..02913f361e5 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -351,8 +351,7 @@ public:
break;
}
case 6:
- me->SetOrientation(me->GetAngle(breathX, breathY));
- me->StopMoving();
+ me->SetFacingTo(me->GetAngle(breathX, breathY));
//DoTextEmote("takes a deep breath.", NULL);
events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 10000);
break;
@@ -405,7 +404,7 @@ public:
events.Update(diff);
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
return;
if (phase == PHASE_GROUND)
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
index 2a2574ea256..294443da0e7 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -441,7 +441,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_kalecAI(creature);
+ return GetInstanceAI<boss_kalecAI>(creature);
}
struct boss_kalecAI : public ScriptedAI
@@ -464,8 +464,7 @@ public:
void Reset() OVERRIDE
{
- if (instance)
- SathGUID = instance->GetData64(DATA_SATHROVARR);
+ SathGUID = instance->GetData64(DATA_SATHROVARR);
RevitalizeTimer = 5000;
HeroicStrikeTimer = 3000;
@@ -575,7 +574,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_sathrovarrAI(creature);
+ return GetInstanceAI<boss_sathrovarrAI>(creature);
}
struct boss_sathrovarrAI : public ScriptedAI
@@ -605,11 +604,8 @@ public:
{
me->SetFullHealth();//dunno why it does not resets health at evade..
me->setActive(true);
- if (instance)
- {
- KalecgosGUID = instance->GetData64(DATA_KALECGOS_DRAGON);
- instance->SetBossState(DATA_KALECGOS, NOT_STARTED);
- }
+ KalecgosGUID = instance->GetData64(DATA_KALECGOS_DRAGON);
+ instance->SetBossState(DATA_KALECGOS, NOT_STARTED);
if (KalecGUID)
{
if (Creature* Kalec = ObjectAccessor::GetCreature(*me, KalecGUID))
@@ -674,8 +670,7 @@ public:
CAST_AI(boss_kalecgos::boss_kalecgosAI, Kalecgos->AI())->isFriendly = true;
}
- if (instance)
- instance->SetBossState(DATA_KALECGOS, DONE);
+ instance->SetBossState(DATA_KALECGOS, DONE);
}
void TeleportAllPlayersBack()
@@ -755,7 +750,7 @@ public:
}
else
{
- me->MonsterTextEmote(EMOTE_UNABLE_TO_FIND, 0);
+ me->MonsterTextEmote(EMOTE_UNABLE_TO_FIND, NULL);
EnterEvadeMode();
return;
}
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
index b3982200a10..9d073cd7ef8 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -236,7 +236,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_kalecgos_kjAI(creature);
+ return GetInstanceAI<boss_kalecgos_kjAI>(creature);
}
struct boss_kalecgos_kjAI : public ScriptedAI
@@ -265,9 +265,6 @@ public:
GameObject* GetOrb(int32 index)
{
- if (!instance)
- return NULL;
-
switch (index)
{
case 0:
@@ -389,7 +386,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_kiljaeden_controllerAI(creature);
+ return GetInstanceAI<npc_kiljaeden_controllerAI>(creature);
}
struct npc_kiljaeden_controllerAI : public ScriptedAI
@@ -424,9 +421,8 @@ public:
{
phase = PHASE_DECEIVERS;
- if (instance)
- if (Creature* pKalecKJ = ObjectAccessor::GetCreature((*me), instance->GetData64(DATA_KALECGOS_KJ)))
- CAST_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs();
+ if (Creature* pKalecKJ = ObjectAccessor::GetCreature((*me), instance->GetData64(DATA_KALECGOS_KJ)))
+ CAST_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs();
deceiverDeathCount = 0;
bSummonedDeceivers = false;
bKiljaedenDeath = false;
@@ -710,7 +706,7 @@ public:
SpeechTimer += diff;
break;
case TIMER_SOUL_FLAY:
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
DoCastVictim(SPELL_SOUL_FLAY_SLOW, false);
DoCastVictim(SPELL_SOUL_FLAY, false);
@@ -718,7 +714,7 @@ public:
}
break;
case TIMER_LEGION_LIGHTNING:
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
Unit* pRandomPlayer = NULL;
@@ -740,7 +736,7 @@ public:
}
break;
case TIMER_FIRE_BLOOM:
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
me->RemoveAurasDueToSpell(SPELL_SOUL_FLAY);
DoCastAOE(SPELL_FIRE_BLOOM, false);
@@ -760,7 +756,7 @@ public:
Timer[TIMER_SOUL_FLAY] = 2000;
break;
case TIMER_SHADOW_SPIKE: //Phase 3
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
CastSinisterReflection();
DoCastAOE(SPELL_SHADOW_SPIKE, false);
@@ -774,7 +770,7 @@ public:
Timer[TIMER_FLAME_DART] = 3000; /// @todo Timer
break;
case TIMER_DARKNESS: //Phase 3
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
// Begins to channel for 8 seconds, then deals 50'000 damage to all raid members.
if (!IsInDarkness)
@@ -927,9 +923,6 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (!instance)
- return;
-
if (Creature* pControl = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_KILJAEDEN_CONTROLLER)))
++(CAST_AI(npc_kiljaeden_controller::npc_kiljaeden_controllerAI, pControl->AI())->deceiverDeathCount);
}
@@ -1150,7 +1143,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_shield_orbAI(creature);
+ return GetInstanceAI<npc_shield_orbAI>(creature);
}
struct npc_shield_orbAI : public ScriptedAI
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
index 8da162bae14..426771e6db6 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -371,7 +371,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_muru_portalAI(creature);
+ return GetInstanceAI<npc_muru_portalAI>(creature);
}
struct npc_muru_portalAI : public ScriptedAI
@@ -405,9 +405,8 @@ public:
void JustSummoned(Creature* summoned) OVERRIDE
{
- if (instance)
- if (Player* Target = ObjectAccessor::GetPlayer(*me, instance->GetData64(DATA_PLAYER_GUID)))
- summoned->AI()->AttackStart(Target);
+ if (Player* Target = ObjectAccessor::GetPlayer(*me, instance->GetData64(DATA_PLAYER_GUID)))
+ summoned->AI()->AttackStart(Target);
Summons.Summon(summoned);
}
@@ -571,7 +570,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_blackholeAI(creature);
+ return GetInstanceAI<npc_blackholeAI>(creature);
}
struct npc_blackholeAI : public ScriptedAI
@@ -593,6 +592,7 @@ public:
DespawnTimer = 15000;
SpellTimer = 5000;
Phase = 0;
+ NeedForAHack = 0;
me->AddUnitState(UNIT_STATE_STUNNED);
DoCastAOE(SPELL_BLACKHOLE_SPAWN, true);
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp
index 4bc42921402..38f63d106ee 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp
index 4b190f04a70..69c48e40d88 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h
index d2025a7b2b9..d32cdb037b2 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/TheStockade/instance_the_stockade.cpp b/src/server/scripts/EasternKingdoms/TheStockade/instance_the_stockade.cpp
index 50d4f0d1578..6d5d9ab4939 100644
--- a/src/server/scripts/EasternKingdoms/TheStockade/instance_the_stockade.cpp
+++ b/src/server/scripts/EasternKingdoms/TheStockade/instance_the_stockade.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
index 69ee53f0762..496be57932e 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -86,8 +86,7 @@ class boss_archaedas : public CreatureScript
bGuardiansAwake = false;
bVaultWalkersAwake = false;
- if (instance)
- instance->SetData(0, 5); // respawn any dead minions
+ instance->SetData(0, 5); // respawn any dead minions
me->setFaction(35);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
@@ -132,8 +131,6 @@ class boss_archaedas : public CreatureScript
void UpdateAI(uint32 uiDiff) OVERRIDE
{
- if (!instance)
- return;
// we're still doing awaken animation
if (bWakingUp && iAwakenTimer >= 0)
{
@@ -196,17 +193,14 @@ class boss_archaedas : public CreatureScript
void JustDied (Unit* /*killer*/)
{
- if (instance)
- {
- instance->SetData(DATA_ANCIENT_DOOR, DONE); // open the vault door
- instance->SetData(DATA_MINIONS, SPECIAL); // deactivate his minions
- }
+ instance->SetData(DATA_ANCIENT_DOOR, DONE); // open the vault door
+ instance->SetData(DATA_MINIONS, SPECIAL); // deactivate his minions
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_archaedasAI(creature);
+ return GetInstanceAI<boss_archaedasAI>(creature);
}
};
@@ -305,7 +299,7 @@ class npc_archaedas_minions : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_archaedas_minionsAI(creature);
+ return GetInstanceAI<npc_archaedas_minionsAI>(creature);
}
};
@@ -361,14 +355,13 @@ class npc_stonekeepers : public CreatureScript
void JustDied(Unit* /*attacker*/) OVERRIDE
{
DoCast (me, SPELL_SELF_DESTRUCT, true);
- if (instance)
- instance->SetData(DATA_STONE_KEEPERS, IN_PROGRESS); // activate next stonekeeper
+ instance->SetData(DATA_STONE_KEEPERS, IN_PROGRESS); // activate next stonekeeper
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_stonekeepersAI(creature);
+ return GetInstanceAI<npc_stonekeepersAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp
index 830942ae2c3..d883cc136eb 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -48,14 +48,14 @@ class boss_ironaya : public CreatureScript
boss_ironayaAI(Creature* creature) : ScriptedAI(creature) { }
uint32 uiArcingTimer;
- bool bHasCastedWstomp;
- bool bHasCastedKnockaway;
+ bool bHasCastWstomp;
+ bool bHasCastKnockaway;
void Reset() OVERRIDE
{
uiArcingTimer = 3000;
- bHasCastedKnockaway = false;
- bHasCastedWstomp = false;
+ bHasCastKnockaway = false;
+ bHasCastWstomp = false;
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -70,7 +70,7 @@ class boss_ironaya : public CreatureScript
return;
//If we are <50% hp do knockaway ONCE
- if (!bHasCastedKnockaway && HealthBelowPct(50))
+ if (!bHasCastKnockaway && HealthBelowPct(50))
{
DoCastVictim(SPELL_KNOCKAWAY, true);
@@ -84,7 +84,7 @@ class boss_ironaya : public CreatureScript
me->TauntApply(target);
//Shouldn't cast this agian
- bHasCastedKnockaway = true;
+ bHasCastKnockaway = true;
}
//uiArcingTimer
@@ -94,10 +94,10 @@ class boss_ironaya : public CreatureScript
uiArcingTimer = 13000;
} else uiArcingTimer -= uiDiff;
- if (!bHasCastedWstomp && HealthBelowPct(25))
+ if (!bHasCastWstomp && HealthBelowPct(25))
{
DoCast(me, SPELL_WSTOMP);
- bHasCastedWstomp = true;
+ bHasCastWstomp = true;
}
DoMeleeAttackIfReady();
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
index f221355b1c8..39e47d109c6 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
index 1dfb48f746f..cd79f90cf58 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.h b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.h
index 15583312f5a..6f17fae0162 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.h
+++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
index 526daaffee1..eca840dbeb2 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -116,8 +116,7 @@ class boss_akilzon : public CreatureScript
Talk(SAY_AGGRO);
//DoZoneInCombat();
- if (instance)
- instance->SetData(DATA_AKILZONEVENT, IN_PROGRESS);
+ instance->SetData(DATA_AKILZONEVENT, IN_PROGRESS);
}
void JustDied(Unit* /*killer*/) OVERRIDE
@@ -126,9 +125,10 @@ class boss_akilzon : public CreatureScript
_JustDied();
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_KILL);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_KILL);
}
void SetWeather(uint32 weather, float grade)
@@ -228,10 +228,14 @@ class boss_akilzon : public CreatureScript
case EVENT_STATIC_DISRUPTION:
{
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
- if (!target) target = me->GetVictim();
- TargetGUID = target->GetGUID();
- DoCast(target, SPELL_STATIC_DISRUPTION, false);
- me->SetInFront(me->GetVictim());
+ if (!target)
+ target = me->GetVictim();
+ if (target)
+ {
+ TargetGUID = target->GetGUID();
+ DoCast(target, SPELL_STATIC_DISRUPTION, false);
+ me->SetInFront(me->GetVictim());
+ }
/*if (float dist = me->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f) dist = 5.0f;
SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/
events.ScheduleEvent(EVENT_STATIC_DISRUPTION, urand(10000, 18000));
@@ -240,8 +244,10 @@ class boss_akilzon : public CreatureScript
case EVENT_GUST_OF_WIND:
{
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
- if (!target) target = me->GetVictim();
- DoCast(target, SPELL_GUST_OF_WIND);
+ if (!target)
+ target = me->GetVictim();
+ if (target)
+ DoCast(target, SPELL_GUST_OF_WIND);
events.ScheduleEvent(EVENT_GUST_OF_WIND, urand(20000, 30000));
break;
}
@@ -362,7 +368,7 @@ class boss_akilzon : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_akilzonAI(creature);
+ return GetInstanceAI<boss_akilzonAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp
index a174b4833b4..4e354b47be5 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -111,8 +111,7 @@ class boss_halazzi : public CreatureScript
void Reset() OVERRIDE
{
- if (instance)
- instance->SetData(DATA_HALAZZIEVENT, NOT_STARTED);
+ instance->SetData(DATA_HALAZZIEVENT, NOT_STARTED);
LynxGUID = 0;
TransformCount = 0;
@@ -127,10 +126,9 @@ class boss_halazzi : public CreatureScript
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS);
+ instance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS);
- me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_AGGRO);
EnterPhase(PHASE_LYNX);
@@ -182,7 +180,7 @@ class boss_halazzi : public CreatureScript
TotemTimer = 12000;
break;
case PHASE_SPLIT:
- me->MonsterYell(YELL_SPLIT, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_SPLIT, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_SPLIT);
DoCast(me, SPELL_TRANSFORM_SPLIT, true);
break;
@@ -197,7 +195,7 @@ class boss_halazzi : public CreatureScript
case PHASE_MERGE:
if (Unit* pLynx = Unit::GetUnit(*me, LynxGUID))
{
- me->MonsterYell(YELL_MERGE, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_MERGE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_MERGE);
pLynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pLynx->GetMotionMaster()->Clear();
@@ -220,7 +218,7 @@ class boss_halazzi : public CreatureScript
if (BerserkTimer <= diff)
{
- me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_BERSERK);
DoCast(me, SPELL_BERSERK, true);
BerserkTimer = 60000;
@@ -266,7 +264,7 @@ class boss_halazzi : public CreatureScript
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
- if (target->IsNonMeleeSpellCasted(false))
+ if (target->IsNonMeleeSpellCast(false))
DoCast(target, SPELL_EARTHSHOCK);
else
DoCast(target, SPELL_FLAMESHOCK);
@@ -320,12 +318,12 @@ class boss_halazzi : public CreatureScript
switch (urand(0, 1))
{
case 0:
- me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_KILL_ONE);
break;
case 1:
- me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_KILL_TWO);
break;
}
@@ -333,17 +331,16 @@ class boss_halazzi : public CreatureScript
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_HALAZZIEVENT, DONE);
+ instance->SetData(DATA_HALAZZIEVENT, DONE);
- me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_DEATH);
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_halazziAI(creature);
+ return GetInstanceAI<boss_halazziAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
index c2975bdf9da..04e3d9f3450 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -278,8 +278,7 @@ class boss_hexlord_malacrass : public CreatureScript
void Reset() OVERRIDE
{
- if (instance)
- instance->SetData(DATA_HEXLORDEVENT, NOT_STARTED);
+ instance->SetData(DATA_HEXLORDEVENT, NOT_STARTED);
SpiritBolts_Timer = 20000;
DrainPower_Timer = 60000;
@@ -296,11 +295,10 @@ class boss_hexlord_malacrass : public CreatureScript
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS);
+ instance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS);
DoZoneInCombat();
- me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_AGGRO);
for (uint8 i = 0; i < 4; ++i)
@@ -321,11 +319,11 @@ class boss_hexlord_malacrass : public CreatureScript
switch (urand(0, 1))
{
case 0:
- me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_KILL_ONE);
break;
case 1:
- me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_KILL_TWO);
break;
}
@@ -333,10 +331,9 @@ class boss_hexlord_malacrass : public CreatureScript
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_HEXLORDEVENT, DONE);
+ instance->SetData(DATA_HEXLORDEVENT, DONE);
- me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_DEATH);
for (uint8 i = 0; i < 4; ++i)
@@ -410,7 +407,7 @@ class boss_hexlord_malacrass : public CreatureScript
if (DrainPower_Timer <= diff)
{
DoCast(me, SPELL_DRAIN_POWER, true);
- me->MonsterYell(YELL_DRAIN_POWER, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_DRAIN_POWER, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_DRAIN_POWER);
DrainPower_Timer = urand(40000, 55000); // must cast in 60 sec, or buff/debuff will disappear
} else DrainPower_Timer -= diff;
@@ -422,7 +419,7 @@ class boss_hexlord_malacrass : public CreatureScript
else
{
DoCast(me, SPELL_SPIRIT_BOLTS, false);
- me->MonsterYell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_SPIRIT_BOLTS);
SpiritBolts_Timer = 40000;
SiphonSoul_Timer = 10000; // ready to drain
@@ -510,7 +507,7 @@ class boss_hexlord_malacrass : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_hex_lord_malacrassAI(creature);
+ return GetInstanceAI<boss_hex_lord_malacrassAI>(creature);
}
};
@@ -567,7 +564,7 @@ class boss_thurg : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_thurgAI(creature);
+ return GetInstanceAI<boss_thurgAI>(creature);
}
};
@@ -664,7 +661,7 @@ class boss_alyson_antille : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_alyson_antilleAI(creature);
+ return GetInstanceAI<boss_alyson_antilleAI>(creature);
}
};
@@ -757,7 +754,7 @@ class boss_lord_raadan : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_lord_raadanAI(creature);
+ return GetInstanceAI<boss_lord_raadanAI>(creature);
}
};
@@ -798,7 +795,7 @@ class boss_darkheart : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_darkheartAI(creature);
+ return GetInstanceAI<boss_darkheartAI>(creature);
}
};
@@ -857,7 +854,7 @@ class boss_slither : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_slitherAI(creature);
+ return GetInstanceAI<boss_slitherAI>(creature);
}
};
@@ -900,7 +897,7 @@ class boss_fenstalker : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_fenstalkerAI(creature);
+ return GetInstanceAI<boss_fenstalkerAI>(creature);
}
};
@@ -950,7 +947,7 @@ class boss_koragg : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_koraggAI(creature);
+ return GetInstanceAI<boss_koraggAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
index e429f27aa48..caf54313fe7 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -143,8 +143,7 @@ class boss_janalai : public CreatureScript
void Reset() OVERRIDE
{
- if (instance)
- instance->SetData(DATA_JANALAIEVENT, NOT_STARTED);
+ instance->SetData(DATA_JANALAIEVENT, NOT_STARTED);
FireBreathTimer = 8000;
BombTimer = 30000;
@@ -169,8 +168,7 @@ class boss_janalai : public CreatureScript
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_JANALAIEVENT, DONE);
+ instance->SetData(DATA_JANALAIEVENT, DONE);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -180,8 +178,7 @@ class boss_janalai : public CreatureScript
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_JANALAIEVENT, IN_PROGRESS);
+ instance->SetData(DATA_JANALAIEVENT, IN_PROGRESS);
Talk(SAY_AGGRO);
// DoZoneInCombat();
@@ -324,7 +321,7 @@ class boss_janalai : public CreatureScript
{
if (isFlameBreathing)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
isFlameBreathing = false;
else
return;
@@ -442,7 +439,7 @@ class boss_janalai : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_janalaiAI(creature);
+ return GetInstanceAI<boss_janalaiAI>(creature);
}
};
@@ -612,7 +609,7 @@ class npc_janalai_hatcher : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_janalai_hatcherAI(creature);
+ return GetInstanceAI<npc_janalai_hatcherAI>(creature);
}
};
@@ -671,7 +668,7 @@ class npc_janalai_hatchling : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_janalai_hatchlingAI(creature);
+ return GetInstanceAI<npc_janalai_hatchlingAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
index 24b043775b1..5bd78006f95 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -148,8 +148,7 @@ class boss_nalorakk : public CreatureScript
(*me).GetMotionMaster()->MovePoint(0, NalorakkWay[7][0], NalorakkWay[7][1], NalorakkWay[7][2]);
}
- if (instance)
- instance->SetData(DATA_NALORAKKEVENT, NOT_STARTED);
+ instance->SetData(DATA_NALORAKKEVENT, NOT_STARTED);
Surge_Timer = urand(15000, 20000);
BrutalSwipe_Timer = urand(7000, 12000);
@@ -217,7 +216,7 @@ class boss_nalorakk : public CreatureScript
case 0:
if (me->IsWithinDistInMap(who, 50))
{
- me->MonsterYell(YELL_NALORAKK_WAVE1, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_NALORAKK_WAVE1, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE1);
(*me).GetMotionMaster()->MovePoint(1, NalorakkWay[1][0], NalorakkWay[1][1], NalorakkWay[1][2]);
@@ -230,7 +229,7 @@ class boss_nalorakk : public CreatureScript
case 2:
if (me->IsWithinDistInMap(who, 40))
{
- me->MonsterYell(YELL_NALORAKK_WAVE2, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_NALORAKK_WAVE2, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE2);
(*me).GetMotionMaster()->MovePoint(3, NalorakkWay[3][0], NalorakkWay[3][1], NalorakkWay[3][2]);
@@ -243,7 +242,7 @@ class boss_nalorakk : public CreatureScript
case 5:
if (me->IsWithinDistInMap(who, 40))
{
- me->MonsterYell(YELL_NALORAKK_WAVE3, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_NALORAKK_WAVE3, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE3);
(*me).GetMotionMaster()->MovePoint(6, NalorakkWay[6][0], NalorakkWay[6][1], NalorakkWay[6][2]);
@@ -258,7 +257,7 @@ class boss_nalorakk : public CreatureScript
{
SendAttacker(who);
- me->MonsterYell(YELL_NALORAKK_WAVE4, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_NALORAKK_WAVE4, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE4);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -275,20 +274,18 @@ class boss_nalorakk : public CreatureScript
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS);
+ instance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS);
- me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_AGGRO);
DoZoneInCombat();
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_NALORAKKEVENT, DONE);
+ instance->SetData(DATA_NALORAKKEVENT, DONE);
- me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_DEATH);
}
@@ -297,11 +294,11 @@ class boss_nalorakk : public CreatureScript
switch (urand(0, 1))
{
case 0:
- me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_KILL_ONE);
break;
case 1:
- me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_KILL_TWO);
break;
}
@@ -365,7 +362,7 @@ class boss_nalorakk : public CreatureScript
if (Berserk_Timer <= diff)
{
DoCast(me, SPELL_BERSERK, true);
- me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_BERSERK);
Berserk_Timer = 600000;
} else Berserk_Timer -= diff;
@@ -375,7 +372,7 @@ class boss_nalorakk : public CreatureScript
if (inBearForm)
{
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122);
- me->MonsterYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_TOTROLL);
me->RemoveAurasDueToSpell(SPELL_BEARFORM);
Surge_Timer = urand(15000, 20000);
@@ -387,7 +384,7 @@ class boss_nalorakk : public CreatureScript
else
{
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0);
- me->MonsterYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_TOBEAR);
DoCast(me, SPELL_BEARFORM, true);
LaceratingSlash_Timer = 2000; // dur 18s
@@ -418,7 +415,7 @@ class boss_nalorakk : public CreatureScript
if (Surge_Timer <= diff)
{
- me->MonsterYell(YELL_SURGE, LANG_UNIVERSAL, 0);
+ me->MonsterYell(YELL_SURGE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_YELL_SURGE);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true);
if (target)
@@ -453,7 +450,7 @@ class boss_nalorakk : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_nalorakkAI(creature);
+ return GetInstanceAI<boss_nalorakkAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
index 6281bcef5df..dbdc0b8e5c7 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -169,8 +169,7 @@ class boss_zuljin : public CreatureScript
void Reset() OVERRIDE
{
- if (instance)
- instance->SetData(DATA_ZULJINEVENT, NOT_STARTED);
+ instance->SetData(DATA_ZULJINEVENT, NOT_STARTED);
Phase = 0;
@@ -206,8 +205,7 @@ class boss_zuljin : public CreatureScript
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_ZULJINEVENT, IN_PROGRESS);
+ instance->SetData(DATA_ZULJINEVENT, IN_PROGRESS);
DoZoneInCombat();
@@ -226,8 +224,7 @@ class boss_zuljin : public CreatureScript
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_ZULJINEVENT, DONE);
+ instance->SetData(DATA_ZULJINEVENT, DONE);
Talk(YELL_DEATH);
Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE);
@@ -246,7 +243,7 @@ class boss_zuljin : public CreatureScript
void DoMeleeAttackIfReady()
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
if (me->isAttackReady() && me->IsWithinMeleeRange(me->GetVictim()))
{
@@ -555,7 +552,7 @@ class boss_zuljin : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_zuljinAI(creature);
+ return GetInstanceAI<boss_zuljinAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
index 854679339c3..2347de4fa66 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
index a4176322288..e51bcfc70ba 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -74,33 +74,30 @@ class npc_forest_frog : public CreatureScript
void DoSpawnRandom()
{
- if (instance)
+ uint32 cEntry = 0;
+ switch (rand()%10)
{
- uint32 cEntry = 0;
- switch (rand()%10)
- {
- case 0: cEntry = 24397; break; //Mannuth
- case 1: cEntry = 24403; break; //Deez
- case 2: cEntry = 24404; break; //Galathryn
- case 3: cEntry = 24405; break; //Adarrah
- case 4: cEntry = 24406; break; //Fudgerick
- case 5: cEntry = 24407; break; //Darwen
- case 6: cEntry = 24445; break; //Mitzi
- case 7: cEntry = 24448; break; //Christian
- case 8: cEntry = 24453; break; //Brennan
- case 9: cEntry = 24455; break; //Hollee
- }
+ case 0: cEntry = 24397; break; //Mannuth
+ case 1: cEntry = 24403; break; //Deez
+ case 2: cEntry = 24404; break; //Galathryn
+ case 3: cEntry = 24405; break; //Adarrah
+ case 4: cEntry = 24406; break; //Fudgerick
+ case 5: cEntry = 24407; break; //Darwen
+ case 6: cEntry = 24445; break; //Mitzi
+ case 7: cEntry = 24448; break; //Christian
+ case 8: cEntry = 24453; break; //Brennan
+ case 9: cEntry = 24455; break; //Hollee
+ }
- if (!instance->GetData(TYPE_RAND_VENDOR_1))
- if (rand()%10 == 1) cEntry = 24408; //Gunter
- if (!instance->GetData(TYPE_RAND_VENDOR_2))
- if (rand()%10 == 1) cEntry = 24409; //Kyren
+ if (!instance->GetData(TYPE_RAND_VENDOR_1))
+ if (rand()%10 == 1) cEntry = 24408; //Gunter
+ if (!instance->GetData(TYPE_RAND_VENDOR_2))
+ if (rand()%10 == 1) cEntry = 24409; //Kyren
- if (cEntry) me->UpdateEntry(cEntry);
+ if (cEntry) me->UpdateEntry(cEntry);
- if (cEntry == 24408) instance->SetData(TYPE_RAND_VENDOR_1, DONE);
- if (cEntry == 24409) instance->SetData(TYPE_RAND_VENDOR_2, DONE);
- }
+ if (cEntry == 24408) instance->SetData(TYPE_RAND_VENDOR_1, DONE);
+ if (cEntry == 24409) instance->SetData(TYPE_RAND_VENDOR_2, DONE);
}
void SpellHit(Unit* caster, const SpellInfo* spell) OVERRIDE
@@ -116,7 +113,7 @@ class npc_forest_frog : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_forest_frogAI(creature);
+ return GetInstanceAI<npc_forest_frogAI>(creature);
}
};
@@ -320,8 +317,7 @@ class npc_harrison_jones : public CreatureScript
me->SetTarget(0);
me->SetByteValue(UNIT_FIELD_BYTES_1, 0, UNIT_STAND_STATE_DEAD);
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
- if (instance)
- instance->SetData(DATA_GONGEVENT, DONE);
+ instance->SetData(DATA_GONGEVENT, DONE);
}
}
@@ -331,9 +327,6 @@ class npc_harrison_jones : public CreatureScript
{
if (_gongTimer <= diff)
{
- if (!instance)
- return;
-
switch (_gongEvent)
{
case GONG_EVENT_1:
@@ -460,7 +453,7 @@ class npc_harrison_jones : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_harrison_jonesAI(creature);
+ return GetInstanceAI<npc_harrison_jonesAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h
index c3386f8c996..4d5938d7253 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h
+++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
index 7fe80c12fd2..5b943fd57f2 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -96,30 +96,21 @@ class boss_arlokk : public CreatureScript
void Reset() OVERRIDE
{
+ if (events.IsInPhase(PHASE_TWO))
+ me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, false); // hack
+ _Reset();
_summonCountA = 0;
_summonCountB = 0;
- me->RemoveAllAuras();
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_DAGGER));
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(WEAPON_DAGGER));
- if (instance)
- {
- if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_FORCEFIELD)))
- gate->SetGoState(GO_STATE_READY);
- me->SetWalk(false);
- me->GetMotionMaster()->MovePoint(0, PosMoveOnSpawn[0]);
- }
+ me->SetWalk(false);
+ me->GetMotionMaster()->MovePoint(0, PosMoveOnSpawn[0]);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
+ _JustDied();
Talk(SAY_DEATH);
- me->RemoveAllAuras();
- if (instance)
- {
- if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_FORCEFIELD)))
- gate->SetGoState(GO_STATE_ACTIVE);
- instance->SetBossState(DATA_ARLOKK, DONE);
- }
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -127,8 +118,7 @@ class boss_arlokk : public CreatureScript
_EnterCombat();
events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(7000, 9000), 0, PHASE_ONE);
events.ScheduleEvent(EVENT_GOUGE, urand(12000, 15000), 0, PHASE_ONE);
- if (instance)
- events.ScheduleEvent(EVENT_SUMMON_PROWLERS, 6000, 0, PHASE_ALL);
+ events.ScheduleEvent(EVENT_SUMMON_PROWLERS, 6000, 0, PHASE_ALL);
events.ScheduleEvent(EVENT_MARK_OF_ARLOKK, urand(9000, 11000), 0, PHASE_ALL);
events.ScheduleEvent(EVENT_TRANSFORM, urand(15000, 20000), 0, PHASE_ONE);
Talk(SAY_AGGRO);
@@ -161,14 +151,9 @@ class boss_arlokk : public CreatureScript
void EnterEvadeMode() OVERRIDE
{
- if (instance)
- {
- if (GameObject* object = me->GetMap()->GetGameObject(instance->GetData64(GO_FORCEFIELD)))
- object->SetGoState(GO_STATE_ACTIVE);
- if (GameObject* object = me->GetMap()->GetGameObject(instance->GetData64(GO_GONG_OF_BETHEKK)))
- object->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
- instance->SetBossState(DATA_ARLOKK, NOT_STARTED);
- }
+ BossAI::EnterEvadeMode();
+ if (GameObject* object = ObjectAccessor::GetGameObject(*me, instance->GetData64(GO_GONG_OF_BETHEKK)))
+ object->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
me->DespawnOrUnsummon(4000);
}
@@ -204,7 +189,7 @@ class boss_arlokk : public CreatureScript
case EVENT_SUMMON_PROWLERS:
if (_summonCountA < MAX_PROWLERS_PER_SIDE)
{
- if (Unit* trigger = me->GetUnit(*me, _triggersSideAGUID[urand(0, 4)]))
+ if (Unit* trigger = ObjectAccessor::GetUnit(*me, _triggersSideAGUID[urand(0, 4)]))
{
trigger->CastSpell(trigger, SPELL_SUMMON_PROWLER);
++_summonCountA;
@@ -212,7 +197,7 @@ class boss_arlokk : public CreatureScript
}
if (_summonCountB < MAX_PROWLERS_PER_SIDE)
{
- if (Unit* trigger = me->GetUnit(*me, _triggersSideBGUID[urand(0, 4)]))
+ if (Unit* trigger = ObjectAccessor::GetUnit(*me, _triggersSideBGUID[urand(0, 4)]))
{
trigger->CastSpell(trigger, SPELL_SUMMON_PROWLER);
++_summonCountB;
@@ -228,20 +213,22 @@ class boss_arlokk : public CreatureScript
if (target)
{
DoCast(target, SPELL_MARK_OF_ARLOKK, true);
- Talk(SAY_FEAST_PROWLER, target->GetGUID());
+ Talk(SAY_FEAST_PROWLER, target);
}
events.ScheduleEvent(EVENT_MARK_OF_ARLOKK, urand(120000, 130000));
break;
}
case EVENT_TRANSFORM:
{
- DoCast(me, SPELL_PANTHER_TRANSFORM);
+ DoCast(me, SPELL_PANTHER_TRANSFORM); // SPELL_AURA_TRANSFORM
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP));
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(EQUIP_UNEQUIP));
+ /*
const CreatureTemplate* cinfo = me->GetCreatureTemplate();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
me->UpdateDamagePhysical(BASE_ATTACK);
+ */
me->AttackStop();
DoResetThreat();
me->SetReactState(REACT_PASSIVE);
@@ -254,8 +241,7 @@ class boss_arlokk : public CreatureScript
case EVENT_VANISH:
DoCast(me, SPELL_SUPER_INVIS);
me->SetWalk(false);
- if (instance)
- me->GetMotionMaster()->MovePoint(0, frand(-11551.0f, -11508.0f), frand(-1638.0f, -1617.0f), me->GetPositionZ());
+ me->GetMotionMaster()->MovePoint(0, frand(-11551.0f, -11508.0f), frand(-1638.0f, -1617.0f), me->GetPositionZ());
events.ScheduleEvent(EVENT_VANISH_2, 9000, 0, PHASE_ONE);
break;
case EVENT_VANISH_2:
@@ -273,6 +259,7 @@ class boss_arlokk : public CreatureScript
events.ScheduleEvent(EVENT_RAVAGE, urand(10000, 14000), 0, PHASE_TWO);
events.ScheduleEvent(EVENT_TRANSFORM_BACK, urand(15000, 18000), 0, PHASE_TWO);
events.SetPhase(PHASE_TWO);
+ me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, true); // hack
break;
case EVENT_RAVAGE:
DoCastVictim(SPELL_RAVAGE, true);
@@ -280,14 +267,17 @@ class boss_arlokk : public CreatureScript
break;
case EVENT_TRANSFORM_BACK:
{
- me->RemoveAura(SPELL_PANTHER_TRANSFORM);
+ me->RemoveAura(SPELL_PANTHER_TRANSFORM); // SPELL_AURA_TRANSFORM
DoCast(me, SPELL_VANISH_VISUAL);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_DAGGER));
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(WEAPON_DAGGER));
+ /*
const CreatureTemplate* cinfo = me->GetCreatureTemplate();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg));
me->UpdateDamagePhysical(BASE_ATTACK);
+ */
+ me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, false); // hack
events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(4000, 7000), 0, PHASE_ONE);
events.ScheduleEvent(EVENT_GOUGE, urand(12000, 15000), 0, PHASE_ONE);
events.ScheduleEvent(EVENT_TRANSFORM, urand(16000, 20000), 0, PHASE_ONE);
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp
index 017730f1186..ef188dd9261 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp
index 6d21e6015fe..120961a087e 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp
index b25daf85a7c..84ebc313b12 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -169,7 +169,7 @@ class boss_hakkar : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_hakkarAI(creature);
+ return GetInstanceAI<boss_hakkarAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp
index f988a43f728..232c9059b47 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp
index 50b7d277a70..e6ef90d1638 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -267,14 +267,11 @@ class npc_batrider : public CreatureScript
//Check_Timer
if (Check_Timer <= diff)
{
- if (instance)
+ if (instance->GetBossState(DATA_JEKLIK) == DONE)
{
- if (instance->GetBossState(DATA_JEKLIK) == DONE)
- {
- me->setDeathState(JUST_DIED);
- me->RemoveCorpse();
- return;
- }
+ me->setDeathState(JUST_DIED);
+ me->RemoveCorpse();
+ return;
}
Check_Timer = 1000;
@@ -286,7 +283,7 @@ class npc_batrider : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_batriderAI(creature);
+ return GetInstanceAI<npc_batriderAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp
index 886e000c093..b4ba1ef71fb 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -217,12 +217,9 @@ class npc_healing_ward : public CreatureScript
//Heal_Timer
if (Heal_Timer <= diff)
{
- if (instance)
- {
- Unit* pJindo = Unit::GetUnit(*me, instance->GetData64(DATA_JINDO));
- if (pJindo)
- DoCast(pJindo, SPELL_HEAL);
- }
+ Unit* pJindo = Unit::GetUnit(*me, instance->GetData64(DATA_JINDO));
+ if (pJindo)
+ DoCast(pJindo, SPELL_HEAL);
Heal_Timer = 3000;
} else Heal_Timer -= diff;
@@ -232,7 +229,7 @@ class npc_healing_ward : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_healing_wardAI(creature);
+ return GetInstanceAI<npc_healing_wardAI>(creature);
}
};
@@ -258,7 +255,7 @@ class npc_shade_of_jindo : public CreatureScript
DoCast(me, SPELL_INVISIBLE, true);
}
- void EnterCombat(Unit* /*who*/)OVERRIDE { }
+ void EnterCombat(Unit* /*who*/) OVERRIDE { }
void UpdateAI(uint32 diff) OVERRIDE
{
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
index 08215f6a9de..d307303f4f4 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -257,7 +257,7 @@ class boss_mandokir : public CreatureScript
if (Unit* player = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoCast(player, SPELL_WATCH);
- Talk(SAY_WATCH, player->GetGUID());
+ Talk(SAY_WATCH, player);
}
events.ScheduleEvent(EVENT_WATCH_PLAYER, urand(12000, 15000));
break;
@@ -393,7 +393,7 @@ class npc_vilebranch_speaker : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_vilebranch_speakerAI(creature);
+ return GetInstanceAI<npc_vilebranch_speakerAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp
index 3edbe6ff721..efd79d89a2b 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -64,11 +64,6 @@ enum Phases
PHASE_THREE = 3
};
-enum ModelId
-{
- MODEL_MARLI = 15220
-};
-
class boss_marli : public CreatureScript
{
public: boss_marli() : CreatureScript("boss_marli") { }
@@ -79,6 +74,8 @@ class boss_marli : public CreatureScript
void Reset() OVERRIDE
{
+ if (events.IsInPhase(PHASE_THREE))
+ me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, false); // hack
_Reset();
}
@@ -155,11 +152,14 @@ class boss_marli : public CreatureScript
case EVENT_TRANSFORM:
{
Talk(SAY_TRANSFORM);
- DoCast(me, SPELL_SPIDER_FORM);
+ DoCast(me, SPELL_SPIDER_FORM); // SPELL_AURA_TRANSFORM
+ /*
CreatureTemplate const* cinfo = me->GetCreatureTemplate();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
me->UpdateDamagePhysical(BASE_ATTACK);
+ */
+ me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, true); // hack
DoCastVictim(SPELL_ENVOLWINGWEB);
if (DoGetThreat(me->GetVictim()))
DoModifyThreatPercent(me->GetVictim(), -100);
@@ -188,11 +188,14 @@ class boss_marli : public CreatureScript
}
case EVENT_TRANSFORM_BACK:
{
- me->SetDisplayId(MODEL_MARLI);
+ me->RemoveAura(SPELL_SPIDER_FORM);
+ /*
CreatureTemplate const* cinfo = me->GetCreatureTemplate();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1)));
me->UpdateDamagePhysical(BASE_ATTACK);
+ */
+ me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, false); // hack
events.ScheduleEvent(EVENT_ASPECT_OF_MARLI, 12000, 0, PHASE_TWO);
events.ScheduleEvent(EVENT_TRANSFORM, 45000, 0, PHASE_TWO);
events.ScheduleEvent(EVENT_POISON_VOLLEY, 15000);
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
index 581f1de5013..87a8e647f53 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
index d20414705cf..a70dd5e0a30 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -89,6 +89,8 @@ class boss_thekal : public CreatureScript
void Reset() OVERRIDE
{
+ if (events.IsInPhase(PHASE_TWO))
+ me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, false); // hack
_Reset();
Enraged = false;
WasDead = false;
@@ -112,8 +114,7 @@ class boss_thekal : public CreatureScript
void JustReachedHome() OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_THEKAL, NOT_STARTED);
+ instance->SetBossState(DATA_THEKAL, NOT_STARTED);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -142,15 +143,17 @@ class boss_thekal : public CreatureScript
//Thekal will transform to Tiger if he died and was not resurrected after 10 seconds.
if (WasDead)
{
- DoCast(me, SPELL_TIGER_FORM);
+ DoCast(me, SPELL_TIGER_FORM); // SPELL_AURA_TRANSFORM
me->SetObjectScale(2.00f);
me->SetStandState(UNIT_STAND_STATE_STAND);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFullHealth();
+ /*
const CreatureTemplate* cinfo = me->GetCreatureTemplate();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40)));
me->UpdateDamagePhysical(BASE_ATTACK);
+ */
+ me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 40.0f, true); // hack
DoResetThreat();
events.ScheduleEvent(EVENT_FRENZY, 30000, 0, PHASE_TWO); // Phase 2
events.ScheduleEvent(EVENT_FORCEPUNCH, 4000, 0, PHASE_TWO); // Phase 2
@@ -165,32 +168,29 @@ class boss_thekal : public CreatureScript
//Check_Timer for the death of LorKhan and Zath.
if (!WasDead)
{
- if (instance)
+ if (instance->GetBossState(DATA_LORKHAN) == SPECIAL)
{
- if (instance->GetBossState(DATA_LORKHAN) == SPECIAL)
+ //Resurrect LorKhan
+ if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN)))
{
- //Resurrect LorKhan
- if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN)))
- {
- pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pLorKhan->setFaction(14);
- pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pLorKhan->SetFullHealth();
- instance->SetData(DATA_LORKHAN, DONE);
- }
+ pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pLorKhan->setFaction(14);
+ pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pLorKhan->SetFullHealth();
+ instance->SetData(DATA_LORKHAN, DONE);
}
+ }
- if (instance->GetBossState(DATA_ZATH) == SPECIAL)
+ if (instance->GetBossState(DATA_ZATH) == SPECIAL)
+ {
+ //Resurrect Zath
+ if (Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH)))
{
- //Resurrect Zath
- if (Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH)))
- {
- pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pZath->setFaction(14);
- pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pZath->SetFullHealth();
- instance->SetBossState(DATA_ZATH, DONE);
- }
+ pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pZath->setFaction(14);
+ pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pZath->SetFullHealth();
+ instance->SetBossState(DATA_ZATH, DONE);
}
}
}
@@ -240,8 +240,7 @@ class boss_thekal : public CreatureScript
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetStandState(UNIT_STAND_STATE_SLEEP);
me->AttackStop();
- if (instance)
- instance->SetBossState(DATA_THEKAL, SPECIAL);
+ instance->SetBossState(DATA_THEKAL, SPECIAL);
WasDead=true;
}
}
@@ -251,7 +250,7 @@ class boss_thekal : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_thekalAI(creature);
+ return GetInstanceAI<boss_thekalAI>(creature);
}
};
@@ -287,8 +286,7 @@ class npc_zealot_lorkhan : public CreatureScript
FakeDeath = false;
- if (instance)
- instance->SetBossState(DATA_LORKHAN, NOT_STARTED);
+ instance->SetBossState(DATA_LORKHAN, NOT_STARTED);
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -320,25 +318,22 @@ class npc_zealot_lorkhan : public CreatureScript
//Casting Greaterheal to Thekal or Zath if they are in meele range.
if (GreaterHeal_Timer <= diff)
{
- if (instance)
- {
- Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL));
- Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH));
+ Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL));
+ Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH));
- if (!pThekal || !pZath)
- return;
+ if (!pThekal || !pZath)
+ return;
- switch (urand(0, 1))
- {
- case 0:
- if (me->IsWithinMeleeRange(pThekal))
- DoCast(pThekal, SPELL_GREATERHEAL);
- break;
- case 1:
- if (me->IsWithinMeleeRange(pZath))
- DoCast(pZath, SPELL_GREATERHEAL);
- break;
- }
+ switch (urand(0, 1))
+ {
+ case 0:
+ if (me->IsWithinMeleeRange(pThekal))
+ DoCast(pThekal, SPELL_GREATERHEAL);
+ break;
+ case 1:
+ if (me->IsWithinMeleeRange(pZath))
+ DoCast(pZath, SPELL_GREATERHEAL);
+ break;
}
GreaterHeal_Timer = 15000+rand()%5000;
@@ -354,30 +349,27 @@ class npc_zealot_lorkhan : public CreatureScript
//Check_Timer for the death of LorKhan and Zath.
if (!FakeDeath && Check_Timer <= diff)
{
- if (instance)
+ if (instance->GetBossState(DATA_THEKAL) == SPECIAL)
{
- if (instance->GetBossState(DATA_THEKAL) == SPECIAL)
+ //Resurrect Thekal
+ if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL)))
{
- //Resurrect Thekal
- if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL)))
- {
- pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pThekal->setFaction(14);
- pThekal->SetFullHealth();
- }
+ pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pThekal->setFaction(14);
+ pThekal->SetFullHealth();
}
+ }
- if (instance->GetBossState(DATA_ZATH) == SPECIAL)
+ if (instance->GetBossState(DATA_ZATH) == SPECIAL)
+ {
+ //Resurrect Zath
+ if (Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH)))
{
- //Resurrect Zath
- if (Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH)))
- {
- pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pZath->setFaction(14);
- pZath->SetFullHealth();
- }
+ pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pZath->setFaction(14);
+ pZath->SetFullHealth();
}
}
@@ -394,8 +386,7 @@ class npc_zealot_lorkhan : public CreatureScript
me->setFaction(35);
me->AttackStop();
- if (instance)
- instance->SetBossState(DATA_LORKHAN, SPECIAL);
+ instance->SetBossState(DATA_LORKHAN, SPECIAL);
FakeDeath = true;
}
@@ -406,7 +397,7 @@ class npc_zealot_lorkhan : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_zealot_lorkhanAI(creature);
+ return GetInstanceAI<npc_zealot_lorkhanAI>(creature);
}
};
@@ -449,8 +440,7 @@ class npc_zealot_zath : public CreatureScript
FakeDeath = false;
- if (instance)
- instance->SetBossState(DATA_ZATH, NOT_STARTED);
+ instance->SetBossState(DATA_ZATH, NOT_STARTED);
me->SetStandState(UNIT_STAND_STATE_STAND);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -507,30 +497,27 @@ class npc_zealot_zath : public CreatureScript
//Check_Timer for the death of LorKhan and Zath.
if (!FakeDeath && Check_Timer <= diff)
{
- if (instance)
+ if (instance->GetBossState(DATA_LORKHAN) == SPECIAL)
{
- if (instance->GetBossState(DATA_LORKHAN) == SPECIAL)
+ //Resurrect LorKhan
+ if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN)))
{
- //Resurrect LorKhan
- if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN)))
- {
- pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pLorKhan->setFaction(14);
- pLorKhan->SetFullHealth();
- }
+ pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pLorKhan->setFaction(14);
+ pLorKhan->SetFullHealth();
}
+ }
- if (instance->GetBossState(DATA_THEKAL) == SPECIAL)
+ if (instance->GetBossState(DATA_THEKAL) == SPECIAL)
+ {
+ //Resurrect Thekal
+ if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL)))
{
- //Resurrect Thekal
- if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL)))
- {
- pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pThekal->setFaction(14);
- pThekal->SetFullHealth();
- }
+ pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pThekal->setFaction(14);
+ pThekal->SetFullHealth();
}
}
@@ -547,8 +534,7 @@ class npc_zealot_zath : public CreatureScript
me->setFaction(35);
me->AttackStop();
- if (instance)
- instance->SetBossState(DATA_ZATH, SPECIAL);
+ instance->SetBossState(DATA_ZATH, SPECIAL);
FakeDeath = true;
}
@@ -559,7 +545,7 @@ class npc_zealot_zath : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_zealot_zathAI(creature);
+ return GetInstanceAI<npc_zealot_zathAI>(creature);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp
index 0d3548ae253..e131ed7ad12 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp
index 8778a306230..a4bd38b8fa7 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
index e9a2172040a..67d40abaea3 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -27,6 +27,12 @@ EndScriptData */
#include "InstanceScript.h"
#include "zulgurub.h"
+DoorData const doorData[] =
+{
+ { GO_FORCEFIELD, DATA_ARLOKK, DOOR_TYPE_ROOM, BOUNDARY_NONE },
+ { 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } // END
+};
+
class instance_zulgurub : public InstanceMapScript
{
public: instance_zulgurub(): InstanceMapScript(ZGScriptName, 309) { }
@@ -36,6 +42,7 @@ class instance_zulgurub : public InstanceMapScript
instance_zulgurub_InstanceMapScript(Map* map) : InstanceScript(map)
{
SetBossNumber(EncounterCount);
+ LoadDoorData(doorData);
}
void Initialize() OVERRIDE
@@ -46,7 +53,6 @@ class instance_zulgurub : public InstanceMapScript
_jindoTheHexxerGUID = 0;
_vilebranchSpeakerGUID = 0;
_arlokkGUID = 0;
- _goForcefieldGUID = 0;
_goGongOfBethekkGUID = 0;
}
@@ -86,7 +92,7 @@ class instance_zulgurub : public InstanceMapScript
switch (go->GetEntry())
{
case GO_FORCEFIELD:
- _goForcefieldGUID = go->GetGUID();
+ AddDoor(go, true);
break;
case GO_GONG_OF_BETHEKK:
_goGongOfBethekkGUID = go->GetGUID();
@@ -100,6 +106,18 @@ class instance_zulgurub : public InstanceMapScript
}
}
+ void OnGameObjectRemove(GameObject* go) OVERRIDE
+ {
+ switch (go->GetEntry())
+ {
+ case GO_FORCEFIELD:
+ AddDoor(go, false);
+ break;
+ default:
+ break;
+ }
+ }
+
uint64 GetData64(uint32 uiData) const OVERRIDE
{
switch (uiData)
@@ -119,9 +137,6 @@ class instance_zulgurub : public InstanceMapScript
case NPC_ARLOKK:
return _arlokkGUID;
break;
- case GO_FORCEFIELD:
- return _goForcefieldGUID;
- break;
case GO_GONG_OF_BETHEKK:
return _goGongOfBethekkGUID;
break;
@@ -181,7 +196,6 @@ class instance_zulgurub : public InstanceMapScript
uint64 _jindoTheHexxerGUID;
uint64 _vilebranchSpeakerGUID;
uint64 _arlokkGUID;
- uint64 _goForcefieldGUID;
uint64 _goGongOfBethekkGUID;
};
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
index 77767153a96..c92e8b8724d 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/boss_kruul.cpp b/src/server/scripts/EasternKingdoms/boss_kruul.cpp
index 5ac197aa7db..faed1a3cc34 100644
--- a/src/server/scripts/EasternKingdoms/boss_kruul.cpp
+++ b/src/server/scripts/EasternKingdoms/boss_kruul.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp b/src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp
index 9b9af494554..3df4fddf69f 100644
--- a/src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp
index 5c760a36e70..7a2c1cb09db 100644
--- a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -39,32 +39,27 @@ EndContentData */
enum ProfessorPhizzlethorpe
{
// Yells
- SAY_PROGRESS_1 = 0,
- SAY_PROGRESS_2 = 1,
- SAY_PROGRESS_3 = 2,
- EMOTE_PROGRESS_4 = 3,
- SAY_AGGRO = 4,
- SAY_PROGRESS_5 = 5,
- SAY_PROGRESS_6 = 6,
- SAY_PROGRESS_7 = 7,
- EMOTE_PROGRESS_8 = 8,
- SAY_PROGRESS_9 = 9,
-
+ SAY_PROGRESS_1 = 0,
+ SAY_PROGRESS_2 = 1,
+ SAY_PROGRESS_3 = 2,
+ EMOTE_PROGRESS_4 = 3,
+ SAY_AGGRO = 4,
+ SAY_PROGRESS_5 = 5,
+ SAY_PROGRESS_6 = 6,
+ SAY_PROGRESS_7 = 7,
+ EMOTE_PROGRESS_8 = 8,
+ SAY_PROGRESS_9 = 9,
// Quests
QUEST_SUNKEN_TREASURE = 665,
-
// Creatures
- NPC_VENGEFUL_SURGE = 2776
+ NPC_VENGEFUL_SURGE = 2776,
+ FACTION_SUNKEN_TREASURE = 113
};
class npc_professor_phizzlethorpe : public CreatureScript
{
public:
-
- npc_professor_phizzlethorpe()
- : CreatureScript("npc_professor_phizzlethorpe")
- {
- }
+ npc_professor_phizzlethorpe() : CreatureScript("npc_professor_phizzlethorpe") { }
struct npc_professor_phizzlethorpeAI : public npc_escortAI
{
@@ -79,10 +74,10 @@ class npc_professor_phizzlethorpe : public CreatureScript
switch (waypointId)
{
case 4:
- Talk(SAY_PROGRESS_2, player->GetGUID());
+ Talk(SAY_PROGRESS_2, player);
break;
case 5:
- Talk(SAY_PROGRESS_3, player->GetGUID());
+ Talk(SAY_PROGRESS_3, player);
break;
case 8:
Talk(EMOTE_PROGRESS_4);
@@ -92,18 +87,18 @@ class npc_professor_phizzlethorpe : public CreatureScript
me->SummonCreature(NPC_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
break;
case 10:
- Talk(SAY_PROGRESS_5, player->GetGUID());
+ Talk(SAY_PROGRESS_5, player);
break;
case 11:
- Talk(SAY_PROGRESS_6, player->GetGUID());
+ Talk(SAY_PROGRESS_6, player);
SetRun();
break;
case 19:
- Talk(SAY_PROGRESS_7, player->GetGUID());
+ Talk(SAY_PROGRESS_7, player);
break;
case 20:
Talk(EMOTE_PROGRESS_8);
- Talk(SAY_PROGRESS_9, player->GetGUID());
+ Talk(SAY_PROGRESS_9, player);
player->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
break;
}
@@ -119,29 +114,26 @@ class npc_professor_phizzlethorpe : public CreatureScript
Talk(SAY_AGGRO);
}
+ void sQuestAccept(Player* player, Quest const* quest)
+ {
+ if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
+ {
+ Talk(SAY_PROGRESS_1, player);
+ npc_escortAI::Start(false, false, player->GetGUID(), quest);
+ me->setFaction(FACTION_SUNKEN_TREASURE);
+ }
+ }
+
void UpdateAI(uint32 diff) OVERRIDE
{
npc_escortAI::UpdateAI(diff);
}
};
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_professor_phizzlethorpeAI(creature);
- }
-
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
- {
- if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
- {
- creature->AI()->Talk(SAY_PROGRESS_1, player->GetGUID());
- if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (creature->AI())))
- pEscortAI->Start(false, false, player->GetGUID(), quest);
-
- creature->setFaction(113);
- }
- return true;
- }
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_professor_phizzlethorpeAI(creature);
+ }
};
void AddSC_arathi_highlands()
diff --git a/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp b/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp
index b102873e940..3fcd3c093b7 100644
--- a/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp
@@ -1,6 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -16,28 +15,26 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Blasted_Lands
-SD%Complete: 90
-SDComment: Quest support: 3628. Teleporter to Rise of the Defiler missing group support.
-SDCategory: Blasted Lands
-EndScriptData */
+/*
+Blasted_Lands
+Quest support: 3628. Teleporter to Rise of the Defiler.
+*/
-/* ContentData
+/*
npc_deathly_usher
-EndContentData */
+*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
+#include "SpellScript.h"
#include "Player.h"
+#include "Group.h"
/*######
## npc_deathly_usher
######*/
-#define GOSSIP_ITEM_USHER "I wish to to visit the Rise of the Defiler."
-
enum DeathlyUsher
{
SPELL_TELEPORT_SINGLE = 12885,
@@ -50,30 +47,72 @@ class npc_deathly_usher : public CreatureScript
public:
npc_deathly_usher() : CreatureScript("npc_deathly_usher") { }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
+ struct npc_deathly_usherAI : public ScriptedAI
{
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF)
+ npc_deathly_usherAI(Creature* creature) : ScriptedAI(creature) { }
+
+ void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) OVERRIDE
{
player->CLOSE_GOSSIP_MENU();
- creature->CastSpell(player, SPELL_TELEPORT_SINGLE, true);
+ me->CastSpell(player, SPELL_TELEPORT_GROUP, true);
}
+ };
- return true;
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_deathly_usherAI(creature);
}
+};
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
- {
- if (player->GetQuestStatus(3628) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(10757))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_USHER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+/*#####
+# spell_razelikh_teleport_group
+#####*/
+
+class spell_razelikh_teleport_group : public SpellScriptLoader
+{
+ public: spell_razelikh_teleport_group() : SpellScriptLoader("spell_razelikh_teleport_group") { }
+
+ class spell_razelikh_teleport_group_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_razelikh_teleport_group_SpellScript);
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
+ bool Validate(SpellInfo const* /*spell*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_TELEPORT_SINGLE) && !sSpellMgr->GetSpellInfo(SPELL_TELEPORT_SINGLE_IN_GROUP))
+ return false;
+ return true;
+ }
- return true;
- }
+ void HandleScriptEffect(SpellEffIndex /* effIndex */)
+ {
+ if (Player* player = GetHitPlayer())
+ {
+ if (Group* group = player->GetGroup())
+ {
+ for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
+ if (Player* member = itr->GetSource())
+ if (member->IsWithinDistInMap(player, 20.0f) && !member->isDead())
+ member->CastSpell(member, SPELL_TELEPORT_SINGLE_IN_GROUP, true);
+ }
+ else
+ player->CastSpell(player, SPELL_TELEPORT_SINGLE, true);
+ }
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_razelikh_teleport_group_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_razelikh_teleport_group_SpellScript();
+ }
};
void AddSC_blasted_lands()
{
new npc_deathly_usher();
+ new spell_razelikh_teleport_group();
}
diff --git a/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp
index 5a61663a0bb..b991ab3c7a2 100644
--- a/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -49,11 +49,43 @@ EndContentData */
#define GOSSIP_SELECT10 "Ahh... Ironfoe"
#define GOSSIP_SELECT11 "Thanks, Ragged John. Your story was very uplifting and informative"
+enum RaggedJohn
+{
+ QUEST_THE_TRUE_MASTERS = 4224,
+ QUEST_MOTHERS_MILK = 4866,
+ SPELL_MOTHERS_MILK = 16468,
+ SPELL_WICKED_MILKING = 16472
+};
+
class npc_ragged_john : public CreatureScript
{
public:
npc_ragged_john() : CreatureScript("npc_ragged_john") { }
+ struct npc_ragged_johnAI : public ScriptedAI
+ {
+ npc_ragged_johnAI(Creature* creature) : ScriptedAI(creature) { }
+
+ void Reset() OVERRIDE { }
+
+ void MoveInLineOfSight(Unit* who) OVERRIDE
+ {
+ if (who->HasAura(SPELL_MOTHERS_MILK))
+ {
+ if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(me))
+ {
+ DoCast(who, SPELL_WICKED_MILKING);
+ if (Player* player = who->ToPlayer())
+ player->AreaExploredOrEventHappens(QUEST_MOTHERS_MILK);
+ }
+ }
+
+ ScriptedAI::MoveInLineOfSight(who);
+ }
+
+ void EnterCombat(Unit* /*who*/) OVERRIDE { }
+ };
+
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
{
player->PlayerTalkClass->ClearMenus();
@@ -105,7 +137,7 @@ public:
break;
case GOSSIP_ACTION_INFO_DEF+11:
player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(4224);
+ player->AreaExploredOrEventHappens(QUEST_THE_TRUE_MASTERS);
break;
}
return true;
@@ -116,7 +148,7 @@ public:
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
- if (player->GetQuestStatus(4224) == QUEST_STATUS_INCOMPLETE)
+ if (player->GetQuestStatus(QUEST_THE_TRUE_MASTERS) == QUEST_STATUS_INCOMPLETE)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(2713, creature->GetGUID());
@@ -127,31 +159,6 @@ public:
{
return new npc_ragged_johnAI(creature);
}
-
- struct npc_ragged_johnAI : public ScriptedAI
- {
- npc_ragged_johnAI(Creature* creature) : ScriptedAI(creature) { }
-
- void Reset() OVERRIDE { }
-
- void MoveInLineOfSight(Unit* who) OVERRIDE
-
- {
- if (who->HasAura(16468))
- {
- if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(me))
- {
- DoCast(who, 16472);
- if (Player* player = who->ToPlayer())
- player->AreaExploredOrEventHappens(4866);
- }
- }
-
- ScriptedAI::MoveInLineOfSight(who);
- }
-
- void EnterCombat(Unit* /*who*/) OVERRIDE { }
- };
};
void AddSC_burning_steppes()
diff --git a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp
index 8f7865dbf71..0332727fa4c 100644
--- a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -27,81 +27,45 @@ EndScriptData */
#include "ScriptedCreature.h"
#include "Player.h"
-enum Yells
-{
- YELL_TWILIGHTCORRUPTOR_RESPAWN = 0,
- YELL_TWILIGHTCORRUPTOR_AGGRO = 1,
- YELL_TWILIGHTCORRUPTOR_KILL = 2,
-};
-
-
-/*######
-# at_twilight_grove
-######*/
-
-class at_twilight_grove : public AreaTriggerScript
+enum TwilightCorrupter
{
-public:
- at_twilight_grove() : AreaTriggerScript("at_twilight_grove") { }
+ ITEM_FRAGMENT = 21149,
+ NPC_TWILIGHT_CORRUPTER = 15625,
+ YELL_TWILIGHTCORRUPTOR_RESPAWN = 0,
+ YELL_TWILIGHTCORRUPTOR_AGGRO = 1,
+ YELL_TWILIGHTCORRUPTOR_KILL = 2,
+ SPELL_SOUL_CORRUPTION = 25805,
+ SPELL_CREATURE_OF_NIGHTMARE = 25806,
+ SPELL_LEVEL_UP = 24312,
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) OVERRIDE
- {
- if (player->HasQuestForItem(21149))
- {
- if (Unit* TCorrupter = player->SummonCreature(15625, -10328.16f, -489.57f, 49.95f, 0, TEMPSUMMON_MANUAL_DESPAWN, 60000))
- {
- TCorrupter->setFaction(14);
- TCorrupter->SetMaxHealth(832750);
- }
- if (Creature* CorrupterSpeaker = player->SummonCreature(1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()-1, 0, TEMPSUMMON_TIMED_DESPAWN, 15000))
- {
- CorrupterSpeaker->SetName("Twilight Corrupter");
- CorrupterSpeaker->SetVisible(true);
- CorrupterSpeaker->AI()->Talk(YELL_TWILIGHTCORRUPTOR_RESPAWN, player->GetGUID());
- }
- }
- return false;
- };
+ EVENT_SOUL_CORRUPTION = 1,
+ EVENT_CREATURE_OF_NIGHTMARE = 2,
+ FACTION_HOSTILE = 14
};
/*######
# boss_twilight_corrupter
######*/
-enum TwilightCorrupter
-{
- SPELL_SOUL_CORRUPTION = 25805,
- SPELL_CREATURE_OF_NIGHTMARE = 25806,
- SPELL_LEVEL_UP = 24312
-};
-
class boss_twilight_corrupter : public CreatureScript
{
public:
boss_twilight_corrupter() : CreatureScript("boss_twilight_corrupter") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new boss_twilight_corrupterAI(creature);
- }
-
struct boss_twilight_corrupterAI : public ScriptedAI
{
boss_twilight_corrupterAI(Creature* creature) : ScriptedAI(creature) { }
- uint32 SoulCorruption_Timer;
- uint32 CreatureOfNightmare_Timer;
- uint8 KillCount;
-
void Reset() OVERRIDE
{
- SoulCorruption_Timer = 15000;
- CreatureOfNightmare_Timer = 30000;
- KillCount = 0;
+ KillCount = 0;
}
+
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(YELL_TWILIGHTCORRUPTOR_AGGRO);
+ _events.ScheduleEvent(EVENT_SOUL_CORRUPTION, 15000);
+ _events.ScheduleEvent(EVENT_CREATURE_OF_NIGHTMARE, 30000);
}
void KilledUnit(Unit* victim) OVERRIDE
@@ -109,7 +73,7 @@ public:
if (victim->GetTypeId() == TYPEID_PLAYER)
{
++KillCount;
- Talk(YELL_TWILIGHTCORRUPTOR_KILL, victim->GetGUID());
+ Talk(YELL_TWILIGHTCORRUPTOR_KILL, victim);
if (KillCount == 3)
{
@@ -123,19 +87,63 @@ public:
{
if (!UpdateVictim())
return;
- if (SoulCorruption_Timer <= diff)
- {
- DoCastVictim(SPELL_SOUL_CORRUPTION);
- SoulCorruption_Timer = rand()%4000+15000; //gotta confirm Timers
- } else SoulCorruption_Timer-=diff;
- if (CreatureOfNightmare_Timer <= diff)
+ _events.Update(diff);
+
+ while (uint32 eventId = _events.ExecuteEvent())
{
- DoCastVictim(SPELL_CREATURE_OF_NIGHTMARE);
- CreatureOfNightmare_Timer = 45000; //gotta confirm Timers
- } else CreatureOfNightmare_Timer-=diff;
+ switch (eventId)
+ {
+ case EVENT_SOUL_CORRUPTION:
+ DoCastVictim(SPELL_SOUL_CORRUPTION);
+ _events.ScheduleEvent(EVENT_SOUL_CORRUPTION, rand()%4000+15000);
+ break;
+ case EVENT_CREATURE_OF_NIGHTMARE:
+ DoCastVictim(SPELL_CREATURE_OF_NIGHTMARE);
+ _events.ScheduleEvent(EVENT_CREATURE_OF_NIGHTMARE, 45000);
+ break;
+ default:
+ break;
+ }
+ }
DoMeleeAttackIfReady();
- };
+ }
+
+ private:
+ EventMap _events;
+ uint8 KillCount;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new boss_twilight_corrupterAI(creature);
+ }
+};
+
+/*######
+# at_twilight_grove
+######*/
+
+class at_twilight_grove : public AreaTriggerScript
+{
+public:
+ at_twilight_grove() : AreaTriggerScript("at_twilight_grove") { }
+
+ bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) OVERRIDE
+ {
+ if (player->HasQuestForItem(ITEM_FRAGMENT))
+ {
+ if (Unit* corrupter = player->SummonCreature(NPC_TWILIGHT_CORRUPTER, -10328.16f, -489.57f, 49.95f, 0, TEMPSUMMON_MANUAL_DESPAWN, 60000))
+ corrupter->setFaction(FACTION_HOSTILE);
+
+ if (Creature* CorrupterSpeaker = player->SummonCreature(1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()-1, 0, TEMPSUMMON_TIMED_DESPAWN, 15000))
+ {
+ CorrupterSpeaker->SetName("Twilight Corrupter");
+ CorrupterSpeaker->SetVisible(true);
+ CorrupterSpeaker->AI()->Talk(YELL_TWILIGHTCORRUPTOR_RESPAWN, player);
+ }
+ }
+ return false;
};
};
diff --git a/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp
index ed14875b36d..23b218897b7 100644
--- a/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp
index 6bc9aab3d6f..dcfa576e7fe 100644
--- a/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp
index 1b181581f5e..a4f75ea23d4 100644
--- a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -19,14 +19,11 @@
/* ScriptData
SDName: Ghostlands
SD%Complete: 100
-SDComment: Quest support: 9692, 9212. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber
+SDComment: Quest support: 9212.
SDCategory: Ghostlands
EndScriptData */
/* ContentData
-npc_blood_knight_dawnstar
-npc_budd_nedreck
-npc_rathis_tomber
npc_ranger_lilatha
EndContentData */
@@ -38,80 +35,11 @@ EndContentData */
#include "WorldSession.h"
/*######
-## npc_budd_nedreck
-######*/
-
-#define GOSSIP_HBN "You gave the crew disguises?"
-
-class npc_budd_nedreck : public CreatureScript
-{
-public:
- npc_budd_nedreck() : CreatureScript("npc_budd_nedreck") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF)
- {
- player->CLOSE_GOSSIP_MENU();
- creature->CastSpell(player, 42540, false);
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(11166) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
-};
-
-/*######
-## npc_rathis_tomber
-######*/
-
-class npc_rathis_tomber : public CreatureScript
-{
-public:
- npc_rathis_tomber() : CreatureScript("npc_rathis_tomber") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_TRADE)
- player->GetSession()->SendListInventory(creature->GetGUID());
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (creature->IsVendor() && player->GetQuestRewardStatus(9152))
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU(8432, creature->GetGUID());
- }else
- player->SEND_GOSSIP_MENU(8431, creature->GetGUID());
-
- return true;
- }
-};
-
-/*######
## npc_ranger_lilatha
######*/
enum RangerLilatha
{
- // Yells
SAY_START = 0,
SAY_PROGRESS1 = 1,
SAY_PROGRESS2 = 2,
@@ -119,18 +47,12 @@ enum RangerLilatha
SAY_END1 = 4,
SAY_END2 = 5,
SAY_CAPTAIN_ANSWER = 0,
-
- // Quests
QUEST_ESCAPE_FROM_THE_CATACOMBS = 9212,
-
- // Gameobjects
GO_CAGE = 181152,
-
- // Creature
NPC_CAPTAIN_HELIOS = 16220,
-
- // Factions
- FACTION_SMOON_E = 1603
+ NPC_MUMMIFIED_HEADHUNTER = 16342,
+ NPC_SHADOWPINE_ORACLE = 16343,
+ FACTION_QUEST_ESCAPE = 113
};
class npc_ranger_lilatha : public CreatureScript
@@ -154,20 +76,20 @@ public:
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_ACTIVE);
- Talk(SAY_START, player->GetGUID());
+ Talk(SAY_START, player);
break;
case 5:
- Talk(SAY_PROGRESS1, player->GetGUID());
+ Talk(SAY_PROGRESS1, player);
break;
case 11:
- Talk(SAY_PROGRESS2, player->GetGUID());
- me->SetOrientation(4.762841f);
+ Talk(SAY_PROGRESS2, player);
+ me->SetFacingTo(4.762841f);
break;
case 18:
{
- Talk(SAY_PROGRESS3, player->GetGUID());
- Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0);
- Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0);
+ Talk(SAY_PROGRESS3, player);
+ Creature* Summ1 = me->SummonCreature(NPC_MUMMIFIED_HEADHUNTER, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0);
+ Creature* Summ2 = me->SummonCreature(NPC_SHADOWPINE_ORACLE, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0);
if (Summ1 && Summ2)
{
Summ1->Attack(me, true);
@@ -186,15 +108,15 @@ public:
player->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me);
break;
case 32:
- me->SetOrientation(2.978281f);
- Talk(SAY_END1, player->GetGUID());
+ me->SetFacingTo(2.978281f);
+ Talk(SAY_END1, player);
break;
case 33:
- me->SetOrientation(5.858011f);
- Talk(SAY_END2, player->GetGUID());
+ me->SetFacingTo(5.858011f);
+ Talk(SAY_END2, player);
Creature* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50);
if (CaptainHelios)
- CaptainHelios->AI()->Talk(SAY_CAPTAIN_ANSWER, player->GetGUID());
+ CaptainHelios->AI()->Talk(SAY_CAPTAIN_ANSWER, player);
break;
}
}
@@ -210,7 +132,7 @@ public:
{
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
{
- creature->setFaction(113);
+ creature->setFaction(FACTION_QUEST_ESCAPE);
if (npc_escortAI* pEscortAI = CAST_AI(npc_ranger_lilatha::npc_ranger_lilathaAI, creature->AI()))
pEscortAI->Start(true, false, player->GetGUID());
@@ -227,7 +149,5 @@ public:
void AddSC_ghostlands()
{
- new npc_budd_nedreck();
- new npc_rathis_tomber();
new npc_ranger_lilatha();
}
diff --git a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
index 257e3c21688..9db6a6b4d19 100644
--- a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@ SDCategory: The Hinterlands
EndScriptData */
/* ContentData
-npc_00x09hl
+npc_oox09hl
npc_rinji
EndContentData */
@@ -34,7 +34,7 @@ EndContentData */
#include "Player.h"
/*######
-## npc_00x09hl
+## npc_oox09hl
######*/
enum OOX
@@ -44,50 +44,47 @@ enum OOX
SAY_OOX_AMBUSH = 2,
SAY_OOX_AMBUSH_REPLY = 3,
SAY_OOX_END = 4,
-
QUEST_RESQUE_OOX_09 = 836,
-
NPC_MARAUDING_OWL = 7808,
NPC_VILE_AMBUSHER = 7809,
-
FACTION_ESCORTEE_A = 774,
FACTION_ESCORTEE_H = 775
};
-class npc_00x09hl : public CreatureScript
+class npc_oox09hl : public CreatureScript
{
public:
- npc_00x09hl() : CreatureScript("npc_00x09hl") { }
+ npc_oox09hl() : CreatureScript("npc_oox09hl") { }
- bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) OVERRIDE
+ struct npc_oox09hlAI : public npc_escortAI
{
- if (quest->GetQuestId() == QUEST_RESQUE_OOX_09)
- {
- creature->SetStandState(UNIT_STAND_STATE_STAND);
+ npc_oox09hlAI(Creature* creature) : npc_escortAI(creature) { }
- if (player->GetTeam() == ALLIANCE)
- creature->setFaction(FACTION_ESCORTEE_A);
- else if (player->GetTeam() == HORDE)
- creature->setFaction(FACTION_ESCORTEE_H);
+ void Reset() OVERRIDE { }
- creature->AI()->Talk(SAY_OOX_START, player->GetGUID());
+ void EnterCombat(Unit* who) OVERRIDE
+ {
+ if (who->GetEntry() == NPC_MARAUDING_OWL || who->GetEntry() == NPC_VILE_AMBUSHER)
+ return;
- if (npc_00x09hlAI* pEscortAI = CAST_AI(npc_00x09hl::npc_00x09hlAI, creature->AI()))
- pEscortAI->Start(false, false, player->GetGUID(), quest);
+ Talk(SAY_OOX_AGGRO);
}
- return true;
- }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_00x09hlAI(creature);
- }
-
- struct npc_00x09hlAI : public npc_escortAI
- {
- npc_00x09hlAI(Creature* creature) : npc_escortAI(creature) { }
+ void JustSummoned(Creature* summoned) OVERRIDE
+ {
+ summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
+ }
- void Reset() OVERRIDE { }
+ void sQuestAccept(Player* player, Quest const* quest)
+ {
+ if (quest->GetQuestId() == QUEST_RESQUE_OOX_09)
+ {
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ me->setFaction(player->GetTeam() == ALLIANCE ? FACTION_ESCORTEE_A : FACTION_ESCORTEE_H);
+ Talk(SAY_OOX_START, player);
+ npc_escortAI::Start(false, false, player->GetGUID(), quest);
+ }
+ }
void WaypointReached(uint32 waypointId) OVERRIDE
{
@@ -107,9 +104,9 @@ public:
}
}
- void WaypointStart(uint32 uiPointId) OVERRIDE
+ void WaypointStart(uint32 pointId) OVERRIDE
{
- switch (uiPointId)
+ switch (pointId)
{
case 27:
for (uint8 i = 0; i < 3; ++i)
@@ -131,20 +128,12 @@ public:
break;
}
}
-
- void EnterCombat(Unit* who) OVERRIDE
- {
- if (who->GetEntry() == NPC_MARAUDING_OWL || who->GetEntry() == NPC_VILE_AMBUSHER)
- return;
-
- Talk(SAY_OOX_AGGRO);
- }
-
- void JustSummoned(Creature* summoned) OVERRIDE
- {
- summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
- }
};
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_oox09hlAI(creature);
+ }
};
/*######
@@ -154,13 +143,11 @@ public:
enum Rinji
{
SAY_RIN_BY_OUTRUNNER = 0,
-
- SAY_RIN_FREE = 0, //from here
+ SAY_RIN_FREE = 0, // from here
SAY_RIN_HELP = 1,
SAY_RIN_COMPLETE = 2,
SAY_RIN_PROGRESS_1 = 3,
SAY_RIN_PROGRESS_2 = 4,
-
QUEST_RINJI_TRAPPED = 2742,
NPC_RANGER = 2694,
NPC_OUTRUNNER = 2691,
@@ -169,19 +156,19 @@ enum Rinji
struct Location
{
- float m_fX, m_fY, m_fZ;
+ float posX, posY, posZ;
};
-Location m_afAmbushSpawn[] =
+Location AmbushSpawn[] =
{
- {191.296204f, -2839.329346f, 107.388f},
- {70.972466f, -2848.674805f, 109.459f}
+ { 191.296204f, -2839.329346f, 107.388f },
+ { 70.972466f, -2848.674805f, 109.459f }
};
-Location m_afAmbushMoveTo[] =
+Location AmbushMoveTo[] =
{
- {166.630386f, -2824.780273f, 108.153f},
- {70.886589f, -2874.335449f, 116.675f}
+ { 166.630386f, -2824.780273f, 108.153f },
+ { 70.886589f, -2874.335449f, 116.675f }
};
class npc_rinji : public CreatureScript
@@ -189,47 +176,24 @@ class npc_rinji : public CreatureScript
public:
npc_rinji() : CreatureScript("npc_rinji") { }
- bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) OVERRIDE
- {
- if (quest->GetQuestId() == QUEST_RINJI_TRAPPED)
- {
- if (GameObject* go = creature->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE))
- go->UseDoorOrButton();
-
- if (npc_rinjiAI* pEscortAI = CAST_AI(npc_rinji::npc_rinjiAI, creature->AI()))
- pEscortAI->Start(false, false, player->GetGUID(), quest);
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_rinjiAI(creature);
- }
-
struct npc_rinjiAI : public npc_escortAI
{
npc_rinjiAI(Creature* creature) : npc_escortAI(creature)
{
- m_bIsByOutrunner = false;
- m_iSpawnId = 0;
+ _IsByOutrunner = false;
+ spawnId = 0;
}
- bool m_bIsByOutrunner;
- uint32 m_uiPostEventCount;
- uint32 m_uiPostEventTimer;
- int m_iSpawnId;
-
void Reset() OVERRIDE
{
- m_uiPostEventCount = 0;
- m_uiPostEventTimer = 3000;
+ postEventCount = 0;
+ postEventTimer = 3000;
}
void JustRespawned() OVERRIDE
{
- m_bIsByOutrunner = false;
- m_iSpawnId = 0;
+ _IsByOutrunner = false;
+ spawnId = 0;
npc_escortAI::JustRespawned();
}
@@ -238,11 +202,11 @@ public:
{
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
- if (who->GetEntry() == NPC_OUTRUNNER && !m_bIsByOutrunner)
+ if (who->GetEntry() == NPC_OUTRUNNER && !_IsByOutrunner)
{
if (Creature* talker = who->ToCreature())
talker->AI()->Talk(SAY_RIN_BY_OUTRUNNER);
- m_bIsByOutrunner = true;
+ _IsByOutrunner = true;
}
if (rand()%4)
@@ -253,19 +217,17 @@ public:
}
}
- void DoSpawnAmbush(bool bFirst)
+ void DoSpawnAmbush(bool _first)
{
- if (!bFirst)
- m_iSpawnId = 1;
+ if (!_first)
+ spawnId = 1;
- me->SummonCreature(NPC_RANGER,
- m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f,
+ me->SummonCreature(NPC_RANGER, AmbushSpawn[spawnId].posX, AmbushSpawn[spawnId].posY, AmbushSpawn[spawnId].posZ, 0.0f,
TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
for (int i = 0; i < 2; ++i)
{
- me->SummonCreature(NPC_OUTRUNNER,
- m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f,
+ me->SummonCreature(NPC_OUTRUNNER, AmbushSpawn[spawnId].posX, AmbushSpawn[spawnId].posY, AmbushSpawn[spawnId].posZ, 0.0f,
TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
}
}
@@ -273,7 +235,18 @@ public:
void JustSummoned(Creature* summoned) OVERRIDE
{
summoned->SetWalk(false);
- summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ);
+ summoned->GetMotionMaster()->MovePoint(0, AmbushMoveTo[spawnId].posX, AmbushMoveTo[spawnId].posY, AmbushMoveTo[spawnId].posZ);
+ }
+
+ void sQuestAccept(Player* player, Quest const* quest)
+ {
+ if (quest->GetQuestId() == QUEST_RINJI_TRAPPED)
+ {
+ if (GameObject* go = me->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE))
+ go->UseDoorOrButton();
+
+ npc_escortAI::Start(false, false, player->GetGUID(), quest);
+ }
}
void WaypointReached(uint32 waypointId) OVERRIDE
@@ -285,7 +258,7 @@ public:
switch (waypointId)
{
case 1:
- Talk(SAY_RIN_FREE, player->GetGUID());
+ Talk(SAY_RIN_FREE, player);
break;
case 7:
DoSpawnAmbush(true);
@@ -294,36 +267,36 @@ public:
DoSpawnAmbush(false);
break;
case 17:
- Talk(SAY_RIN_COMPLETE, player->GetGUID());
+ Talk(SAY_RIN_COMPLETE, player);
player->GroupEventHappens(QUEST_RINJI_TRAPPED, me);
SetRun();
- m_uiPostEventCount = 1;
+ postEventCount = 1;
break;
}
}
- void UpdateEscortAI(const uint32 uiDiff) OVERRIDE
+ void UpdateEscortAI(const uint32 diff) OVERRIDE
{
//Check if we have a current target
if (!UpdateVictim())
{
- if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPostEventCount)
+ if (HasEscortState(STATE_ESCORT_ESCORTING) && postEventCount)
{
- if (m_uiPostEventTimer <= uiDiff)
+ if (postEventTimer <= diff)
{
- m_uiPostEventTimer = 3000;
+ postEventTimer = 3000;
if (Player* player = GetPlayerForEscort())
{
- switch (m_uiPostEventCount)
+ switch (postEventCount)
{
case 1:
- Talk(SAY_RIN_PROGRESS_1, player->GetGUID());
- ++m_uiPostEventCount;
+ Talk(SAY_RIN_PROGRESS_1, player);
+ ++postEventCount;
break;
case 2:
- Talk(SAY_RIN_PROGRESS_2, player->GetGUID());
- m_uiPostEventCount = 0;
+ Talk(SAY_RIN_PROGRESS_2, player);
+ postEventCount = 0;
break;
}
}
@@ -334,19 +307,28 @@ public:
}
}
else
- m_uiPostEventTimer -= uiDiff;
+ postEventTimer -= diff;
}
-
return;
}
-
DoMeleeAttackIfReady();
}
+
+ private:
+ uint32 postEventCount;
+ uint32 postEventTimer;
+ int spawnId;
+ bool _IsByOutrunner;
};
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_rinjiAI(creature);
+ }
};
void AddSC_hinterlands()
{
- new npc_00x09hl();
+ new npc_oox09hl();
new npc_rinji();
}
diff --git a/src/server/scripts/EasternKingdoms/zone_ironforge.cpp b/src/server/scripts/EasternKingdoms/zone_ironforge.cpp
index 90271c5658c..e50bbb9f3e0 100644
--- a/src/server/scripts/EasternKingdoms/zone_ironforge.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_ironforge.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp
index 50b230b836d..65c070ffcf1 100644
--- a/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/zone_loch_modan.cpp b/src/server/scripts/EasternKingdoms/zone_loch_modan.cpp
index afdfa496f7c..af0ec5aa4f5 100644
--- a/src/server/scripts/EasternKingdoms/zone_loch_modan.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_loch_modan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp
index 604d51f9d8f..08028cc5872 100644
--- a/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -29,15 +29,13 @@ Script Data End */
enum CorporalKeeshan
{
QUEST_MISSING_IN_ACTION = 219,
-
- SAY_CORPORAL_1 = 0,
- SAY_CORPORAL_2 = 1,
- SAY_CORPORAL_3 = 2,
- SAY_CORPORAL_4 = 3,
- SAY_CORPORAL_5 = 4,
-
- SPELL_MOCKING_BLOW = 21008,
- SPELL_SHIELD_BASH = 11972,
+ SAY_CORPORAL_1 = 0,
+ SAY_CORPORAL_2 = 1,
+ SAY_CORPORAL_3 = 2,
+ SAY_CORPORAL_4 = 3,
+ SAY_CORPORAL_5 = 4,
+ SPELL_MOCKING_BLOW = 21008,
+ SPELL_SHIELD_BASH = 11972
};
class npc_corporal_keeshan : public CreatureScript
@@ -45,37 +43,25 @@ class npc_corporal_keeshan : public CreatureScript
public:
npc_corporal_keeshan() : CreatureScript("npc_corporal_keeshan") { }
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
- {
- if (quest->GetQuestId() == QUEST_MISSING_IN_ACTION)
- {
- CAST_AI(npc_corporal_keeshan::npc_corporal_keeshanAI, creature->AI())->Start(true, false, player->GetGUID(), quest);
- creature->AI()->Talk(SAY_CORPORAL_1);
- }
-
- return false;
- }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_corporal_keeshanAI(creature);
- }
-
struct npc_corporal_keeshanAI : public npc_escortAI
{
npc_corporal_keeshanAI(Creature* creature) : npc_escortAI(creature) { }
- uint32 uiPhase;
- uint32 uiTimer;
- uint32 uiMockingBlowTimer;
- uint32 uiShieldBashTimer;
-
void Reset() OVERRIDE
{
- uiTimer = 0;
- uiPhase = 0;
- uiMockingBlowTimer = 5000;
- uiShieldBashTimer = 8000;
+ timer = 0;
+ phase = 0;
+ mockingBlowTimer = 5000;
+ shieldBashTimer = 8000;
+ }
+
+ void sQuestAccept(Player* player, Quest const* quest)
+ {
+ if (quest->GetQuestId() == QUEST_MISSING_IN_ACTION)
+ {
+ Talk(SAY_CORPORAL_1, player);
+ npc_escortAI::Start(true, false, player->GetGUID(), quest);
+ }
}
void WaypointReached(uint32 waypointId) OVERRIDE
@@ -91,82 +77,93 @@ public:
{
case 39:
SetEscortPaused(true);
- uiTimer = 2000;
- uiPhase = 1;
+ timer = 2000;
+ phase = 1;
break;
case 65:
me->SetWalk(false);
break;
case 115:
player->AreaExploredOrEventHappens(QUEST_MISSING_IN_ACTION);
- uiTimer = 2000;
- uiPhase = 4;
+ timer = 2000;
+ phase = 4;
break;
}
}
- void UpdateAI(uint32 uiDiff) OVERRIDE
+ void UpdateAI(uint32 diff) OVERRIDE
{
if (HasEscortState(STATE_ESCORT_NONE))
return;
- npc_escortAI::UpdateAI(uiDiff);
+ npc_escortAI::UpdateAI(diff);
- if (uiPhase)
+ if (phase)
{
- if (uiTimer <= uiDiff)
+ if (timer <= diff)
{
- switch (uiPhase)
+ switch (phase)
{
case 1:
me->SetStandState(UNIT_STAND_STATE_SIT);
- uiTimer = 1000;
- uiPhase = 2;
+ timer = 1000;
+ phase = 2;
break;
case 2:
Talk(SAY_CORPORAL_2);
- uiTimer = 15000;
- uiPhase = 3;
+ timer = 15000;
+ phase = 3;
break;
case 3:
Talk(SAY_CORPORAL_3);
me->SetStandState(UNIT_STAND_STATE_STAND);
SetEscortPaused(false);
- uiTimer = 0;
- uiPhase = 0;
+ timer = 0;
+ phase = 0;
break;
case 4:
Talk(SAY_CORPORAL_4);
- uiTimer = 2500;
- uiPhase = 5;
+ timer = 2500;
+ phase = 5;
break;
case 5:
Talk(SAY_CORPORAL_5);
- uiTimer = 0;
- uiPhase = 0;
+ timer = 0;
+ phase = 0;
break;
}
- } else uiTimer -= uiDiff;
+ } else timer -= diff;
}
if (!UpdateVictim())
return;
- if (uiMockingBlowTimer <= uiDiff)
+ if (mockingBlowTimer <= diff)
{
DoCastVictim(SPELL_MOCKING_BLOW);
- uiMockingBlowTimer = 5000;
- } else uiMockingBlowTimer -= uiDiff;
+ mockingBlowTimer = 5000;
+ } else mockingBlowTimer -= diff;
- if (uiShieldBashTimer <= uiDiff)
+ if (shieldBashTimer <= diff)
{
DoCastVictim(SPELL_MOCKING_BLOW);
- uiShieldBashTimer = 8000;
- } else uiShieldBashTimer -= uiDiff;
+ shieldBashTimer = 8000;
+ } else shieldBashTimer -= diff;
DoMeleeAttackIfReady();
}
+
+ private:
+ uint32 phase;
+ uint32 timer;
+ uint32 mockingBlowTimer;
+ uint32 shieldBashTimer;
};
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_corporal_keeshanAI(creature);
+ }
};
void AddSC_redridge_mountains()
diff --git a/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp
index 757f2bcff2c..b7ab4227e5e 100644
--- a/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -76,13 +76,13 @@ public:
switch (waypointId)
{
case 1:
- Talk(SAY_START, player->GetGUID());
+ Talk(SAY_START, player);
break;
case 10:
Talk(SAY_PROGRESS);
break;
case 13:
- Talk(SAY_LAST, player->GetGUID());
+ Talk(SAY_LAST, player);
player->GroupEventHappens(QUEST_ESCORTING, me);
break;
case 15:
@@ -112,7 +112,7 @@ public:
void EnterCombat(Unit* who) OVERRIDE
{
- Talk(SAY_AGGRO, who->GetGUID());
+ Talk(SAY_AGGRO, who);
}
};
@@ -120,7 +120,7 @@ public:
{
if (quest->GetQuestId() == QUEST_ESCORTING)
{
- creature->AI()->Talk(SAY_QUESTACCEPT, player->GetGUID());
+ creature->AI()->Talk(SAY_QUESTACCEPT, player);
if (npc_escortAI* pEscortAI = CAST_AI(npc_deathstalker_erland::npc_deathstalker_erlandAI, creature->AI()))
pEscortAI->Start(true, false, player->GetGUID());
@@ -273,7 +273,7 @@ public:
{
case 0:
if (WaitTimer == WAIT_SECS)
- me->MonsterSay(NPCSAY_INIT, LANG_UNIVERSAL, 0); //no blizzlike
+ me->MonsterSay(NPCSAY_INIT, LANG_UNIVERSAL, NULL); //no blizzlike
if (WaitTimer <= diff)
{
@@ -303,7 +303,7 @@ public:
{
if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID))
{
- me->MonsterSay(NPCSAY_END, LANG_UNIVERSAL, 0); //not blizzlike
+ me->MonsterSay(NPCSAY_END, LANG_UNIVERSAL, NULL); //not blizzlike
player->GroupEventHappens(QUEST_PYREWOOD_AMBUSH, me);
}
}
diff --git a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
index e4eca2c387f..4bfbff50dd5 100644
--- a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp
index 91bf802abf7..6cfef015450 100644
--- a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp
index bec49e0f15c..9232a7962e3 100644
--- a/src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -28,59 +28,46 @@
enum Galen
{
QUEST_GALENS_ESCAPE = 1393,
-
GO_GALENS_CAGE = 37118,
-
SAY_PERIODIC = 0,
SAY_QUEST_ACCEPTED = 1,
SAY_ATTACKED = 2,
SAY_QUEST_COMPLETE = 3,
EMOTE_WHISPER = 4,
- EMOTE_DISAPPEAR = 5,
+ EMOTE_DISAPPEAR = 5
};
class npc_galen_goodward : public CreatureScript
{
public:
-
npc_galen_goodward() : CreatureScript("npc_galen_goodward") { }
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
- {
- if (quest->GetQuestId() == QUEST_GALENS_ESCAPE)
- {
- CAST_AI(npc_galen_goodward::npc_galen_goodwardAI, creature->AI())->Start(false, false, player->GetGUID());
- creature->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE);
- creature->AI()->Talk(SAY_QUEST_ACCEPTED);
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_galen_goodwardAI(creature);
- }
-
struct npc_galen_goodwardAI : public npc_escortAI
{
npc_galen_goodwardAI(Creature* creature) : npc_escortAI(creature)
{
- m_uiGalensCageGUID = 0;
+ galensCageGUID = 0;
Reset();
}
- uint64 m_uiGalensCageGUID;
- uint32 m_uiPeriodicSay;
-
void Reset() OVERRIDE
{
- m_uiPeriodicSay = 6000;
+ periodicSay = 6000;
}
void EnterCombat(Unit* who) OVERRIDE
{
if (HasEscortState(STATE_ESCORT_ESCORTING))
- Talk(SAY_ATTACKED, who->GetGUID());
+ Talk(SAY_ATTACKED, who);
+ }
+
+ void sQuestAccept(Player* player, Quest const* quest)
+ {
+ if (quest->GetQuestId() == QUEST_GALENS_ESCAPE)
+ {
+ Talk(SAY_QUEST_ACCEPTED, player);
+ npc_escortAI::Start(false, false, player->GetGUID(), quest);
+ }
}
void WaypointStart(uint32 uiPointId) OVERRIDE
@@ -89,15 +76,15 @@ public:
{
case 0:
{
- GameObject* pCage = NULL;
- if (m_uiGalensCageGUID)
- pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID);
+ GameObject* cage = NULL;
+ if (galensCageGUID)
+ cage = me->GetMap()->GetGameObject(galensCageGUID);
else
- pCage = GetClosestGameObjectWithEntry(me, GO_GALENS_CAGE, INTERACTION_DISTANCE);
- if (pCage)
+ cage = GetClosestGameObjectWithEntry(me, GO_GALENS_CAGE, INTERACTION_DISTANCE);
+ if (cage)
{
- pCage->UseDoorOrButton();
- m_uiGalensCageGUID = pCage->GetGUID();
+ cage->UseDoorOrButton();
+ galensCageGUID = cage->GetGUID();
}
break;
}
@@ -112,15 +99,15 @@ public:
switch (waypointId)
{
case 0:
- if (GameObject* pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID))
- pCage->ResetDoorOrButton();
+ if (GameObject* cage = me->GetMap()->GetGameObject(galensCageGUID))
+ cage->ResetDoorOrButton();
break;
case 20:
if (Player* player = GetPlayerForEscort())
{
me->SetFacingToObject(player);
- Talk(SAY_QUEST_COMPLETE, player->GetGUID());
- Talk(EMOTE_WHISPER, player->GetGUID());
+ Talk(SAY_QUEST_COMPLETE, player);
+ Talk(EMOTE_WHISPER, player);
player->GroupEventHappens(QUEST_GALENS_ESCAPE, me);
}
SetRun(true);
@@ -128,25 +115,34 @@ public:
}
}
- void UpdateAI(uint32 uiDiff) OVERRIDE
+ void UpdateAI(uint32 diff) OVERRIDE
{
- npc_escortAI::UpdateAI(uiDiff);
+ npc_escortAI::UpdateAI(diff);
if (HasEscortState(STATE_ESCORT_NONE))
return;
- if (m_uiPeriodicSay < uiDiff)
+ if (periodicSay < diff)
{
if (!HasEscortState(STATE_ESCORT_ESCORTING))
Talk(SAY_PERIODIC);
- m_uiPeriodicSay = 15000;
+ periodicSay = 15000;
}
else
- m_uiPeriodicSay -= uiDiff;
+ periodicSay -= diff;
DoMeleeAttackIfReady();
}
+
+ private:
+ uint64 galensCageGUID;
+ uint32 periodicSay;
};
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_galen_goodwardAI(creature);
+ }
};
void AddSC_swamp_of_sorrows()
diff --git a/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp
index 7cf7b69a0bc..925d0d73a70 100644
--- a/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/zone_undercity.cpp b/src/server/scripts/EasternKingdoms/zone_undercity.cpp
index d205fe8cb40..652189a8eea 100644
--- a/src/server/scripts/EasternKingdoms/zone_undercity.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_undercity.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp
index 6b409012cb0..56961d2fb02 100644
--- a/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -371,18 +371,18 @@ public:
if (Ughost)
{
Ughost->SetDisableGravity(true);
- Ughost->AI()->Talk(SAY_WP_4, me->GetGUID());
+ Ughost->AI()->Talk(SAY_WP_4, me);
}
m_uiChatTimer = 4000;
break;
case 24:
if (Ughost)
- Ughost->AI()->Talk(SAY_WP_5, me->GetGUID());
+ Ughost->AI()->Talk(SAY_WP_5, me);
m_uiChatTimer = 4000;
break;
case 25:
if (Ughost)
- Ughost->AI()->Talk(SAY_WP_6, me->GetGUID());
+ Ughost->AI()->Talk(SAY_WP_6, me);
m_uiChatTimer = 4000;
break;
case 26:
diff --git a/src/server/scripts/EasternKingdoms/zone_westfall.cpp b/src/server/scripts/EasternKingdoms/zone_westfall.cpp
index 3869ee5bbb5..350ceead706 100644
--- a/src/server/scripts/EasternKingdoms/zone_westfall.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_westfall.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -228,7 +228,7 @@ public:
if (npc_escortAI* pEscortAI = CAST_AI(npc_defias_traitor::npc_defias_traitorAI, creature->AI()))
pEscortAI->Start(true, true, player->GetGUID());
- creature->AI()->Talk(SAY_START, player->GetGUID());
+ creature->AI()->Talk(SAY_START, player);
}
return true;
@@ -255,10 +255,10 @@ public:
SetRun(false);
break;
case 36:
- Talk(SAY_PROGRESS, player->GetGUID());
+ Talk(SAY_PROGRESS, player);
break;
case 44:
- Talk(SAY_END, player->GetGUID());
+ Talk(SAY_END, player);
player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me);
break;
}
@@ -266,7 +266,7 @@ public:
void EnterCombat(Unit* who) OVERRIDE
{
- Talk(SAY_AGGRO, who->GetGUID());
+ Talk(SAY_AGGRO, who);
}
void Reset() OVERRIDE { }
diff --git a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp
index dc4154c3d3e..a7feb2b7c43 100644
--- a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Events/CMakeLists.txt b/src/server/scripts/Events/CMakeLists.txt
index 8f40bbd75a9..e45bc585007 100644
--- a/src/server/scripts/Events/CMakeLists.txt
+++ b/src/server/scripts/Events/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/scripts/Events/childrens_week.cpp b/src/server/scripts/Events/childrens_week.cpp
index 75c5ef797e1..92e70cd028b 100644
--- a/src/server/scripts/Events/childrens_week.cpp
+++ b/src/server/scripts/Events/childrens_week.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Examples/CMakeLists.txt b/src/server/scripts/Examples/CMakeLists.txt
index f69182dd0f4..2688fe4174d 100644
--- a/src/server/scripts/Examples/CMakeLists.txt
+++ b/src/server/scripts/Examples/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/scripts/Examples/example_commandscript.cpp b/src/server/scripts/Examples/example_commandscript.cpp
index 0c10cec5155..eb87a58be77 100644
--- a/src/server/scripts/Examples/example_commandscript.cpp
+++ b/src/server/scripts/Examples/example_commandscript.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Examples/example_creature.cpp b/src/server/scripts/Examples/example_creature.cpp
index b13ec1e1503..1ef0290af53 100644
--- a/src/server/scripts/Examples/example_creature.cpp
+++ b/src/server/scripts/Examples/example_creature.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -128,7 +128,7 @@ class example_creature : public CreatureScript
void EnterCombat(Unit* who) OVERRIDE
{
//Say some stuff
- Talk(SAY_AGGRO, who->GetGUID());
+ Talk(SAY_AGGRO, who);
}
// *** HANDLED FUNCTION ***
@@ -236,7 +236,7 @@ class example_creature : public CreatureScript
if (m_uiBeserkTimer <= uiDiff)
{
//Say our line then cast uber death spell
- Talk(SAY_BERSERK, me->GetVictim() ? me->GetVictim()->GetGUID() : 0);
+ Talk(SAY_BERSERK, me->GetVictim());
DoCastVictim(SPELL_BERSERK);
//Cast our beserk spell agian in 12 seconds if we didn't kill everyone
diff --git a/src/server/scripts/Examples/example_escort.cpp b/src/server/scripts/Examples/example_escort.cpp
index 8cbd2fc4933..57fe27ad041 100644
--- a/src/server/scripts/Examples/example_escort.cpp
+++ b/src/server/scripts/Examples/example_escort.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -100,9 +100,9 @@ class example_escort : public CreatureScript
if (Player* player = GetPlayerForEscort())
{
//pTmpPlayer is the target of the text
- Talk(SAY_WP_3, player->GetGUID());
+ Talk(SAY_WP_3, player);
//pTmpPlayer is the source of the text
- sCreatureTextMgr->SendChat(me, SAY_WP_4, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player);
+ sCreatureTextMgr->SendChat(me, SAY_WP_4, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player);
}
break;
}
@@ -113,7 +113,7 @@ class example_escort : public CreatureScript
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
if (Player* player = GetPlayerForEscort())
- Talk(SAY_AGGRO1, player->GetGUID());
+ Talk(SAY_AGGRO1, player);
}
else
Talk(SAY_AGGRO2);
@@ -133,9 +133,9 @@ class example_escort : public CreatureScript
{
// not a likely case, code here for the sake of example
if (killer == me)
- Talk(SAY_DEATH_1, player->GetGUID());
+ Talk(SAY_DEATH_1, player);
else
- Talk(SAY_DEATH_2, player->GetGUID());
+ Talk(SAY_DEATH_2, player);
}
}
else
diff --git a/src/server/scripts/Examples/example_gossip_codebox.cpp b/src/server/scripts/Examples/example_gossip_codebox.cpp
index 90aae21f807..4ab39f429b1 100644
--- a/src/server/scripts/Examples/example_gossip_codebox.cpp
+++ b/src/server/scripts/Examples/example_gossip_codebox.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Examples/example_misc.cpp b/src/server/scripts/Examples/example_misc.cpp
index 980d52c729c..938a5f9e623 100644
--- a/src/server/scripts/Examples/example_misc.cpp
+++ b/src/server/scripts/Examples/example_misc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Examples/example_spell.cpp b/src/server/scripts/Examples/example_spell.cpp
index 2c76d9a40b0..9bf91d08ac0 100644
--- a/src/server/scripts/Examples/example_spell.cpp
+++ b/src/server/scripts/Examples/example_spell.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -220,7 +220,7 @@ class spell_ex_66244 : public SpellScriptLoader
// we initialize local variables if needed
bool Load() OVERRIDE
{
- // do not load script if aura is casted by player or caster not avalible
+ // do not load script if aura is cast by player or caster not avalible
if (Unit* caster = GetCaster())
if (caster->GetTypeId() == TYPEID_PLAYER)
return true;
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
index e74ed93bc66..c7ef191cf8f 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -73,7 +73,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_blackfathom_deeps_eventAI(creature);
+ return GetInstanceAI<npc_blackfathom_deeps_eventAI>(creature);
}
struct npc_blackfathom_deeps_eventAI : public ScriptedAI
@@ -182,8 +182,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
if (me->IsSummon()) //we are not a normal spawn.
- if (instance)
- instance->SetData(DATA_EVENT, instance->GetData(DATA_EVENT) + 1);
+ instance->SetData(DATA_EVENT, instance->GetData(DATA_EVENT) + 1);
}
};
};
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h
index 46deda8e4c8..07a388043a6 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp
index 579bb7a8e95..dfff92b8f05 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp
index 139eed963c1..8d2ced59276 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -31,7 +31,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_gelihastAI(creature);
+ return GetInstanceAI<boss_gelihastAI>(creature);
}
struct boss_gelihastAI : public ScriptedAI
@@ -48,20 +48,17 @@ public:
void Reset() OVERRIDE
{
netTimer = urand(2000, 4000);
- if (instance)
- instance->SetData(TYPE_GELIHAST, NOT_STARTED);
+ instance->SetData(TYPE_GELIHAST, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetData(TYPE_GELIHAST, IN_PROGRESS);
+ instance->SetData(TYPE_GELIHAST, IN_PROGRESS);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(TYPE_GELIHAST, DONE);
+ instance->SetData(TYPE_GELIHAST, DONE);
}
void UpdateAI(uint32 diff) OVERRIDE
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp
index 8eeedb6e15f..3ded27bd42a 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -36,7 +36,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_kelrisAI(creature);
+ return GetInstanceAI<boss_kelrisAI>(creature);
}
struct boss_kelrisAI : public ScriptedAI
@@ -55,22 +55,19 @@ public:
{
mindBlastTimer = urand(2000, 5000);
sleepTimer = urand(9000, 12000);
- if (instance)
- instance->SetData(TYPE_KELRIS, NOT_STARTED);
+ instance->SetData(TYPE_KELRIS, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(TYPE_KELRIS, IN_PROGRESS);
+ instance->SetData(TYPE_KELRIS, IN_PROGRESS);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(TYPE_KELRIS, DONE);
+ instance->SetData(TYPE_KELRIS, DONE);
}
void UpdateAI(uint32 diff) OVERRIDE
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
index b1d3dba105e..2c9c94d9724 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt
index 17c360a54b2..1adc8a53271 100644
--- a/src/server/scripts/Kalimdor/CMakeLists.txt
+++ b/src/server/scripts/Kalimdor/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
@@ -15,12 +15,15 @@ set(scripts_STAT_SRCS
Kalimdor/zone_moonglade.cpp
Kalimdor/RazorfenDowns/razorfen_downs.cpp
Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp
+ Kalimdor/RazorfenDowns/boss_tuten_kash.cpp
+ Kalimdor/RazorfenDowns/boss_mordresh_fire_eye.cpp
+ Kalimdor/RazorfenDowns/boss_glutton.cpp
Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp
Kalimdor/RazorfenDowns/razorfen_downs.h
- Kalimdor/ZulFarrak/zulfarrak.h
Kalimdor/ZulFarrak/zulfarrak.cpp
Kalimdor/ZulFarrak/instance_zulfarrak.cpp
Kalimdor/ZulFarrak/boss_zum_rah.cpp
+ Kalimdor/ZulFarrak/zulfarrak.h
Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp
Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h
Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp
index 164de89b017..a4f9a364684 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -47,7 +47,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_anetheronAI(creature);
+ return GetInstanceAI<boss_anetheronAI>(creature);
}
struct boss_anetheronAI : public hyjal_trashAI
@@ -83,9 +83,10 @@ public:
Talk(SAY_ONAGGRO);
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_ONSLAY);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_ONSLAY);
}
void WaypointReached(uint32 waypointId) OVERRIDE
@@ -115,19 +116,16 @@ public:
if (!go)
{
go = true;
- if (instance)
- {
- AddWaypoint(0, 4896.08f, -1576.35f, 1333.65f);
- AddWaypoint(1, 4898.68f, -1615.02f, 1329.48f);
- AddWaypoint(2, 4907.12f, -1667.08f, 1321.00f);
- AddWaypoint(3, 4963.18f, -1699.35f, 1340.51f);
- AddWaypoint(4, 4989.16f, -1716.67f, 1335.74f);
- AddWaypoint(5, 5026.27f, -1736.89f, 1323.02f);
- AddWaypoint(6, 5037.77f, -1770.56f, 1324.36f);
- AddWaypoint(7, 5067.23f, -1789.95f, 1321.17f);
- Start(false, true);
- SetDespawnAtEnd(false);
- }
+ AddWaypoint(0, 4896.08f, -1576.35f, 1333.65f);
+ AddWaypoint(1, 4898.68f, -1615.02f, 1329.48f);
+ AddWaypoint(2, 4907.12f, -1667.08f, 1321.00f);
+ AddWaypoint(3, 4963.18f, -1699.35f, 1340.51f);
+ AddWaypoint(4, 4989.16f, -1716.67f, 1335.74f);
+ AddWaypoint(5, 5026.27f, -1736.89f, 1323.02f);
+ AddWaypoint(6, 5037.77f, -1770.56f, 1324.36f);
+ AddWaypoint(7, 5067.23f, -1789.95f, 1321.17f);
+ Start(false, true);
+ SetDespawnAtEnd(false);
}
}
@@ -179,7 +177,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_towering_infernalAI(creature);
+ return GetInstanceAI<npc_towering_infernalAI>(creature);
}
struct npc_towering_infernalAI : public ScriptedAI
@@ -187,8 +185,7 @@ public:
npc_towering_infernalAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
- if (instance)
- AnetheronGUID = instance->GetData64(DATA_ANETHERON);
+ AnetheronGUID = instance->GetData64(DATA_ANETHERON);
}
uint32 ImmolationTimer;
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp
index 41cc1d0241d..4fa9af466b1 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -83,7 +83,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ancient_wispAI(creature);
+ return GetInstanceAI<npc_ancient_wispAI>(creature);
}
struct npc_ancient_wispAI : public ScriptedAI
@@ -102,8 +102,7 @@ public:
{
CheckTimer = 1000;
- if (instance)
- ArchimondeGUID = instance->GetData64(DATA_ARCHIMONDE);
+ ArchimondeGUID = instance->GetData64(DATA_ARCHIMONDE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
@@ -239,7 +238,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_archimondeAI(creature);
+ return GetInstanceAI<boss_archimondeAI>(creature);
}
struct boss_archimondeAI : public hyjal_trashAI
@@ -275,8 +274,7 @@ public:
void Reset() OVERRIDE
{
- if (instance)
- instance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED);
+ instance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED);
DoomfireSpiritGUID = 0;
damageTaken = 0;
@@ -308,8 +306,7 @@ public:
Talk(SAY_AGGRO);
DoZoneInCombat();
- if (instance)
- instance->SetData(DATA_ARCHIMONDEEVENT, IN_PROGRESS);
+ instance->SetData(DATA_ARCHIMONDEEVENT, IN_PROGRESS);
}
void KilledUnit(Unit* victim) OVERRIDE
@@ -350,8 +347,7 @@ public:
hyjal_trashAI::JustDied(killer);
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_ARCHIMONDEEVENT, DONE);
+ instance->SetData(DATA_ARCHIMONDEEVENT, DONE);
}
bool CanUseFingerOfDeath()
@@ -471,19 +467,16 @@ public:
{
if (!me->IsInCombat())
{
- if (instance)
+ // Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished.
+ if ((instance->GetData(DATA_AZGALOREVENT) < DONE) && (me->IsVisible() || (me->getFaction() != 35)))
{
- // Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished.
- if ((instance->GetData(DATA_AZGALOREVENT) < DONE) && (me->IsVisible() || (me->getFaction() != 35)))
- {
- me->SetVisible(false);
- me->setFaction(35);
- }
- else if ((instance->GetData(DATA_AZGALOREVENT) >= DONE) && (!me->IsVisible() || (me->getFaction() == 35)))
- {
- me->setFaction(1720);
- me->SetVisible(true);
- }
+ me->SetVisible(false);
+ me->setFaction(35);
+ }
+ else if ((instance->GetData(DATA_AZGALOREVENT) >= DONE) && (!me->IsVisible() || (me->getFaction() == 35)))
+ {
+ me->setFaction(1720);
+ me->SetVisible(true);
}
if (DrainNordrassilTimer <= diff)
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp
index aaf2bb65ba0..6d296945659 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -48,7 +48,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_azgalorAI(creature);
+ return GetInstanceAI<boss_azgalorAI>(creature);
}
struct boss_azgalorAI : public hyjal_trashAI
@@ -121,19 +121,16 @@ public:
if (!go)
{
go = true;
- if (instance)
- {
- AddWaypoint(0, 5492.91f, -2404.61f, 1462.63f);
- AddWaypoint(1, 5531.76f, -2460.87f, 1469.55f);
- AddWaypoint(2, 5554.58f, -2514.66f, 1476.12f);
- AddWaypoint(3, 5554.16f, -2567.23f, 1479.90f);
- AddWaypoint(4, 5540.67f, -2625.99f, 1480.89f);
- AddWaypoint(5, 5508.16f, -2659.2f, 1480.15f);
- AddWaypoint(6, 5489.62f, -2704.05f, 1482.18f);
- AddWaypoint(7, 5457.04f, -2726.26f, 1485.10f);
- Start(false, true);
- SetDespawnAtEnd(false);
- }
+ AddWaypoint(0, 5492.91f, -2404.61f, 1462.63f);
+ AddWaypoint(1, 5531.76f, -2460.87f, 1469.55f);
+ AddWaypoint(2, 5554.58f, -2514.66f, 1476.12f);
+ AddWaypoint(3, 5554.16f, -2567.23f, 1479.90f);
+ AddWaypoint(4, 5540.67f, -2625.99f, 1480.89f);
+ AddWaypoint(5, 5508.16f, -2659.2f, 1480.15f);
+ AddWaypoint(6, 5489.62f, -2704.05f, 1482.18f);
+ AddWaypoint(7, 5457.04f, -2726.26f, 1485.10f);
+ Start(false, true);
+ SetDespawnAtEnd(false);
}
}
@@ -186,7 +183,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_lesser_doomguardAI(creature);
+ return GetInstanceAI<npc_lesser_doomguardAI>(creature);
}
struct npc_lesser_doomguardAI : public hyjal_trashAI
@@ -194,8 +191,7 @@ public:
npc_lesser_doomguardAI(Creature* creature) : hyjal_trashAI(creature)
{
instance = creature->GetInstanceScript();
- if (instance)
- AzgalorGUID = instance->GetData64(DATA_AZGALOR);
+ AzgalorGUID = instance->GetData64(DATA_AZGALOR);
}
uint32 CrippleTimer;
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp
index 66e276d25b6..7a5870809f7 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -49,7 +49,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_kazrogalAI(creature);
+ return GetInstanceAI<boss_kazrogalAI>(creature);
}
struct boss_kazrogalAI : public hyjal_trashAI
@@ -117,19 +117,16 @@ public:
if (!go)
{
go = true;
- if (instance)
- {
- AddWaypoint(0, 5492.91f, -2404.61f, 1462.63f);
- AddWaypoint(1, 5531.76f, -2460.87f, 1469.55f);
- AddWaypoint(2, 5554.58f, -2514.66f, 1476.12f);
- AddWaypoint(3, 5554.16f, -2567.23f, 1479.90f);
- AddWaypoint(4, 5540.67f, -2625.99f, 1480.89f);
- AddWaypoint(5, 5508.16f, -2659.2f, 1480.15f);
- AddWaypoint(6, 5489.62f, -2704.05f, 1482.18f);
- AddWaypoint(7, 5457.04f, -2726.26f, 1485.10f);
- Start(false, true);
- SetDespawnAtEnd(false);
- }
+ AddWaypoint(0, 5492.91f, -2404.61f, 1462.63f);
+ AddWaypoint(1, 5531.76f, -2460.87f, 1469.55f);
+ AddWaypoint(2, 5554.58f, -2514.66f, 1476.12f);
+ AddWaypoint(3, 5554.16f, -2567.23f, 1479.90f);
+ AddWaypoint(4, 5540.67f, -2625.99f, 1480.89f);
+ AddWaypoint(5, 5508.16f, -2659.2f, 1480.15f);
+ AddWaypoint(6, 5489.62f, -2704.05f, 1482.18f);
+ AddWaypoint(7, 5457.04f, -2726.26f, 1485.10f);
+ Start(false, true);
+ SetDespawnAtEnd(false);
}
}
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 c163e7c0f1f..4d6a94b6e73 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -44,7 +44,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_rage_winterchillAI(creature);
+ return GetInstanceAI<boss_rage_winterchillAI>(creature);
}
struct boss_rage_winterchillAI : public hyjal_trashAI
@@ -112,19 +112,16 @@ public:
if (!go)
{
go = true;
- if (instance)
- {
- AddWaypoint(0, 4896.08f, -1576.35f, 1333.65f);
- AddWaypoint(1, 4898.68f, -1615.02f, 1329.48f);
- AddWaypoint(2, 4907.12f, -1667.08f, 1321.00f);
- AddWaypoint(3, 4963.18f, -1699.35f, 1340.51f);
- AddWaypoint(4, 4989.16f, -1716.67f, 1335.74f);
- AddWaypoint(5, 5026.27f, -1736.89f, 1323.02f);
- AddWaypoint(6, 5037.77f, -1770.56f, 1324.36f);
- AddWaypoint(7, 5067.23f, -1789.95f, 1321.17f);
- Start(false, true);
- SetDespawnAtEnd(false);
- }
+ AddWaypoint(0, 4896.08f, -1576.35f, 1333.65f);
+ AddWaypoint(1, 4898.68f, -1615.02f, 1329.48f);
+ AddWaypoint(2, 4907.12f, -1667.08f, 1321.00f);
+ AddWaypoint(3, 4963.18f, -1699.35f, 1340.51f);
+ AddWaypoint(4, 4989.16f, -1716.67f, 1335.74f);
+ AddWaypoint(5, 5026.27f, -1736.89f, 1323.02f);
+ AddWaypoint(6, 5037.77f, -1770.56f, 1324.36f);
+ AddWaypoint(7, 5067.23f, -1789.95f, 1321.17f);
+ Start(false, true);
+ SetDespawnAtEnd(false);
}
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp
index f4d3f559585..4419973902a 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -102,6 +102,9 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
+ if (!creature->GetInstanceScript())
+ return NULL;
+
hyjalAI* ai = new hyjalAI(creature);
ai->Reset();
@@ -184,6 +187,9 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
+ if (!creature->GetInstanceScript())
+ return NULL;
+
hyjalAI* ai = new hyjalAI(creature);
ai->Reset();
@@ -209,6 +215,9 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
+ if (!creature->GetInstanceScript())
+ return NULL;
+
hyjalAI* ai = new hyjalAI(creature);
ai->Reset();
ai->EnterEvadeMode();
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h
index 1f510ebec73..7ea09d2cda1 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
index 4a491803cb4..3b3cacf7d3f 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -397,17 +397,14 @@ void hyjalAI::Reset()
memset(Spells, 0, sizeof(Spell) * HYJAL_AI_MAX_SPELLS);
//Reset Instance Data for trash count
- if (instance)
+ if ((!instance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == JAINA) || (instance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == THRALL))
{
- if ((!instance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == JAINA) || (instance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == THRALL))
- {
- //Reset World States
- instance->DoUpdateWorldState(WORLD_STATE_WAVES, 0);
- instance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0);
- instance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0);
- instance->SetData(DATA_RESET_TRASH_COUNT, 0);
- }
- } else TC_LOG_ERROR("scripts", ERROR_INST_DATA);
+ //Reset World States
+ instance->DoUpdateWorldState(WORLD_STATE_WAVES, 0);
+ instance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0);
+ instance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0);
+ instance->SetData(DATA_RESET_TRASH_COUNT, 0);
+ }
//Visibility
DoHide = true;
@@ -517,11 +514,8 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
CAST_AI(hyjal_trashAI, creature->AI())->IsEvent = true;
break;
}
- if (instance)
- {
- if (instance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE)
- creature->SetDisableReputationGain(true);//no repu for solo farming
- }
+ if (instance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE)
+ creature->SetDisableReputationGain(true);//no repu for solo farming
// Check if Creature is a boss.
if (creature->isWorldBoss())
{
@@ -538,11 +532,6 @@ void hyjalAI::SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3]
if (rand()%4 == 0)
Talk(RALLY);
- if (!instance)
- {
- TC_LOG_ERROR("scripts", ERROR_INST_DATA);
- return;
- }
InfernalCount = 0;//reset infernal count every new wave
EnemyCount = instance->GetData(DATA_TRASH);
@@ -612,41 +601,34 @@ void hyjalAI::StartEvent(Player* player)
uint32 hyjalAI::GetInstanceData(uint32 Event)
{
- if (instance)
- return instance->GetData(Event);
- else TC_LOG_ERROR("scripts", ERROR_INST_DATA);
-
- return 0;
+ return instance->GetData(Event);
}
void hyjalAI::Retreat()
{
- if (instance)
- {
- instance->SetData(TYPE_RETREAT, SPECIAL);
+ instance->SetData(TYPE_RETREAT, SPECIAL);
- if (Faction == 0)
- {
- instance->SetData(DATA_ALLIANCE_RETREAT, 1);
- AddWaypoint(0, JainaWPs[0][0], JainaWPs[0][1], JainaWPs[0][2]);
- AddWaypoint(1, JainaWPs[1][0], JainaWPs[1][1], JainaWPs[1][2]);
- Start(false, false);
- SetDespawnAtEnd(false);//move to center of alliance base
- }
- if (Faction == 1)
+ if (Faction == 0)
+ {
+ instance->SetData(DATA_ALLIANCE_RETREAT, 1);
+ AddWaypoint(0, JainaWPs[0][0], JainaWPs[0][1], JainaWPs[0][2]);
+ AddWaypoint(1, JainaWPs[1][0], JainaWPs[1][1], JainaWPs[1][2]);
+ Start(false, false);
+ SetDespawnAtEnd(false);//move to center of alliance base
+ }
+ if (Faction == 1)
+ {
+ instance->SetData(DATA_HORDE_RETREAT, 1);
+ Creature* JainaDummy = me->SummonCreature(JAINA, JainaDummySpawn[0][0], JainaDummySpawn[0][1], JainaDummySpawn[0][2], JainaDummySpawn[0][3], TEMPSUMMON_TIMED_DESPAWN, 60000);
+ if (JainaDummy)
{
- instance->SetData(DATA_HORDE_RETREAT, 1);
- Creature* JainaDummy = me->SummonCreature(JAINA, JainaDummySpawn[0][0], JainaDummySpawn[0][1], JainaDummySpawn[0][2], JainaDummySpawn[0][3], TEMPSUMMON_TIMED_DESPAWN, 60000);
- if (JainaDummy)
- {
- JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- CAST_AI(hyjalAI, JainaDummy->AI())->IsDummy = true;
- DummyGuid = JainaDummy->GetGUID();
- }
- AddWaypoint(0, JainaDummySpawn[1][0], JainaDummySpawn[1][1], JainaDummySpawn[1][2]);
- Start(false, false);
- SetDespawnAtEnd(false);//move to center of alliance base
+ JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ CAST_AI(hyjalAI, JainaDummy->AI())->IsDummy = true;
+ DummyGuid = JainaDummy->GetGUID();
}
+ AddWaypoint(0, JainaDummySpawn[1][0], JainaDummySpawn[1][1], JainaDummySpawn[1][2]);
+ Start(false, false);
+ SetDespawnAtEnd(false);//move to center of alliance base
}
SpawnVeins();
Overrun = true;
@@ -681,8 +663,6 @@ void hyjalAI::SpawnVeins()
void hyjalAI::DeSpawnVeins()
{
- if (!instance)
- return;
if (Faction == 1)
{
Creature* unit=Unit::GetCreature((*me), instance->GetData64(DATA_JAINAPROUDMOORE));
@@ -841,8 +821,7 @@ void hyjalAI::UpdateAI(uint32 diff)
CheckTimer = 0;
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
BossGUID[i] = 0;
- if (instance)
- instance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); // Reset world state for enemies to disable it
+ instance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); // Reset world state for enemies to disable it
}
}
}
@@ -858,7 +837,7 @@ void hyjalAI::UpdateAI(uint32 diff)
{
if (SpellTimer[i] <= diff)
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(false);
Unit* target = NULL;
@@ -899,18 +878,16 @@ void hyjalAI::JustDied(Unit* /*killer*/)
RespawnTimer = 120000;
Talk(DEATH);
Summons.DespawnAll();//despawn all wave's summons
- if (instance)
- {//reset encounter if boss is despawned (ex: thrall is killed, boss despawns, event stucks at inprogress)
- if (instance->GetData(DATA_RAGEWINTERCHILLEVENT) == IN_PROGRESS)
- instance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED);
- if (instance->GetData(DATA_ANETHERONEVENT) == IN_PROGRESS)
- instance->SetData(DATA_ANETHERONEVENT, NOT_STARTED);
- if (instance->GetData(DATA_KAZROGALEVENT) == IN_PROGRESS)
- instance->SetData(DATA_KAZROGALEVENT, NOT_STARTED);
- if (instance->GetData(DATA_AZGALOREVENT) == IN_PROGRESS)
- instance->SetData(DATA_AZGALOREVENT, NOT_STARTED);
- instance->SetData(DATA_RESET_RAIDDAMAGE, 0);//reset damage on die
- }
+ //reset encounter if boss is despawned (ex: thrall is killed, boss despawns, event stucks at inprogress)
+ if (instance->GetData(DATA_RAGEWINTERCHILLEVENT) == IN_PROGRESS)
+ instance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED);
+ if (instance->GetData(DATA_ANETHERONEVENT) == IN_PROGRESS)
+ instance->SetData(DATA_ANETHERONEVENT, NOT_STARTED);
+ if (instance->GetData(DATA_KAZROGALEVENT) == IN_PROGRESS)
+ instance->SetData(DATA_KAZROGALEVENT, NOT_STARTED);
+ if (instance->GetData(DATA_AZGALOREVENT) == IN_PROGRESS)
+ instance->SetData(DATA_AZGALOREVENT, NOT_STARTED);
+ instance->SetData(DATA_RESET_RAIDDAMAGE, 0);//reset damage on die
}
void hyjalAI::HideNearPos(float x, float y)
@@ -953,7 +930,7 @@ void hyjalAI::WaypointReached(uint32 waypointId)
{
if (waypointId == 1 || (waypointId == 0 && me->GetEntry() == THRALL))
{
- me->MonsterYell(YELL_HURRY, 0, 0);
+ me->MonsterYell(YELL_HURRY, LANG_UNIVERSAL, NULL);
WaitForTeleport = true;
TeleportTimer = 20000;
if (me->GetEntry() == JAINA)
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h
index 90dd277346a..c91414eba9d 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
index 3653aaf5770..2688fbbdaff 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -195,8 +195,7 @@ void hyjal_trashAI::DamageTaken(Unit* done_by, uint32 &damage)
if (done_by->GetTypeId() == TYPEID_PLAYER || done_by->IsPet())
{
damageTaken += damage;
- if (instance)
- instance->SetData(DATA_RAIDDAMAGE, damage);//store raid's damage
+ instance->SetData(DATA_RAIDDAMAGE, damage);//store raid's damage
}
}
@@ -399,9 +398,6 @@ void hyjal_trashAI::UpdateAI(uint32 /*diff*/)
void hyjal_trashAI::JustDied(Unit* /*killer*/)
{
- if (!instance)
- return;
-
if (IsEvent && !me->isWorldBoss())
instance->SetData(DATA_TRASH, 0);//signal trash is dead
@@ -431,7 +427,6 @@ public:
bool meteor;
bool CanMove;
- bool WpEnabled;
bool go;
uint32 spawnTimer;
uint32 FlameBuffetTimer;
@@ -489,16 +484,13 @@ public:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetDisplayId(me->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
CanMove = true;
- if (instance)
+ if (instance->GetData(DATA_ALLIANCE_RETREAT) && !instance->GetData(DATA_HORDE_RETREAT))
{
- if (instance->GetData(DATA_ALLIANCE_RETREAT) && !instance->GetData(DATA_HORDE_RETREAT))
- {
- Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL));
- if (target && target->IsAlive())
- me->AddThreat(target, 0.0f);
- } else if (instance->GetData(DATA_ALLIANCE_RETREAT) && instance->GetData(DATA_HORDE_RETREAT)){
- //do overrun
- }
+ Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL));
+ if (target && target->IsAlive())
+ me->AddThreat(target, 0.0f);
+ } else if (instance->GetData(DATA_ALLIANCE_RETREAT) && instance->GetData(DATA_HORDE_RETREAT)){
+ //do overrun
}
} else spawnTimer -= diff;
}
@@ -511,12 +503,9 @@ public:
if (!go)
{
go = true;
- if (instance)
- {
- AddWaypoint(0, HordeWPs[7][0]+irand(-3, 3), HordeWPs[7][1]+irand(-3, 3), HordeWPs[7][2]);//HordeWPs[7] infront of thrall
- Start(true, true);
- SetDespawnAtEnd(false);
- }
+ AddWaypoint(0, HordeWPs[7][0]+irand(-3, 3), HordeWPs[7][1]+irand(-3, 3), HordeWPs[7][2]);//HordeWPs[7] infront of thrall
+ Start(true, true);
+ SetDespawnAtEnd(false);
}
}
@@ -538,7 +527,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_giant_infernalAI(creature);
+ return GetInstanceAI<npc_giant_infernalAI>(creature);
}
};
@@ -549,7 +538,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_abominationAI(creature);
+ return GetInstanceAI<npc_abominationAI>(creature);
}
struct npc_abominationAI : public hyjal_trashAI
@@ -607,21 +596,18 @@ public:
if (!go)
{
go = true;
- if (instance)
+ if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
+ {
+ for (uint8 i = 0; i < 8; ++i)
+ AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
+ Start(false, true);
+ SetDespawnAtEnd(false);
+ }else//use alliance WPs
{
- if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
- {
- for (uint8 i = 0; i < 8; ++i)
- AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
- Start(false, true);
- SetDespawnAtEnd(false);
- }else//use alliance WPs
- {
- for (uint8 i = 0; i < 8; ++i)
- AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
- Start(false, true);
- SetDespawnAtEnd(false);
- }
+ for (uint8 i = 0; i < 8; ++i)
+ AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
+ Start(false, true);
+ SetDespawnAtEnd(false);
}
}
}
@@ -647,7 +633,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ghoulAI(creature);
+ return GetInstanceAI<npc_ghoulAI>(creature);
}
struct npc_ghoulAI : public hyjal_trashAI
@@ -710,21 +696,18 @@ public:
if (!go)
{
go = true;
- if (instance)
+ if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
{
- if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
- {
- for (uint8 i = 0; i < 8; ++i)
- AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
- Start(false, true);
- SetDespawnAtEnd(false);
- }else//use alliance WPs
- {
- for (uint8 i = 0; i < 8; ++i)
- AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
- Start(false, true);
- SetDespawnAtEnd(false);
- }
+ for (uint8 i = 0; i < 8; ++i)
+ AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
+ Start(false, true);
+ SetDespawnAtEnd(false);
+ }else//use alliance WPs
+ {
+ for (uint8 i = 0; i < 8; ++i)
+ AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
+ Start(false, true);
+ SetDespawnAtEnd(false);
}
}
}
@@ -749,7 +732,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_necromancerAI(creature);
+ return GetInstanceAI<npc_necromancerAI>(creature);
}
struct npc_necromancerAI : public hyjal_trashAI
@@ -835,21 +818,18 @@ public:
if (!go)
{
go = true;
- if (instance)
+ if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
+ {
+ for (uint8 i = 0; i < 8; ++i)
+ AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
+ Start(true, true);
+ SetDespawnAtEnd(false);
+ }else//use alliance WPs
{
- if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
- {
- for (uint8 i = 0; i < 8; ++i)
- AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
- Start(true, true);
- SetDespawnAtEnd(false);
- }else//use alliance WPs
- {
- for (uint8 i = 0; i < 8; ++i)
- AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
- Start(true, true);
- SetDespawnAtEnd(false);
- }
+ for (uint8 i = 0; i < 8; ++i)
+ AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
+ Start(true, true);
+ SetDespawnAtEnd(false);
}
}
}
@@ -876,7 +856,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_bansheeAI(creature);
+ return GetInstanceAI<npc_bansheeAI>(creature);
}
struct npc_bansheeAI : public hyjal_trashAI
@@ -931,21 +911,18 @@ public:
if (!go)
{
go = true;
- if (instance)
+ if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
{
- if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
- {
- for (uint8 i = 0; i < 8; ++i)
- AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
- Start(false, true);
- SetDespawnAtEnd(false);
- }else//use alliance WPs
- {
- for (uint8 i = 0; i < 8; ++i)
- AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
- Start(false, true);
- SetDespawnAtEnd(false);
- }
+ for (uint8 i = 0; i < 8; ++i)
+ AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
+ Start(false, true);
+ SetDespawnAtEnd(false);
+ }else//use alliance WPs
+ {
+ for (uint8 i = 0; i < 8; ++i)
+ AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
+ Start(false, true);
+ SetDespawnAtEnd(false);
}
}
}
@@ -979,7 +956,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_crypt_fiendAI(creature);
+ return GetInstanceAI<npc_crypt_fiendAI>(creature);
}
struct npc_crypt_fiendAI : public hyjal_trashAI
@@ -1030,22 +1007,18 @@ public:
if (!go)
{
go = true;
- if (instance)
+ if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
{
- if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
- {
- for (uint8 i = 0; i < 8; ++i)
- AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
- Start(false, true);
- SetDespawnAtEnd(false);
- }else//use alliance WPs
- {
- for (uint8 i = 0; i < 8; ++i)
- AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
- Start(false, true);
- SetDespawnAtEnd(false);
- }
-
+ for (uint8 i = 0; i < 8; ++i)
+ AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
+ Start(false, true);
+ SetDespawnAtEnd(false);
+ }else//use alliance WPs
+ {
+ for (uint8 i = 0; i < 8; ++i)
+ AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
+ Start(false, true);
+ SetDespawnAtEnd(false);
}
}
}
@@ -1069,7 +1042,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_fel_stalkerAI(creature);
+ return GetInstanceAI<npc_fel_stalkerAI>(creature);
}
struct npc_fel_stalkerAI : public hyjal_trashAI
@@ -1120,22 +1093,18 @@ public:
if (!go)
{
go = true;
- if (instance)
+ if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
{
- if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs
- {
- for (uint8 i = 0; i < 8; ++i)
- AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
- Start(false, true);
- SetDespawnAtEnd(false);
- }else//use alliance WPs
- {
- for (uint8 i = 0; i < 8; ++i)
- AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
- Start(false, true);
- SetDespawnAtEnd(false);
- }
-
+ for (uint8 i = 0; i < 8; ++i)
+ AddWaypoint(i, HordeWPs[i][0]+irand(-3, 3), HordeWPs[i][1]+irand(-3, 3), HordeWPs[i][2]);
+ Start(false, true);
+ SetDespawnAtEnd(false);
+ }else//use alliance WPs
+ {
+ for (uint8 i = 0; i < 8; ++i)
+ AddWaypoint(i, AllianceWPs[i][0]+irand(-3, 3), AllianceWPs[i][1]+irand(-3, 3), AllianceWPs[i][2]);
+ Start(false, true);
+ SetDespawnAtEnd(false);
}
}
}
@@ -1159,7 +1128,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_frost_wyrmAI(creature);
+ return GetInstanceAI<npc_frost_wyrmAI>(creature);
}
struct npc_frost_wyrmAI : public hyjal_trashAI
@@ -1222,20 +1191,17 @@ public:
if (!go)
{
go = true;
- if (instance)
+ if (!useFlyPath)
{
- if (!useFlyPath)
- {
- for (uint8 i = 0; i < 3; ++i)
- AddWaypoint(i, FrostWyrmWPs[i][0], FrostWyrmWPs[i][1], FrostWyrmWPs[i][2]);
- Start(false, true);
- SetDespawnAtEnd(false);
- }else{//fly path FlyPathWPs
- for (uint8 i = 0; i < 3; ++i)
- AddWaypoint(i, FlyPathWPs[i][0]+irand(-10, 10), FlyPathWPs[i][1]+irand(-10, 10), FlyPathWPs[i][2]);
- Start(false, true);
- SetDespawnAtEnd(false);
- }
+ for (uint8 i = 0; i < 3; ++i)
+ AddWaypoint(i, FrostWyrmWPs[i][0], FrostWyrmWPs[i][1], FrostWyrmWPs[i][2]);
+ Start(false, true);
+ SetDespawnAtEnd(false);
+ }else{//fly path FlyPathWPs
+ for (uint8 i = 0; i < 3; ++i)
+ AddWaypoint(i, FlyPathWPs[i][0]+irand(-10, 10), FlyPathWPs[i][1]+irand(-10, 10), FlyPathWPs[i][2]);
+ Start(false, true);
+ SetDespawnAtEnd(false);
}
}
}
@@ -1271,7 +1237,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_gargoyleAI(creature);
+ return GetInstanceAI<npc_gargoyleAI>(creature);
}
struct npc_gargoyleAI : public hyjal_trashAI
@@ -1335,20 +1301,17 @@ public:
if (!go)
{
go = true;
- if (instance)
+ if (!useFlyPath)
{
- if (!useFlyPath)
- {
- for (uint8 i = 0; i < 3; ++i)
- AddWaypoint(i, GargoyleWPs[i][0]+irand(-10, 10), GargoyleWPs[i][1]+irand(-10, 10), GargoyleWPs[i][2]);
- Start(false, true);
- SetDespawnAtEnd(false);
- }else{//fly path FlyPathWPs
- for (uint8 i = 0; i < 3; ++i)
- AddWaypoint(i, FlyPathWPs[i][0]+irand(-10, 10), FlyPathWPs[i][1]+irand(-10, 10), FlyPathWPs[i][2]);
- Start(false, true);
- SetDespawnAtEnd(false);
- }
+ for (uint8 i = 0; i < 3; ++i)
+ AddWaypoint(i, GargoyleWPs[i][0]+irand(-10, 10), GargoyleWPs[i][1]+irand(-10, 10), GargoyleWPs[i][2]);
+ Start(false, true);
+ SetDespawnAtEnd(false);
+ }else{//fly path FlyPathWPs
+ for (uint8 i = 0; i < 3; ++i)
+ AddWaypoint(i, FlyPathWPs[i][0]+irand(-10, 10), FlyPathWPs[i][1]+irand(-10, 10), FlyPathWPs[i][2]);
+ Start(false, true);
+ SetDespawnAtEnd(false);
}
}
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h
index 01ae6244b4a..18122ba2b0c 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp
index d54ef0c5168..0c3f33dea55 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@ EndScriptData */
#include "Player.h"
#include "WorldPacket.h"
#include "Opcodes.h"
+#include "Chat.h"
/* Battle of Mount Hyjal encounters:
0 - Rage Winterchill event
@@ -185,8 +186,8 @@ public:
{
if (i->GetSource())
{
- WorldPacket packet(SMSG_MESSAGECHAT, 200);
- unit->BuildMonsterChat(&packet, CHAT_MSG_MONSTER_YELL, YELL_EFFORTS, 0, YELL_EFFORTS_NAME, i->GetSource()->GetGUID());
+ WorldPacket packet;
+ ChatHandler::BuildChatPacket(packet, CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, unit, i->GetSource(), YELL_EFFORTS);
i->GetSource()->GetSession()->SendPacket(&packet);
WorldPacket data2(SMSG_PLAY_SOUND, 4);
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp
index c049be0309b..a03bfb3082b 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -52,7 +52,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_epochAI(creature);
+ return GetInstanceAI<boss_epochAI>(creature);
}
struct boss_epochAI : public ScriptedAI
@@ -81,16 +81,14 @@ public:
uiTimeStopTimer = 21300;
uiWoundingStrikeTimer = 5300;
- if (instance)
- instance->SetData(DATA_EPOCH_EVENT, NOT_STARTED);
+ instance->SetData(DATA_EPOCH_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_EPOCH_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_EPOCH_EVENT, IN_PROGRESS);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -132,8 +130,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_EPOCH_EVENT, DONE);
+ instance->SetData(DATA_EPOCH_EVENT, DONE);
}
void KilledUnit(Unit* victim) OVERRIDE
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite_corruptor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite_corruptor.cpp
index 54438e3b8a9..c3427c99fbb 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite_corruptor.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite_corruptor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -39,7 +39,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_infinite_corruptorAI(creature);
+ return GetInstanceAI<boss_infinite_corruptorAI>(creature);
}
struct boss_infinite_corruptorAI : public ScriptedAI
@@ -53,15 +53,13 @@ public:
void Reset() OVERRIDE
{
- if (instance)
- instance->SetData(DATA_INFINITE_EVENT, NOT_STARTED);
+ instance->SetData(DATA_INFINITE_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_INFINITE_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_INFINITE_EVENT, IN_PROGRESS);
}
void UpdateAI(uint32 /*diff*/) OVERRIDE
@@ -76,8 +74,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_INFINITE_EVENT, DONE);
+ instance->SetData(DATA_INFINITE_EVENT, DONE);
}
};
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp
index e16ed882171..e4f1324d19c 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -66,7 +66,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_mal_ganisAI(creature);
+ return GetInstanceAI<boss_mal_ganisAI>(creature);
}
struct boss_mal_ganisAI : public ScriptedAI
@@ -102,15 +102,13 @@ public:
uiSleepTimer = urand(15000, 20000);
uiOutroTimer = 1000;
- if (instance)
- instance->SetData(DATA_MAL_GANIS_EVENT, NOT_STARTED);
+ instance->SetData(DATA_MAL_GANIS_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_MAL_GANIS_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_MAL_GANIS_EVENT, IN_PROGRESS);
}
void DamageTaken(Unit* done_by, uint32 &damage) OVERRIDE
@@ -154,8 +152,7 @@ public:
{
EnterEvadeMode();
me->DisappearAndDie();
- if (instance)
- instance->SetData(DATA_MAL_GANIS_EVENT, FAIL);
+ instance->SetData(DATA_MAL_GANIS_EVENT, FAIL);
}
if (uiCarrionSwarmTimer < diff)
@@ -228,13 +225,10 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- {
- instance->SetData(DATA_MAL_GANIS_EVENT, DONE);
- DoCastAOE(SPELL_MAL_GANIS_KILL_CREDIT);
- // give achievement credit and LFG rewards to players. criteria use spell 58630 which doesn't exist, but it was created in spell_dbc
- DoCastAOE(SPELL_KILL_CREDIT);
- }
+ instance->SetData(DATA_MAL_GANIS_EVENT, DONE);
+ DoCastAOE(SPELL_MAL_GANIS_KILL_CREDIT);
+ // give achievement credit and LFG rewards to players. criteria use spell 58630 which doesn't exist, but it was created in spell_dbc
+ DoCastAOE(SPELL_KILL_CREDIT);
}
void KilledUnit(Unit* victim) OVERRIDE
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp
index aff076f4763..b4bf6a30140 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -51,7 +51,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_meathookAI(creature);
+ return GetInstanceAI<boss_meathookAI>(creature);
}
struct boss_meathookAI : public ScriptedAI
@@ -59,8 +59,7 @@ public:
boss_meathookAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
- if (instance)
- Talk(SAY_SPAWN);
+ Talk(SAY_SPAWN);
}
uint32 uiChainTimer;
@@ -75,16 +74,14 @@ public:
uiDiseaseTimer = urand(2000, 4000); //approx 3s
uiFrenzyTimer = urand(21000, 26000); //made it up
- if (instance)
- instance->SetData(DATA_MEATHOOK_EVENT, NOT_STARTED);
+ instance->SetData(DATA_MEATHOOK_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_MEATHOOK_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_MEATHOOK_EVENT, IN_PROGRESS);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -119,8 +116,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_MEATHOOK_EVENT, DONE);
+ instance->SetData(DATA_MEATHOOK_EVENT, DONE);
}
void KilledUnit(Unit* victim) OVERRIDE
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp
index fc5b3c4a8b0..5d9477a1b45 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -56,7 +56,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_salrammAI(creature);
+ return GetInstanceAI<boss_salrammAI>(creature);
}
struct boss_salrammAI : public ScriptedAI
@@ -64,8 +64,7 @@ public:
boss_salrammAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
- if (instance)
- Talk(SAY_SPAWN);
+ Talk(SAY_SPAWN);
}
uint32 uiCurseFleshTimer;
@@ -84,16 +83,14 @@ public:
uiStealFleshTimer = 12345;
uiSummonGhoulsTimer = urand(19000, 24000); //on a video approx 24s after aggro
- if (instance)
- instance->SetData(DATA_SALRAMM_EVENT, NOT_STARTED);
+ instance->SetData(DATA_SALRAMM_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_SALRAMM_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_SALRAMM_EVENT, IN_PROGRESS);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -142,8 +139,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_SALRAMM_EVENT, DONE);
+ instance->SetData(DATA_SALRAMM_EVENT, DONE);
}
void KilledUnit(Unit* victim) OVERRIDE
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
index dbead663cff..60352f7d55c 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -344,7 +344,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_arthasAI(creature);
+ return GetInstanceAI<npc_arthasAI>(creature);
}
struct npc_arthasAI : public npc_escortAI
@@ -399,22 +399,20 @@ public:
malganisGUID = 0;
infiniteGUID = 0;
- if (instance) {
- instance->SetData(DATA_ARTHAS_EVENT, NOT_STARTED);
- switch (instance->GetData(DATA_ARTHAS_EVENT))
- {
- case NOT_STARTED:
- bStepping = true;
- step = 0;
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- bossEvent = DATA_MEATHOOK_EVENT;
- gossipStep = 0;
- break;
- }
- phaseTimer = 1000;
- exorcismTimer = 7300;
- wave = 0;
+ instance->SetData(DATA_ARTHAS_EVENT, NOT_STARTED);
+ switch (instance->GetData(DATA_ARTHAS_EVENT))
+ {
+ case NOT_STARTED:
+ bStepping = true;
+ step = 0;
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ bossEvent = DATA_MEATHOOK_EVENT;
+ gossipStep = 0;
+ break;
}
+ phaseTimer = 1000;
+ exorcismTimer = 7300;
+ wave = 0;
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -424,8 +422,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_ARTHAS_EVENT, FAIL);
+ instance->SetData(DATA_ARTHAS_EVENT, FAIL);
}
void SpawnTimeRift(uint32 timeRiftID, uint64* guidVector)
@@ -559,9 +556,8 @@ public:
Talk(SAY_PHASE403);
break;
case 36:
- if (instance)
- if (GameObject* pGate = instance->instance->GetGameObject(instance->GetData64(DATA_SHKAF_GATE)))
- pGate->SetGoState(GO_STATE_ACTIVE);
+ if (GameObject* pGate = instance->instance->GetGameObject(instance->GetData64(DATA_SHKAF_GATE)))
+ pGate->SetGoState(GO_STATE_ACTIVE);
break;
case 45:
SetRun(true);
@@ -888,8 +884,7 @@ public:
Talk(SAY_PHASE209);
bossEvent = DATA_MEATHOOK_EVENT;
- if (instance)
- instance->SetData(DATA_ARTHAS_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_ARTHAS_EVENT, IN_PROGRESS);
me->SetReactState(REACT_DEFENSIVE);
SetDespawnAtFar(false);
@@ -961,25 +956,22 @@ public:
break;
case 50: //Wait Boss death
case 60:
- if (instance)
+ if (instance->GetData(bossEvent) == DONE)
{
- if (instance->GetData(bossEvent) == DONE)
+ JumpToNextStep(1000);
+ if (bossEvent == DATA_MEATHOOK_EVENT)
+ bossEvent = DATA_SALRAMM_EVENT;
+ else if (bossEvent == DATA_SALRAMM_EVENT)
{
- JumpToNextStep(1000);
- if (bossEvent == DATA_MEATHOOK_EVENT)
- bossEvent = DATA_SALRAMM_EVENT;
- else if (bossEvent == DATA_SALRAMM_EVENT)
- {
- SetHoldState(false);
- bStepping = false;
- bossEvent = DATA_EPOCH_EVENT;
- }
+ SetHoldState(false);
+ bStepping = false;
+ bossEvent = DATA_EPOCH_EVENT;
}
- else if (instance->GetData(bossEvent) == FAIL)
- npc_escortAI::EnterEvadeMode();
- else
- phaseTimer = 10000;
}
+ else if (instance->GetData(bossEvent) == FAIL)
+ npc_escortAI::EnterEvadeMode();
+ else
+ phaseTimer = 10000;
break;
//After Gossip 2 (waypoint 22)
case 61:
@@ -1096,53 +1088,47 @@ public:
JumpToNextStep(1000);
break;
case 80:
- if (instance)
- if (instance->GetData(DATA_EPOCH_EVENT) != DONE)
- {
- SpawnTimeRift(17, &epochGUID);
- if (Creature* epoch = Unit::GetCreature(*me, epochGUID))
- epoch->AI()->Talk(SAY_PHASE314);
- me->SetTarget(epochGUID);
- }
+ if (instance->GetData(DATA_EPOCH_EVENT) != DONE)
+ {
+ SpawnTimeRift(17, &epochGUID);
+ if (Creature* epoch = Unit::GetCreature(*me, epochGUID))
+ epoch->AI()->Talk(SAY_PHASE314);
+ me->SetTarget(epochGUID);
+ }
JumpToNextStep(18000);
break;
case 81:
- if (instance)
- if (instance->GetData(DATA_EPOCH_EVENT) != DONE)
- Talk(SAY_PHASE315);
+ if (instance->GetData(DATA_EPOCH_EVENT) != DONE)
+ Talk(SAY_PHASE315);
JumpToNextStep(6000);
break;
case 82:
- if (instance)
- if (instance->GetData(DATA_EPOCH_EVENT) != DONE)
+ if (instance->GetData(DATA_EPOCH_EVENT) != DONE)
+ {
+ if (Creature* epoch = Unit::GetCreature(*me, epochGUID))
{
- if (Creature* epoch = Unit::GetCreature(*me, epochGUID))
- {
- //Make Epoch attackable
- epoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
- epoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- epoch->SetReactState(REACT_AGGRESSIVE);
- }
-
+ //Make Epoch attackable
+ epoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ epoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ epoch->SetReactState(REACT_AGGRESSIVE);
}
+
+ }
JumpToNextStep(1000);
break;
case 83:
- if (instance)
+ if (instance->GetData(DATA_EPOCH_EVENT) == DONE)
{
- if (instance->GetData(DATA_EPOCH_EVENT) == DONE)
- {
- gossipStep = 3;
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- bStepping = false;
- bossEvent = DATA_MAL_GANIS_EVENT;
- JumpToNextStep(15000);
- }
- else if (instance->GetData(DATA_EPOCH_EVENT) == FAIL)
- npc_escortAI::EnterEvadeMode();
- else
- phaseTimer = 10000;
+ gossipStep = 3;
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ bStepping = false;
+ bossEvent = DATA_MAL_GANIS_EVENT;
+ JumpToNextStep(15000);
}
+ else if (instance->GetData(DATA_EPOCH_EVENT) == FAIL)
+ npc_escortAI::EnterEvadeMode();
+ else
+ phaseTimer = 10000;
break;
//After Gossip 4
case 84:
@@ -1158,9 +1144,8 @@ public:
malganisGUID = malganis->GetGUID();
malganis->SetReactState(REACT_PASSIVE);
}
- if (instance)
- if (GameObject* pGate = instance->instance->GetGameObject(instance->GetData64(DATA_MAL_GANIS_GATE_1)))
- pGate->SetGoState(GO_STATE_ACTIVE);
+ if (GameObject* pGate = instance->instance->GetGameObject(instance->GetData64(DATA_MAL_GANIS_GATE_1)))
+ pGate->SetGoState(GO_STATE_ACTIVE);
SetHoldState(false);
bStepping = false;
JumpToNextStep(0);
@@ -1180,18 +1165,15 @@ public:
JumpToNextStep(1000);
break;
case 88:
- if (instance)
+ if (instance->GetData(DATA_MAL_GANIS_EVENT) == DONE)
{
- if (instance->GetData(DATA_MAL_GANIS_EVENT) == DONE)
- {
- SetHoldState(false);
- JumpToNextStep(1000);
- }
- else if (instance->GetData(DATA_MAL_GANIS_EVENT) == FAIL)
- npc_escortAI::EnterEvadeMode();
- else
- phaseTimer = 10000;
+ SetHoldState(false);
+ JumpToNextStep(1000);
}
+ else if (instance->GetData(DATA_MAL_GANIS_EVENT) == FAIL)
+ npc_escortAI::EnterEvadeMode();
+ else
+ phaseTimer = 10000;
break;
//After waypoint 56
case 89:
@@ -1201,11 +1183,8 @@ public:
JumpToNextStep(7000);
break;
case 90:
- if (instance)
- {
- instance->SetData(DATA_ARTHAS_EVENT, DONE); //Rewards: Achiev & Chest ;D
- me->SetTarget(instance->GetData64(DATA_MAL_GANIS_GATE_2)); //Look behind
- }
+ instance->SetData(DATA_ARTHAS_EVENT, DONE); //Rewards: Achiev & Chest ;D
+ me->SetTarget(instance->GetData64(DATA_MAL_GANIS_GATE_2)); //Look behind
Talk(SAY_PHASE504);
bStepping = false;
break;
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 bd6549d40be..649d9dbf803 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp
index 9af1486275c..9e192d2e1a2 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -187,8 +187,7 @@ class instance_culling_of_stratholme : public InstanceMapScript
// Summon Chromie and global whisper
if (Creature* chromie = instance->SummonCreature(NPC_CHROMIE_2, ChromieSummonPos))
if (!instance->GetPlayers().isEmpty())
- if (Player* player = instance->GetPlayers().getFirst()->GetSource())
- sCreatureTextMgr->SendChat(chromie, SAY_CRATES_COMPLETED, player->GetGUID(), CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
+ sCreatureTextMgr->SendChat(chromie, SAY_CRATES_COMPLETED, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
}
DoUpdateWorldState(WORLDSTATE_CRATES_REVEALED, _crateCount);
break;
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp
index 3b51f6d0f8f..061c7fdfc62 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_captain_skarlocAI(creature);
+ return GetInstanceAI<boss_captain_skarlocAI>(creature);
}
struct boss_captain_skarlocAI : public ScriptedAI
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp
index 3e650bf4fe9..cb25d96acf3 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_epoch_hunterAI(creature);
+ return GetInstanceAI<boss_epoch_hunterAI>(creature);
}
struct boss_epoch_hunterAI : public ScriptedAI
@@ -104,7 +104,7 @@ public:
//Sand Breath
if (SandBreath_Timer <= diff)
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(false);
DoCastVictim(SPELL_SAND_BREATH);
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 c623ff40a10..7ca850e8754 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp
index 8250f1ec3c0..47317b0a13e 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
index 46978366224..6e4ef814dbe 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -188,7 +188,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_thrall_old_hillsbradAI(creature);
+ return GetInstanceAI<npc_thrall_old_hillsbradAI>(creature);
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
@@ -291,9 +291,6 @@ public:
void WaypointReached(uint32 waypointId) OVERRIDE
{
- if (!instance)
- return;
-
switch (waypointId)
{
case 8:
@@ -407,7 +404,7 @@ public:
if (uint64 TarethaGUID = instance->GetData64(DATA_TARETHA))
{
if (Creature* Taretha = Creature::GetCreature(*me, TarethaGUID))
- Taretha->AI()->Talk(SAY_TA_ESCAPED, me->GetGUID());
+ Taretha->AI()->Talk(SAY_TA_ESCAPED, me);
}
break;
case 95:
@@ -526,8 +523,7 @@ public:
}
void JustDied(Unit* slayer) OVERRIDE
{
- if (instance)
- instance->SetData(TYPE_THRALL_EVENT, FAIL);
+ instance->SetData(TYPE_THRALL_EVENT, FAIL);
// Don't do a yell if he kills self (if player goes too far or at the end).
if (slayer == me)
@@ -573,7 +569,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_tarethaAI(creature);
+ return GetInstanceAI<npc_tarethaAI>(creature);
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h
index 7d8b06f1b02..57b0a1fce85 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp
index c929a1b6a55..bf11d781a0c 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -90,16 +90,14 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- {
- instance->SetData(TYPE_RIFT, DONE);
- instance->SetData(TYPE_MEDIVH, DONE); // FIXME: later should be removed
- }
+ instance->SetData(TYPE_RIFT, DONE);
+ instance->SetData(TYPE_MEDIVH, DONE); // FIXME: later should be removed
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_SLAY);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_SLAY);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -140,7 +138,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_aeonusAI(creature);
+ return GetInstanceAI<boss_aeonusAI>(creature);
}
};
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_chrono_lord_deja.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_chrono_lord_deja.cpp
index fe91f3ab712..251c1b14e9b 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_chrono_lord_deja.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_chrono_lord_deja.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -98,8 +98,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(TYPE_RIFT, SPECIAL);
+ instance->SetData(TYPE_RIFT, SPECIAL);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -145,7 +144,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_chrono_lord_dejaAI(creature);
+ return GetInstanceAI<boss_chrono_lord_dejaAI>(creature);
}
};
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp
index 4d94edf7339..fcd3cc92604 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -81,8 +81,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(TYPE_RIFT, SPECIAL);
+ instance->SetData(TYPE_RIFT, SPECIAL);
}
void MoveInLineOfSight(Unit* who) OVERRIDE
@@ -143,7 +142,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_temporusAI(creature);
+ return GetInstanceAI<boss_temporusAI>(creature);
}
};
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp
index d0178f4874a..e5920084033 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
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 cc3cf8192dc..f1406a5a008 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -70,7 +70,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_medivh_bmAI(creature);
+ return GetInstanceAI<npc_medivh_bmAI>(creature);
}
struct npc_medivh_bmAI : public ScriptedAI
@@ -97,9 +97,6 @@ public:
Life50 = true;
Life25 = true;
- if (!instance)
- return;
-
if (instance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
DoCast(me, SPELL_CHANNEL, true);
else if (me->HasAura(SPELL_CHANNEL))
@@ -109,11 +106,7 @@ public:
}
void MoveInLineOfSight(Unit* who) OVERRIDE
-
{
- if (!instance)
- return;
-
if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 10.0f))
{
if (instance->GetData(TYPE_MEDIVH) == IN_PROGRESS || instance->GetData(TYPE_MEDIVH) == DONE)
@@ -175,9 +168,6 @@ public:
void UpdateAI(uint32 diff) OVERRIDE
{
- if (!instance)
- return;
-
if (SpellCorrupt_Timer)
{
if (SpellCorrupt_Timer <= diff)
@@ -268,7 +258,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_time_riftAI(creature);
+ return GetInstanceAI<npc_time_riftAI>(creature);
}
struct npc_time_riftAI : public ScriptedAI
@@ -291,9 +281,6 @@ public:
TimeRiftWave_Timer = 15000;
mRiftWaveCount = 0;
- if (!instance)
- return;
-
mPortalCount = instance->GetData(DATA_PORTAL_COUNT);
if (mPortalCount < 6)
@@ -349,16 +336,13 @@ public:
void UpdateAI(uint32 diff) OVERRIDE
{
- if (!instance)
- return;
-
if (TimeRiftWave_Timer <= diff)
{
DoSelectSummon();
TimeRiftWave_Timer = 15000;
} else TimeRiftWave_Timer -= diff;
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
return;
TC_LOG_DEBUG("scripts", "npc_time_rift: not casting anylonger, i need to die.");
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 729eb42e9c5..25f10f22907 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp b/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp
index e28e65b6911..160495a8dc2 100644
--- a/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp
+++ b/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 2a00565e4bd..ec8596e4fc0 100644
--- a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp
+++ b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp
index 723070fd18d..3b9ad0bfb79 100644
--- a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp
+++ b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp
index 6478c6eae75..6b425c4c0fe 100644
--- a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp
+++ b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp
index 654ef986a17..035ababd3b9 100644
--- a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp
+++ b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/Maraudon/instance_maraudon.cpp b/src/server/scripts/Kalimdor/Maraudon/instance_maraudon.cpp
index 53b04c9b4e7..e5653df8f64 100644
--- a/src/server/scripts/Kalimdor/Maraudon/instance_maraudon.cpp
+++ b/src/server/scripts/Kalimdor/Maraudon/instance_maraudon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
index 79421ffe37e..7381594a1ce 100644
--- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
+++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -145,12 +145,9 @@ public:
SummonWhelpCount = 0;
IsMoving = false;
- if (instance)
- {
- instance->SetBossState(DATA_ONYXIA, NOT_STARTED);
- instance->SetData(DATA_ONYXIA_PHASE, Phase);
- instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
- }
+ instance->SetBossState(DATA_ONYXIA, NOT_STARTED);
+ instance->SetData(DATA_ONYXIA_PHASE, Phase);
+ instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -163,17 +160,13 @@ public:
events.ScheduleEvent(EVENT_CLEAVE, urand (2000, 5000));
events.ScheduleEvent(EVENT_WING_BUFFET, urand (10000, 20000));
- if (instance)
- {
- instance->SetBossState(DATA_ONYXIA, IN_PROGRESS);
- instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
- }
+ instance->SetBossState(DATA_ONYXIA, IN_PROGRESS);
+ instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_ONYXIA, DONE);
+ instance->SetBossState(DATA_ONYXIA, DONE);
Summons.DespawnAll();
}
@@ -246,8 +239,7 @@ public:
me->GetMotionMaster()->MovePoint(11, Phase2Location.GetPositionX(), Phase2Location.GetPositionY(), Phase2Location.GetPositionZ()+25);
me->SetSpeed(MOVE_FLIGHT, 1.0f);
Talk(SAY_PHASE_2_TRANS);
- if (instance)
- instance->SetData(DATA_ONYXIA_PHASE, Phase);
+ instance->SetData(DATA_ONYXIA_PHASE, Phase);
events.ScheduleEvent(EVENT_WHELP_SPAWN, 5000);
events.ScheduleEvent(EVENT_LAIR_GUARD, 15000);
break;
@@ -280,10 +272,7 @@ public:
(Spell->Id >= 22267 && Spell->Id <= 22268)) &&
(target->GetTypeId() == TYPEID_PLAYER))
{
- if (instance)
- {
instance->SetData(DATA_SHE_DEEP_BREATH_MORE, FAIL);
- }
}
}
@@ -383,8 +372,7 @@ public:
if (HealthBelowPct(40))
{
Phase = PHASE_END;
- if (instance)
- instance->SetData(DATA_ONYXIA_PHASE, PHASE_END);
+ instance->SetData(DATA_ONYXIA_PHASE, PHASE_END);
Talk(SAY_PHASE_3_TRANS);
SetCombatMovement(true);
@@ -404,7 +392,7 @@ public:
case EVENT_DEEP_BREATH: // Phase PHASE_BREATH
if (!IsMoving)
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(false);
Talk(EMOTE_BREATH);
@@ -469,7 +457,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_onyxiaAI(creature);
+ return GetInstanceAI<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 fcb6a484a9b..e028fab67e5 100644
--- a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp
+++ b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h
index bf5010e4658..cacbd8b2787 100644
--- a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h
+++ b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Kalimdor/RagefireChasm/instance_ragefire_chasm.cpp b/src/server/scripts/Kalimdor/RagefireChasm/instance_ragefire_chasm.cpp
index 2205845e6f8..8d5173ff266 100644
--- a/src/server/scripts/Kalimdor/RagefireChasm/instance_ragefire_chasm.cpp
+++ b/src/server/scripts/Kalimdor/RagefireChasm/instance_ragefire_chasm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp
index 4a4d7fe4b07..bfc8c468af6 100644
--- a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp
@@ -1,6 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -16,69 +15,69 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Boss_Amnennar_the_coldbringer
-SD%Complete: 100
-SDComment:
-SDCategory: Razorfen Downs
-EndScriptData */
-
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
+#include "razorfen_downs.h"
-enum AmnennarTheColdbringer
+enum Say
{
SAY_AGGRO = 0,
SAY_SUMMON60 = 1,
SAY_SUMMON30 = 2,
SAY_HP = 3,
- SAY_KILL = 4,
+ SAY_KILL = 4
+};
+enum Spells
+{
SPELL_AMNENNARSWRATH = 13009,
SPELL_FROSTBOLT = 15530,
SPELL_FROST_NOVA = 15531,
SPELL_FROST_SPECTRES = 12642
};
+enum Events
+{
+ EVENT_AMNENNARSWRATH = 1,
+ EVENT_FROSTBOLT = 2,
+ EVENT_FROST_NOVA = 3
+};
+
class boss_amnennar_the_coldbringer : public CreatureScript
{
public:
boss_amnennar_the_coldbringer() : CreatureScript("boss_amnennar_the_coldbringer") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new boss_amnennar_the_coldbringerAI(creature);
- }
-
- struct boss_amnennar_the_coldbringerAI : public ScriptedAI
+ struct boss_amnennar_the_coldbringerAI : public BossAI
{
- boss_amnennar_the_coldbringerAI(Creature* creature) : ScriptedAI(creature) { }
-
- uint32 AmnenarsWrath_Timer;
- uint32 FrostBolt_Timer;
- uint32 FrostNova_Timer;
- bool Spectrals60;
- bool Spectrals30;
- bool Hp;
+ boss_amnennar_the_coldbringerAI(Creature* creature) : BossAI(creature, DATA_AMNENNAR_THE_COLD_BRINGER) { }
void Reset() OVERRIDE
{
- AmnenarsWrath_Timer = 8000;
- FrostBolt_Timer = 1000;
- FrostNova_Timer = urand(10000, 15000);
- Spectrals30 = false;
- Spectrals60 = false;
- Hp = false;
+ _Reset();
+ hp60Spectrals = false;
+ hp30Spectrals = false;
+ hp50 = false;
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
+ _EnterCombat();
+ events.ScheduleEvent(EVENT_AMNENNARSWRATH, 8000);
+ events.ScheduleEvent(EVENT_FROSTBOLT, 1000);
+ events.ScheduleEvent(EVENT_FROST_NOVA, urand(10000, 15000));
Talk(SAY_AGGRO);
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_KILL);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_KILL);
+ }
+
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ _JustDied();
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -86,50 +85,63 @@ public:
if (!UpdateVictim())
return;
- //AmnenarsWrath_Timer
- if (AmnenarsWrath_Timer <= diff)
- {
- DoCastVictim(SPELL_AMNENNARSWRATH);
- AmnenarsWrath_Timer = 12000;
- } else AmnenarsWrath_Timer -= diff;
+ events.Update(diff);
- //FrostBolt_Timer
- if (FrostBolt_Timer <= diff)
- {
- DoCastVictim(SPELL_FROSTBOLT);
- FrostBolt_Timer = 8000;
- } else FrostBolt_Timer -= diff;
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
- if (FrostNova_Timer <= diff)
+ while (uint32 eventId = events.ExecuteEvent())
{
- DoCast(me, SPELL_FROST_NOVA);
- FrostNova_Timer = 15000;
- } else FrostNova_Timer -= diff;
+ switch (eventId)
+ {
+ case EVENT_AMNENNARSWRATH:
+ DoCastVictim(SPELL_AMNENNARSWRATH);
+ events.ScheduleEvent(EVENT_AMNENNARSWRATH, 12000);
+ break;
+ case EVENT_FROSTBOLT:
+ DoCastVictim(SPELL_FROSTBOLT);
+ events.ScheduleEvent(EVENT_FROSTBOLT, 8000);
+ break;
+ case EVENT_FROST_NOVA:
+ DoCast(me, SPELL_FROST_NOVA);
+ events.ScheduleEvent(EVENT_FROST_NOVA, 15000);
+ break;
+ }
+ }
- if (!Spectrals60 && HealthBelowPct(60))
+ if (!hp60Spectrals && HealthBelowPct(60))
{
Talk(SAY_SUMMON60);
DoCastVictim(SPELL_FROST_SPECTRES);
- Spectrals60 = true;
+ hp60Spectrals = true;
}
- if (!Hp && HealthBelowPct(50))
+ if (!hp50 && HealthBelowPct(50))
{
Talk(SAY_HP);
- Hp = true;
+ hp50 = true;
}
- if (!Spectrals30 && HealthBelowPct(30))
+ if (!hp30Spectrals && HealthBelowPct(30))
{
Talk(SAY_SUMMON30);
DoCastVictim(SPELL_FROST_SPECTRES);
- Spectrals30 = true;
+ hp30Spectrals = true;
}
DoMeleeAttackIfReady();
}
+
+ private:
+ bool hp60Spectrals;
+ bool hp30Spectrals;
+ bool hp50;
};
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new boss_amnennar_the_coldbringerAI(creature);
+ }
};
void AddSC_boss_amnennar_the_coldbringer()
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/boss_glutton.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/boss_glutton.cpp
new file mode 100644
index 00000000000..d29831b8cde
--- /dev/null
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/boss_glutton.cpp
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
+ *
+ * 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 "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "razorfen_downs.h"
+
+enum Say
+{
+ SAY_AGGRO = 0,
+ SAY_SLAY = 1,
+ SAY_HP50 = 2,
+ SAY_HP15 = 3
+};
+
+enum Spells
+{
+ SPELL_DISEASE_CLOUD = 12627,
+ SPELL_FRENZY = 12795
+};
+
+class boss_glutton : public CreatureScript
+{
+public:
+ boss_glutton() : CreatureScript("boss_glutton") { }
+
+ struct boss_gluttonAI : public BossAI
+ {
+ boss_gluttonAI(Creature* creature) : BossAI(creature, DATA_GLUTTON) { }
+
+ void Reset() OVERRIDE
+ {
+ _Reset();
+ hp50 = false;
+ hp15 = false;
+ }
+
+ void EnterCombat(Unit* /*who*/) OVERRIDE
+ {
+ _EnterCombat();
+ Talk(SAY_AGGRO);
+ }
+
+ void KilledUnit(Unit* /*victim*/) OVERRIDE
+ {
+ Talk(SAY_SLAY);
+ }
+
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ _JustDied();
+ }
+
+ void UpdateAI(uint32 /*diff*/) OVERRIDE
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (!hp50 && HealthBelowPct(50))
+ {
+ Talk(SAY_HP50);
+ hp50 = true;
+ }
+
+ if (!hp15 && HealthBelowPct(15))
+ {
+ Talk(SAY_HP15);
+ DoCast(me, SPELL_FRENZY);
+ hp15 = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ bool hp50;
+ bool hp15;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new boss_gluttonAI(creature);
+ }
+};
+
+void AddSC_boss_glutton()
+{
+ new boss_glutton();
+}
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/boss_mordresh_fire_eye.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/boss_mordresh_fire_eye.cpp
new file mode 100644
index 00000000000..6026991f253
--- /dev/null
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/boss_mordresh_fire_eye.cpp
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
+ *
+ * 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 "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "razorfen_downs.h"
+
+enum Say
+{
+ SAY_OOC_1 = 0,
+ SAY_OOC_2 = 1,
+ SAY_OOC_3 = 2,
+ SAY_AGGRO = 3
+};
+
+enum Spells
+{
+ SPELL_FIREBALL = 12466,
+ SPELL_FIRE_NOVA = 12470
+};
+
+enum Events
+{
+ EVENT_OOC_1 = 1,
+ EVENT_OOC_2 = 2,
+ EVENT_OOC_3 = 3,
+ EVENT_OOC_4 = 4,
+ EVENT_FIREBALL = 5,
+ EVENT_FIRE_NOVA = 6
+};
+
+class boss_mordresh_fire_eye : public CreatureScript
+{
+public:
+ boss_mordresh_fire_eye() : CreatureScript("boss_mordresh_fire_eye") { }
+
+ struct boss_mordresh_fire_eyeAI : public BossAI
+ {
+ boss_mordresh_fire_eyeAI(Creature* creature) : BossAI(creature, DATA_MORDRESH_FIRE_EYE) { }
+
+ void Reset() OVERRIDE
+ {
+ _Reset();
+ events.ScheduleEvent(EVENT_OOC_1, 10000);
+ }
+
+ void EnterCombat(Unit* /*who*/) OVERRIDE
+ {
+ _EnterCombat();
+ events.Reset();
+ Talk(SAY_AGGRO);
+ events.ScheduleEvent(EVENT_FIREBALL, 100);
+ events.ScheduleEvent(EVENT_FIRE_NOVA, urand(8000, 12000));
+ }
+
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ _JustDied();
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ events.Update(diff);
+
+ if (!UpdateVictim())
+ {
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_OOC_1:
+ Talk(SAY_OOC_1);
+ events.ScheduleEvent(EVENT_OOC_2, 8000);
+ break;
+ case EVENT_OOC_2:
+ Talk(SAY_OOC_2);
+ events.ScheduleEvent(EVENT_OOC_3, 3000);
+ break;
+ case EVENT_OOC_3:
+ me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
+ events.ScheduleEvent(EVENT_OOC_4, 6000);
+ break;
+ case EVENT_OOC_4:
+ Talk(SAY_OOC_3);
+ events.ScheduleEvent(EVENT_OOC_1, 14000);
+ break;
+ }
+ }
+ return;
+ }
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_FIREBALL:
+ DoCastVictim(SPELL_FIREBALL);
+ events.ScheduleEvent(EVENT_FIREBALL, urand(2400, 3800));
+ break;
+ case EVENT_FIRE_NOVA:
+ DoCast(me, SPELL_FIRE_NOVA);
+ events.ScheduleEvent(EVENT_FIRE_NOVA, urand(11000, 16000));
+ break;
+ }
+ }
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new boss_mordresh_fire_eyeAI(creature);
+ }
+};
+
+void AddSC_boss_mordresh_fire_eye()
+{
+ new boss_mordresh_fire_eye();
+}
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/boss_tuten_kash.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/boss_tuten_kash.cpp
new file mode 100644
index 00000000000..0c76da22625
--- /dev/null
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/boss_tuten_kash.cpp
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
+ *
+ * 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 "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "razorfen_downs.h"
+
+enum Spells
+{
+ SPELL_THRASH = 8876,
+ SPELL_WEB_SPRAY = 12252,
+ SPELL_VIRULENT_POISON = 12254,
+ SPELL_CURSE_OF_TUTENKASH = 12255
+};
+
+enum Events
+{
+ EVENT_WEB_SPRAY = 1,
+ EVENT_CURSE_OF_TUTENKASH = 2
+};
+
+class boss_tuten_kash : public CreatureScript
+{
+public:
+ boss_tuten_kash() : CreatureScript("boss_tuten_kash") { }
+
+ struct boss_tuten_kashAI : public BossAI
+ {
+ boss_tuten_kashAI(Creature* creature) : BossAI(creature, DATA_TUTEN_KASH) { }
+
+ void Reset() OVERRIDE
+ {
+ _Reset();
+ if (!me->HasAura(SPELL_THRASH))
+ DoCast(me, SPELL_THRASH);
+ if (!me->HasAura(SPELL_VIRULENT_POISON))
+ DoCast(me, SPELL_VIRULENT_POISON);
+ }
+
+ void EnterCombat(Unit* /*who*/) OVERRIDE
+ {
+ _EnterCombat();
+ events.ScheduleEvent(EVENT_WEB_SPRAY, urand(3000, 5000));
+ events.ScheduleEvent(EVENT_CURSE_OF_TUTENKASH, urand(9000, 14000));
+ }
+
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ _JustDied();
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_WEB_SPRAY:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, false))
+ {
+ if (!target->HasAura(SPELL_WEB_SPRAY))
+ DoCast(target, SPELL_WEB_SPRAY);
+ }
+ events.ScheduleEvent(EVENT_WEB_SPRAY, urand(6000, 8000));
+ break;
+ case EVENT_CURSE_OF_TUTENKASH:
+ DoCast(me, SPELL_CURSE_OF_TUTENKASH);
+ events.ScheduleEvent(EVENT_CURSE_OF_TUTENKASH, urand(15000, 25000));
+ break;
+ }
+ }
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new boss_tuten_kashAI(creature);
+ }
+};
+
+void AddSC_boss_tuten_kash()
+{
+ new boss_tuten_kash();
+}
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp
index 091c7e46585..a4ab03d6611 100644
--- a/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -16,199 +16,219 @@
*/
#include "ScriptMgr.h"
+#include "ObjectMgr.h"
#include "InstanceScript.h"
#include "razorfen_downs.h"
#include "Player.h"
#include "TemporarySummon.h"
-#define MAX_ENCOUNTER 1
+Position const PosSummonTutenkash[15] =
+{
+ // 7349 Tomb Fiend
+ { 2487.339f, 805.9111f, 43.08361f, 2.844887f },
+ { 2485.405f, 804.1145f, 43.68511f, 3.054326f },
+ { 2488.431f, 801.2809f, 42.70374f, 4.29351f },
+ { 2489.914f, 804.7949f, 43.25175f, 1.658063f },
+ { 2541.246f, 907.0941f, 46.64201f, 2.024582f },
+ { 2544.701f, 907.6331f, 46.38007f, 1.605703f },
+ { 2541.49f, 911.1756f, 46.26493f, 4.817109f },
+ { 2544.693f, 912.8887f, 46.39912f, 2.129302f },
+ { 2524.036f, 834.4852f, 48.37031f, 0.8028514f },
+ { 2527.017f, 829.9793f, 48.06498f, 0.6981317f },
+ // 7351 Tomb Reaver
+ { 2542.818f, 904.9359f, 46.80911f, 4.642576f },
+ { 2543.287f, 911.2448f, 46.32785f, 0.6806784f },
+ { 2489.083f, 806.5914f, 43.21102f, 3.682645f },
+ { 2486.828f, 802.8737f, 43.19883f, 2.9147f },
+ // 7355 Tuten'kash
+ { 2487.939f, 804.2224f, 43.10735f, 1.692969f }
+};
class instance_razorfen_downs : public InstanceMapScript
{
public:
- instance_razorfen_downs() : InstanceMapScript("instance_razorfen_downs", 129) { }
-
- InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE
- {
- return new instance_razorfen_downs_InstanceMapScript(map);
- }
+ instance_razorfen_downs() : InstanceMapScript(RFDScriptName, 129) { }
struct instance_razorfen_downs_InstanceMapScript : public InstanceScript
{
instance_razorfen_downs_InstanceMapScript(Map* map) : InstanceScript(map)
{
+ SetBossNumber(EncounterCount);
}
- uint64 uiGongGUID;
-
- uint32 m_auiEncounter[MAX_ENCOUNTER];
-
- uint16 uiGongWaves;
-
- std::string str_data;
-
void Initialize() OVERRIDE
{
- uiGongGUID = 0;
-
- uiGongWaves = 0;
-
- memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
- }
-
- std::string GetSaveData() OVERRIDE
- {
- OUT_SAVE_INST_DATA;
-
- std::ostringstream saveStream;
-
- saveStream << "T C " << m_auiEncounter[0]
- << ' ' << uiGongWaves;
-
- str_data = saveStream.str();
-
- OUT_SAVE_INST_DATA_COMPLETE;
- return str_data;
+ goGongGUID = 0;
+ gongWave = 0;
+ fiendsKilled = 0;
+ reaversKilled = 0;
+ summonLowRange = 0;
+ summonHighRange = 0;
+ summonCreature = 0;
}
- void Load(const char* in) OVERRIDE
+ void OnGameObjectCreate(GameObject* gameObject) OVERRIDE
{
- if (!in)
+ switch (gameObject->GetEntry())
{
- OUT_LOAD_INST_DATA_FAIL;
- return;
+ case GO_GONG:
+ goGongGUID = gameObject->GetGUID();
+ if (GetBossState(DATA_TUTEN_KASH) == DONE)
+ gameObject->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
+ break;
+ case GO_IDOL_OVEN_FIRE:
+ case GO_IDOL_CUP_FIRE:
+ case GO_IDOL_MOUTH_FIRE:
+ if (GetBossState(DATA_EXTINGUISHING_THE_IDOL) == DONE)
+ gameObject->Delete();
+ break;
+ default:
+ break;
}
-
- OUT_LOAD_INST_DATA(in);
-
- char dataHead1, dataHead2;
- uint16 data0, data1;
-
- std::istringstream loadStream(in);
- loadStream >> dataHead1 >> dataHead2 >> data0 >> data1;
-
- if (dataHead1 == 'T' && dataHead2 == 'C')
- {
- m_auiEncounter[0] = data0;
-
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS)
- m_auiEncounter[i] = NOT_STARTED;
-
- uiGongWaves = data1;
- } else OUT_LOAD_INST_DATA_FAIL;
-
- OUT_LOAD_INST_DATA_COMPLETE;
}
- void OnGameObjectCreate(GameObject* go) OVERRIDE
+ bool SetBossState(uint32 type, EncounterState state) OVERRIDE
{
- switch (go->GetEntry())
+ if (!InstanceScript::SetBossState(type, state))
+ return false;
+
+ switch (type)
{
- case GO_GONG:
- uiGongGUID = go->GetGUID();
- if (m_auiEncounter[0] == DONE)
- go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
+ case DATA_TUTEN_KASH:
+ case DATA_MORDRESH_FIRE_EYE:
+ case DATA_GLUTTON:
+ case DATA_AMNENNAR_THE_COLD_BRINGER:
+ case DATA_GONG:
+ case DATA_WAVE:
+ case DATA_EXTINGUISHING_THE_IDOL:
break;
default:
break;
}
+ return true;
}
- void SetData(uint32 uiType, uint32 uiData) OVERRIDE
+ void SetData(uint32 type, uint32 data) OVERRIDE
{
- if (uiType == DATA_GONG_WAVES)
+ if (type == DATA_WAVE)
{
- uiGongWaves = uiData;
-
- switch (uiGongWaves)
+ switch (data)
{
- case 9:
- case 14:
- if (GameObject* go = instance->GetGameObject(uiGongGUID))
- go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
- break;
- case 1:
- case 10:
- case 16:
+ case IN_PROGRESS:
{
- GameObject* go = instance->GetGameObject(uiGongGUID);
-
- if (!go)
- return;
-
- go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
-
- uint32 uiCreature = 0;
- uint8 uiSummonTimes = 0;
+ if (GameObject* go = instance->GetGameObject(goGongGUID))
+ go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
- switch (uiGongWaves)
+ switch (gongWave)
{
- case 1:
- uiCreature = NPC_TOMB_FIEND;
- uiSummonTimes = 7;
- break;
- case 10:
- uiCreature = NPC_TOMB_REAVER;
- uiSummonTimes = 3;
+ case 0:
+ summonLowRange = 0;
+ summonHighRange = 10;
+ summonCreature = NPC_TOMB_FIEND;
break;
- case 16:
- uiCreature = NPC_TUTEN_KASH;
+ case 1:
+ summonLowRange = 10;
+ summonHighRange = 14;
+ summonCreature = NPC_TOMB_REAVER;
break;
- default:
+ case 2:
+ summonLowRange = 14;
+ summonHighRange = 15;
+ summonCreature = NPC_TUTEN_KASH;
break;
}
- if (Creature* creature = go->SummonCreature(uiCreature, 2502.635f, 844.140f, 46.896f, 0.633f))
+ if (GameObject* go = instance->GetGameObject(goGongGUID))
{
- if (uiGongWaves == 10 || uiGongWaves == 1)
+ for (uint8 i = summonLowRange; i < summonHighRange; ++i)
{
- for (uint8 i = 0; i < uiSummonTimes; ++i)
- {
- if (Creature* summon = go->SummonCreature(uiCreature, 2502.635f + float(irand(-5, 5)), 844.140f + float(irand(-5, 5)), 46.896f, 0.633f))
- summon->GetMotionMaster()->MovePoint(0, 2533.479f + float(irand(-5, 5)), 870.020f + float(irand(-5, 5)), 47.678f);
- }
+ Creature* creature = go->SummonCreature(summonCreature, PosSummonTutenkash[i]);
+ creature->GetMotionMaster()->MovePoint(0, 2533.479f + float(irand(-5, 5)), 870.020f + float(irand(-5, 5)), 47.678f);
}
- creature->GetMotionMaster()->MovePoint(0, 2533.479f + float(irand(-5, 5)), 870.020f + float(irand(-5, 5)), 47.678f);
}
+
+ ++gongWave;
break;
}
- default:
+ case NPC_TOMB_FIEND:
+ if (++fiendsKilled == 10)
+ {
+ fiendsKilled = 0;
+ if (GameObject* go = instance->GetGameObject(goGongGUID))
+ go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
+ }
+ break;
+ case NPC_TOMB_REAVER:
+ if (++reaversKilled == 4)
+ {
+ reaversKilled = 0;
+ if (GameObject* go = instance->GetGameObject(goGongGUID))
+ go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
+ }
break;
}
+
}
- if (uiType == BOSS_TUTEN_KASH)
- {
- m_auiEncounter[0] = uiData;
+ }
- if (uiData == DONE)
- SaveToDB();
- }
+ std::string GetSaveData() OVERRIDE
+ {
+ OUT_SAVE_INST_DATA;
+
+ std::ostringstream saveStream;
+ saveStream << "R D " << GetBossSaveData();
+
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return saveStream.str();
}
- uint32 GetData(uint32 uiType) const OVERRIDE
+ void Load(const char* str) OVERRIDE
{
- switch (uiType)
+ if (!str)
{
- case DATA_GONG_WAVES:
- return uiGongWaves;
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
}
- return 0;
- }
+ OUT_LOAD_INST_DATA(str);
- uint64 GetData64(uint32 uiType) const OVERRIDE
- {
- switch (uiType)
+ char dataHead1, dataHead2;
+
+ std::istringstream loadStream(str);
+ loadStream >> dataHead1 >> dataHead2;
+
+ if (dataHead1 == 'R' && dataHead2 == 'D')
{
- case DATA_GONG: return uiGongGUID;
+ for (uint32 i = 0; i < EncounterCount; ++i)
+ {
+ uint32 tmpState;
+ loadStream >> tmpState;
+ if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
+ tmpState = NOT_STARTED;
+ SetBossState(i, EncounterState(tmpState));
+ }
}
+ else
+ OUT_LOAD_INST_DATA_FAIL;
- return 0;
+ OUT_LOAD_INST_DATA_COMPLETE;
}
+
+ protected:
+ uint64 goGongGUID;
+ uint16 gongWave;
+ uint8 fiendsKilled;
+ uint8 reaversKilled;
+ uint8 summonLowRange;
+ uint8 summonHighRange;
+ uint32 summonCreature;
};
+ InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE
+ {
+ return new instance_razorfen_downs_InstanceMapScript(map);
+ }
};
void AddSC_instance_razorfen_downs()
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
index 320c9970077..3b4defeca56 100644
--- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -32,6 +32,10 @@ EndContentData */
#include "ScriptedGossip.h"
#include "razorfen_downs.h"
#include "Player.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "Cell.h"
+#include "CellImpl.h"
/*###
# npc_henry_stern
@@ -101,32 +105,269 @@ public:
};
/*######
-## go_gong
+## npc_belnistrasz for Quest 3525 "Extinguishing the Idol"
######*/
-class go_gong : public GameObjectScript
+Position const PosSummonSpawner[3] =
+{
+ { 2582.789f, 954.3925f, 52.48214f, 3.787364f },
+ { 2569.42f, 956.3801f, 52.27323f, 5.427974f },
+ { 2570.62f, 942.3934f, 53.7433f, 0.715585f }
+};
+
+enum Belnistrasz
+{
+ EVENT_CHANNEL = 1,
+ EVENT_IDOL_ROOM_SPAWNER = 2,
+ EVENT_PROGRESS = 3,
+ EVENT_COMPLETE = 4,
+ EVENT_FIREBALL = 5,
+ EVENT_FROST_NOVA = 6,
+
+ FACTION_ESCORT = 250,
+
+ PATH_ESCORT = 871710,
+ POINT_REACH_IDOL = 17,
+
+ QUEST_EXTINGUISHING_THE_IDOL = 3525,
+
+ SAY_QUEST_ACCEPTED = 0,
+ SAY_EVENT_START = 1,
+ SAY_EVENT_THREE_MIN_LEFT = 2,
+ SAY_EVENT_TWO_MIN_LEFT = 3,
+ SAY_EVENT_ONE_MIN_LEFT = 4,
+ SAY_EVENT_END = 5,
+ SAY_AGGRO = 6, // Combat
+ SAY_WATCH_OUT = 7, // 25% chance to target random creature and say on wave spawn
+
+ SPELL_ARCANE_INTELLECT = 13326,
+ SPELL_FIREBALL = 9053,
+ SPELL_FROST_NOVA = 11831,
+ SPELL_IDOL_SHUTDOWN_VISUAL = 12774, // Hits Unit Entry: 8662
+ SPELL_IDOM_ROOM_CAMERA_SHAKE = 12816 // Dummy needs scripting
+};
+
+class npc_belnistrasz : public CreatureScript
{
public:
- go_gong() : GameObjectScript("go_gong") { }
+ npc_belnistrasz() : CreatureScript("npc_belnistrasz") { }
- bool OnGossipHello(Player* /*player*/, GameObject* go) OVERRIDE
+ struct npc_belnistraszAI : public ScriptedAI
{
- //basic support, not blizzlike data is missing...
- InstanceScript* instance = go->GetInstanceScript();
+ npc_belnistraszAI(Creature* creature) : ScriptedAI(creature)
+ {
+ instance = creature->GetInstanceScript();
+ eventInProgress = false;
+ }
- if (instance)
+ void Reset() OVERRIDE
{
- instance->SetData(DATA_GONG_WAVES, instance->GetData(DATA_GONG_WAVES)+1);
- return true;
+ if (!eventInProgress)
+ {
+ if (!me->HasAura(SPELL_ARCANE_INTELLECT))
+ DoCast(me, SPELL_ARCANE_INTELLECT);
+
+ channeling = false;
+ eventProgress = 0;
+ spawnerCount = 0;
+ me->SetFlag(UNIT_NPC_FLAGS, GOSSIP_OPTION_QUESTGIVER);
+ }
}
- return false;
+ void EnterCombat(Unit* who) OVERRIDE
+ {
+ if (channeling)
+ {
+ Talk(SAY_WATCH_OUT, who);
+ }
+ else
+ {
+ events.ScheduleEvent(EVENT_FIREBALL, 1000);
+ events.ScheduleEvent(EVENT_FROST_NOVA, urand(8000, 12000));
+ if (urand(0, 100) > 40)
+ Talk(SAY_AGGRO, who);
+ }
+ }
+
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ instance->SetBossState(DATA_EXTINGUISHING_THE_IDOL, DONE);
+ me->DespawnOrUnsummon(5000);
+ }
+
+ void sQuestAccept(Player* /*player*/, Quest const* quest) OVERRIDE
+ {
+ if (quest->GetQuestId() == QUEST_EXTINGUISHING_THE_IDOL)
+ {
+ eventInProgress = true;
+ Talk(SAY_QUEST_ACCEPTED);
+ me->RemoveFlag(UNIT_NPC_FLAGS, GOSSIP_OPTION_QUESTGIVER);
+ me->setFaction(FACTION_ESCORT);
+ me->GetMotionMaster()->MovePath(PATH_ESCORT, false);
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 id) OVERRIDE
+ {
+ if (type == WAYPOINT_MOTION_TYPE && id == POINT_REACH_IDOL)
+ {
+ channeling = true;
+ events.ScheduleEvent(EVENT_CHANNEL, 2000);
+ }
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ if (!eventInProgress)
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_CHANNEL:
+ Talk(SAY_EVENT_START);
+ DoCast(me, SPELL_IDOL_SHUTDOWN_VISUAL);
+ events.ScheduleEvent(EVENT_IDOL_ROOM_SPAWNER, 100);
+ events.ScheduleEvent(EVENT_PROGRESS, 120000);
+ break;
+ case EVENT_IDOL_ROOM_SPAWNER:
+ if (Creature* creature = me->SummonCreature(NPC_IDOL_ROOM_SPAWNER, PosSummonSpawner[urand(0,2)], TEMPSUMMON_TIMED_DESPAWN, 4000))
+ creature->AI()->SetData(0,spawnerCount);
+ if (++spawnerCount < 8)
+ events.ScheduleEvent(EVENT_IDOL_ROOM_SPAWNER, 35000);
+ break;
+ case EVENT_PROGRESS:
+ {
+ switch (eventProgress)
+ {
+ case 0:
+ Talk(SAY_EVENT_THREE_MIN_LEFT);
+ ++eventProgress;
+ events.ScheduleEvent(EVENT_PROGRESS, 60000);
+ break;
+ case 1:
+ Talk(SAY_EVENT_TWO_MIN_LEFT);
+ ++eventProgress;
+ events.ScheduleEvent(EVENT_PROGRESS, 60000);
+ break;
+ case 2:
+ Talk(SAY_EVENT_ONE_MIN_LEFT);
+ ++eventProgress;
+ events.ScheduleEvent(EVENT_PROGRESS, 60000);
+ break;
+ case 3:
+ events.CancelEvent(EVENT_IDOL_ROOM_SPAWNER);
+ me->InterruptSpell(CURRENT_CHANNELED_SPELL);
+ Talk(SAY_EVENT_END);
+ events.ScheduleEvent(EVENT_COMPLETE, 3000);
+ break;
+ }
+ break;
+ }
+ case EVENT_COMPLETE:
+ {
+ DoCast(me, SPELL_IDOM_ROOM_CAMERA_SHAKE);
+ me->SummonGameObject(GO_BELNISTRASZS_BRAZIER, 2577.196f, 947.0781f, 53.16757f, 2.356195f, 0, 0, 0.9238796f, 0.3826832f, 3600000);
+ std::list<WorldObject*> ClusterList;
+ Trinity::AllWorldObjectsInRange objects(me, 50.0f);
+ Trinity::WorldObjectListSearcher<Trinity::AllWorldObjectsInRange> searcher(me, ClusterList, objects);
+ me->VisitNearbyObject(50.0f, searcher);
+ for (std::list<WorldObject*>::const_iterator itr = ClusterList.begin(); itr != ClusterList.end(); ++itr)
+ {
+ if (Player* player = (*itr)->ToPlayer())
+ {
+ if (player->GetQuestStatus(QUEST_EXTINGUISHING_THE_IDOL) == QUEST_STATUS_INCOMPLETE)
+ player->CompleteQuest(QUEST_EXTINGUISHING_THE_IDOL);
+ }
+ else if (GameObject* go = (*itr)->ToGameObject())
+ {
+ if (go->GetEntry() == GO_IDOL_OVEN_FIRE || go->GetEntry() == GO_IDOL_CUP_FIRE || go->GetEntry() == GO_IDOL_MOUTH_FIRE)
+ go->Delete();
+ }
+ }
+ instance->SetBossState(DATA_EXTINGUISHING_THE_IDOL, DONE);
+ me->DespawnOrUnsummon();
+ break;
+ }
+ case EVENT_FIREBALL:
+ if (me->HasUnitState(UNIT_STATE_CASTING) || !UpdateVictim())
+ return;
+ DoCastVictim(SPELL_FIREBALL);
+ events.ScheduleEvent(EVENT_FIREBALL, 8000);
+ break;
+ case EVENT_FROST_NOVA:
+ if (me->HasUnitState(UNIT_STATE_CASTING) || !UpdateVictim())
+ return;
+ DoCast(me, SPELL_FROST_NOVA);
+ events.ScheduleEvent(EVENT_FROST_NOVA, 15000);
+ break;
+ }
+ }
+ if (!channeling)
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ InstanceScript* instance;
+ EventMap events;
+ bool eventInProgress;
+ bool channeling;
+ uint8 eventProgress;
+ uint8 spawnerCount;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return GetInstanceAI<npc_belnistraszAI>(creature);
}
+};
+
+class npc_idol_room_spawner : public CreatureScript
+{
+public:
+ npc_idol_room_spawner() : CreatureScript("npc_idol_room_spawner") { }
+
+ struct npc_idol_room_spawnerAI : public ScriptedAI
+ {
+ npc_idol_room_spawnerAI(Creature* creature) : ScriptedAI(creature)
+ {
+ instance = creature->GetInstanceScript();
+ }
+
+ void Reset() OVERRIDE { }
+
+ void SetData(uint32 /*type*/, uint32 data) OVERRIDE
+ {
+ if (data < 7)
+ {
+ me->SummonCreature(NPC_WITHERED_BATTLE_BOAR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
+ if (data > 0 && me->GetOrientation() < 4.0f)
+ me->SummonCreature(NPC_WITHERED_BATTLE_BOAR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
+ me->SummonCreature(NPC_DEATHS_HEAD_GEOMANCER, me->GetPositionX() + (cos(me->GetOrientation() - (M_PI/2)) * 2), me->GetPositionY() + (sin(me->GetOrientation() - (M_PI/2)) * 2), me->GetPositionZ(), me->GetOrientation());
+ me->SummonCreature(NPC_WITHERED_QUILGUARD, me->GetPositionX() + (cos(me->GetOrientation() + (M_PI/2)) * 2), me->GetPositionY() + (sin(me->GetOrientation() + (M_PI/2)) * 2), me->GetPositionZ(), me->GetOrientation());
+ }
+ else if (data == 7)
+ me->SummonCreature(NPC_PLAGUEMAW_THE_ROTTING, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
+ }
+
+ private:
+ InstanceScript* instance;
+ };
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return GetInstanceAI<npc_idol_room_spawnerAI>(creature);
+ }
};
enum TombCreature
{
+ EVENT_WEB = 7,
+ SPELL_POISON_PROC = 3616,
+ SPELL_VIRULENT_POISON_PROC = 12254,
SPELL_WEB = 745
};
@@ -135,11 +376,6 @@ class npc_tomb_creature : public CreatureScript
public:
npc_tomb_creature() : CreatureScript("npc_tomb_creature") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_tomb_creatureAI(creature);
- }
-
struct npc_tomb_creatureAI : public ScriptedAI
{
npc_tomb_creatureAI(Creature* creature) : ScriptedAI(creature)
@@ -147,45 +383,85 @@ public:
instance = creature->GetInstanceScript();
}
- InstanceScript* instance;
+ void Reset() OVERRIDE
+ {
+ if (!me->HasAura(SPELL_POISON_PROC) && me->GetEntry() == NPC_TOMB_FIEND)
+ DoCast(me, SPELL_POISON_PROC);
- uint32 uiWebTimer;
+ if (!me->HasAura(SPELL_VIRULENT_POISON_PROC) && me->GetEntry() == NPC_TOMB_REAVER)
+ DoCast(me, SPELL_VIRULENT_POISON_PROC);
+ }
- void Reset() OVERRIDE
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ instance->SetData(DATA_WAVE, me->GetEntry());
+ }
+
+ void EnterCombat(Unit* /*who*/) OVERRIDE
{
- uiWebTimer = urand(5000, 8000);
+ events.ScheduleEvent(EVENT_WEB, urand(5000, 8000));
}
- void UpdateAI(uint32 uiDiff) OVERRIDE
+ void UpdateAI(uint32 diff) OVERRIDE
{
if (!UpdateVictim())
return;
- //from acid
- if (me->GetEntry() == NPC_TOMB_REAVER)
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
{
- if (uiWebTimer <= uiDiff)
+ switch (eventId)
{
- DoCastVictim(SPELL_WEB);
- uiWebTimer = urand(7000, 16000);
- } else uiWebTimer -= uiDiff;
+ case EVENT_WEB:
+ DoCastVictim(SPELL_WEB);
+ events.ScheduleEvent(EVENT_WEB, urand(7000, 16000));
+ break;
+ }
}
-
DoMeleeAttackIfReady();
}
- void JustDied(Unit* /*killer*/) OVERRIDE
+ private:
+ InstanceScript* instance;
+ EventMap events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return GetInstanceAI<npc_tomb_creatureAI>(creature);
+ }
+};
+
+/*######
+## go_gong
+######*/
+
+class go_gong : public GameObjectScript
+{
+public:
+ go_gong() : GameObjectScript("go_gong") { }
+
+ bool OnGossipHello(Player* /*player*/, GameObject* go) OVERRIDE
+ {
+ InstanceScript* instance = go->GetInstanceScript();
+
+ if (instance)
{
- if (instance)
- instance->SetData(DATA_GONG_WAVES, instance->GetData(DATA_GONG_WAVES)+1);
+ go->SendCustomAnim(0);
+ instance->SetData(DATA_WAVE, IN_PROGRESS);
+ return true;
}
- };
+ return false;
+ }
};
void AddSC_razorfen_downs()
{
new npc_henry_stern();
- new go_gong();
+ new npc_belnistrasz();
+ new npc_idol_room_spawner();
new npc_tomb_creature();
+ new go_gong();
}
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h
index c0f63474f23..4778677e067 100644
--- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -18,27 +18,56 @@
#ifndef DEF_RAZORFEN_DOWNS_H
#define DEF_RAZORFEN_DOWNS_H
-enum Data
+#define RFDScriptName "instance_razorfen_downs"
+
+uint32 const EncounterCount = 5;
+
+enum DataTypes
{
- BOSS_TUTEN_KASH,
- DATA_GONG_WAVES
+ // Main Bosses
+ DATA_TUTEN_KASH = 0,
+ DATA_MORDRESH_FIRE_EYE = 1,
+ DATA_GLUTTON = 2,
+ DATA_AMNENNAR_THE_COLD_BRINGER = 3,
+ // Events
+ DATA_GONG = 4,
+ DATA_WAVE = 5,
+ DATA_EXTINGUISHING_THE_IDOL = 6
};
-enum Data64
+enum CreatureIds
{
- DATA_GONG
+ // Used in Tuten Kash summon event
+ NPC_TOMB_FIEND = 7349,
+ NPC_TOMB_REAVER = 7351,
+ NPC_TUTEN_KASH = 7355,
+ // Used for quest 3525 "Extinguishing the Idol"
+ NPC_IDOL_ROOM_SPAWNER = 8611,
+ NPC_WITHERED_BATTLE_BOAR = 7333,
+ NPC_DEATHS_HEAD_GEOMANCER = 7335,
+ NPC_WITHERED_QUILGUARD = 7329,
+ NPC_PLAGUEMAW_THE_ROTTING = 7356
};
enum GameObjectIds
{
- GO_GONG = 148917
+ // Used for Tuten Kash summon event
+ GO_GONG = 148917,
+ // Used for quest 3525 "Extinguishing the Idol"
+ GO_IDOL_OVEN_FIRE = 151951,
+ GO_IDOL_CUP_FIRE = 151952,
+ GO_IDOL_MOUTH_FIRE = 151973,
+ GO_BELNISTRASZS_BRAZIER = 152097
};
-enum CreatureId
+template<class AI>
+CreatureAI* GetRazorfenDownsAI(Creature* creature)
{
- NPC_TOMB_FIEND = 7349,
- NPC_TOMB_REAVER = 7351,
- NPC_TUTEN_KASH = 7355
-};
+ if (InstanceMap* instance = creature->GetMap()->ToInstanceMap())
+ if (instance->GetInstanceScript())
+ if (instance->GetScriptId() == sObjectMgr->GetScriptId(RFDScriptName))
+ return new AI(creature);
+ return NULL;
+}
#endif
diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp
index 59a24032d5f..9900ba9e3b3 100644
--- a/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp
index ee8618eacc9..f04b71d1da9 100644
--- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2013 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@ public:
if (quest->GetQuestId() == QUEST_WILLIX_THE_IMPORTER)
{
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
- creature->AI()->Talk(SAY_READY, player->GetGUID());
+ creature->AI()->Talk(SAY_READY, player);
creature->setFaction(113);
}
@@ -78,42 +78,42 @@ public:
{
case 3:
me->HandleEmoteCommand(EMOTE_STATE_POINT);
- Talk(SAY_POINT, player->GetGUID());
+ Talk(SAY_POINT, player);
break;
case 4:
me->SummonCreature(ENTRY_BOAR, 2137.66f, 1843.98f, 48.08f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 8:
- Talk(SAY_BLUELEAF, player->GetGUID());
+ Talk(SAY_BLUELEAF, player);
break;
case 9:
- Talk(SAY_DANGER, player->GetGUID());
+ Talk(SAY_DANGER, player);
break;
case 13:
- Talk(SAY_BAD, player->GetGUID());
+ Talk(SAY_BAD, player);
break;
case 14:
me->SummonCreature(ENTRY_BOAR, 2078.91f, 1704.54f, 56.77f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 25:
- Talk(SAY_THINK, player->GetGUID());
+ Talk(SAY_THINK, player);
break;
case 31:
- Talk(SAY_SOON, player->GetGUID());
+ Talk(SAY_SOON, player);
break;
case 42:
- Talk(SAY_FINALY, player->GetGUID());
+ Talk(SAY_FINALY, player);
break;
case 43:
me->SummonCreature(ENTRY_BOAR, 1956.43f, 1596.97f, 81.75f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 45:
- Talk(SAY_WIN, player->GetGUID());
+ Talk(SAY_WIN, player);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
player->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER, me);
break;
case 46:
- Talk(SAY_END, player->GetGUID());
+ Talk(SAY_END, player);
break;
}
}
@@ -176,6 +176,7 @@ public:
void Reset() OVERRIDE
{
IsMovementActive = false;
+ TargetTubberGUID = 0;
}
void MovementInform(uint32 type, uint32 id) OVERRIDE
diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h
index eaf6ef69267..236d06fee52 100644
--- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h
+++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp
index 327fe0d1358..e0771b0ebe2 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -232,7 +232,7 @@ class boss_ayamiss : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_ayamissAI(creature);
+ return GetInstanceAI<boss_ayamissAI>(creature);
}
};
@@ -286,7 +286,7 @@ class npc_hive_zara_larva : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_hive_zara_larvaAI(creature);
+ return GetInstanceAI<npc_hive_zara_larvaAI>(creature);
}
};
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
index a0a093246b6..e62f1781f13 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@ class boss_buru : public CreatureScript
void EnterCombat(Unit* who) OVERRIDE
{
_EnterCombat();
- Talk(EMOTE_TARGET, who->GetGUID());
+ Talk(EMOTE_TARGET, who);
DoCast(me, SPELL_THORNS);
events.ScheduleEvent(EVENT_DISMEMBER, 5000);
@@ -122,7 +122,7 @@ class boss_buru : public CreatureScript
{
DoResetThreat();
AttackStart(victim);
- Talk(EMOTE_TARGET, victim->GetGUID());
+ Talk(EMOTE_TARGET, victim);
}
}
@@ -236,7 +236,7 @@ class npc_buru_egg : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_buru_eggAI(creature);
+ return GetInstanceAI<npc_buru_eggAI>(creature);
}
};
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp
index c13ae5aa9c8..84003576a2a 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -78,7 +78,7 @@ class boss_kurinnaxx : public CreatureScript
{
_JustDied();
if (Creature* Ossirian = me->GetMap()->GetCreature(instance->GetData64(DATA_OSSIRIAN)))
- sCreatureTextMgr->SendChat(Ossirian, SAY_KURINAXX_DEATH, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_ZONE);
+ sCreatureTextMgr->SendChat(Ossirian, SAY_KURINAXX_DEATH, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_ZONE);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -127,7 +127,7 @@ class boss_kurinnaxx : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_kurinnaxxAI(creature);
+ return GetInstanceAI<boss_kurinnaxxAI>(creature);
}
};
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp
index 6a1891e5c62..9dd82bf157e 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp
index 366f74f469e..3852802f43d 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -136,26 +136,23 @@ class boss_ossirian : public CreatureScript
DoCast(me, SPELL_SUPREME);
Talk(SAY_AGGRO);
- if (instance)
- {
- Map* map = me->GetMap();
- if (!map->IsDungeon())
- return;
+ Map* map = me->GetMap();
+ if (!map->IsDungeon())
+ return;
- WorldPacket data(SMSG_WEATHER, (4+4+4));
- data << uint32(WEATHER_STATE_HEAVY_SANDSTORM) << float(1) << uint8(0);
- map->SendToPlayers(&data);
+ WorldPacket data(SMSG_WEATHER, (4+4+4));
+ data << uint32(WEATHER_STATE_HEAVY_SANDSTORM) << float(1) << uint8(0);
+ map->SendToPlayers(&data);
- for (uint8 i = 0; i < NUM_TORNADOS; ++i)
- {
- Position Point;
- me->GetRandomPoint(RoomCenter, RoomRadius, Point);
- if (Creature* Tornado = me->GetMap()->SummonCreature(NPC_SAND_VORTEX, Point))
- Tornado->CastSpell(Tornado, SPELL_SAND_STORM, true);
- }
-
- SpawnNextCrystal();
+ for (uint8 i = 0; i < NUM_TORNADOS; ++i)
+ {
+ Position Point;
+ me->GetRandomPoint(RoomCenter, RoomRadius, Point);
+ if (Creature* Tornado = me->GetMap()->SummonCreature(NPC_SAND_VORTEX, Point))
+ Tornado->CastSpell(Tornado, SPELL_SAND_STORM, true);
}
+
+ SpawnNextCrystal();
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -273,7 +270,7 @@ class boss_ossirian : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_ossirianAI(creature);
+ return GetInstanceAI<boss_ossirianAI>(creature);
}
};
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp
index b8d91065d05..b2aedfb5c99 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp
index 0cf56df50e3..761ca60f714 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h
index 419aaf1c303..8d32bd61740 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp
index 53e09c918ea..c1897ff48ad 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@ enum Spells
SPELL_CLEAVE = 26350,
SPELL_TOXIC_VOLLEY = 25812,
SPELL_POISON_CLOUD = 38718, //Only Spell with right dmg.
- SPELL_ENRAGE = 34624, //Changed cause 25790 is casted on gamers too. Same prob with old explosion of twin emperors.
+ SPELL_ENRAGE = 34624, //Changed cause 25790 is cast on gamers too. Same prob with old explosion of twin emperors.
SPELL_CHARGE = 26561,
SPELL_KNOCKBACK = 26027,
@@ -48,7 +48,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_kriAI(creature);
+ return GetInstanceAI<boss_kriAI>(creature);
}
struct boss_kriAI : public ScriptedAI
@@ -83,14 +83,10 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- {
- if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)
- // Unlootable if death
- me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)// Unlootable if death
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- instance->SetData(DATA_BUG_TRIO_DEATH, 1);
- }
+ instance->SetData(DATA_BUG_TRIO_DEATH, 1);
}
void UpdateAI(uint32 diff) OVERRIDE
{
@@ -145,7 +141,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_vemAI(creature);
+ return GetInstanceAI<boss_vemAI>(creature);
}
struct boss_vemAI : public ScriptedAI
@@ -174,14 +170,10 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- {
- instance->SetData(DATA_VEM_DEATH, 0);
- if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)
- // Unlootable if death
- me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- instance->SetData(DATA_BUG_TRIO_DEATH, 1);
- }
+ instance->SetData(DATA_VEM_DEATH, 0);
+ if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)// Unlootable if death
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ instance->SetData(DATA_BUG_TRIO_DEATH, 1);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -238,7 +230,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_yaujAI(creature);
+ return GetInstanceAI<boss_yaujAI>(creature);
}
struct boss_yaujAI : public ScriptedAI
@@ -267,13 +259,9 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- {
- if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)
- // Unlootable if death
- me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- instance->SetData(DATA_BUG_TRIO_DEATH, 1);
- }
+ if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)// Unlootable if death
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ instance->SetData(DATA_BUG_TRIO_DEATH, 1);
for (uint8 i = 0; i < 10; ++i)
{
@@ -306,25 +294,19 @@ public:
//Casting Heal to other twins or herself.
if (Heal_Timer <= diff)
{
- if (instance)
+ switch (urand(0, 2))
{
- Unit* pKri = Unit::GetUnit(*me, instance->GetData64(DATA_KRI));
- Unit* pVem = Unit::GetUnit(*me, instance->GetData64(DATA_VEM));
-
- switch (urand(0, 2))
- {
- case 0:
- if (pKri)
- DoCast(pKri, SPELL_HEAL);
- break;
- case 1:
- if (pVem)
- DoCast(pVem, SPELL_HEAL);
- break;
- case 2:
- DoCast(me, SPELL_HEAL);
- break;
- }
+ case 0:
+ if (Creature* kri = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_KRI)))
+ DoCast(kri, SPELL_HEAL);
+ break;
+ case 1:
+ if (Creature* vem = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_VEM)))
+ DoCast(vem, SPELL_HEAL);
+ break;
+ case 2:
+ DoCast(me, SPELL_HEAL);
+ break;
}
Heal_Timer = 15000+rand()%15000;
@@ -335,13 +317,10 @@ public:
{
if (!VemDead)
{
- if (instance)
+ if (instance->GetData(DATA_VEMISDEAD))
{
- if (instance->GetData(DATA_VEMISDEAD))
- {
- DoCast(me, SPELL_ENRAGE);
- VemDead = true;
- }
+ DoCast(me, SPELL_ENRAGE);
+ VemDead = true;
}
}
Check_Timer = 2000;
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
index d1f0bb10ecd..9e3244cccdb 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -153,7 +153,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new eye_of_cthunAI(creature);
+ return GetInstanceAI<eye_of_cthunAI>(creature);
}
struct eye_of_cthunAI : public ScriptedAI
@@ -161,8 +161,6 @@ public:
eye_of_cthunAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
- if (!instance)
- TC_LOG_ERROR("scripts", "No Instance eye_of_cthunAI");
SetCombatMovement(false);
}
@@ -206,8 +204,7 @@ public:
me->SetVisible(true);
//Reset Phase
- if (instance)
- instance->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED);
+ instance->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED);
//to avoid having a following void zone
Creature* pPortal= me->FindNearestCreature(NPC_CTHUN_PORTAL, 10);
@@ -218,8 +215,7 @@ public:
void EnterCombat(Unit* /*who*/) OVERRIDE
{
DoZoneInCombat();
- if (instance)
- instance->SetData(DATA_CTHUN_PHASE, PHASE_EYE_GREEN_BEAM);
+ instance->SetData(DATA_CTHUN_PHASE, PHASE_EYE_GREEN_BEAM);
}
void SpawnEyeTentacle(float x, float y)
@@ -236,10 +232,6 @@ public:
if (!UpdateVictim())
return;
- //No instance
- if (!instance)
- return;
-
uint32 currentPhase = instance->GetData(DATA_CTHUN_PHASE);
if (currentPhase == PHASE_EYE_GREEN_BEAM || currentPhase == PHASE_EYE_RED_BEAM)
{
@@ -404,10 +396,6 @@ public:
void DamageTaken(Unit* /*done_by*/, uint32 &damage) OVERRIDE
{
- //No instance
- if (!instance)
- return;
-
switch (instance->GetData(DATA_CTHUN_PHASE))
{
case PHASE_EYE_GREEN_BEAM:
@@ -459,7 +447,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new cthunAI(creature);
+ return GetInstanceAI<cthunAI>(creature);
}
struct cthunAI : public ScriptedAI
@@ -469,8 +457,6 @@ public:
SetCombatMovement(false);
instance = creature->GetInstanceScript();
- if (!instance)
- TC_LOG_ERROR("scripts", "No Instance eye_of_cthunAI");
}
InstanceScript* instance;
@@ -528,8 +514,7 @@ public:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
me->SetVisible(false);
- if (instance)
- instance->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED);
+ instance->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -615,10 +600,6 @@ public:
me->SetTarget(0);
- //No instance
- if (!instance)
- return;
-
uint32 currentPhase = instance->GetData(DATA_CTHUN_PHASE);
if (currentPhase == PHASE_CTHUN_STOMACH || currentPhase == PHASE_CTHUN_WEAK)
{
@@ -861,16 +842,11 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_DONE);
+ instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_DONE);
}
void DamageTaken(Unit* /*done_by*/, uint32 &damage) OVERRIDE
{
- //No instance
- if (!instance)
- return;
-
switch (instance->GetData(DATA_CTHUN_PHASE))
{
case PHASE_CTHUN_STOMACH:
@@ -922,6 +898,7 @@ public:
{
eye_tentacleAI(Creature* creature) : ScriptedAI(creature)
{
+ Portal = 0;
if (Creature* pPortal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
@@ -999,6 +976,7 @@ public:
{
SetCombatMovement(false);
+ Portal = 0;
if (Creature* pPortal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
@@ -1109,6 +1087,7 @@ public:
{
SetCombatMovement(false);
+ Portal = 0;
if (Creature* pPortal = me->SummonCreature(NPC_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
@@ -1228,6 +1207,7 @@ public:
{
SetCombatMovement(false);
+ Portal = 0;
if (Creature* pPortal = me->SummonCreature(NPC_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp
index bc6f03517b8..910b09ec278 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp
index 2104d7f5837..34dc224214e 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp
index 33c3f29b94e..233dc12de4f 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp
index a3edd9ad83d..b8042e8e106 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -160,7 +160,7 @@ public:
//If she is 20% enrage
if (!Enraged)
{
- if (!HealthAbovePct(20) && !me->IsNonMeleeSpellCasted(false))
+ if (!HealthAbovePct(20) && !me->IsNonMeleeSpellCast(false))
{
DoCast(me, SPELL_ENRAGE);
Enraged = true;
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp
index 1921cd77ce6..4708a563098 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp
index 1d888f3ce8b..81171eef580 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -80,7 +80,7 @@ struct boss_twinemperorsAI : public ScriptedAI
uint32 AfterTeleportTimer;
bool DontYellWhenDead;
uint32 Abuse_Bug_Timer, BugsTimer;
- bool tspellcasted;
+ bool tspellcast;
uint32 EnrageTimer;
virtual bool IAmVeklor() = 0;
@@ -92,7 +92,7 @@ struct boss_twinemperorsAI : public ScriptedAI
Heal_Timer = 0; // first heal immediately when they get close together
Teleport_Timer = TELEPORTTIME;
AfterTeleport = false;
- tspellcasted = false;
+ tspellcast = false;
AfterTeleportTimer = 0;
Abuse_Bug_Timer = urand(10000, 17000);
BugsTimer = 2000;
@@ -103,10 +103,7 @@ struct boss_twinemperorsAI : public ScriptedAI
Creature* GetOtherBoss()
{
- if (instance)
- return Unit::GetCreature(*me, instance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR));
- else
- return NULL;
+ return Unit::GetCreature(*me, instance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR));
}
void DamageTaken(Unit* /*done_by*/, uint32 &damage) OVERRIDE
@@ -210,9 +207,6 @@ struct boss_twinemperorsAI : public ScriptedAI
void TeleportToMyBrother()
{
- if (!instance)
- return;
-
Teleport_Timer = TELEPORTTIME;
if (IAmVeklor())
@@ -243,21 +237,21 @@ struct boss_twinemperorsAI : public ScriptedAI
me->AddUnitState(UNIT_STATE_STUNNED);
AfterTeleport = true;
AfterTeleportTimer = 2000;
- tspellcasted = false;
+ tspellcast = false;
}
bool TryActivateAfterTTelep(uint32 diff)
{
if (AfterTeleport)
{
- if (!tspellcasted)
+ if (!tspellcast)
{
me->ClearUnitState(UNIT_STATE_STUNNED);
DoCast(me, SPELL_TWIN_TELEPORT);
me->AddUnitState(UNIT_STATE_STUNNED);
}
- tspellcasted = true;
+ tspellcast = true;
if (AfterTeleportTimer <= diff)
{
@@ -378,7 +372,7 @@ struct boss_twinemperorsAI : public ScriptedAI
{
if (EnrageTimer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(true))
+ if (!me->IsNonMeleeSpellCast(true))
{
DoCast(me, SPELL_BERSERK);
EnrageTimer = 60*60000;
@@ -394,7 +388,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_veknilashAI(creature);
+ return GetInstanceAI<boss_veknilashAI>(creature);
}
struct boss_veknilashAI : public boss_twinemperorsAI
@@ -480,7 +474,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_veklorAI(creature);
+ return GetInstanceAI<boss_veklorAI>(creature);
}
struct boss_veklorAI : public boss_twinemperorsAI
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp
index 115d9d0d12c..44c70075a94 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -263,8 +263,6 @@ class npc_glob_of_viscidus : public CreatureScript
void JustDied(Unit* /*killer*/) OVERRIDE
{
InstanceScript* Instance = me->GetInstanceScript();
- if (!Instance)
- return;
if (Creature* Viscidus = me->GetMap()->GetCreature(Instance->GetData64(DATA_VISCIDUS)))
{
@@ -289,14 +287,15 @@ class npc_glob_of_viscidus : public CreatureScript
if (id == ROOM_CENTER)
{
DoCast(me, SPELL_REJOIN_VISCIDUS);
- ((TempSummon*)me)->UnSummon();
+ if (TempSummon* summon = me->ToTempSummon())
+ summon->UnSummon();
}
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_glob_of_viscidusAI(creature);
+ return GetInstanceAI<npc_glob_of_viscidusAI>(creature);
}
};
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 0a5733f1c7f..b1402f95135 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp
index d78f8bd609d..7fc6af08d9d 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h
index 1a7ba226135..fc858ced774 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp
index 522345c4fd4..f903d1b6da8 100644
--- a/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp
+++ b/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
index 706c6e1804d..72ced3d3399 100644
--- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
+++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -81,7 +81,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_disciple_of_naralexAI(creature);
+ return GetInstanceAI<npc_disciple_of_naralexAI>(creature);
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
@@ -152,9 +152,6 @@ public:
void WaypointReached(uint32 waypointId) OVERRIDE
{
- if (!instance)
- return;
-
switch (waypointId)
{
case 4:
@@ -189,18 +186,15 @@ public:
void EnterCombat(Unit* who) OVERRIDE
{
- Talk(SAY_ATTACKED, who->GetGUID());
+ Talk(SAY_ATTACKED, who);
}
void JustDied(Unit* /*slayer*/) OVERRIDE
{
- if (instance)
- {
- instance->SetData(TYPE_NARALEX_EVENT, FAIL);
- instance->SetData(TYPE_NARALEX_PART1, FAIL);
- instance->SetData(TYPE_NARALEX_PART2, FAIL);
- instance->SetData(TYPE_NARALEX_PART3, FAIL);
- }
+ instance->SetData(TYPE_NARALEX_EVENT, FAIL);
+ instance->SetData(TYPE_NARALEX_PART1, FAIL);
+ instance->SetData(TYPE_NARALEX_PART2, FAIL);
+ instance->SetData(TYPE_NARALEX_PART3, FAIL);
}
void JustSummoned(Creature* summoned) OVERRIDE
@@ -213,8 +207,6 @@ public:
if (currentEvent != TYPE_NARALEX_PART3)
npc_escortAI::UpdateAI(diff);
- if (!instance)
- return;
if (eventTimer <= diff)
{
eventTimer = 0;
diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h
index 0a1848acbf9..c331d5f43c1 100644
--- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h
+++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp b/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp
index bc31fd118be..2ddd60ca442 100644
--- a/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp
+++ b/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -78,8 +78,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_ZUM_RAH, DONE);
+ instance->SetData(DATA_ZUM_RAH, DONE);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -150,7 +149,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_zum_rahAI(creature);
+ return GetInstanceAI<boss_zum_rahAI>(creature);
}
};
diff --git a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp
index 8cb1cfebd15..8a7b5effa67 100644
--- a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp
+++ b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
index a2f98b21589..4b95d33a81e 100644
--- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
+++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -97,7 +97,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_sergeant_blyAI(creature);
+ return GetInstanceAI<npc_sergeant_blyAI>(creature);
}
struct npc_sergeant_blyAI : public ScriptedAI
@@ -148,12 +148,9 @@ public:
if (Player* target = ObjectAccessor::GetPlayer(*me, PlayerGUID))
AttackStart(target);
- if (instance)
- {
- switchFactionIfAlive(instance, ENTRY_RAVEN);
- switchFactionIfAlive(instance, ENTRY_ORO);
- switchFactionIfAlive(instance, ENTRY_MURTA);
- }
+ switchFactionIfAlive(instance, ENTRY_RAVEN);
+ switchFactionIfAlive(instance, ENTRY_ORO);
+ switchFactionIfAlive(instance, ENTRY_MURTA);
}
postGossipStep++;
}
@@ -296,7 +293,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_weegli_blastfuseAI(creature);
+ return GetInstanceAI<npc_weegli_blastfuseAI>(creature);
}
struct npc_weegli_blastfuseAI : public ScriptedAI
@@ -316,8 +313,7 @@ public:
void Reset() OVERRIDE
{
- /*if (instance)
- instance->SetData(0, NOT_STARTED);*/
+ /*instance->SetData(0, NOT_STARTED);*/
}
void AttackStart(Unit* victim) OVERRIDE
@@ -327,8 +323,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- /*if (instance)
- instance->SetData(0, DONE);*/
+ /*instance->SetData(0, DONE);*/
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -358,22 +353,19 @@ public:
void MovementInform(uint32 /*type*/, uint32 /*id*/) OVERRIDE
{
- if (instance)
+ if (instance->GetData(EVENT_PYRAMID) == PYRAMID_CAGES_OPEN)
{
- if (instance->GetData(EVENT_PYRAMID) == PYRAMID_CAGES_OPEN)
- {
- instance->SetData(EVENT_PYRAMID, PYRAMID_ARRIVED_AT_STAIR);
- Talk(SAY_WEEGLI_OHNO);
- me->SetHomePosition(1882.69f, 1272.28f, 41.87f, 0);
- }
- else
- if (destroyingDoor)
- {
- instance->DoUseDoorOrButton(instance->GetData64(GO_END_DOOR));
- /// @todo leave the area...
- me->DespawnOrUnsummon();
- };
+ instance->SetData(EVENT_PYRAMID, PYRAMID_ARRIVED_AT_STAIR);
+ Talk(SAY_WEEGLI_OHNO);
+ me->SetHomePosition(1882.69f, 1272.28f, 41.87f, 0);
}
+ else
+ if (destroyingDoor)
+ {
+ instance->DoUseDoorOrButton(instance->GetData64(GO_END_DOOR));
+ /// @todo leave the area...
+ me->DespawnOrUnsummon();
+ };
}
void DoAction(int32 /*param*/) OVERRIDE
diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp
index e433884c24a..3eceb2adcf7 100644
--- a/src/server/scripts/Kalimdor/boss_azuregos.cpp
+++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/zone_ashenvale.cpp b/src/server/scripts/Kalimdor/zone_ashenvale.cpp
index dbcf054f8f4..ec28ee42625 100644
--- a/src/server/scripts/Kalimdor/zone_ashenvale.cpp
+++ b/src/server/scripts/Kalimdor/zone_ashenvale.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -37,133 +37,118 @@ EndContentData */
# npc_torek
####*/
-enum TorekSays
+enum Torek
{
SAY_READY = 0,
SAY_MOVE = 1,
SAY_PREPARE = 2,
SAY_WIN = 3,
SAY_END = 4,
+ SPELL_REND = 11977,
+ SPELL_THUNDERCLAP = 8078,
+ QUEST_TOREK_ASSULT = 6544,
+ NPC_SPLINTERTREE_RAIDER = 12859,
+ NPC_DURIEL = 12860,
+ NPC_SILVERWING_SENTINEL = 12896,
+ NPC_SILVERWING_WARRIOR = 12897,
+ FACTION_QUEST = 113
};
-enum TorekSpells
+class npc_torek : public CreatureScript
{
- SPELL_REND = 11977,
- SPELL_THUNDERCLAP = 8078,
-};
+public:
+ npc_torek() : CreatureScript("npc_torek") { }
-enum TorekMisc
-{
- QUEST_TOREK_ASSULT = 6544,
+ struct npc_torekAI : public npc_escortAI
+ {
+ npc_torekAI(Creature* creature) : npc_escortAI(creature) { }
- ENTRY_SPLINTERTREE_RAIDER = 12859,
- ENTRY_DURIEL = 12860,
- ENTRY_SILVERWING_SENTINEL = 12896,
- ENTRY_SILVERWING_WARRIOR = 12897,
-};
+ void Reset() OVERRIDE
+ {
+ rend_Timer = 5000;
+ thunderclap_Timer = 8000;
+ _completed = false;
+ }
-class npc_torek : public CreatureScript
-{
- public:
+ void EnterCombat(Unit* /*who*/) OVERRIDE { }
- npc_torek() : CreatureScript("npc_torek")
+ void JustSummoned(Creature* summoned) OVERRIDE
{
+ summoned->AI()->AttackStart(me);
}
- struct npc_torekAI : public npc_escortAI
+ void sQuestAccept(Player* player, Quest const* quest)
{
- npc_torekAI(Creature* creature) : npc_escortAI(creature) { }
-
- uint32 Rend_Timer;
- uint32 Thunderclap_Timer;
- bool Completed;
+ if (quest->GetQuestId() == QUEST_TOREK_ASSULT)
+ {
+ /// @todo find companions, make them follow Torek, at any time (possibly done by core/database in future?)
+ Talk(SAY_READY, player);
+ me->setFaction(FACTION_QUEST);
+ npc_escortAI::Start(true, true, player->GetGUID());
+ }
+ }
- void WaypointReached(uint32 waypointId) OVERRIDE
+ void WaypointReached(uint32 waypointId) OVERRIDE
+ {
+ if (Player* player = GetPlayerForEscort())
{
- if (Player* player = GetPlayerForEscort())
+ switch (waypointId)
{
- switch (waypointId)
- {
- case 1:
- Talk(SAY_MOVE, player->GetGUID());
- break;
- case 8:
- Talk(SAY_PREPARE, player->GetGUID());
- break;
- case 19:
- /// @todo verify location and creatures amount.
- me->SummonCreature(ENTRY_DURIEL, 1776.73f, -2049.06f, 109.83f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- me->SummonCreature(ENTRY_SILVERWING_SENTINEL, 1774.64f, -2049.41f, 109.83f, 1.40f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- me->SummonCreature(ENTRY_SILVERWING_WARRIOR, 1778.73f, -2049.50f, 109.83f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- break;
- case 20:
- Talk(SAY_WIN, player->GetGUID());
- Completed = true;
- player->GroupEventHappens(QUEST_TOREK_ASSULT, me);
- break;
- case 21:
- Talk(SAY_END, player->GetGUID());
- break;
- }
+ case 1:
+ Talk(SAY_MOVE, player);
+ break;
+ case 8:
+ Talk(SAY_PREPARE, player);
+ break;
+ case 19:
+ /// @todo verify location and creatures amount.
+ me->SummonCreature(NPC_DURIEL, 1776.73f, -2049.06f, 109.83f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(NPC_SILVERWING_SENTINEL, 1774.64f, -2049.41f, 109.83f, 1.40f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(NPC_SILVERWING_WARRIOR, 1778.73f, -2049.50f, 109.83f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ break;
+ case 20:
+ Talk(SAY_WIN, player);
+ _completed = true;
+ player->GroupEventHappens(QUEST_TOREK_ASSULT, me);
+ break;
+ case 21:
+ Talk(SAY_END, player);
+ break;
}
}
+ }
- void Reset() OVERRIDE
- {
- Rend_Timer = 5000;
- Thunderclap_Timer = 8000;
- Completed = false;
- }
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ npc_escortAI::UpdateAI(diff);
- void EnterCombat(Unit* /*who*/) OVERRIDE
- {
- }
+ if (!UpdateVictim())
+ return;
- void JustSummoned(Creature* summoned) OVERRIDE
+ if (rend_Timer <= diff)
{
- summoned->AI()->AttackStart(me);
- }
+ DoCastVictim(SPELL_REND);
+ rend_Timer = 20000;
+ } else rend_Timer -= diff;
- void UpdateAI(uint32 diff) OVERRIDE
+ if (thunderclap_Timer <= diff)
{
- npc_escortAI::UpdateAI(diff);
-
- if (!UpdateVictim())
- return;
-
- if (Rend_Timer <= diff)
- {
- DoCastVictim(SPELL_REND);
- Rend_Timer = 20000;
- } else Rend_Timer -= diff;
-
- if (Thunderclap_Timer <= diff)
- {
- DoCast(me, SPELL_THUNDERCLAP);
- Thunderclap_Timer = 30000;
- } else Thunderclap_Timer -= diff;
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_torekAI(creature);
+ DoCast(me, SPELL_THUNDERCLAP);
+ thunderclap_Timer = 30000;
+ } else thunderclap_Timer -= diff;
}
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
- {
- if (quest->GetQuestId() == QUEST_TOREK_ASSULT)
- {
- /// @todo find companions, make them follow Torek, at any time (possibly done by core/database in future?)
- creature->AI()->Talk(SAY_READY, player->GetGUID());
- creature->setFaction(113);
+ private:
+ uint32 rend_Timer;
+ uint32 thunderclap_Timer;
+ bool _completed;
- if (npc_escortAI* pEscortAI = CAST_AI(npc_torekAI, creature->AI()))
- pEscortAI->Start(true, true, player->GetGUID());
- }
+ };
- return true;
- }
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_torekAI(creature);
+ }
};
/*####
@@ -175,96 +160,90 @@ enum RuulSnowhoof
NPC_THISTLEFUR_URSA = 3921,
NPC_THISTLEFUR_TOTEMIC = 3922,
NPC_THISTLEFUR_PATHFINDER = 3926,
-
QUEST_FREEDOM_TO_RUUL = 6482,
-
GO_CAGE = 178147
};
Position const RuulSnowhoofSummonsCoord[6] =
{
- {3449.218018f, -587.825073f, 174.978867f, 4.714445f},
- {3446.384521f, -587.830872f, 175.186279f, 4.714445f},
- {3444.218994f, -587.835327f, 175.380600f, 4.714445f},
- {3508.344482f, -492.024261f, 186.929031f, 4.145029f},
- {3506.265625f, -490.531006f, 186.740128f, 4.239277f},
- {3503.682373f, -489.393799f, 186.629684f, 4.349232f}
+ { 3449.218018f, -587.825073f, 174.978867f, 4.714445f },
+ { 3446.384521f, -587.830872f, 175.186279f, 4.714445f },
+ { 3444.218994f, -587.835327f, 175.380600f, 4.714445f },
+ { 3508.344482f, -492.024261f, 186.929031f, 4.145029f },
+ { 3506.265625f, -490.531006f, 186.740128f, 4.239277f },
+ { 3503.682373f, -489.393799f, 186.629684f, 4.349232f }
};
class npc_ruul_snowhoof : public CreatureScript
{
- public:
- npc_ruul_snowhoof() : CreatureScript("npc_ruul_snowhoof") { }
+public:
+ npc_ruul_snowhoof() : CreatureScript("npc_ruul_snowhoof") { }
- struct npc_ruul_snowhoofAI : public npc_escortAI
+ struct npc_ruul_snowhoofAI : public npc_escortAI
+ {
+ npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) { }
+
+ void Reset() OVERRIDE
{
- npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) { }
+ if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
+ Cage->SetGoState(GO_STATE_READY);
+ }
- void WaypointReached(uint32 waypointId) OVERRIDE
- {
- Player* player = GetPlayerForEscort();
- if (!player)
- return;
+ void EnterCombat(Unit* /*who*/) OVERRIDE { }
- switch (waypointId)
- {
- case 0:
- me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
- Cage->SetGoState(GO_STATE_ACTIVE);
- break;
- case 13:
- me->SummonCreature(NPC_THISTLEFUR_TOTEMIC, RuulSnowhoofSummonsCoord[0], TEMPSUMMON_DEAD_DESPAWN, 60000);
- me->SummonCreature(NPC_THISTLEFUR_URSA, RuulSnowhoofSummonsCoord[1], TEMPSUMMON_DEAD_DESPAWN, 60000);
- me->SummonCreature(NPC_THISTLEFUR_PATHFINDER, RuulSnowhoofSummonsCoord[2], TEMPSUMMON_DEAD_DESPAWN, 60000);
- break;
- case 19:
- me->SummonCreature(NPC_THISTLEFUR_TOTEMIC, RuulSnowhoofSummonsCoord[3], TEMPSUMMON_DEAD_DESPAWN, 60000);
- me->SummonCreature(NPC_THISTLEFUR_URSA, RuulSnowhoofSummonsCoord[4], TEMPSUMMON_DEAD_DESPAWN, 60000);
- me->SummonCreature(NPC_THISTLEFUR_PATHFINDER, RuulSnowhoofSummonsCoord[5], TEMPSUMMON_DEAD_DESPAWN, 60000);
- break;
- case 21:
- player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me);
- break;
- }
- }
-
- void EnterCombat(Unit* /*who*/) OVERRIDE { }
+ void JustSummoned(Creature* summoned) OVERRIDE
+ {
+ summoned->AI()->AttackStart(me);
+ }
- void Reset() OVERRIDE
+ void sQuestAccept(Player* player, Quest const* quest)
+ {
+ if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL)
{
- if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
- Cage->SetGoState(GO_STATE_READY);
+ me->setFaction(FACTION_QUEST);
+ npc_escortAI::Start(true, false, player->GetGUID());
}
+ }
- void JustSummoned(Creature* summoned) OVERRIDE
- {
- summoned->AI()->AttackStart(me);
- }
+ void WaypointReached(uint32 waypointId) OVERRIDE
+ {
+ Player* player = GetPlayerForEscort();
+ if (!player)
+ return;
- void UpdateAI(uint32 diff) OVERRIDE
+ switch (waypointId)
{
- npc_escortAI::UpdateAI(diff);
+ case 0:
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
+ Cage->SetGoState(GO_STATE_ACTIVE);
+ break;
+ case 13:
+ me->SummonCreature(NPC_THISTLEFUR_TOTEMIC, RuulSnowhoofSummonsCoord[0], TEMPSUMMON_DEAD_DESPAWN, 60000);
+ me->SummonCreature(NPC_THISTLEFUR_URSA, RuulSnowhoofSummonsCoord[1], TEMPSUMMON_DEAD_DESPAWN, 60000);
+ me->SummonCreature(NPC_THISTLEFUR_PATHFINDER, RuulSnowhoofSummonsCoord[2], TEMPSUMMON_DEAD_DESPAWN, 60000);
+ break;
+ case 19:
+ me->SummonCreature(NPC_THISTLEFUR_TOTEMIC, RuulSnowhoofSummonsCoord[3], TEMPSUMMON_DEAD_DESPAWN, 60000);
+ me->SummonCreature(NPC_THISTLEFUR_URSA, RuulSnowhoofSummonsCoord[4], TEMPSUMMON_DEAD_DESPAWN, 60000);
+ me->SummonCreature(NPC_THISTLEFUR_PATHFINDER, RuulSnowhoofSummonsCoord[5], TEMPSUMMON_DEAD_DESPAWN, 60000);
+ break;
+ case 21:
+ player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me);
+ break;
}
- };
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_ruul_snowhoofAI(creature);
}
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
+ void UpdateAI(uint32 diff) OVERRIDE
{
- if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL)
- {
- creature->setFaction(113);
-
- if (npc_escortAI* pEscortAI = CAST_AI(npc_ruul_snowhoofAI, (creature->AI())))
- pEscortAI->Start(true, false, player->GetGUID());
- }
-
- return true;
+ npc_escortAI::UpdateAI(diff);
}
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_ruul_snowhoofAI(creature);
+ }
};
enum Muglash
@@ -298,37 +277,68 @@ enum Muglash
Position const FirstNagaCoord[3] =
{
- {3603.504150f, 1122.631104f, 1.635f, 0.0f}, // rider
- {3589.293945f, 1148.664063f, 5.565f, 0.0f}, // sorceress
- {3609.925537f, 1168.759521f, -1.168f, 0.0f} // razortail
+ { 3603.504150f, 1122.631104f, 1.635f, 0.0f }, // rider
+ { 3589.293945f, 1148.664063f, 5.565f, 0.0f }, // sorceress
+ { 3609.925537f, 1168.759521f, -1.168f, 0.0f } // razortail
};
Position const SecondNagaCoord[3] =
{
- {3609.925537f, 1168.759521f, -1.168f, 0.0f}, // witch
- {3645.652100f, 1139.425415f, 1.322f, 0.0f}, // priest
- {3583.602051f, 1128.405762f, 2.347f, 0.0f} // myrmidon
+ { 3609.925537f, 1168.759521f, -1.168f, 0.0f }, // witch
+ { 3645.652100f, 1139.425415f, 1.322f, 0.0f }, // priest
+ { 3583.602051f, 1128.405762f, 2.347f, 0.0f } // myrmidon
};
Position const VorshaCoord = {3633.056885f, 1172.924072f, -5.388f, 0.0f};
class npc_muglash : public CreatureScript
{
- public:
- npc_muglash() : CreatureScript("npc_muglash") { }
+public:
+ npc_muglash() : CreatureScript("npc_muglash") { }
+
+ struct npc_muglashAI : public npc_escortAI
+ {
+ npc_muglashAI(Creature* creature) : npc_escortAI(creature) { }
+
+ void Reset() OVERRIDE
+ {
+ eventTimer = 10000;
+ waveId = 0;
+ _isBrazierExtinguished = false;
+ }
+
+ void EnterCombat(Unit* /*who*/) OVERRIDE
+ {
+ if (Player* player = GetPlayerForEscort())
+ if (HasEscortState(STATE_ESCORT_PAUSED))
+ {
+ if (urand(0, 1))
+ Talk(SAY_MUG_ON_GUARD, player);
+ return;
+ }
+ }
- struct npc_muglashAI : public npc_escortAI
+ void JustDied(Unit* /*killer*/) OVERRIDE
{
- npc_muglashAI(Creature* creature) : npc_escortAI(creature) { }
+ if (HasEscortState(STATE_ESCORT_ESCORTING))
+ if (Player* player = GetPlayerForEscort())
+ player->FailQuest(QUEST_VORSHA);
+ }
- uint8 WaveId;
- uint32 EventTimer;
- bool IsBrazierExtinguished;
+ void JustSummoned(Creature* summoned) OVERRIDE
+ {
+ summoned->AI()->AttackStart(me);
+ }
- void JustSummoned(Creature* summoned) OVERRIDE
+ void sQuestAccept(Player* player, Quest const* quest)
+ {
+ if (quest->GetQuestId() == QUEST_VORSHA)
{
- summoned->AI()->AttackStart(me);
+ Talk(SAY_MUG_START1);
+ me->setFaction(FACTION_QUEST);
+ npc_escortAI::Start(true, false, player->GetGUID());
}
+ }
void WaypointReached(uint32 waypointId) OVERRIDE
{
@@ -337,10 +347,10 @@ class npc_muglash : public CreatureScript
switch (waypointId)
{
case 0:
- Talk(SAY_MUG_START2, player->GetGUID());
+ Talk(SAY_MUG_START2, player);
break;
case 24:
- Talk(SAY_MUG_BRAZIER, player->GetGUID());
+ Talk(SAY_MUG_BRAZIER, player);
if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2))
{
@@ -362,34 +372,9 @@ class npc_muglash : public CreatureScript
}
}
- void EnterCombat(Unit* /*who*/) OVERRIDE
- {
- if (Player* player = GetPlayerForEscort())
- if (HasEscortState(STATE_ESCORT_PAUSED))
- {
- if (urand(0, 1))
- Talk(SAY_MUG_ON_GUARD, player->GetGUID());
- return;
- }
- }
-
- void Reset() OVERRIDE
- {
- EventTimer = 10000;
- WaveId = 0;
- IsBrazierExtinguished = false;
- }
-
- void JustDied(Unit* /*killer*/) OVERRIDE
- {
- if (HasEscortState(STATE_ESCORT_ESCORTING))
- if (Player* player = GetPlayerForEscort())
- player->FailQuest(QUEST_VORSHA);
- }
-
void DoWaveSummon()
{
- switch (WaveId)
+ switch (waveId)
{
case 1:
me->SummonCreature(NPC_WRATH_RIDER, FirstNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
@@ -411,48 +396,40 @@ class npc_muglash : public CreatureScript
}
}
- void UpdateAI(uint32 uiDiff) OVERRIDE
+ void UpdateAI(uint32 diff) OVERRIDE
{
- npc_escortAI::UpdateAI(uiDiff);
+ npc_escortAI::UpdateAI(diff);
if (!me->GetVictim())
{
- if (HasEscortState(STATE_ESCORT_PAUSED) && IsBrazierExtinguished)
+ if (HasEscortState(STATE_ESCORT_PAUSED) && _isBrazierExtinguished)
{
- if (EventTimer < uiDiff)
+ if (eventTimer < diff)
{
- ++WaveId;
+ ++waveId;
DoWaveSummon();
- EventTimer = 10000;
+ eventTimer = 10000;
}
else
- EventTimer -= uiDiff;
+ eventTimer -= diff;
}
return;
}
DoMeleeAttackIfReady();
}
- };
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_muglashAI(creature);
- }
+ private:
+ uint32 eventTimer;
+ uint8 waveId;
+ public:
+ bool _isBrazierExtinguished;
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
- {
- if (quest->GetQuestId() == QUEST_VORSHA)
- {
- if (npc_muglashAI* pEscortAI = CAST_AI(npc_muglashAI, creature->AI()))
- {
- creature->AI()->Talk(SAY_MUG_START1);
- creature->setFaction(113);
+ };
- pEscortAI->Start(true, false, player->GetGUID());
- }
- }
- return true;
- }
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_muglashAI(creature);
+ }
};
class go_naga_brazier : public GameObjectScript
@@ -468,7 +445,7 @@ class go_naga_brazier : public GameObjectScript
{
creature->AI()->Talk(SAY_MUG_BRAZIER_WAIT);
- pEscortAI->IsBrazierExtinguished = true;
+ pEscortAI->_isBrazierExtinguished = true;
return false;
}
}
diff --git a/src/server/scripts/Kalimdor/zone_azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp
index 58829abc940..edc13c8d446 100644
--- a/src/server/scripts/Kalimdor/zone_azshara.cpp
+++ b/src/server/scripts/Kalimdor/zone_azshara.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -40,16 +40,22 @@ EndContentData */
## npc_spitelashes
######*/
+enum Spitelashes
+{
+ SPELL_POLYMORPH_RANK1 = 118,
+ SPELL_POLYMORPH_RANK2 = 12824,
+ SPELL_POLYMORPH_RANK3 = 12825,
+ SPELL_POLYMORPH_RANK4 = 12826,
+ SPELL_POLYMORPH = 29124,
+ SPELL_POLYMORPH_BACKFIRE = 28406,
+ SPELL_REMOVE_POLYMORPH = 6924
+};
+
class npc_spitelashes : public CreatureScript
{
public:
npc_spitelashes() : CreatureScript("npc_spitelashes") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_spitelashesAI(creature);
- }
-
struct npc_spitelashesAI : public ScriptedAI
{
npc_spitelashesAI(Creature* creature) : ScriptedAI(creature) { }
@@ -72,15 +78,15 @@ public:
switch (spell->Id)
{
- case 118:
- case 12824:
- case 12825:
- case 12826:
+ case SPELL_POLYMORPH_RANK1:
+ case SPELL_POLYMORPH_RANK2:
+ case SPELL_POLYMORPH_RANK3:
+ case SPELL_POLYMORPH_RANK4:
if (Player* player = unit->ToPlayer())
if (player->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE)
{
spellhit = true;
- DoCast(me, 29124);
+ DoCast(me, SPELL_POLYMORPH);
}
break;
default:
@@ -102,8 +108,8 @@ public:
morphtimer+=diff;
if (morphtimer >= 5000)
{
- DoCast(me, 28406); //summon copies
- DoCast(me, 6924); //visual explosion
+ DoCast(me, SPELL_POLYMORPH_BACKFIRE); // summon copies
+ DoCast(me, SPELL_REMOVE_POLYMORPH); // visual explosion
}
}
if (!UpdateVictim())
@@ -114,6 +120,10 @@ public:
}
};
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_spitelashesAI(creature);
+ }
};
/*######
@@ -219,7 +229,7 @@ Position const WPs[58] =
{3675.02f, -3960.49f, 35.9118f, 3.67f},
{3653.19f, -3958.33f, 33.9118f, 3.59f},
{3621.12f, -3958.51f, 29.9118f, 3.48f},
- {3604.86f, -3963, 29.9118f, 3.48f},
+ {3604.86f, -3963, 29.9118f, 3.48f},
{3569.94f, -3970.25f, 29.9118f, 3.44f},
{3541.03f, -3975.64f, 29.9118f, 3.41f},
{3510.84f, -3978.71f, 29.9118f, 3.41f},
@@ -260,14 +270,14 @@ Position const WPs[58] =
{2521.05f, -3716.6f, 31.9118f, 2.55f},
{2485.26f, -3706.67f, 31.9118f, 2.51f},
{2458.93f, -3696.67f, 31.9118f, 2.51f},
- {2432, -3692.03f, 31.9118f, 2.46f},
+ {2432, -3692.03f, 31.9118f, 2.46f},
{2399.59f, -3681.97f, 31.9118f, 2.45f},
{2357.75f, -3666.6f, 31.9118f, 2.44f},
{2311.99f, -3656.88f, 31.9118f, 2.94f},
{2263.41f, -3649.55f, 31.9118f, 3.02f},
{2209.05f, -3641.76f, 31.9118f, 2.99f},
{2164.83f, -3637.64f, 31.9118f, 3.15f},
- {2122.42f, -3639, 31.9118f, 3.21f},
+ {2122.42f, -3639, 31.9118f, 3.21f},
{2075.73f, -3643.59f, 31.9118f, 3.22f},
{2033.59f, -3649.52f, 31.9118f, 3.42f},
{1985.22f, -3662.99f, 31.9118f, 3.42f},
@@ -280,51 +290,10 @@ class npc_rizzle_sprysprocket : public CreatureScript
public:
npc_rizzle_sprysprocket() : CreatureScript("npc_rizzle_sprysprocket") { }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF + 1 && player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE)
- {
- player->CLOSE_GOSSIP_MENU();
- creature->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true);
- CAST_AI(npc_rizzle_sprysprocket::npc_rizzle_sprysprocketAI, creature->AI())->MustDieTimer = 3000;
- CAST_AI(npc_rizzle_sprysprocket::npc_rizzle_sprysprocketAI, creature->AI())->MustDie = true;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
- {
- if (player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) != QUEST_STATUS_INCOMPLETE)
- return true;
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(10811, creature->GetGUID());
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_rizzle_sprysprocketAI(creature);
- }
-
struct npc_rizzle_sprysprocketAI : public ScriptedAI
{
npc_rizzle_sprysprocketAI(Creature* creature) : ScriptedAI(creature) { }
- uint32 SpellEscapeTimer;
- uint32 TeleportTimer;
- uint32 CheckTimer;
- uint32 GrenadeTimer;
- uint32 MustDieTimer;
- uint32 CurrWP;
-
- uint64 PlayerGUID;
-
- bool MustDie;
- bool Escape;
- bool ContinueWP;
- bool Reached;
-
void Reset() OVERRIDE
{
SpellEscapeTimer = 1300;
@@ -342,6 +311,47 @@ public:
Reached = false;
}
+ void EnterCombat(Unit* /*who*/) OVERRIDE { }
+
+ void AttackStart(Unit* who) OVERRIDE
+ {
+ if (!who || PlayerGUID)
+ return;
+
+ Player* player = who->ToPlayer();
+
+ if (player && player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE)
+ {
+ PlayerGUID = who->GetGUID();
+ Talk(SAY_RIZZLE_START);
+ DoCast(who, SPELL_RIZZLE_BLACKJACK, false);
+ return;
+ }
+ }
+
+ void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) OVERRIDE
+ {
+ player->CLOSE_GOSSIP_MENU();
+ me->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true);
+ MustDieTimer = 3000;
+ MustDie = true;
+ }
+
+ void MovementInform(uint32 type, uint32 id) OVERRIDE
+ {
+ if (type != POINT_MOTION_TYPE)
+ return;
+
+ if (id == 57)
+ {
+ me->DespawnOrUnsummon();
+ return;
+ }
+
+ ++CurrWP;
+ ContinueWP = true;
+ }
+
void UpdateAI(uint32 diff) OVERRIDE
{
if (MustDie)
@@ -374,7 +384,7 @@ public:
if (!player)
return;
- Talk(MSG_ESCAPE_NOTICE, player->GetGUID());
+ Talk(MSG_ESCAPE_NOTICE, player);
DoCast(me, SPELL_PERIODIC_DEPTH_CHARGE);
me->SetHover(true);
me->SetSwim(true);
@@ -397,7 +407,7 @@ public:
{
if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID))
{
- Talk(SAY_RIZZLE_GRENADE, player->GetGUID());
+ Talk(SAY_RIZZLE_GRENADE, player);
DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true);
}
GrenadeTimer = 30000;
@@ -424,42 +434,35 @@ public:
CheckTimer = 1000;
} else CheckTimer -= diff;
-
- }
-
- void AttackStart(Unit* who) OVERRIDE
- {
- if (!who || PlayerGUID)
- return;
-
- Player* player = who->ToPlayer();
-
- if (player && player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE)
- {
- PlayerGUID = who->GetGUID();
- Talk(SAY_RIZZLE_START);
- DoCast(who, SPELL_RIZZLE_BLACKJACK, false);
- return;
- }
}
- void EnterCombat(Unit* /*who*/) OVERRIDE { }
-
- void MovementInform(uint32 type, uint32 id) OVERRIDE
- {
- if (type != POINT_MOTION_TYPE)
- return;
+ private:
+ uint64 PlayerGUID;
+ uint32 SpellEscapeTimer;
+ uint32 TeleportTimer;
+ uint32 CheckTimer;
+ uint32 GrenadeTimer;
+ uint32 MustDieTimer;
+ uint32 CurrWP;
+ bool MustDie;
+ bool Escape;
+ bool ContinueWP;
+ bool Reached;
+ };
- if (id == 57)
- {
- me->DespawnOrUnsummon();
- return;
- }
+ bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
+ {
+ if (player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) != QUEST_STATUS_INCOMPLETE)
+ return true;
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(10811, creature->GetGUID());
+ return true;
+ }
- ++CurrWP;
- ContinueWP = true;
- }
- };
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_rizzle_sprysprocketAI(creature);
+ }
};
/*####
@@ -470,11 +473,6 @@ class npc_depth_charge : public CreatureScript
public:
npc_depth_charge() : CreatureScript("npc_depth_charge") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_depth_chargeAI(creature);
- }
-
struct npc_depth_chargeAI : public ScriptedAI
{
npc_depth_chargeAI(Creature* creature) : ScriptedAI(creature) { }
@@ -491,20 +489,11 @@ public:
WeMustDieTimer = 1000;
}
- void UpdateAI(uint32 diff) OVERRIDE
- {
- if (WeMustDie)
- {
- if (WeMustDieTimer <= diff)
- me->DespawnOrUnsummon();
- else
- WeMustDieTimer -= diff;
- }
- return;
- }
+ void EnterCombat(Unit* /*who*/) OVERRIDE { }
- void MoveInLineOfSight(Unit* who) OVERRIDE
+ void AttackStart(Unit* /*who*/) OVERRIDE { }
+ void MoveInLineOfSight(Unit* who) OVERRIDE
{
if (!who)
return;
@@ -517,10 +506,23 @@ public:
}
}
- void AttackStart(Unit* /*who*/) OVERRIDE { }
-
- void EnterCombat(Unit* /*who*/) OVERRIDE { }
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ if (WeMustDie)
+ {
+ if (WeMustDieTimer <= diff)
+ me->DespawnOrUnsummon();
+ else
+ WeMustDieTimer -= diff;
+ }
+ return;
+ }
};
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_depth_chargeAI(creature);
+ }
};
void AddSC_azshara()
diff --git a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp
index 812aa5a139f..38bc321d2af 100644
--- a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp
+++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -49,9 +49,7 @@ EndContentData */
enum draeneiSurvivor
{
SAY_HEAL = 0,
-
SAY_HELP = 1,
-
SPELL_IRRIDATION = 35046,
SPELL_STUNNED = 28630
};
@@ -61,11 +59,6 @@ class npc_draenei_survivor : public CreatureScript
public:
npc_draenei_survivor() : CreatureScript("npc_draenei_survivor") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_draenei_survivorAI(creature);
- }
-
struct npc_draenei_survivorAI : public ScriptedAI
{
npc_draenei_survivorAI(Creature* creature) : ScriptedAI(creature) { }
@@ -99,12 +92,11 @@ public:
void EnterCombat(Unit* /*who*/) OVERRIDE { }
void MoveInLineOfSight(Unit* who) OVERRIDE
-
{
if (CanSayHelp && who->GetTypeId() == TYPEID_PLAYER && me->IsFriendlyTo(who) && me->IsWithinDistInMap(who, 25.0f))
{
//Random switch between 4 texts
- Talk(SAY_HELP, who->GetGUID());
+ Talk(SAY_HELP, who);
SayHelpTimer = 20000;
CanSayHelp = false;
@@ -136,7 +128,7 @@ public:
if (Player* player = ObjectAccessor::GetPlayer(*me, pCaster))
{
- Talk(SAY_HEAL, player->GetGUID());
+ Talk(SAY_HEAL, player);
player->TalkedToCreature(me->GetEntry(), me->GetGUID());
}
@@ -169,6 +161,10 @@ public:
}
};
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_draenei_survivorAI(creature);
+ }
};
/*######
@@ -188,39 +184,11 @@ enum Overgrind
SPELL_DYNAMITE = 7978
};
-#define GOSSIP_FIGHT "Traitor! You will be brought to justice!"
-
class npc_engineer_spark_overgrind : public CreatureScript
{
public:
npc_engineer_spark_overgrind() : CreatureScript("npc_engineer_spark_overgrind") { }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF)
- {
- player->CLOSE_GOSSIP_MENU();
- creature->setFaction(FACTION_HOSTILE);
- CAST_AI(npc_engineer_spark_overgrind::npc_engineer_spark_overgrindAI, creature->AI())->AttackStart(player);
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
- {
- if (player->GetQuestStatus(QUEST_GNOMERCY) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_engineer_spark_overgrindAI(creature);
- }
-
struct npc_engineer_spark_overgrindAI : public ScriptedAI
{
npc_engineer_spark_overgrindAI(Creature* creature) : ScriptedAI(creature)
@@ -232,14 +200,6 @@ public:
IsTreeEvent = true;
}
- uint32 NormFaction;
- uint32 NpcFlags;
-
- uint32 DynamiteTimer;
- uint32 EmoteTimer;
-
- bool IsTreeEvent;
-
void Reset() OVERRIDE
{
DynamiteTimer = 8000;
@@ -253,7 +213,14 @@ public:
void EnterCombat(Unit* who) OVERRIDE
{
- Talk(ATTACK_YELL, who->GetGUID());
+ Talk(ATTACK_YELL, who);
+ }
+
+ void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) OVERRIDE
+ {
+ player->CLOSE_GOSSIP_MENU();
+ me->setFaction(FACTION_HOSTILE);
+ me->Attack(player, true);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -281,8 +248,19 @@ public:
DoMeleeAttackIfReady();
}
+
+ private:
+ uint32 NormFaction;
+ uint32 NpcFlags;
+ uint32 DynamiteTimer;
+ uint32 EmoteTimer;
+ bool IsTreeEvent;
};
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_engineer_spark_overgrindAI(creature);
+ }
};
/*######
@@ -294,11 +272,6 @@ class npc_injured_draenei : public CreatureScript
public:
npc_injured_draenei() : CreatureScript("npc_injured_draenei") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_injured_draeneiAI(creature);
- }
-
struct npc_injured_draeneiAI : public ScriptedAI
{
npc_injured_draeneiAI(Creature* creature) : ScriptedAI(creature) { }
@@ -323,10 +296,13 @@ public:
void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { }
-
void UpdateAI(uint32 /*diff*/) OVERRIDE { }
};
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_injured_draeneiAI(creature);
+ }
};
/*######
@@ -341,8 +317,8 @@ enum Magwin
SAY_END1 = 3,
SAY_END2 = 4,
EMOTE_HUG = 5,
-
- QUEST_A_CRY_FOR_SAY_HELP = 9528
+ QUEST_A_CRY_FOR_SAY_HELP = 9528,
+ FACTION_QUEST = 113
};
class npc_magwin : public CreatureScript
@@ -350,25 +326,25 @@ class npc_magwin : public CreatureScript
public:
npc_magwin() : CreatureScript("npc_magwin") { }
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
+ struct npc_magwinAI : public npc_escortAI
{
- if (quest->GetQuestId() == QUEST_A_CRY_FOR_SAY_HELP)
+ npc_magwinAI(Creature* creature) : npc_escortAI(creature) { }
+
+ void Reset() OVERRIDE { }
+
+ void EnterCombat(Unit* who) OVERRIDE
{
- creature->setFaction(113);
- if (npc_escortAI* pEscortAI = CAST_AI(npc_escortAI, creature->AI()))
- pEscortAI->Start(true, false, player->GetGUID());
+ Talk(SAY_AGGRO, who);
}
- return true;
- }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_magwinAI(creature);
- }
-
- struct npc_magwinAI : public npc_escortAI
- {
- npc_magwinAI(Creature* creature) : npc_escortAI(creature) { }
+ void sQuestAccept(Player* player, Quest const* quest)
+ {
+ if (quest->GetQuestId() == QUEST_A_CRY_FOR_SAY_HELP)
+ {
+ me->setFaction(FACTION_QUEST);
+ npc_escortAI::Start(true, false, player->GetGUID());
+ }
+ }
void WaypointReached(uint32 waypointId) OVERRIDE
{
@@ -377,31 +353,28 @@ public:
switch (waypointId)
{
case 0:
- Talk(SAY_START, player->GetGUID());
+ Talk(SAY_START, player);
break;
case 17:
- Talk(SAY_PROGRESS, player->GetGUID());
+ Talk(SAY_PROGRESS, player);
break;
case 28:
- Talk(SAY_END1, player->GetGUID());
+ Talk(SAY_END1, player);
break;
case 29:
- Talk(EMOTE_HUG, player->GetGUID());
- Talk(SAY_END2, player->GetGUID());
+ Talk(EMOTE_HUG, player);
+ Talk(SAY_END2, player);
player->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP, me);
break;
}
}
}
-
- void EnterCombat(Unit* who) OVERRIDE
- {
- Talk(SAY_AGGRO, who->GetGUID());
- }
-
- void Reset() OVERRIDE { }
};
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_magwinAI(creature);
+ }
};
/*######
@@ -435,11 +408,6 @@ class npc_geezle : public CreatureScript
public:
npc_geezle() : CreatureScript("npc_geezle") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_geezleAI(creature);
- }
-
struct npc_geezleAI : public ScriptedAI
{
npc_geezleAI(Creature* creature) : ScriptedAI(creature) { }
@@ -490,7 +458,7 @@ public:
Spark->AI()->Talk(EMOTE_SPARK);
return 1000;
case 2:
- Talk(GEEZLE_SAY_1, SparkGUID);
+ Talk(GEEZLE_SAY_1, Spark);
Spark->SetInFront(me);
me->SetInFront(Spark);
return 5000;
@@ -501,7 +469,7 @@ public:
Spark->AI()->Talk(SPARK_SAY_3);
return 8000;
case 5:
- Talk(GEEZLE_SAY_4, SparkGUID);
+ Talk(GEEZLE_SAY_4, Spark);
return 8000;
case 6:
Spark->AI()->Talk(SPARK_SAY_5);
@@ -510,11 +478,11 @@ public:
Spark->AI()->Talk(SPARK_SAY_6);
return 8000;
case 8:
- Talk(GEEZLE_SAY_7, SparkGUID);
+ Talk(GEEZLE_SAY_7, Spark);
return 2000;
case 9:
me->GetMotionMaster()->MoveTargetedHome();
- Spark->GetMotionMaster()->MovePoint(0, SparkPos);
+ Spark->GetMotionMaster()->MovePoint(0, SparkPos);
CompleteQuest();
return 9000;
case 10:
@@ -570,6 +538,10 @@ public:
}
};
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_geezleAI(creature);
+ }
};
enum RavegerCage
@@ -608,11 +580,6 @@ class npc_death_ravager : public CreatureScript
public:
npc_death_ravager() : CreatureScript("npc_death_ravager") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_death_ravagerAI(creature);
- }
-
struct npc_death_ravagerAI : public ScriptedAI
{
npc_death_ravagerAI(Creature* creature) : ScriptedAI(creature){ }
@@ -652,6 +619,10 @@ public:
}
};
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_death_ravagerAI(creature);
+ }
};
/*########
@@ -695,7 +666,7 @@ class npc_stillpine_capitive : public CreatureScript
{
if (owner)
{
- Talk(CAPITIVE_SAY, owner->GetGUID());
+ Talk(CAPITIVE_SAY, owner);
_player = owner;
}
Position pos;
diff --git a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp
index 694d63d5295..c935a83b3ee 100644
--- a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp
+++ b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -19,18 +19,18 @@
/* ScriptData
SDName: Bloodmyst_Isle
SD%Complete: 80
-SDComment: Quest support: 9670, 9756(gossip items text needed).
+SDComment: Quest support: 9670, 9667
SDCategory: Bloodmyst Isle
EndScriptData */
/* ContentData
npc_webbed_creature
-npc_captured_sunhawk_agent
+npc_princess_stillpine
+go_princess_stillpines_cage
EndContentData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
-#include "ScriptedGossip.h"
#include "Player.h"
/*######
@@ -40,16 +40,16 @@ EndContentData */
//possible creatures to be spawned
uint32 const possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327};
+enum WebbedCreature
+{
+ NPC_EXPEDITION_RESEARCHER = 17681
+};
+
class npc_webbed_creature : public CreatureScript
{
public:
npc_webbed_creature() : CreatureScript("npc_webbed_creature") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_webbed_creatureAI(creature);
- }
-
struct npc_webbed_creatureAI : public ScriptedAI
{
npc_webbed_creatureAI(Creature* creature) : ScriptedAI(creature) { }
@@ -65,9 +65,8 @@ public:
switch (urand(0, 2))
{
case 0:
- spawnCreatureID = 17681;
if (Player* player = killer->ToPlayer())
- player->KilledMonsterCredit(spawnCreatureID, 0);
+ player->KilledMonsterCredit(NPC_EXPEDITION_RESEARCHER, 0);
break;
case 1:
case 2:
@@ -80,72 +79,10 @@ public:
}
};
-};
-
-/*######
-## npc_captured_sunhawk_agent
-######*/
-
-#define C_SUNHAWK_TRIGGER 17974
-
-#define GOSSIP_HELLO_CSA "[PH] "
-#define GOSSIP_SELECT_CSA1 "[PH] "
-#define GOSSIP_SELECT_CSA2 "[PH] "
-#define GOSSIP_SELECT_CSA3 "[PH] "
-#define GOSSIP_SELECT_CSA4 "[PH] "
-#define GOSSIP_SELECT_CSA5 "[PH] "
-
-class npc_captured_sunhawk_agent : public CreatureScript
-{
-public:
- npc_captured_sunhawk_agent() : CreatureScript("npc_captured_sunhawk_agent") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(9137, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(9138, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(9139, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(9140, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- player->SEND_GOSSIP_MENU(9141, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->CLOSE_GOSSIP_MENU();
- player->TalkedToCreature(C_SUNHAWK_TRIGGER, creature->GetGUID());
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- if (player->HasAura(31609) && player->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_CSA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(9136, creature->GetGUID());
- }
- else
- player->SEND_GOSSIP_MENU(9134, creature->GetGUID());
-
- return true;
+ return new npc_webbed_creatureAI(creature);
}
-
};
/*######
@@ -206,7 +143,6 @@ public:
void AddSC_bloodmyst_isle()
{
new npc_webbed_creature();
- new npc_captured_sunhawk_agent();
new npc_princess_stillpine();
new go_princess_stillpines_cage();
}
diff --git a/src/server/scripts/Kalimdor/zone_darkshore.cpp b/src/server/scripts/Kalimdor/zone_darkshore.cpp
index 99a693a0eb6..ae98fbc4072 100644
--- a/src/server/scripts/Kalimdor/zone_darkshore.cpp
+++ b/src/server/scripts/Kalimdor/zone_darkshore.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -63,26 +63,6 @@ class npc_kerlonian : public CreatureScript
public:
npc_kerlonian() : CreatureScript("npc_kerlonian") { }
- bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) OVERRIDE
- {
- if (quest->GetQuestId() == QUEST_SLEEPER_AWAKENED)
- {
- if (npc_kerlonianAI* pKerlonianAI = CAST_AI(npc_kerlonian::npc_kerlonianAI, creature->AI()))
- {
- creature->SetStandState(UNIT_STAND_STATE_STAND);
- creature->AI()->Talk(SAY_KER_START, player->GetGUID());
- pKerlonianAI->StartFollow(player, FACTION_KER_ESCORTEE, quest);
- }
- }
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_kerlonianAI(creature);
- }
-
struct npc_kerlonianAI : public FollowerAI
{
npc_kerlonianAI(Creature* creature) : FollowerAI(creature) { }
@@ -144,7 +124,7 @@ public:
SetFollowPaused(false);
}
- void UpdateFollowerAI(uint32 Diff) OVERRIDE
+ void UpdateFollowerAI(uint32 diff) OVERRIDE
{
if (!UpdateVictim())
{
@@ -153,13 +133,13 @@ public:
if (!HasFollowState(STATE_FOLLOW_PAUSED))
{
- if (FallAsleepTimer <= Diff)
+ if (FallAsleepTimer <= diff)
{
SetSleeping();
FallAsleepTimer = urand(25000, 90000);
}
else
- FallAsleepTimer -= Diff;
+ FallAsleepTimer -= diff;
}
return;
@@ -169,6 +149,25 @@ public:
}
};
+ bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) OVERRIDE
+ {
+ if (quest->GetQuestId() == QUEST_SLEEPER_AWAKENED)
+ {
+ if (npc_kerlonianAI* pKerlonianAI = CAST_AI(npc_kerlonian::npc_kerlonianAI, creature->AI()))
+ {
+ creature->SetStandState(UNIT_STAND_STATE_STAND);
+ creature->AI()->Talk(SAY_KER_START, player);
+ pKerlonianAI->StartFollow(player, FACTION_KER_ESCORTEE, quest);
+ }
+ }
+
+ return true;
+ }
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_kerlonianAI(creature);
+ }
};
/*####
@@ -203,27 +202,23 @@ class npc_prospector_remtravel : public CreatureScript
public:
npc_prospector_remtravel() : CreatureScript("npc_prospector_remtravel") { }
- bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) OVERRIDE
+ struct npc_prospector_remtravelAI : public npc_escortAI
{
- if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2)
- {
- if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI()))
- pEscortAI->Start(false, false, player->GetGUID());
-
- creature->setFaction(FACTION_ESCORTEE);
- }
+ npc_prospector_remtravelAI(Creature* creature) : npc_escortAI(creature) { }
- return true;
- }
+ void Reset() OVERRIDE { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_prospector_remtravelAI(creature);
- }
+ void EnterCombat(Unit* who) OVERRIDE
+ {
+ if (urand(0, 1))
+ Talk(SAY_REM_AGGRO, who);
+ }
- struct npc_prospector_remtravelAI : public npc_escortAI
- {
- npc_prospector_remtravelAI(Creature* creature) : npc_escortAI(creature) { }
+ void JustSummoned(Creature* /*pSummoned*/) OVERRIDE
+ {
+ //unsure if it should be any
+ //pSummoned->AI()->AttackStart(me);
+ }
void WaypointReached(uint32 waypointId) OVERRIDE
{
@@ -232,40 +227,40 @@ public:
switch (waypointId)
{
case 0:
- Talk(SAY_REM_START, player->GetGUID());
+ Talk(SAY_REM_START, player);
break;
case 5:
- Talk(SAY_REM_RAMP1_1, player->GetGUID());
+ Talk(SAY_REM_RAMP1_1, player);
break;
case 6:
DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 9:
- Talk(SAY_REM_RAMP1_2, player->GetGUID());
+ Talk(SAY_REM_RAMP1_2, player);
break;
case 14:
//depend quest rewarded?
- Talk(SAY_REM_BOOK, player->GetGUID());
+ Talk(SAY_REM_BOOK, player);
break;
case 15:
- Talk(SAY_REM_TENT1_1, player->GetGUID());
+ Talk(SAY_REM_TENT1_1, player);
break;
case 16:
DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 17:
- Talk(SAY_REM_TENT1_2, player->GetGUID());
+ Talk(SAY_REM_TENT1_2, player);
break;
case 26:
- Talk(SAY_REM_MOSS, player->GetGUID());
+ Talk(SAY_REM_MOSS, player);
break;
case 27:
- Talk(EMOTE_REM_MOSS, player->GetGUID());
+ Talk(EMOTE_REM_MOSS, player);
break;
case 28:
- Talk(SAY_REM_MOSS_PROGRESS, player->GetGUID());
+ Talk(SAY_REM_MOSS_PROGRESS, player);
break;
case 29:
DoSpawnCreature(NPC_GRAVEL_SCOUT, -15.0f, 3.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
@@ -273,34 +268,37 @@ public:
DoSpawnCreature(NPC_GRAVEL_GEO, -15.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 31:
- Talk(SAY_REM_PROGRESS, player->GetGUID());
+ Talk(SAY_REM_PROGRESS, player);
break;
case 41:
- Talk(SAY_REM_REMEMBER, player->GetGUID());
+ Talk(SAY_REM_REMEMBER, player);
break;
case 42:
- Talk(EMOTE_REM_END, player->GetGUID());
+ Talk(EMOTE_REM_END, player);
player->GroupEventHappens(QUEST_ABSENT_MINDED_PT2, me);
break;
}
}
}
+ };
- void Reset() OVERRIDE { }
-
- void EnterCombat(Unit* who) OVERRIDE
+ bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) OVERRIDE
+ {
+ if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2)
{
- if (urand(0, 1))
- Talk(SAY_REM_AGGRO, who->GetGUID());
- }
+ if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI()))
+ pEscortAI->Start(false, false, player->GetGUID());
- void JustSummoned(Creature* /*pSummoned*/) OVERRIDE
- {
- //unsure if it should be any
- //pSummoned->AI()->AttackStart(me);
+ creature->setFaction(FACTION_ESCORTEE);
}
- };
+ return true;
+ }
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_prospector_remtravelAI(creature);
+ }
};
/*####
@@ -323,37 +321,6 @@ class npc_threshwackonator : public CreatureScript
public:
npc_threshwackonator() : CreatureScript("npc_threshwackonator") { }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
-
- if (npc_threshwackonatorAI* pThreshAI = CAST_AI(npc_threshwackonator::npc_threshwackonatorAI, creature->AI()))
- {
- creature->AI()->Talk(EMOTE_START);
- pThreshAI->StartFollow(player);
- }
- }
-
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
- {
- if (player->GetQuestStatus(QUEST_GYROMAST_REV) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INSERT_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_threshwackonatorAI(creature);
- }
-
struct npc_threshwackonatorAI : public FollowerAI
{
npc_threshwackonatorAI(Creature* creature) : FollowerAI(creature) { }
@@ -369,7 +336,7 @@ public:
{
if (me->IsWithinDistInMap(who, 10.0f))
{
- Talk(SAY_AT_CLOSE, who->GetGUID());
+ Talk(SAY_AT_CLOSE, who);
DoAtEnd();
}
}
@@ -386,6 +353,36 @@ public:
}
};
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
+ {
+ player->PlayerTalkClass->ClearMenus();
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+
+ if (npc_threshwackonatorAI* pThreshAI = CAST_AI(npc_threshwackonator::npc_threshwackonatorAI, creature->AI()))
+ {
+ creature->AI()->Talk(EMOTE_START);
+ pThreshAI->StartFollow(player);
+ }
+ }
+
+ return true;
+ }
+
+ bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
+ {
+ if (player->GetQuestStatus(QUEST_GYROMAST_REV) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INSERT_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
+ return true;
+ }
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_threshwackonatorAI(creature);
+ }
};
void AddSC_darkshore()
diff --git a/src/server/scripts/Kalimdor/zone_desolace.cpp b/src/server/scripts/Kalimdor/zone_desolace.cpp
index b748db4592c..58322963c6e 100644
--- a/src/server/scripts/Kalimdor/zone_desolace.cpp
+++ b/src/server/scripts/Kalimdor/zone_desolace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -61,18 +61,6 @@ class npc_aged_dying_ancient_kodo : public CreatureScript
public:
npc_aged_dying_ancient_kodo() : CreatureScript("npc_aged_dying_ancient_kodo") { }
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
- {
- if (player->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && creature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
- {
- player->TalkedToCreature(creature->GetEntry(), 0);
- player->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF);
- }
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
-
struct npc_aged_dying_ancient_kodoAI : public ScriptedAI
{
npc_aged_dying_ancient_kodoAI(Creature* creature) : ScriptedAI(creature) { }
@@ -111,6 +99,18 @@ public:
}
};
+ bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
+ {
+ if (player->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && creature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
+ {
+ player->TalkedToCreature(creature->GetEntry(), 0);
+ player->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF);
+ }
+
+ player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
+ return true;
+ }
+
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_aged_dying_ancient_kodoAI(creature);
@@ -126,7 +126,7 @@ public:
enum Iruxos
{
QUEST_HAND_IRUXOS = 5381,
- NPC_DEMON_SPIRIT = 11876,
+ NPC_DEMON_SPIRIT = 11876
};
class go_iruxos : public GameObjectScript
@@ -157,28 +157,21 @@ class npc_dalinda : public CreatureScript
public:
npc_dalinda() : CreatureScript("npc_dalinda") { }
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
- {
- if (quest->GetQuestId() == QUEST_RETURN_TO_VAHLARRIEL)
- {
- if (npc_escortAI* escortAI = CAST_AI(npc_dalinda::npc_dalindaAI, creature->AI()))
- {
- escortAI->Start(true, false, player->GetGUID());
- creature->setFaction(113);
- }
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_dalindaAI(creature);
- }
-
struct npc_dalindaAI : public npc_escortAI
{
npc_dalindaAI(Creature* creature) : npc_escortAI(creature) { }
+ void Reset() OVERRIDE { }
+
+ void EnterCombat(Unit* /*who*/) OVERRIDE { }
+
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ if (Player* player = GetPlayerForEscort())
+ player->FailQuest(QUEST_RETURN_TO_VAHLARRIEL);
+ return;
+ }
+
void WaypointReached(uint32 waypointId) OVERRIDE
{
Player* player = GetPlayerForEscort();
@@ -195,25 +188,34 @@ public:
}
}
- void EnterCombat(Unit* /*who*/) OVERRIDE { }
-
- void Reset() OVERRIDE { }
-
- void JustDied(Unit* /*killer*/) OVERRIDE
+ void UpdateAI(uint32 diff) OVERRIDE
{
- if (Player* player = GetPlayerForEscort())
- player->FailQuest(QUEST_RETURN_TO_VAHLARRIEL);
- return;
- }
+ npc_escortAI::UpdateAI(diff);
- void UpdateAI(uint32 Diff) OVERRIDE
- {
- npc_escortAI::UpdateAI(Diff);
if (!UpdateVictim())
return;
+
DoMeleeAttackIfReady();
}
};
+
+ bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
+ {
+ if (quest->GetQuestId() == QUEST_RETURN_TO_VAHLARRIEL)
+ {
+ if (npc_escortAI* escortAI = CAST_AI(npc_dalinda::npc_dalindaAI, creature->AI()))
+ {
+ escortAI->Start(true, false, player->GetGUID());
+ creature->setFaction(113);
+ }
+ }
+ return true;
+ }
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_dalindaAI(creature);
+ }
};
/*######
@@ -223,8 +225,7 @@ public:
enum DemonPortal
{
NPC_DEMON_GUARDIAN = 11937,
-
- QUEST_PORTAL_OF_THE_LEGION = 5581,
+ QUEST_PORTAL_OF_THE_LEGION = 5581
};
class go_demon_portal : public GameObjectScript
diff --git a/src/server/scripts/Kalimdor/zone_durotar.cpp b/src/server/scripts/Kalimdor/zone_durotar.cpp
index ff96d5e8465..08f4f2ebfdf 100644
--- a/src/server/scripts/Kalimdor/zone_durotar.cpp
+++ b/src/server/scripts/Kalimdor/zone_durotar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -80,24 +80,24 @@ public:
if (player && player->GetQuestStatus(QUEST_LAZY_PEONS) == QUEST_STATUS_INCOMPLETE)
{
player->KilledMonsterCredit(me->GetEntry(), me->GetGUID());
- Talk(SAY_SPELL_HIT, caster->GetGUID());
+ Talk(SAY_SPELL_HIT, caster);
me->RemoveAllAuras();
if (GameObject* Lumberpile = me->FindNearestGameObject(GO_LUMBERPILE, 20))
me->GetMotionMaster()->MovePoint(1, Lumberpile->GetPositionX()-1, Lumberpile->GetPositionY(), Lumberpile->GetPositionZ());
}
}
- void UpdateAI(uint32 Diff) OVERRIDE
+ void UpdateAI(uint32 diff) OVERRIDE
{
if (work == true)
me->HandleEmoteCommand(EMOTE_ONESHOT_WORK_CHOPWOOD);
- if (RebuffTimer <= Diff)
+ if (RebuffTimer <= diff)
{
DoCast(me, SPELL_BUFF_SLEEP);
RebuffTimer = 300000; //Rebuff agian in 5 minutes
}
else
- RebuffTimer -= Diff;
+ RebuffTimer -= diff;
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
@@ -208,7 +208,7 @@ class npc_tiger_matriarch_credit : public CreatureScript
me->AddAura(SPELL_NO_SUMMON_AURA, summoner);
me->AddAura(SPELL_DETECT_INVIS, summoner);
summoner->CastSpell(summoner, SPELL_SUMMON_MATRIARCH, true);
- Talk(SAY_MATRIARCH_AGGRO, summoner->GetGUID());
+ Talk(SAY_MATRIARCH_AGGRO, summoner);
}
}
}
diff --git a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
index 9ad9b8dc835..6030ce9f8fc 100644
--- a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
+++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -527,29 +527,29 @@ public:
switch (waypointId)
{
case 7:
- Talk(SAY_STAY_1, player->GetGUID());
+ Talk(SAY_STAY_1, player);
break;
case 11:
- Talk(SAY_STAY_2, player->GetGUID());
+ Talk(SAY_STAY_2, player);
break;
case 25:
- Talk(SAY_STAY_3, player->GetGUID());
+ Talk(SAY_STAY_3, player);
break;
case 26:
- Talk(SAY_STAY_4, player->GetGUID());
+ Talk(SAY_STAY_4, player);
break;
case 27:
- Talk(SAY_STAY_5, player->GetGUID());
+ Talk(SAY_STAY_5, player);
break;
case 28:
- Talk(SAY_STAY_6, player->GetGUID());
+ Talk(SAY_STAY_6, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
break;
case 29:
me->SetStandState(UNIT_STAND_STATE_STAND);
break;
case 37:
- Talk(SAY_QUEST_COMPLETE, player->GetGUID());
+ Talk(SAY_QUEST_COMPLETE, player);
me->SetSpeed(MOVE_RUN, 1.2f, true);
me->SetWalk(false);
if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H))
@@ -565,7 +565,7 @@ public:
void EnterCombat(Unit* who) OVERRIDE
{
- Talk(SAY_ATTACKED_1, who->GetGUID());
+ Talk(SAY_ATTACKED_1, who);
}
void Reset() OVERRIDE { }
diff --git a/src/server/scripts/Kalimdor/zone_felwood.cpp b/src/server/scripts/Kalimdor/zone_felwood.cpp
index 45ef955ccbb..2d322a7c079 100644
--- a/src/server/scripts/Kalimdor/zone_felwood.cpp
+++ b/src/server/scripts/Kalimdor/zone_felwood.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/zone_feralas.cpp b/src/server/scripts/Kalimdor/zone_feralas.cpp
index 3402722e2d7..11e95f325c2 100644
--- a/src/server/scripts/Kalimdor/zone_feralas.cpp
+++ b/src/server/scripts/Kalimdor/zone_feralas.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/zone_moonglade.cpp b/src/server/scripts/Kalimdor/zone_moonglade.cpp
index 7fb423f53ee..3b77a2c7a0b 100644
--- a/src/server/scripts/Kalimdor/zone_moonglade.cpp
+++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -420,7 +420,7 @@ public:
switch (Step)
{
case 0:
- Talk(CLINTAR_SPIRIT_SAY_START, PlayerGUID);
+ Talk(CLINTAR_SPIRIT_SAY_START, player);
EventTimer = 8000;
Step = 1;
break;
diff --git a/src/server/scripts/Kalimdor/zone_mulgore.cpp b/src/server/scripts/Kalimdor/zone_mulgore.cpp
index 2cc6f4bfb5b..f70460ec7b6 100644
--- a/src/server/scripts/Kalimdor/zone_mulgore.cpp
+++ b/src/server/scripts/Kalimdor/zone_mulgore.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
index f1887b9f55a..4b6670043bf 100644
--- a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
+++ b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp
index 7e580a29d3b..b002bbe8a48 100644
--- a/src/server/scripts/Kalimdor/zone_silithus.cpp
+++ b/src/server/scripts/Kalimdor/zone_silithus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -19,12 +19,11 @@
/* ScriptData
SDName: Silithus
SD%Complete: 100
-SDComment: Quest support: 7785, 8304, 8507.
+SDComment: Quest support: 8304, 8507.
SDCategory: Silithus
EndScriptData */
/* ContentData
-npc_highlord_demitrian
npcs_rutgar_and_frankal
quest_a_pawn_on_the_eternal_pawn
EndContentData */
@@ -36,79 +35,6 @@ EndContentData */
#include "Player.h"
/*###
-## npc_highlord_demitrian
-###*/
-
-#define GOSSIP_DEMITRIAN1 "What do you know of it?"
-#define GOSSIP_DEMITRIAN2 "I am listening, Demitrian."
-#define GOSSIP_DEMITRIAN3 "Continue, please."
-#define GOSSIP_DEMITRIAN4 "A battle?"
-#define GOSSIP_DEMITRIAN5 "<Nod>"
-#define GOSSIP_DEMITRIAN6 "Caught unaware? How?"
-#define GOSSIP_DEMITRIAN7 "So what did Ragnaros do next?"
-
-class npc_highlord_demitrian : public CreatureScript
-{
-public:
- npc_highlord_demitrian() : CreatureScript("npc_highlord_demitrian") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(6842, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(6843, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(6844, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(6867, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(6868, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- player->SEND_GOSSIP_MENU(6869, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->SEND_GOSSIP_MENU(6870, creature->GetGUID());
-
- ItemPosCountVec dest;
- uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 19016, 1);
- if (msg == EQUIP_ERR_OK)
- player->StoreNewItem(dest, 19016, true);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(7785) == QUEST_STATUS_NONE &&
- (player->HasItemCount(18563, 1, false) || player->HasItemCount(18564, 1, false)))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(6812, creature->GetGUID());
- return true;
- }
-
-};
-
-/*###
## npcs_rutgar_and_frankal
###*/
@@ -544,11 +470,11 @@ public:
switch (AnimationCount)
{
case 0:
- Talk(ANACHRONOS_SAY_1, Fandral->GetGUID());
+ Talk(ANACHRONOS_SAY_1, Fandral);
break;
case 1:
Fandral->SetTarget(me->GetGUID());
- Fandral->AI()->Talk(FANDRAL_SAY_1, me->GetGUID());
+ Fandral->AI()->Talk(FANDRAL_SAY_1, me);
break;
case 2:
Fandral->SetTarget(0);
@@ -618,7 +544,7 @@ public:
case 21:
break;
case 22:
- Caelestrasz->AI()->Talk(CAELESTRASZ_SAY_2, Fandral->GetGUID());
+ Caelestrasz->AI()->Talk(CAELESTRASZ_SAY_2, Fandral);
break;
case 23:
Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10);
@@ -640,7 +566,7 @@ public:
Caelestrasz->CastSpell(Caelestrasz, 54293, false);
break;
case 28:
- Talk(ANACHRONOS_SAY_2, Fandral->GetGUID());
+ Talk(ANACHRONOS_SAY_2, Fandral);
break;
case 29:
Caelestrasz->GetMotionMaster()->MoveCharge(-8095, 1530, 50, 42);
@@ -649,7 +575,7 @@ public:
case 30:
break;
case 31:
- Talk(ANACHRONOS_SAY_3, Fandral->GetGUID());
+ Talk(ANACHRONOS_SAY_3, Fandral);
break;
case 32:
Caelestrasz->SetVisible(false);
@@ -678,7 +604,7 @@ public:
me->SummonGameObject(GO_GLYPH_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0);
break;
case 39:
- Talk(ANACHRONOS_SAY_5, Fandral->GetGUID());
+ Talk(ANACHRONOS_SAY_5, Fandral);
break;
case 40:
Fandral->CastSpell(me, 25167, true);
@@ -708,10 +634,10 @@ public:
Talk(ANACHRONOS_EMOTE_1);
break;
case 48:
- Fandral->AI()->Talk(FANDRAL_SAY_4, me->GetGUID());
+ Fandral->AI()->Talk(FANDRAL_SAY_4, me);
break;
case 49:
- Fandral->AI()->Talk(FANDRAL_SAY_5, me->GetGUID());
+ Fandral->AI()->Talk(FANDRAL_SAY_5, me);
break;
case 50:
Fandral->AI()->Talk(FANDRAL_EMOTE_2);
@@ -734,7 +660,7 @@ public:
}
case 52:
Fandral->GetMotionMaster()->MoveCharge(-8028.75f, 1538.795f, 2.61f, 4);
- Fandral->AI()->Talk(ANACHRONOS_SAY_9, me->GetGUID());
+ Fandral->AI()->Talk(ANACHRONOS_SAY_9, me);
break;
case 53:
Fandral->AI()->Talk(FANDRAL_SAY_6);
@@ -760,7 +686,7 @@ public:
break;
case 60:
if (player)
- Talk(ANACHRONOS_SAY_10, player->GetGUID());
+ Talk(ANACHRONOS_SAY_10, player);
me->GetMotionMaster()->MoveCharge(-8113.46f, 1524.16f, 2.89f, 4);
break;
case 61:
@@ -1508,7 +1434,6 @@ void AddSC_silithus()
new npc_anachronos_quest_trigger();
new npc_anachronos_the_ancient();
new npc_qiraj_war_spawn();
- new npc_highlord_demitrian();
new npcs_rutgar_and_frankal();
new go_wind_stone();
}
diff --git a/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp
index 891879f2ea6..92fd5a3fd47 100644
--- a/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp
+++ b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp
index 5e27d71ea07..204a2960611 100644
--- a/src/server/scripts/Kalimdor/zone_tanaris.cpp
+++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -103,7 +103,7 @@ public:
void EnterCombat(Unit* who) OVERRIDE
{
- Talk(AGGRO_YELL_AQUE, who->GetGUID());
+ Talk(AGGRO_YELL_AQUE, who);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -191,58 +191,58 @@ public:
switch (waypointId)
{
case 0:
- Talk(WHISPER_CUSTODIAN_1, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_1, player);
break;
case 1:
- Talk(WHISPER_CUSTODIAN_2, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_2, player);
break;
case 2:
- Talk(WHISPER_CUSTODIAN_3, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_3, player);
break;
case 3:
- Talk(WHISPER_CUSTODIAN_4, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_4, player);
break;
case 5:
- Talk(WHISPER_CUSTODIAN_5, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_5, player);
break;
case 6:
- Talk(WHISPER_CUSTODIAN_6, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_6, player);
break;
case 7:
- Talk(WHISPER_CUSTODIAN_7, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_7, player);
break;
case 8:
- Talk(WHISPER_CUSTODIAN_8, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_8, player);
break;
case 9:
- Talk(WHISPER_CUSTODIAN_9, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_9, player);
break;
case 10:
- Talk(WHISPER_CUSTODIAN_4, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_4, player);
break;
case 13:
- Talk(WHISPER_CUSTODIAN_10, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_10, player);
break;
case 14:
- Talk(WHISPER_CUSTODIAN_4, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_4, player);
break;
case 16:
- Talk(WHISPER_CUSTODIAN_11, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_11, player);
break;
case 17:
- Talk(WHISPER_CUSTODIAN_12, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_12, player);
break;
case 18:
- Talk(WHISPER_CUSTODIAN_4, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_4, player);
break;
case 22:
- Talk(WHISPER_CUSTODIAN_13, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_13, player);
break;
case 23:
- Talk(WHISPER_CUSTODIAN_4, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_4, player);
break;
case 24:
- Talk(WHISPER_CUSTODIAN_14, player->GetGUID());
+ Talk(WHISPER_CUSTODIAN_14, player);
DoCast(player, 34883);
// below here is temporary workaround, to be removed when spell works properly
player->AreaExploredOrEventHappens(10277);
diff --git a/src/server/scripts/Kalimdor/zone_teldrassil.cpp b/src/server/scripts/Kalimdor/zone_teldrassil.cpp
index 14f8f2a9dac..a94813f2b0f 100644
--- a/src/server/scripts/Kalimdor/zone_teldrassil.cpp
+++ b/src/server/scripts/Kalimdor/zone_teldrassil.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -79,7 +79,7 @@ public:
{
if (me->IsWithinDistInMap(who, 10.0f))
{
- Talk(SAY_AT_HOME, who->GetGUID());
+ Talk(SAY_AT_HOME, who);
DoComplete();
}
}
diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp
index 292017d2cc4..7b08baa0511 100644
--- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp
+++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -109,7 +109,7 @@ public:
creature->setFaction(FACTION_ESCORTEE);
creature->SetStandState(UNIT_STAND_STATE_STAND);
- creature->AI()->Talk(SAY_GIL_START, player->GetGUID());
+ creature->AI()->Talk(SAY_GIL_START, player);
if (npc_giltharesAI* pEscortAI = CAST_AI(npc_gilthares::npc_giltharesAI, creature->AI()))
pEscortAI->Start(false, false, player->GetGUID(), quest);
@@ -137,22 +137,22 @@ public:
switch (waypointId)
{
case 16:
- Talk(SAY_GIL_AT_LAST, player->GetGUID());
+ Talk(SAY_GIL_AT_LAST, player);
break;
case 17:
- Talk(SAY_GIL_PROCEED, player->GetGUID());
+ Talk(SAY_GIL_PROCEED, player);
break;
case 18:
- Talk(SAY_GIL_FREEBOOTERS, player->GetGUID());
+ Talk(SAY_GIL_FREEBOOTERS, player);
break;
case 37:
- Talk(SAY_GIL_ALMOST, player->GetGUID());
+ Talk(SAY_GIL_ALMOST, player);
break;
case 47:
- Talk(SAY_GIL_SWEET, player->GetGUID());
+ Talk(SAY_GIL_SWEET, player);
break;
case 53:
- Talk(SAY_GIL_FREED, player->GetGUID());
+ Talk(SAY_GIL_FREED, player);
player->GroupEventHappens(QUEST_FREE_FROM_HOLD, me);
break;
}
@@ -168,7 +168,7 @@ public:
if (who->GetTypeId() != TYPEID_PLAYER && me->GetAreaId() == AREA_MERCHANT_COAST)
{
//appears to be pretty much random (possible only if escorter not in combat with who yet?)
- Talk(SAY_GIL_AGGRO, who->GetGUID());
+ Talk(SAY_GIL_AGGRO, who);
}
}
};
@@ -345,10 +345,7 @@ public:
BigWill = 0;
}
- void EnterCombat(Unit* /*who*/) OVERRIDE { }
-
void MoveInLineOfSight(Unit* who) OVERRIDE
-
{
if (!who || !who->IsAlive() || EventInProgress)
return;
@@ -362,8 +359,6 @@ public:
}
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE { }
-
void UpdateAI(uint32 diff) OVERRIDE
{
if (EventInProgress)
@@ -408,7 +403,7 @@ public:
if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324)
{
warrior->AreaExploredOrEventHappens(1719);
- Talk(SAY_TWIGGY_FLATHEAD_BEGIN, warrior->GetGUID());
+ Talk(SAY_TWIGGY_FLATHEAD_BEGIN, warrior);
for (uint8 i = 0; i < 6; ++i)
{
@@ -577,10 +572,10 @@ public:
switch (PointId)
{
case 9:
- Talk(SAY_STARTUP2, player->GetGUID());
+ Talk(SAY_STARTUP2, player);
break;
case 18:
- Talk(SAY_PROGRESS_1, player->GetGUID());
+ Talk(SAY_PROGRESS_1, player);
SetRun();
break;
}
diff --git a/src/server/scripts/Kalimdor/zone_thousand_needles.cpp b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp
index 1ba9bf2cb54..f027fd05f8b 100644
--- a/src/server/scripts/Kalimdor/zone_thousand_needles.cpp
+++ b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -146,7 +146,7 @@ public:
{
if (quest->GetQuestId() == QUEST_FREE_AT_LAST)
{
- creature->AI()->Talk(SAY_LAKO_START, player->GetGUID());
+ creature->AI()->Talk(SAY_LAKO_START, player);
creature->setFaction(FACTION_ESCORTEE_LAKO);
if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsong::npc_lakota_windsongAI, creature->AI()))
@@ -229,7 +229,7 @@ public:
{
if (quest->GetQuestId() == QUEST_HOMEWARD)
{
- creature->AI()->Talk(SAY_START, player->GetGUID());
+ creature->AI()->Talk(SAY_START, player);
creature->setFaction(FACTION_ESCORTEE);
if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountain::npc_paoka_swiftmountainAI, creature->AI()))
diff --git a/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp
index fee15608884..10538fb2387 100644
--- a/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp
+++ b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp
index 5f19e838c8a..dd165f807b2 100644
--- a/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp
+++ b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -62,7 +62,7 @@ public:
if (quest->GetQuestId() == QUEST_CHASING_AME)
{
CAST_AI(npc_escortAI, (creature->AI()))->Start(false, false, player->GetGUID());
- creature->AI()->Talk(SAY_READY, player->GetGUID());
+ creature->AI()->Talk(SAY_READY, player);
creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
// Change faction so mobs attack
creature->setFaction(113);
@@ -89,21 +89,21 @@ public:
{
case 19:
me->SummonCreature(ENTRY_STOMPER, -6391.69f, -1730.49f, -272.83f, 4.96f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- Talk(SAY_AGGRO1, player->GetGUID());
+ Talk(SAY_AGGRO1, player);
break;
case 28:
- Talk(SAY_SEARCH, player->GetGUID());
+ Talk(SAY_SEARCH, player);
break;
case 38:
me->SummonCreature(ENTRY_TARLORD, -6370.75f, -1382.84f, -270.51f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- Talk(SAY_AGGRO2, player->GetGUID());
+ Talk(SAY_AGGRO2, player);
break;
case 49:
me->SummonCreature(ENTRY_TARLORD1, -6324.44f, -1181.05f, -270.17f, 4.34f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- Talk(SAY_AGGRO3, player->GetGUID());
+ Talk(SAY_AGGRO3, player);
break;
case 55:
- Talk(SAY_FINISH, player->GetGUID());
+ Talk(SAY_FINISH, player);
player->GroupEventHappens(QUEST_CHASING_AME, me);
break;
}
diff --git a/src/server/scripts/Kalimdor/zone_winterspring.cpp b/src/server/scripts/Kalimdor/zone_winterspring.cpp
index 18df584e64a..3ae8bc38120 100644
--- a/src/server/scripts/Kalimdor/zone_winterspring.cpp
+++ b/src/server/scripts/Kalimdor/zone_winterspring.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -524,7 +524,7 @@ public:
if (Player* player = GetPlayerForEscort())
{
me->SetFacingToObject(player);
- Talk(SAY_RANSHALLA_END_1, player->GetGUID());
+ Talk(SAY_RANSHALLA_END_1, player);
}
break;
case SAY_RANSHALLA_END_2:
@@ -538,7 +538,7 @@ public:
if (Player* player = GetPlayerForEscort())
{
player->GroupEventHappens(QUEST_GUARDIANS_ALTAR, me);
- Talk(SAY_RANSHALLA_END_2, player->GetGUID());
+ Talk(SAY_RANSHALLA_END_2, player);
}
me->DespawnOrUnsummon(4000);
break;
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h
index 5b8cf0a4d44..3830ba3c8aa 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp
index 977aa97a974..8f71ae47bcb 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 a670e14338e..84c9181e495 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -147,7 +147,7 @@ class boss_elder_nadox : public CreatureScript
if (me->HealthBelowPct(100 - AmountHealthModifier * 25))
{
- Talk(EMOTE_HATCHES, me->GetGUID());
+ Talk(EMOTE_HATCHES, me);
DoCast(me, SPELL_SUMMON_SWARM_GUARD);
++AmountHealthModifier;
}
@@ -232,7 +232,6 @@ public:
npc_nadox_eggsAI(Creature* creature) : ScriptedAI(creature)
{
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
- creature->UpdateAllStats();
}
void Reset() 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 5bb68a4c886..7555ba39206 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -33,7 +33,7 @@ enum Spells
SPELL_MIND_FLAY = 57941,
SPELL_SHADOW_BOLT_VOLLEY = 57942,
SPELL_SHIVER = 57949,
- SPELL_CLONE_PLAYER = 57507, //casted on player during insanity
+ SPELL_CLONE_PLAYER = 57507, //cast on player during insanity
SPELL_INSANITY_PHASING_1 = 57508,
SPELL_INSANITY_PHASING_2 = 57509,
SPELL_INSANITY_PHASING_3 = 57510,
@@ -149,11 +149,8 @@ public:
uiShadowBoltVolleyTimer = 5*IN_MILLISECONDS;
uiShiverTimer = 15*IN_MILLISECONDS;
- if (instance)
- {
- instance->SetBossState(DATA_HERALD_VOLAZJ, NOT_STARTED);
- instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT);
- }
+ instance->SetBossState(DATA_HERALD_VOLAZJ, NOT_STARTED);
+ instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT);
// Visible for all players in insanity
me->SetPhaseMask((1|16|32|64|128|256), true);
@@ -172,11 +169,8 @@ public:
{
Talk(SAY_AGGRO);
- if (instance)
- {
- instance->SetBossState(DATA_HERALD_VOLAZJ, IN_PROGRESS);
- instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT);
- }
+ instance->SetBossState(DATA_HERALD_VOLAZJ, IN_PROGRESS);
+ instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT);
}
void JustSummoned(Creature* summon) OVERRIDE
@@ -295,22 +289,22 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetBossState(DATA_HERALD_VOLAZJ, DONE);
+ instance->SetBossState(DATA_HERALD_VOLAZJ, DONE);
Summons.DespawnAll();
ResetPlayersPhaseMask();
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_SLAY);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_SLAY);
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_volazjAI(creature);
+ return GetInstanceAI<boss_volazjAI>(creature);
}
};
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 a68a122bc31..1890dfb4ff8 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -101,15 +101,12 @@ public:
bCanDown = false;
volunteerWork = true;
- if (instance)
- {
- if (!bFirstTime)
- instance->SetBossState(DATA_JEDOGA_SHADOWSEEKER, FAIL);
+ if (!bFirstTime)
+ instance->SetBossState(DATA_JEDOGA_SHADOWSEEKER, FAIL);
- instance->SetData64(DATA_PL_JEDOGA_TARGET, 0);
- instance->SetData64(DATA_ADD_JEDOGA_OPFER, 0);
- instance->SetData(DATA_JEDOGA_RESET_INITIANDS, 0);
- }
+ instance->SetData64(DATA_PL_JEDOGA_TARGET, 0);
+ instance->SetData64(DATA_ADD_JEDOGA_OPFER, 0);
+ instance->SetData(DATA_JEDOGA_RESET_INITIANDS, 0);
MoveUp();
bFirstTime = false;
@@ -144,8 +141,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
Talk(TEXT_DEATH);
- if (instance)
- instance->SetBossState(DATA_JEDOGA_SHADOWSEEKER, DONE);
+ instance->SetBossState(DATA_JEDOGA_SHADOWSEEKER, DONE);
}
void DoAction(int32 action) OVERRIDE
@@ -197,9 +193,6 @@ public:
void MoveDown()
{
- if (!instance)
- return;
-
bOpFerokFail = false;
instance->SetData(DATA_JEDOGA_TRIGGER_SWITCH, 0);
@@ -233,9 +226,6 @@ public:
void MoveUp()
{
- if (!instance)
- return;
-
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
@@ -255,9 +245,6 @@ public:
void OpferRufen()
{
- if (!instance)
- return;
-
uint64 opfer = instance->GetData64(DATA_ADD_JEDOGA_INITIAND);
if (opfer)
@@ -281,9 +268,6 @@ public:
void UpdateAI(uint32 diff) OVERRIDE
{
- if (!instance)
- return;
-
if (instance->GetBossState(DATA_JEDOGA_SHADOWSEEKER) != IN_PROGRESS && instance->GetData(DATA_ALL_INITIAND_DEAD))
MoveDown();
@@ -337,7 +321,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_jedoga_shadowseekerAI(creature);
+ return GetInstanceAI<boss_jedoga_shadowseekerAI>(creature);
}
};
@@ -361,9 +345,6 @@ public:
void Reset() OVERRIDE
{
- if (!instance)
- return;
-
bWalking = false;
bCheckTimer = 2*IN_MILLISECONDS;
@@ -503,7 +484,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_jedoga_initiandAI(creature);
+ return GetInstanceAI<npc_jedoga_initiandAI>(creature);
}
};
@@ -528,8 +509,8 @@ public:
instance = creature->GetInstanceScript();
bRemoved = false;
bRemoved2 = false;
- bCasted = false;
- bCasted2 = false;
+ bCast = false;
+ bCast2 = false;
SetCombatMovement(false);
}
@@ -538,8 +519,8 @@ public:
bool bRemoved;
bool bRemoved2;
- bool bCasted;
- bool bCasted2;
+ bool bCast;
+ bool bCast2;
void Reset() OVERRIDE { }
void EnterCombat(Unit* /*who*/) OVERRIDE { }
@@ -549,9 +530,6 @@ public:
void UpdateAI(uint32 /*diff*/) OVERRIDE
{
- if (!instance)
- return;
-
if (!bRemoved && me->GetPositionX() > 440.0f)
{
if (instance->GetBossState(DATA_PRINCE_TALDARAM) == DONE)
@@ -560,23 +538,23 @@ public:
bRemoved = true;
return;
}
- if (!bCasted)
+ if (!bCast)
{
DoCast(me, SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_1, false);
- bCasted = true;
+ bCast = true;
}
}
if (!bRemoved2 && me->GetPositionX() < 440.0f)
{
- if (!bCasted2 && instance->GetData(DATA_JEDOGA_TRIGGER_SWITCH))
+ if (!bCast2 && instance->GetData(DATA_JEDOGA_TRIGGER_SWITCH))
{
DoCast(me, SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_2, false);
- bCasted2 = true;
+ bCast2 = true;
}
- if (bCasted2 && !instance->GetData(DATA_JEDOGA_TRIGGER_SWITCH))
+ if (bCast2 && !instance->GetData(DATA_JEDOGA_TRIGGER_SWITCH))
{
me->InterruptNonMeleeSpells(true);
- bCasted2 = false;
+ bCast2 = false;
}
if (!bRemoved2 && instance->GetBossState(DATA_JEDOGA_SHADOWSEEKER) == DONE)
{
@@ -589,7 +567,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_jedogas_aufseher_triggerAI(creature);
+ return GetInstanceAI<npc_jedogas_aufseher_triggerAI>(creature);
}
};
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 e0098570923..77d3ce21d0c 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp
index 7207bbd3aab..6f03228ad76 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h
index 5087ed0cec3..674e5cf36bb 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
index 81530265617..8a9fc2993a8 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -130,11 +130,8 @@ public:
Summons.DespawnAll();
- if (instance)
- {
- instance->SetBossState(DATA_ANUBARAK, NOT_STARTED);
- instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
- }
+ instance->SetBossState(DATA_ANUBARAK, NOT_STARTED);
+ instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
Creature* DoSummonImpaleTarget(Unit* target)
@@ -158,14 +155,12 @@ public:
{
Talk(SAY_AGGRO);
DelayTimer = 0;
- if (instance)
- instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
+ instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
void DelayEventStart()
{
- if (instance)
- instance->SetBossState(DATA_ANUBARAK, IN_PROGRESS);
+ instance->SetBossState(DATA_ANUBARAK, IN_PROGRESS);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -335,8 +330,7 @@ public:
{
Talk(SAY_DEATH);
Summons.DespawnAll();
- if (instance)
- instance->SetBossState(DATA_ANUBARAK, DONE);
+ instance->SetBossState(DATA_ANUBARAK, DONE);
}
void KilledUnit(Unit* victim) OVERRIDE
@@ -355,7 +349,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_anub_arakAI(creature);
+ return GetInstanceAI<boss_anub_arakAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp
index 1664a1375ae..7534e747ee0 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -102,14 +102,12 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_HADRONOX, DONE);
+ instance->SetBossState(DATA_HADRONOX, DONE);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_HADRONOX, IN_PROGRESS);
+ instance->SetBossState(DATA_HADRONOX, IN_PROGRESS);
me->SetInCombatWithZone();
}
@@ -192,7 +190,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_hadronoxAI(creature);
+ return GetInstanceAI<boss_hadronoxAI>(creature);
}
};
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 143ccc29e0d..2fe619a5367 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -104,8 +104,7 @@ public:
uiMindFlayTimer = 15*IN_MILLISECONDS;
uiCurseFatigueTimer = 12*IN_MILLISECONDS;
- if (instance)
- instance->SetBossState(DATA_KRIKTHIR_THE_GATEWATCHER, NOT_STARTED);
+ instance->SetBossState(DATA_KRIKTHIR_THE_GATEWATCHER, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -114,8 +113,7 @@ public:
Summon();
uiSummonTimer = 15*IN_MILLISECONDS;
- if (instance)
- instance->SetBossState(DATA_KRIKTHIR_THE_GATEWATCHER, IN_PROGRESS);
+ instance->SetBossState(DATA_KRIKTHIR_THE_GATEWATCHER, IN_PROGRESS);
}
void Summon()
@@ -175,8 +173,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetBossState(DATA_KRIKTHIR_THE_GATEWATCHER, DONE);
+ instance->SetBossState(DATA_KRIKTHIR_THE_GATEWATCHER, DONE);
}
void KilledUnit(Unit* victim) OVERRIDE
@@ -195,7 +192,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_krik_thirAI(creature);
+ return GetInstanceAI<boss_krik_thirAI>(creature);
}
};
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 b20a28b7a75..0b641eea3bc 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/CMakeLists.txt b/src/server/scripts/Northrend/CMakeLists.txt
index 3c56361d096..42a7ee15bb6 100644
--- a/src/server/scripts/Northrend/CMakeLists.txt
+++ b/src/server/scripts/Northrend/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
@@ -45,6 +45,7 @@ set(scripts_STAT_SRCS
Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp
Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h
Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
+ Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp
Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
index 2088ef2fa2e..045564ce570 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -37,12 +37,6 @@ enum Enums
SAY_SARTHARION_SLAY = 8,
WHISPER_LAVA_CHURN = 9,
- WHISPER_HATCH_EGGS = 6,
- WHISPER_OPEN_PORTAL = 6, // whisper, shared by two dragons
-
- WHISPER_SHADRON_DICIPLE = 7,
- WHISPER_VESPERON_DICIPLE = 7,
-
//Sartharion Spells
SPELL_BERSERK = 61632, // Increases the caster's attack speed by 150% and all damage it deals by 500% for 5 min.
SPELL_CLEAVE = 56909, // Inflicts 35% weapon damage to an enemy and its nearest allies, affecting up to 10 targets.
@@ -51,77 +45,32 @@ enum Enums
SPELL_TAIL_LASH = 56910, // A sweeping tail strike hits all enemies behind the caster, inflicting 3063 to 3937 damage and stunning them for 2 sec.
SPELL_TAIL_LASH_H = 58957, // A sweeping tail strike hits all enemies behind the caster, inflicting 4375 to 5625 damage and stunning them for 2 sec.
SPELL_WILL_OF_SARTHARION = 61254, // Sartharion's presence bolsters the resolve of the Twilight Drakes, increasing their total health by 25%. This effect also increases Sartharion's health by 25%.
- SPELL_LAVA_STRIKE = 57571, // (Real spell casted should be 57578) 57571 then trigger visual missile, then summon Lava Blaze on impact(spell 57572)
+ SPELL_LAVA_STRIKE = 57571, // (Real spell cast should be 57578) 57571 then trigger visual missile, then summon Lava Blaze on impact(spell 57572)
SPELL_TWILIGHT_REVENGE = 60639,
NPC_FIRE_CYCLONE = 30648,
SPELL_PYROBUFFET = 56916, // currently used for hard enrage after 15 minutes
SPELL_PYROBUFFET_RANGE = 58907, // possibly used when player get too far away from dummy creatures (2x Creature entry 30494)
- SPELL_TWILIGHT_SHIFT_ENTER = 57620, // enter phase. Player get this when click GO
- SPELL_TWILIGHT_SHIFT = 57874, // Twilight Shift Aura
- SPELL_TWILIGHT_SHIFT_REMOVAL = 61187, // leave phase
- SPELL_TWILIGHT_SHIFT_REMOVAL_ALL = 61190, // leave phase (probably version to make all leave)
-
- //Mini bosses common spells
- SPELL_TWILIGHT_RESIDUE = 61885, // makes immune to shadow damage, applied when leave phase
-
- //Miniboses (Vesperon, Shadron, Tenebron)
- SPELL_SHADOW_BREATH_H = 59126, // Inflicts 8788 to 10212 Fire damage to enemies in a cone in front of the caster.
- SPELL_SHADOW_BREATH = 57570, // Inflicts 6938 to 8062 Fire damage to enemies in a cone in front of the caster.
-
- SPELL_SHADOW_FISSURE_H = 59127, // Deals 9488 to 13512 Shadow damage to any enemy within the Shadow fissure after 5 sec.
- SPELL_SHADOW_FISSURE = 57579, // Deals 6188 to 8812 Shadow damage to any enemy within the Shadow fissure after 5 sec.
-
//Vesperon
//In portal is a disciple, when disciple killed remove Power_of_vesperon, portal open multiple times
NPC_ACOLYTE_OF_VESPERON = 31219, // Acolyte of Vesperon
SPELL_POWER_OF_VESPERON = 61251, // Vesperon's presence decreases the maximum health of all enemies by 25%.
- SPELL_TWILIGHT_TORMENT_VESP = 57948, // (Shadow only) trigger 57935 then 57988
- SPELL_TWILIGHT_TORMENT_VESP_ACO = 58853, // (Fire and Shadow) trigger 58835 then 57988
//Shadron
//In portal is a disciple, when disciple killed remove Power_of_vesperon, portal open multiple times
NPC_ACOLYTE_OF_SHADRON = 31218, // Acolyte of Shadron
SPELL_POWER_OF_SHADRON = 58105, // Shadron's presence increases Fire damage taken by all enemies by 100%.
- SPELL_GIFT_OF_TWILIGTH_SHA = 57835, // TARGET_SCRIPT shadron
- SPELL_GIFT_OF_TWILIGTH_SAR = 58766, // TARGET_SCRIPT sartharion
- SPELL_VOID_BLAST = 57581, // Twilight Fissure
- SPELL_VOID_BLAST_H = 59128,
//Tenebron
//in the portal spawns 6 eggs, if not killed in time (approx. 20s) they will hatch, whelps can cast 60708
SPELL_POWER_OF_TENEBRON = 61248, // Tenebron's presence increases Shadow damage taken by all enemies by 100%.
- //Tenebron, dummy spell
- SPELL_SUMMON_TWILIGHT_WHELP = 58035, // doesn't work, will spawn NPC_TWILIGHT_WHELP
- SPELL_SUMMON_SARTHARION_TWILIGHT_WHELP = 58826, // doesn't work, will spawn NPC_SHARTHARION_TWILIGHT_WHELP
-
- SPELL_HATCH_EGGS_H = 59189,
- SPELL_HATCH_EGGS = 58542,
- SPELL_HATCH_EGGS_EFFECT_H = 59190,
- SPELL_HATCH_EGGS_EFFECT = 58685,
- NPC_TWILIHT_WHELP = 31214,
- NPC_TWILIGHT_EGG = 30882,
- NPC_SARTHARION_TWILIGHT_EGG = 31204,
-
- //Whelps
- NPC_TWILIGHT_WHELP = 30890,
- NPC_SHARTHARION_TWILIGHT_WHELP = 31214,
- SPELL_FADE_ARMOR = 60708, // Reduces the armor of an enemy by 1500 for 15s
-
- //flame tsunami
- SPELL_FLAME_TSUNAMI = 57494, // the visual dummy
- SPELL_FLAME_TSUNAMI_LEAP = 60241, // SPELL_EFFECT_138 some leap effect, causing caster to move in direction
-
- SPELL_FLAME_TSUNAMI_DMG_AURA = 57491, // periodic damage, npc has this aura
- SPELL_FLAME_TSUNAMI_BUFF = 60430,
NPC_FLAME_TSUNAMI = 30616, // for the flame waves
- NPC_LAVA_BLAZE = 30643, // adds spawning from flame strike
//using these custom points for dragons start and end
POINT_ID_INIT = 100,
- POINT_ID_LAND = 200,
+ POINT_ID_LAND = 200
};
enum Misc
@@ -129,87 +78,49 @@ enum Misc
DATA_CAN_LOOT = 0
};
-struct Waypoint
-{
- float m_fX, m_fY, m_fZ;
-};
-
-struct Location
-{
- float x, y, z;
-};
-struct Locations
-{
- float x, y, z;
-};
+Position const FlameRight1Spawn = { 3200.00f, 573.211f, 57.1551f, 0.0f };
+Position const FlameRight1Direction = { 3289.28f, 573.211f, 57.1551f, 0.0f };
+Position const FlameRight2Spawn = { 3200.00f, 532.211f, 57.1551f, 0.0f };
+Position const FlameRight2Direction = { 3289.28f, 532.211f, 57.1551f, 0.0f };
+Position const FlameRight3Spawn = { 3200.00f, 491.211f, 57.1551f, 0.0f };
+Position const FlameRight3Direction = { 3289.28f, 491.211f, 57.1551f, 0.0f };
+Position const FlameLeft1Spawn = { 3289.28f, 511.711f, 57.1551f, 0.0f };
+Position const FlameLeft1Direction = { 3200.00f, 511.711f, 57.1551f, 0.0f };
+Position const FlameLeft2Spawn = { 3289.28f, 552.711f, 57.1551f, 0.0f };
+Position const FlameLeft2Direction = { 3200.00f, 552.711f, 57.1551f, 0.0f };
//each dragons special points. First where fly to before connect to connon, second where land point is.
-Waypoint m_aTene[]=
+Position const TenebronPositions[] =
{
- {3212.854f, 575.597f, 109.856f}, //init
- {3246.425f, 565.367f, 61.249f} //end
+ { 3212.854f, 575.597f, 109.856f, 0.0f }, // init
+ { 3246.425f, 565.367f, 61.249f, 0.0f } // end
};
-Waypoint m_aShad[]=
+Position const ShadronPositions[] =
{
- {3293.238f, 472.223f, 106.968f},
- {3271.669f, 526.907f, 61.931f}
+ { 3293.238f, 472.223f, 106.968f, 0.0f },
+ { 3271.669f, 526.907f, 61.931f, 0.0f }
};
-Waypoint m_aVesp[]=
+Position const VesperonPositions[] =
{
- {3193.310f, 472.861f, 102.697f},
- {3227.268f, 533.238f, 59.995f}
+ { 3193.310f, 472.861f, 102.697f, 0.0f },
+ { 3227.268f, 533.238f, 59.995f, 0.0f }
};
-#define MAX_WAYPOINT 6
-//points around raid "isle", counter clockwise. should probably be adjusted to be more alike
-Waypoint m_aDragonCommon[MAX_WAYPOINT]=
+enum SartharionEvents
{
- {3214.012f, 468.932f, 98.652f},
- {3244.950f, 468.427f, 98.652f},
- {3283.520f, 496.869f, 98.652f},
- {3287.316f, 555.875f, 98.652f},
- {3250.479f, 585.827f, 98.652f},
- {3209.969f, 566.523f, 98.652f}
+ EVENT_HARD_ENRAGE = 1,
+ EVENT_FLAME_TSUNAMI = 2,
+ EVENT_FLAME_BREATH = 3,
+ EVENT_TAIL_SWEEP = 4,
+ EVENT_CLEAVE_ATTACK = 5,
+ EVENT_LAVA_STRIKE = 6,
+ EVENT_CALL_TENEBRON = 7,
+ EVENT_CALL_SHADRON = 8,
+ EVENT_CALL_VESPERON = 9
};
-static Location FlameRight1Spawn = { 3200.00f, 573.211f, 57.1551f };
-static Location FlameRight1Direction = { 3289.28f, 573.211f, 57.1551f };
-static Location FlameRight2Spawn = { 3200.00f, 532.211f, 57.1551f };
-static Location FlameRight2Direction = { 3289.28f, 532.211f, 57.1551f };
-static Location FlameRight3Spawn = { 3200.00f, 491.211f, 57.1551f };
-static Location FlameRight3Direction = { 3289.28f, 491.211f, 57.1551f };
-static Location FlameLeft1Spawn = { 3289.28f, 511.711f, 57.1551f };
-static Location FlameLeft1Direction = { 3200.00f, 511.711f, 57.1551f };
-static Location FlameLeft2Spawn = { 3289.28f, 552.711f, 57.1551f };
-static Location FlameLeft2Direction = { 3200.00f, 552.711f, 57.1551f };
-
-static Location AcolyteofShadron = { 3363.92f, 534.703f, 97.2683f };
-static Location AcolyteofShadron2 = { 3246.57f, 551.263f, 58.6164f };
-static Location AcolyteofVesperon = { 3145.68f, 520.71f, 89.7f };
-static Location AcolyteofVesperon2 = { 3246.57f, 551.263f, 58.6164f };
-Locations TwilightEggs[] =
-{
- {3219.28f, 669.121f, 88.5549f},
- {3221.55f, 682.852f, 90.5361f},
- {3239.77f, 685.94f, 90.3168f},
- {3250.33f, 669.749f, 88.7637f},
- {3246.6f, 642.365f, 84.8752f},
- {3233.68f, 653.117f, 85.7051f}
-};
-Locations TwilightEggsSarth[] =
-{
- {3252.73f, 515.762f, 58.5501f},
- {3256.56f, 521.119f, 58.6061f},
- {3255.63f, 527.513f, 58.7568f},
- {3264.90f, 525.865f, 58.6436f},
- {3264.26f, 516.364f, 58.8011f},
- {3257.54f, 502.285f, 58.2077f}
-};
-
-#define TWILIGHT_ACHIEVEMENTS 1
-
/*######
## Boss Sartharion
######*/
@@ -219,175 +130,71 @@ class boss_sartharion : public CreatureScript
public:
boss_sartharion() : CreatureScript("boss_sartharion") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ struct boss_sartharionAI : public BossAI
{
- return new boss_sartharionAI(creature);
- }
-
- struct boss_sartharionAI : public ScriptedAI
- {
- boss_sartharionAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- }
-
- InstanceScript* instance;
-
- bool m_bIsBerserk;
- bool m_bIsSoftEnraged;
-
- uint32 m_uiEnrageTimer;
- bool m_bIsHardEnraged;
-
- uint32 m_uiTenebronTimer;
- uint32 m_uiShadronTimer;
- uint32 m_uiVesperonTimer;
-
- uint32 m_uiFlameTsunamiTimer;
- uint32 m_uiFlameBreathTimer;
- uint32 m_uiTailSweepTimer;
- uint32 m_uiCleaveTimer;
- uint32 m_uiLavaStrikeTimer;
-
- bool m_bHasCalledTenebron;
- bool m_bHasCalledShadron;
- bool m_bHasCalledVesperon;
-
- uint8 drakeCount;
+ boss_sartharionAI(Creature* creature) : BossAI(creature, DATA_SARTHARION) { }
void Reset() OVERRIDE
{
- m_bIsBerserk = false;
- m_bIsSoftEnraged = false;
-
- m_uiEnrageTimer = 15*MINUTE*IN_MILLISECONDS;
- m_bIsHardEnraged = false;
-
- m_uiTenebronTimer = 30000;
- m_uiShadronTimer = 75000;
- m_uiVesperonTimer = 120000;
-
- m_uiFlameTsunamiTimer = 30000;
- m_uiFlameBreathTimer = 20000;
- m_uiTailSweepTimer = 20000;
- m_uiCleaveTimer = 7000;
- m_uiLavaStrikeTimer = 5000;
-
- m_bHasCalledTenebron = false;
- m_bHasCalledShadron = false;
- m_bHasCalledVesperon = false;
+ _isBerserk = false;
+ _isSoftEnraged = false;
+ _isHardEnraged = false;
+ drakeCount = 0;
if (me->HasAura(SPELL_TWILIGHT_REVENGE))
me->RemoveAurasDueToSpell(SPELL_TWILIGHT_REVENGE);
me->SetHomePosition(3246.57f, 551.263f, 58.6164f, 4.66003f);
- drakeCount = 0;
-
- // Drakes respawning system
- if (instance)
- {
- Creature* pTenebron = Unit::GetCreature(*me, instance->GetData64(DATA_TENEBRON));
- Creature* pShadron = Unit::GetCreature(*me, instance->GetData64(DATA_SHADRON));
- Creature* pVesperon = Unit::GetCreature(*me, instance->GetData64(DATA_VESPERON));
- if (pTenebron)
- {
- pTenebron->SetHomePosition(3239.07f, 657.235f, 86.8775f, 4.74729f);
- if (pTenebron->IsAlive())
- {
- if (pTenebron->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- pTenebron->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- pTenebron->GetMotionMaster()->MoveTargetedHome();
- }else
- {
- if (instance->GetData(TYPE_TENEBRON_PREKILLED) == false)
- {
- pTenebron->Respawn();
- pTenebron->GetMotionMaster()->MoveTargetedHome();
- pTenebron->AI()->SetData(DATA_CAN_LOOT, 0);
- }
- }
- }
- if (pShadron)
- {
- pShadron->SetHomePosition(3363.06f, 525.28f, 98.362f, 4.76475f);
- if (pShadron->IsAlive())
- {
- if (pShadron->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- pShadron->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- pShadron->GetMotionMaster()->MoveTargetedHome();
- }else
- {
- if (instance->GetData(TYPE_SHADRON_PREKILLED) == false)
- {
- pShadron->Respawn();
- pShadron->GetMotionMaster()->MoveTargetedHome();
- pShadron->AI()->SetData(DATA_CAN_LOOT, 0);
- }
- }
- }
- if (pVesperon)
- {
- pVesperon->SetHomePosition(3145.68f, 520.71f, 89.7f, 4.64258f);
- if (pVesperon->IsAlive())
- {
- if (pVesperon->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- pVesperon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- pVesperon->GetMotionMaster()->MoveTargetedHome();
- }else
- {
- if (instance->GetData(TYPE_VESPERON_PREKILLED) == false)
- {
- pVesperon->Respawn();
- pVesperon->GetMotionMaster()->MoveTargetedHome();
- pVesperon->AI()->SetData(DATA_CAN_LOOT, 0);
- }
- }
- }
- }
+ DrakeRespawn();
+ instance->SetBossState(DATA_PORTAL_OPEN, NOT_STARTED);
}
void JustReachedHome() OVERRIDE
{
- if (instance)
- instance->SetData(TYPE_SARTHARION_EVENT, NOT_STARTED);
+ _Reset();
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_SARTHARION_AGGRO);
+ _EnterCombat();
DoZoneInCombat();
- if (instance)
- {
- instance->SetData(TYPE_SARTHARION_EVENT, IN_PROGRESS);
- FetchDragons();
- }
+ FetchDragons();
+
+ events.ScheduleEvent(EVENT_LAVA_STRIKE, 5000);
+ events.ScheduleEvent(EVENT_CLEAVE_ATTACK, 7000);
+ events.ScheduleEvent(EVENT_FLAME_BREATH, 20000);
+ events.ScheduleEvent(EVENT_TAIL_SWEEP, 20000);
+ events.ScheduleEvent(EVENT_FLAME_TSUNAMI, 30000);
+ events.ScheduleEvent(EVENT_CALL_TENEBRON, 30000);
+ events.ScheduleEvent(EVENT_CALL_SHADRON, 75000);
+ events.ScheduleEvent(EVENT_CALL_VESPERON, 120000);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
Talk(SAY_SARTHARION_DEATH);
+ _JustDied();
- if (instance)
- {
- Creature* pTenebron = Unit::GetCreature(*me, instance->GetData64(DATA_TENEBRON));
- Creature* pShadron = Unit::GetCreature(*me, instance->GetData64(DATA_SHADRON));
- Creature* pVesperon = Unit::GetCreature(*me, instance->GetData64(DATA_VESPERON));
- if (pTenebron && pTenebron->IsAlive())
- pTenebron->DisappearAndDie();
- if (pShadron && pShadron->IsAlive())
- pShadron->DisappearAndDie();
- if (pVesperon && pVesperon->IsAlive())
- pVesperon->DisappearAndDie();
-
- instance->SetData(TYPE_SARTHARION_EVENT, DONE);
- }
+ if (Creature* tenebron = Unit::GetCreature(*me, instance->GetData64(DATA_TENEBRON)))
+ if (tenebron->IsAlive())
+ tenebron->DisappearAndDie();
+
+ if (Creature* shadron = Unit::GetCreature(*me, instance->GetData64(DATA_SHADRON)))
+ if (shadron->IsAlive())
+ shadron->DisappearAndDie();
+
+ if (Creature* vesperon = Unit::GetCreature(*me, instance->GetData64(DATA_VESPERON)))
+ if (vesperon->IsAlive())
+ vesperon->DisappearAndDie();
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_SARTHARION_SLAY);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_SARTHARION_SLAY);
}
// me->ResetLootMode() is called from Reset()
@@ -402,1371 +209,310 @@ public:
me->AddLootMode(LOOT_MODE_HARD_MODE_1); // Add 1st Drake loot mode
}
- uint32 GetData(uint32 type) const OVERRIDE
+ void DrakeRespawn() // Drakes respawning system
{
- if (type == TWILIGHT_ACHIEVEMENTS)
- return drakeCount;
-
- return 0;
- }
-
- void FetchDragons()
- {
- if (!instance)
- return;
-
- me->ResetLootMode();
- drakeCount = 0;
-
- Creature* pFetchTene = Unit::GetCreature(*me, instance->GetData64(DATA_TENEBRON));
- Creature* pFetchShad = Unit::GetCreature(*me, instance->GetData64(DATA_SHADRON));
- Creature* pFetchVesp = Unit::GetCreature(*me, instance->GetData64(DATA_VESPERON));
-
- //if at least one of the dragons are alive and are being called
- bool bCanUseWill = false;
-
- if (pFetchTene && pFetchTene->IsAlive() && !pFetchTene->GetVictim())
+ if (Creature* tenebron = Unit::GetCreature(*me, instance->GetData64(DATA_TENEBRON)))
{
- bCanUseWill = true;
- if (!pFetchTene->IsInCombat())
+ tenebron->SetHomePosition(3239.07f, 657.235f, 86.8775f, 4.74729f);
+ if (tenebron->IsAlive())
{
- DoCast(me, SPELL_POWER_OF_TENEBRON);
- AddDrakeLootMode();
- ++drakeCount;
+ if (tenebron->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ tenebron->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ tenebron->GetMotionMaster()->MoveTargetedHome();
}
- pFetchTene->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aTene[0].m_fX, m_aTene[0].m_fY, m_aTene[0].m_fZ);
-
- if (!pFetchTene->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- pFetchTene->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
-
- if (pFetchShad && pFetchShad->IsAlive() && !pFetchShad->GetVictim())
- {
- bCanUseWill = true;
- if (!pFetchShad->IsInCombat())
+ else
{
- DoCast(me, SPELL_POWER_OF_SHADRON);
- AddDrakeLootMode();
- ++drakeCount;
+ if (instance->GetBossState(DATA_TENEBRON) != DONE)
+ {
+ tenebron->Respawn();
+ tenebron->GetMotionMaster()->MoveTargetedHome();
+ tenebron->AI()->SetData(DATA_CAN_LOOT, 0);
+ }
}
- pFetchShad->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aShad[0].m_fX, m_aShad[0].m_fY, m_aShad[0].m_fZ);
-
- if (!pFetchShad->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- pFetchShad->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
- if (pFetchVesp && pFetchVesp->IsAlive() && !pFetchVesp->GetVictim())
+ if (Creature* shadron = Unit::GetCreature(*me, instance->GetData64(DATA_SHADRON)))
{
- bCanUseWill = true;
- if (!pFetchVesp->IsInCombat())
+ shadron->SetHomePosition(3363.06f, 525.28f, 98.362f, 4.76475f);
+ if (shadron->IsAlive())
{
- DoCast(me, SPELL_POWER_OF_VESPERON);
- AddDrakeLootMode();
- ++drakeCount;
+ if (shadron->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ shadron->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ shadron->GetMotionMaster()->MoveTargetedHome();
}
- pFetchVesp->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aVesp[0].m_fX, m_aVesp[0].m_fY, m_aVesp[0].m_fZ);
-
- if (!pFetchVesp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- pFetchVesp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
-
- if (bCanUseWill)
- DoCast(me, SPELL_WILL_OF_SARTHARION);
- }
-
- void CallDragon(uint32 uiDataId)
- {
- if (instance)
- {
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(uiDataId)))
+ else
{
- if (temp->IsAlive() && !temp->GetVictim())
+ if (instance->GetBossState(DATA_SHADRON) != DONE)
{
- temp->SetWalk(false);
-
- if (temp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- int32 iTextId = 0;
-
- switch (temp->GetEntry())
- {
- case NPC_TENEBRON:
- iTextId = SAY_SARTHARION_CALL_TENEBRON;
- temp->AddAura(SPELL_POWER_OF_TENEBRON, temp);
- temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aTene[1].m_fX, m_aTene[1].m_fY, m_aTene[1].m_fZ);
- break;
- case NPC_SHADRON:
- iTextId = SAY_SARTHARION_CALL_SHADRON;
- temp->AddAura(SPELL_POWER_OF_SHADRON, temp);
- temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aShad[1].m_fX, m_aShad[1].m_fY, m_aShad[1].m_fZ);
- break;
- case NPC_VESPERON:
- iTextId = SAY_SARTHARION_CALL_VESPERON;
- temp->AddAura(SPELL_POWER_OF_VESPERON, temp);
- temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aVesp[1].m_fX, m_aVesp[1].m_fY, m_aVesp[1].m_fZ);
- break;
- }
-
- Talk(iTextId);
+ shadron->Respawn();
+ shadron->GetMotionMaster()->MoveTargetedHome();
+ shadron->AI()->SetData(DATA_CAN_LOOT, 0);
}
}
}
- }
-
- void SendFlameTsunami()
- {
- if (Map* map = me->GetMap())
- if (map->IsDungeon())
- {
- Map::PlayerList const &PlayerList = map->GetPlayers();
-
- if (!PlayerList.isEmpty())
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- if (i->GetSource() && i->GetSource()->IsAlive())
- Talk(WHISPER_LAVA_CHURN, i->GetSource()->GetGUID());
- }
- }
-
- // Selects a random Fire Cyclone and makes it cast Lava Strike.
- // FIXME: Frequency of the casts reduced to compensate 100% chance of spawning a Lava Blaze add
- void CastLavaStrikeOnTarget(Unit* target)
- {
- std::list<Creature*> pFireCyclonesList;
- Trinity::AllCreaturesOfEntryInRange checker(me, NPC_FIRE_CYCLONE, 200.0f);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, pFireCyclonesList, checker);
- me->VisitNearbyObject(200.0f, searcher);
-
- if (pFireCyclonesList.empty())
- return;
-
- std::list<Creature*>::iterator itr = pFireCyclonesList.begin();
- uint32 rnd = rand()%pFireCyclonesList.size();
- for (uint32 i = 0; i < rnd; ++i)
- ++itr;
-
- (*itr)->CastSpell(target, SPELL_LAVA_STRIKE, true);
- }
-
- void UpdateAI(uint32 uiDiff) OVERRIDE
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- Unit* pTene = Unit::GetUnit(*me, instance ? instance->GetData64(DATA_TENEBRON) : 0);
- Unit* pShad = Unit::GetUnit(*me, instance ? instance->GetData64(DATA_SHADRON) : 0);
- Unit* pVesp = Unit::GetUnit(*me, instance ? instance->GetData64(DATA_VESPERON) : 0);
-
- //spell will target dragons, if they are still alive at 35%
- if (!m_bIsBerserk && !HealthAbovePct(35)
- && ((pTene && pTene->IsAlive()) || (pShad && pShad->IsAlive()) || (pVesp && pVesp->IsAlive())))
- {
- Talk(SAY_SARTHARION_BERSERK);
- DoCast(me, SPELL_BERSERK);
- m_bIsBerserk = true;
- }
-
- //soft enrage
- if (!m_bIsSoftEnraged && HealthBelowPct(10))
+ if (Creature* vesperon = Unit::GetCreature(*me, instance->GetData64(DATA_VESPERON)))
{
- // m_bIsSoftEnraged is used while determining Lava Strike cooldown.
- m_bIsSoftEnraged = true;
- }
-
- // hard enrage
- if (!m_bIsHardEnraged)
- {
- if (m_uiEnrageTimer <= uiDiff)
+ vesperon->SetHomePosition(3145.68f, 520.71f, 89.7f, 4.64258f);
+ if (vesperon->IsAlive())
{
- DoCast(me, SPELL_PYROBUFFET, true);
- m_bIsHardEnraged = true;
+ if (vesperon->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ vesperon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ vesperon->GetMotionMaster()->MoveTargetedHome();
}
else
- m_uiEnrageTimer -= uiDiff;
- }
-
- // flame tsunami
- if (m_uiFlameTsunamiTimer <= uiDiff)
- {
- SendFlameTsunami();
- switch (urand(0, 1))
{
- case 0:
+ if (instance->GetBossState(DATA_VESPERON) != DONE)
{
- Creature* Right1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight1Spawn.x, FlameRight1Spawn.y, FlameRight1Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN, 12000);
- Creature* Right2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight2Spawn.x, FlameRight2Spawn.y, FlameRight2Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN, 12000);
- Creature* Right3 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight3Spawn.x, FlameRight3Spawn.y, FlameRight3Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN, 12000);
- Right1->GetMotionMaster()->MovePoint(0, FlameRight1Direction.x, FlameRight1Direction.y, FlameRight1Direction.z);
- Right2->GetMotionMaster()->MovePoint(0, FlameRight2Direction.x, FlameRight2Direction.y, FlameRight2Direction.z);
- Right3->GetMotionMaster()->MovePoint(0, FlameRight3Direction.x, FlameRight3Direction.y, FlameRight3Direction.z);
- break;
- }
- case 1:
- {
- Creature* Left1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft1Spawn.x, FlameLeft1Spawn.y, FlameLeft1Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN, 12000);
- Creature* Left2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft2Spawn.x, FlameLeft2Spawn.y, FlameLeft2Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN, 12000);
- Left1->GetMotionMaster()->MovePoint(0, FlameLeft1Direction.x, FlameLeft1Direction.y, FlameLeft1Direction.z);
- Left2->GetMotionMaster()->MovePoint(0, FlameLeft2Direction.x, FlameLeft2Direction.y, FlameLeft2Direction.z);
- break;
+ vesperon->Respawn();
+ vesperon->GetMotionMaster()->MoveTargetedHome();
+ vesperon->AI()->SetData(DATA_CAN_LOOT, 0);
}
}
-
- m_uiFlameTsunamiTimer = 30000;
- }
- else
- m_uiFlameTsunamiTimer -= uiDiff;
-
- // flame breath
- if (m_uiFlameBreathTimer <= uiDiff)
- {
- Talk(SAY_SARTHARION_BREATH);
- DoCastVictim(RAID_MODE(SPELL_FLAME_BREATH, SPELL_FLAME_BREATH_H));
- m_uiFlameBreathTimer = urand(25000, 35000);
}
- else
- m_uiFlameBreathTimer -= uiDiff;
-
- // Tail Sweep
- if (m_uiTailSweepTimer <= uiDiff)
- {
- DoCastVictim(RAID_MODE(SPELL_TAIL_LASH, SPELL_TAIL_LASH_H));
- m_uiTailSweepTimer = urand(15000, 20000);
- }
- else
- m_uiTailSweepTimer -= uiDiff;
-
- // Cleave
- if (m_uiCleaveTimer <= uiDiff)
- {
- DoCastVictim(SPELL_CLEAVE);
- m_uiCleaveTimer = urand(7000, 10000);
- }
- else
- m_uiCleaveTimer -= uiDiff;
-
- // Lavas Strike
- if (m_uiLavaStrikeTimer <= uiDiff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- {
- CastLavaStrikeOnTarget(target);
-
- if (urand(0, 5) == 0)
- Talk(SAY_SARTHARION_SPECIAL);
- }
- m_uiLavaStrikeTimer = (m_bIsSoftEnraged ? urand(1400, 2000) : urand(5000, 20000));
- }
- else
- m_uiLavaStrikeTimer -= uiDiff;
-
- // call tenebron
- if (!m_bHasCalledTenebron && m_uiTenebronTimer <= uiDiff)
- {
- CallDragon(DATA_TENEBRON);
- m_bHasCalledTenebron = true;
- }
- else
- m_uiTenebronTimer -= uiDiff;
-
- // call shadron
- if (!m_bHasCalledShadron && m_uiShadronTimer <= uiDiff)
- {
- CallDragon(DATA_SHADRON);
- m_bHasCalledShadron = true;
- }
- else
- m_uiShadronTimer -= uiDiff;
-
- // call vesperon
- if (!m_bHasCalledVesperon && m_uiVesperonTimer <= uiDiff)
- {
- CallDragon(DATA_VESPERON);
- m_bHasCalledVesperon = true;
- }
- else
- m_uiVesperonTimer -= uiDiff;
-
- DoMeleeAttackIfReady();
-
- EnterEvadeIfOutOfCombatArea(uiDiff);
- }
- };
-
-};
-
-enum TeneText
-{
- SAY_TENEBRON_AGGRO = 0,
- SAY_TENEBRON_SLAY = 1,
- SAY_TENEBRON_DEATH = 2,
- SAY_TENEBRON_BREATH = 3,
- SAY_TENEBRON_RESPOND = 4,
- SAY_TENEBRON_SPECIAL = 5
-};
-
-enum ShadText
-{
- SAY_SHADRON_AGGRO = 0,
- SAY_SHADRON_SLAY = 1,
- SAY_SHADRON_DEATH = 2,
- SAY_SHADRON_BREATH = 3,
- SAY_SHADRON_RESPOND = 4,
- SAY_SHADRON_SPECIAL = 5
-};
-
-enum VespText
-{
- SAY_VESPERON_AGGRO = 0,
- SAY_VESPERON_SLAY = 1,
- SAY_VESPERON_DEATH = 2,
- SAY_VESPERON_BREATH = 3,
- SAY_VESPERON_RESPOND = 4,
- SAY_VESPERON_SPECIAL = 5,
-};
-
-//to control each dragons common abilities
-struct dummy_dragonAI : public ScriptedAI
-{
- dummy_dragonAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- }
-
- InstanceScript* instance;
-
- uint32 m_uiWaypointId;
- uint32 m_uiMoveNextTimer;
- int32 m_iPortalRespawnTime;
- bool m_bCanMoveFree;
- bool m_bCanLoot;
-
- void Reset() OVERRIDE
- {
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- m_uiWaypointId = 0;
- m_uiMoveNextTimer = 500;
- m_iPortalRespawnTime = 30000;
- m_bCanMoveFree = false;
- m_bCanLoot = true;
- }
-
- void SetData(uint32 type, uint32 value) OVERRIDE
- {
- if (type == DATA_CAN_LOOT)
- m_bCanLoot = value;
- }
-
- void MovementInform(uint32 uiType, uint32 uiPointId) OVERRIDE
- {
- if (!instance || uiType != POINT_MOTION_TYPE)
- return;
-
-// debug_log("dummy_dragonAI: %s reached point %u", me->GetName(), uiPointId);
-
- //if healers messed up the raid and we was already initialized
- if (instance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS)
- {
- EnterEvadeMode();
- return;
- }
-
- //this is end, if we reach this, don't do much
- if (uiPointId == POINT_ID_LAND)
- {
- me->GetMotionMaster()->Clear();
- me->SetInCombatWithZone();
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
- {
- me->AddThreat(target, 1.0f);
- me->Attack(target, true);
- me->GetMotionMaster()->MoveChase(target);
- }
-
- m_bCanMoveFree = false;
- return;
}
- //get amount of common points
- uint32 uiCommonWPCount = sizeof(m_aDragonCommon)/sizeof(Waypoint);
-
- //increase
- m_uiWaypointId = uiPointId+1;
-
- //if we have reached a point bigger or equal to count, it mean we must reset to point 0
- if (m_uiWaypointId >= uiCommonWPCount)
- {
- if (!m_bCanMoveFree)
- m_bCanMoveFree = true;
-
- m_uiWaypointId = 0;
- }
-
- m_uiMoveNextTimer = 500;
- }
-
- //used when open portal and spawn mobs in phase
- void DoRaidWhisper(int32 iTextId)
- {
- Map* map = me->GetMap();
-
- if (map && map->IsDungeon())
+ void FetchDragons()
{
- Map::PlayerList const &PlayerList = map->GetPlayers();
-
- if (!PlayerList.isEmpty())
- {
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- Talk(iTextId, i->GetSource()->GetGUID());
- }
- }
- }
-
- //"opens" the portal and does the "opening" whisper
- void OpenPortal()
- {
- int32 iTextId = 0;
-
- //there are 4 portal spawn locations, each are expected to be spawned with negative spawntimesecs in database
+ me->ResetLootMode();
+ drakeCount = 0;
- //using a grid search here seem to be more efficient than caching all four guids
- //in instance script and calculate range to each.
- GameObject* pPortal = me->FindNearestGameObject(GO_TWILIGHT_PORTAL, 50.0f);
+ //if at least one of the dragons are alive and are being called
+ bool _canUseWill = false;
- switch (me->GetEntry())
- {
- case NPC_TENEBRON:
+ if (Creature* fetchTene = Unit::GetCreature(*me, instance->GetData64(DATA_TENEBRON)))
{
- iTextId = WHISPER_HATCH_EGGS;
- if (instance && !instance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
- {
- for (uint32 i = 0; i < 6; ++i)
- me->SummonCreature(NPC_TWILIGHT_EGG, TwilightEggs[i].x, TwilightEggs[i].y, TwilightEggs[i].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
- }
- else
+ if (fetchTene->IsAlive() && !fetchTene->GetVictim())
{
- for (uint32 i = 0; i < 6; ++i)
- me->SummonCreature(NPC_SARTHARION_TWILIGHT_EGG, TwilightEggsSarth[i].x, TwilightEggsSarth[i].y, TwilightEggsSarth[i].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
+ _canUseWill = true;
+ if (!fetchTene->IsInCombat())
+ {
+ DoCast(me, SPELL_POWER_OF_TENEBRON);
+ AddDrakeLootMode();
+ ++drakeCount;
+ }
+ fetchTene->GetMotionMaster()->MovePoint(POINT_ID_INIT, TenebronPositions[0]);
+
+ if (!fetchTene->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ fetchTene->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
- break;
}
- case NPC_SHADRON:
- {
- iTextId = WHISPER_OPEN_PORTAL;
- if (instance && !instance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
- me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron.x, AcolyteofShadron.y, AcolyteofShadron.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 28000);
- else
- me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron2.x, AcolyteofShadron2.y, AcolyteofShadron2.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 28000);
- break;
- }
- case NPC_VESPERON:
+ if (Creature* fetchShad = Unit::GetCreature(*me, instance->GetData64(DATA_SHADRON)))
{
- iTextId = WHISPER_OPEN_PORTAL;
- if (instance && !instance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
+ if (fetchShad->IsAlive() && !fetchShad->GetVictim())
{
- if (Creature* Acolyte = me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon.x, AcolyteofVesperon.y, AcolyteofVesperon.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
+ _canUseWill = true;
+ if (!fetchShad->IsInCombat())
{
- me->InterruptNonMeleeSpells(true);
- Acolyte->InterruptNonMeleeSpells(true);
- me->CastSpell(me, 32747, false);
+ DoCast(me, SPELL_POWER_OF_SHADRON);
+ AddDrakeLootMode();
+ ++drakeCount;
}
+ fetchShad->GetMotionMaster()->MovePoint(POINT_ID_INIT, ShadronPositions[0]);
+
+ if (!fetchShad->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ fetchShad->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
- else
+ }
+
+ if (Creature* fetchVesp = Unit::GetCreature(*me, instance->GetData64(DATA_VESPERON)))
+ {
+ if (fetchVesp && fetchVesp->IsAlive() && !fetchVesp->GetVictim())
{
- if (Creature* Acolyte = me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon2.x, AcolyteofVesperon2.y, AcolyteofVesperon2.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
+ _canUseWill = true;
+ if (!fetchVesp->IsInCombat())
{
- me->InterruptNonMeleeSpells(true);
- Acolyte->InterruptNonMeleeSpells(true);
- me->CastSpell(me, 32747, false);
+ DoCast(me, SPELL_POWER_OF_VESPERON);
+ AddDrakeLootMode();
+ ++drakeCount;
}
- }
-
- break;
- }
- }
-
- DoRaidWhisper(iTextId);
+ fetchVesp->GetMotionMaster()->MovePoint(POINT_ID_INIT, VesperonPositions[0]);
- //By using SetRespawnTime() we will actually "spawn" the object with our defined time.
- //Once time is up, portal will disappear again.
- if (pPortal && !pPortal->isSpawned())
- pPortal->SetRespawnTime(m_iPortalRespawnTime);
-
- //Unclear what are expected to happen if one drake has a portal open already
- //Refresh respawnTime so time again are set to 30secs?
- }
-
- void JustDied(Unit* /*killer*/) OVERRIDE
- {
- if (!m_bCanLoot)
- me->SetLootRecipient(NULL);
-
- int32 iTextId = 0;
- uint32 uiSpellId = 0;
-
- switch (me->GetEntry())
- {
- case NPC_TENEBRON:
- iTextId = SAY_TENEBRON_DEATH;
- uiSpellId = SPELL_POWER_OF_TENEBRON;
- if (instance && instance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS)
- instance->SetData(TYPE_TENEBRON_PREKILLED, 1);
- break;
- case NPC_SHADRON:
- iTextId = SAY_SHADRON_DEATH;
- uiSpellId = SPELL_POWER_OF_SHADRON;
- if (instance && instance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS)
- instance->SetData(TYPE_SHADRON_PREKILLED, 1);
- if (Creature* pAcolyte = me->FindNearestCreature(NPC_ACOLYTE_OF_SHADRON, 100.0f))
- pAcolyte->Kill(pAcolyte);
- break;
- case NPC_VESPERON:
- iTextId = SAY_VESPERON_DEATH;
- uiSpellId = SPELL_POWER_OF_VESPERON;
- if (instance && instance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS)
- instance->SetData(TYPE_VESPERON_PREKILLED, 1);
- if (Creature* pAcolyte = me->FindNearestCreature(NPC_ACOLYTE_OF_VESPERON, 100.0f))
- pAcolyte->Kill(pAcolyte);
- break;
- }
-
- Talk(iTextId);
-
- me->RemoveAurasDueToSpell(uiSpellId);
-
- if (instance)
- {
- instance->DoRemoveAurasDueToSpellOnPlayers(uiSpellId);
-
- // not if solo mini-boss fight
- if (instance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS)
- return;
-
- // Twilight Revenge to main boss
- if (Unit* pSartharion = Unit::GetUnit(*me, instance->GetData64(DATA_SARTHARION)))
- if (pSartharion->IsAlive())
- {
- pSartharion->RemoveAurasDueToSpell(uiSpellId);
- DoCast(pSartharion, SPELL_TWILIGHT_REVENGE, true);
+ if (!fetchVesp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ fetchVesp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
- }
- }
-
- void UpdateAI(uint32 uiDiff) OVERRIDE
- {
- if (m_bCanMoveFree && m_uiMoveNextTimer)
- {
- if (m_uiMoveNextTimer <= uiDiff)
- {
- if (m_uiWaypointId < MAX_WAYPOINT)
- me->GetMotionMaster()->MovePoint(m_uiWaypointId,
- m_aDragonCommon[m_uiWaypointId].m_fX, m_aDragonCommon[m_uiWaypointId].m_fY, m_aDragonCommon[m_uiWaypointId].m_fZ);
-
-// debug_log("dummy_dragonAI: %s moving to point %u", me->GetName(), m_uiWaypointId);
- m_uiMoveNextTimer = 0;
}
- else
- m_uiMoveNextTimer -= uiDiff;
- }
- }
-};
-
-/*######
-## Mob Tenebron
-######*/
-
-class npc_tenebron : public CreatureScript
-{
-public:
- npc_tenebron() : CreatureScript("npc_tenebron") { }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_tenebronAI(creature);
- }
-
- struct npc_tenebronAI : public dummy_dragonAI
- {
- npc_tenebronAI(Creature* creature) : dummy_dragonAI(creature) { }
-
- uint32 m_uiShadowBreathTimer;
- uint32 m_uiShadowFissureTimer;
- uint32 m_uiHatchEggTimer;
-
- bool m_bHasPortalOpen;
-
- void Reset() OVERRIDE
- {
- dummy_dragonAI::Reset();
- m_uiShadowBreathTimer = 20000;
- m_uiShadowFissureTimer = 5000;
- m_uiHatchEggTimer = 30000;
-
- m_bHasPortalOpen = false;
- }
-
- void EnterCombat(Unit* /*who*/) OVERRIDE
- {
- Talk(SAY_TENEBRON_AGGRO);
- DoZoneInCombat();
- }
-
- void KilledUnit(Unit* /*victim*/) OVERRIDE
- {
- Talk(SAY_TENEBRON_SLAY);
+ if (_canUseWill)
+ DoCast(me, SPELL_WILL_OF_SARTHARION);
}
- void UpdateAI(uint32 uiDiff) OVERRIDE
+ void CallDragon(uint32 dataId)
{
- //if no target, update dummy and return
- if (!UpdateVictim())
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(dataId)))
{
- dummy_dragonAI::UpdateAI(uiDiff);
- return;
- }
+ if (temp->IsAlive() && !temp->GetVictim())
+ {
+ temp->SetWalk(false);
- // shadow fissure
- if (m_uiShadowFissureTimer <= uiDiff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- DoCast(target, RAID_MODE(SPELL_SHADOW_FISSURE, SPELL_SHADOW_FISSURE));
+ if (temp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_uiShadowFissureTimer = urand(15000, 20000);
- }
- else
- m_uiShadowFissureTimer -= uiDiff;
+ uint8 textId = 0;
- // Hatch Egg
- if (m_uiHatchEggTimer <= uiDiff)
- {
- OpenPortal();
- m_uiHatchEggTimer = 30000;
- }
- else
- m_uiHatchEggTimer -= uiDiff;
+ switch (temp->GetEntry())
+ {
+ case NPC_TENEBRON:
+ textId = SAY_SARTHARION_CALL_TENEBRON;
+ temp->AddAura(SPELL_POWER_OF_TENEBRON, temp);
+ temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, TenebronPositions[1]);
+ break;
+ case NPC_SHADRON:
+ textId = SAY_SARTHARION_CALL_SHADRON;
+ temp->AddAura(SPELL_POWER_OF_SHADRON, temp);
+ temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, ShadronPositions[1]);
+ break;
+ case NPC_VESPERON:
+ textId = SAY_SARTHARION_CALL_VESPERON;
+ temp->AddAura(SPELL_POWER_OF_VESPERON, temp);
+ temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, VesperonPositions[1]);
+ break;
+ }
- // shadow breath
- if (m_uiShadowBreathTimer <= uiDiff)
- {
- Talk(SAY_TENEBRON_BREATH);
- DoCastVictim(RAID_MODE(SPELL_SHADOW_BREATH, SPELL_SHADOW_BREATH_H));
- m_uiShadowBreathTimer = urand(20000, 25000);
+ Talk(textId);
+ }
}
- else
- m_uiShadowBreathTimer -= uiDiff;
-
- DoMeleeAttackIfReady();
}
- };
-
-};
-/*######
-## Mob Shadron
-######*/
-
-class npc_shadron : public CreatureScript
-{
-public:
- npc_shadron() : CreatureScript("npc_shadron") { }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_shadronAI(creature);
- }
-
- struct npc_shadronAI : public dummy_dragonAI
- {
- npc_shadronAI(Creature* creature) : dummy_dragonAI(creature) { }
-
- uint32 m_uiShadowBreathTimer;
- uint32 m_uiShadowFissureTimer;
- uint32 m_uiAcolyteShadronTimer;
-
- bool m_bHasPortalOpen;
-
- void Reset() OVERRIDE
+ uint32 GetData(uint32 type) const OVERRIDE
{
- dummy_dragonAI::Reset();
-
- m_uiShadowBreathTimer = 20000;
- m_uiShadowFissureTimer = 5000;
- m_uiAcolyteShadronTimer = 60000;
-
- if (me->HasAura(SPELL_TWILIGHT_TORMENT_VESP))
- me->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP);
-
- if (me->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA))
- me->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA);
-
- m_bHasPortalOpen = false;
- }
+ if (type == TWILIGHT_ACHIEVEMENTS)
+ return drakeCount;
- void EnterCombat(Unit* /*who*/) OVERRIDE
- {
- Talk(SAY_SHADRON_AGGRO);
- DoZoneInCombat();
+ return 0;
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ // Selects a random Fire Cyclone and makes it cast Lava Strike.
+ // FIXME: Frequency of the casts reduced to compensate 100% chance of spawning a Lava Blaze add
+ void CastLavaStrikeOnTarget(Unit* target)
{
- Talk(SAY_SHADRON_SLAY);
- }
+ std::list<Creature*> fireCyclonesList;
+ Trinity::AllCreaturesOfEntryInRange checker(me, NPC_FIRE_CYCLONE, 200.0f);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, fireCyclonesList, checker);
+ me->VisitNearbyObject(200.0f, searcher);
- void UpdateAI(uint32 uiDiff) OVERRIDE
- {
- //if no target, update dummy and return
- if (!UpdateVictim())
- {
- dummy_dragonAI::UpdateAI(uiDiff);
+ if (fireCyclonesList.empty())
return;
- }
-
- // shadow fissure
- if (m_uiShadowFissureTimer <= uiDiff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- DoCast(target, RAID_MODE(SPELL_SHADOW_FISSURE, SPELL_SHADOW_FISSURE_H));
-
- m_uiShadowFissureTimer = urand(15000, 20000);
- }
- else
- m_uiShadowFissureTimer -= uiDiff;
-
- // Portal Event
- if (m_uiAcolyteShadronTimer <= uiDiff)
- {
- if (m_bHasPortalOpen)
- m_uiAcolyteShadronTimer = 10000;
- else
- {
- if (me->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA))
- return;
-
- OpenPortal();
- m_bHasPortalOpen = true;
- m_uiAcolyteShadronTimer = urand(60000, 65000);
- }
- }
- else
- m_uiAcolyteShadronTimer -= uiDiff;
-
- // shadow breath
- if (m_uiShadowBreathTimer <= uiDiff)
- {
- Talk(SAY_SHADRON_BREATH);
- DoCastVictim(RAID_MODE(SPELL_SHADOW_BREATH, SPELL_SHADOW_BREATH_H));
- m_uiShadowBreathTimer = urand(20000, 25000);
- }
- else
- m_uiShadowBreathTimer -= uiDiff;
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
-/*######
-## Mob Vesperon
-######*/
-
-class npc_vesperon : public CreatureScript
-{
-public:
- npc_vesperon() : CreatureScript("npc_vesperon") { }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_vesperonAI(creature);
- }
-
- struct npc_vesperonAI : public dummy_dragonAI
- {
- npc_vesperonAI(Creature* creature) : dummy_dragonAI(creature) { }
- uint32 m_uiShadowBreathTimer;
- uint32 m_uiShadowFissureTimer;
- uint32 m_uiAcolyteVesperonTimer;
-
- bool m_bHasPortalOpen;
-
- void Reset() OVERRIDE
- {
- dummy_dragonAI::Reset();
-
- m_uiShadowBreathTimer = 20000;
- m_uiShadowFissureTimer = 5000;
- m_uiAcolyteVesperonTimer = 60000;
-
- m_bHasPortalOpen = false;
- }
-
- void EnterCombat(Unit* /*who*/) OVERRIDE
- {
- Talk(SAY_VESPERON_AGGRO);
- DoZoneInCombat();
+ Trinity::Containers::SelectRandomContainerElement(fireCyclonesList)->CastSpell(target, SPELL_LAVA_STRIKE, true);
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
- {
- Talk(SAY_VESPERON_SLAY);
- }
-
- void UpdateAI(uint32 uiDiff) OVERRIDE
+ void UpdateAI(uint32 diff) OVERRIDE
{
- //if no target, update dummy and return
if (!UpdateVictim())
- {
- dummy_dragonAI::UpdateAI(uiDiff);
return;
- }
- // shadow fissure
- if (m_uiShadowFissureTimer <= uiDiff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- DoCast(target, RAID_MODE(SPELL_SHADOW_FISSURE, SPELL_SHADOW_FISSURE_H));
-
- m_uiShadowFissureTimer = urand(15000, 20000);
- }
- else
- m_uiShadowFissureTimer -= uiDiff;
+ events.Update(diff);
- // Portal Event
- if (m_uiAcolyteVesperonTimer <= uiDiff)
+ while (uint32 eventId = events.ExecuteEvent())
{
- if (m_bHasPortalOpen)
- m_uiAcolyteVesperonTimer = 10000;
- else
+ switch (eventId)
{
- OpenPortal();
- DoCastVictim(SPELL_TWILIGHT_TORMENT_VESP);
- m_uiAcolyteVesperonTimer = urand(60000, 70000);
- }
- }
- else
- m_uiAcolyteVesperonTimer -= uiDiff;
-
- // shadow breath
- if (m_uiShadowBreathTimer <= uiDiff)
- {
- Talk(SAY_VESPERON_BREATH);
- DoCastVictim(RAID_MODE(SPELL_SHADOW_BREATH, SPELL_SHADOW_BREATH_H));
- m_uiShadowBreathTimer = urand(20000, 25000);
- }
- else
- m_uiShadowBreathTimer -= uiDiff;
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
-/*######
-## Mob Acolyte of Shadron
-######*/
-
-class npc_acolyte_of_shadron : public CreatureScript
-{
-public:
- npc_acolyte_of_shadron() : CreatureScript("npc_acolyte_of_shadron") { }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_acolyte_of_shadronAI(creature);
- }
-
- struct npc_acolyte_of_shadronAI : public ScriptedAI
- {
- npc_acolyte_of_shadronAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- }
-
- InstanceScript* instance;
- uint32 uiDespawnTimer;
-
- void Reset() OVERRIDE
- {
- uiDespawnTimer = 28000;
- if (instance)
- {
- Creature* target = NULL;
- //if not solo figth, buff main boss, else place debuff on mini-boss. both spells TARGET_SCRIPT
- if (instance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
- {
- target = Unit::GetCreature((*me), instance->GetData64(DATA_SARTHARION));
- if (target)
- target->AddAura(SPELL_GIFT_OF_TWILIGTH_SAR, target);
- }
- else
- {
- target = Unit::GetCreature((*me), instance->GetData64(DATA_SHADRON));
- if (target)
- target->AddAura(SPELL_GIFT_OF_TWILIGTH_SHA, target);
- }
- }
-
- me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER, me);
- }
-
- void JustDied(Unit* /*killer*/) OVERRIDE
- {
- if (instance)
- {
- Creature* Shadron = instance->instance->GetCreature(instance->GetData64(DATA_SHADRON));
- if (Shadron)
- {
- (CAST_AI(npc_shadron::npc_shadronAI, Shadron->AI()))->m_bHasPortalOpen = false;
- }
-
- Creature* pDebuffTarget = NULL;
- Map* map = me->GetMap();
- if (map->IsDungeon())
- {
- Map::PlayerList const &PlayerList = map->GetPlayers();
-
- if (PlayerList.isEmpty())
- return;
-
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- {
- if (i->GetSource()->IsAlive() && i->GetSource()->HasAura(SPELL_TWILIGHT_SHIFT, 0) && !i->GetSource()->GetVictim())
+ case EVENT_HARD_ENRAGE:
+ if (!_isHardEnraged)
{
- i->GetSource()->CastSpell(i->GetSource(), SPELL_TWILIGHT_SHIFT_REMOVAL_ALL, true);
- i->GetSource()->CastSpell(i->GetSource(), SPELL_TWILIGHT_RESIDUE, true);
- i->GetSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT);
- i->GetSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT_ENTER);
+ DoCast(me, SPELL_PYROBUFFET, true);
+ _isHardEnraged = true;
+ }
+ break;
+ case EVENT_FLAME_TSUNAMI:
+ Talk(WHISPER_LAVA_CHURN);
+ switch (urand(0, 1))
+ {
+ case 0:
+ {
+ if (Creature* right1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight1Spawn, TEMPSUMMON_TIMED_DESPAWN, 12000))
+ right1->GetMotionMaster()->MovePoint(0, FlameRight1Direction);
+ if (Creature* right2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight2Spawn, TEMPSUMMON_TIMED_DESPAWN, 12000))
+ right2->GetMotionMaster()->MovePoint(0, FlameRight2Direction);
+ if (Creature* right3 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight3Spawn, TEMPSUMMON_TIMED_DESPAWN, 12000))
+ right3->GetMotionMaster()->MovePoint(0, FlameRight3Direction);
+ break;
+ }
+ case 1:
+ {
+ if (Creature* left1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft1Spawn, TEMPSUMMON_TIMED_DESPAWN, 12000))
+ left1->GetMotionMaster()->MovePoint(0, FlameLeft1Direction);
+ if (Creature* left2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft2Spawn, TEMPSUMMON_TIMED_DESPAWN, 12000))
+ left2->GetMotionMaster()->MovePoint(0, FlameLeft2Direction);
+ break;
+ }
}
- }
+ events.ScheduleEvent(EVENT_FLAME_TSUNAMI, 30000);
+ break;
+ case EVENT_FLAME_BREATH:
+ Talk(SAY_SARTHARION_BREATH);
+ DoCastVictim(RAID_MODE(SPELL_FLAME_BREATH, SPELL_FLAME_BREATH_H));
+ events.ScheduleEvent(EVENT_FLAME_BREATH, urand(25000, 35000));
+ break;
+ case EVENT_TAIL_SWEEP:
+ DoCastVictim(RAID_MODE(SPELL_TAIL_LASH, SPELL_TAIL_LASH_H));
+ events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(15000, 20000));
+ break;
+ case EVENT_CLEAVE_ATTACK:
+ DoCastVictim(SPELL_CLEAVE);
+ events.ScheduleEvent(EVENT_CLEAVE_ATTACK, urand(7000, 10000));
+ break;
+ case EVENT_LAVA_STRIKE:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ {
+ CastLavaStrikeOnTarget(target);
+ if (urand(0, 5) == 0)
+ Talk(SAY_SARTHARION_SPECIAL);
+ }
+ events.ScheduleEvent(EVENT_LAVA_STRIKE, (_isSoftEnraged ? urand(1400, 2000) : urand(5000, 20000)));
+ break;
+ case EVENT_CALL_TENEBRON:
+ CallDragon(DATA_TENEBRON);
+ break;
+ case EVENT_CALL_SHADRON:
+ CallDragon(DATA_SHADRON);
+ break;
+ case EVENT_CALL_VESPERON:
+ CallDragon(DATA_VESPERON);
+ break;
+ default:
+ break;
}
-
- //not solo fight, so main boss has deduff
- pDebuffTarget = instance->instance->GetCreature(instance->GetData64(DATA_SARTHARION));
- if (pDebuffTarget && pDebuffTarget->IsAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SAR))
- pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SAR);
-
- //event not in progress, then solo fight and must remove debuff mini-boss
- pDebuffTarget = instance->instance->GetCreature(instance->GetData64(DATA_SHADRON));
- if (pDebuffTarget && pDebuffTarget->IsAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA))
- pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA);
}
- }
- void UpdateAI(uint32 uiDiff) OVERRIDE
- {
- if (uiDespawnTimer < uiDiff)
+ // At 35% spell will target dragons, if they are still alive.
+ if (!_isBerserk && !HealthAbovePct(35))
{
- me->SetVisible(false);
- me->Kill(me);
- uiDespawnTimer = 28000;
- return;
- }else uiDespawnTimer -= uiDiff;
-
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
-/*######
-## Mob Acolyte of Vesperon
-######*/
-
-class npc_acolyte_of_vesperon : public CreatureScript
-{
-public:
- npc_acolyte_of_vesperon() : CreatureScript("npc_acolyte_of_vesperon") { }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_acolyte_of_vesperonAI(creature);
- }
-
- struct npc_acolyte_of_vesperonAI : public ScriptedAI
- {
- npc_acolyte_of_vesperonAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- }
-
- InstanceScript* instance;
- uint32 uiDespawnTimer;
-
- void Reset() OVERRIDE
- {
- uiDespawnTimer = 28000;
- if (instance)
- me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER, me);
- DoCast(me, SPELL_TWILIGHT_TORMENT_VESP_ACO);
- }
-
- void JustDied(Unit* /*killer*/) OVERRIDE
- {
- me->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP_ACO);
-
- // remove twilight torment on Vesperon
- if (instance)
- {
- Creature* pVesperon = instance->instance->GetCreature(instance->GetData64(DATA_VESPERON));
- if (pVesperon)
- (CAST_AI(npc_vesperon::npc_vesperonAI, pVesperon->AI()))->m_bHasPortalOpen = false;
-
- if (pVesperon && pVesperon->IsAlive() && pVesperon->HasAura(SPELL_TWILIGHT_TORMENT_VESP))
- pVesperon->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP);
-
- Map* map = me->GetMap();
- if (map->IsDungeon())
+ if (instance->GetBossState(DATA_TENEBRON) != DONE || instance->GetBossState(DATA_SHADRON) != DONE || instance->GetBossState(DATA_VESPERON) != DONE)
{
- Map::PlayerList const &PlayerList = map->GetPlayers();
-
- if (PlayerList.isEmpty())
- return;
-
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- {
- if (i->GetSource()->IsAlive() && i->GetSource()->HasAura(SPELL_TWILIGHT_SHIFT, 0) && !i->GetSource()->GetVictim())
- {
- i->GetSource()->CastSpell(i->GetSource(), SPELL_TWILIGHT_SHIFT_REMOVAL_ALL, true);
- i->GetSource()->CastSpell(i->GetSource(), SPELL_TWILIGHT_RESIDUE, true);
- i->GetSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT);
- i->GetSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT_ENTER);
- }
- if (i->GetSource()->IsAlive() && i->GetSource()->HasAura(SPELL_TWILIGHT_TORMENT_VESP, 0) && !i->GetSource()->GetVictim())
- i->GetSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP);
- }
+ Talk(SAY_SARTHARION_BERSERK);
+ DoCast(me, SPELL_BERSERK);
+ _isBerserk = true;
}
-
- instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_TWILIGHT_TORMENT_VESP_ACO);
- instance->DoRemoveAurasDueToSpellOnPlayers(57935);
- instance->DoRemoveAurasDueToSpellOnPlayers(58835); // Components of spell Twilight Torment
}
- }
- void UpdateAI(uint32 uiDiff) OVERRIDE
- {
- if (uiDespawnTimer < uiDiff)
+ // Soft Enrage used while determining Lava Strike cooldown.
+ if (!_isSoftEnraged && HealthBelowPct(10))
{
- me->SetVisible(false);
- me->Kill(me);
- uiDespawnTimer = 28000;
- return;
- }else uiDespawnTimer -= uiDiff;
-
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
-/*######
-## Mob Twilight Eggs
-######*/
-
-class npc_twilight_eggs : public CreatureScript
-{
-public:
- npc_twilight_eggs() : CreatureScript("npc_twilight_eggs") { }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_twilight_eggsAI(creature);
- }
-
- struct npc_twilight_eggsAI : public ScriptedAI
- {
- npc_twilight_eggsAI(Creature* creature) : ScriptedAI(creature)
- {
- SetCombatMovement(false);
- instance = creature->GetInstanceScript();
- }
-
- uint32 m_uiFadeArmorTimer;
- uint32 m_uiHatchEggTimer;
-
- InstanceScript* instance;
-
- void Reset() OVERRIDE
- {
- if (instance)
- me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER, me);
- m_uiFadeArmorTimer = 1000;
- m_uiHatchEggTimer = 20000;
- }
-
- void SpawnWhelps()
- {
- me->RemoveAllAuras();
-
- if (!instance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
- me->SummonCreature(NPC_TWILIGHT_WHELP, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
- else
- me->SummonCreature(NPC_SHARTHARION_TWILIGHT_WHELP, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
- me->DealDamage(me, me->GetHealth());
- }
-
- void JustSummoned(Creature* who) OVERRIDE
- {
- who->SetInCombatWithZone();
- }
-
- void UpdateAI(uint32 uiDiff) OVERRIDE
- {
- if (m_uiHatchEggTimer <= uiDiff)
- {
- Creature* Tenebron = instance->instance->GetCreature(instance->GetData64(DATA_TENEBRON));
- if (Tenebron)
- (CAST_AI(npc_tenebron::npc_tenebronAI, Tenebron->AI()))->m_bHasPortalOpen = false;
- SpawnWhelps();
+ _isSoftEnraged = true;
}
- else
- m_uiHatchEggTimer -= uiDiff;
- }
-
- void AttackStart(Unit* /*who*/) OVERRIDE { }
- void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { }
-
- };
-
-};
-
-/*######
-## Mob Flame Tsunami
-######*/
-class npc_flame_tsunami : public CreatureScript
-{
-public:
- npc_flame_tsunami() : CreatureScript("npc_flame_tsunami") { }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_flame_tsunamiAI(creature);
- }
-
- struct npc_flame_tsunamiAI : public ScriptedAI
- {
- npc_flame_tsunamiAI(Creature* creature) : ScriptedAI(creature)
- {
- me->SetDisplayId(11686);
- me->AddAura(SPELL_FLAME_TSUNAMI, me);
- }
-
- uint32 Tsunami_Timer;
- uint32 TsunamiBuff_timer;
- uint32 entry;
-
- void Reset() OVERRIDE
- {
- me->SetReactState(REACT_PASSIVE);
- Tsunami_Timer = 100;
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- TsunamiBuff_timer = 1000;
- entry = 0;
- }
-
- void UpdateAI(uint32 diff) OVERRIDE
- {
- if (Tsunami_Timer <= diff)
- {
- DoCast(me, SPELL_FLAME_TSUNAMI_DMG_AURA);
- Tsunami_Timer = 500;
- }else Tsunami_Timer -= diff;
-
- if (TsunamiBuff_timer <= diff)
- {
- if (Unit* LavaBlaze = GetClosestCreatureWithEntry(me, NPC_LAVA_BLAZE, 10.0f, true))
- LavaBlaze->CastSpell(LavaBlaze, SPELL_FLAME_TSUNAMI_BUFF, true);
- TsunamiBuff_timer = 1000;
- }else TsunamiBuff_timer -= diff;
- }
- };
-
-};
-
-// Twilight Fissure
-class npc_twilight_fissure : public CreatureScript
-{
-public:
- npc_twilight_fissure() : CreatureScript("npc_twilight_fissure") { }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_twilight_fissureAI(creature);
- }
- struct npc_twilight_fissureAI : public ScriptedAI
- {
- npc_twilight_fissureAI(Creature* creature) : ScriptedAI(creature)
- {
- SetCombatMovement(false);
- }
-
- uint32 VoidBlast_Timer;
+ DoMeleeAttackIfReady();
- void Reset() OVERRIDE
- {
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->AddAura( 46265, me ); // Wrong, can't find proper visual
- me->AddAura( 69422, me );
- VoidBlast_Timer = 5000;
+ EnterEvadeIfOutOfCombatArea(diff);
}
- void UpdateAI(uint32 diff) OVERRIDE
- {
- if (VoidBlast_Timer <= diff)
- {
- DoCastAOE(RAID_MODE(SPELL_VOID_BLAST, SPELL_VOID_BLAST_H));
- ////twilight realm
- //DoCastVictim(57620, true);
- //DoCastVictim(57874, true);
- VoidBlast_Timer = 9000;
- me->RemoveAllAuras();
- me->Kill(me);
- } else VoidBlast_Timer -= diff;
- }
+ private:
+ bool _isBerserk;
+ bool _isSoftEnraged;
+ bool _isHardEnraged;
+ uint8 drakeCount;
};
-};
-
-/*######
-## Mob Twilight Whelps
-######*/
-
-class npc_twilight_whelp : public CreatureScript
-{
-public:
- npc_twilight_whelp() : CreatureScript("npc_twilight_whelp") { }
-
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_twilight_whelpAI(creature);
+ return GetObsidianSanctumAI<boss_sartharionAI>(creature);
}
-
- struct npc_twilight_whelpAI : public ScriptedAI
- {
- npc_twilight_whelpAI(Creature* creature) : ScriptedAI(creature)
- {
- Reset();
- }
-
- uint32 m_uiFadeArmorTimer;
-
- void Reset() OVERRIDE
- {
- me->RemoveAllAuras();
- me->SetInCombatWithZone();
- m_uiFadeArmorTimer = 1000;
- }
-
- void UpdateAI(uint32 uiDiff) OVERRIDE
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- // twilight torment
- if (m_uiFadeArmorTimer <= uiDiff)
- {
- DoCastVictim(SPELL_FADE_ARMOR);
- m_uiFadeArmorTimer = urand(5000, 10000);
- }
- else
- m_uiFadeArmorTimer -= uiDiff;
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
-class achievement_twilight_assist : public AchievementCriteriaScript
-{
- public:
- achievement_twilight_assist() : AchievementCriteriaScript("achievement_twilight_assist")
- {
- }
-
- bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE
- {
- if (!target)
- return false;
-
- if (Creature* Sartharion = target->ToCreature())
- if (Sartharion->AI()->GetData(TWILIGHT_ACHIEVEMENTS) >= 1)
- return true;
-
- return false;
- }
-};
-
-class achievement_twilight_duo : public AchievementCriteriaScript
-{
- public:
- achievement_twilight_duo() : AchievementCriteriaScript("achievement_twilight_duo")
- {
- }
-
- bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE
- {
- if (!target)
- return false;
-
- if (Creature* Sartharion = target->ToCreature())
- if (Sartharion->AI()->GetData(TWILIGHT_ACHIEVEMENTS) >= 2)
- return true;
-
- return false;
- }
-};
-
-class achievement_twilight_zone : public AchievementCriteriaScript
-{
- public:
- achievement_twilight_zone() : AchievementCriteriaScript("achievement_twilight_zone")
- {
- }
-
- bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE
- {
- if (!target)
- return false;
-
- if (Creature* Sartharion = target->ToCreature())
- if (Sartharion->AI()->GetData(TWILIGHT_ACHIEVEMENTS) == 3)
- return true;
-
- return false;
- }
};
void AddSC_boss_sartharion()
{
new boss_sartharion();
- new npc_vesperon();
- new npc_shadron();
- new npc_tenebron();
- new npc_acolyte_of_shadron();
- new npc_acolyte_of_vesperon();
- new npc_twilight_eggs();
- new npc_flame_tsunami();
- new npc_twilight_fissure();
- new npc_twilight_whelp();
- new achievement_twilight_assist();
- new achievement_twilight_duo();
- new achievement_twilight_zone();
}
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp
index ace2258ac9f..be5a42517b5 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -19,8 +19,6 @@
#include "InstanceScript.h"
#include "obsidian_sanctum.h"
-#define MAX_ENCOUNTER 1
-
/* Obsidian Sanctum encounters:
0 - Sartharion
*/
@@ -28,48 +26,18 @@
class instance_obsidian_sanctum : public InstanceMapScript
{
public:
- instance_obsidian_sanctum() : InstanceMapScript("instance_obsidian_sanctum", 615) { }
-
- InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE
- {
- return new instance_obsidian_sanctum_InstanceMapScript(map);
- }
+ instance_obsidian_sanctum() : InstanceMapScript(OSScriptName, 615) { }
struct instance_obsidian_sanctum_InstanceMapScript : public InstanceScript
{
instance_obsidian_sanctum_InstanceMapScript(Map* map) : InstanceScript(map) { }
- uint32 m_auiEncounter[MAX_ENCOUNTER];
- uint64 m_uiSartharionGUID;
- uint64 m_uiTenebronGUID;
- uint64 m_uiShadronGUID;
- uint64 m_uiVesperonGUID;
-
- bool m_bTenebronKilled;
- bool m_bShadronKilled;
- bool m_bVesperonKilled;
-
void Initialize() OVERRIDE
{
- memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
-
- m_uiSartharionGUID = 0;
- m_uiTenebronGUID = 0;
- m_uiShadronGUID = 0;
- m_uiVesperonGUID = 0;
-
- m_bTenebronKilled = false;
- m_bShadronKilled = false;
- m_bVesperonKilled = false;
- }
-
- bool IsEncounterInProgress() const OVERRIDE
- {
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS)
- return true;
-
- return false;
+ sartharionGUID = 0;
+ tenebronGUID = 0;
+ shadronGUID = 0;
+ vesperonGUID = 0;
}
void OnCreatureCreate(Creature* creature) OVERRIDE
@@ -77,68 +45,113 @@ public:
switch (creature->GetEntry())
{
case NPC_SARTHARION:
- m_uiSartharionGUID = creature->GetGUID();
+ sartharionGUID = creature->GetGUID();
break;
- //three dragons below set to active state once created.
- //we must expect bigger raid to encounter main boss, and then three dragons must be active due to grid differences
+ // Three dragons below set to active state once created.
+ // We must expect bigger raid to encounter main boss, and then three dragons must be active due to grid differences
case NPC_TENEBRON:
- m_uiTenebronGUID = creature->GetGUID();
+ tenebronGUID = creature->GetGUID();
creature->setActive(true);
break;
case NPC_SHADRON:
- m_uiShadronGUID = creature->GetGUID();
+ shadronGUID = creature->GetGUID();
creature->setActive(true);
break;
case NPC_VESPERON:
- m_uiVesperonGUID = creature->GetGUID();
+ vesperonGUID = creature->GetGUID();
creature->setActive(true);
break;
}
}
- void SetData(uint32 uiType, uint32 uiData) OVERRIDE
- {
- if (uiType == TYPE_SARTHARION_EVENT)
- m_auiEncounter[0] = uiData;
- else if (uiType == TYPE_TENEBRON_PREKILLED)
- m_bTenebronKilled = true;
- else if (uiType == TYPE_SHADRON_PREKILLED)
- m_bShadronKilled = true;
- else if (uiType == TYPE_VESPERON_PREKILLED)
- m_bVesperonKilled = true;
- }
-
- uint32 GetData(uint32 uiType) const OVERRIDE
+ bool SetBossState(uint32 type, EncounterState state) OVERRIDE
{
- if (uiType == TYPE_SARTHARION_EVENT)
- return m_auiEncounter[0];
- else if (uiType == TYPE_TENEBRON_PREKILLED)
- return m_bTenebronKilled;
- else if (uiType == TYPE_SHADRON_PREKILLED)
- return m_bShadronKilled;
- else if (uiType == TYPE_VESPERON_PREKILLED)
- return m_bVesperonKilled;
+ if (!InstanceScript::SetBossState(type, state))
+ return false;
- return 0;
+ switch (type)
+ {
+ case DATA_SARTHARION:
+ case DATA_TENEBRON:
+ case DATA_SHADRON:
+ case DATA_VESPERON:
+ break;
+ default:
+ break;
+ }
+ return true;
}
- uint64 GetData64(uint32 uiData) const OVERRIDE
+ uint64 GetData64(uint32 Data) const OVERRIDE
{
- switch (uiData)
+ switch (Data)
{
case DATA_SARTHARION:
- return m_uiSartharionGUID;
+ return sartharionGUID;
case DATA_TENEBRON:
- return m_uiTenebronGUID;
+ return tenebronGUID;
case DATA_SHADRON:
- return m_uiShadronGUID;
+ return shadronGUID;
case DATA_VESPERON:
- return m_uiVesperonGUID;
+ return vesperonGUID;
}
return 0;
}
+
+ std::string GetSaveData() OVERRIDE
+ {
+ OUT_SAVE_INST_DATA;
+
+ std::ostringstream saveStream;
+ saveStream << "O S " << GetBossSaveData();
+
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return saveStream.str();
+ }
+
+ void Load(const char* str) OVERRIDE
+ {
+ if (!str)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+
+ OUT_LOAD_INST_DATA(str);
+
+ char dataHead1, dataHead2;
+
+ std::istringstream loadStream(str);
+ loadStream >> dataHead1 >> dataHead2;
+
+ if (dataHead1 == 'O' && dataHead2 == 'S')
+ {
+ for (uint32 i = 0; i < EncounterCount; ++i)
+ {
+ uint32 tmpState;
+ loadStream >> tmpState;
+ if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
+ tmpState = NOT_STARTED;
+ SetBossState(i, EncounterState(tmpState));
+ }
+ }
+ else
+ OUT_LOAD_INST_DATA_FAIL;
+
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+
+ protected:
+ uint64 sartharionGUID;
+ uint64 tenebronGUID;
+ uint64 shadronGUID;
+ uint64 vesperonGUID;
};
+ InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE
+ {
+ return new instance_obsidian_sanctum_InstanceMapScript(map);
+ }
};
void AddSC_instance_obsidian_sanctum()
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp
new file mode 100644
index 00000000000..dd699911786
--- /dev/null
+++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp
@@ -0,0 +1,1074 @@
+/*
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
+ *
+ * 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 "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "Cell.h"
+#include "CellImpl.h"
+#include "obsidian_sanctum.h"
+
+enum Enums
+{
+ //Mini bosses common spells
+ SPELL_TWILIGHT_RESIDUE = 61885, // makes immune to shadow damage, applied when leave phase
+
+ //Miniboses (Vesperon, Shadron, Tenebron)
+ SPELL_SHADOW_BREATH_H = 59126, // Inflicts 8788 to 10212 Fire damage to enemies in a cone in front of the caster.
+ SPELL_SHADOW_BREATH = 57570, // Inflicts 6938 to 8062 Fire damage to enemies in a cone in front of the caster.
+
+ SPELL_SHADOW_FISSURE_H = 59127, // Deals 9488 to 13512 Shadow damage to any enemy within the Shadow fissure after 5 sec.
+ SPELL_SHADOW_FISSURE = 57579, // Deals 6188 to 8812 Shadow damage to any enemy within the Shadow fissure after 5 sec.
+
+ //Vesperon
+ //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal open multiple times
+ NPC_ACOLYTE_OF_VESPERON = 31219, // Acolyte of Vesperon
+ SPELL_POWER_OF_VESPERON = 61251, // Vesperon's presence decreases the maximum health of all enemies by 25%.
+ SPELL_TWILIGHT_TORMENT_VESP = 57948, // (Shadow only) trigger 57935 then 57988
+ SPELL_TWILIGHT_TORMENT_VESP_ACO = 58853, // (Fire and Shadow) trigger 58835 then 57988
+
+ //Shadron
+ //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal open multiple times
+ NPC_ACOLYTE_OF_SHADRON = 31218, // Acolyte of Shadron
+ SPELL_POWER_OF_SHADRON = 58105, // Shadron's presence increases Fire damage taken by all enemies by 100%.
+ SPELL_GIFT_OF_TWILIGTH_SHA = 57835, // TARGET_SCRIPT shadron
+ SPELL_GIFT_OF_TWILIGTH_SAR = 58766, // TARGET_SCRIPT sartharion
+ SPELL_VOID_BLAST = 57581, // Twilight Fissure
+ SPELL_VOID_BLAST_H = 59128,
+
+ //Tenebron
+ //in the portal spawns 6 eggs, if not killed in time (approx. 20s) they will hatch, whelps can cast 60708
+ SPELL_POWER_OF_TENEBRON = 61248, // Tenebron's presence increases Shadow damage taken by all enemies by 100%.
+ //Tenebron, dummy spell
+ SPELL_SUMMON_TWILIGHT_WHELP = 58035, // doesn't work, will spawn NPC_TWILIGHT_WHELP
+ SPELL_SUMMON_SARTHARION_TWILIGHT_WHELP = 58826, // doesn't work, will spawn NPC_SHARTHARION_TWILIGHT_WHELP
+ SPELL_TWILIGHT_REVENGE = 60639,
+ SPELL_HATCH_EGGS_H = 59189,
+ SPELL_HATCH_EGGS = 58542,
+ SPELL_HATCH_EGGS_EFFECT_H = 59190,
+ SPELL_HATCH_EGGS_EFFECT = 58685,
+ NPC_TWILIHT_WHELP = 31214,
+ NPC_TWILIGHT_EGG = 30882,
+ NPC_SARTHARION_TWILIGHT_EGG = 31204,
+
+ SPELL_TWILIGHT_SHIFT_ENTER = 57620, // enter phase. Player get this when click GO
+ SPELL_TWILIGHT_SHIFT = 57874, // Twilight Shift Aura
+ SPELL_TWILIGHT_SHIFT_REMOVAL = 61187, // leave phase
+ SPELL_TWILIGHT_SHIFT_REMOVAL_ALL = 61190, // leave phase (probably version to make all leave)
+
+ //Whelps
+ NPC_TWILIGHT_WHELP = 30890,
+ NPC_SHARTHARION_TWILIGHT_WHELP = 31214,
+ SPELL_FADE_ARMOR = 60708, // Reduces the armor of an enemy by 1500 for 15s
+
+ //flame tsunami
+ SPELL_FLAME_TSUNAMI = 57494, // the visual dummy
+ SPELL_FLAME_TSUNAMI_LEAP = 60241, // SPELL_EFFECT_138 some leap effect, causing caster to move in direction
+
+ SPELL_FLAME_TSUNAMI_DMG_AURA = 57491, // periodic damage, npc has this aura
+ SPELL_FLAME_TSUNAMI_BUFF = 60430,
+ NPC_LAVA_BLAZE = 30643, // adds spawning from flame strike
+
+ //using these custom points for dragons start and end
+ POINT_ID_INIT = 100,
+ POINT_ID_LAND = 200
+};
+
+enum Misc
+{
+ DATA_CAN_LOOT = 0
+};
+
+#define MAX_WAYPOINT 6
+//points around raid "isle", counter clockwise. should probably be adjusted to be more alike
+Position const dragonCommon[MAX_WAYPOINT]=
+{
+ { 3214.012f, 468.932f, 98.652f, 0.0f },
+ { 3244.950f, 468.427f, 98.652f, 0.0f },
+ { 3283.520f, 496.869f, 98.652f, 0.0f },
+ { 3287.316f, 555.875f, 98.652f, 0.0f },
+ { 3250.479f, 585.827f, 98.652f, 0.0f },
+ { 3209.969f, 566.523f, 98.652f, 0.0f }
+};
+
+Position const AcolyteofShadron = { 3363.92f, 534.703f, 97.2683f, 0.0f };
+Position const AcolyteofShadron2 = { 3246.57f, 551.263f, 58.6164f, 0.0f };
+Position const AcolyteofVesperon = { 3145.68f, 520.71f, 89.7f, 0.0f };
+Position const AcolyteofVesperon2 = { 3246.57f, 551.263f, 58.6164f, 0.0f };
+
+Position const TwilightEggs[] =
+{
+ { 3219.28f, 669.121f, 88.5549f, 0.0f },
+ { 3221.55f, 682.852f, 90.5361f, 0.0f },
+ { 3239.77f, 685.94f, 90.3168f, 0.0f },
+ { 3250.33f, 669.749f, 88.7637f, 0.0f },
+ { 3246.6f, 642.365f, 84.8752f, 0.0f },
+ { 3233.68f, 653.117f, 85.7051f, 0.0f }
+};
+
+Position const TwilightEggsSarth[] =
+{
+ { 3252.73f, 515.762f, 58.5501f, 0.0f },
+ { 3256.56f, 521.119f, 58.6061f, 0.0f },
+ { 3255.63f, 527.513f, 58.7568f, 0.0f },
+ { 3264.90f, 525.865f, 58.6436f, 0.0f },
+ { 3264.26f, 516.364f, 58.8011f, 0.0f },
+ { 3257.54f, 502.285f, 58.2077f, 0.0f }
+};
+
+enum SharedTextIds
+{
+ SAY_AGGRO = 0,
+ SAY_SLAY = 1,
+ SAY_DEATH = 2,
+ SAY_BREATH = 3,
+ SAY_RESPOND = 4,
+ SAY_SPECIAL = 5,
+ WHISPER_OPEN_PORTAL = 6,
+ WHISPER_OPENED_PORTAL = 7
+};
+
+enum DragonEvents
+{
+ // Shared Events
+ EVENT_FREE_MOVEMENT = 1,
+ EVENT_SHADOW_FISSURE = 2,
+ EVENT_SHADOW_BREATH = 3,
+
+ // Tenebron
+ EVENT_HATCH_EGGS = 4,
+
+ // Shadron
+ EVENT_ACOLYTE_SHADRON = 5,
+
+ // Vesperon
+ EVENT_ACOLYTE_VESPERON = 6
+};
+
+// to control each dragons common abilities
+struct dummy_dragonAI : public ScriptedAI
+{
+ dummy_dragonAI(Creature* creature) : ScriptedAI(creature)
+ {
+ instance = creature->GetInstanceScript();
+ }
+
+ void Reset() OVERRIDE
+ {
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ events.Reset();
+ waypointId = 0;
+ portalRespawnTime = 30000;
+ _canMoveFree = false;
+ _canLoot = true;
+ }
+
+ void EnterCombat(Unit* /*who*/) OVERRIDE
+ {
+ Talk(SAY_AGGRO);
+ DoZoneInCombat();
+
+ events.ScheduleEvent(EVENT_SHADOW_FISSURE, 5000);
+ events.ScheduleEvent(EVENT_SHADOW_BREATH, 20000);
+ }
+
+ void SetData(uint32 type, uint32 value) OVERRIDE
+ {
+ if (type == DATA_CAN_LOOT)
+ _canLoot = value;
+ }
+
+ void MovementInform(uint32 type, uint32 pointId) OVERRIDE
+ {
+ if (!instance || type != POINT_MOTION_TYPE)
+ return;
+
+ // debug_log("dummy_dragonAI: %s reached point %u", me->GetName(), uiPointId);
+
+ // if healers messed up the raid and we was already initialized
+ if (instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS)
+ {
+ EnterEvadeMode();
+ return;
+ }
+
+ // this is end, if we reach this, don't do much
+ if (pointId == POINT_ID_LAND)
+ {
+ me->GetMotionMaster()->Clear();
+ me->SetInCombatWithZone();
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
+ {
+ me->AddThreat(target, 1.0f);
+ me->Attack(target, true);
+ me->GetMotionMaster()->MoveChase(target);
+ }
+
+ _canMoveFree = false;
+ return;
+ }
+
+ // increase
+ waypointId = pointId + 1;
+
+ // if we have reached a point bigger or equal to count, it mean we must reset to point 0
+ if (waypointId >= MAX_WAYPOINT)
+ {
+ if (!_canMoveFree)
+ _canMoveFree = true;
+
+ waypointId = 0;
+ }
+
+ events.ScheduleEvent(EVENT_FREE_MOVEMENT, 500);
+ }
+
+ // "opens" the portal and does the "opening" whisper
+ void OpenPortal()
+ {
+ // there are 4 portal spawn locations, each are expected to be spawned with negative spawntimesecs in database
+
+ // using a grid search here seem to be more efficient than caching all four guids
+ // in instance script and calculate range to each.
+ GameObject* portal = me->FindNearestGameObject(GO_TWILIGHT_PORTAL, 50.0f);
+
+ switch (me->GetEntry())
+ {
+ case NPC_TENEBRON:
+ {
+ if (instance && !instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS)
+ {
+ for (uint32 i = 0; i < 6; ++i)
+ me->SummonCreature(NPC_TWILIGHT_EGG, TwilightEggs[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
+ }
+ else
+ {
+ for (uint32 i = 0; i < 6; ++i)
+ me->SummonCreature(NPC_SARTHARION_TWILIGHT_EGG, TwilightEggsSarth[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
+ }
+ break;
+ }
+ case NPC_SHADRON:
+ {
+ if (instance && !instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS)
+ me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 28000);
+ else
+ me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 28000);
+
+ break;
+ }
+ case NPC_VESPERON:
+ {
+ if (instance && !instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS)
+ {
+ if (Creature* acolyte = me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
+ {
+ me->InterruptNonMeleeSpells(true);
+ acolyte->InterruptNonMeleeSpells(true);
+ me->CastSpell(me, 32747, false);
+ }
+ }
+ else
+ {
+ if (Creature* acolyte = me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
+ {
+ me->InterruptNonMeleeSpells(true);
+ acolyte->InterruptNonMeleeSpells(true);
+ me->CastSpell(me, 32747, false);
+ }
+ }
+
+ break;
+ }
+ }
+
+ Talk(WHISPER_OPEN_PORTAL);
+ Talk(WHISPER_OPENED_PORTAL);
+
+ // By using SetRespawnTime() we will actually "spawn" the object with our defined time.
+ // Once time is up, portal will disappear again.
+ if (portal && !portal->isSpawned())
+ portal->SetRespawnTime(portalRespawnTime);
+
+ // Unclear what are expected to happen if one drake has a portal open already
+ // Refresh respawnTime so time again are set to 30secs?
+ }
+
+ void KilledUnit(Unit* who) OVERRIDE
+ {
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_SLAY);
+ }
+
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ if (!_canLoot)
+ me->SetLootRecipient(NULL);
+
+ uint32 spellId = 0;
+
+ switch (me->GetEntry())
+ {
+ case NPC_TENEBRON:
+ spellId = SPELL_POWER_OF_TENEBRON;
+ if (instance && instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS)
+ instance->SetBossState(DATA_TENEBRON, DONE);
+ break;
+ case NPC_SHADRON:
+ spellId = SPELL_POWER_OF_SHADRON;
+ if (instance && instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS)
+ instance->SetBossState(DATA_SHADRON, DONE);
+ if (Creature* acolyte = me->FindNearestCreature(NPC_ACOLYTE_OF_SHADRON, 100.0f))
+ acolyte->Kill(acolyte);
+ break;
+ case NPC_VESPERON:
+ spellId = SPELL_POWER_OF_VESPERON;
+ if (instance && instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS)
+ instance->SetBossState(DATA_VESPERON, DONE);
+ if (Creature* acolyte = me->FindNearestCreature(NPC_ACOLYTE_OF_VESPERON, 100.0f))
+ acolyte->Kill(acolyte);
+ break;
+ }
+
+ Talk(SAY_DEATH);
+ me->RemoveAurasDueToSpell(spellId);
+
+ instance->DoRemoveAurasDueToSpellOnPlayers(spellId);
+
+ // not if solo mini-boss fight
+ if (instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS)
+ return;
+
+ // Twilight Revenge to main boss
+ if (Unit* sartharion = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_SARTHARION)))
+ if (sartharion->IsAlive())
+ {
+ sartharion->RemoveAurasDueToSpell(spellId);
+ DoCast(sartharion, SPELL_TWILIGHT_REVENGE, true);
+ }
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ events.Update(diff);
+
+ if (events.ExecuteEvent() == EVENT_FREE_MOVEMENT)
+ {
+ if (_canMoveFree && waypointId < MAX_WAYPOINT)
+ me->GetMotionMaster()->MovePoint(waypointId, dragonCommon[waypointId]);
+ }
+ }
+
+ void ExecuteEvent(uint32 eventId)
+ {
+ switch (eventId)
+ {
+ case EVENT_SHADOW_FISSURE:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
+ DoCast(target, RAID_MODE(SPELL_SHADOW_FISSURE, SPELL_SHADOW_FISSURE));
+ events.ScheduleEvent(eventId, urand(15000, 20000));
+ break;
+ case EVENT_SHADOW_BREATH:
+ Talk(SAY_BREATH);
+ DoCastVictim(RAID_MODE(SPELL_SHADOW_BREATH, SPELL_SHADOW_BREATH_H));
+ events.ScheduleEvent(eventId, urand(20000, 25000));
+ break;
+ default:
+ break;
+ }
+ }
+
+ protected:
+ InstanceScript* instance;
+ EventMap events;
+ uint32 waypointId;
+ int32 portalRespawnTime;
+ bool _canMoveFree;
+ bool _canLoot;
+};
+
+/*######
+## Tenebron
+######*/
+
+class npc_tenebron : public CreatureScript
+{
+public:
+ npc_tenebron() : CreatureScript("npc_tenebron") { }
+
+ struct npc_tenebronAI : public dummy_dragonAI
+ {
+ npc_tenebronAI(Creature* creature) : dummy_dragonAI(creature) { }
+
+ void Reset() OVERRIDE
+ {
+ dummy_dragonAI::Reset();
+ }
+
+ void EnterCombat(Unit* who) OVERRIDE
+ {
+ dummy_dragonAI::EnterCombat(who);
+
+ events.ScheduleEvent(EVENT_HATCH_EGGS, 30000);
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ // if no target, update dummy and return
+ if (!UpdateVictim())
+ {
+ dummy_dragonAI::UpdateAI(diff);
+ return;
+ }
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_HATCH_EGGS:
+ OpenPortal();
+ events.ScheduleEvent(EVENT_HATCH_EGGS, 30000);
+ break;
+ default:
+ dummy_dragonAI::ExecuteEvent(eventId);
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return GetObsidianSanctumAI<npc_tenebronAI>(creature);
+ }
+};
+
+/*######
+## Shadron
+######*/
+
+class npc_shadron : public CreatureScript
+{
+public:
+ npc_shadron() : CreatureScript("npc_shadron") { }
+
+ struct npc_shadronAI : public dummy_dragonAI
+ {
+ npc_shadronAI(Creature* creature) : dummy_dragonAI(creature) { }
+
+ void Reset() OVERRIDE
+ {
+ dummy_dragonAI::Reset();
+
+ if (me->HasAura(SPELL_TWILIGHT_TORMENT_VESP))
+ me->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP);
+
+ if (me->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA))
+ me->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA);
+
+ instance->SetBossState(DATA_PORTAL_OPEN, NOT_STARTED);
+ }
+
+ void EnterCombat(Unit* who) OVERRIDE
+ {
+ dummy_dragonAI::EnterCombat(who);
+
+ events.ScheduleEvent(EVENT_ACOLYTE_SHADRON, 60000);
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ // if no target, update dummy and return
+ if (!UpdateVictim())
+ {
+ dummy_dragonAI::UpdateAI(diff);
+ return;
+ }
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_ACOLYTE_SHADRON:
+ if (instance->GetBossState(DATA_PORTAL_OPEN) == NOT_STARTED)
+ events.ScheduleEvent(EVENT_ACOLYTE_SHADRON, 10000);
+ else
+ {
+ if (me->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA))
+ return;
+
+ OpenPortal();
+
+ instance->SetBossState(DATA_PORTAL_OPEN, IN_PROGRESS);
+
+ events.ScheduleEvent(EVENT_ACOLYTE_SHADRON, urand(60000, 65000));
+ }
+ break;
+ default:
+ dummy_dragonAI::ExecuteEvent(eventId);
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return GetObsidianSanctumAI<npc_shadronAI>(creature);
+ }
+};
+
+/*######
+## Vesperon
+######*/
+
+class npc_vesperon : public CreatureScript
+{
+public:
+ npc_vesperon() : CreatureScript("npc_vesperon") { }
+
+ struct npc_vesperonAI : public dummy_dragonAI
+ {
+ npc_vesperonAI(Creature* creature) : dummy_dragonAI(creature) { }
+
+ void Reset() OVERRIDE
+ {
+ dummy_dragonAI::Reset();
+ }
+
+ void EnterCombat(Unit* who) OVERRIDE
+ {
+ dummy_dragonAI::EnterCombat(who);
+
+ events.ScheduleEvent(EVENT_ACOLYTE_VESPERON, 60000);
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ // if no target, update dummy and return
+ if (!UpdateVictim())
+ {
+ dummy_dragonAI::UpdateAI(diff);
+ return;
+ }
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_ACOLYTE_VESPERON:
+ if (instance->GetBossState(DATA_PORTAL_OPEN) == IN_PROGRESS)
+ events.ScheduleEvent(EVENT_ACOLYTE_VESPERON, 10000);
+ else
+ {
+ OpenPortal();
+ DoCastVictim(SPELL_TWILIGHT_TORMENT_VESP);
+ events.ScheduleEvent(EVENT_ACOLYTE_VESPERON, urand(60000, 70000));
+ }
+ break;
+ default:
+ dummy_dragonAI::ExecuteEvent(eventId);
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return GetObsidianSanctumAI<npc_vesperonAI>(creature);
+ }
+};
+
+/*######
+## Acolyte of Shadron
+######*/
+
+class npc_acolyte_of_shadron : public CreatureScript
+{
+ public:
+ npc_acolyte_of_shadron() : CreatureScript("npc_acolyte_of_shadron") { }
+
+ struct npc_acolyte_of_shadronAI : public ScriptedAI
+ {
+ npc_acolyte_of_shadronAI(Creature* creature) : ScriptedAI(creature)
+ {
+ instance = creature->GetInstanceScript();
+ }
+
+ void Reset() OVERRIDE
+ {
+ // Despawn the NPC automatically after 28 seconds
+ me->DespawnOrUnsummon(28000);
+
+ //if not solo fight, buff main boss, else place debuff on mini-boss. both spells TARGET_SCRIPT
+ if (instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS)
+ {
+ if (Creature* sartharion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SARTHARION)))
+ sartharion->AddAura(SPELL_GIFT_OF_TWILIGTH_SAR, sartharion);
+ }
+ else
+ {
+ if (Creature* shadron = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SHADRON)))
+ shadron->AddAura(SPELL_GIFT_OF_TWILIGTH_SHA, shadron);
+ }
+
+ me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER, me);
+ }
+
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ if (ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SHADRON)))
+ instance->SetBossState(DATA_PORTAL_OPEN, NOT_STARTED);
+
+ Map* map = me->GetMap();
+ if (map->IsDungeon())
+ {
+ Map::PlayerList const& PlayerList = map->GetPlayers();
+
+ if (PlayerList.isEmpty())
+ return;
+
+ for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ {
+ if (i->GetSource()->IsAlive() && i->GetSource()->HasAura(SPELL_TWILIGHT_SHIFT, 0) && !i->GetSource()->GetVictim())
+ {
+ i->GetSource()->CastSpell(i->GetSource(), SPELL_TWILIGHT_SHIFT_REMOVAL_ALL, true);
+ i->GetSource()->CastSpell(i->GetSource(), SPELL_TWILIGHT_RESIDUE, true);
+ i->GetSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT);
+ i->GetSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT_ENTER);
+ }
+ }
+ }
+
+ // not solo fight, so main boss has debuff
+ if (Creature* debuffTarget = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SARTHARION)))
+ if (debuffTarget->IsAlive() && debuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SAR))
+ debuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SAR);
+
+ // event not in progress, then solo fight and must remove debuff mini-boss
+ if (Creature* debuffTarget = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SHADRON)))
+ if (debuffTarget->IsAlive() && debuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA))
+ debuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA);
+ }
+
+ void UpdateAI(uint32 /*diff*/) OVERRIDE
+ {
+ if (!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ InstanceScript* instance;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return GetObsidianSanctumAI<npc_acolyte_of_shadronAI>(creature);
+ }
+};
+
+/*######
+## Acolyte of Vesperon
+######*/
+
+class npc_acolyte_of_vesperon : public CreatureScript
+{
+ public:
+ npc_acolyte_of_vesperon() : CreatureScript("npc_acolyte_of_vesperon") { }
+
+ struct npc_acolyte_of_vesperonAI : public ScriptedAI
+ {
+ npc_acolyte_of_vesperonAI(Creature* creature) : ScriptedAI(creature)
+ {
+ instance = creature->GetInstanceScript();
+ }
+
+ void Reset() OVERRIDE
+ {
+ // Despawn the NPC automatically after 28 seconds
+ me->DespawnOrUnsummon(28000);
+
+ me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER, me);
+
+ DoCast(me, SPELL_TWILIGHT_TORMENT_VESP_ACO);
+ }
+
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ me->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP_ACO);
+
+ // remove twilight torment on Vesperon
+ if (Creature* vesperon = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_VESPERON)))
+ {
+ instance->SetBossState(DATA_PORTAL_OPEN, NOT_STARTED);
+
+ if (vesperon->IsAlive() && vesperon->HasAura(SPELL_TWILIGHT_TORMENT_VESP))
+ vesperon->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP);
+ }
+
+ Map* map = me->GetMap();
+ if (map->IsDungeon())
+ {
+ Map::PlayerList const &PlayerList = map->GetPlayers();
+
+ if (PlayerList.isEmpty())
+ return;
+
+ for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ {
+ if (i->GetSource()->IsAlive() && i->GetSource()->HasAura(SPELL_TWILIGHT_SHIFT, 0) && !i->GetSource()->GetVictim())
+ {
+ i->GetSource()->CastSpell(i->GetSource(), SPELL_TWILIGHT_SHIFT_REMOVAL_ALL, true);
+ i->GetSource()->CastSpell(i->GetSource(), SPELL_TWILIGHT_RESIDUE, true);
+ i->GetSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT);
+ i->GetSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT_ENTER);
+ }
+ if (i->GetSource()->IsAlive() && i->GetSource()->HasAura(SPELL_TWILIGHT_TORMENT_VESP, 0) && !i->GetSource()->GetVictim())
+ i->GetSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP);
+ }
+ }
+
+ instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_TWILIGHT_TORMENT_VESP_ACO);
+ instance->DoRemoveAurasDueToSpellOnPlayers(57935);
+ instance->DoRemoveAurasDueToSpellOnPlayers(58835); // Components of spell Twilight Torment
+ }
+
+ void UpdateAI(uint32 /*diff*/) OVERRIDE
+ {
+ if (!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ InstanceScript* instance;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return GetObsidianSanctumAI<npc_acolyte_of_vesperonAI>(creature);
+ }
+};
+
+/*######
+## Twilight Eggs
+######*/
+
+enum TwilightEggs
+{
+ EVENT_TWILIGHT_EGGS = 11
+};
+
+class npc_twilight_eggs : public CreatureScript
+{
+public:
+ npc_twilight_eggs() : CreatureScript("npc_twilight_eggs") { }
+
+ struct npc_twilight_eggsAI : public ScriptedAI
+ {
+ npc_twilight_eggsAI(Creature* creature) : ScriptedAI(creature)
+ {
+ SetCombatMovement(false);
+ instance = creature->GetInstanceScript();
+ }
+
+ void Reset() OVERRIDE
+ {
+ me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER, me);
+
+ events.ScheduleEvent(EVENT_TWILIGHT_EGGS, 20000);
+ }
+
+ void SpawnWhelps()
+ {
+ me->RemoveAllAuras();
+
+ if (!instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS)
+ me->SummonCreature(NPC_TWILIGHT_WHELP, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
+ else
+ me->SummonCreature(NPC_SHARTHARION_TWILIGHT_WHELP, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
+ me->DealDamage(me, me->GetHealth());
+ }
+
+ void JustSummoned(Creature* who) OVERRIDE
+ {
+ who->SetInCombatWithZone();
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ events.Update(diff);
+
+ if (events.ExecuteEvent() == EVENT_TWILIGHT_EGGS)
+ {
+ if (ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_TENEBRON)))
+ instance->SetBossState(DATA_PORTAL_OPEN, NOT_STARTED);
+
+ SpawnWhelps();
+ }
+ }
+
+ private:
+ InstanceScript* instance;
+ EventMap events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return GetObsidianSanctumAI<npc_twilight_eggsAI>(creature);
+ }
+};
+
+/*######
+## Flame Tsunami
+######*/
+
+enum FlameTsunami
+{
+ EVENT_TSUNAMI_TIMER = 12,
+ EVENT_TSUNAMI_BUFF = 13
+};
+
+class npc_flame_tsunami : public CreatureScript
+{
+public:
+ npc_flame_tsunami() : CreatureScript("npc_flame_tsunami") { }
+
+ struct npc_flame_tsunamiAI : public ScriptedAI
+ {
+ npc_flame_tsunamiAI(Creature* creature) : ScriptedAI(creature)
+ {
+ me->SetDisplayId(11686);
+ me->AddAura(SPELL_FLAME_TSUNAMI, me);
+ }
+
+ void Reset() OVERRIDE
+ {
+ me->SetReactState(REACT_PASSIVE);
+ events.ScheduleEvent(EVENT_TSUNAMI_TIMER, 100);
+ events.ScheduleEvent(EVENT_TSUNAMI_BUFF, 1000);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_TSUNAMI_TIMER:
+ DoCast(me, SPELL_FLAME_TSUNAMI_DMG_AURA);
+ events.ScheduleEvent(EVENT_TSUNAMI_TIMER, 500);
+ break;
+ case EVENT_TSUNAMI_BUFF:
+ if (Unit* lavaBlaze = GetClosestCreatureWithEntry(me, NPC_LAVA_BLAZE, 10.0f, true))
+ lavaBlaze->CastSpell(lavaBlaze, SPELL_FLAME_TSUNAMI_BUFF, true);
+ events.ScheduleEvent(EVENT_TSUNAMI_BUFF, 1000);
+ break;
+ }
+ }
+ }
+
+ private:
+ EventMap events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_flame_tsunamiAI(creature);
+ }
+};
+
+/*######
+## Twilight Fissure
+######*/
+
+enum TwilightFissure
+{
+ EVENT_VOID_BLAST = 14
+};
+
+class npc_twilight_fissure : public CreatureScript
+{
+public:
+ npc_twilight_fissure() : CreatureScript("npc_twilight_fissure") { }
+
+ struct npc_twilight_fissureAI : public ScriptedAI
+ {
+ npc_twilight_fissureAI(Creature* creature) : ScriptedAI(creature)
+ {
+ SetCombatMovement(false);
+ }
+
+ void Reset() OVERRIDE
+ {
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->AddAura(46265, me); // Wrong, can't find proper visual
+ me->AddAura(69422, me);
+ events.ScheduleEvent(EVENT_VOID_BLAST, 5000);
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ events.Update(diff);
+
+ if (events.ExecuteEvent() == EVENT_VOID_BLAST)
+ {
+ DoCastAOE(RAID_MODE(SPELL_VOID_BLAST, SPELL_VOID_BLAST_H));
+ ////twilight realm
+ //DoCastVictim(57620, true);
+ //DoCastVictim(57874, true);
+ me->RemoveAllAuras();
+ me->Kill(me);
+ }
+ }
+
+ private:
+ EventMap events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_twilight_fissureAI(creature);
+ }
+};
+
+/*######
+## Twilight Whelps
+######*/
+
+enum TwilightWhelps
+{
+ EVENT_FADE_ARMOR = 15
+};
+
+class npc_twilight_whelp : public CreatureScript
+{
+public:
+ npc_twilight_whelp() : CreatureScript("npc_twilight_whelp") { }
+
+ struct npc_twilight_whelpAI : public ScriptedAI
+ {
+ npc_twilight_whelpAI(Creature* creature) : ScriptedAI(creature)
+ {
+ Reset();
+ }
+
+ void Reset() OVERRIDE
+ {
+ me->RemoveAllAuras();
+ me->SetInCombatWithZone();
+ events.ScheduleEvent(EVENT_FADE_ARMOR, 1000);
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ if (!UpdateVictim())
+ return;
+
+ // twilight torment
+ events.Update(diff);
+
+ if (events.ExecuteEvent() == EVENT_FADE_ARMOR)
+ {
+ DoCastVictim(SPELL_FADE_ARMOR);
+ events.ScheduleEvent(EVENT_FADE_ARMOR, urand(5000, 10000));
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ EventMap events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_twilight_whelpAI(creature);
+ }
+};
+
+class achievement_twilight_assist : public AchievementCriteriaScript
+{
+ public:
+ achievement_twilight_assist() : AchievementCriteriaScript("achievement_twilight_assist") { }
+
+ bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE
+ {
+ return target && target->GetAI()->GetData(TWILIGHT_ACHIEVEMENTS) >= 1;
+ }
+};
+
+class achievement_twilight_duo : public AchievementCriteriaScript
+{
+ public:
+ achievement_twilight_duo() : AchievementCriteriaScript("achievement_twilight_duo") { }
+
+ bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE
+ {
+ return target && target->GetAI()->GetData(TWILIGHT_ACHIEVEMENTS) >= 2;
+ }
+};
+
+class achievement_twilight_zone : public AchievementCriteriaScript
+{
+ public:
+ achievement_twilight_zone() : AchievementCriteriaScript("achievement_twilight_zone") { }
+
+ bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE
+ {
+ return target && target->GetAI()->GetData(TWILIGHT_ACHIEVEMENTS) == 3;
+ }
+};
+
+void AddSC_obsidian_sanctum()
+{
+ new npc_vesperon();
+ new npc_shadron();
+ new npc_tenebron();
+ new npc_acolyte_of_shadron();
+ new npc_acolyte_of_vesperon();
+ new npc_twilight_eggs();
+ new npc_flame_tsunami();
+ new npc_twilight_fissure();
+ new npc_twilight_whelp();
+ new achievement_twilight_assist();
+ new achievement_twilight_duo();
+ new achievement_twilight_zone();
+}
+
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h
index 7d2403be469..f26ad3a45ed 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h
+++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -15,20 +15,21 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef DEF_OBSIDIAN_SANCTUM_H
-#define DEF_OBSIDIAN_SANCTUM_H
+#ifndef OBSIDIAN_SANCTUM_H_
+#define OBSIDIAN_SANCTUM_H_
+
+#define OSScriptName "instance_obsidian_sanctum"
+
+uint32 const EncounterCount = 5;
enum DataTypes
{
- TYPE_SARTHARION_EVENT = 1,
- TYPE_TENEBRON_PREKILLED = 2,
- TYPE_SHADRON_PREKILLED = 3,
- TYPE_VESPERON_PREKILLED = 4,
-
- DATA_SARTHARION = 10,
- DATA_TENEBRON = 11,
- DATA_SHADRON = 12,
- DATA_VESPERON = 13
+ DATA_SARTHARION = 0,
+ DATA_TENEBRON = 1,
+ DATA_SHADRON = 2,
+ DATA_VESPERON = 3,
+ DATA_PORTAL_OPEN = 4,
+ TWILIGHT_ACHIEVEMENTS = 5
};
enum CreaturesIds
@@ -44,4 +45,10 @@ enum GameObjectIds
GO_TWILIGHT_PORTAL = 193988
};
-#endif
+template<class AI>
+AI* GetObsidianSanctumAI(Creature* creature)
+{
+ return GetInstanceAI<AI>(creature, 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 a92df96113c..91c1563b494 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 175a64f49a5..d0b0db2e1ab 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
index f968add0b5b..0f583d54a13 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -852,9 +852,9 @@ class npc_halion_controller : public CreatureScript
halion->CastSpell(halion, GetSpell(_materialCorporealityValue, itr == DATA_TWILIGHT_HALION), true);
if (itr == DATA_TWILIGHT_HALION)
- halion->AI()->Talk(oldValue < _materialCorporealityValue ? EMOTE_CORPOREALITY_TOT : EMOTE_CORPOREALITY_TIT, halion->GetGUID());
+ halion->AI()->Talk(oldValue < _materialCorporealityValue ? EMOTE_CORPOREALITY_TOT : EMOTE_CORPOREALITY_TIT, halion);
else // if (itr == DATA_HALION)
- halion->AI()->Talk(oldValue > _materialCorporealityValue ? EMOTE_CORPOREALITY_POT : EMOTE_CORPOREALITY_PIP, halion->GetGUID());
+ halion->AI()->Talk(oldValue > _materialCorporealityValue ? EMOTE_CORPOREALITY_POT : EMOTE_CORPOREALITY_PIP, halion);
}
}
}
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 9f20cb4062a..bd5ab3d1a6e 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 d6c71889962..1f8656853a2 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp
index 9794d8c729f..d0a46b01bd4 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
index f50b10fb513..016d541cec9 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
index f6fd1c14a9b..773009b06d6 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -196,8 +196,7 @@ public:
if (MovementType != POINT_MOTION_TYPE)
return;
- if (instance)
- instance->SetData(BOSS_ARGENT_CHALLENGE_E, DONE);
+ instance->SetData(BOSS_ARGENT_CHALLENGE_E, DONE);
me->DisappearAndDie();
}
@@ -248,7 +247,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_eadricAI(creature);
+ return GetInstanceAI<boss_eadricAI>(creature);
}
};
@@ -320,8 +319,7 @@ public:
if (MovementType != POINT_MOTION_TYPE || Point != 0)
return;
- if (instance)
- instance->SetData(BOSS_ARGENT_CHALLENGE_P, DONE);
+ instance->SetData(BOSS_ARGENT_CHALLENGE_P, DONE);
me->DisappearAndDie();
}
@@ -406,7 +404,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_paletressAI(creature);
+ return GetInstanceAI<boss_paletressAI>(creature);
}
};
@@ -582,14 +580,13 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_ARGENT_SOLDIER_DEFEATED, instance->GetData(DATA_ARGENT_SOLDIER_DEFEATED) + 1);
+ instance->SetData(DATA_ARGENT_SOLDIER_DEFEATED, instance->GetData(DATA_ARGENT_SOLDIER_DEFEATED) + 1);
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_argent_soldierAI(creature);
+ return GetInstanceAI<npc_argent_soldierAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp
index 1922ad26060..5a0cd7cc3d2 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -293,14 +293,13 @@ public:
{
DoCast(me, SPELL_KILL_CREDIT);
- if (instance)
- instance->SetData(BOSS_BLACK_KNIGHT, DONE);
+ instance->SetData(BOSS_BLACK_KNIGHT, DONE);
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_black_knightAI(creature);
+ return GetInstanceAI<boss_black_knightAI>(creature);
}
};
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 8bff123af75..3b1b5d4fd24 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -207,9 +207,6 @@ public:
void WaypointReached(uint32 waypointId) OVERRIDE
{
- if (!instance)
- return;
-
switch (waypointId)
{
case 2:
@@ -300,7 +297,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new generic_vehicleAI_toc5AI(creature);
+ return GetInstanceAI<generic_vehicleAI_toc5AI>(creature);
}
};
@@ -426,14 +423,13 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
+ instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_warrior_toc5AI(creature);
+ return GetInstanceAI<boss_warrior_toc5AI>(creature);
}
};
@@ -507,8 +503,7 @@ public:
else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);
- if (instance)
- instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
+ instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
EnterEvadeMode();
bHome = true;
@@ -565,14 +560,13 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
+ instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_mage_toc5AI(creature);
+ return GetInstanceAI<boss_mage_toc5AI>(creature);
}
};
@@ -652,8 +646,7 @@ public:
else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);
- if (instance)
- instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
+ instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
EnterEvadeMode();
bHome = true;
@@ -712,14 +705,13 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
+ instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_shaman_toc5AI(creature);
+ return GetInstanceAI<boss_shaman_toc5AI>(creature);
}
};
@@ -798,8 +790,7 @@ public:
else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);
- if (instance)
- instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
+ instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
EnterEvadeMode();
bHome = true;
@@ -868,14 +859,13 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
+ instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_hunter_toc5AI(creature);
+ return GetInstanceAI<boss_hunter_toc5AI>(creature);
}
};
@@ -946,8 +936,7 @@ public:
else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);
- if (instance)
- instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
+ instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
EnterEvadeMode();
bHome = true;
@@ -989,14 +978,13 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
+ instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_rouge_toc5AI(creature);
+ return GetInstanceAI<boss_rouge_toc5AI>(creature);
}
};
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 2a203b49764..1f8b281b807 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 00b312aa407..ab21393fce3 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -236,11 +236,8 @@ public:
if (Vehicle* pVehicle = pBoss->GetVehicleKit())
if (Unit* unit = pVehicle->GetPassenger(0))
uiGrandChampionBoss1 = unit->GetGUID();
- if (instance)
- {
- instance->SetData64(DATA_GRAND_CHAMPION_VEHICLE_1, uiVehicle1GUID);
- instance->SetData64(DATA_GRAND_CHAMPION_1, uiGrandChampionBoss1);
- }
+ instance->SetData64(DATA_GRAND_CHAMPION_VEHICLE_1, uiVehicle1GUID);
+ instance->SetData64(DATA_GRAND_CHAMPION_1, uiGrandChampionBoss1);
pBoss->AI()->SetData(1, 0);
break;
}
@@ -251,11 +248,8 @@ public:
if (Vehicle* pVehicle = pBoss->GetVehicleKit())
if (Unit* unit = pVehicle->GetPassenger(0))
uiGrandChampionBoss2 = unit->GetGUID();
- if (instance)
- {
- instance->SetData64(DATA_GRAND_CHAMPION_VEHICLE_2, uiVehicle2GUID);
- instance->SetData64(DATA_GRAND_CHAMPION_2, uiGrandChampionBoss2);
- }
+ instance->SetData64(DATA_GRAND_CHAMPION_VEHICLE_2, uiVehicle2GUID);
+ instance->SetData64(DATA_GRAND_CHAMPION_2, uiGrandChampionBoss2);
pBoss->AI()->SetData(2, 0);
break;
}
@@ -266,11 +260,8 @@ public:
if (Vehicle* pVehicle = pBoss->GetVehicleKit())
if (Unit* unit = pVehicle->GetPassenger(0))
uiGrandChampionBoss3 = unit->GetGUID();
- if (instance)
- {
- instance->SetData64(DATA_GRAND_CHAMPION_VEHICLE_3, uiVehicle3GUID);
- instance->SetData64(DATA_GRAND_CHAMPION_3, uiGrandChampionBoss3);
- }
+ instance->SetData64(DATA_GRAND_CHAMPION_VEHICLE_3, uiVehicle3GUID);
+ instance->SetData64(DATA_GRAND_CHAMPION_3, uiGrandChampionBoss3);
pBoss->AI()->SetData(3, 0);
break;
}
@@ -359,9 +350,6 @@ public:
void StartEncounter()
{
- if (!instance)
- return;
-
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
if (instance->GetData(BOSS_BLACK_KNIGHT) == NOT_STARTED)
@@ -472,7 +460,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_announcer_toc5AI(creature);
+ return GetInstanceAI<npc_announcer_toc5AI>(creature);
}
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
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 8812b578827..2b69fcbcc08 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
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 53b11de921a..0b9b9f2543f 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -201,8 +201,7 @@ class boss_anubarak_trial : public CreatureScript
if (who->GetTypeId() == TYPEID_PLAYER)
{
Talk(SAY_KILL_PLAYER);
- if (instance)
- instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELIGIBLE, 0);
+ instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELIGIBLE, 0);
}
}
@@ -218,8 +217,7 @@ class boss_anubarak_trial : public CreatureScript
void JustReachedHome() OVERRIDE
{
- if (instance)
- instance->SetBossState(BOSS_ANUBARAK, FAIL);
+ instance->SetBossState(BOSS_ANUBARAK, FAIL);
//Summon Scarab Swarms neutral at random places
for (int i = 0; i < 10; i++)
if (Creature* temp = me->SummonCreature(NPC_SCARAB, AnubarakLoc[1].GetPositionX()+urand(0, 50)-25, AnubarakLoc[1].GetPositionY()+urand(0, 50)-25, AnubarakLoc[1].GetPositionZ()))
@@ -245,7 +243,6 @@ class boss_anubarak_trial : public CreatureScript
void JustSummoned(Creature* summoned) OVERRIDE
{
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true);
switch (summoned->GetEntry())
{
case NPC_BURROW:
@@ -255,9 +252,12 @@ class boss_anubarak_trial : public CreatureScript
summoned->SetDisplayId(summoned->GetCreatureTemplate()->Modelid2);
break;
case NPC_SPIKE:
- summoned->CombatStart(target);
summoned->SetDisplayId(summoned->GetCreatureTemplate()->Modelid1);
- Talk(EMOTE_SPIKE, target->GetGUID());
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
+ {
+ summoned->CombatStart(target);
+ Talk(EMOTE_SPIKE, target);
+ }
break;
default:
break;
@@ -423,7 +423,7 @@ class boss_anubarak_trial : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_anubarak_trialAI(creature);
+ return GetInstanceAI<boss_anubarak_trialAI>(creature);
};
};
@@ -495,7 +495,7 @@ class npc_swarm_scarab : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_swarm_scarabAI(creature);
+ return GetInstanceAI<npc_swarm_scarabAI>(creature);
};
};
@@ -583,7 +583,7 @@ class npc_nerubian_burrower : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_nerubian_burrowerAI(creature);
+ return GetInstanceAI<npc_nerubian_burrowerAI>(creature);
};
};
@@ -689,7 +689,7 @@ class npc_anubarak_spike : public CreatureScript
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
{
StartChase(target);
- Talk(EMOTE_SPIKE, who->GetGUID());
+ Talk(EMOTE_SPIKE, who);
}
}
@@ -719,7 +719,7 @@ class npc_anubarak_spike : public CreatureScript
if (Unit* target2 = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
{
StartChase(target2);
- Talk(EMOTE_SPIKE, target2->GetGUID());
+ Talk(EMOTE_SPIKE, target2);
}
_phaseSwitchTimer = 7*IN_MILLISECONDS;
return;
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 4c73d1a5f55..44a6ddb368f 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -539,7 +539,7 @@ class boss_toc_champion_controller : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_toc_champion_controllerAI(creature);
+ return GetInstanceAI<boss_toc_champion_controllerAI>(creature);
}
};
@@ -559,9 +559,8 @@ struct boss_faction_championsAI : public BossAI
void JustReachedHome() OVERRIDE
{
- if (instance)
- if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
- pChampionController->AI()->SetData(2, FAIL);
+ if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
+ pChampionController->AI()->SetData(2, FAIL);
me->DespawnOrUnsummon();
}
@@ -610,18 +609,16 @@ struct boss_faction_championsAI : public BossAI
void JustDied(Unit* /*killer*/) OVERRIDE
{
if (_aiType != AI_PET)
- if (instance)
- if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
- pChampionController->AI()->SetData(2, DONE);
+ if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
+ pChampionController->AI()->SetData(2, DONE);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
DoCast(me, SPELL_ANTI_AOE, true);
_EnterCombat();
- if (instance)
- if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
- pChampionController->AI()->SetData(2, IN_PROGRESS);
+ if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
+ pChampionController->AI()->SetData(2, IN_PROGRESS);
}
void KilledUnit(Unit* who) OVERRIDE
@@ -635,20 +632,17 @@ struct boss_faction_championsAI : public BossAI
if (Player* player = players.begin()->GetSource())
TeamInInstance = player->GetTeam();
- if (instance)
+ if (TeamInInstance == ALLIANCE)
{
- if (TeamInInstance == ALLIANCE)
- {
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_VARIAN)))
- temp->AI()->Talk(SAY_KILL_PLAYER);
- }
- else
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_GARROSH)))
- temp->AI()->Talk(SAY_KILL_PLAYER);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_VARIAN)))
+ temp->AI()->Talk(SAY_KILL_PLAYER);
+ }
+ else
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_GARROSH)))
+ temp->AI()->Talk(SAY_KILL_PLAYER);
- instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELIGIBLE, 0);
- }
+ instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELIGIBLE, 0);
}
}
@@ -839,7 +833,7 @@ class npc_toc_druid : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_druidAI(creature);
+ return GetInstanceAI<npc_toc_druidAI>(creature);
}
};
@@ -932,7 +926,7 @@ class npc_toc_shaman : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_shamanAI(creature);
+ return GetInstanceAI<npc_toc_shamanAI>(creature);
}
};
@@ -1036,7 +1030,7 @@ class npc_toc_paladin : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_paladinAI(creature);
+ return GetInstanceAI<npc_toc_paladinAI>(creature);
}
};
@@ -1121,7 +1115,7 @@ class npc_toc_priest : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_priestAI(creature);
+ return GetInstanceAI<npc_toc_priestAI>(creature);
}
};
@@ -1219,7 +1213,7 @@ class npc_toc_shadow_priest : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_shadow_priestAI(creature);
+ return GetInstanceAI<npc_toc_shadow_priestAI>(creature);
}
};
@@ -1310,7 +1304,7 @@ class npc_toc_warlock : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_warlockAI(creature);
+ return GetInstanceAI<npc_toc_warlockAI>(creature);
}
};
@@ -1404,7 +1398,7 @@ class npc_toc_mage : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_mageAI(creature);
+ return GetInstanceAI<npc_toc_mageAI>(creature);
}
};
@@ -1506,7 +1500,7 @@ class npc_toc_hunter : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_hunterAI(creature);
+ return GetInstanceAI<npc_toc_hunterAI>(creature);
}
};
@@ -1598,7 +1592,7 @@ class npc_toc_boomkin : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_boomkinAI(creature);
+ return GetInstanceAI<npc_toc_boomkinAI>(creature);
}
};
@@ -1702,7 +1696,7 @@ class npc_toc_warrior : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_warriorAI(creature);
+ return GetInstanceAI<npc_toc_warriorAI>(creature);
}
};
@@ -1798,7 +1792,7 @@ class npc_toc_dk : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_dkAI(creature);
+ return GetInstanceAI<npc_toc_dkAI>(creature);
}
};
@@ -1903,7 +1897,7 @@ class npc_toc_rogue : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_rogueAI(creature);
+ return GetInstanceAI<npc_toc_rogueAI>(creature);
}
};
@@ -2029,7 +2023,7 @@ class npc_toc_enh_shaman : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_enh_shamanAI(creature);
+ return GetInstanceAI<npc_toc_enh_shamanAI>(creature);
}
};
@@ -2135,7 +2129,7 @@ class npc_toc_retro_paladin : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_retro_paladinAI(creature);
+ return GetInstanceAI<npc_toc_retro_paladinAI>(creature);
}
};
@@ -2187,7 +2181,7 @@ class npc_toc_pet_warlock : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_pet_warlockAI(creature);
+ return GetInstanceAI<npc_toc_pet_warlockAI>(creature);
}
};
@@ -2227,7 +2221,7 @@ class npc_toc_pet_hunter : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toc_pet_hunterAI(creature);
+ return GetInstanceAI<npc_toc_pet_hunterAI>(creature);
}
};
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 4cea1ea5b06..99423a4b7ae 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -116,8 +116,7 @@ class boss_jaraxxus : public CreatureScript
void JustReachedHome() OVERRIDE
{
_JustReachedHome();
- if (instance)
- instance->SetBossState(BOSS_JARAXXUS, FAIL);
+ instance->SetBossState(BOSS_JARAXXUS, FAIL);
DoCast(me, SPELL_JARAXXUS_CHAINS);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
@@ -127,8 +126,7 @@ class boss_jaraxxus : public CreatureScript
if (who->GetTypeId() == TYPEID_PLAYER)
{
Talk(SAY_KILL_PLAYER);
- if (instance)
- instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELIGIBLE, 0);
+ instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELIGIBLE, 0);
}
}
@@ -175,7 +173,7 @@ class boss_jaraxxus : public CreatureScript
case EVENT_INCINERATE_FLESH:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_LORD_HITTIN))
{
- Talk(EMOTE_INCINERATE, target->GetGUID());
+ Talk(EMOTE_INCINERATE, target);
Talk(SAY_INCINERATE);
DoCast(target, SPELL_INCINERATE_FLESH);
}
@@ -188,7 +186,7 @@ class boss_jaraxxus : public CreatureScript
case EVENT_LEGION_FLAME:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_LORD_HITTIN))
{
- Talk(EMOTE_LEGION_FLAME, target->GetGUID());
+ Talk(EMOTE_LEGION_FLAME, target);
DoCast(target, SPELL_LEGION_FLAME);
}
events.ScheduleEvent(EVENT_LEGION_FLAME, 30*IN_MILLISECONDS);
@@ -214,7 +212,7 @@ class boss_jaraxxus : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_jaraxxusAI(creature);
+ return GetInstanceAI<boss_jaraxxusAI>(creature);
}
};
@@ -250,7 +248,7 @@ class npc_legion_flame : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_legion_flameAI(creature);
+ return GetInstanceAI<npc_legion_flameAI>(creature);
}
};
@@ -355,7 +353,7 @@ class npc_fel_infernal : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_fel_infernalAI(creature);
+ return GetInstanceAI<npc_fel_infernalAI>(creature);
}
};
@@ -488,7 +486,7 @@ class npc_mistress_of_pain : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_mistress_of_painAI(creature);
+ return GetInstanceAI<npc_mistress_of_painAI>(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 8f6b951d524..a11a74250f5 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -195,17 +195,14 @@ class boss_gormok : public CreatureScript
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(TYPE_NORTHREND_BEASTS, GORMOK_DONE);
+ instance->SetData(TYPE_NORTHREND_BEASTS, GORMOK_DONE);
}
void JustReachedHome() OVERRIDE
{
- if (instance)
- {
- instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR));
- instance->SetData(TYPE_NORTHREND_BEASTS, FAIL);
- }
+ instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR));
+ instance->SetData(TYPE_NORTHREND_BEASTS, FAIL);
+
me->DespawnOrUnsummon();
}
@@ -284,7 +281,7 @@ class boss_gormok : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_gormokAI(creature);
+ return GetInstanceAI<boss_gormokAI>(creature);
}
};
@@ -310,8 +307,6 @@ class npc_snobold_vassal : public CreatureScript
_targetGUID = 0;
_targetDied = false;
- if (_instance)
- _bossGUID = _instance->GetData64(NPC_GORMOK);
//Workaround for Snobold
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
}
@@ -450,14 +445,13 @@ class npc_snobold_vassal : public CreatureScript
private:
EventMap _events;
InstanceScript* _instance;
- uint64 _bossGUID;
uint64 _targetGUID;
bool _targetDied;
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_snobold_vassalAI(creature);
+ return GetInstanceAI<npc_snobold_vassalAI>(creature);
}
};
@@ -493,7 +487,7 @@ class npc_firebomb : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_firebombAI(creature);
+ return GetInstanceAI<npc_firebombAI>(creature);
}
};
@@ -517,20 +511,17 @@ struct boss_jormungarAI : public BossAI
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
+ if (Creature* otherWorm = Unit::GetCreature(*me, instance->GetData64(OtherWormEntry)))
{
- if (Creature* otherWorm = Unit::GetCreature(*me, instance->GetData64(OtherWormEntry)))
+ if (!otherWorm->IsAlive())
{
- if (!otherWorm->IsAlive())
- {
- instance->SetData(TYPE_NORTHREND_BEASTS, SNAKES_DONE);
+ instance->SetData(TYPE_NORTHREND_BEASTS, SNAKES_DONE);
- me->DespawnOrUnsummon();
- otherWorm->DespawnOrUnsummon();
- }
- else
- instance->SetData(TYPE_NORTHREND_BEASTS, SNAKES_SPECIAL);
+ me->DespawnOrUnsummon();
+ otherWorm->DespawnOrUnsummon();
}
+ else
+ instance->SetData(TYPE_NORTHREND_BEASTS, SNAKES_SPECIAL);
}
}
@@ -546,16 +537,14 @@ struct boss_jormungarAI : public BossAI
void KilledUnit(Unit* who) OVERRIDE
{
if (who->GetTypeId() == TYPEID_PLAYER)
- if (instance)
- instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELIGIBLE, 0);
+ instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELIGIBLE, 0);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
_EnterCombat();
me->SetInCombatWithZone();
- if (instance)
- instance->SetData(TYPE_NORTHREND_BEASTS, SNAKES_IN_PROGRESS);
+ instance->SetData(TYPE_NORTHREND_BEASTS, SNAKES_IN_PROGRESS);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -715,7 +704,7 @@ class boss_acidmaw : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_acidmawAI(creature);
+ return GetInstanceAI<boss_acidmawAI>(creature);
}
};
@@ -773,8 +762,7 @@ class boss_dreadscale : public CreatureScript
void JustReachedHome() OVERRIDE
{
- if (instance)
- instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR));
+ instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR));
boss_jormungarAI::JustReachedHome();
}
@@ -782,7 +770,7 @@ class boss_dreadscale : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_dreadscaleAI(creature);
+ return GetInstanceAI<boss_dreadscaleAI>(creature);
}
};
@@ -823,7 +811,7 @@ class npc_slime_pool : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_slime_poolAI(creature);
+ return GetInstanceAI<npc_slime_poolAI>(creature);
}
};
@@ -876,7 +864,7 @@ class boss_icehowl : public CreatureScript
events.ScheduleEvent(EVENT_MASSIVE_CRASH, 30*IN_MILLISECONDS);
_movementStarted = false;
_movementFinish = false;
- _trampleCasted = false;
+ _trampleCast = false;
_trampleTargetGUID = 0;
_trampleTargetX = 0;
_trampleTargetY = 0;
@@ -887,8 +875,7 @@ class boss_icehowl : public CreatureScript
void JustDied(Unit* /*killer*/) OVERRIDE
{
_JustDied();
- if (instance)
- instance->SetData(TYPE_NORTHREND_BEASTS, ICEHOWL_DONE);
+ instance->SetData(TYPE_NORTHREND_BEASTS, ICEHOWL_DONE);
}
void MovementInform(uint32 type, uint32 pointId) OVERRIDE
@@ -936,11 +923,8 @@ class boss_icehowl : public CreatureScript
void JustReachedHome() OVERRIDE
{
- if (instance)
- {
- instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR));
- instance->SetData(TYPE_NORTHREND_BEASTS, FAIL);
- }
+ instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR));
+ instance->SetData(TYPE_NORTHREND_BEASTS, FAIL);
me->DespawnOrUnsummon();
}
@@ -948,26 +932,24 @@ class boss_icehowl : public CreatureScript
{
if (who->GetTypeId() == TYPEID_PLAYER)
{
- if (instance)
- instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELIGIBLE, 0);
+ instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELIGIBLE, 0);
}
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
_EnterCombat();
- if (instance)
- instance->SetData(TYPE_NORTHREND_BEASTS, ICEHOWL_IN_PROGRESS);
+ instance->SetData(TYPE_NORTHREND_BEASTS, ICEHOWL_IN_PROGRESS);
}
void SpellHitTarget(Unit* target, SpellInfo const* spell) OVERRIDE
{
if (spell->Id == SPELL_TRAMPLE && target->GetTypeId() == TYPEID_PLAYER)
{
- if (!_trampleCasted)
+ if (!_trampleCast)
{
DoCast(me, SPELL_FROTHING_RAGE, true);
- _trampleCasted = true;
+ _trampleCast = true;
}
}
}
@@ -1028,7 +1010,7 @@ class boss_icehowl : public CreatureScript
me->AttackStop();
_trampleTargetGUID = target->GetGUID();
me->SetTarget(_trampleTargetGUID);
- _trampleCasted = false;
+ _trampleCast = false;
SetCombatMovement(false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
me->GetMotionMaster()->Clear();
@@ -1050,7 +1032,7 @@ class boss_icehowl : public CreatureScript
{
me->StopMoving();
me->AttackStop();
- _trampleCasted = false;
+ _trampleCast = false;
_movementStarted = true;
_trampleTargetX = target->GetPositionX();
_trampleTargetY = target->GetPositionY();
@@ -1071,7 +1053,8 @@ class boss_icehowl : public CreatureScript
case 4:
me->StopMoving();
me->AttackStop();
- Talk(EMOTE_TRAMPLE_START, _trampleTargetGUID);
+ if (Player* target = ObjectAccessor::GetPlayer(*me, _trampleTargetGUID))
+ Talk(EMOTE_TRAMPLE_START, target);
me->GetMotionMaster()->MoveCharge(_trampleTargetX, _trampleTargetY, _trampleTargetZ, 42, 1);
me->SetTarget(0);
_stage = 5;
@@ -1102,7 +1085,7 @@ class boss_icehowl : public CreatureScript
}
break;
case 6:
- if (!_trampleCasted)
+ if (!_trampleCast)
{
DoCast(me, SPELL_STAGGERED_DAZE);
Talk(EMOTE_TRAMPLE_CRASH);
@@ -1133,13 +1116,13 @@ class boss_icehowl : public CreatureScript
uint64 _trampleTargetGUID;
bool _movementStarted;
bool _movementFinish;
- bool _trampleCasted;
+ bool _trampleCast;
uint8 _stage;
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_icehowlAI(creature);
+ return GetInstanceAI<boss_icehowlAI>(creature);
}
};
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 0674696a033..0d7dc9062ad 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -165,8 +165,7 @@ struct boss_twin_baseAI : public BossAI
void JustReachedHome() OVERRIDE
{
- if (instance)
- instance->SetBossState(BOSS_VALKIRIES, FAIL);
+ instance->SetBossState(BOSS_VALKIRIES, FAIL);
summons.DespawnAll();
me->DespawnOrUnsummon();
@@ -193,8 +192,7 @@ struct boss_twin_baseAI : public BossAI
if (who->GetTypeId() == TYPEID_PLAYER)
{
Talk(SAY_KILL_PLAYER);
- if (instance)
- instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELIGIBLE, 0);
+ instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELIGIBLE, 0);
}
}
@@ -227,21 +225,18 @@ struct boss_twin_baseAI : public BossAI
void JustDied(Unit* /*killer*/) OVERRIDE
{
Talk(SAY_DEATH);
- if (instance)
+ if (Creature* pSister = GetSister())
{
- if (Creature* pSister = GetSister())
+ if (!pSister->IsAlive())
{
- if (!pSister->IsAlive())
- {
- me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- pSister->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- _JustDied();
- }
- else
- {
- me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- instance->SetBossState(BOSS_VALKIRIES, SPECIAL);
- }
+ me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ pSister->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ _JustDied();
+ }
+ else
+ {
+ me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ instance->SetBossState(BOSS_VALKIRIES, SPECIAL);
}
}
summons.DespawnAll();
@@ -256,15 +251,12 @@ struct boss_twin_baseAI : public BossAI
void EnterCombat(Unit* /*who*/) OVERRIDE
{
me->SetInCombatWithZone();
- if (instance)
+ if (Creature* pSister = GetSister())
{
- if (Creature* pSister = GetSister())
- {
- me->AddAura(MyEmphatySpellId, pSister);
- pSister->SetInCombatWithZone();
- }
- instance->SetBossState(BOSS_VALKIRIES, IN_PROGRESS);
+ me->AddAura(MyEmphatySpellId, pSister);
+ pSister->SetInCombatWithZone();
}
+ instance->SetBossState(BOSS_VALKIRIES, IN_PROGRESS);
Talk(SAY_AGGRO);
DoCast(me, SurgeSpellId);
@@ -289,7 +281,6 @@ struct boss_twin_baseAI : public BossAI
{
SetEquipmentSlots(false, Weapon, mode ? Weapon : int32(EQUIP_UNEQUIP), EQUIP_UNEQUIP);
me->SetCanDualWield(mode);
- me->UpdateDamagePhysical(mode ? OFF_ATTACK : BASE_ATTACK);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -420,15 +411,13 @@ class boss_fjola : public CreatureScript
TouchSpellId = SPELL_LIGHT_TOUCH;
SpikeSpellId = SPELL_LIGHT_TWIN_SPIKE;
- if (instance)
- instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT);
+ instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT);
boss_twin_baseAI::Reset();
}
void EnterCombat(Unit* who) OVERRIDE
{
- if (instance)
- instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT);
+ instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT);
me->SummonCreature(NPC_BULLET_CONTROLLER, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 0.0f, TEMPSUMMON_MANUAL_DESPAWN);
boss_twin_baseAI::EnterCombat(who);
@@ -442,8 +431,7 @@ class boss_fjola : public CreatureScript
void JustReachedHome() OVERRIDE
{
- if (instance)
- instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR));
+ instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR));
boss_twin_baseAI::JustReachedHome();
}
@@ -451,7 +439,7 @@ class boss_fjola : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_fjolaAI(creature);
+ return GetInstanceAI<boss_fjolaAI>(creature);
}
};
@@ -486,7 +474,7 @@ class boss_eydis : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_eydisAI(creature);
+ return GetInstanceAI<boss_eydisAI>(creature);
}
};
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 a72d3917004..c0e49fa43fb 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
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 ff7092590e7..cb0ec2acc38 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -357,7 +357,7 @@ class boss_lich_king_toc : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_lich_king_tocAI(creature);
+ return GetInstanceAI<boss_lich_king_tocAI>(creature);
}
};
@@ -375,7 +375,7 @@ class npc_fizzlebang_toc : public CreatureScript
void JustDied(Unit* killer) OVERRIDE
{
- Talk(SAY_STAGE_1_06, killer->GetGUID());
+ Talk(SAY_STAGE_1_06, killer);
_instance->SetData(TYPE_EVENT, 1180);
if (Creature* temp = Unit::GetCreature(*me, _instance->GetData64(NPC_JARAXXUS)))
{
@@ -531,7 +531,7 @@ class npc_fizzlebang_toc : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_fizzlebang_tocAI(creature);
+ return GetInstanceAI<npc_fizzlebang_tocAI>(creature);
}
};
@@ -819,7 +819,7 @@ class npc_tirion_toc : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_tirion_tocAI(creature);
+ return GetInstanceAI<npc_tirion_tocAI>(creature);
}
};
@@ -903,7 +903,7 @@ class npc_garrosh_toc : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_garrosh_tocAI(creature);
+ return GetInstanceAI<npc_garrosh_tocAI>(creature);
}
};
@@ -987,7 +987,7 @@ class npc_varian_toc : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_varian_tocAI(creature);
+ return GetInstanceAI<npc_varian_tocAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp
index f8f0752184e..7b55452105b 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -27,7 +27,7 @@ enum Spells
{
SPELL_BELLOWING_ROAR = 22686, // fears the group, can be resisted/dispelled
SPELL_GRIEVOUS_BITE = 48920,
- SPELL_MANGLING_SLASH = 48873, // casted on the current tank, adds debuf
+ SPELL_MANGLING_SLASH = 48873, // cast on the current tank, adds debuf
SPELL_FEARSOME_ROAR = 48849,
SPELL_PIERCING_SLASH = 48878, // debuff --> Armor reduced by 75%
SPELL_RAPTOR_CALL = 59416, // dummy
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
index 71386167d5d..09db3f89c26 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp
index efca060b67c..8022c19180c 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -32,7 +32,7 @@ enum Spells
SPELL_CURSE_OF_LIFE = 49527,
SPELL_RAIN_OF_FIRE = 49518,
SPELL_SHADOW_VOLLEY = 49528,
- SPELL_DECAY_FLESH = 49356, // casted at end of phase 1, starts phase 2
+ SPELL_DECAY_FLESH = 49356, // cast at end of phase 1, starts phase 2
// Flesh Spells (phase 2)
SPELL_GIFT_OF_THARON_JA = 52509,
SPELL_CLEAR_GIFT_OF_THARON_JA = 53242,
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
index d0cec8a4f43..4fc8f532c47 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h b/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h
index c2d957b7c0a..b5e7be25d73 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h
+++ b/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 d9e34ee2af3..112afe732b6 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -170,7 +170,7 @@ class instance_drak_tharon_keep : public InstanceMapScript
return saveStream.str();
}
- void Load(char const* str) OVERRIDE OVERRIDE
+ void Load(char const* str) OVERRIDE
{
if (!str)
{
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
index 2dedc986b0c..2e0466d19d0 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -188,7 +188,7 @@ class boss_bronjahm : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_bronjahmAI(creature);
+ return GetInstanceAI<boss_bronjahmAI>(creature);
}
};
@@ -209,19 +209,16 @@ class npc_corrupted_soul_fragment : public CreatureScript
if (type != CHASE_MOTION_TYPE)
return;
- if (instance)
+ if (TempSummon* summ = me->ToTempSummon())
{
- if (TempSummon* summ = me->ToTempSummon())
- {
- uint64 BronjahmGUID = instance->GetData64(DATA_BRONJAHM);
- if (GUID_LOPART(BronjahmGUID) != id)
- return;
+ uint64 BronjahmGUID = instance->GetData64(DATA_BRONJAHM);
+ if (GUID_LOPART(BronjahmGUID) != id)
+ return;
- if (Creature* bronjahm = ObjectAccessor::GetCreature(*me, BronjahmGUID))
- me->CastSpell(bronjahm, SPELL_CONSUME_SOUL, true);
+ if (Creature* bronjahm = ObjectAccessor::GetCreature(*me, BronjahmGUID))
+ me->CastSpell(bronjahm, SPELL_CONSUME_SOUL, true);
- summ->UnSummon();
- }
+ summ->UnSummon();
}
}
@@ -231,7 +228,7 @@ class npc_corrupted_soul_fragment : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_corrupted_soul_fragmentAI(creature);
+ return GetInstanceAI<npc_corrupted_soul_fragmentAI>(creature);
}
};
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 7d923e7686f..8ef6abf2f47 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -345,7 +345,7 @@ class boss_devourer_of_souls : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_devourer_of_soulsAI(creature);
+ return GetInstanceAI<boss_devourer_of_soulsAI>(creature);
}
};
@@ -480,9 +480,7 @@ class spell_devourer_of_souls_mirrored_soul_target_selector : public SpellScript
class achievement_three_faced : public AchievementCriteriaScript
{
public:
- achievement_three_faced() : AchievementCriteriaScript("achievement_three_faced")
- {
- }
+ achievement_three_faced() : AchievementCriteriaScript("achievement_three_faced") { }
bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE
{
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp
index cfa149c134f..3e901bfd0d4 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -113,9 +113,6 @@ public:
{
if (phase == PHASE_INTRO)
{
- if (!instance)
- return;
-
events.Update(diff);
switch (events.ExecuteEvent())
{
@@ -193,7 +190,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_sylvanas_fosAI(creature);
+ return GetInstanceAI<npc_sylvanas_fosAI>(creature);
}
};
@@ -239,9 +236,6 @@ public:
{
if (phase == PHASE_INTRO)
{
- if (!instance)
- return;
-
events.Update(diff);
switch (events.ExecuteEvent())
{
@@ -330,7 +324,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_jaina_fosAI(creature);
+ return GetInstanceAI<npc_jaina_fosAI>(creature);
}
};
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 d404f9daf9c..14220e26cdd 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 b1339b13119..cb03842cf3f 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp
index e2d285f7306..2ba47d354f9 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -52,7 +52,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_falricAI(creature);
+ return GetInstanceAI<boss_falricAI>(creature);
}
struct boss_falricAI : public boss_horAI
@@ -67,15 +67,13 @@ public:
uiHopelessnessCount = 0;
- if (instance)
- instance->SetBossState(DATA_FALRIC_EVENT, NOT_STARTED);
+ instance->SetBossState(DATA_FALRIC_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetBossState(DATA_FALRIC_EVENT, IN_PROGRESS);
+ instance->SetBossState(DATA_FALRIC_EVENT, IN_PROGRESS);
events.ScheduleEvent(EVENT_QUIVERING_STRIKE, 23000);
events.ScheduleEvent(EVENT_IMPENDING_DESPAIR, 9000);
@@ -86,8 +84,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetBossState(DATA_FALRIC_EVENT, DONE);
+ instance->SetBossState(DATA_FALRIC_EVENT, DONE);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp
index a87b7b6d93d..c6f692e7ff5 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -51,7 +51,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_marwynAI(creature);
+ return GetInstanceAI<boss_marwynAI>(creature);
}
struct boss_marwynAI : public boss_horAI
@@ -62,15 +62,13 @@ public:
{
boss_horAI::Reset();
- if (instance)
- instance->SetBossState(DATA_MARWYN_EVENT, NOT_STARTED);
+ instance->SetBossState(DATA_MARWYN_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetBossState(DATA_MARWYN_EVENT, IN_PROGRESS);
+ instance->SetBossState(DATA_MARWYN_EVENT, IN_PROGRESS);
events.ScheduleEvent(EVENT_OBLITERATE, 30000); /// @todo Check timer
events.ScheduleEvent(EVENT_WELL_OF_CORRUPTION, 13000);
@@ -82,8 +80,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetBossState(DATA_MARWYN_EVENT, DONE);
+ instance->SetBossState(DATA_MARWYN_EVENT, DONE);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
index 06355e25207..c9247ce17f3 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -1185,6 +1185,7 @@ struct npc_gauntlet_trash : public ScriptedAI
void Reset() OVERRIDE
{
+ InternalWaveId = 0;
me->CastSpell(me, SPELL_WELL_OF_SOULS, true);
_events.Reset();
}
@@ -1282,7 +1283,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ghostly_priestAI(creature);
+ return GetInstanceAI<npc_ghostly_priestAI>(creature);
}
};
@@ -1354,7 +1355,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_phantom_mageAI(creature);
+ return GetInstanceAI<npc_phantom_mageAI>(creature);
}
};
@@ -1376,7 +1377,7 @@ public:
void EnterEvadeMode() OVERRIDE
{
- if (!me->GetOwner()->HasAura(AURA_HALLUCINATION))
+ if (me->GetOwner() && !me->GetOwner()->HasAura(AURA_HALLUCINATION))
npc_phantom_mage::npc_phantom_mageAI::EnterEvadeMode();
}
@@ -1446,7 +1447,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_shadowy_mercenaryAI(creature);
+ return GetInstanceAI<npc_shadowy_mercenaryAI>(creature);
}
};
@@ -1498,7 +1499,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_spectral_footmanAI(creature);
+ return GetInstanceAI<npc_spectral_footmanAI>(creature);
}
};
@@ -1557,7 +1558,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_tortured_riflemanAI(creature);
+ return GetInstanceAI<npc_tortured_riflemanAI>(creature);
}
};
@@ -1673,7 +1674,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_frostworn_generalAI(creature);
+ return GetInstanceAI<npc_frostworn_generalAI>(creature);
}
};
@@ -1900,7 +1901,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_raging_ghoulAI(creature);
+ return GetInstanceAI<npc_raging_ghoulAI>(creature);
}
};
@@ -2020,7 +2021,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_risen_witch_doctorAI(creature);
+ return GetInstanceAI<npc_risen_witch_doctorAI>(creature);
}
};
@@ -2110,7 +2111,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_lumbering_abominationAI(creature);
+ return GetInstanceAI<npc_lumbering_abominationAI>(creature);
}
};
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 9c40cb70141..ff3192b89d5 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 955f4fb1568..f78be036900 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 4a9a41f6f8e..fe2b818b325 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -111,12 +111,13 @@ class boss_garfrost : public CreatureScript
{
_JustDied();
Talk(SAY_DEATH);
+ me->RemoveAllGameObjects();
if (Creature* tyrannus = me->GetCreature(*me, instance->GetData64(DATA_TYRANNUS)))
tyrannus->AI()->Talk(SAY_TYRANNUS_DEATH);
}
- void DamageTaken(Unit* /*attacker*/, uint32& /*uiDamage*/) OVERRIDE
+ void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) OVERRIDE
{
if (events.IsInPhase(PHASE_ONE) && !HealthAbovePct(66))
{
@@ -189,7 +190,7 @@ class boss_garfrost : public CreatureScript
case EVENT_THROW_SARONITE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
{
- Talk(SAY_THROW_SARONITE, target->GetGUID());
+ Talk(SAY_THROW_SARONITE, target);
DoCast(target, SPELL_THROW_SARONITE);
}
events.ScheduleEvent(EVENT_THROW_SARONITE, urand(12500, 20000));
@@ -201,7 +202,7 @@ class boss_garfrost : public CreatureScript
case EVENT_DEEP_FREEZE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
{
- Talk(SAY_CAST_DEEP_FREEZE, target->GetGUID());
+ Talk(SAY_CAST_DEEP_FREEZE, target);
DoCast(target, SPELL_DEEP_FREEZE);
}
events.ScheduleEvent(EVENT_DEEP_FREEZE, 35000, 0, PHASE_THREE);
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
index 3b3f65c7704..7720d4a4ca0 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -622,7 +622,7 @@ class spell_krick_pursuit : public SpellScriptLoader
{
if (Unit* target = ick->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true))
{
- ick->AI()->Talk(SAY_ICK_CHASE_1, target->GetGUID());
+ ick->AI()->Talk(SAY_ICK_CHASE_1, target);
ick->AddAura(GetSpellInfo()->Id, target);
CAST_AI(boss_ick::boss_ickAI, ick->AI())->SetTempThreat(ick->getThreatManager().getThreat(target));
ick->AddThreat(target, float(GetEffectValue()));
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 48cc6f89a13..833c3765145 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -265,7 +265,7 @@ class boss_tyrannus : public CreatureScript
Talk(SAY_MARK_RIMEFANG_1);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
{
- Talk(SAY_MARK_RIMEFANG_2, target->GetGUID());
+ Talk(SAY_MARK_RIMEFANG_2, target);
DoCast(target, SPELL_MARK_OF_RIMEFANG);
}
events.ScheduleEvent(EVENT_MARK_OF_RIMEFANG, urand(24000, 26000));
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 d61fc69a0ae..364246e05f1 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 82dfcb716b6..bce9e067ae1 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 e7a3b069ce3..2a2f6a25741 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp
index 93030492caf..5a16271d378 100644
--- a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp
+++ b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -248,7 +248,7 @@ class boss_drakkari_colossus : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_drakkari_colossusAI(creature);
+ return GetInstanceAI<boss_drakkari_colossusAI>(creature);
}
};
@@ -278,11 +278,8 @@ class boss_drakkari_elemental : public CreatureScript
if (killer == me)
return;
- if (instance)
- {
- if (Creature* colossus = Unit::GetCreature(*me, instance->GetData64(DATA_DRAKKARI_COLOSSUS)))
- killer->Kill(colossus);
- }
+ if (Creature* colossus = Unit::GetCreature(*me, instance->GetData64(DATA_DRAKKARI_COLOSSUS)))
+ killer->Kill(colossus);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -317,12 +314,9 @@ class boss_drakkari_elemental : public CreatureScript
{
case ACTION_RETURN_TO_COLOSSUS:
DoCast(SPELL_SURGE_VISUAL);
- if (instance)
- {
- if (Creature* colossus = Unit::GetCreature(*me, instance->GetData64(DATA_DRAKKARI_COLOSSUS)))
- // what if the elemental is more than 80 yards from drakkari colossus ?
- DoCast(colossus, SPELL_MERGE, true);
- }
+ if (Creature* colossus = Unit::GetCreature(*me, instance->GetData64(DATA_DRAKKARI_COLOSSUS)))
+ // what if the elemental is more than 80 yards from drakkari colossus ?
+ DoCast(colossus, SPELL_MERGE, true);
break;
}
}
@@ -381,7 +375,7 @@ class boss_drakkari_elemental : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_drakkari_elementalAI(creature);
+ return GetInstanceAI<boss_drakkari_elementalAI>(creature);
}
};
@@ -392,7 +386,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_living_mojoAI(creature);
+ return GetInstanceAI<npc_living_mojoAI>(creature);
}
struct npc_living_mojoAI : public ScriptedAI
diff --git a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp
index c11db7146d1..e8791c6e97e 100644
--- a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp
+++ b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -37,7 +37,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_eckAI(creature);
+ return GetInstanceAI<boss_eckAI>(creature);
}
struct boss_eckAI : public ScriptedAI
@@ -65,14 +65,12 @@ public:
bBerserk = false;
- if (instance)
- instance->SetData(DATA_ECK_THE_FEROCIOUS_EVENT, NOT_STARTED);
+ instance->SetData(DATA_ECK_THE_FEROCIOUS_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_ECK_THE_FEROCIOUS_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_ECK_THE_FEROCIOUS_EVENT, IN_PROGRESS);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -127,8 +125,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_ECK_THE_FEROCIOUS_EVENT, DONE);
+ instance->SetData(DATA_ECK_THE_FEROCIOUS_EVENT, DONE);
}
};
@@ -141,7 +138,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ruins_dwellerAI(creature);
+ return GetInstanceAI<npc_ruins_dwellerAI>(creature);
}
struct npc_ruins_dwellerAI : public ScriptedAI
@@ -155,12 +152,9 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- {
- instance->SetData64(DATA_RUIN_DWELLER_DIED, me->GetGUID());
- if (instance->GetData(DATA_ALIVE_RUIN_DWELLERS) == 0)
- me->SummonCreature(CREATURE_ECK, EckSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300*IN_MILLISECONDS);
- }
+ instance->SetData64(DATA_RUIN_DWELLER_DIED, me->GetGUID());
+ if (instance->GetData(DATA_ALIVE_RUIN_DWELLERS) == 0)
+ me->SummonCreature(CREATURE_ECK, EckSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300*IN_MILLISECONDS);
}
};
diff --git a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp
index 7a5520ab145..4cf9eea8734 100644
--- a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp
+++ b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -70,7 +70,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_gal_darahAI(creature);
+ return GetInstanceAI<boss_gal_darahAI>(creature);
}
struct boss_gal_darahAI : public ScriptedAI
@@ -118,16 +118,14 @@ public:
me->SetDisplayId(DISPLAY_TROLL);
- if (instance)
- instance->SetData(DATA_GAL_DARAH_EVENT, NOT_STARTED);
+ instance->SetData(DATA_GAL_DARAH_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_GAL_DARAH_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_GAL_DARAH_EVENT, IN_PROGRESS);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -269,8 +267,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_GAL_DARAH_EVENT, DONE);
+ instance->SetData(DATA_GAL_DARAH_EVENT, DONE);
}
void KilledUnit(Unit* victim) OVERRIDE
diff --git a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp
index 0ccaea316ef..25580efb9e0 100644
--- a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp
+++ b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -54,7 +54,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_moorabiAI(creature);
+ return GetInstanceAI<boss_moorabiAI>(creature);
}
struct boss_moorabiAI : public ScriptedAI
@@ -81,8 +81,7 @@ public:
uiTransformationTImer = 12*IN_MILLISECONDS;
bPhase = false;
- if (instance)
- instance->SetData(DATA_MOORABI_EVENT, NOT_STARTED);
+ instance->SetData(DATA_MOORABI_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -90,8 +89,7 @@ public:
Talk(SAY_AGGRO);
DoCast(me, SPELL_MOJO_FRENZY, true);
- if (instance)
- instance->SetData(DATA_MOORABI_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_MOORABI_EVENT, IN_PROGRESS);
}
void UpdateAI(uint32 uiDiff) OVERRIDE
@@ -157,8 +155,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_MOORABI_EVENT, DONE);
+ instance->SetData(DATA_MOORABI_EVENT, DONE);
}
void KilledUnit(Unit* victim) OVERRIDE
diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp
index 441149c6dd8..dd1d35e639e 100644
--- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp
+++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -76,7 +76,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_slad_ranAI(creature);
+ return GetInstanceAI<boss_slad_ranAI>(creature);
}
struct boss_slad_ranAI : public ScriptedAI
@@ -109,16 +109,14 @@ public:
lSummons.DespawnAll();
- if (instance)
- instance->SetData(DATA_SLAD_RAN_EVENT, NOT_STARTED);
+ instance->SetData(DATA_SLAD_RAN_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_SLAD_RAN_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_SLAD_RAN_EVENT, IN_PROGRESS);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -180,13 +178,13 @@ public:
Talk(SAY_DEATH);
lSummons.DespawnAll();
- if (instance)
- instance->SetData(DATA_SLAD_RAN_EVENT, DONE);
+ instance->SetData(DATA_SLAD_RAN_EVENT, DONE);
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_SLAY);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_SLAY);
}
void JustSummoned(Creature* summoned) OVERRIDE
diff --git a/src/server/scripts/Northrend/Gundrak/gundrak.h b/src/server/scripts/Northrend/Gundrak/gundrak.h
index f47b71cd48e..4cdbec3c157 100644
--- a/src/server/scripts/Northrend/Gundrak/gundrak.h
+++ b/src/server/scripts/Northrend/Gundrak/gundrak.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp
index 780ab6358a6..3ac3c32916e 100644
--- a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp
+++ b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 0c859236965..30c11ec556d 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -666,7 +666,7 @@ class boss_prince_taldaram_icc : public CreatureScript
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true); // too bad for you raiders, its going to boom
if (summon->GetEntry() == NPC_BALL_OF_INFERNO_FLAME && target)
- Talk(EMOTE_TALDARAM_FLAME, target->GetGUID());
+ Talk(EMOTE_TALDARAM_FLAME, target);
if (target)
summon->AI()->SetGUID(target->GetGUID());
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 1e5919536f3..3d4ee279685 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -412,7 +412,7 @@ class boss_blood_queen_lana_thel : public CreatureScript
case EVENT_SWARMING_SHADOWS:
if (Player* target = SelectRandomTarget(false))
{
- Talk(EMOTE_SWARMING_SHADOWS, target->GetGUID());
+ Talk(EMOTE_SWARMING_SHADOWS, target);
Talk(SAY_SWARMING_SHADOWS);
DoCast(target, SPELL_SWARMING_SHADOWS);
}
@@ -601,7 +601,7 @@ class spell_blood_queen_frenzied_bloodthirst : public SpellScriptLoader
{
if (InstanceScript* instance = GetTarget()->GetInstanceScript())
if (Creature* bloodQueen = ObjectAccessor::GetCreature(*GetTarget(), instance->GetData64(DATA_BLOOD_QUEEN_LANA_THEL)))
- bloodQueen->AI()->Talk(EMOTE_BLOODTHIRST, GetTarget()->GetGUID());
+ bloodQueen->AI()->Talk(EMOTE_BLOODTHIRST, GetTarget());
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
index 0f46888fbe7..7be766c0a0e 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp
index 68df37f0fdd..884baaf39c7 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
index 027c8823af8..f05f2c20b12 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
index 42bb8acbf07..162382e91b0 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
index cdcd8ed796a..ac4d18adb8b 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -739,7 +739,7 @@ class npc_putricide_oozeAI : public ScriptedAI
if (!UpdateVictim() && !_newTargetSelectTimer)
return;
- if (!_newTargetSelectTimer && !me->IsNonMeleeSpellCasted(false, false, true, false, true))
+ if (!_newTargetSelectTimer && !me->IsNonMeleeSpellCast(false, false, true, false, true))
_newTargetSelectTimer = 1000;
DoMeleeAttackIfReady();
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
index eddc67b5f5e..e3c21c6b88e 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -538,7 +538,7 @@ class spell_rotface_mutated_infection : public SpellScriptLoader
{
if (Creature* caster = GetCaster()->ToCreature())
if (Unit* target = GetHitUnit())
- caster->AI()->Talk(EMOTE_MUTATED_INFECTION, target->GetGUID());
+ caster->AI()->Talk(EMOTE_MUTATED_INFECTION, target);
}
void Register() OVERRIDE
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
index 1b03022c9bd..b1141e31d39 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -484,7 +484,7 @@ class boss_sindragosa : public CreatureScript
case EVENT_ICE_TOMB:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, FrostBeaconSelector(me)))
{
- Talk(EMOTE_WARN_FROZEN_ORB, target->GetGUID());
+ Talk(EMOTE_WARN_FROZEN_ORB, target);
DoCast(target, SPELL_ICE_TOMB_DUMMY, true);
}
events.ScheduleEvent(EVENT_ICE_TOMB, urand(16000, 23000));
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 d8a95d5c1fb..30d520ce7bf 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -934,7 +934,7 @@ class boss_the_lich_king : public CreatureScript
case EVENT_NECROTIC_PLAGUE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, NecroticPlagueTargetCheck(me, NECROTIC_PLAGUE_LK, NECROTIC_PLAGUE_PLR)))
{
- Talk(EMOTE_NECROTIC_PLAGUE_WARNING, target->GetGUID());
+ Talk(EMOTE_NECROTIC_PLAGUE_WARNING, target);
DoCast(target, SPELL_NECROTIC_PLAGUE);
}
events.ScheduleEvent(EVENT_NECROTIC_PLAGUE, urand(30000, 33000), 0, PHASE_ONE);
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
index bbd700b7edd..e56bde39ae7 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -666,7 +666,7 @@ class npc_the_lich_king_controller : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_the_lich_king_controllerAI(creature);
+ return GetInstanceAI<npc_the_lich_king_controllerAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
index 9116222a4e0..f3b62cd7b24 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -628,7 +628,7 @@ class npc_rotting_frost_giant : public CreatureScript
case EVENT_DEATH_PLAGUE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
{
- Talk(EMOTE_DEATH_PLAGUE_WARNING, target->GetGUID());
+ Talk(EMOTE_DEATH_PLAGUE_WARNING, target);
DoCast(target, SPELL_DEATH_PLAGUE);
}
_events.ScheduleEvent(EVENT_DEATH_PLAGUE, 15000);
@@ -841,7 +841,7 @@ class boss_sister_svalna : public CreatureScript
if (spell->Id == SPELL_HURL_SPEAR && me->HasAura(SPELL_AETHER_SHIELD))
{
me->RemoveAurasDueToSpell(SPELL_AETHER_SHIELD);
- Talk(EMOTE_SVALNA_BROKEN_SHIELD, caster->GetGUID());
+ Talk(EMOTE_SVALNA_BROKEN_SHIELD, caster);
}
}
@@ -867,7 +867,7 @@ class boss_sister_svalna : public CreatureScript
case SPELL_IMPALING_SPEAR:
if (TempSummon* summon = target->SummonCreature(NPC_IMPALING_SPEAR, *target))
{
- Talk(EMOTE_SVALNA_IMPALE, target->GetGUID());
+ Talk(EMOTE_SVALNA_IMPALE, target);
summon->CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, 1, target, false);
summon->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_UNK1 | UNIT_FLAG2_ALLOW_ENEMY_INTERACT);
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
index 6090d4b8368..8e529ba0ee9 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp
index 72700a83a55..ad06bc1c485 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
index fd024dd4401..edd80377d68 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
index b873b3ee15c..be6531df66a 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -59,7 +59,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_anubrekhanAI(creature);
+ return GetInstanceAI<boss_anubrekhanAI>(creature);
}
struct boss_anubrekhanAI : public BossAI
@@ -105,8 +105,7 @@ public:
_JustDied();
// start achievement timer (kill Maexna within 20 min)
- if (instance)
- instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
+ instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp
index b723c2f4139..a61331bee3e 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -216,7 +216,7 @@ class npc_faerlina_add : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_faerlina_addAI(creature);
+ return GetInstanceAI<npc_faerlina_addAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
index 9b336a77e26..544077db8e8 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -89,7 +89,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_four_horsemenAI(creature);
+ return GetInstanceAI<boss_four_horsemenAI>(creature);
}
struct boss_four_horsemenAI : public BossAI
@@ -121,8 +121,7 @@ public:
if (!encounterActionReset)
DoEncounteraction(NULL, false, true, false);
- if (instance)
- instance->SetData(DATA_HORSEMEN0 + id, NOT_STARTED);
+ instance->SetData(DATA_HORSEMEN0 + id, NOT_STARTED);
me->SetReactState(REACT_AGGRESSIVE);
uiEventStarterGUID = 0;
@@ -139,9 +138,6 @@ public:
bool DoEncounteraction(Unit* who, bool attack, bool reset, bool checkAllDead)
{
- if (!instance)
- return false;
-
Creature* Thane = Unit::GetCreature(*me, instance->GetData64(DATA_THANE));
Creature* Lady = Unit::GetCreature(*me, instance->GetData64(DATA_LADY));
Creature* Baron = Unit::GetCreature(*me, instance->GetData64(DATA_BARON));
@@ -301,10 +297,9 @@ public:
events.Reset();
summons.DespawnAll();
- if (instance)
- instance->SetData(DATA_HORSEMEN0 + id, DONE);
+ instance->SetData(DATA_HORSEMEN0 + id, DONE);
- if (instance && DoEncounteraction(NULL, false, false, true))
+ if (DoEncounteraction(NULL, false, false, true))
{
instance->SetBossState(BOSS_HORSEMEN, DONE);
instance->SaveToDB();
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
index 8980cd063c0..d33d218fab9 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -76,7 +76,7 @@ public:
{
SetGazeOn(who);
/// @todo use a script text
- me->MonsterTextEmote(EMOTE_NEARBY, 0, true);
+ me->MonsterTextEmote(EMOTE_NEARBY, NULL, true);
}
else
BossAI::MoveInLineOfSight(who);
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
index 68387279c1d..20f7ec25775 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -181,8 +181,7 @@ class boss_gothik : public CreatureScript
DeadTriggerGUID.clear();
me->SetReactState(REACT_PASSIVE);
- if (instance)
- instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
+ instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
_Reset();
mergedSides = false;
phaseTwo = false;
@@ -210,8 +209,7 @@ class boss_gothik : public CreatureScript
events.ScheduleEvent(EVENT_SUMMON, 30000);
DoTeleportTo(PosPlatform);
Talk(SAY_SPEECH);
- if (instance)
- instance->SetData(DATA_GOTHIK_GATE, GO_STATE_READY);
+ instance->SetData(DATA_GOTHIK_GATE, GO_STATE_READY);
}
void JustSummoned(Creature* summon) OVERRIDE
@@ -248,8 +246,7 @@ class boss_gothik : public CreatureScript
DeadTriggerGUID.clear();
_JustDied();
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
+ instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
}
void DoGothikSummon(uint32 entry)
@@ -403,8 +400,7 @@ class boss_gothik : public CreatureScript
if (!thirtyPercentReached && HealthBelowPct(30) && phaseTwo)
{
thirtyPercentReached = true;
- if (instance)
- instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
+ instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
}
if (me->HasUnitState(UNIT_STATE_CASTING))
@@ -429,8 +425,7 @@ class boss_gothik : public CreatureScript
{
if (!CheckGroupSplitted())
{
- if (instance)
- instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
+ instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
DummyEntryCheckPredicate pred;
summons.DoAction(0, pred); //! Magic numbers fail
summons.DoZoneInCombat();
@@ -500,7 +495,7 @@ class boss_gothik : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_gothikAI(creature);
+ return GetInstanceAI<boss_gothikAI>(creature);
}
};
@@ -514,6 +509,7 @@ class npc_gothik_minion : public CreatureScript
npc_gothik_minionAI(Creature* creature) : CombatAI(creature)
{
liveSide = IN_LIVE_SIDE(me);
+ gateClose = false;
}
bool liveSide;
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp
index 8371a5ad9a0..6769e3429fa 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -17,18 +17,19 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "naxxramas.h"
-#include "SpellInfo.h"
enum Spells
{
SPELL_BOMBARD_SLIME = 28280,
- SPELL_POISON_CLOUD = 28240,
- SPELL_MUTATING_INJECTION = 28169,
SPELL_SLIME_SPRAY = 28157,
- H_SPELL_SLIME_SPRAY = 54364,
- SPELL_BERSERK = 26662,
- SPELL_POISON_CLOUD_ADD = 59116
+ SPELL_MUTATING_INJECTION = 28169,
+ SPELL_MUTATING_EXPLOSION = 28206,
+ SPELL_POISON_CLOUD = 28240,
+ SPELL_POISON_CLOUD_PASSIVE = 28158,
+ SPELL_BERSERK = 26662
};
enum Events
@@ -46,115 +47,183 @@ enum CreatureId
class boss_grobbulus : public CreatureScript
{
-public:
- boss_grobbulus() : CreatureScript("boss_grobbulus") { }
+ public:
+ boss_grobbulus() : CreatureScript("boss_grobbulus") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new boss_grobbulusAI(creature);
- }
-
- struct boss_grobbulusAI : public BossAI
- {
- boss_grobbulusAI(Creature* creature) : BossAI(creature, BOSS_GROBBULUS)
+ struct boss_grobbulusAI : public BossAI
{
- me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_POISON_CLOUD_ADD, true);
- }
+ boss_grobbulusAI(Creature* creature) : BossAI(creature, BOSS_GROBBULUS) { }
- void EnterCombat(Unit* /*who*/) OVERRIDE
- {
- _EnterCombat();
- events.ScheduleEvent(EVENT_CLOUD, 15000);
- events.ScheduleEvent(EVENT_INJECT, 20000);
- events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); //not sure
- events.ScheduleEvent(EVENT_BERSERK, 12*60000);
- }
+ void EnterCombat(Unit* /*who*/) OVERRIDE
+ {
+ _EnterCombat();
+ events.ScheduleEvent(EVENT_CLOUD, 15000);
+ events.ScheduleEvent(EVENT_INJECT, 20000);
+ events.ScheduleEvent(EVENT_SPRAY, urand(15000, 30000)); // not sure
+ events.ScheduleEvent(EVENT_BERSERK, 12 * 60000);
+ }
- void SpellHitTarget(Unit* target, const SpellInfo* spell) OVERRIDE
- {
- if (spell->Id == uint32(SPELL_SLIME_SPRAY))
+ void SpellHitTarget(Unit* target, SpellInfo const* spell) OVERRIDE
{
- if (TempSummon* slime = me->SummonCreature(NPC_FALLOUT_SLIME, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0))
- DoZoneInCombat(slime);
+ if (spell->Id == SPELL_SLIME_SPRAY)
+ me->SummonCreature(NPC_FALLOUT_SLIME, *target, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT);
}
- }
- void UpdateAI(uint32 diff) OVERRIDE
- {
- if (!UpdateVictim())
- return;
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ if (!UpdateVictim())
+ return;
- events.Update(diff);
+ events.Update(diff);
- while (uint32 eventId = events.ExecuteEvent())
- {
- switch (eventId)
+ while (uint32 eventId = events.ExecuteEvent())
{
- case EVENT_CLOUD:
- DoCastAOE(SPELL_POISON_CLOUD);
- events.ScheduleEvent(EVENT_CLOUD, 15000);
- return;
- case EVENT_BERSERK:
- DoCastAOE(SPELL_BERSERK);
- return;
- case EVENT_SPRAY:
- DoCastAOE(SPELL_SLIME_SPRAY);
- events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000);
- return;
- case EVENT_INJECT:
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
- if (!target->HasAura(SPELL_MUTATING_INJECTION))
+ switch (eventId)
+ {
+ case EVENT_CLOUD:
+ DoCastAOE(SPELL_POISON_CLOUD);
+ events.ScheduleEvent(EVENT_CLOUD, 15000);
+ return;
+ case EVENT_BERSERK:
+ DoCastAOE(SPELL_BERSERK, true);
+ return;
+ case EVENT_SPRAY:
+ DoCastAOE(SPELL_SLIME_SPRAY);
+ events.ScheduleEvent(EVENT_SPRAY, urand(15000, 30000));
+ return;
+ case EVENT_INJECT:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_MUTATING_INJECTION))
DoCast(target, SPELL_MUTATING_INJECTION);
- events.ScheduleEvent(EVENT_INJECT, 8000 + uint32(120 * me->GetHealthPct()));
- return;
+ events.ScheduleEvent(EVENT_INJECT, 8000 + uint32(120 * me->GetHealthPct()));
+ return;
+ default:
+ break;
+ }
}
+
+ DoMeleeAttackIfReady();
}
+ };
- DoMeleeAttackIfReady();
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new boss_grobbulusAI(creature);
}
- };
-
};
class npc_grobbulus_poison_cloud : public CreatureScript
{
-public:
- npc_grobbulus_poison_cloud() : CreatureScript("npc_grobbulus_poison_cloud") { }
+ public:
+ npc_grobbulus_poison_cloud() : CreatureScript("npc_grobbulus_poison_cloud") { }
+
+ struct npc_grobbulus_poison_cloudAI : public ScriptedAI
+ {
+ npc_grobbulus_poison_cloudAI(Creature* creature) : ScriptedAI(creature)
+ {
+ SetCombatMovement(false);
+ creature->SetReactState(REACT_PASSIVE);
+ }
+
+ void IsSummonedBy(Unit* /*summoner*/) OVERRIDE
+ {
+ // no visual when casting in ctor or Reset()
+ DoCast(me, SPELL_POISON_CLOUD_PASSIVE, true);
+ }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_grobbulus_poison_cloudAI(creature);
- }
+ void UpdateAI(uint32 /*diff*/) OVERRIDE { }
+ };
- struct npc_grobbulus_poison_cloudAI : public ScriptedAI
- {
- npc_grobbulus_poison_cloudAI(Creature* creature) : ScriptedAI(creature)
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- SetCombatMovement(false);
+ return new npc_grobbulus_poison_cloudAI(creature);
}
+};
+
+// 28169 - Mutating Injection
+class spell_grobbulus_mutating_injection : public SpellScriptLoader
+{
+ public:
+ spell_grobbulus_mutating_injection() : SpellScriptLoader("spell_grobbulus_mutating_injection") { }
- uint32 Cloud_Timer;
+ class spell_grobbulus_mutating_injection_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_grobbulus_mutating_injection_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_MUTATING_EXPLOSION)
+ || !sSpellMgr->GetSpellInfo(SPELL_POISON_CLOUD))
+ return false;
+ return true;
+ }
+
+ void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
+ if (removeMode != AURA_REMOVE_BY_ENEMY_SPELL && removeMode != AURA_REMOVE_BY_EXPIRE)
+ return;
+
+ if (Unit* caster = GetCaster())
+ {
+ caster->CastSpell(GetTarget(), SPELL_MUTATING_EXPLOSION, true);
+ GetTarget()->CastSpell(GetTarget(), SPELL_POISON_CLOUD, true, NULL, aurEff, GetCasterGUID());
+ }
+ }
- void Reset() OVERRIDE
+ void Register() OVERRIDE
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_grobbulus_mutating_injection_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const OVERRIDE
{
- Cloud_Timer = 1000;
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ return new spell_grobbulus_mutating_injection_AuraScript();
}
+};
- void UpdateAI(uint32 diff) OVERRIDE
+// 28158, 54362 - Poison (Grobbulus)
+class spell_grobbulus_poison_cloud : public SpellScriptLoader
+{
+ public:
+ spell_grobbulus_poison_cloud() : SpellScriptLoader("spell_grobbulus_poison_cloud") { }
+
+ class spell_grobbulus_poison_cloud_AuraScript : public AuraScript
{
- if (Cloud_Timer <= diff)
+ PrepareAuraScript(spell_grobbulus_poison_cloud_AuraScript);
+
+ bool Validate(SpellInfo const* spellInfo) OVERRIDE
{
- DoCast(me, SPELL_POISON_CLOUD_ADD);
- Cloud_Timer = 10000;
- } else Cloud_Timer -= diff;
- }
- };
+ if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell))
+ return false;
+ return true;
+ }
+
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ PreventDefaultAction();
+ uint32 triggerSpell = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
+ int32 mod = int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) * 0.9f + 0.1f) * 10000 * 2 / 3);
+ GetTarget()->CastCustomSpell(triggerSpell, SPELLVALUE_RADIUS_MOD, mod, (Unit*)NULL, TRIGGERED_FULL_MASK, NULL, aurEff);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_grobbulus_poison_cloud_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const OVERRIDE
+ {
+ return new spell_grobbulus_poison_cloud_AuraScript();
+ }
};
void AddSC_boss_grobbulus()
{
new boss_grobbulus();
new npc_grobbulus_poison_cloud();
+ new spell_grobbulus_mutating_injection();
+ new spell_grobbulus_poison_cloud();
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
index a8e2783602f..b850d5e5072 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -61,7 +61,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_heiganAI(creature);
+ return GetInstanceAI<boss_heiganAI>(creature);
}
struct boss_heiganAI : public BossAI
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
index f9efdfce28b..41d1f53b52d 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -310,8 +310,7 @@ public:
FindGameObjects();
- if (instance)
- instance->SetData(DATA_ABOMINATION_KILLED, 0);
+ instance->SetData(DATA_ABOMINATION_KILLED, 0);
if (GameObject* pKTTrigger = me->GetMap()->GetGameObject(KTTriggerGUID))
{
@@ -649,7 +648,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_kelthuzadAI(creature);
+ return GetInstanceAI<boss_kelthuzadAI>(creature);
}
};
@@ -769,7 +768,7 @@ class npc_kelthuzad_abomination : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_kelthuzad_abominationAI(creature);
+ return GetInstanceAI<npc_kelthuzad_abominationAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp
index 93575e6367f..760cc180b95 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
index 588d58c1436..9d8dbf70ce7 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
index d90db5e077e..93cbb1b992a 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -37,23 +37,20 @@ enum Noth
NPC_GUARDIAN = 16981
};
-#define SPELL_BLINK RAND(29208, 29209, 29210, 29211)
+#define SPELL_BLINK RAND(29208, 29209, 29210, 29211)
// Teleport position of Noth on his balcony
-#define TELE_X 2631.370f
-#define TELE_Y -3529.680f
-#define TELE_Z 274.040f
-#define TELE_O 6.277f
+Position const Teleport = { 2631.370f, -3529.680f, 274.040f, 6.277f };
#define MAX_SUMMON_POS 5
-const float SummonPos[MAX_SUMMON_POS][4] =
+Position const SummonPos[MAX_SUMMON_POS] =
{
- {2728.12f, -3544.43f, 261.91f, 6.04f},
- {2729.05f, -3544.47f, 261.91f, 5.58f},
- {2728.24f, -3465.08f, 264.20f, 3.56f},
- {2704.11f, -3456.81f, 265.53f, 4.51f},
- {2663.56f, -3464.43f, 262.66f, 5.20f},
+ { 2728.12f, -3544.43f, 261.91f, 6.04f },
+ { 2729.05f, -3544.47f, 261.91f, 5.58f },
+ { 2728.24f, -3465.08f, 264.20f, 3.56f },
+ { 2704.11f, -3456.81f, 265.53f, 4.51f },
+ { 2663.56f, -3464.43f, 262.66f, 5.20f }
};
enum Events
@@ -65,7 +62,7 @@ enum Events
EVENT_WARRIOR,
EVENT_BALCONY,
EVENT_WAVE,
- EVENT_GROUND,
+ EVENT_GROUND
};
class boss_noth : public CreatureScript
@@ -73,17 +70,10 @@ class boss_noth : public CreatureScript
public:
boss_noth() : CreatureScript("boss_noth") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new boss_nothAI(creature);
- }
-
struct boss_nothAI : public BossAI
{
boss_nothAI(Creature* creature) : BossAI(creature, BOSS_NOTH) { }
- uint32 waveCount, balconyCount;
-
void Reset() OVERRIDE
{
me->SetReactState(REACT_AGGRESSIVE);
@@ -104,6 +94,7 @@ public:
me->SetReactState(REACT_AGGRESSIVE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoZoneInCombat();
+
if (me->getThreatManager().isThreatListEmpty())
EnterEvadeMode();
else
@@ -138,11 +129,7 @@ public:
void SummonUndead(uint32 entry, uint32 num)
{
for (uint32 i = 0; i < num; ++i)
- {
- uint32 pos = rand()%MAX_SUMMON_POS;
- me->SummonCreature(entry, SummonPos[pos][0], SummonPos[pos][1], SummonPos[pos][2],
- SummonPos[pos][3], TEMPSUMMON_CORPSE_DESPAWN, 60000);
- }
+ me->SummonCreature(entry, SummonPos[rand()%MAX_SUMMON_POS], TEMPSUMMON_CORPSE_DESPAWN, 60000);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -152,6 +139,9 @@ public:
events.Update(diff);
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
@@ -176,7 +166,7 @@ public:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->AttackStop();
me->RemoveAllAuras();
- me->NearTeleportTo(TELE_X, TELE_Y, TELE_Z, TELE_O);
+ me->NearTeleportTo(Teleport.GetPositionX(), Teleport.GetPositionY(), Teleport.GetPositionZ(), Teleport.GetOrientation());
events.Reset();
events.ScheduleEvent(EVENT_WAVE, urand(2000, 5000));
waveCount = 0;
@@ -185,12 +175,20 @@ public:
Talk(SAY_SUMMON);
switch (balconyCount)
{
- case 0: SummonUndead(NPC_CHAMPION, RAID_MODE(2, 4)); break;
- case 1: SummonUndead(NPC_CHAMPION, RAID_MODE(1, 2));
- SummonUndead(NPC_GUARDIAN, RAID_MODE(1, 2)); break;
- case 2: SummonUndead(NPC_GUARDIAN, RAID_MODE(2, 4)); break;
- default:SummonUndead(NPC_CHAMPION, RAID_MODE(5, 10));
- SummonUndead(NPC_GUARDIAN, RAID_MODE(5, 10));break;
+ case 0:
+ SummonUndead(NPC_CHAMPION, RAID_MODE(2, 4));
+ break;
+ case 1:
+ SummonUndead(NPC_CHAMPION, RAID_MODE(1, 2));
+ SummonUndead(NPC_GUARDIAN, RAID_MODE(1, 2));
+ break;
+ case 2:
+ SummonUndead(NPC_GUARDIAN, RAID_MODE(2, 4));
+ break;
+ default:
+ SummonUndead(NPC_CHAMPION, RAID_MODE(5, 10));
+ SummonUndead(NPC_GUARDIAN, RAID_MODE(5, 10));
+ break;
}
++waveCount;
events.ScheduleEvent(waveCount < 2 ? EVENT_WAVE : EVENT_GROUND, urand(30000, 45000));
@@ -211,8 +209,16 @@ public:
if (me->HasReactState(REACT_AGGRESSIVE))
DoMeleeAttackIfReady();
}
+
+ private:
+ uint32 waveCount;
+ uint32 balconyCount;
};
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return GetInstanceAI<boss_nothAI>(creature);
+ }
};
void AddSC_boss_noth()
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
index 96f2d743cac..cc0b3836a7a 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -57,7 +57,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_patchwerkAI(creature);
+ return GetInstanceAI<boss_patchwerkAI>(creature);
}
struct boss_patchwerkAI : public BossAI
@@ -70,8 +70,7 @@ public:
{
_Reset();
- if (instance)
- instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_MAKE_QUICK_WERK_OF_HIM_STARTING_EVENT);
+ instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_MAKE_QUICK_WERK_OF_HIM_STARTING_EVENT);
}
void KilledUnit(Unit* /*Victim*/) OVERRIDE
@@ -94,8 +93,7 @@ public:
events.ScheduleEvent(EVENT_HATEFUL, 1000);
events.ScheduleEvent(EVENT_BERSERK, 360000);
- if (instance)
- instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_MAKE_QUICK_WERK_OF_HIM_STARTING_EVENT);
+ instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_MAKE_QUICK_WERK_OF_HIM_STARTING_EVENT);
}
void UpdateAI(uint32 diff) OVERRIDE
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp
index 3ac20df24d6..4936681839f 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
index 60620804db8..be434ecc73a 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -96,6 +96,8 @@ class boss_sapphiron : public CreatureScript
void InitializeAI() OVERRIDE
{
+ _canTheHundredClub = true;
+
float x, y, z;
me->GetPosition(x, y, z);
me->SummonGameObject(GO_BIRTH, x, y, z, 0, 0, 0, 0, 0, 0);
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
index 3d121887471..245399afdda 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -110,7 +110,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_thaddiusAI(creature);
+ return GetInstanceAI<boss_thaddiusAI>(creature);
}
struct boss_thaddiusAI : public BossAI
@@ -230,15 +230,13 @@ public:
{
if (!checkStalaggAlive)
{
- if (instance)
- if (Creature* pStalagg = me->GetCreature(*me, instance->GetData64(DATA_STALAGG)))
- pStalagg->Respawn();
+ if (Creature* pStalagg = me->GetCreature(*me, instance->GetData64(DATA_STALAGG)))
+ pStalagg->Respawn();
}
else
{
- if (instance)
- if (Creature* pFeugen = me->GetCreature(*me, instance->GetData64(DATA_FEUGEN)))
- pFeugen->Respawn();
+ if (Creature* pFeugen = me->GetCreature(*me, instance->GetData64(DATA_FEUGEN)))
+ pFeugen->Respawn();
}
}
}
@@ -285,7 +283,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_stalaggAI(creature);
+ return GetInstanceAI<npc_stalaggAI>(creature);
}
struct npc_stalaggAI : public ScriptedAI
@@ -302,10 +300,9 @@ public:
void Reset() OVERRIDE
{
- if (instance)
- if (Creature* pThaddius = me->GetCreature(*me, instance->GetData64(DATA_THADDIUS)))
- if (pThaddius->AI())
- pThaddius->AI()->DoAction(ACTION_STALAGG_RESET);
+ if (Creature* pThaddius = me->GetCreature(*me, instance->GetData64(DATA_THADDIUS)))
+ if (pThaddius->AI())
+ pThaddius->AI()->DoAction(ACTION_STALAGG_RESET);
powerSurgeTimer = urand(20000, 25000);
magneticPullTimer = 20000;
}
@@ -325,10 +322,9 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
Talk(SAY_STAL_DEATH);
- if (instance)
- if (Creature* pThaddius = me->GetCreature(*me, instance->GetData64(DATA_THADDIUS)))
- if (pThaddius->AI())
- pThaddius->AI()->DoAction(ACTION_STALAGG_DIED);
+ if (Creature* pThaddius = me->GetCreature(*me, instance->GetData64(DATA_THADDIUS)))
+ if (pThaddius->AI())
+ pThaddius->AI()->DoAction(ACTION_STALAGG_DIED);
}
void UpdateAI(uint32 uiDiff) OVERRIDE
@@ -379,7 +375,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_feugenAI(creature);
+ return GetInstanceAI<npc_feugenAI>(creature);
}
struct npc_feugenAI : public ScriptedAI
@@ -395,10 +391,9 @@ public:
void Reset() OVERRIDE
{
- if (instance)
- if (Creature* pThaddius = me->GetCreature(*me, instance->GetData64(DATA_THADDIUS)))
- if (pThaddius->AI())
- pThaddius->AI()->DoAction(ACTION_FEUGEN_RESET);
+ if (Creature* pThaddius = me->GetCreature(*me, instance->GetData64(DATA_THADDIUS)))
+ if (pThaddius->AI())
+ pThaddius->AI()->DoAction(ACTION_FEUGEN_RESET);
staticFieldTimer = 5000;
}
@@ -417,10 +412,9 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
Talk(SAY_FEUG_DEATH);
- if (instance)
- if (Creature* pThaddius = me->GetCreature(*me, instance->GetData64(DATA_THADDIUS)))
- if (pThaddius->AI())
- pThaddius->AI()->DoAction(ACTION_FEUGEN_DIED);
+ if (Creature* pThaddius = me->GetCreature(*me, instance->GetData64(DATA_THADDIUS)))
+ if (pThaddius->AI())
+ pThaddius->AI()->DoAction(ACTION_FEUGEN_DIED);
}
void UpdateAI(uint32 uiDiff) OVERRIDE
diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
index 57f36ddc3a4..137c9e68247 100644
--- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Naxxramas/naxxramas.h b/src/server/scripts/Northrend/Naxxramas/naxxramas.h
index a71d573bf20..b6e87504c77 100644
--- a/src/server/scripts/Northrend/Naxxramas/naxxramas.h
+++ b/src/server/scripts/Northrend/Naxxramas/naxxramas.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
index 4a1670d1048..4e386afae17 100644
--- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
+++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -106,8 +106,8 @@ enum Spells
SPELL_ARCANE_STORM_P_I = 61693,
SPELL_VORTEX_1 = 56237, // seems that frezze object animation
SPELL_VORTEX_2 = 55873, // visual effect
- SPELL_VORTEX_3 = 56105, // this spell must handle all the script - casted by the boss and to himself
- SPELL_VORTEX_6 = 73040, // teleport - (casted to all raid), caster vortex bunnies, targets players.
+ SPELL_VORTEX_3 = 56105, // this spell must handle all the script - cast by the boss and to himself
+ SPELL_VORTEX_6 = 73040, // teleport - (cast to all raid), caster vortex bunnies, targets players.
// Phase II
SPELL_TELEPORT_VISUAL_ONLY = 41232, // Light blue animation cast by arcane NPCs when spawned on Hover Disks
@@ -117,7 +117,7 @@ enum Spells
SPELL_SUMMON_ARCANE_BOMB = 56429,
SPELL_ARCANE_BOMB_TRIGGER = 56430,
SPELL_ARCANE_BOMB_KNOCKBACK_DAMAGE = 56431,
- SPELL_ARCANE_OVERLOAD_1 = 56432, // casted by npc Arcane Overload ID: 30282
+ SPELL_ARCANE_OVERLOAD_1 = 56432, // cast by npc Arcane Overload ID: 30282
// SPELL_ARCANE_OVERLOAD_2 = 56435, // Triggered by 56432 - resizing target
// SPELL_ARCANE_OVERLOAD_3 = 56438, // Triggered by 56432 - damage reduction
SPELL_SURGE_OF_POWER_P_II = 56505,
@@ -376,8 +376,7 @@ public:
SetPhase(PHASE_NOT_STARTED, true);
me->SetReactState(REACT_PASSIVE);
- if (instance)
- instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
+ instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
uint32 GetData(uint32 data) const OVERRIDE
@@ -568,27 +567,22 @@ public:
// We can't call full function here since it includes DoZoneInCombat(),
// if someone does it will be returned with a warning.
me->setActive(true);
- if (instance)
+ if (!instance->CheckRequiredBosses(DATA_MALYGOS_EVENT))
{
- if (!instance->CheckRequiredBosses(DATA_MALYGOS_EVENT))
- {
- EnterEvadeMode();
- return;
- }
-
- instance->SetBossState(DATA_MALYGOS_EVENT, IN_PROGRESS);
+ EnterEvadeMode();
+ return;
}
+ instance->SetBossState(DATA_MALYGOS_EVENT, IN_PROGRESS);
+
Talk(SAY_START_P_ONE);
DoCast(SPELL_BERSERK); // periodic aura, first tick in 10 minutes
- if (instance)
- instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
+ instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
void EnterEvadeMode() OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_MALYGOS_EVENT, FAIL);
+ instance->SetBossState(DATA_MALYGOS_EVENT, FAIL);
SendLightOverride(LIGHT_GET_DEFAULT_FOR_MAP, 1*IN_MILLISECONDS);
@@ -628,8 +622,7 @@ public:
summons.DespawnAll();
}
- if (instance)
- instance->SetBossState(DATA_MALYGOS_EVENT, NOT_STARTED);
+ instance->SetBossState(DATA_MALYGOS_EVENT, NOT_STARTED);
}
void KilledUnit(Unit* victim) OVERRIDE
@@ -670,7 +663,7 @@ public:
Talk(SAY_BUFF_SPARK);
}
else if (spell->Id == SPELL_MALYGOS_BERSERK)
- sCreatureTextMgr->SendChat(me, EMOTE_HIT_BERSERKER_TIMER, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
+ sCreatureTextMgr->SendChat(me, EMOTE_HIT_BERSERKER_TIMER, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
}
void MoveInLineOfSight(Unit* who) OVERRIDE
@@ -963,7 +956,7 @@ public:
{
if (passenger->GetTypeId() == TYPEID_PLAYER)
{
- Talk(EMOTE_SURGE_OF_POWER_WARNING_P3, passenger->GetGUID());
+ Talk(EMOTE_SURGE_OF_POWER_WARNING_P3, passenger);
DoCast(tempSurgeTarget, SPELL_SURGE_OF_POWER_PHASE_3_10, true);
}
}
@@ -1074,7 +1067,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_malygosAI(creature);
+ return GetInstanceAI<boss_malygosAI>(creature);
}
};
@@ -1127,7 +1120,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_portal_eoeAI(creature);
+ return GetInstanceAI<npc_portal_eoeAI>(creature);
}
};
@@ -1142,7 +1135,7 @@ public:
{
_instance = creature->GetInstanceScript();
// Talk range was not enough for this encounter
- sCreatureTextMgr->SendChat(me, EMOTE_POWER_SPARK_SUMMONED, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
+ sCreatureTextMgr->SendChat(me, EMOTE_POWER_SPARK_SUMMONED, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
MoveToMalygos();
}
@@ -1190,7 +1183,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_power_sparkAI(creature);
+ return GetInstanceAI<npc_power_sparkAI>(creature);
}
};
@@ -1292,7 +1285,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_melee_hover_diskAI(creature);
+ return GetInstanceAI<npc_melee_hover_diskAI>(creature);
}
};
@@ -1374,7 +1367,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_caster_hover_diskAI(creature);
+ return GetInstanceAI<npc_caster_hover_diskAI>(creature);
}
};
@@ -1450,7 +1443,7 @@ class npc_nexus_lord : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_nexus_lordAI(creature);
+ return GetInstanceAI<npc_nexus_lordAI>(creature);
}
};
@@ -1517,7 +1510,7 @@ class npc_scion_of_eternity : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_scion_of_eternityAI(creature);
+ return GetInstanceAI<npc_scion_of_eternityAI>(creature);
}
};
@@ -1575,7 +1568,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_arcane_overloadAI(creature);
+ return GetInstanceAI<npc_arcane_overloadAI>(creature);
}
};
@@ -1907,7 +1900,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 casted by each vehicle when it's passenger leaves it.
+ // 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->GetData64(DATA_TRIGGER)))
trigger->CastSpell(targetPlayer, SPELL_VORTEX_6, true);
}
@@ -2351,7 +2344,7 @@ class spell_malygos_surge_of_power_warning_selector_25 : public SpellScriptLoade
if (Vehicle* vehicle = target->GetVehicleKit())
if (Unit* passenger = vehicle->GetPassenger(0))
if (passenger->GetTypeId() == TYPEID_PLAYER)
- caster->AI()->Talk(EMOTE_SURGE_OF_POWER_WARNING_P3, passenger->GetGUID());
+ caster->AI()->Talk(EMOTE_SURGE_OF_POWER_WARNING_P3, passenger);
}
}
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 db879eab6fb..f94acf5d772 100644
--- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h
+++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
index 4777b451e4e..e79f8d0764f 100644
--- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
+++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp
index fdc4927763e..f3304368e70 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -25,9 +25,9 @@ enum Spells
SPELL_SPARK = 47751,
H_SPELL_SPARK = 57062,
SPELL_RIFT_SHIELD = 47748,
- SPELL_CHARGE_RIFT = 47747, //Works wrong (affect players, not rifts)
- SPELL_CREATE_RIFT = 47743, //Don't work, using WA
- SPELL_ARCANE_ATTRACTION = 57063, //No idea, when it's used
+ SPELL_CHARGE_RIFT = 47747, // Works wrong (affect players, not rifts)
+ SPELL_CREATE_RIFT = 47743, // Don't work, using WA
+ SPELL_ARCANE_ATTRACTION = 57063, // No idea, when it's used
};
enum Adds
@@ -41,14 +41,16 @@ enum Yells
SAY_AGGRO = 0,
SAY_DEATH = 1,
SAY_RIFT = 2,
- SAY_SHIELD = 3
+ SAY_SHIELD = 3,
+ SAY_RIFT_EMOTE = 4, // Needs to be added to script
+ SAY_SHIELD_EMOTE = 5 // Needs to be added to script
};
enum RiftSpells
{
SPELL_CHAOTIC_ENERGY_BURST = 47688,
SPELL_CHARGED_CHAOTIC_ENERGY_BURST = 47737,
- SPELL_ARCANEFORM = 48019, //Chaotic Rift visual
+ SPELL_ARCANEFORM = 48019, // Chaotic Rift visual
};
Position const RiftLocation[6] =
@@ -93,24 +95,21 @@ class boss_anomalus : public CreatureScript
uiChaoticRiftGUID = 0;
chaosTheory = true;
- if (instance)
- instance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED);
+ instance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_ANOMALUS_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_ANOMALUS_EVENT, IN_PROGRESS);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_ANOMALUS_EVENT, DONE);
+ instance->SetData(DATA_ANOMALUS_EVENT, DONE);
}
uint32 GetData(uint32 type) const OVERRIDE
@@ -185,7 +184,7 @@ class boss_anomalus : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_anomalusAI(creature);
+ return GetInstanceAI<boss_anomalusAI>(creature);
}
};
@@ -253,7 +252,7 @@ class npc_chaotic_rift : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_chaotic_riftAI(creature);
+ return GetInstanceAI<npc_chaotic_riftAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp
index a864d679b89..b82f131457a 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp
index 3a74d3408c3..7a9ea8ec9c3 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp
index ef8f5c2d3c4..2f6a328b728 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -44,7 +44,8 @@ enum Yells
SAY_SLAY = 1,
SAY_ENRAGE = 2,
SAY_DEATH = 3,
- SAY_CRYSTAL_NOVA = 4
+ SAY_CRYSTAL_NOVA = 4,
+ SAY_FRENZY = 5
};
enum Misc
@@ -60,7 +61,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_keristraszaAI(creature);
+ return GetInstanceAI<boss_keristraszaAI>(creature);
}
struct boss_keristraszaAI : public ScriptedAI
@@ -94,8 +95,7 @@ public:
RemovePrison(CheckContainmentSpheres());
- if (instance)
- instance->SetData(DATA_KERISTRASZA_EVENT, NOT_STARTED);
+ instance->SetData(DATA_KERISTRASZA_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -103,28 +103,24 @@ public:
Talk(SAY_AGGRO);
DoCastAOE(SPELL_INTENSE_COLD);
- if (instance)
- instance->SetData(DATA_KERISTRASZA_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_KERISTRASZA_EVENT, IN_PROGRESS);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_KERISTRASZA_EVENT, DONE);
+ instance->SetData(DATA_KERISTRASZA_EVENT, DONE);
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_SLAY);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_SLAY);
}
bool CheckContainmentSpheres(bool remove_prison = false)
{
- if (!instance)
- return false;
-
auiContainmentSphereGUIDs[0] = instance->GetData64(ANOMALUS_CONTAINMET_SPHERE);
auiContainmentSphereGUIDs[1] = instance->GetData64(ORMOROKS_CONTAINMET_SPHERE);
auiContainmentSphereGUIDs[2] = instance->GetData64(TELESTRAS_CONTAINMET_SPHERE);
@@ -175,6 +171,7 @@ public:
if (!bEnrage && HealthBelowPct(25))
{
Talk(SAY_ENRAGE);
+ Talk(SAY_FRENZY);
DoCast(me, SPELL_ENRAGE);
bEnrage = true;
}
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 8a01c40186e..cfa1b704c90 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -65,7 +65,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_magus_telestraAI(creature);
+ return GetInstanceAI<boss_magus_telestraAI>(creature);
}
struct boss_magus_telestraAI : public ScriptedAI
@@ -118,29 +118,27 @@ public:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetVisible(true);
- if (instance)
- instance->SetData(DATA_MAGUS_TELESTRA_EVENT, NOT_STARTED);
+ instance->SetData(DATA_MAGUS_TELESTRA_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_MAGUS_TELESTRA_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_MAGUS_TELESTRA_EVENT, IN_PROGRESS);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_MAGUS_TELESTRA_EVENT, DONE);
+ instance->SetData(DATA_MAGUS_TELESTRA_EVENT, DONE);
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_KILL);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_KILL);
}
void DoAction(int32 action) OVERRIDE
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp
index 423937303b5..93e52c4da73 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@ enum Yells
SAY_REFLECT = 3,
SAY_CRYSTAL_SPIKES = 4,
SAY_KILL = 5,
+ SAY_FRENZY = 6
};
enum Events
@@ -69,6 +70,12 @@ public:
{
boss_ormorokAI(Creature* creature) : BossAI(creature, DATA_ORMOROK_EVENT) { }
+ void Reset()
+ {
+ BossAI::Reset();
+ frenzy = false;
+ }
+
void EnterCombat(Unit* /*who*/) OVERRIDE
{
_EnterCombat();
@@ -81,14 +88,14 @@ public:
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_ORMOROK_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_ORMOROK_EVENT, IN_PROGRESS);
}
void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) OVERRIDE
{
if (!frenzy && HealthBelowPct(25))
{
+ Talk(SAY_FRENZY);
DoCast(me, SPELL_FRENZY);
frenzy = true;
}
@@ -100,13 +107,13 @@ public:
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_ORMOROK_EVENT, DONE);
+ instance->SetData(DATA_ORMOROK_EVENT, DONE);
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_KILL);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_KILL);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -157,7 +164,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_ormorokAI(creature);
+ return GetInstanceAI<boss_ormorokAI>(creature);
}
};
@@ -188,7 +195,11 @@ public:
struct npc_crystal_spike_triggerAI : public ScriptedAI
{
- npc_crystal_spike_triggerAI(Creature* creature) : ScriptedAI(creature) { }
+ npc_crystal_spike_triggerAI(Creature* creature) : ScriptedAI(creature)
+ {
+ _count = 0;
+ _despawntimer = 0;
+ }
void IsSummonedBy(Unit* owner) OVERRIDE
{
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp
index 109106d4d59..851e16fe576 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/nexus.h b/src/server/scripts/Northrend/Nexus/Nexus/nexus.h
index 58abfb3b63e..e9be1a32c2a 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/nexus.h
+++ b/src/server/scripts/Northrend/Nexus/Nexus/nexus.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp
index d22a0bcc79f..949b26d3d3b 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp
index ca6f580633c..c4fda7e68b3 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -99,9 +99,10 @@ class boss_eregos : public CreatureScript
DoAction(ACTION_SET_NORMAL_EVENTS);
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_KILL);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_KILL);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -165,7 +166,7 @@ class boss_eregos : public CreatureScript
if (summon->GetEntry() != NPC_PLANAR_ANOMALY)
return;
- /// @todo: See why the spell is not casted
+ /// @todo: See why the spell is not cast
summon->CastSpell(summon, SPELL_PLANAR_BLAST, true);
}
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp
index f7c558879d1..8cc198a0d84 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -248,7 +248,7 @@ class boss_urom : public CreatureScript
arcaneExplosionTimer -= diff;
}
- if (!me->IsNonMeleeSpellCasted(false, true, true))
+ if (!me->IsNonMeleeSpellCast(false, true, true))
{
if (frostBombTimer <= diff)
{
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
index 385f80ae37d..f6cf17c5b88 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -217,17 +217,14 @@ class npc_azure_ring_captain : public CreatureScript
switch (action)
{
case ACTION_CALL_DRAGON_EVENT:
- if (instance)
+ if (Creature* varos = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_VAROS)))
{
- if (Creature* varos = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_VAROS)))
+ if (Unit* victim = varos->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0))
{
- if (Unit* victim = varos->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0))
- {
- me->SetReactState(REACT_PASSIVE);
- me->SetWalk(false);
- me->GetMotionMaster()->MovePoint(ACTION_CALL_DRAGON_EVENT, victim->GetPositionX(), victim->GetPositionY(), victim->GetPositionZ() + 20.0f);
- targetGUID = victim->GetGUID();
- }
+ me->SetReactState(REACT_PASSIVE);
+ me->SetWalk(false);
+ me->GetMotionMaster()->MovePoint(ACTION_CALL_DRAGON_EVENT, victim->GetPositionX(), victim->GetPositionY(), victim->GetPositionZ() + 20.0f);
+ targetGUID = victim->GetGUID();
}
}
break;
@@ -241,7 +238,7 @@ class npc_azure_ring_captain : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_azure_ring_captainAI(creature);
+ return GetInstanceAI<npc_azure_ring_captainAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
index b108378910e..2c809b17367 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
index 1230868c020..40e526219fa 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -310,17 +310,21 @@ class npc_ruby_emerald_amber_drake : public CreatureScript
switch (eventId)
{
case EVENT_WELCOME:
- Talk(WHISPER_DRAKES_WELCOME, me->GetCreatorGUID());
+ if (Unit* creator = ObjectAccessor::GetUnit(*me, me->GetCreatorGUID()))
+ Talk(WHISPER_DRAKES_WELCOME, creator);
_events.ScheduleEvent(EVENT_ABILITIES, 5 * IN_MILLISECONDS);
break;
case EVENT_ABILITIES:
- Talk(WHISPER_DRAKES_ABILITIES, me->GetCreatorGUID());
+ if (Unit* creator = ObjectAccessor::GetUnit(*me, me->GetCreatorGUID()))
+ Talk(WHISPER_DRAKES_ABILITIES, creator);
break;
case EVENT_SPECIAL_ATTACK:
- Talk(WHISPER_DRAKES_SPECIAL, me->GetCreatorGUID());
+ if (Unit* creator = ObjectAccessor::GetUnit(*me, me->GetCreatorGUID()))
+ Talk(WHISPER_DRAKES_SPECIAL, creator);
break;
case EVENT_LOW_HEALTH:
- Talk(WHISPER_DRAKES_LOWHEALTH, me->GetCreatorGUID());
+ if (Unit* creator = ObjectAccessor::GetUnit(*me, me->GetCreatorGUID()))
+ Talk(WHISPER_DRAKES_LOWHEALTH, creator);
_healthWarning = false;
_events.ScheduleEvent(EVENT_RESET_LOW_HEALTH, 25000);
break;
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.h b/src/server/scripts/Northrend/Nexus/Oculus/oculus.h
index 6f34cfbf6e5..f54b1c067f0 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.h
+++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
index 944eacda34e..dbdcfc88951 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -99,7 +99,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_bjarngrimAI(creature);
+ return GetInstanceAI<boss_bjarngrimAI>(creature);
}
struct boss_bjarngrimAI : public ScriptedAI
@@ -180,8 +180,7 @@ public:
SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE);
- if (instance)
- instance->SetBossState(DATA_BJARNGRIM, NOT_STARTED);
+ instance->SetBossState(DATA_BJARNGRIM, NOT_STARTED);
}
void EnterEvadeMode() OVERRIDE
@@ -201,8 +200,7 @@ public:
//must get both lieutenants here and make sure they are with him
me->CallForHelp(30.0f);
- if (instance)
- instance->SetBossState(DATA_BJARNGRIM, IN_PROGRESS);
+ instance->SetBossState(DATA_BJARNGRIM, IN_PROGRESS);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -214,8 +212,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetBossState(DATA_BJARNGRIM, DONE);
+ instance->SetBossState(DATA_BJARNGRIM, DONE);
}
/// @todo remove when removal is done by the core
@@ -245,7 +242,7 @@ public:
if (m_uiChangeStance_Timer <= uiDiff)
{
//wait for current spell to finish before change stance
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
return;
DoRemoveStanceAura(m_uiStance);
@@ -391,7 +388,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_stormforged_lieutenantAI(creature);
+ return GetInstanceAI<npc_stormforged_lieutenantAI>(creature);
}
struct npc_stormforged_lieutenantAI : public ScriptedAI
@@ -414,13 +411,10 @@ public:
void EnterCombat(Unit* who) OVERRIDE
{
- if (instance)
+ if (Creature* pBjarngrim = instance->instance->GetCreature(instance->GetData64(DATA_BJARNGRIM)))
{
- if (Creature* pBjarngrim = instance->instance->GetCreature(instance->GetData64(DATA_BJARNGRIM)))
- {
- if (pBjarngrim->IsAlive() && !pBjarngrim->GetVictim())
- pBjarngrim->AI()->AttackStart(who);
- }
+ if (pBjarngrim->IsAlive() && !pBjarngrim->GetVictim())
+ pBjarngrim->AI()->AttackStart(who);
}
}
@@ -440,13 +434,10 @@ public:
if (m_uiRenewSteel_Timer <= uiDiff)
{
- if (instance)
+ if (Creature* pBjarngrim = instance->instance->GetCreature(instance->GetData64(DATA_BJARNGRIM)))
{
- if (Creature* pBjarngrim = instance->instance->GetCreature(instance->GetData64(DATA_BJARNGRIM)))
- {
- if (pBjarngrim->IsAlive())
- DoCast(pBjarngrim, SPELL_RENEW_STEEL_N);
- }
+ if (pBjarngrim->IsAlive())
+ DoCast(pBjarngrim, SPELL_RENEW_STEEL_N);
}
m_uiRenewSteel_Timer = urand(10000, 14000);
}
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
index af6beca608d..c666a36741b 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -72,7 +72,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_ionarAI(creature);
+ return GetInstanceAI<boss_ionarAI>(creature);
}
struct boss_ionarAI : public ScriptedAI
@@ -115,16 +115,14 @@ public:
if (!me->IsVisible())
me->SetVisible(true);
- if (instance)
- instance->SetBossState(DATA_IONAR, NOT_STARTED);
+ instance->SetBossState(DATA_IONAR, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetBossState(DATA_IONAR, IN_PROGRESS);
+ instance->SetBossState(DATA_IONAR, IN_PROGRESS);
}
void JustDied(Unit* /*killer*/) OVERRIDE
@@ -133,13 +131,13 @@ public:
lSparkList.DespawnAll();
- if (instance)
- instance->SetBossState(DATA_IONAR, DONE);
+ instance->SetBossState(DATA_IONAR, DONE);
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_SLAY);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_SLAY);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) OVERRIDE
@@ -278,7 +276,7 @@ public:
Talk(SAY_SPLIT);
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_DISPERSE, false);
@@ -301,7 +299,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_spark_of_ionarAI(creature);
+ return GetInstanceAI<npc_spark_of_ionarAI>(creature);
}
struct npc_spark_of_ionarAI : public ScriptedAI
@@ -347,24 +345,21 @@ public:
// Prevent them to follow players through the whole instance
if (uiCheckTimer <= uiDiff)
{
- if (instance)
+ Creature* pIonar = instance->instance->GetCreature(instance->GetData64(DATA_IONAR));
+ if (pIonar && pIonar->IsAlive())
{
- Creature* pIonar = instance->instance->GetCreature(instance->GetData64(DATA_IONAR));
- if (pIonar && pIonar->IsAlive())
+ if (me->GetDistance(pIonar) > DATA_MAX_SPARK_DISTANCE)
{
- if (me->GetDistance(pIonar) > DATA_MAX_SPARK_DISTANCE)
- {
- Position pos;
- pIonar->GetPosition(&pos);
-
- me->SetSpeed(MOVE_RUN, 2.0f);
- me->GetMotionMaster()->Clear();
- me->GetMotionMaster()->MovePoint(DATA_POINT_CALLBACK, pos);
- }
+ Position pos;
+ pIonar->GetPosition(&pos);
+
+ me->SetSpeed(MOVE_RUN, 2.0f);
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MovePoint(DATA_POINT_CALLBACK, pos);
}
- else
- me->DespawnOrUnsummon();
}
+ else
+ me->DespawnOrUnsummon();
uiCheckTimer = 2*IN_MILLISECONDS;
}
else
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
index 61687de1b58..fee7d201a31 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -69,7 +69,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_lokenAI(creature);
+ return GetInstanceAI<boss_lokenAI>(creature);
}
struct boss_lokenAI : public ScriptedAI
@@ -95,38 +95,30 @@ public:
m_uiHealthAmountModifier = 1;
- if (instance)
- {
- instance->SetBossState(DATA_LOKEN, NOT_STARTED);
- instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT);
- }
+ instance->SetBossState(DATA_LOKEN, NOT_STARTED);
+ instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- {
- instance->SetBossState(DATA_LOKEN, IN_PROGRESS);
- instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT);
- }
+ instance->SetBossState(DATA_LOKEN, IN_PROGRESS);
+ instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
Talk(SAY_DEATH);
- if (instance)
- {
- instance->SetBossState(DATA_LOKEN, DONE);
- instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PULSING_SHOCKWAVE_AURA);
- }
+ instance->SetBossState(DATA_LOKEN, DONE);
+ instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PULSING_SHOCKWAVE_AURA);
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_SLAY);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_SLAY);
}
void UpdateAI(uint32 uiDiff) OVERRIDE
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
index b6790a088ad..c312d001ee7 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -75,7 +75,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_volkhanAI(creature);
+ return GetInstanceAI<boss_volkhanAI>(creature);
}
struct boss_volkhanAI : public ScriptedAI
@@ -120,16 +120,14 @@ public:
DespawnGolem();
m_lGolemGUIDList.clear();
- if (instance)
- instance->SetBossState(DATA_VOLKHAN, NOT_STARTED);
+ instance->SetBossState(DATA_VOLKHAN, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetBossState(DATA_VOLKHAN, IN_PROGRESS);
+ instance->SetBossState(DATA_VOLKHAN, IN_PROGRESS);
}
void AttackStart(Unit* who) OVERRIDE
@@ -150,13 +148,13 @@ public:
Talk(SAY_DEATH);
DespawnGolem();
- if (instance)
- instance->SetBossState(DATA_VOLKHAN, DONE);
+ instance->SetBossState(DATA_VOLKHAN, DONE);
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_SLAY);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_SLAY);
}
void DespawnGolem()
@@ -286,7 +284,7 @@ public:
{
++m_uiHealthAmountModifier;
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(false);
Talk(SAY_FORGE);
@@ -411,7 +409,7 @@ public:
me->AttackStop();
// me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); //Set in DB
// me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //Set in DB
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(false);
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
me->GetMotionMaster()->MovementExpired();
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 17c049e8292..cef99ce7abd 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 394fbc84253..a6d55c363f5 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp
index b6a4375d0eb..3a38f2b61e5 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -83,15 +83,13 @@ public:
uiStompTimer = urand(20000, 29000);
uiShatterTimer = 0;
- if (instance)
- instance->SetBossState(DATA_KRYSTALLUS, NOT_STARTED);
+ instance->SetBossState(DATA_KRYSTALLUS, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetBossState(DATA_KRYSTALLUS, IN_PROGRESS);
+ instance->SetBossState(DATA_KRYSTALLUS, IN_PROGRESS);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -143,8 +141,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetBossState(DATA_KRYSTALLUS, DONE);
+ instance->SetBossState(DATA_KRYSTALLUS, DONE);
}
void KilledUnit(Unit* victim) OVERRIDE
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp
index f4ea3ff556c..927f4490770 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -15,153 +15,130 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* Script Data Start
-SDName: Boss maiden_of_grief
-SDAuthor: LordVanMartin
-SD%Complete:
-SDComment:
-SDCategory:
-Script Data End */
-
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "halls_of_stone.h"
+enum Yells
+{
+ SAY_AGGRO = 0,
+ SAY_SLAY = 1,
+ SAY_DEATH = 2,
+ SAY_STUN = 3
+};
+
enum Spells
{
- SPELL_PARTING_SORROW = 59723,
- SPELL_STORM_OF_GRIEF_N = 50752,
- SPELL_STORM_OF_GRIEF_H = 59772,
- SPELL_SHOCK_OF_SORROW_N = 50760,
- SPELL_SHOCK_OF_SORROW_H = 59726,
- SPELL_PILLAR_OF_WOE_N = 50761,
- SPELL_PILLAR_OF_WOE_H = 59727
+ SPELL_PARTING_SORROW = 59723,
+ SPELL_STORM_OF_GRIEF = 50752,
+ SPELL_SHOCK_OF_SORROW = 50760,
+ SPELL_PILLAR_OF_WOE = 50761
};
-enum Yells
+enum Events
{
- SAY_AGGRO = 0,
- SAY_SLAY = 1,
- SAY_DEATH = 2,
- SAY_STUN = 3
+ EVENT_PARTING_SORROW = 1,
+ EVENT_STORM_OF_GRIEF,
+ EVENT_SHOCK_OF_SORROW,
+ EVENT_PILLAR_OF_WOE
};
enum Achievements
{
- ACHIEV_GOOD_GRIEF_START_EVENT = 20383,
+ ACHIEV_GOOD_GRIEF_START_EVENT = 20383,
};
class boss_maiden_of_grief : public CreatureScript
{
-public:
- boss_maiden_of_grief() : CreatureScript("boss_maiden_of_grief") { }
+ public:
+ boss_maiden_of_grief() : CreatureScript("boss_maiden_of_grief") { }
- struct boss_maiden_of_griefAI : public ScriptedAI
- {
- boss_maiden_of_griefAI(Creature* creature) : ScriptedAI(creature)
+ struct boss_maiden_of_griefAI : public BossAI
{
- instance = me->GetInstanceScript();
- }
-
- InstanceScript* instance;
+ boss_maiden_of_griefAI(Creature* creature) : BossAI(creature, DATA_MAIDEN_OF_GRIEF) { }
- uint32 PartingSorrowTimer;
- uint32 StormOfGriefTimer;
- uint32 ShockOfSorrowTimer;
- uint32 PillarOfWoeTimer;
+ void Reset() OVERRIDE
+ {
+ _Reset();
- void Reset() OVERRIDE
- {
- PartingSorrowTimer = urand(25000, 30000);
- StormOfGriefTimer = 10000;
- ShockOfSorrowTimer = 20000+rand()%5000;
- PillarOfWoeTimer = urand(5000, 15000);
+ if (IsHeroic())
+ events.ScheduleEvent(EVENT_PARTING_SORROW, urand(25000, 30000));
+ events.ScheduleEvent(EVENT_STORM_OF_GRIEF, 10000);
+ events.ScheduleEvent(EVENT_SHOCK_OF_SORROW, urand(20000, 25000));
+ events.ScheduleEvent(EVENT_PILLAR_OF_WOE, urand(5000, 15000));
- if (instance)
- {
- instance->SetBossState(DATA_MAIDEN_OF_GRIEF, NOT_STARTED);
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_GOOD_GRIEF_START_EVENT);
}
- }
- void EnterCombat(Unit* /*who*/) OVERRIDE
- {
- Talk(SAY_AGGRO);
-
- if (instance)
+ void EnterCombat(Unit* /*who*/) OVERRIDE
{
- instance->SetBossState(DATA_MAIDEN_OF_GRIEF, IN_PROGRESS);
+ _EnterCombat();
+ Talk(SAY_AGGRO);
+
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_GOOD_GRIEF_START_EVENT);
}
- }
- void UpdateAI(uint32 diff) OVERRIDE
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- if (IsHeroic())
+ void KilledUnit(Unit* who) OVERRIDE
{
- if (PartingSorrowTimer <= diff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- DoCast(target, SPELL_PARTING_SORROW);
-
- PartingSorrowTimer = urand(30000, 40000);
- } else PartingSorrowTimer -= diff;
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_SLAY);
}
- if (StormOfGriefTimer <= diff)
+ void JustDied(Unit* /*killer*/) OVERRIDE
{
- DoCastVictim(SPELL_STORM_OF_GRIEF_N, true);
- StormOfGriefTimer = urand(15000, 20000);
- } else StormOfGriefTimer -= diff;
-
- if (ShockOfSorrowTimer <= diff)
- {
- DoResetThreat();
- Talk(SAY_STUN);
- DoCast(me, SPELL_SHOCK_OF_SORROW_N);
- ShockOfSorrowTimer = urand(20000, 30000);
- } else ShockOfSorrowTimer -= diff;
+ _JustDied();
+ Talk(SAY_DEATH);
+ }
- if (PillarOfWoeTimer <= diff)
+ void UpdateAI(uint32 diff) OVERRIDE
{
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
-
- if (target)
- DoCast(target, SPELL_PILLAR_OF_WOE_N);
- else
- DoCastVictim(SPELL_PILLAR_OF_WOE_N);
+ if (!UpdateVictim())
+ return;
- PillarOfWoeTimer = urand(5000, 25000);
- } else PillarOfWoeTimer -= diff;
+ events.Update(diff);
- DoMeleeAttackIfReady();
- }
-
- void JustDied(Unit* /*killer*/) OVERRIDE
- {
- Talk(SAY_DEATH);
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
- if (instance)
- instance->SetBossState(DATA_MAIDEN_OF_GRIEF, DONE);
- }
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_PARTING_SORROW:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
+ DoCast(target, SPELL_PARTING_SORROW);
+ events.ScheduleEvent(EVENT_PARTING_SORROW, urand(30000, 40000));
+ break;
+ case EVENT_STORM_OF_GRIEF:
+ DoCastVictim(SPELL_STORM_OF_GRIEF, true);
+ events.ScheduleEvent(EVENT_STORM_OF_GRIEF, urand(15000, 20000));
+ break;
+ case EVENT_SHOCK_OF_SORROW:
+ DoResetThreat();
+ Talk(SAY_STUN);
+ DoCastAOE(SPELL_SHOCK_OF_SORROW);
+ events.ScheduleEvent(EVENT_SHOCK_OF_SORROW, urand(20000, 30000));
+ break;
+ case EVENT_PILLAR_OF_WOE:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
+ DoCast(target, SPELL_PILLAR_OF_WOE);
+ else
+ DoCastVictim(SPELL_PILLAR_OF_WOE);
+ events.ScheduleEvent(EVENT_PILLAR_OF_WOE, urand(5000, 25000));
+ break;
+ default:
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ };
- void KilledUnit(Unit* victim) OVERRIDE
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- if (victim->GetTypeId() != TYPEID_PLAYER)
- return;
-
- Talk(SAY_SLAY);
+ return GetHallsOfStoneAI<boss_maiden_of_griefAI>(creature);
}
- };
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return GetHallsOfStoneAI<boss_maiden_of_griefAI>(creature);
- }
};
void AddSC_boss_maiden_of_grief()
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp
index 618628adf88..b2785fbaba5 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 ff4a5d1b43a..d64b0d5c71d 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -167,13 +167,10 @@ public:
bMarnakActivated = false;
bAbedneumActivated = false;
- if (instance)
- {
- instance->HandleGameObject(instance->GetData64(DATA_GO_KADDRAK), false);
- instance->HandleGameObject(instance->GetData64(DATA_GO_MARNAK), false);
- instance->HandleGameObject(instance->GetData64(DATA_GO_ABEDNEUM), false);
- instance->HandleGameObject(instance->GetData64(DATA_GO_SKY_FLOOR), false);
- }
+ instance->HandleGameObject(instance->GetData64(DATA_GO_KADDRAK), false);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_MARNAK), false);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_ABEDNEUM), false);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_SKY_FLOOR), false);
KaddrakGUIDList.clear();
}
@@ -324,8 +321,7 @@ public:
DespawnDwarf();
- if (instance)
- instance->SetBossState(DATA_BRANN_EVENT, NOT_STARTED);
+ instance->SetBossState(DATA_BRANN_EVENT, NOT_STARTED);
}
}
@@ -362,8 +358,7 @@ public:
break;
case 17:
Talk(SAY_EVENT_INTRO_2);
- if (instance)
- instance->HandleGameObject(instance->GetData64(DATA_GO_TRIBUNAL_CONSOLE), true);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_TRIBUNAL_CONSOLE), true);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
SetEscortPaused(true);
JumpToNextStep(8500);
@@ -438,12 +433,9 @@ public:
switch (uiStep)
{
case 1:
- if (instance)
- {
- if (instance->GetBossState(DATA_BRANN_EVENT) != NOT_STARTED)
- return;
- instance->SetBossState(DATA_BRANN_EVENT, IN_PROGRESS);
- }
+ if (instance->GetBossState(DATA_BRANN_EVENT) != NOT_STARTED)
+ return;
+ instance->SetBossState(DATA_BRANN_EVENT, IN_PROGRESS);
bIsBattle = false;
Talk(SAY_ESCORT_START);
SetRun(true);
@@ -454,25 +446,22 @@ public:
JumpToNextStep(0);
break;
case 5:
- if (instance)
- if (Creature* temp = (Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM))))
- temp->AI()->Talk(SAY_EVENT_INTRO_3_ABED);
- JumpToNextStep(8500);
+ if (Creature* temp = (Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM))))
+ temp->AI()->Talk(SAY_EVENT_INTRO_3_ABED);
+ JumpToNextStep(8500);
break;
case 6:
Talk(SAY_EVENT_A_1);
JumpToNextStep(6500);
break;
case 7:
- if (instance)
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
- temp->AI()->Talk(SAY_EVENT_A_2_KADD);
- JumpToNextStep(12500);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
+ temp->AI()->Talk(SAY_EVENT_A_2_KADD);
+ JumpToNextStep(12500);
break;
case 8:
Talk(SAY_EVENT_A_3);
- if (instance)
- instance->HandleGameObject(instance->GetData64(DATA_GO_KADDRAK), true);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_KADDRAK), true);
if (Creature* temp = Unit::GetCreature(*me, uiControllerGUID))
CAST_AI(npc_tribuna_controller::npc_tribuna_controllerAI, temp->AI())->bKaddrakActivated = true;
JumpToNextStep(5000);
@@ -487,16 +476,14 @@ public:
JumpToNextStep(6000);
break;
case 11:
- if (instance)
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
- temp->AI()->Talk(SAY_EVENT_B_2_MARN);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
+ temp->AI()->Talk(SAY_EVENT_B_2_MARN);
SpawnDwarf(1);
JumpToNextStep(20000);
break;
case 12:
Talk(SAY_EVENT_B_3);
- if (instance)
- instance->HandleGameObject(instance->GetData64(DATA_GO_MARNAK), true);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_MARNAK), true);
if (Creature* temp = Unit::GetCreature(*me, uiControllerGUID))
CAST_AI(npc_tribuna_controller::npc_tribuna_controllerAI, temp->AI())->bMarnakActivated = true;
JumpToNextStep(10000);
@@ -519,16 +506,14 @@ public:
JumpToNextStep(20000);
break;
case 17:
- if (instance)
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
- temp->AI()->Talk(SAY_EVENT_C_2_ABED);
- SpawnDwarf(1);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
+ temp->AI()->Talk(SAY_EVENT_C_2_ABED);
+ SpawnDwarf(1);
JumpToNextStep(20000);
break;
case 18:
Talk(SAY_EVENT_C_3);
- if (instance)
- instance->HandleGameObject(instance->GetData64(DATA_GO_ABEDNEUM), true);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_ABEDNEUM), true);
if (Creature* temp = Unit::GetCreature(*me, uiControllerGUID))
CAST_AI(npc_tribuna_controller::npc_tribuna_controllerAI, temp->AI())->bAbedneumActivated = true;
JumpToNextStep(5000);
@@ -547,9 +532,8 @@ public:
JumpToNextStep(20000);
break;
case 22:
- if (instance)
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
- temp->AI()->Talk(SAY_EVENT_D_2_ABED);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
+ temp->AI()->Talk(SAY_EVENT_D_2_ABED);
SpawnDwarf(1);
JumpToNextStep(5000);
break;
@@ -571,9 +555,8 @@ public:
JumpToNextStep(10000);
break;
case 27:
- if (instance)
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
- temp->AI()->Talk(SAY_EVENT_D_4_ABED);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
+ temp->AI()->Talk(SAY_EVENT_D_4_ABED);
SpawnDwarf(1);
JumpToNextStep(10000);
break;
@@ -581,8 +564,7 @@ public:
me->SetReactState(REACT_DEFENSIVE);
Talk(SAY_EVENT_END_01);
me->SetStandState(UNIT_STAND_STATE_STAND);
- if (instance)
- instance->HandleGameObject(instance->GetData64(DATA_GO_SKY_FLOOR), true);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_SKY_FLOOR), true);
if (Creature* temp = Unit::GetCreature(*me, uiControllerGUID))
temp->DealDamage(temp, temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
bIsBattle = true;
@@ -591,15 +573,13 @@ public:
break;
case 29:
Talk(SAY_EVENT_END_02);
- if (instance)
- instance->SetBossState(DATA_BRANN_EVENT, DONE);
+ instance->SetBossState(DATA_BRANN_EVENT, DONE);
me->CastSpell(me, SPELL_REWARD_ACHIEVEMENT, true);
JumpToNextStep(5500);
break;
case 30:
- if (instance)
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
- temp->AI()->Talk(SAY_EVENT_END_03_ABED);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
+ temp->AI()->Talk(SAY_EVENT_END_03_ABED);
JumpToNextStep(8500);
break;
case 31:
@@ -607,29 +587,26 @@ public:
JumpToNextStep(11500);
break;
case 32:
- if (instance)
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
- temp->AI()->Talk(SAY_EVENT_END_05_ABED);
- JumpToNextStep(11500);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
+ temp->AI()->Talk(SAY_EVENT_END_05_ABED);
+ JumpToNextStep(11500);
break;
case 33:
Talk(SAY_EVENT_END_06);
JumpToNextStep(4500);
break;
case 34:
- if (instance)
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
- temp->AI()->Talk(SAY_EVENT_END_07_ABED);
- JumpToNextStep(22500);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
+ temp->AI()->Talk(SAY_EVENT_END_07_ABED);
+ JumpToNextStep(22500);
break;
case 35:
Talk(SAY_EVENT_END_08);
JumpToNextStep(7500);
break;
case 36:
- if (instance)
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
- temp->AI()->Talk(SAY_EVENT_END_09_KADD);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
+ temp->AI()->Talk(SAY_EVENT_END_09_KADD);
JumpToNextStep(18500);
break;
case 37:
@@ -637,19 +614,17 @@ public:
JumpToNextStep(5500);
break;
case 38:
- if (instance)
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
- temp->AI()->Talk(SAY_EVENT_END_11_KADD);
- JumpToNextStep(20500);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
+ temp->AI()->Talk(SAY_EVENT_END_11_KADD);
+ JumpToNextStep(20500);
break;
case 39:
Talk(SAY_EVENT_END_12);
JumpToNextStep(2500);
break;
case 40:
- if (instance)
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
- temp->AI()->Talk(SAY_EVENT_END_13_KADD);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_KADDRAK)))
+ temp->AI()->Talk(SAY_EVENT_END_13_KADD);
JumpToNextStep(19500);
break;
case 41:
@@ -657,50 +632,43 @@ public:
JumpToNextStep(10500);
break;
case 42:
- if (instance)
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
- temp->AI()->Talk(SAY_EVENT_END_15_MARN);
- JumpToNextStep(6500);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
+ temp->AI()->Talk(SAY_EVENT_END_15_MARN);
+ JumpToNextStep(6500);
break;
case 43:
Talk(SAY_EVENT_END_16);
JumpToNextStep(6500);
break;
case 44:
- if (instance)
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
- temp->AI()->Talk(SAY_EVENT_END_17_MARN);
- JumpToNextStep(25500);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
+ temp->AI()->Talk(SAY_EVENT_END_17_MARN);
+ JumpToNextStep(25500);
break;
case 45:
Talk(SAY_EVENT_END_18);
JumpToNextStep(23500);
break;
case 46:
- if (instance)
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
- temp->AI()->Talk(SAY_EVENT_END_19_MARN);
- JumpToNextStep(3500);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_MARNAK)))
+ temp->AI()->Talk(SAY_EVENT_END_19_MARN);
+ JumpToNextStep(3500);
break;
case 47:
Talk(SAY_EVENT_END_20);
JumpToNextStep(8500);
break;
case 48:
- if (instance)
- if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
- temp->AI()->Talk(SAY_EVENT_END_21_ABED);
- JumpToNextStep(5500);
+ if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ABEDNEUM)))
+ temp->AI()->Talk(SAY_EVENT_END_21_ABED);
+ JumpToNextStep(5500);
break;
case 49:
{
- if (instance)
- {
- instance->HandleGameObject(instance->GetData64(DATA_GO_KADDRAK), false);
- instance->HandleGameObject(instance->GetData64(DATA_GO_MARNAK), false);
- instance->HandleGameObject(instance->GetData64(DATA_GO_ABEDNEUM), false);
- instance->HandleGameObject(instance->GetData64(DATA_GO_SKY_FLOOR), false);
- }
+ instance->HandleGameObject(instance->GetData64(DATA_GO_KADDRAK), false);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_MARNAK), false);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_ABEDNEUM), false);
+ instance->HandleGameObject(instance->GetData64(DATA_GO_SKY_FLOOR), false);
Player* player = GetPlayerForEscort();
if (player)
player->GroupEventHappens(QUEST_HALLS_OF_STONE, me);
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 b8af76bba20..3690557d91b 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 552e0661568..9f0bb3c87c1 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
index aa3c034da6e..a8f933431c3 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp
index cf33906d6f1..9b417690f46 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp
index e2a8ab25cac..a809eb4ddff 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -315,7 +315,7 @@ class npc_auriaya_seeping_trigger : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_auriaya_seeping_triggerAI(creature);
+ return GetInstanceAI<npc_auriaya_seeping_triggerAI>(creature);
}
};
@@ -390,7 +390,7 @@ class npc_sanctum_sentry : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_sanctum_sentryAI(creature);
+ return GetInstanceAI<npc_sanctum_sentryAI>(creature);
}
};
@@ -466,7 +466,7 @@ class npc_feral_defender : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_feral_defenderAI(creature);
+ return GetInstanceAI<npc_feral_defenderAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
index 554556e4084..779adf67211 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -619,7 +619,7 @@ class boss_flame_leviathan_seat : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_flame_leviathan_seatAI(creature);
+ return GetInstanceAI<boss_flame_leviathan_seatAI>(creature);
}
};
@@ -898,7 +898,7 @@ class npc_colossus : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_colossusAI(creature);
+ return GetInstanceAI<npc_colossusAI>(creature);
}
};
@@ -1530,7 +1530,7 @@ class spell_auto_repair : public SpellScriptLoader
if (!driver)
return;
- driver->MonsterTextEmote(EMOTE_REPAIR, driver->GetGUID(), true);
+ driver->MonsterTextEmote(EMOTE_REPAIR, driver, true);
InstanceScript* instance = driver->GetInstanceScript();
if (!instance)
@@ -1690,9 +1690,9 @@ class spell_pursue : public SpellScriptLoader
for (SeatMap::const_iterator itr = caster->GetVehicleKit()->Seats.begin(); itr != caster->GetVehicleKit()->Seats.end(); ++itr)
{
- if (IS_PLAYER_GUID(itr->second.Passenger.Guid))
+ if (Player* passenger = ObjectAccessor::GetPlayer(*caster, itr->second.Passenger.Guid))
{
- caster->AI()->Talk(EMOTE_PURSUE, itr->second.Passenger.Guid);
+ caster->AI()->Talk(EMOTE_PURSUE, passenger);
return;
}
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
index 549d496f19d..64ee385b7fc 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -433,7 +433,7 @@ class boss_freya : public CreatureScript
case EVENT_STRENGTHENED_IRON_ROOTS:
Talk(EMOTE_IRON_ROOTS);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_ROOTS_FREYA))
- target->CastSpell(target, SPELL_ROOTS_FREYA, true); // This must be casted by Target self
+ target->CastSpell(target, SPELL_ROOTS_FREYA, true); // This must be cast by Target self
events.ScheduleEvent(EVENT_STRENGTHENED_IRON_ROOTS, urand(12000, 20000));
break;
case EVENT_GROUND_TREMOR:
@@ -1146,7 +1146,7 @@ class npc_ancient_water_spirit : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ancient_water_spiritAI(creature);
+ return GetInstanceAI<npc_ancient_water_spiritAI>(creature);
}
};
@@ -1213,7 +1213,7 @@ class npc_storm_lasher : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_storm_lasherAI(creature);
+ return GetInstanceAI<npc_storm_lasherAI>(creature);
}
};
@@ -1258,7 +1258,7 @@ class npc_snaplasher : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_snaplasherAI(creature);
+ return GetInstanceAI<npc_snaplasherAI>(creature);
}
};
@@ -1522,7 +1522,7 @@ class npc_unstable_sun_beam : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_unstable_sun_beamAI(creature);
+ return GetInstanceAI<npc_unstable_sun_beamAI>(creature);
}
};
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 46776ae9b96..446075f76e5 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -369,7 +369,7 @@ class boss_saronite_animus : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_saronite_animusAI(creature);
+ return GetInstanceAI<boss_saronite_animusAI>(creature);
}
};
@@ -439,7 +439,7 @@ class npc_saronite_vapors : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_saronite_vaporsAI(creature);
+ return GetInstanceAI<npc_saronite_vaporsAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
index 2fb165b935e..480c04c3254 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -235,7 +235,7 @@ class npc_flash_freeze : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_flash_freezeAI(creature);
+ return GetInstanceAI<npc_flash_freezeAI>(creature);
}
};
@@ -296,7 +296,7 @@ class npc_ice_block : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ice_blockAI(creature);
+ return GetInstanceAI<npc_ice_blockAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
index 45c35741c3c..4b1572447d4 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
index ec2cf36822d..26886719ec8 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
index 6783d8cd428..f58ed4e83e5 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
index 31c635c7de5..862ee2c786b 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -300,7 +300,7 @@ class boss_razorscale_controller : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_razorscale_controllerAI(creature);
+ return GetInstanceAI<boss_razorscale_controllerAI>(creature);
}
};
@@ -735,7 +735,7 @@ class npc_expedition_commander : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_expedition_commanderAI(creature);
+ return GetInstanceAI<npc_expedition_commanderAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp
index c14cab88d76..73b644f3021 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
index 12925f1c6e1..ee87e3e9732 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -218,9 +218,6 @@ class boss_xt002 : public CreatureScript
_phase = 1;
_heartExposed = 0;
- if (!instance)
- return;
-
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_MUST_DECONSTRUCT_FASTER);
}
@@ -232,12 +229,9 @@ class boss_xt002 : public CreatureScript
events.ScheduleEvent(EVENT_ENRAGE, TIMER_ENRAGE);
events.ScheduleEvent(EVENT_GRAVITY_BOMB, TIMER_GRAVITY_BOMB);
events.ScheduleEvent(EVENT_SEARING_LIGHT, TIMER_SEARING_LIGHT);
- //Tantrum is casted a bit slower the first time.
+ //Tantrum is cast a bit slower the first time.
events.ScheduleEvent(EVENT_TYMPANIC_TANTRUM, urand(TIMER_TYMPANIC_TANTRUM_MIN, TIMER_TYMPANIC_TANTRUM_MAX) * 2);
- if (!instance)
- return;
-
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_MUST_DECONSTRUCT_FASTER);
}
@@ -477,7 +471,7 @@ class npc_xt002_heart : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_xt002_heartAI(creature);
+ return GetInstanceAI<npc_xt002_heartAI>(creature);
}
};
@@ -493,7 +487,7 @@ class npc_scrapbot : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_scrapbotAI(creature);
+ return GetInstanceAI<npc_scrapbotAI>(creature);
}
struct npc_scrapbotAI : public ScriptedAI
@@ -550,7 +544,7 @@ class npc_pummeller : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_pummellerAI(creature);
+ return GetInstanceAI<npc_pummellerAI>(creature);
}
struct npc_pummellerAI : public ScriptedAI
@@ -652,7 +646,7 @@ class npc_boombot : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_boombotAI(creature);
+ return GetInstanceAI<npc_boombotAI>(creature);
}
struct npc_boombotAI : public ScriptedAI
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 4ba6d948f1a..5e44d97299e 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -108,7 +108,7 @@ enum Spells
SPELL_SANITY = 63050,
SPELL_INSANE_PERIODIC = 64554,
SPELL_INSANE = 63120,
- //SPELL_CLEAR_INSANE = 63122, // when it should be casted?
+ //SPELL_CLEAR_INSANE = 63122, // when should it be cast?
SPELL_CONSTRICTOR_TENTACLE = 64132,
SPELL_CRUSHER_TENTACLE_SUMMON = 64139,
SPELL_CORRUPTOR_TENTACLE_SUMMON = 64143,
@@ -452,7 +452,7 @@ class boss_voice_of_yogg_saron : public CreatureScript
if (Player* player = itr->GetSource())
{
if (events.IsInPhase(PHASE_ONE))
- Talk(WHISPER_VOICE_PHASE_1_WIPE, player->GetGUID());
+ Talk(WHISPER_VOICE_PHASE_1_WIPE, player);
player->RemoveAurasDueToSpell(SPELL_SANITY);
player->RemoveAurasDueToSpell(SPELL_INSANE);
@@ -531,7 +531,7 @@ class boss_voice_of_yogg_saron : public CreatureScript
case EVENT_EXTINGUISH_ALL_LIFE:
if (Creature* yogg = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_YOGG_SARON)))
{
- yogg->AI()->Talk(EMOTE_YOGG_SARON_EXTINGUISH_ALL_LIFE, me->GetGUID());
+ yogg->AI()->Talk(EMOTE_YOGG_SARON_EXTINGUISH_ALL_LIFE, me);
yogg->CastSpell((Unit*)NULL, SPELL_EXTINGUISH_ALL_LIFE, true);
}
events.ScheduleEvent(EVENT_EXTINGUISH_ALL_LIFE, 10000); // cast it again after a short while, players can survive
@@ -799,7 +799,7 @@ class boss_sara : public CreatureScript
DoCast(yogg, SPELL_RIDE_YOGG_SARON_VEHICLE);
DoCast(me, SPELL_SHADOWY_BARRIER_SARA);
_events.SetPhase(PHASE_TWO);
- _events.ScheduleEvent(EVENT_DEATH_RAY, 20000, 0, PHASE_TWO); // almost never casted at scheduled time, why?
+ _events.ScheduleEvent(EVENT_DEATH_RAY, 20000, 0, PHASE_TWO); // almost never cast at scheduled time, why?
_events.ScheduleEvent(EVENT_MALADY_OF_THE_MIND, 18000, 0, PHASE_TWO);
_events.ScheduleEvent(EVENT_PSYCHOSIS, 1, 0, PHASE_TWO);
_events.ScheduleEvent(EVENT_BRAIN_LINK, 23000, 0, PHASE_TWO);
@@ -1071,7 +1071,7 @@ class boss_brain_of_yogg_saron : public CreatureScript
uint8 illusion = _instance->GetData(DATA_ILLUSION);
if (++_tentaclesKilled >= (illusion == ICECROWN_ILLUSION ? 9 : 8))
{
- sCreatureTextMgr->SendChat(me, EMOTE_BRAIN_ILLUSION_SHATTERED, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_AREA);
+ sCreatureTextMgr->SendChat(me, EMOTE_BRAIN_ILLUSION_SHATTERED, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_AREA);
_summons.DespawnAll();
DoCastAOE(SPELL_SHATTERED_ILLUSION, true);
_instance->HandleGameObject(_instance->GetData64(GO_BRAIN_ROOM_DOOR_1 + illusion), true);
@@ -1524,8 +1524,8 @@ class npc_observation_ring_keeper : public CreatureScript
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->DespawnOrUnsummon(2000);
DoCast(SPELL_TELEPORT);
- Talk(SAY_KEEPER_CHOSEN_1, player->GetGUID());
- Talk(SAY_KEEPER_CHOSEN_2, player->GetGUID());
+ Talk(SAY_KEEPER_CHOSEN_1, player);
+ Talk(SAY_KEEPER_CHOSEN_2, player);
switch (me->GetEntry())
{
@@ -2234,7 +2234,7 @@ class spell_yogg_saron_boil_ominously : public SpellScriptLoader // 63030
if (!target->HasAura(SPELL_FLASH_FREEZE) && !GetCaster()->HasAura(SPELL_SUMMON_GUARDIAN_1) && !GetCaster()->HasAura(SPELL_SUMMON_GUARDIAN_2))
{
if (Creature* caster = GetCaster()->ToCreature())
- caster->AI()->Talk(EMOTE_OMINOUS_CLOUD_PLAYER_TOUCH, target->GetGUID());
+ caster->AI()->Talk(EMOTE_OMINOUS_CLOUD_PLAYER_TOUCH, target);
GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_GUARDIAN_1, true);
}
@@ -2905,7 +2905,7 @@ class spell_yogg_saron_insane : public SpellScriptLoader // 63120
{
if (Unit* caster = GetCaster())
if (Creature* yogg = caster->ToCreature())
- yogg->AI()->Talk(WHISPER_VOICE_INSANE, GetTarget()->GetGUID());
+ yogg->AI()->Talk(WHISPER_VOICE_INSANE, GetTarget());
GetTarget()->CastSpell(GetTarget(), SPELL_INSANE_VISUAL, true);
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
index d0cb7108c09..d0a25d2b216 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h
index 45134cd9ff6..3544ff3c079 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp
index 0daa9ea16c6..e3e588be076 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
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 30174996a42..cc37dde57dd 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp
index 75aa2994dbc..1bcbc63a8ab 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -194,7 +194,7 @@ class boss_keleseth : public CreatureScript
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_FROST_TOMB))
{
Talk(SAY_FROST_TOMB);
- Talk(SAY_FROST_TOMB_EMOTE, target->GetGUID());
+ Talk(SAY_FROST_TOMB_EMOTE, target);
DoCast(target, SPELL_FROST_TOMB_STUN, true);
// checked from sniffs - the player casts the spell
@@ -212,7 +212,7 @@ class boss_keleseth : public CreatureScript
void SummonSkeletons()
{
- // I could not found any spell casted for this
+ // I could not found any spell cast for this
for (uint8 i = 0; i < 4; ++i)
me->SummonCreature(NPC_SKELETON, SkeletonSpawnPoint[0][0], SkeletonSpawnPoint[0][1], SKELETONSPAWN_Z, 0);
}
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp
index 5247f9019da..76ae2a1d374 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -358,7 +358,7 @@ class boss_dalronn_the_controller : public CreatureScript
if (ShadowBolt_Timer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
DoCast(target, SPELL_SHADOW_BOLT);
@@ -370,7 +370,7 @@ class boss_dalronn_the_controller : public CreatureScript
if (Debilitate_Timer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
DoCast(target, SPELL_DEBILITATE);
@@ -384,7 +384,7 @@ class boss_dalronn_the_controller : public CreatureScript
{
if (Summon_Timer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
DoCast(me, H_SPELL_SUMMON_SKELETONS);
Summon_Timer = (rand()%10000) + 20000;
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 c4e7416f855..763dcda24e1 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp
index 84d6ee1734b..0ad12a15092 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h
index 873c5d634fa..240cb8c65db 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
index 77c19422da0..7c42f75b72f 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -193,9 +193,10 @@ public:
//Talk(SAY_DEATH);
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_SLAY);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_SLAY);
}
void DoAction(int32 actionId) OVERRIDE
@@ -255,7 +256,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ravenous_furbolgAI(creature);
+ return GetInstanceAI<npc_ravenous_furbolgAI>(creature);
}
struct npc_ravenous_furbolgAI : public ScriptedAI
@@ -363,7 +364,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_frenzied_worgenAI(creature);
+ return GetInstanceAI<npc_frenzied_worgenAI>(creature);
}
struct npc_frenzied_worgenAI : public ScriptedAI
@@ -437,8 +438,7 @@ public:
who->SetInCombatWith(me);
DoStartMovement(who);
}
- if (instance)
- instance->SetBossState(DATA_GORTOK_PALEHOOF, IN_PROGRESS);
+ instance->SetBossState(DATA_GORTOK_PALEHOOF, IN_PROGRESS);
}
void JustDied(Unit* /*killer*/) OVERRIDE
@@ -474,7 +474,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ferocious_rhinoAI(creature);
+ return GetInstanceAI<npc_ferocious_rhinoAI>(creature);
}
struct npc_ferocious_rhinoAI : public ScriptedAI
@@ -589,7 +589,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_massive_jormungarAI(creature);
+ return GetInstanceAI<npc_massive_jormungarAI>(creature);
}
struct npc_massive_jormungarAI : public ScriptedAI
@@ -690,7 +690,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_palehoof_orbAI(creature);
+ return GetInstanceAI<npc_palehoof_orbAI>(creature);
}
struct npc_palehoof_orbAI : public ScriptedAI
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
index 01fcd9a665d..b6438008dde 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -133,7 +133,7 @@ enum Spells
{
// Skadi Spells
SPELL_CRUSH = 50234,
- SPELL_POISONED_SPEAR = 50225, //isn't being casted =/
+ SPELL_POISONED_SPEAR = 50225, //isn't being cast
SPELL_WHIRLWIND = 50228, //random target, but not the tank approx. every 20s
SPELL_RAPID_FIRE = 56570,
SPELL_HARPOON_DAMAGE = 56578,
@@ -162,7 +162,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_skadiAI(creature);
+ return GetInstanceAI<boss_skadiAI>(creature);
}
struct boss_skadiAI : public ScriptedAI
@@ -208,11 +208,8 @@ public:
me->SetSpeed(MOVE_FLIGHT, 3.0f);
if ((Unit::GetCreature(*me, m_uiGraufGUID) == NULL) && !me->IsMounted())
me->SummonCreature(NPC_GRAUF, Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 3.0f);
- if (instance)
- {
- instance->SetBossState(DATA_SKADI_THE_RUTHLESS, NOT_STARTED);
- instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
- }
+ instance->SetBossState(DATA_SKADI_THE_RUTHLESS, NOT_STARTED);
+ instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
void JustReachedHome() OVERRIDE
@@ -235,15 +232,12 @@ public:
m_uiMovementTimer = 1000;
m_uiSummonTimer = 10000;
me->SetInCombatWithZone();
- if (instance)
- {
- instance->SetBossState(DATA_SKADI_THE_RUTHLESS, IN_PROGRESS);
- instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
- me->GetMotionMaster()->MoveJump(Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 5.0f, 10.0f);
- me->SetWalk(false);
- m_uiMountTimer = 1000;
- Summons.DespawnEntry(NPC_GRAUF);
- }
+ instance->SetBossState(DATA_SKADI_THE_RUTHLESS, IN_PROGRESS);
+ instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
+ me->GetMotionMaster()->MoveJump(Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 5.0f, 10.0f);
+ me->SetWalk(false);
+ m_uiMountTimer = 1000;
+ Summons.DespawnEntry(NPC_GRAUF);
}
void JustSummoned(Creature* summoned) OVERRIDE
@@ -411,13 +405,13 @@ public:
{
Talk(SAY_DEATH);
Summons.DespawnAll();
- if (instance)
- instance->SetBossState(DATA_SKADI_THE_RUTHLESS, DONE);
+ instance->SetBossState(DATA_SKADI_THE_RUTHLESS, DONE);
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_KILL);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_KILL);
}
void SpawnMobs()
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
index d518747a462..2a24b1145c0 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -81,15 +81,40 @@ enum Creatures
NPC_SCOURGE_HULK = 26555
};
-enum SvalaPhase
+enum Phases
{
- IDLE,
+ IDLE = 1,
INTRO,
NORMAL,
SACRIFICING,
SVALADEAD
};
+enum Events
+{
+ //INTRO
+ EVENT_INTRO_SVALA_TALK_0 = 1,
+ EVENT_INTRO_ARTHAS_TALK_0,
+ EVENT_INTRO_TRANSFORM_0,
+ EVENT_INTRO_TRANSFORM_1,
+ EVENT_INTRO_TRANSFORM_2,
+ EVENT_INTRO_SVALA_TALK_1,
+ EVENT_INTRO_ARTHAS_TALK_1,
+ EVENT_INTRO_SVALA_TALK_2,
+ EVENT_INTRO_RELOCATE_SVALA,
+ EVENT_INTRO_DESPAWN_ARTHAS,
+
+ //NORMAL
+ EVENT_SINISTER_STRIKE,
+ EVENT_CALL_FLAMES,
+ EVENT_RITUAL_PREPARATION,
+
+ //SACRIFICING
+ EVENT_SPAWN_RITUAL_CHANNELERS,
+ EVENT_RITUAL_STRIKE,
+ EVENT_RITUAL_DISARM
+};
+
enum Misc
{
DATA_INCREDIBLE_HULK = 2043
@@ -112,38 +137,23 @@ class boss_svala : public CreatureScript
{
boss_svalaAI(Creature* creature) : BossAI(creature, DATA_SVALA_SORROWGRAVE)
{
- Phase = IDLE;
+ _introCompleted = false;
}
- SvalaPhase Phase;
-
- uint32 introTimer;
- uint8 introPhase;
- uint8 sacrePhase;
-
- uint64 arthasGUID;
-
- uint32 sinsterStrikeTimer;
- uint32 callFlamesTimer;
- uint32 sacrificeTimer;
-
- bool sacrificed;
-
void Reset() OVERRIDE
{
_Reset();
- sacrificed = false;
+ _sacrificed = false;
SetCombatMovement(true);
- if (Phase > NORMAL)
- Phase = NORMAL;
+ if (_introCompleted)
+ events.SetPhase(NORMAL);
+ else
+ events.SetPhase(IDLE);
- me->SetDisableGravity(Phase == NORMAL);
+ me->SetDisableGravity(events.IsInPhase(NORMAL));
- introTimer = 1 * IN_MILLISECONDS;
- introPhase = 0;
- sacrePhase = 0;
- arthasGUID = 0;
+ _arthasGUID = 0;
instance->SetData64(DATA_SACRIFICED_PLAYER, 0);
}
@@ -152,16 +162,12 @@ class boss_svala : public CreatureScript
{
_EnterCombat();
Talk(SAY_AGGRO);
-
- sinsterStrikeTimer = 7 * IN_MILLISECONDS;
- callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
}
void JustSummoned(Creature* summon) OVERRIDE
{
if (summon->GetEntry() == NPC_RITUAL_CHANNELER)
summon->CastSpell(summon, SPELL_SUMMONED_VIS, true);
-
summons.Summon(summon);
}
@@ -170,9 +176,9 @@ class boss_svala : public CreatureScript
if (!who)
return;
- if (Phase == IDLE && me->IsValidAttackTarget(who) && me->IsWithinDistInMap(who, 40))
+ if (events.IsInPhase(IDLE) && me->IsValidAttackTarget(who) && me->IsWithinDistInMap(who, 40))
{
- Phase = INTRO;
+ events.SetPhase(INTRO);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (GameObject* mirror = ObjectAccessor::GetGameObject(*me, DATA_UTGARDE_MIRROR))
@@ -181,8 +187,9 @@ class boss_svala : public CreatureScript
if (Creature* arthas = me->SummonCreature(NPC_ARTHAS, ArthasPos, TEMPSUMMON_MANUAL_DESPAWN))
{
arthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
- arthasGUID = arthas->GetGUID();
+ _arthasGUID = arthas->GetGUID();
}
+ events.ScheduleEvent(EVENT_INTRO_SVALA_TALK_0, 1 * IN_MILLISECONDS, 0, INTRO);
}
}
@@ -194,20 +201,20 @@ class boss_svala : public CreatureScript
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (Phase == SACRIFICING)
+ if (events.IsInPhase(SACRIFICING))
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
-
me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH);
-
_JustDied();
Talk(SAY_DEATH);
}
void SpellHitTarget(Unit* /*target*/, SpellInfo const* spellInfo) OVERRIDE
{
- if (spellInfo->Id == SPELL_RITUAL_STRIKE_EFF_1 && Phase != NORMAL && Phase != SVALADEAD)
+ if (spellInfo->Id == SPELL_RITUAL_STRIKE_EFF_1 && !events.IsInPhase(NORMAL) && !events.IsInPhase(SVALADEAD))
{
- Phase = NORMAL;
+ events.SetPhase(NORMAL);
+ events.ScheduleEvent(EVENT_SINISTER_STRIKE, 7 * IN_MILLISECONDS, 0, NORMAL);
+ events.ScheduleEvent(EVENT_CALL_FLAMES, urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS), 0, NORMAL);
SetCombatMovement(true);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 300.0f, true))
@@ -217,199 +224,163 @@ class boss_svala : public CreatureScript
void UpdateAI(uint32 diff) OVERRIDE
{
- if (Phase == IDLE)
+ if (events.IsInPhase(IDLE))
+ return;
+
+ if (events.IsInPhase(NORMAL) && !UpdateVictim())
return;
- if (Phase == INTRO)
+ events.Update(diff);
+
+ if (!_sacrificed && HealthBelowPct(50))
{
- if (introTimer <= diff)
- {
- Creature* arthas = ObjectAccessor::GetCreature(*me, arthasGUID);
- if (!arthas)
- return;
+ _sacrificed = true;
+ events.SetPhase(SACRIFICING);
+ events.ScheduleEvent(EVENT_RITUAL_PREPARATION, 0, 0, SACRIFICING);
+ }
- switch (introPhase)
- {
- case 0:
- Talk(SAY_SVALA_INTRO_0);
- ++introPhase;
- introTimer = 8100;
- break;
- case 1:
+ if (events.IsInPhase(NORMAL))
+ DoMeleeAttackIfReady();
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_INTRO_SVALA_TALK_0:
+ Talk(SAY_SVALA_INTRO_0);
+ events.ScheduleEvent(EVENT_INTRO_ARTHAS_TALK_0, 8.1 * IN_MILLISECONDS, 0, INTRO);
+ break;
+ case EVENT_INTRO_ARTHAS_TALK_0:
+ if (Creature* arthas = ObjectAccessor::GetCreature(*me, _arthasGUID))
arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_1);
- ++introPhase;
- introTimer = 10000;
- break;
- case 2:
+ events.ScheduleEvent(EVENT_INTRO_TRANSFORM_0, 10 * IN_MILLISECONDS, 0, INTRO);
+ break;
+ case EVENT_INTRO_TRANSFORM_0:
+ {
+ if (Creature* arthas = ObjectAccessor::GetCreature(*me, _arthasGUID))
+ arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, true);
+ Position pos;
+ pos.Relocate(me);
+ pos.m_positionZ += 8.0f;
+ me->GetMotionMaster()->MoveTakeoff(0, pos);
+ // spectators flee event
+ std::list<Creature*> lspectatorList;
+ GetCreatureListWithEntryInGrid(lspectatorList, me, NPC_SPECTATOR, 100.0f);
+ for (std::list<Creature*>::iterator itr = lspectatorList.begin(); itr != lspectatorList.end(); ++itr)
{
- arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, false);
- Position pos;
- pos.Relocate(me);
- pos.m_positionZ += 8.0f;
- me->GetMotionMaster()->MoveTakeoff(0, pos);
- // spectators flee event
- std::list<Creature*> lspectatorList;
- GetCreatureListWithEntryInGrid(lspectatorList, me, NPC_SPECTATOR, 100.0f);
- for (std::list<Creature*>::iterator itr = lspectatorList.begin(); itr != lspectatorList.end(); ++itr)
+ if ((*itr)->IsAlive())
{
- if ((*itr)->IsAlive())
- {
- (*itr)->SetStandState(UNIT_STAND_STATE_STAND);
- (*itr)->SetWalk(false);
- (*itr)->GetMotionMaster()->MovePoint(1, spectatorWP[0]);
- }
+ (*itr)->SetStandState(UNIT_STAND_STATE_STAND);
+ (*itr)->SetWalk(false);
+ (*itr)->GetMotionMaster()->MovePoint(1, spectatorWP[0]);
}
-
- ++introPhase;
- introTimer = 4200;
- break;
}
- case 3:
- me->CastSpell(me, SPELL_SVALA_TRANSFORMING1, false);
- ++introPhase;
- introTimer = 6200;
- break;
- case 4:
- me->CastSpell(me, SPELL_SVALA_TRANSFORMING2, false);
+ events.ScheduleEvent(EVENT_INTRO_TRANSFORM_1, 4.2 * IN_MILLISECONDS, 0, INTRO);
+ break;
+ }
+ case EVENT_INTRO_TRANSFORM_1:
+ me->CastSpell(me, SPELL_SVALA_TRANSFORMING1, false);
+ events.ScheduleEvent(EVENT_INTRO_TRANSFORM_2, 6.2 * IN_MILLISECONDS, 0, INTRO);
+ break;
+ case EVENT_INTRO_TRANSFORM_2:
+ me->CastSpell(me, SPELL_SVALA_TRANSFORMING2, false);
+ if (Creature* arthas = ObjectAccessor::GetCreature(*me, _arthasGUID))
+ {
arthas->InterruptNonMeleeSpells(true);
- me->RemoveAllAuras();
- me->UpdateEntry(NPC_SVALA_SORROWGRAVE);
me->SetFacingToObject(arthas);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- ++introPhase;
- introTimer = 3200;
- break;
- case 5:
- Talk(SAY_SVALA_INTRO_1);
- ++introPhase;
- introTimer = 10000;
- break;
- case 6:
+ }
+ me->RemoveAllAuras();
+ me->UpdateEntry(NPC_SVALA_SORROWGRAVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ events.ScheduleEvent(EVENT_INTRO_SVALA_TALK_1, 10 * IN_MILLISECONDS, 0, INTRO);
+ break;
+ case EVENT_INTRO_SVALA_TALK_1:
+ Talk(SAY_SVALA_INTRO_1);
+ events.ScheduleEvent(EVENT_INTRO_ARTHAS_TALK_1, 3.2 * IN_MILLISECONDS, 0, INTRO);
+ break;
+ case EVENT_INTRO_ARTHAS_TALK_1:
+ if (Creature* arthas = ObjectAccessor::GetCreature(*me, _arthasGUID))
arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_2);
- ++introPhase;
- introTimer = 7200;
- break;
- case 7:
- Talk(SAY_SVALA_INTRO_2);
- me->SetFacingTo(1.58f);
+ events.ScheduleEvent(EVENT_INTRO_SVALA_TALK_2, 7.2 * IN_MILLISECONDS, 0, INTRO);
+ break;
+ case EVENT_INTRO_SVALA_TALK_2:
+ Talk(SAY_SVALA_INTRO_2);
+ me->SetFacingTo(1.58f);
+ if (Creature* arthas = ObjectAccessor::GetCreature(*me, _arthasGUID))
arthas->SetVisible(false);
- ++introPhase;
- introTimer = 13800;
- break;
- case 8:
- {
- Position pos;
- pos.Relocate(me);
- pos.m_positionX = me->GetHomePosition().GetPositionX();
- pos.m_positionY = me->GetHomePosition().GetPositionY();
- pos.m_positionZ = 90.6065f;
- me->GetMotionMaster()->MoveLand(0, pos);
- me->SetDisableGravity(false, true);
- me->SetHover(true);
- ++introPhase;
- introTimer = 3000;
- break;
- }
- case 9:
- if (GameObject* mirror = ObjectAccessor::GetGameObject(*me, DATA_UTGARDE_MIRROR))
- mirror->SetGoState(GO_STATE_ACTIVE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- arthas->DespawnOrUnsummon();
- arthasGUID = 0;
- Phase = NORMAL;
- break;
- }
- }
- else
- introTimer -= diff;
-
- return;
- }
-
- if (Phase == NORMAL)
- {
- if (!UpdateVictim())
- return;
-
- if (sinsterStrikeTimer <= diff)
- {
- DoCastVictim(SPELL_SINSTER_STRIKE);
- sinsterStrikeTimer = urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS);
- }
- else
- sinsterStrikeTimer -= diff;
-
- if (callFlamesTimer <= diff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
+ events.ScheduleEvent(EVENT_INTRO_RELOCATE_SVALA, 13.8 * IN_MILLISECONDS, 0, INTRO);
+ break;
+ case EVENT_INTRO_RELOCATE_SVALA:
{
- DoCast(target, SPELL_CALL_FLAMES);
- callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
+ Position pos;
+ pos.Relocate(me);
+ pos.m_positionX = me->GetHomePosition().GetPositionX();
+ pos.m_positionY = me->GetHomePosition().GetPositionY();
+ pos.m_positionZ = 90.6065f;
+ me->GetMotionMaster()->MoveLand(0, pos);
+ me->SetDisableGravity(false, true);
+ me->SetHover(true);
+ events.ScheduleEvent(EVENT_INTRO_DESPAWN_ARTHAS, 3 * IN_MILLISECONDS, 0, INTRO);
+ break;
}
- }
- else
- callFlamesTimer -= diff;
-
- if (!sacrificed)
- {
- if (HealthBelowPct(50))
- {
+ case EVENT_INTRO_DESPAWN_ARTHAS:
+ if (GameObject* mirror = ObjectAccessor::GetGameObject(*me, DATA_UTGARDE_MIRROR))
+ mirror->SetGoState(GO_STATE_ACTIVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ if (Creature* arthas = ObjectAccessor::GetCreature(*me, _arthasGUID))
+ arthas->DespawnOrUnsummon();
+ _arthasGUID = 0;
+ events.SetPhase(NORMAL);
+ _introCompleted = true;
+ events.ScheduleEvent(EVENT_SINISTER_STRIKE, 7 * IN_MILLISECONDS, 0, NORMAL);
+ events.ScheduleEvent(EVENT_CALL_FLAMES, urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS), 0, NORMAL);
+ break;
+ case EVENT_SINISTER_STRIKE:
+ DoCastVictim(SPELL_SINSTER_STRIKE);
+ events.ScheduleEvent(EVENT_SINISTER_STRIKE, urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS), 0, NORMAL);
+ break;
+ case EVENT_CALL_FLAMES:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
+ DoCast(target, SPELL_CALL_FLAMES);
+ events.ScheduleEvent(EVENT_CALL_FLAMES, urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS), 0, NORMAL);
+ break;
+ case EVENT_RITUAL_PREPARATION:
if (Unit* sacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80.0f, true))
{
instance->SetData64(DATA_SACRIFICED_PLAYER, sacrificeTarget->GetGUID());
-
Talk(SAY_SACRIFICE_PLAYER);
-
DoCast(sacrificeTarget, SPELL_RITUAL_PREPARATION);
-
SetCombatMovement(false);
-
- Phase = SACRIFICING;
- sacrePhase = 0;
- sacrificeTimer = 1 * IN_MILLISECONDS;
-
DoCast(me, SPELL_RITUAL_OF_THE_SWORD);
- sacrificed = true;
}
- }
- }
-
- DoMeleeAttackIfReady();
- }
- else // SACRIFICING
- {
- if (sacrificeTimer <= diff)
- {
- switch (sacrePhase)
- {
- case 0:
- // spawn ritual channelers
- DoCast(me, SPELL_RITUAL_CHANNELER_1, true);
- DoCast(me, SPELL_RITUAL_CHANNELER_2, true);
- DoCast(me, SPELL_RITUAL_CHANNELER_3, true);
- ++sacrePhase;
- sacrificeTimer = 2 * IN_MILLISECONDS;
- break;
- case 1:
- me->StopMoving();
- me->GetMotionMaster()->MoveIdle();
- me->InterruptNonMeleeSpells(true);
- DoCast(me, SPELL_RITUAL_STRIKE_TRIGGER, true);
- ++sacrePhase;
- sacrificeTimer = 200;
- break;
- case 2:
- DoCast(me, SPELL_RITUAL_DISARM);
- ++sacrePhase;
- break;
- case 3:
- break;
- }
+ events.ScheduleEvent(EVENT_SPAWN_RITUAL_CHANNELERS, 1 * IN_MILLISECONDS, 0, SACRIFICING);
+ break;
+ case EVENT_SPAWN_RITUAL_CHANNELERS:
+ DoCast(me, SPELL_RITUAL_CHANNELER_1, true);
+ DoCast(me, SPELL_RITUAL_CHANNELER_2, true);
+ DoCast(me, SPELL_RITUAL_CHANNELER_3, true);
+ events.ScheduleEvent(EVENT_RITUAL_STRIKE, 2 * IN_MILLISECONDS, 0, SACRIFICING);
+ break;
+ case EVENT_RITUAL_STRIKE:
+ me->StopMoving();
+ me->GetMotionMaster()->MoveIdle();
+ me->InterruptNonMeleeSpells(true);
+ DoCast(me, SPELL_RITUAL_STRIKE_TRIGGER, true);
+ events.ScheduleEvent(EVENT_RITUAL_DISARM, 200, 0, SACRIFICING);
+ break;
+ case EVENT_RITUAL_DISARM:
+ DoCast(me, SPELL_RITUAL_DISARM);
+ break;
+ default:
+ break;
}
- else
- sacrificeTimer -= diff;
}
}
+
+ private:
+ uint64 _arthasGUID;
+ bool _sacrificed;
+ bool _introCompleted;
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
index f4c306c726a..ba1dd0fc42b 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 46fabe41086..5068abd0131 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h
index ddf1d1e512a..99acef0b2b3 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp
index 7d3d149f0ff..398a0308760 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp
+++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp
index 1ceddd4bd66..4dd3aa9916b 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp
+++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -268,7 +268,7 @@ class npc_tempest_minion : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_tempest_minionAI(creature);
+ return GetInstanceAI<npc_tempest_minionAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp
index ad65fcc83fd..9371068e231 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp
+++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp
index e8e54184cb3..ccb1b5ed7d8 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp
+++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -277,7 +277,7 @@ class npc_frozen_orb_stalker : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_frozen_orb_stalkerAI(creature);
+ return GetInstanceAI<npc_frozen_orb_stalkerAI>(creature);
}
};
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp
index c6e3894a722..59b097d98b6 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp
+++ b/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h b/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h
index 7b5258fc3fc..4a8d52ac306 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h
+++ b/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp
index 80ebc01debc..ec20489bfc2 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -50,7 +50,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_cyanigosaAI(creature);
+ return GetInstanceAI<boss_cyanigosaAI>(creature);
}
struct boss_cyanigosaAI : public ScriptedAI
@@ -75,16 +75,14 @@ public:
uiManaDestructionTimer = 30000;
uiTailSweepTimer = 20000;
uiUncontrollableEnergyTimer = 25000;
- if (instance)
- instance->SetData(DATA_CYANIGOSA_EVENT, NOT_STARTED);
+ instance->SetData(DATA_CYANIGOSA_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_CYANIGOSA_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_CYANIGOSA_EVENT, IN_PROGRESS);
}
void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { }
@@ -144,8 +142,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_CYANIGOSA_EVENT, DONE);
+ instance->SetData(DATA_CYANIGOSA_EVENT, DONE);
}
void KilledUnit(Unit* victim) OVERRIDE
diff --git a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
index 883ea8fa0c0..81edfd65d03 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -49,7 +49,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_erekemAI(creature);
+ return GetInstanceAI<boss_erekemAI>(creature);
}
struct boss_erekemAI : public ScriptedAI
@@ -74,13 +74,10 @@ public:
uiEarthShockTimer = urand(2000, 8000);
uiLightningBoltTimer = urand(5000, 10000);
uiEarthShieldTimer = 20000;
- if (instance)
- {
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- instance->SetData(DATA_1ST_BOSS_EVENT, NOT_STARTED);
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- instance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
- }
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
+ instance->SetData(DATA_1ST_BOSS_EVENT, NOT_STARTED);
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ instance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
if (Creature* pGuard1 = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_EREKEM_GUARD_1) : 0))
{
@@ -126,20 +123,17 @@ public:
Talk(SAY_AGGRO);
DoCast(me, SPELL_EARTH_SHIELD);
- if (instance)
- {
- if (GameObject* pDoor = instance->instance->GetGameObject(instance->GetData64(DATA_EREKEM_CELL)))
- if (pDoor->GetGoState() == GO_STATE_READY)
- {
- EnterEvadeMode();
- return;
- }
+ if (GameObject* pDoor = instance->instance->GetGameObject(instance->GetData64(DATA_EREKEM_CELL)))
+ if (pDoor->GetGoState() == GO_STATE_READY)
+ {
+ EnterEvadeMode();
+ return;
+ }
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- instance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- instance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
- }
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
+ instance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ instance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
}
void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { }
@@ -210,18 +204,15 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
{
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- {
- instance->SetData(DATA_1ST_BOSS_EVENT, DONE);
- instance->SetData(DATA_WAVE_COUNT, 7);
- }
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- {
- instance->SetData(DATA_2ND_BOSS_EVENT, DONE);
- instance->SetData(DATA_WAVE_COUNT, 13);
- }
+ instance->SetData(DATA_1ST_BOSS_EVENT, DONE);
+ instance->SetData(DATA_WAVE_COUNT, 7);
+ }
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ {
+ instance->SetData(DATA_2ND_BOSS_EVENT, DONE);
+ instance->SetData(DATA_WAVE_COUNT, 13);
}
}
@@ -266,7 +257,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_erekem_guardAI(creature);
+ return GetInstanceAI<npc_erekem_guardAI>(creature);
}
struct npc_erekem_guardAI : public ScriptedAI
diff --git a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp
index 4852b6cea07..7bdf8234087 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -78,7 +78,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_ichoronAI(creature);
+ return GetInstanceAI<boss_ichoronAI>(creature);
}
struct boss_ichoronAI : public ScriptedAI
@@ -110,13 +110,10 @@ public:
me->SetVisible(true);
DespawnWaterElements();
- if (instance)
- {
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- instance->SetData(DATA_1ST_BOSS_EVENT, NOT_STARTED);
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- instance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
- }
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
+ instance->SetData(DATA_1ST_BOSS_EVENT, NOT_STARTED);
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ instance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -125,19 +122,16 @@ public:
DoCast(me, SPELL_PROTECTIVE_BUBBLE);
- if (instance)
- {
- if (GameObject* pDoor = instance->instance->GetGameObject(instance->GetData64(DATA_ICHORON_CELL)))
- if (pDoor->GetGoState() == GO_STATE_READY)
- {
- EnterEvadeMode();
- return;
- }
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- instance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- instance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
- }
+ if (GameObject* pDoor = instance->instance->GetGameObject(instance->GetData64(DATA_ICHORON_CELL)))
+ if (pDoor->GetGoState() == GO_STATE_READY)
+ {
+ EnterEvadeMode();
+ return;
+ }
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
+ instance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ instance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
}
void AttackStart(Unit* who) OVERRIDE
@@ -289,18 +283,15 @@ public:
DespawnWaterElements();
- if (instance)
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
{
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- {
- instance->SetData(DATA_1ST_BOSS_EVENT, DONE);
- instance->SetData(DATA_WAVE_COUNT, 7);
- }
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- {
- instance->SetData(DATA_2ND_BOSS_EVENT, DONE);
- instance->SetData(DATA_WAVE_COUNT, 13);
- }
+ instance->SetData(DATA_1ST_BOSS_EVENT, DONE);
+ instance->SetData(DATA_WAVE_COUNT, 7);
+ }
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ {
+ instance->SetData(DATA_2ND_BOSS_EVENT, DONE);
+ instance->SetData(DATA_WAVE_COUNT, 13);
}
}
@@ -342,7 +333,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ichor_globuleAI(creature);
+ return GetInstanceAI<npc_ichor_globuleAI>(creature);
}
struct npc_ichor_globuleAI : public ScriptedAI
@@ -371,16 +362,13 @@ public:
{
if (uiRangeCheck_Timer < uiDiff)
{
- if (instance)
+ if (Creature* pIchoron = Unit::GetCreature(*me, instance->GetData64(DATA_ICHORON)))
{
- if (Creature* pIchoron = Unit::GetCreature(*me, instance->GetData64(DATA_ICHORON)))
+ if (me->IsWithinDist(pIchoron, 2.0f, false))
{
- if (me->IsWithinDist(pIchoron, 2.0f, false))
- {
- if (pIchoron->AI())
- pIchoron->AI()->DoAction(ACTION_WATER_ELEMENT_HIT);
- me->DespawnOrUnsummon();
- }
+ if (pIchoron->AI())
+ pIchoron->AI()->DoAction(ACTION_WATER_ELEMENT_HIT);
+ me->DespawnOrUnsummon();
}
}
uiRangeCheck_Timer = 1000;
diff --git a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp
index 964f6b75e72..ef0e6d900e7 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -37,7 +37,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_lavanthorAI(creature);
+ return GetInstanceAI<boss_lavanthorAI>(creature);
}
struct boss_lavanthorAI : public ScriptedAI
@@ -60,19 +60,14 @@ public:
uiFlameBreathTimer = 5000;
uiLavaBurnTimer = 10000;
uiCauterizingFlamesTimer = 3000;
- if (instance)
- {
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- instance->SetData(DATA_1ST_BOSS_EVENT, NOT_STARTED);
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- instance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
- }
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
+ instance->SetData(DATA_1ST_BOSS_EVENT, NOT_STARTED);
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ instance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- {
if (GameObject* pDoor = instance->instance->GetGameObject(instance->GetData64(DATA_LAVANTHOR_CELL)))
if (pDoor->GetGoState() == GO_STATE_READY)
{
@@ -83,7 +78,6 @@ public:
instance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
else if (instance->GetData(DATA_WAVE_COUNT) == 12)
instance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
- }
}
void AttackStart(Unit* who) OVERRIDE
@@ -141,18 +135,15 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
{
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- {
- instance->SetData(DATA_1ST_BOSS_EVENT, DONE);
- instance->SetData(DATA_WAVE_COUNT, 7);
- }
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- {
- instance->SetData(DATA_2ND_BOSS_EVENT, DONE);
- instance->SetData(DATA_WAVE_COUNT, 13);
- }
+ instance->SetData(DATA_1ST_BOSS_EVENT, DONE);
+ instance->SetData(DATA_WAVE_COUNT, 7);
+ }
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ {
+ instance->SetData(DATA_2ND_BOSS_EVENT, DONE);
+ instance->SetData(DATA_WAVE_COUNT, 13);
}
}
};
diff --git a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp
index d5dd41e7a90..5829adc7c86 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -33,7 +33,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_moraggAI(creature);
+ return GetInstanceAI<boss_moraggAI>(creature);
}
struct boss_moraggAI : public ScriptedAI
@@ -53,30 +53,24 @@ public:
uiOpticLinkTimer = 10000;
uiCorrosiveSalivaTimer = 5000;
- if (instance)
- {
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- instance->SetData(DATA_1ST_BOSS_EVENT, NOT_STARTED);
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- instance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
- }
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
+ instance->SetData(DATA_1ST_BOSS_EVENT, NOT_STARTED);
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ instance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- {
- if (GameObject* pDoor = instance->instance->GetGameObject(instance->GetData64(DATA_MORAGG_CELL)))
- if (pDoor->GetGoState() == GO_STATE_READY)
- {
- EnterEvadeMode();
- return;
- }
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- instance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- instance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
- }
+ if (GameObject* pDoor = instance->instance->GetGameObject(instance->GetData64(DATA_MORAGG_CELL)))
+ if (pDoor->GetGoState() == GO_STATE_READY)
+ {
+ EnterEvadeMode();
+ return;
+ }
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
+ instance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ instance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
}
void AttackStart(Unit* who) OVERRIDE
@@ -119,18 +113,15 @@ public:
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
{
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- {
- instance->SetData(DATA_1ST_BOSS_EVENT, DONE);
- instance->SetData(DATA_WAVE_COUNT, 7);
- }
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- {
- instance->SetData(DATA_2ND_BOSS_EVENT, DONE);
- instance->SetData(DATA_WAVE_COUNT, 13);
- }
+ instance->SetData(DATA_1ST_BOSS_EVENT, DONE);
+ instance->SetData(DATA_WAVE_COUNT, 7);
+ }
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ {
+ instance->SetData(DATA_2ND_BOSS_EVENT, DONE);
+ instance->SetData(DATA_WAVE_COUNT, 13);
}
}
};
diff --git a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp
index 8b39c48fb92..477be1ee56d 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -63,7 +63,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_xevozzAI(creature);
+ return GetInstanceAI<boss_xevozzAI>(creature);
}
struct boss_xevozzAI : public ScriptedAI
@@ -81,13 +81,10 @@ public:
void Reset() OVERRIDE
{
- if (instance)
- {
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- instance->SetData(DATA_1ST_BOSS_EVENT, NOT_STARTED);
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- instance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
- }
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
+ instance->SetData(DATA_1ST_BOSS_EVENT, NOT_STARTED);
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ instance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
uiSummonEtherealSphere_Timer = urand(10000, 12000);
uiArcaneBarrageVolley_Timer = urand(20000, 22000);
@@ -137,19 +134,16 @@ public:
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- {
- if (GameObject* pDoor = instance->instance->GetGameObject(instance->GetData64(DATA_XEVOZZ_CELL)))
- if (pDoor->GetGoState() == GO_STATE_READY)
- {
- EnterEvadeMode();
- return;
- }
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- instance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- instance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
- }
+ if (GameObject* pDoor = instance->instance->GetGameObject(instance->GetData64(DATA_XEVOZZ_CELL)))
+ if (pDoor->GetGoState() == GO_STATE_READY)
+ {
+ EnterEvadeMode();
+ return;
+ }
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
+ instance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ instance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
}
void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { }
@@ -199,18 +193,15 @@ public:
DespawnSphere();
- if (instance)
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
{
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- {
- instance->SetData(DATA_1ST_BOSS_EVENT, DONE);
- instance->SetData(DATA_WAVE_COUNT, 7);
- }
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- {
- instance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
- instance->SetData(DATA_WAVE_COUNT, 13);
- }
+ instance->SetData(DATA_1ST_BOSS_EVENT, DONE);
+ instance->SetData(DATA_WAVE_COUNT, 7);
+ }
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ {
+ instance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
+ instance->SetData(DATA_WAVE_COUNT, 13);
}
}
void KilledUnit(Unit* victim) OVERRIDE
@@ -231,7 +222,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ethereal_sphereAI(creature);
+ return GetInstanceAI<npc_ethereal_sphereAI>(creature);
}
struct npc_ethereal_sphereAI : public ScriptedAI
@@ -263,16 +254,13 @@ public:
if (uiRangeCheck_Timer < uiDiff)
{
- if (instance)
+ if (Creature* pXevozz = Unit::GetCreature(*me, instance->GetData64(DATA_XEVOZZ)))
{
- if (Creature* pXevozz = Unit::GetCreature(*me, instance->GetData64(DATA_XEVOZZ)))
- {
- float fDistance = me->GetDistance2d(pXevozz);
- if (fDistance <= 3)
- DoCast(pXevozz, SPELL_ARCANE_POWER);
- else
- DoCast(me, 35845); //Is it blizzlike?
- }
+ float fDistance = me->GetDistance2d(pXevozz);
+ if (fDistance <= 3)
+ DoCast(pXevozz, SPELL_ARCANE_POWER);
+ else
+ DoCast(me, 35845); //Is it blizzlike?
}
uiRangeCheck_Timer = 1000;
}
diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp
index 3db389ac703..6835228ca46 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -58,7 +58,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_zuramatAI(creature);
+ return GetInstanceAI<boss_zuramatAI>(creature);
}
struct boss_zuramatAI : public ScriptedAI
@@ -77,13 +77,10 @@ public:
void Reset() OVERRIDE
{
- if (instance)
- {
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- instance->SetData(DATA_1ST_BOSS_EVENT, NOT_STARTED);
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- instance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
- }
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
+ instance->SetData(DATA_1ST_BOSS_EVENT, NOT_STARTED);
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ instance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
SpellShroudOfDarknessTimer = 22000;
SpellVoidShiftTimer = 15000;
@@ -108,19 +105,16 @@ public:
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- {
- if (GameObject* pDoor = instance->instance->GetGameObject(instance->GetData64(DATA_ZURAMAT_CELL)))
- if (pDoor->GetGoState() == GO_STATE_READY)
- {
- EnterEvadeMode();
- return;
- }
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- instance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- instance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
- }
+ if (GameObject* pDoor = instance->instance->GetGameObject(instance->GetData64(DATA_ZURAMAT_CELL)))
+ if (pDoor->GetGoState() == GO_STATE_READY)
+ {
+ EnterEvadeMode();
+ return;
+ }
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
+ instance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ instance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
}
void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { }
@@ -172,18 +166,15 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
+ if (instance->GetData(DATA_WAVE_COUNT) == 6)
{
- if (instance->GetData(DATA_WAVE_COUNT) == 6)
- {
- instance->SetData(DATA_1ST_BOSS_EVENT, DONE);
- instance->SetData(DATA_WAVE_COUNT, 7);
- }
- else if (instance->GetData(DATA_WAVE_COUNT) == 12)
- {
- instance->SetData(DATA_2ND_BOSS_EVENT, DONE);
- instance->SetData(DATA_WAVE_COUNT, 13);
- }
+ instance->SetData(DATA_1ST_BOSS_EVENT, DONE);
+ instance->SetData(DATA_WAVE_COUNT, 7);
+ }
+ else if (instance->GetData(DATA_WAVE_COUNT) == 12)
+ {
+ instance->SetData(DATA_2ND_BOSS_EVENT, DONE);
+ instance->SetData(DATA_WAVE_COUNT, 13);
}
}
diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
index 4ff0f2d36e9..9d02929efdb 100644
--- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
+++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -160,7 +160,7 @@ public:
bool bActive;
bool bWiped;
- bool bIsDoorSpellCasted;
+ bool bIsDoorSpellCast;
bool bCrystalActivated;
bool defenseless;
@@ -210,7 +210,7 @@ public:
uiCyanigosaEventTimer = 3*IN_MILLISECONDS;
bActive = false;
- bIsDoorSpellCasted = false;
+ bIsDoorSpellCast = false;
bCrystalActivated = false;
defenseless = true;
uiMainEventPhase = NOT_STARTED;
diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp
index c78a1ee1740..79025bb5c0f 100644
--- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp
+++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -307,7 +307,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_sinclariAI(creature);
+ return GetInstanceAI<npc_sinclariAI>(creature);
}
struct npc_sinclariAI : public ScriptedAI
@@ -401,8 +401,7 @@ public:
uiPhase = 5;
break;
case 5:
- if (instance)
- instance->SetData(DATA_MAIN_EVENT_PHASE, IN_PROGRESS);
+ instance->SetData(DATA_MAIN_EVENT_PHASE, IN_PROGRESS);
me->SetReactState(REACT_PASSIVE);
uiTimer = 0;
uiPhase = 0;
@@ -428,7 +427,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_azure_saboteurAI(creature);
+ return GetInstanceAI<npc_azure_saboteurAI>(creature);
}
struct npc_azure_saboteurAI : public npc_escortAI
@@ -552,7 +551,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_teleportation_portalAI(creature);
+ return GetInstanceAI<npc_teleportation_portalAI>(creature);
}
struct npc_teleportation_portalAI : public ScriptedAI
@@ -585,9 +584,6 @@ public:
void UpdateAI(uint32 diff) OVERRIDE
{
- if (!instance) //Massive usage of instance, global check
- return;
-
if (instance->GetData(DATA_REMOVE_NPC) == 1)
{
me->DespawnOrUnsummon();
@@ -649,7 +645,7 @@ public:
uiSpawnTimer = SPAWN_TIME;
} else uiSpawnTimer -= diff;
- if (bPortalGuardianOrKeeperOrEliteSpawn && !me->IsNonMeleeSpellCasted(false))
+ if (bPortalGuardianOrKeeperOrEliteSpawn && !me->IsNonMeleeSpellCast(false))
{
me->Kill(me, false);
me->RemoveCorpse();
@@ -660,22 +656,19 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_WAVE_COUNT, instance->GetData(DATA_WAVE_COUNT)+1);
+ instance->SetData(DATA_WAVE_COUNT, instance->GetData(DATA_WAVE_COUNT)+1);
}
void JustSummoned(Creature* summoned) OVERRIDE
{
listOfMobs.Summon(summoned);
- if (instance)
- instance->SetData64(DATA_ADD_TRASH_MOB, summoned->GetGUID());
+ instance->SetData64(DATA_ADD_TRASH_MOB, summoned->GetGUID());
}
void SummonedCreatureDies(Creature* summoned, Unit* /*killer*/) OVERRIDE
{
listOfMobs.Despawn(summoned);
- if (instance)
- instance->SetData64(DATA_DEL_TRASH_MOB, summoned->GetGUID());
+ instance->SetData64(DATA_DEL_TRASH_MOB, summoned->GetGUID());
}
};
@@ -687,8 +680,7 @@ struct violet_hold_trashAI : public npc_escortAI
{
instance = creature->GetInstanceScript();
bHasGotMovingPoints = false;
- if (instance)
- portalLocationID = instance->GetData(DATA_PORTAL_LOCATION);
+ portalLocationID = instance->GetData(DATA_PORTAL_LOCATION);
Reset();
}
@@ -788,16 +780,14 @@ struct violet_hold_trashAI : public npc_escortAI
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_NPC_PRESENCE_AT_DOOR_REMOVE, 1);
+ instance->SetData(DATA_NPC_PRESENCE_AT_DOOR_REMOVE, 1);
}
void CreatureStartAttackDoor()
{
me->SetReactState(REACT_PASSIVE);
DoCast(SPELL_DESTROY_DOOR_SEAL);
- if (instance)
- instance->SetData(DATA_NPC_PRESENCE_AT_DOOR_ADD, 1);
+ instance->SetData(DATA_NPC_PRESENCE_AT_DOOR_ADD, 1);
}
};
@@ -809,7 +799,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_azure_invaderAI(creature);
+ return GetInstanceAI<npc_azure_invaderAI>(creature);
}
struct npc_azure_invaderAI : public violet_hold_trashAI
@@ -887,7 +877,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_azure_binderAI(creature);
+ return GetInstanceAI<npc_azure_binderAI>(creature);
}
struct npc_azure_binderAI : public violet_hold_trashAI
@@ -965,7 +955,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_azure_mage_slayerAI(creature);
+ return GetInstanceAI<npc_azure_mage_slayerAI>(creature);
}
struct npc_azure_mage_slayerAI : public violet_hold_trashAI
@@ -1025,7 +1015,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_azure_raiderAI(creature);
+ return GetInstanceAI<npc_azure_raiderAI>(creature);
}
struct npc_azure_raiderAI : public violet_hold_trashAI
@@ -1131,7 +1121,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_azure_stalkerAI(creature);
+ return GetInstanceAI<npc_azure_stalkerAI>(creature);
}
};
@@ -1210,7 +1200,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_azure_spellbreakerAI(creature);
+ return GetInstanceAI<npc_azure_spellbreakerAI>(creature);
}
};
@@ -1221,7 +1211,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_azure_captainAI(creature);
+ return GetInstanceAI<npc_azure_captainAI>(creature);
}
struct npc_azure_captainAI : public violet_hold_trashAI
@@ -1273,7 +1263,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_azure_sorcerorAI(creature);
+ return GetInstanceAI<npc_azure_sorcerorAI>(creature);
}
struct npc_azure_sorcerorAI : public violet_hold_trashAI
diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.h b/src/server/scripts/Northrend/VioletHold/violet_hold.h
index f288af43ed2..96691f5e662 100644
--- a/src/server/scripts/Northrend/VioletHold/violet_hold.h
+++ b/src/server/scripts/Northrend/VioletHold/violet_hold.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/isle_of_conquest.cpp b/src/server/scripts/Northrend/isle_of_conquest.cpp
index 62173bb2145..1149c58e561 100644
--- a/src/server/scripts/Northrend/isle_of_conquest.cpp
+++ b/src/server/scripts/Northrend/isle_of_conquest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp
index f5700358150..0173454ef28 100644
--- a/src/server/scripts/Northrend/zone_borean_tundra.cpp
+++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -51,6 +51,9 @@ EndContentData */
enum Sinkhole
{
+ GO_EXPLOSIVES_CART = 188160,
+ NPC_SCOURGED_BURROWER = 26250,
+ QUEST_PLUG_THE_SINKHOLES = 11897,
SPELL_SET_CART = 46797,
SPELL_EXPLODE_CART = 46799,
SPELL_SUMMON_CART = 46798,
@@ -83,7 +86,7 @@ public:
return;
Player* player = caster->ToPlayer();
- if (player && player->GetQuestStatus(11897) == QUEST_STATUS_INCOMPLETE)
+ if (player && player->GetQuestStatus(QUEST_PLUG_THE_SINKHOLES) == QUEST_STATUS_INCOMPLETE)
{
phase = 1;
casterGuid = caster->GetGUID();
@@ -104,13 +107,13 @@ public:
case 1:
DoCast(me, SPELL_EXPLODE_CART, true);
DoCast(me, SPELL_SUMMON_CART, true);
- if (GameObject* cart = me->FindNearestGameObject(188160, 3))
+ if (GameObject* cart = me->FindNearestGameObject(GO_EXPLOSIVES_CART, 3.0f))
cart->SetUInt32Value(GAMEOBJECT_FACTION, 14);
phaseTimer = 3000;
phase = 2;
break;
case 2:
- if (GameObject* cart = me->FindNearestGameObject(188160, 3))
+ if (GameObject* cart = me->FindNearestGameObject(GO_EXPLOSIVES_CART, 3.0f))
cart->UseDoorOrButton();
DoCast(me, SPELL_EXPLODE_CART, true);
phaseTimer = 3000;
@@ -123,7 +126,7 @@ public:
break;
case 5:
DoCast(me, SPELL_SUMMON_WORM, true);
- if (Unit* worm = me->FindNearestCreature(26250, 3))
+ if (Unit* worm = me->FindNearestCreature(NPC_SCOURGED_BURROWER, 3.0f))
{
worm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
worm->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
@@ -133,7 +136,7 @@ public:
break;
case 6:
DoCast(me, SPELL_EXPLODE_CART, true);
- if (Unit* worm = me->FindNearestCreature(26250, 3))
+ if (Unit* worm = me->FindNearestCreature(NPC_SCOURGED_BURROWER, 3.0f))
{
me->Kill(worm);
worm->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
@@ -168,6 +171,12 @@ public:
## npc_khunok_the_behemoth
######*/
+enum Khunok
+{
+ NPC_ORPHANED_MAMMOTH_CALF = 25861,
+ SPELL_MAMMOTH_CALF_ESCORT_CREDIT = 46231
+};
+
class npc_khunok_the_behemoth : public CreatureScript
{
public:
@@ -185,13 +194,13 @@ public:
if (who->GetTypeId() != TYPEID_UNIT)
return;
- if (who->GetEntry() == 25861 && me->IsWithinDistInMap(who, 10.0f))
+ if (who->GetEntry() == NPC_ORPHANED_MAMMOTH_CALF && me->IsWithinDistInMap(who, 10.0f))
{
if (Unit* owner = who->GetOwner())
{
if (owner->GetTypeId() == TYPEID_PLAYER)
{
- owner->CastSpell(owner, 46231, true);
+ owner->CastSpell(owner, SPELL_MAMMOTH_CALF_ESCORT_CREDIT, true);
who->ToCreature()->DespawnOrUnsummon();
}
}
@@ -341,11 +350,19 @@ public:
## npc_nerubar_victim
######*/
-#define WARSONG_PEON 25270
+enum Nerubar
+{
+ NPC_WARSONG_PEON = 25270,
+ QUEST_TAKEN_BY_THE_SCOURGE = 11611,
+ SPELL_FREED_WARSONG_MAGE = 45526,
+ SPELL_FREED_WARSONG_SHAMAN = 45527,
+ SPELL_FREED_WARSONG_WARRIOR = 45514,
+ SPELL_FREED_WARSONG_PEON = 45532
+};
const uint32 nerubarVictims[3] =
{
- 45526, 45527, 45514
+ SPELL_FREED_WARSONG_MAGE, SPELL_FREED_WARSONG_SHAMAN, SPELL_FREED_WARSONG_WARRIOR
};
class npc_nerubar_victim : public CreatureScript
@@ -368,13 +385,13 @@ public:
if (!player)
return;
- if (player->GetQuestStatus(11611) == QUEST_STATUS_INCOMPLETE)
+ if (player->GetQuestStatus(QUEST_TAKEN_BY_THE_SCOURGE) == QUEST_STATUS_INCOMPLETE)
{
uint8 uiRand = urand(0, 99);
if (uiRand < 25)
{
- player->CastSpell(me, 45532, true);
- player->KilledMonsterCredit(WARSONG_PEON, 0);
+ player->CastSpell(me, SPELL_FREED_WARSONG_PEON, true);
+ player->KilledMonsterCredit(NPC_WARSONG_PEON, 0);
}
else if (uiRand < 75)
player->CastSpell(me, nerubarVictims[urand(0, 2)], true);
@@ -411,7 +428,10 @@ public:
struct npc_jennyAI : public ScriptedAI
{
- npc_jennyAI(Creature* creature) : ScriptedAI(creature) { }
+ npc_jennyAI(Creature* creature) : ScriptedAI(creature)
+ {
+ setCrateNumber = false;
+ }
bool setCrateNumber;
@@ -422,6 +442,9 @@ public:
me->SetReactState(REACT_PASSIVE);
+ if (!me->GetOwner())
+ return;
+
switch (me->GetOwner()->ToPlayer()->GetTeamId())
{
case TEAM_ALLIANCE:
@@ -1026,9 +1049,9 @@ public:
}
}
- void UpdateAI(uint32 uiDiff) OVERRIDE
+ void UpdateAI(uint32 diff) OVERRIDE
{
- npc_escortAI::UpdateAI(uiDiff);
+ npc_escortAI::UpdateAI(diff);
if (arthasInPosition && talbotInPosition)
{
@@ -1045,7 +1068,7 @@ public:
SetEscortPaused(false);
}
- if (phaseTimer <= uiDiff)
+ if (phaseTimer <= diff)
{
Creature* talbot = me->GetCreature(*me, talbotGUID);
Creature* arthas = me->GetCreature(*me, arthasGUID);
@@ -1196,7 +1219,7 @@ public:
phaseTimer = 0;
phase = 0;
}
- } else phaseTimer -= uiDiff;
+ } else phaseTimer -= diff;
if (!UpdateVictim())
return;
@@ -1369,7 +1392,7 @@ public:
CAST_AI(npc_thassarian::npc_thassarianAI, summoner->ToCreature()->AI())->talbotInPosition = true;
}
- void UpdateAI(uint32 uiDiff) OVERRIDE
+ void UpdateAI(uint32 diff) OVERRIDE
{
if (bCheck)
{
@@ -1385,23 +1408,23 @@ public:
if (me->GetAreaId() == 4125)
{
- if (shadowBoltTimer <= uiDiff)
+ if (shadowBoltTimer <= diff)
{
DoCastVictim(SPELL_SHADOW_BOLT);
shadowBoltTimer = urand(5000, 12000);
- } else shadowBoltTimer -= uiDiff;
+ } else shadowBoltTimer -= diff;
- if (deflectionTimer <= uiDiff)
+ if (deflectionTimer <= diff)
{
DoCastVictim(SPELL_DEFLECTION);
deflectionTimer = urand(20000, 25000);
- } else deflectionTimer -= uiDiff;
+ } else deflectionTimer -= diff;
- if (soulBlastTimer <= uiDiff)
+ if (soulBlastTimer <= diff)
{
DoCastVictim(SPELL_SOUL_BLAST);
soulBlastTimer = urand(12000, 18000);
- } else soulBlastTimer -= uiDiff;
+ } else soulBlastTimer -= diff;
}
DoMeleeAttackIfReady();
@@ -1491,11 +1514,11 @@ public:
}
}
- void UpdateAI(uint32 uiDiff) OVERRIDE
+ void UpdateAI(uint32 diff) OVERRIDE
{
- ScriptedAI::UpdateAI(uiDiff);
+ ScriptedAI::UpdateAI(diff);
- if (phaseTimer <= uiDiff)
+ if (phaseTimer <= diff)
{
switch (phase)
{
@@ -1551,7 +1574,7 @@ public:
phase = 0;
break;
}
- } else phaseTimer -= uiDiff;
+ } else phaseTimer -= diff;
if (!UpdateVictim())
return;
@@ -1632,7 +1655,7 @@ public:
}
}
- void UpdateAI(uint32 /*uiDiff*/) OVERRIDE
+ void UpdateAI(uint32 /*diff*/) OVERRIDE
{
if (!UpdateVictim())
return;
@@ -1728,7 +1751,7 @@ public:
Talk(SAY_IMPRISIONED_BERYL_1);
break;
case 2:
- Talk(SAY_IMPRISIONED_BERYL_2, caster->GetGUID());
+ Talk(SAY_IMPRISIONED_BERYL_2, caster);
break;
case 3:
Talk(SAY_IMPRISIONED_BERYL_3);
@@ -1740,7 +1763,7 @@ public:
Talk(SAY_IMPRISIONED_BERYL_5);
break;
case 6:
- Talk(SAY_IMPRISIONED_BERYL_6, caster->GetGUID());
+ Talk(SAY_IMPRISIONED_BERYL_6, caster);
break;
case 7:
Talk(SAY_IMPRISIONED_BERYL_7);
@@ -1872,7 +1895,7 @@ public:
if (quest->GetQuestId() == QUEST_GET_ME_OUTA_HERE)
{
creature->SetStandState(UNIT_STAND_STATE_STAND);
- creature->AI()->Talk(SAY_BONKER_2, player->GetGUID());
+ creature->AI()->Talk(SAY_BONKER_2, player);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, player->GetGUID());
}
return true;
diff --git a/src/server/scripts/Northrend/zone_crystalsong_forest.cpp b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp
index 34a217b6418..9023f02111f 100644
--- a/src/server/scripts/Northrend/zone_crystalsong_forest.cpp
+++ b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -56,21 +56,21 @@ public:
SetCombatMovement(false);
}
- uint64 uiTargetGUID;
+ uint64 targetGUID;
void Reset() OVERRIDE
{
- uiTargetGUID = 0;
+ targetGUID = 0;
}
- void UpdateAI(uint32 /*uiDiff*/) OVERRIDE
+ void UpdateAI(uint32 /*diff*/) OVERRIDE
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
return;
if (me->GetEntry() == NPC_WARMAGE_SARINA)
{
- if (!uiTargetGUID)
+ if (!targetGUID)
{
std::list<Creature*> orbList;
GetCreatureListWithEntryInGrid(orbList, me, NPC_TRANSITUS_SHIELD_DUMMY, 32.0f);
@@ -82,7 +82,7 @@ public:
{
if (pOrb->GetPositionY() < 1000)
{
- uiTargetGUID = pOrb->GetGUID();
+ targetGUID = pOrb->GetGUID();
break;
}
}
@@ -91,13 +91,13 @@ public:
}
}else
{
- if (!uiTargetGUID)
+ if (!targetGUID)
if (Creature* pOrb = GetClosestCreatureWithEntry(me, NPC_TRANSITUS_SHIELD_DUMMY, 32.0f))
- uiTargetGUID = pOrb->GetGUID();
+ targetGUID = pOrb->GetGUID();
}
- if (Creature* pOrb = me->GetCreature(*me, uiTargetGUID))
+ if (Creature* pOrb = me->GetCreature(*me, targetGUID))
DoCast(pOrb, SPELL_TRANSITUS_SHIELD_BEAM);
}
diff --git a/src/server/scripts/Northrend/zone_dalaran.cpp b/src/server/scripts/Northrend/zone_dalaran.cpp
index 083b4f879ee..a9c89dbf3da 100644
--- a/src/server/scripts/Northrend/zone_dalaran.cpp
+++ b/src/server/scripts/Northrend/zone_dalaran.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -35,8 +35,8 @@ Script Data End */
enum Spells
{
- SPELL_TRESPASSER_A = 54028,
- SPELL_TRESPASSER_H = 54029,
+ SPELL_TRESPASSER_A = 54028,
+ SPELL_TRESPASSER_H = 54029,
SPELL_SUNREAVER_DISGUISE_FEMALE = 70973,
SPELL_SUNREAVER_DISGUISE_MALE = 70974,
@@ -46,8 +46,10 @@ enum Spells
enum NPCs // All outdoor guards are within 35.0f of these NPCs
{
- NPC_APPLEBOUGH_A = 29547,
- NPC_SWEETBERRY_H = 29715,
+ NPC_APPLEBOUGH_A = 29547,
+ NPC_SWEETBERRY_H = 29715,
+ NPC_SILVER_COVENANT_GUARDIAN_MAGE = 29254,
+ NPC_SUNREAVER_GUARDIAN_MAGE = 29255,
};
class npc_mageguard_dalaran : public CreatureScript
@@ -89,7 +91,7 @@ public:
switch (me->GetEntry())
{
- case 29254:
+ case NPC_SILVER_COVENANT_GUARDIAN_MAGE:
if (player->GetTeam() == HORDE) // Horde unit found in Alliance area
{
if (GetClosestCreatureWithEntry(me, NPC_APPLEBOUGH_A, 32.0f))
@@ -101,7 +103,7 @@ public:
DoCast(who, SPELL_TRESPASSER_A); // Teleport the Horde unit out
}
break;
- case 29255:
+ case NPC_SUNREAVER_GUARDIAN_MAGE:
if (player->GetTeam() == ALLIANCE) // Alliance unit found in Horde area
{
if (GetClosestCreatureWithEntry(me, NPC_SWEETBERRY_H, 32.0f))
@@ -133,7 +135,7 @@ public:
enum HiraSnowdawn
{
- SPELL_COLD_WEATHER_FLYING = 54197
+ SPELL_COLD_WEATHER_FLYING = 54197
};
#define GOSSIP_TEXT_TRAIN_HIRA "I seek training to ride a steed."
diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp
index 76ce586aa9d..f91f5d8c007 100644
--- a/src/server/scripts/Northrend/zone_dragonblight.cpp
+++ b/src/server/scripts/Northrend/zone_dragonblight.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -37,6 +37,331 @@ EndContentData */
#include "CombatAI.h"
#include "Player.h"
+/*#####
+# npc_commander_eligor_dawnbringer
+#####*/
+
+enum CommanderEligorDawnbringer
+{
+ MODEL_IMAGE_OF_KELTHUZAD = 24787, // Image of Kel'Thuzad
+ MODEL_IMAGE_OF_SAPPHIRON = 24788, // Image of Sapphiron
+ MODEL_IMAGE_OF_RAZUVIOUS = 24799, // Image of Razuvious
+ MODEL_IMAGE_OF_GOTHIK = 24804, // Image of Gothik
+ MODEL_IMAGE_OF_THANE = 24802, // Image of Thane Korth'azz
+ MODEL_IMAGE_OF_BLAUMEUX = 24794, // Image of Lady Blaumeux
+ MODEL_IMAGE_OF_ZELIEK = 24800, // Image of Sir Zeliek
+ MODEL_IMAGE_OF_PATCHWERK = 24798, // Image of Patchwerk
+ MODEL_IMAGE_OF_GROBBULUS = 24792, // Image of Grobbulus
+ MODEL_IMAGE_OF_THADDIUS = 24801, // Image of Thaddius
+ MODEL_IMAGE_OF_GLUTH = 24803, // Image of Gluth
+ MODEL_IMAGE_OF_ANUBREKHAN = 24789, // Image of Anub'rekhan
+ MODEL_IMAGE_OF_FAERLINA = 24790, // Image of Faerlina
+ MODEL_IMAGE_OF_MAEXXNA = 24796, // Image of Maexxna
+ MODEL_IMAGE_OF_NOTH = 24797, // Image of Noth
+ MODEL_IMAGE_OF_HEIGAN = 24793, // Image of Heigan
+ MODEL_IMAGE_OF_LOATHEB = 24795, // Image of Loatheb
+
+ NPC_IMAGE_OF_KELTHUZAD = 27766, // Image of Kel'Thuzad
+ NPC_IMAGE_OF_SAPPHIRON = 27767, // Image of Sapphiron
+ NPC_IMAGE_OF_RAZUVIOUS = 27768, // Image of Razuvious
+ NPC_IMAGE_OF_GOTHIK = 27769, // Image of Gothik
+ NPC_IMAGE_OF_THANE = 27770, // Image of Thane Korth'azz
+ NPC_IMAGE_OF_BLAUMEUX = 27771, // Image of Lady Blaumeux
+ NPC_IMAGE_OF_ZELIEK = 27772, // Image of Sir Zeliek
+ NPC_IMAGE_OF_PATCHWERK = 27773, // Image of Patchwerk
+ NPC_IMAGE_OF_GROBBULUS = 27774, // Image of Grobbulus
+ NPC_IMAGE_OF_THADDIUS = 27775, // Image of Thaddius
+ NPC_IMAGE_OF_GLUTH = 27782, // Image of Gluth
+ NPC_IMAGE_OF_ANUBREKHAN = 27776, // Image of Anub'rekhan
+ NPC_IMAGE_OF_FAERLINA = 27777, // Image of Faerlina
+ NPC_IMAGE_OF_MAEXXNA = 27778, // Image of Maexxna
+ NPC_IMAGE_OF_NOTH = 27779, // Image of Noth
+ NPC_IMAGE_OF_HEIGAN = 27780, // Image of Heigan
+ NPC_IMAGE_OF_LOATHEB = 27781, // Image of Loatheb
+
+ NPC_INFANTRYMAN = 27160, // Add in case I randomize the spawning
+ NPC_SENTINAL = 27162,
+ NPC_BATTLE_MAGE = 27164,
+
+ // Five platforms to choose from
+ SAY_PINNACLE = 0,
+ SAY_DEATH_KNIGHT_WING = 1,
+ SAY_ABOMINATION_WING = 2,
+ SAY_SPIDER_WING = 3,
+ SAY_PLAGUE_WING = 4,
+ // Used in all talks
+ SAY_TALK_COMPLETE = 5,
+ // Pinnacle of Naxxramas
+ SAY_SAPPHIRON = 6,
+ SAY_KELTHUZAD_1 = 7,
+ SAY_KELTHUZAD_2 = 8,
+ SAY_KELTHUZAD_3 = 9,
+ // Death knight wing of Naxxramas
+ SAY_RAZUVIOUS = 10,
+ SAY_GOTHIK = 11,
+ SAY_DEATH_KNIGHTS_1 = 12,
+ SAY_DEATH_KNIGHTS_2 = 13,
+ SAY_DEATH_KNIGHTS_3 = 14,
+ SAY_DEATH_KNIGHTS_4 = 15,
+ // Blighted abomination wing of Naxxramas
+ SAY_PATCHWERK = 16,
+ SAY_GROBBULUS = 17,
+ SAY_GLUTH = 18,
+ SAY_THADDIUS = 19,
+ // Accursed spider wing of Naxxramas
+ SAY_ANUBREKHAN = 20,
+ SAY_FAERLINA = 21,
+ SAY_MAEXXNA = 22,
+ // Dread plague wing of Naxxramas
+ SAY_NOTH = 23,
+ SAY_HEIGAN_1 = 24,
+ SAY_HEIGAN_2 = 25,
+ SAY_LOATHEB = 26,
+
+ SPELL_HEROIC_IMAGE_CHANNEL = 49519,
+
+ EVENT_START_RANDOM = 1,
+ EVENT_MOVE_TO_POINT = 2,
+ EVENT_TALK_COMPLETE = 3,
+ EVENT_GET_TARGETS = 4,
+ EVENT_KELTHUZAD_2 = 5,
+ EVENT_KELTHUZAD_3 = 6,
+ EVENT_DEATH_KNIGHTS_2 = 7,
+ EVENT_DEATH_KNIGHTS_3 = 8,
+ EVENT_DEATH_KNIGHTS_4 = 9,
+ EVENT_HEIGAN_2 = 10
+};
+
+uint32 const AudienceMobs[3] = { NPC_INFANTRYMAN, NPC_SENTINAL, NPC_BATTLE_MAGE };
+
+Position const PosTalkLocations[6] =
+{
+ { 3805.453f, -682.9075f, 222.2917f, 2.793398f }, // Pinnacle of Naxxramas
+ { 3807.508f, -691.0882f, 221.9688f, 2.094395f }, // Death knight wing of Naxxramas
+ { 3797.228f, -690.3555f, 222.5019f, 1.134464f }, // Blighted abomination wing of Naxxramas
+ { 3804.038f, -672.3098f, 222.5019f, 4.578917f }, // Accursed spider wing of Naxxramas
+ { 3815.097f, -680.2596f, 221.9777f, 2.86234f }, // Dread plague wing of Naxxramas
+ { 3798.05f, -680.611f, 222.9825f, 6.038839f }, // Home
+};
+
+class npc_commander_eligor_dawnbringer : public CreatureScript
+{
+ public: npc_commander_eligor_dawnbringer() : CreatureScript("npc_commander_eligor_dawnbringer") {}
+
+ struct npc_commander_eligor_dawnbringerAI : public ScriptedAI
+ {
+ npc_commander_eligor_dawnbringerAI(Creature* creature) : ScriptedAI(creature) { }
+
+ void Reset() OVERRIDE
+ {
+ talkWing = 0;
+ memset(audienceList, 0, sizeof(audienceList));
+ memset(imageList, 0, sizeof(imageList));
+ _events.ScheduleEvent(EVENT_GET_TARGETS, 5000);
+ _events.ScheduleEvent(EVENT_START_RANDOM, 20000);
+ }
+
+ void MovementInform(uint32 type, uint32 id) OVERRIDE
+ {
+ if (type == POINT_MOTION_TYPE)
+ {
+ if (id == 1)
+ {
+ me->SetFacingTo(PosTalkLocations[talkWing].m_orientation);
+ TurnAudience();
+
+ switch (talkWing)
+ {
+ case 0: // Pinnacle of Naxxramas
+ {
+ switch (urand (0, 1))
+ {
+ case 0: ChangeImage(NPC_IMAGE_OF_KELTHUZAD, MODEL_IMAGE_OF_KELTHUZAD, SAY_KELTHUZAD_1);
+ _events.ScheduleEvent(EVENT_KELTHUZAD_2, 8000); break;
+ case 1: ChangeImage(NPC_IMAGE_OF_SAPPHIRON, MODEL_IMAGE_OF_SAPPHIRON, SAY_SAPPHIRON); break;
+ }
+ }
+ break;
+ case 1: // Death knight wing of Naxxramas
+ {
+ switch (urand (0, 2))
+ {
+ case 0: ChangeImage(NPC_IMAGE_OF_RAZUVIOUS, MODEL_IMAGE_OF_RAZUVIOUS, SAY_RAZUVIOUS); break;
+ case 1: ChangeImage(NPC_IMAGE_OF_GOTHIK, MODEL_IMAGE_OF_GOTHIK, SAY_GOTHIK); break;
+ case 2: ChangeImage(NPC_IMAGE_OF_THANE, MODEL_IMAGE_OF_THANE, SAY_DEATH_KNIGHTS_1);
+ _events.ScheduleEvent(EVENT_DEATH_KNIGHTS_2, 10000); break;
+ }
+ }
+ break;
+ case 2: // Blighted abomination wing of Naxxramas
+ {
+ switch (urand (0, 3))
+ {
+ case 0: ChangeImage(NPC_IMAGE_OF_PATCHWERK, MODEL_IMAGE_OF_PATCHWERK, SAY_PATCHWERK); break;
+ case 1: ChangeImage(NPC_IMAGE_OF_GROBBULUS, MODEL_IMAGE_OF_GROBBULUS, SAY_GROBBULUS); break;
+ case 2: ChangeImage(NPC_IMAGE_OF_THADDIUS, MODEL_IMAGE_OF_THADDIUS, SAY_THADDIUS); break;
+ case 3: ChangeImage(NPC_IMAGE_OF_GLUTH, MODEL_IMAGE_OF_GLUTH, SAY_GLUTH); break;
+ }
+ }
+ break;
+ case 3: // Accursed spider wing of Naxxramas
+ {
+ switch (urand (0, 2))
+ {
+ case 0: ChangeImage(NPC_IMAGE_OF_ANUBREKHAN, MODEL_IMAGE_OF_ANUBREKHAN, SAY_ANUBREKHAN); break;
+ case 1: ChangeImage(NPC_IMAGE_OF_FAERLINA, MODEL_IMAGE_OF_FAERLINA, SAY_FAERLINA); break;
+ case 2: ChangeImage(NPC_IMAGE_OF_MAEXXNA, MODEL_IMAGE_OF_MAEXXNA, SAY_MAEXXNA); break;
+ }
+ }
+ break;
+ case 4: // Dread plague wing of Naxxramas
+ {
+ switch (urand (0, 2))
+ {
+ case 0: ChangeImage(NPC_IMAGE_OF_NOTH, MODEL_IMAGE_OF_NOTH, SAY_NOTH); break;
+ case 1: ChangeImage(NPC_IMAGE_OF_HEIGAN, MODEL_IMAGE_OF_HEIGAN, SAY_HEIGAN_1);
+ _events.ScheduleEvent(EVENT_HEIGAN_2, 8000); break;
+ case 2: ChangeImage(NPC_IMAGE_OF_LOATHEB, MODEL_IMAGE_OF_LOATHEB, SAY_LOATHEB); break;
+ }
+ }
+ break;
+ case 5: // Home
+ _events.ScheduleEvent(EVENT_START_RANDOM, 30000);
+ break;
+ }
+ }
+ }
+ }
+
+ void StoreTargets()
+ {
+ uint8 creaturecount;
+
+ creaturecount = 0;
+
+ for (uint8 ii = 0; ii < 3; ++ii)
+ {
+ std::list<Creature*> creatureList;
+ GetCreatureListWithEntryInGrid(creatureList, me, AudienceMobs[ii], 15.0f);
+ for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
+ {
+ if (Creature* creatureList = *itr)
+ {
+ audienceList[creaturecount] = creatureList->GetGUID();
+ ++creaturecount;
+ }
+ }
+ }
+
+ if (Creature* creature = me->FindNearestCreature(NPC_IMAGE_OF_KELTHUZAD, 20.0f, true))
+ imageList[0] = creature->GetGUID();
+ if (Creature* creature = me->FindNearestCreature(NPC_IMAGE_OF_RAZUVIOUS, 20.0f, true))
+ imageList[1] = creature->GetGUID();
+ if (Creature* creature = me->FindNearestCreature(NPC_IMAGE_OF_PATCHWERK, 20.0f, true))
+ imageList[2] = creature->GetGUID();
+ if (Creature* creature = me->FindNearestCreature(NPC_IMAGE_OF_ANUBREKHAN, 20.0f, true))
+ imageList[3] = creature->GetGUID();
+ if (Creature* creature = me->FindNearestCreature(NPC_IMAGE_OF_NOTH, 20.0f, true))
+ imageList[4] = creature->GetGUID();
+ }
+
+ void ChangeImage(uint32 entry, uint32 model, uint8 text)
+ {
+ if (Creature* creature = ObjectAccessor::GetCreature(*me, imageList[talkWing]))
+ {
+ Talk(text);
+ creature->SetEntry(entry);
+ creature->SetDisplayId(model);
+ creature->CastSpell(creature, SPELL_HEROIC_IMAGE_CHANNEL);
+ _events.ScheduleEvent(EVENT_TALK_COMPLETE, 40000);
+ }
+ }
+
+ void TurnAudience()
+ {
+ for (uint8 i = 0; i < 10; ++i)
+ {
+ if (Creature* creature = ObjectAccessor::GetCreature(*me, audienceList[i]))
+ creature->SetFacingToObject(me);
+ }
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ _events.Update(diff);
+
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_START_RANDOM:
+ talkWing = urand (0, 4);
+ Talk(talkWing);
+ _events.ScheduleEvent(EVENT_MOVE_TO_POINT, 8000);
+ break;
+ case EVENT_MOVE_TO_POINT:
+ me->SetWalk(true);
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MovePoint(1, PosTalkLocations[talkWing].m_positionX, PosTalkLocations[talkWing].m_positionY, PosTalkLocations[talkWing].m_positionZ);
+ break;
+ case EVENT_TALK_COMPLETE:
+ talkWing = 5;
+ Talk(talkWing);
+ _events.ScheduleEvent(EVENT_MOVE_TO_POINT, 5000);
+ break;
+ case EVENT_GET_TARGETS:
+ StoreTargets();
+ break;
+ case EVENT_KELTHUZAD_2:
+ Talk(SAY_KELTHUZAD_2);
+ _events.ScheduleEvent(EVENT_KELTHUZAD_3, 8000);
+ break;
+ case EVENT_KELTHUZAD_3:
+ Talk(SAY_KELTHUZAD_3);
+ break;
+ case EVENT_DEATH_KNIGHTS_2:
+ Talk(SAY_DEATH_KNIGHTS_2);
+ if (Creature* creature = ObjectAccessor::GetCreature(*me, imageList[talkWing]))
+ {
+ creature->SetEntry(NPC_IMAGE_OF_BLAUMEUX);
+ creature->SetDisplayId(MODEL_IMAGE_OF_BLAUMEUX);
+ }
+ _events.ScheduleEvent(EVENT_DEATH_KNIGHTS_3, 10000);
+ break;
+ case EVENT_DEATH_KNIGHTS_3:
+ Talk(SAY_DEATH_KNIGHTS_3);
+ if (Creature* creature = ObjectAccessor::GetCreature(*me, imageList[talkWing]))
+ {
+ creature->SetEntry(NPC_IMAGE_OF_ZELIEK);
+ creature->SetDisplayId(MODEL_IMAGE_OF_ZELIEK);
+ }
+ _events.ScheduleEvent(EVENT_DEATH_KNIGHTS_4, 10000);
+ break;
+ case EVENT_DEATH_KNIGHTS_4:
+ Talk(SAY_DEATH_KNIGHTS_4);
+ break;
+ case EVENT_HEIGAN_2:
+ Talk(SAY_HEIGAN_2);
+ break;
+ default:
+ break;
+ }
+ }
+ DoMeleeAttackIfReady();
+ }
+ private:
+ EventMap _events;
+ uint64 audienceList[10];
+ uint64 imageList[5];
+ uint8 talkWing;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_commander_eligor_dawnbringerAI(creature);
+ }
+};
+
enum AlexstraszaWrGate
{
// Quest
@@ -121,12 +446,12 @@ public:
if (roll == 1) // friendly version
{
tree->CastSpell(player, SPELL_CREATE_ITEM_BARK);
- tree->AI()->Talk(SAY_WALKER_FRIENDLY, player->GetGUID());
+ tree->AI()->Talk(SAY_WALKER_FRIENDLY, player);
tree->DespawnOrUnsummon(1000);
}
else if (roll == 0) // enemy version
{
- tree->AI()->Talk(SAY_WALKER_ENEMY, player->GetGUID());
+ tree->AI()->Talk(SAY_WALKER_ENEMY, player);
tree->setFaction(FACTION_WALKER_ENEMY);
tree->Attack(player, true);
}
@@ -192,7 +517,7 @@ enum WyrmDefenderEnum
// Spells data
SPELL_CHARACTER_SCRIPT = 49213,
SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE = 52421, // ID - 52421 Wyrmrest Defender: On Low Health Boss Emote to Controller - Random /self/
- SPELL_RENEW = 49263, // casted to heal drakes
+ SPELL_RENEW = 49263, // cast to heal drakes
SPELL_WYRMREST_DEFENDER_MOUNT = 49256,
// Texts data
@@ -278,13 +603,13 @@ class npc_wyrmrest_defender : public CreatureScript
switch (spell->Id)
{
case SPELL_WYRMREST_DEFENDER_MOUNT:
- Talk(WHISPER_MOUNTED, me->GetCharmerOrOwnerGUID());
+ Talk(WHISPER_MOUNTED, me->GetCharmerOrOwner());
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
break;
// Both below are for checking low hp warning
case SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE:
- Talk(BOSS_EMOTE_ON_LOW_HEALTH, me->GetCharmerOrOwnerGUID());
+ Talk(BOSS_EMOTE_ON_LOW_HEALTH, me->GetCharmerOrOwner());
break;
case SPELL_RENEW:
if (!hpWarningReady && RenewRecoveryChecker <= 100)
@@ -338,7 +663,7 @@ class npc_torturer_lecraft : public CreatureScript
_events.ScheduleEvent(EVENT_KIDNEY_SHOT, urand(12000, 15000));
if (Player* player = who->ToPlayer())
- Talk (SAY_AGGRO, player->GetGUID());
+ Talk (SAY_AGGRO, player);
}
void SpellHit(Unit* caster, const SpellInfo* spell) OVERRIDE
@@ -354,7 +679,7 @@ class npc_torturer_lecraft : public CreatureScript
if (_playerGUID != player->GetGUID())
return;
- Talk(_textCounter, player->GetGUID());
+ Talk(_textCounter, player);
if (_textCounter == 5)
player->KilledMonsterCredit(NPC_TORTURER_LECRAFT, 0);
@@ -405,9 +730,10 @@ class npc_torturer_lecraft : public CreatureScript
void AddSC_dragonblight()
{
- new npc_alexstrasza_wr_gate;
- new spell_q12096_q12092_dummy;
- new spell_q12096_q12092_bark;
- new npc_wyrmrest_defender;
- new npc_torturer_lecraft;
+ new npc_commander_eligor_dawnbringer();
+ new npc_alexstrasza_wr_gate();
+ new spell_q12096_q12092_dummy();
+ new spell_q12096_q12092_bark();
+ new npc_wyrmrest_defender();
+ new npc_torturer_lecraft();
}
diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
index 6587f0536b3..bacc6de57f0 100644
--- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp
+++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -160,7 +160,7 @@ public:
if (player)
{
player->GroupEventHappens(QUEST_PERILOUS_ADVENTURE, me);
- Talk(SAY_QUEST_COMPLETE, player->GetGUID());
+ Talk(SAY_QUEST_COMPLETE, player);
}
me->SetWalk(false);
break;
diff --git a/src/server/scripts/Northrend/zone_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp
index 671628e4cbc..798801041f4 100644
--- a/src/server/scripts/Northrend/zone_howling_fjord.cpp
+++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -32,6 +32,8 @@ EndContentData */
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#include "Player.h"
+#include "SpellInfo.h"
+#include "SpellScript.h"
/*######
## npc_apothecary_hanes
@@ -43,7 +45,8 @@ enum Entries
FACTION_ESCORTEE_H = 775,
NPC_HANES_FIRE_TRIGGER = 23968,
QUEST_TRAIL_OF_FIRE = 11241,
- SPELL_COSMETIC_LOW_POLY_FIRE = 56274
+ SPELL_COSMETIC_LOW_POLY_FIRE = 56274,
+ SPELL_HEALING_POTION = 17534
};
class npc_apothecary_hanes : public CreatureScript
@@ -92,7 +95,7 @@ public:
{
if (PotTimer <= diff)
{
- DoCast(me, 17534, true);
+ DoCast(me, SPELL_HEALING_POTION, true);
PotTimer = 10000;
} else PotTimer -= diff;
}
@@ -380,10 +383,107 @@ public:
}
};
+enum MindlessAbomination
+{
+ EVENT_CHECK_CHARMED = 1
+};
+
+class npc_mindless_abomination : public CreatureScript
+{
+public:
+ npc_mindless_abomination() : CreatureScript("npc_mindless_abomination") { }
+
+ struct npc_mindless_abominationAI : public ScriptedAI
+ {
+ npc_mindless_abominationAI(Creature* creature) : ScriptedAI(creature) { }
+
+ void Reset() OVERRIDE
+ {
+ events.ScheduleEvent(EVENT_CHECK_CHARMED, 1000);
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_CHECK_CHARMED:
+ if (!me->IsCharmedOwnedByPlayerOrPlayer())
+ me->DespawnOrUnsummon();
+ else
+ events.ScheduleEvent(EVENT_CHECK_CHARMED, 1000);
+ break;
+ }
+ }
+ }
+
+ private:
+ EventMap events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_mindless_abominationAI(creature);
+ }
+};
+
+class spell_mindless_abomination_explosion_fx_master : public SpellScriptLoader
+{
+ enum Spells
+ {
+ SPELL_RANDOM_CIRCUMFERENCE_POINT_POISON = 42266,
+ SPELL_COSMETIC_BLOOD_EXPLOSION_GREEN_LARGE = 43401
+ };
+
+ public:
+ spell_mindless_abomination_explosion_fx_master() : SpellScriptLoader("spell_mindless_abomination_explosion_fx_master") { }
+
+ class spell_mindless_abomination_explosion_fx_master_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_mindless_abomination_explosion_fx_master_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_RANDOM_CIRCUMFERENCE_POINT_POISON) || !sSpellMgr->GetSpellInfo(SPELL_COSMETIC_BLOOD_EXPLOSION_GREEN_LARGE))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex /*eff*/)
+ {
+ Creature* caster = GetCaster()->ToCreature();
+ if (!caster)
+ return;
+
+ caster->AI()->DoCast(caster, SPELL_COSMETIC_BLOOD_EXPLOSION_GREEN_LARGE);
+
+ for (uint8 i = 0; i < 10; ++i)
+ caster->AI()->DoCast(caster, SPELL_RANDOM_CIRCUMFERENCE_POINT_POISON);
+
+ caster->DespawnOrUnsummon(4000);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_mindless_abomination_explosion_fx_master_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_mindless_abomination_explosion_fx_master_SpellScript();
+ }
+};
+
void AddSC_howling_fjord()
{
- new npc_apothecary_hanes;
- new npc_plaguehound_tracker;
- new npc_razael_and_lyana;
- new npc_daegarn;
+ new npc_apothecary_hanes();
+ new npc_plaguehound_tracker();
+ new npc_razael_and_lyana();
+ new npc_daegarn();
+ new npc_mindless_abomination();
+ new spell_mindless_abomination_explosion_fx_master();
}
diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp
index 5c65be982e0..f7894c58b3e 100644
--- a/src/server/scripts/Northrend/zone_icecrown.cpp
+++ b/src/server/scripts/Northrend/zone_icecrown.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp
index a0b6524bd89..0298500e790 100644
--- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp
+++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -225,7 +225,7 @@ public:
break;
case GOSSIP_ACTION_INFO_DEF+2:
player->CLOSE_GOSSIP_MENU();
- creature->AI()->Talk(SAY_TEXTID_VEKJIK1, player->GetGUID());
+ creature->AI()->Talk(SAY_TEXTID_VEKJIK1, player);
player->AreaExploredOrEventHappens(QUEST_MAKING_PEACE);
creature->CastSpell(player, SPELL_FREANZYHEARTS_FURY, false);
break;
@@ -772,7 +772,7 @@ public:
{
if (Creature* presence = caster->FindNearestCreature(NPC_PRESENCE, 50.0f))
{
- presence->AI()->Talk(WHISPER_ACTIVATE, caster->GetGUID());
+ presence->AI()->Talk(WHISPER_ACTIVATE, caster);
presence->CastSpell(presence, SPELL_FREYA_DUMMY, true); // will target plants
// Freya Dummy could be scripted with the following code
@@ -1110,10 +1110,10 @@ public:
switch (GetSpellInfo()->Id)
{
case SPELL_CORRECT_TRACKS:
- player->MonsterSay(sObjectMgr->GetTrinityStringForDBCLocale(SAY_CORRECT_TRACKS), LANG_UNIVERSAL, player->GetGUID());
+ player->MonsterSay(sObjectMgr->GetTrinityStringForDBCLocale(SAY_CORRECT_TRACKS), LANG_UNIVERSAL, player);
break;
case SPELL_INCORRECT_TRACKS:
- player->MonsterSay(sObjectMgr->GetTrinityStringForDBCLocale(SAY_INCORRECT_TRACKS), LANG_UNIVERSAL, player->GetGUID());
+ player->MonsterSay(sObjectMgr->GetTrinityStringForDBCLocale(SAY_INCORRECT_TRACKS), LANG_UNIVERSAL, player);
break;
default:
break;
diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp
index 825981ba5c5..69e4e65225a 100644
--- a/src/server/scripts/Northrend/zone_storm_peaks.cpp
+++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -57,7 +57,7 @@ public:
switch (waypointId)
{
case 26:
- Talk(SAY_END_WP_REACHED, player->GetGUID());
+ Talk(SAY_END_WP_REACHED, player);
break;
case 27:
player->GroupEventHappens(QUEST_BITTER_DEPARTURE, me);
@@ -163,7 +163,8 @@ public:
## npc_brunnhildar_prisoner
######*/
-enum BrunnhildarPrisoner {
+enum BrunnhildarPrisoner
+{
SPELL_ICE_PRISON = 54894,
SPELL_ICE_LANCE = 55046,
SPELL_FREE_PRISONER = 55048,
@@ -281,7 +282,7 @@ public:
if (Vehicle* vehicle = me->GetVehicleKit())
if (Unit* passenger = vehicle->GetPassenger(0))
{
- Talk(TEXT_EMOTE, passenger->GetGUID());
+ Talk(TEXT_EMOTE, passenger);
me->GetMotionMaster()->MovePath(NPC_DRAKE, false);
}
}
@@ -338,17 +339,9 @@ public:
}
}
- void WaypointReached(uint32 /*waypointId*/) OVERRIDE
- {
- }
-
- void JustDied(Unit* /*killer*/) OVERRIDE
- {
- }
-
- void OnCharmed(bool /*apply*/) OVERRIDE
- {
- }
+ void WaypointReached(uint32 /*waypointId*/) OVERRIDE { }
+ void JustDied(Unit* /*killer*/) OVERRIDE { }
+ void OnCharmed(bool /*apply*/) OVERRIDE { }
void UpdateAI(uint32 diff) OVERRIDE
{
@@ -413,61 +406,313 @@ class npc_hyldsmeet_protodrake : public CreatureScript
}
};
-enum CloseRift
+/*#####
+# npc_brann_bronzebeard for Quest 13285 "Forging the Keystone"
+#####*/
+
+enum BrannBronzebeard
{
- SPELL_DESPAWN_RIFT = 61665
+ NPC_BRANN_BRONZEBEARD = 31810,
+ NPC_A_DISTANT_VOICE = 31814,
+ OBJECT_TOL_SIGNAL_1 = 193590,
+ OBJECT_TOL_SIGNAL_2 = 193591,
+ OBJECT_TOL_SIGNAL_3 = 193592,
+ OBJECT_TOL_SIGNAL_4 = 193593,
+ OBJECT_TOL_SIGNAL_5 = 193594,
+ SPELL_RESURRECTION = 58854,
+ SAY_BRANN_1 = 0,
+ SAY_BRANN_2 = 1,
+ SAY_BRANN_3 = 2,
+ SAY_VOICE_1 = 0,
+ SAY_VOICE_2 = 1,
+ SAY_VOICE_3 = 2,
+ SAY_VOICE_4 = 3,
+ SAY_VOICE_5 = 4,
+
+ EVENT_SCRIPT_1 = 3,
+ EVENT_SCRIPT_2 = 4,
+ EVENT_SCRIPT_3 = 5,
+ EVENT_SCRIPT_4 = 6,
+ EVENT_SCRIPT_5 = 7,
+ EVENT_SCRIPT_6 = 8,
+ EVENT_SCRIPT_7 = 9,
+ EVENT_SCRIPT_8 = 10,
+ EVENT_SCRIPT_9 = 11,
+ EVENT_SCRIPT_10 = 12,
+ EVENT_SCRIPT_11 = 13,
+ EVENT_SCRIPT_12 = 14,
+ EVENT_SCRIPT_13 = 15
};
-class spell_close_rift : public SpellScriptLoader
+class npc_brann_bronzebeard_keystone : public CreatureScript
{
- public:
- spell_close_rift() : SpellScriptLoader("spell_close_rift") { }
+public:
+ npc_brann_bronzebeard_keystone() : CreatureScript("npc_brann_bronzebeard_keystone") { }
- class spell_close_rift_AuraScript : public AuraScript
+ struct npc_brann_bronzebeard_keystoneAI : public ScriptedAI
+ {
+ npc_brann_bronzebeard_keystoneAI(Creature* creature) : ScriptedAI(creature) { }
+
+ void Reset() OVERRIDE
{
- PrepareAuraScript(spell_close_rift_AuraScript);
+ memset(&objectGUID, 0, sizeof(objectGUID));
+ playerGUID = 0;
+ voiceGUID = 0;
+ objectCounter = 0;
+ }
- bool Load() OVERRIDE
+ void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) OVERRIDE
+ {
+ player->CLOSE_GOSSIP_MENU();
+ playerGUID = player->GetGUID();
+ events.ScheduleEvent(EVENT_SCRIPT_1, 100);
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
{
- _counter = 0;
- return true;
+ switch (eventId)
+ {
+ case EVENT_SCRIPT_1:
+ if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
+ Talk(SAY_BRANN_1, player);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
+ if (Creature* voice = me->SummonCreature(NPC_A_DISTANT_VOICE, 7863.43f, -1396.585f, 1538.076f, 2.949606f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 49000))
+ voiceGUID = voice->GetGUID();
+ events.ScheduleEvent(EVENT_SCRIPT_2, 4000);
+ break;
+ case EVENT_SCRIPT_2:
+ me->SetWalk(true);
+ me->GetMotionMaster()->MovePoint(0, 7861.488f, -1396.376f, 1534.059f, false);
+ events.ScheduleEvent(EVENT_SCRIPT_3, 6000);
+ break;
+ case EVENT_SCRIPT_3:
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_WORK_MINING);
+ events.ScheduleEvent(EVENT_SCRIPT_4, 6000);
+ break;
+ case EVENT_SCRIPT_4:
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
+ if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
+ {
+ voice->AI()->DoCast(voice, SPELL_RESURRECTION);
+ if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
+ voice->AI()->Talk(SAY_VOICE_1, player);
+ }
+ if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_1, 7860.273f, -1383.622f, 1538.302f, -1.658062f, 0, 0, -0.737277f, 0.6755905f, 0))
+ objectGUID[objectCounter++] = go->GetGUID();
+ events.ScheduleEvent(EVENT_SCRIPT_5, 6000);
+ break;
+ case EVENT_SCRIPT_5:
+ if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
+ if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
+ voice->AI()->Talk(SAY_VOICE_2, player);
+ if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_2, 7875.67f, -1387.266f, 1538.323f, -2.373644f, 0, 0, -0.9271832f, 0.3746083f, 0))
+ objectGUID[objectCounter++] = go->GetGUID();
+ events.ScheduleEvent(EVENT_SCRIPT_6, 6000);
+ break;
+ case EVENT_SCRIPT_6:
+ if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
+ if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
+ voice->AI()->Talk(SAY_VOICE_3, player);
+ if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_3, 7879.212f, -1401.175f, 1538.279f, 2.967041f, 0, 0, 0.9961939f, 0.08716504f, 0))
+ objectGUID[objectCounter++] = go->GetGUID();
+ events.ScheduleEvent(EVENT_SCRIPT_7, 6000);
+ break;
+ case EVENT_SCRIPT_7:
+ if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
+ if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
+ voice->AI()->Talk(SAY_VOICE_4, player);
+ if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_4, 7868.944f, -1411.18f, 1538.213f, 2.111848f, 0, 0, 0.8703556f, 0.4924237f, 0))
+ objectGUID[objectCounter++] = go->GetGUID();
+ events.ScheduleEvent(EVENT_SCRIPT_8, 6000);
+ break;
+ case EVENT_SCRIPT_8:
+ if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
+ if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
+ voice->AI()->Talk(SAY_VOICE_5, player);
+ if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_5, 7855.11f, -1406.839f, 1538.42f, 1.151916f, 0, 0, 0.5446386f, 0.8386708f, 0))
+ objectGUID[objectCounter] = go->GetGUID();
+ events.ScheduleEvent(EVENT_SCRIPT_9, 6000);
+ break;
+ case EVENT_SCRIPT_9:
+ if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
+ voice->AI()->DoCast(voice, SPELL_RESURRECTION);
+ events.ScheduleEvent(EVENT_SCRIPT_10, 6000);
+ break;
+ case EVENT_SCRIPT_10:
+ if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
+ {
+ Talk(SAY_BRANN_2, player);
+ player->KilledMonsterCredit(me->GetEntry());
+ }
+ events.ScheduleEvent(EVENT_SCRIPT_11, 6000);
+ break;
+ case EVENT_SCRIPT_11:
+ me->SetFacingTo(2.932153f);
+ if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
+ Talk(SAY_BRANN_3, player);
+
+ for (uint8 i = 0; i < 5; ++i)
+ if (GameObject* go = ObjectAccessor::GetGameObject(*me, objectGUID[i]))
+ go->Delete();
+
+ events.ScheduleEvent(EVENT_SCRIPT_12, 6000);
+ break;
+ case EVENT_SCRIPT_12:
+ me->GetMotionMaster()->Clear();
+ me->SetWalk(false);
+ me->GetMotionMaster()->MovePoint(0, 7799.908f, -1413.561f, 1534.829f, false);
+ events.ScheduleEvent(EVENT_SCRIPT_13, 10000);
+ break;
+ case EVENT_SCRIPT_13:
+ me->DisappearAndDie();
+ break;
+ }
}
+ }
- bool Validate(SpellInfo const* /*spell*/) OVERRIDE
+ private:
+ EventMap events;
+ uint64 playerGUID;
+ uint64 objectGUID[5];
+ uint64 voiceGUID;
+ uint8 objectCounter;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_brann_bronzebeard_keystoneAI(creature);
+ }
+};
+
+/*#####
+# Quest 13010 Krolmir, Hammer of Storms
+#####*/
+
+enum JokkumScriptcast
+{
+ NPC_KINGJOKKUM = 30331,
+ NPC_THORIM = 30390,
+ PATH_JOKKUM = 2072200,
+ PATH_JOKKUM_END = 2072201,
+ SAY_HOLD_ON = 0,
+ SAY_JOKKUM_1 = 1,
+ SAY_JOKKUM_2 = 2,
+ SAY_JOKKUM_3 = 3,
+ SAY_JOKKUM_4 = 4,
+ SAY_JOKKUM_5 = 5,
+ SAY_JOKKUM_6 = 6,
+ SAY_JOKKUM_7 = 7,
+ SAY_JOKKUM_8 = 8,
+ SAY_THORIM_1 = 0,
+ SAY_THORIM_2 = 1,
+ SAY_THORIM_3 = 2,
+ SAY_THORIM_4 = 3,
+ SPELL_JOKKUM_SUMMON = 56541,
+ SPELL_JOKKUM_KILL_CREDIT = 56545,
+ SPELL_EJECT_ALL_PASSENGERS = 50630,
+ SPELL_PLAYER_CAST_VERANUS_SUMMON = 56650,
+ SPELL_SUMMON_VERANUS_AND_THORIM = 56649,
+ EVENT_KROLMIR_1 = 16,
+ EVENT_KROLMIR_2 = 17,
+ EVENT_KROLMIR_3 = 18,
+ EVENT_KROLMIR_4 = 19,
+ EVENT_KROLMIR_5 = 20,
+ EVENT_KROLMIR_6 = 21,
+ EVENT_KROLMIR_7 = 22,
+ EVENT_KROLMIR_8 = 23,
+ EVENT_KROLMIR_9 = 24,
+};
+
+class npc_king_jokkum_vehicle : public CreatureScript
+{
+public:
+ npc_king_jokkum_vehicle() : CreatureScript("npc_king_jokkum_vehicle") { }
+
+ struct npc_king_jokkum_vehicleAI : public VehicleAI
+ {
+ npc_king_jokkum_vehicleAI(Creature* creature) : VehicleAI(creature) { }
+
+ void Reset() OVERRIDE
+ {
+ playerGUID = 0;
+ pathEnd = false;
+ }
+
+ void OnCharmed(bool /*apply*/) OVERRIDE { }
+
+ void PassengerBoarded(Unit* who, int8 /*seat*/, bool apply) OVERRIDE
+ {
+ if (apply)
{
- return sSpellMgr->GetSpellInfo(SPELL_DESPAWN_RIFT);
+ playerGUID = who->GetGUID();
+ Talk(SAY_HOLD_ON, who);
+ me->CastSpell(who, SPELL_JOKKUM_KILL_CREDIT, true);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
+ me->GetMotionMaster()->MovePath(PATH_JOKKUM, false);
}
+ }
- void HandlePeriodic(AuraEffect const* /* aurEff */)
+ void MovementInform(uint32 type, uint32 id) OVERRIDE
+ {
+ if (type != WAYPOINT_MOTION_TYPE)
+ return;
+
+ if (pathEnd)
{
- if (++_counter == 5)
- GetTarget()->CastSpell((Unit*)NULL, SPELL_DESPAWN_RIFT, true);
- }
+ if (id == 4)
+ {
- void Register() OVERRIDE
+ }
+ }
+ else
{
- OnEffectPeriodic += AuraEffectPeriodicFn(spell_close_rift_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ if (id == 19)
+ {
+ pathEnd = true;
+ me->SetFacingTo(0.418879f);
+ Talk(SAY_JOKKUM_1);
+ if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
+ me->CastSpell(player, SPELL_PLAYER_CAST_VERANUS_SUMMON);
+ me->CastSpell(me, SPELL_EJECT_ALL_PASSENGERS);
+
+ }
}
+ }
- private:
- uint8 _counter;
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ if (!pathEnd)
+ return;
- };
+ events.Update(diff);
- AuraScript* GetAuraScript() const OVERRIDE
- {
- return new spell_close_rift_AuraScript();
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_KROLMIR_1:
+ Talk(SAY_JOKKUM_2);
+ events.ScheduleEvent(EVENT_KROLMIR_2, 4000);
+ break;
+ }
+ }
}
-};
-/*#####
-# spell_jokkum_scriptcast
-#####*/
+ private:
+ EventMap events;
+ uint64 playerGUID;
+ bool pathEnd;
-enum JokkumScriptcast
-{
- SPELL_JOKKUM_KILL_CREDIT = 56545,
- SPELL_JOKKUM_SUMMON = 56541
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_king_jokkum_vehicleAI(creature);
+ }
};
class spell_jokkum_scriptcast : public SpellScriptLoader
@@ -480,18 +725,15 @@ class spell_jokkum_scriptcast : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
- if (!sSpellMgr->GetSpellInfo(SPELL_JOKKUM_KILL_CREDIT) || !sSpellMgr->GetSpellInfo(SPELL_JOKKUM_SUMMON))
+ if (!sSpellMgr->GetSpellInfo(SPELL_JOKKUM_SUMMON))
return false;
return true;
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- if (Player* player = GetTarget()->ToPlayer())
- {
- player->CastSpell(player, SPELL_JOKKUM_KILL_CREDIT, true);
- player->CastSpell(player, SPELL_JOKKUM_SUMMON, true);
- }
+ if (Unit* target = GetTarget())
+ target->CastSpell(target, SPELL_JOKKUM_SUMMON, true);
}
void Register() OVERRIDE
@@ -506,6 +748,117 @@ class spell_jokkum_scriptcast : public SpellScriptLoader
}
};
+class spell_veranus_summon : public SpellScriptLoader
+{
+ public: spell_veranus_summon() : SpellScriptLoader("spell_veranus_summon") { }
+
+ class spell_veranus_summon_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_veranus_summon_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_VERANUS_AND_THORIM))
+ return false;
+ return true;
+ }
+
+ void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* target = GetTarget())
+ target->CastSpell(target, SPELL_SUMMON_VERANUS_AND_THORIM, true);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectApply += AuraEffectApplyFn(spell_veranus_summon_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const OVERRIDE
+ {
+ return new spell_veranus_summon_AuraScript();
+ }
+};
+
+/*#####
+# spell_jokkum_eject_all
+#####*/
+
+class spell_jokkum_eject_all : public SpellScriptLoader
+{
+ public: spell_jokkum_eject_all() : SpellScriptLoader("spell_jokkum_eject_all") { }
+
+ class spell_jokkum_eject_all_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_jokkum_eject_all_SpellScript);
+
+ void HandleScriptEffect(SpellEffIndex /* effIndex */)
+ {
+ if (Unit* caster = GetCaster())
+ if (caster->IsVehicle())
+ caster->GetVehicleKit()->RemoveAllPassengers();
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_jokkum_eject_all_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_jokkum_eject_all_SpellScript();
+ }
+};
+
+enum CloseRift
+{
+ SPELL_DESPAWN_RIFT = 61665
+};
+
+class spell_close_rift : public SpellScriptLoader
+{
+ public:
+ spell_close_rift() : SpellScriptLoader("spell_close_rift") { }
+
+ class spell_close_rift_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_close_rift_AuraScript);
+
+ bool Load() OVERRIDE
+ {
+ _counter = 0;
+ return true;
+ }
+
+ bool Validate(SpellInfo const* /*spell*/) OVERRIDE
+ {
+ return sSpellMgr->GetSpellInfo(SPELL_DESPAWN_RIFT);
+ }
+
+ void HandlePeriodic(AuraEffect const* /* aurEff */)
+ {
+ if (++_counter == 5)
+ GetTarget()->CastSpell((Unit*)NULL, SPELL_DESPAWN_RIFT, true);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_close_rift_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+
+ private:
+ uint8 _counter;
+
+ };
+
+ AuraScript* GetAuraScript() const OVERRIDE
+ {
+ return new spell_close_rift_AuraScript();
+ }
+};
+
void AddSC_storm_peaks()
{
new npc_injured_goblin();
@@ -514,6 +867,10 @@ void AddSC_storm_peaks()
new npc_freed_protodrake();
new npc_icefang();
new npc_hyldsmeet_protodrake();
- new spell_close_rift();
+ new npc_brann_bronzebeard_keystone();
+ new npc_king_jokkum_vehicle();
new spell_jokkum_scriptcast();
+ new spell_veranus_summon();
+ new spell_jokkum_eject_all();
+ new spell_close_rift();
}
diff --git a/src/server/scripts/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp
index a27ce0324ff..311b18524b2 100644
--- a/src/server/scripts/Northrend/zone_wintergrasp.cpp
+++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp
@@ -237,11 +237,47 @@ class npc_wg_spirit_guide : public CreatureScript
}
};
+enum WGQueue
+{
+ SPELL_FROST_ARMOR = 12544
+};
+
class npc_wg_queue : public CreatureScript
{
public:
npc_wg_queue() : CreatureScript("npc_wg_queue") { }
+ struct npc_wg_queueAI : public ScriptedAI
+ {
+ npc_wg_queueAI(Creature* creature) : ScriptedAI(creature) { }
+
+ uint32 FrostArmor_Timer;
+
+ void Reset() OVERRIDE
+ {
+ FrostArmor_Timer = 0;
+ }
+
+ void EnterCombat(Unit* /*who*/) OVERRIDE { }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ if (FrostArmor_Timer <= diff)
+ {
+ DoCast(me, SPELL_FROST_ARMOR);
+ FrostArmor_Timer = 180000;
+ }
+ else FrostArmor_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_wg_queueAI(creature);
+ }
+
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
{
if (creature->IsQuestGiver())
diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp
index 00adfa59d8d..8f5ae0f65ff 100644
--- a/src/server/scripts/Northrend/zone_zuldrak.cpp
+++ b/src/server/scripts/Northrend/zone_zuldrak.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -457,6 +457,8 @@ public:
void Reset() OVERRIDE
{
+ _playerGUID = 0;
+ _getingredienttry = 0;
_events.ScheduleEvent(EVENT_TURN_TO_POT, urand(15000, 26000));
}
@@ -504,7 +506,7 @@ public:
case EVENT_EASY_123:
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
{
- Talk(SAY_EASY_123, _playerGUID);
+ Talk(SAY_EASY_123, player);
DoCast(player, SPELL_RANDOM_INGREDIENT_EASY_AURA);
++_getingredienttry;
}
@@ -512,7 +514,7 @@ public:
case EVENT_MEDIUM_4:
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
{
- Talk(SAY_MEDIUM_4, _playerGUID);
+ Talk(SAY_MEDIUM_4, player);
DoCast(player, SPELL_RANDOM_INGREDIENT_MEDIUM_AURA);
++_getingredienttry;
}
@@ -520,7 +522,7 @@ public:
case EVENT_MEDIUM_5:
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
{
- Talk(SAY_MEDIUM_5, _playerGUID);
+ Talk(SAY_MEDIUM_5, player);
DoCast(player, SPELL_RANDOM_INGREDIENT_MEDIUM_AURA);
++_getingredienttry;
}
@@ -528,7 +530,7 @@ public:
case EVENT_HARD_6:
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
{
- Talk(SAY_HARD_6, _playerGUID);
+ Talk(SAY_HARD_6, player);
DoCast(player, SPELL_RANDOM_INGREDIENT_HARD_AURA);
++_getingredienttry;
}
@@ -691,7 +693,7 @@ class spell_random_ingredient : public SpellScriptLoader
if (Creature* finklestein = GetClosestCreatureWithEntry(player, NPC_FINKLESTEIN, 25.0f))
{
finklestein->CastSpell(player, FetchIngredients[ingredient][0], true, NULL);
- finklestein->AI()->Talk(FetchIngredients[ingredient][3], player->GetGUID());
+ finklestein->AI()->Talk(FetchIngredients[ingredient][3], player);
}
}
}
@@ -774,7 +776,7 @@ class spell_pot_check : public SpellScriptLoader
RemoveItems(player);
player->RemoveAura(SPELL_ALCHEMIST_APPRENTICE_INVISBUFF);
if (Creature* finklestein = GetClosestCreatureWithEntry(player, NPC_FINKLESTEIN, 25.0f))
- finklestein->AI()->Talk(SAY_RUINED, player->GetGUID());
+ finklestein->AI()->Talk(SAY_RUINED, player);
return;
}
}
@@ -821,7 +823,7 @@ class spell_fetch_ingredient_aura : public SpellScriptLoader
if (Creature* finklestein = GetClosestCreatureWithEntry(target, NPC_FINKLESTEIN, 100.0f))
{
target->RemoveAura(SPELL_ALCHEMIST_APPRENTICE_INVISBUFF);
- finklestein->AI()->Talk(SAY_RUINED, target->GetGUID());
+ finklestein->AI()->Talk(SAY_RUINED, target);
}
}
diff --git a/src/server/scripts/OutdoorPvP/CMakeLists.txt b/src/server/scripts/OutdoorPvP/CMakeLists.txt
index 1789cbc1ffe..01347e134ea 100644
--- a/src/server/scripts/OutdoorPvP/CMakeLists.txt
+++ b/src/server/scripts/OutdoorPvP/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
index f5d04154686..b8a28a3248a 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h
index cdd944107bc..ecf9d80f071 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
index 4fd9f380350..5af51a5d07f 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h
index a477b2af8a4..fa78da4732d 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
index c77d05e1150..41cd17e1afd 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h
index 637f86591d4..cc32397741c 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
index 41ebf577f68..30ca2e8cb3f 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h
index bfad558e3e0..050bd6e8889 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
index 7a7efd2c81d..2877c5c0dcc 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h
index be6032a82f5..2c4ad0445be 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp
index 1308d61f333..df526ed068d 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
index d6743428db0..4b810ddb15f 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h
index 21e82a1702d..d741044eea7 100644
--- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h
+++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp
index 4f7ac113547..5266a7bd137 100644
--- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp
+++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -68,6 +68,7 @@ public:
void Reset() OVERRIDE
{
+ myClass = CLASS_NONE;
Class_Timer = 1000;
}
@@ -249,7 +250,7 @@ public:
if (!Avatar_summoned && HealthBelowPct(25))
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(true);
Talk(SAY_SUMMON);
@@ -265,7 +266,7 @@ public:
{
if (target->GetTypeId() == TYPEID_PLAYER)
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(true);
Talk(SAY_ROAR);
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 9f7a27ecdef..f73ff46908b 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -149,7 +149,7 @@ public:
{
FocusedTargetGUID = target->GetGUID();
me->SummonCreature(NPC_FOCUS_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 5500);
- Talk(EMOTE_FOCUSED, FocusedTargetGUID);
+ Talk(EMOTE_FOCUSED, target);
}
FocusFire_Timer = 15000+(rand()%5000);
} else FocusFire_Timer -= diff;
diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/instance_auchenai_crypts.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/instance_auchenai_crypts.cpp
index 56279f20e4c..b003039f484 100644
--- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/instance_auchenai_crypts.cpp
+++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/instance_auchenai_crypts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp
index 862fe76decd..7ccf7a7f9b2 100644
--- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -170,7 +170,7 @@ public:
if (FrostNova_Timer <= diff)
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(true);
DoCast(me, SPELL_FROSTNOVA);
@@ -194,7 +194,7 @@ public:
{
if (Blink_Timer <= diff)
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(true);
//expire movement, will prevent from running right back to victim after cast
@@ -210,7 +210,7 @@ public:
if (Beacon_Timer <= diff)
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(true);
if (!urand(0, 3))
@@ -301,7 +301,7 @@ public:
if (Apprentice_Timer <= diff)
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(true);
DoCast(me, SPELL_ETHEREAL_APPRENTICE, true);
diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp
index 3a845842934..267acbc95eb 100644
--- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -107,7 +107,7 @@ public:
{
if (DarkShell_Timer <= diff)
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(true);
Talk(EMOTE_DARK_SHELL);
diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/instance_mana_tombs.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/instance_mana_tombs.cpp
index 77a5841cb39..baf8d2b7d01 100644
--- a/src/server/scripts/Outland/Auchindoun/ManaTombs/instance_mana_tombs.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/instance_mana_tombs.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/mana_tombs.h b/src/server/scripts/Outland/Auchindoun/ManaTombs/mana_tombs.h
index 9199ef1945b..89eefa19d6a 100644
--- a/src/server/scripts/Outland/Auchindoun/ManaTombs/mana_tombs.h
+++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/mana_tombs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_anzu.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_anzu.cpp
index af8a4390d96..d888121403f 100644
--- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_anzu.cpp
+++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_anzu.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -140,7 +140,7 @@ class boss_anzu : public CreatureScript
if (target->getPowerType() == POWER_MANA)
{
DoCast(target, SPELL_SPELL_BOMB);
- Talk(SAY_SPELL_BOMB, target->GetGUID());
+ Talk(SAY_SPELL_BOMB, target);
}
}
break;
diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp
index c077cec3c04..25fdf84e739 100644
--- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp
+++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -115,7 +115,7 @@ public:
{
Talk(SAY_SUMMON);
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_SUMMON_SYTH_ARCANE, true); //front
diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp
index 022ac3e9e4d..e6c416a3b61 100644
--- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp
+++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -167,7 +167,7 @@ public:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(false);
//Spell doesn't work, but we use for visual effect at least
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 08cefb83c96..d70cc5dd566 100644
--- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
+++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h b/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h
index 58b8d4d157c..aeca1b88fcd 100644
--- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h
+++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp
index 1fa589af3a1..e0f25bb18e2 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp
index ec3465a0bfc..d84181046de 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
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 44ef5e8e42c..2bdd86afe47 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp
index 38c14292289..130cdf31d42 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp
index a401a74273f..9e324d99879 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h
index fd073903748..d7ef52cc7a7 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp
index 57c494756e5..ba8eb2194f5 100644
--- a/src/server/scripts/Outland/BlackTemple/black_temple.cpp
+++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -207,7 +207,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_wrathbone_flayerAI(creature);
+ return GetInstanceAI<npc_wrathbone_flayerAI>(creature);
}
};
diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.h b/src/server/scripts/Outland/BlackTemple/black_temple.h
index fb529a6b522..4af561480be 100644
--- a/src/server/scripts/Outland/BlackTemple/black_temple.h
+++ b/src/server/scripts/Outland/BlackTemple/black_temple.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp
index 3a33885144d..a6a16f83a26 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -64,7 +64,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_gurtogg_bloodboilAI(creature);
+ return GetInstanceAI<boss_gurtogg_bloodboilAI>(creature);
}
struct boss_gurtogg_bloodboilAI : public ScriptedAI
@@ -95,8 +95,7 @@ public:
void Reset() OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_GURTOGG_BLOODBOIL, NOT_STARTED);
+ instance->SetBossState(DATA_GURTOGG_BLOODBOIL, NOT_STARTED);
TargetGUID = 0;
@@ -123,8 +122,7 @@ public:
{
DoZoneInCombat();
Talk(SAY_AGGRO);
- if (instance)
- instance->SetBossState(DATA_GURTOGG_BLOODBOIL, IN_PROGRESS);
+ instance->SetBossState(DATA_GURTOGG_BLOODBOIL, IN_PROGRESS);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -134,8 +132,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_GURTOGG_BLOODBOIL, DONE);
+ instance->SetBossState(DATA_GURTOGG_BLOODBOIL, DONE);
Talk(SAY_DEATH);
}
diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
index 3f90118ec8b..3bbd41afc89 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -541,9 +541,6 @@ public:
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- if (!instance)
- return;
-
instance->SetBossState(DATA_ILLIDAN_STORMRAGE, DONE);
for (uint8 i = DATA_GO_ILLIDAN_DOOR_R; i < DATA_GO_ILLIDAN_DOOR_L + 1; ++i)
@@ -608,7 +605,7 @@ public:
if (Conversation[count].emote)
creature->HandleEmoteCommand(Conversation[count].emote); // Make the Creature do some animation!
if (Conversation[count].text.size())
- creature->MonsterYell(Conversation[count].text.c_str(), LANG_UNIVERSAL, 0); // Have the Creature yell out some text
+ creature->MonsterYell(Conversation[count].text.c_str(), LANG_UNIVERSAL, NULL); // Have the Creature yell out some text
if (Conversation[count].sound)
DoPlaySoundToSet(creature, Conversation[count].sound); // Play some sound on the creature
}
@@ -764,7 +761,7 @@ public:
if (!MaievGUID) // If Maiev cannot be summoned, reset the encounter and post some errors to the console.
{
EnterEvadeMode();
- me->MonsterTextEmote(EMOTE_UNABLE_TO_SUMMON, 0);
+ me->MonsterTextEmote(EMOTE_UNABLE_TO_SUMMON, NULL);
TC_LOG_ERROR("scripts", "SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)");
}
}
@@ -974,7 +971,7 @@ public:
break;
}
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
return;
if (Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || (Phase == PHASE_NORMAL_MAIEV && !me->HasAura(SPELL_CAGED)))
@@ -1126,7 +1123,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_illidan_stormrageAI(creature);
+ return GetInstanceAI<boss_illidan_stormrageAI>(creature);
}
};
@@ -1368,37 +1365,27 @@ public:
void Reset() OVERRIDE
{
WalkCount = 0;
- if (instance)
- {
- instance->SetBossState(DATA_ILLIDAN_STORMRAGE, NOT_STARTED);
+ instance->SetBossState(DATA_ILLIDAN_STORMRAGE, NOT_STARTED);
- IllidanGUID = instance->GetData64(DATA_ILLIDAN_STORMRAGE);
- GateGUID = instance->GetData64(DATA_GO_ILLIDAN_GATE);
- DoorGUID[0] = instance->GetData64(DATA_GO_ILLIDAN_DOOR_R);
- DoorGUID[1] = instance->GetData64(DATA_GO_ILLIDAN_DOOR_L);
-
- if (JustCreated) // close all doors at create
- {
- instance->HandleGameObject(GateGUID, false);
+ IllidanGUID = instance->GetData64(DATA_ILLIDAN_STORMRAGE);
+ GateGUID = instance->GetData64(DATA_GO_ILLIDAN_GATE);
+ DoorGUID[0] = instance->GetData64(DATA_GO_ILLIDAN_DOOR_R);
+ DoorGUID[1] = instance->GetData64(DATA_GO_ILLIDAN_DOOR_L);
- for (uint8 i = 0; i < 2; ++i)
- instance->HandleGameObject(DoorGUID[i], false);
- }
- else // open all doors, raid wiped
- {
- instance->HandleGameObject(GateGUID, true);
- WalkCount = 1; // skip first wp
+ if (JustCreated) // close all doors at create
+ {
+ instance->HandleGameObject(GateGUID, false);
- for (uint8 i = 0; i < 2; ++i)
- instance->HandleGameObject(DoorGUID[i], true);
- }
+ for (uint8 i = 0; i < 2; ++i)
+ instance->HandleGameObject(DoorGUID[i], false);
}
- else
+ else // open all doors, raid wiped
{
- IllidanGUID = 0;
- GateGUID = 0;
- DoorGUID[0] = 0;
- DoorGUID[1] = 0;
+ instance->HandleGameObject(GateGUID, true);
+ WalkCount = 1; // skip first wp
+
+ for (uint8 i = 0; i < 2; ++i)
+ instance->HandleGameObject(DoorGUID[i], true);
}
ChannelGUID = 0;
@@ -1461,9 +1448,6 @@ public:
void BeginTalk()
{
- if (!instance)
- return;
-
instance->SetBossState(DATA_ILLIDAN_STORMRAGE, IN_PROGRESS);
for (uint8 i = 0; i < 2; ++i)
instance->HandleGameObject(DoorGUID[i], false);
@@ -1515,8 +1499,6 @@ public:
void EnterPhase(PhaseAkama NextPhase)
{
- if (!instance)
- return;
switch (NextPhase)
{
case PHASE_CHANNEL:
@@ -1634,8 +1616,7 @@ public:
me->InterruptNonMeleeSpells(true);
Spirit[0]->InterruptNonMeleeSpells(true);
Spirit[1]->InterruptNonMeleeSpells(true);
- if (instance)
- instance->HandleGameObject(GateGUID, true);
+ instance->HandleGameObject(GateGUID, true);
Timer = 2000;
break;
case 4:
@@ -1664,8 +1645,7 @@ public:
{
case 6:
for (uint8 i = 0; i < 2; ++i)
- if (instance)
- instance->HandleGameObject(DoorGUID[i], true);
+ instance->HandleGameObject(DoorGUID[i], true);
break;
case 8:
if (Phase == PHASE_WALK)
@@ -1794,14 +1774,13 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_akama_illidanAI(creature);
+ return GetInstanceAI<npc_akama_illidanAI>(creature);
}
};
void boss_illidan_stormrage::boss_illidan_stormrageAI::Reset()
{
- if (instance)
- instance->SetBossState(DATA_ILLIDAN_STORMRAGE, NOT_STARTED);
+ instance->SetBossState(DATA_ILLIDAN_STORMRAGE, NOT_STARTED);
if (Creature* akama = ObjectAccessor::GetCreature(*me, AkamaGUID))
{
@@ -2160,10 +2139,7 @@ public:
void Reset() OVERRIDE
{
- if (instance)
- IllidanGUID = instance->GetData64(DATA_ILLIDAN_STORMRAGE);
- else
- IllidanGUID = 0;
+ IllidanGUID = instance->GetData64(DATA_ILLIDAN_STORMRAGE);
CheckTimer = 5000;
DoCast(me, SPELL_SHADOWFIEND_PASSIVE, true);
@@ -2228,7 +2204,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_parasitic_shadowfiendAI(creature);
+ return GetInstanceAI<npc_parasitic_shadowfiendAI>(creature);
}
};
diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
index aafe5f365b2..7081607e755 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -84,7 +84,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_shahrazAI(creature);
+ return GetInstanceAI<boss_shahrazAI>(creature);
}
struct boss_shahrazAI : public ScriptedAI
@@ -113,8 +113,7 @@ public:
void Reset() OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_MOTHER_SHAHRAZ, NOT_STARTED);
+ instance->SetBossState(DATA_MOTHER_SHAHRAZ, NOT_STARTED);
for (uint8 i = 0; i<3; ++i)
TargetGUID[i] = 0;
@@ -136,8 +135,7 @@ public:
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_MOTHER_SHAHRAZ, IN_PROGRESS);
+ instance->SetBossState(DATA_MOTHER_SHAHRAZ, IN_PROGRESS);
DoZoneInCombat();
Talk(SAY_AGGRO);
@@ -150,8 +148,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_MOTHER_SHAHRAZ, DONE);
+ instance->SetBossState(DATA_MOTHER_SHAHRAZ, DONE);
Talk(SAY_DEATH);
}
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 ad913a45071..ca0ea947295 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -134,7 +134,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_reliquary_of_soulsAI(creature);
+ return GetInstanceAI<boss_reliquary_of_soulsAI>(creature);
}
struct boss_reliquary_of_soulsAI : public ScriptedAI
@@ -158,8 +158,7 @@ public:
void Reset() OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_RELIQUARY_OF_SOULS, NOT_STARTED);
+ instance->SetBossState(DATA_RELIQUARY_OF_SOULS, NOT_STARTED);
if (EssenceGUID)
{
@@ -197,8 +196,7 @@ public:
{
me->AddThreat(who, 10000.0f);
DoZoneInCombat();
- if (instance)
- instance->SetBossState(DATA_RELIQUARY_OF_SOULS, IN_PROGRESS);
+ instance->SetBossState(DATA_RELIQUARY_OF_SOULS, IN_PROGRESS);
Phase = 1;
Counter = 0;
@@ -243,8 +241,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_RELIQUARY_OF_SOULS, DONE);
+ instance->SetBossState(DATA_RELIQUARY_OF_SOULS, DONE);
}
void UpdateAI(uint32 diff) OVERRIDE
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 1a2a55e6d00..48d1af27649 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -198,8 +198,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_SHADE_OF_AKAMA, DONE);
+ instance->SetBossState(DATA_SHADE_OF_AKAMA, DONE);
}
void EnterCombat(Unit* /*who*/) OVERRIDE { }
@@ -405,7 +404,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_shade_of_akamaAI(creature);
+ return GetInstanceAI<boss_shade_of_akamaAI>(creature);
}
};
@@ -475,16 +474,13 @@ public:
switch (eventId)
{
case EVENT_SHADE_START:
- if (instance)
- {
- instance->SetBossState(DATA_SHADE_OF_AKAMA, IN_PROGRESS);
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- me->RemoveAura(SPELL_STEALTH);
- me->SetWalk(true);
- me->GetMotionMaster()->MovePoint(0, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z, false);
- events.ScheduleEvent(EVENT_SHADE_CHANNEL, 10000);
- break;
- }
+ instance->SetBossState(DATA_SHADE_OF_AKAMA, IN_PROGRESS);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveAura(SPELL_STEALTH);
+ me->SetWalk(true);
+ me->GetMotionMaster()->MovePoint(0, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z, false);
+ events.ScheduleEvent(EVENT_SHADE_CHANNEL, 10000);
+ break;
case EVENT_SHADE_CHANNEL:
me->AddUnitState(UNIT_STATE_ROOT);
me->SetFacingTo(3.118662f);
@@ -550,7 +546,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_akamaAI(creature);
+ return GetInstanceAI<npc_akamaAI>(creature);
}
};
@@ -622,7 +618,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ashtongue_channelerAI(creature);
+ return GetInstanceAI<npc_ashtongue_channelerAI>(creature);
}
};
@@ -730,7 +726,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_creature_generator_akamaAI(creature);
+ return GetInstanceAI<npc_creature_generator_akamaAI>(creature);
}
};
@@ -748,6 +744,7 @@ public:
npc_ashtongue_sorcererAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
+ startedBanishing = false;
}
void Reset() OVERRIDE
@@ -851,7 +848,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ashtongue_sorcererAI(creature);
+ return GetInstanceAI<npc_ashtongue_sorcererAI>(creature);
}
};
@@ -941,7 +938,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ashtongue_defenderAI(creature);
+ return GetInstanceAI<npc_ashtongue_defenderAI>(creature);
}
};
@@ -1021,7 +1018,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ashtongue_rogueAI(creature);
+ return GetInstanceAI<npc_ashtongue_rogueAI>(creature);
}
};
@@ -1101,7 +1098,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ashtongue_elementalistAI(creature);
+ return GetInstanceAI<npc_ashtongue_elementalistAI>(creature);
}
};
@@ -1198,7 +1195,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ashtongue_spiritbinderAI(creature);
+ return GetInstanceAI<npc_ashtongue_spiritbinderAI>(creature);
}
};
diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp
index b62e7b35a3c..551213b8b2c 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -90,7 +90,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_supremusAI(creature);
+ return GetInstanceAI<boss_supremusAI>(creature);
}
struct boss_supremusAI : public ScriptedAI
@@ -107,11 +107,8 @@ public:
void Reset() OVERRIDE
{
- if (instance)
- {
- if (me->IsAlive())
- instance->SetBossState(DATA_SUPREMUS, NOT_STARTED);
- }
+ if (me->IsAlive())
+ instance->SetBossState(DATA_SUPREMUS, NOT_STARTED);
phase = 0;
@@ -121,8 +118,7 @@ public:
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_SUPREMUS, IN_PROGRESS);
+ instance->SetBossState(DATA_SUPREMUS, IN_PROGRESS);
ChangePhase();
events.ScheduleEvent(EVENT_BERSERK, 900000, GCD_CAST);
@@ -158,8 +154,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_SUPREMUS, DONE);
+ instance->SetBossState(DATA_SUPREMUS, DONE);
summons.DespawnAll();
}
diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
index 7d445e23053..8deac58461c 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -217,7 +217,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_teron_gorefiendAI(creature);
+ return GetInstanceAI<boss_teron_gorefiendAI>(creature);
}
struct boss_teron_gorefiendAI : public ScriptedAI
@@ -246,8 +246,7 @@ public:
void Reset() OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_TERON_GOREFIEND, NOT_STARTED);
+ instance->SetBossState(DATA_TERON_GOREFIEND, NOT_STARTED);
IncinerateTimer = urand(20000, 31000);
SummonDoomBlossomTimer = 12000;
@@ -275,8 +274,7 @@ public:
{
if (me->IsWithinDistInMap(who, VISIBLE_RANGE) && me->IsWithinLOSInMap(who))
{
- if (instance)
- instance->SetBossState(DATA_TERON_GOREFIEND, IN_PROGRESS);
+ instance->SetBossState(DATA_TERON_GOREFIEND, IN_PROGRESS);
me->GetMotionMaster()->Clear(false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -297,8 +295,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_TERON_GOREFIEND, DONE);
+ instance->SetBossState(DATA_TERON_GOREFIEND, DONE);
Talk(SAY_DEATH);
}
diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
index 1f4a36afad6..39fcbc16297 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -78,7 +78,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_najentusAI(creature);
+ return GetInstanceAI<boss_najentusAI>(creature);
}
struct boss_najentusAI : public ScriptedAI
@@ -99,8 +99,7 @@ public:
SpineTargetGUID = 0;
- if (instance)
- instance->SetBossState(DATA_HIGH_WARLORD_NAJENTUS, NOT_STARTED);
+ instance->SetBossState(DATA_HIGH_WARLORD_NAJENTUS, NOT_STARTED);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -111,8 +110,7 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_HIGH_WARLORD_NAJENTUS, DONE);
+ instance->SetBossState(DATA_HIGH_WARLORD_NAJENTUS, DONE);
Talk(SAY_DEATH);
}
@@ -129,8 +127,7 @@ public:
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetBossState(DATA_HIGH_WARLORD_NAJENTUS, IN_PROGRESS);
+ instance->SetBossState(DATA_HIGH_WARLORD_NAJENTUS, IN_PROGRESS);
Talk(SAY_AGGRO);
DoZoneInCombat();
diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp
index 057bb725c32..2db95b6ea53 100644
--- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp
+++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -218,7 +218,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_illidari_councilAI(creature);
+ return GetInstanceAI<npc_illidari_councilAI>(creature);
}
struct npc_illidari_councilAI : public ScriptedAI
@@ -263,12 +263,9 @@ public:
pMember->AI()->EnterEvadeMode();
}
- if (instance)
- {
- instance->SetBossState(DATA_ILLIDARI_COUNCIL, NOT_STARTED);
- if (Creature* VoiceTrigger = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))
- VoiceTrigger->AI()->EnterEvadeMode();
- }
+ instance->SetBossState(DATA_ILLIDARI_COUNCIL, NOT_STARTED);
+ if (Creature* VoiceTrigger = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))
+ VoiceTrigger->AI()->EnterEvadeMode();
EventBegun = false;
@@ -284,9 +281,6 @@ public:
void StartEvent(Unit* target)
{
- if (!instance)
- return;
-
if (target && target->IsAlive())
{
Council[0] = instance->GetData64(DATA_GATHIOS_THE_SHATTERER);
@@ -328,13 +322,10 @@ public:
{
if (DeathCount > 3)
{
- if (instance)
- {
- if (Creature* VoiceTrigger = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))
- VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- instance->SetBossState(DATA_ILLIDARI_COUNCIL, DONE);
- //me->SummonCreature(AKAMAID, 746.466980f, 304.394989f, 311.90208f, 6.272870f, TEMPSUMMON_DEAD_DESPAWN, 0);
- }
+ if (Creature* VoiceTrigger = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))
+ VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ instance->SetBossState(DATA_ILLIDARI_COUNCIL, DONE);
+ //me->SummonCreature(AKAMAID, 746.466980f, 304.394989f, 311.90208f, 6.272870f, TEMPSUMMON_DEAD_DESPAWN, 0);
me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return;
}
@@ -401,17 +392,8 @@ struct boss_illidari_councilAI : public ScriptedAI
void EnterCombat(Unit* who) OVERRIDE
{
- if (instance)
- {
- if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ILLIDARI_COUNCIL)))
- CAST_AI(npc_illidari_council::npc_illidari_councilAI, controller->AI())->StartEvent(who);
- }
- else
- {
- TC_LOG_ERROR("scripts", ERROR_INST_DATA);
- EnterEvadeMode();
- return;
- }
+ if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ILLIDARI_COUNCIL)))
+ CAST_AI(npc_illidari_council::npc_illidari_councilAI, controller->AI())->StartEvent(who);
DoZoneInCombat();
// Load GUIDs on first aggro because the Creature guids are only set as the creatures are created in world-
// this means that for each creature, it will attempt to LoadGUIDs even though some of the other creatures are
@@ -454,12 +436,6 @@ struct boss_illidari_councilAI : public ScriptedAI
void LoadGUIDs()
{
- if (!instance)
- {
- TC_LOG_ERROR("scripts", ERROR_INST_DATA);
- return;
- }
-
Council[0] = instance->GetData64(DATA_LADY_MALANDE);
Council[1] = instance->GetData64(DATA_HIGH_NETHERMANCER_ZEREVOR);
Council[2] = instance->GetData64(DATA_GATHIOS_THE_SHATTERER);
@@ -476,7 +452,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_gathios_the_shattererAI(creature);
+ return GetInstanceAI<boss_gathios_the_shattererAI>(creature);
}
struct boss_gathios_the_shattererAI : public boss_illidari_councilAI
@@ -608,7 +584,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_high_nethermancer_zerevorAI(creature);
+ return GetInstanceAI<boss_high_nethermancer_zerevorAI>(creature);
}
struct boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI
@@ -712,7 +688,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_lady_malandeAI(creature);
+ return GetInstanceAI<boss_lady_malandeAI>(creature);
}
struct boss_lady_malandeAI : public boss_illidari_councilAI
@@ -790,7 +766,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_veras_darkshadowAI(creature);
+ return GetInstanceAI<boss_veras_darkshadowAI>(creature);
}
struct boss_veras_darkshadowAI : public boss_illidari_councilAI
diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
index 591f28a19f3..91ee58ea286 100644
--- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
+++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/CMakeLists.txt b/src/server/scripts/Outland/CMakeLists.txt
index ab10ee2dfe4..414a3bce14a 100644
--- a/src/server/scripts/Outland/CMakeLists.txt
+++ b/src/server/scripts/Outland/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
index a27677f60f5..6d632c81bca 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -104,7 +104,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_fathomlord_karathressAI(creature);
+ return GetInstanceAI<boss_fathomlord_karathressAI>(creature);
}
struct boss_fathomlord_karathressAI : public ScriptedAI
@@ -135,27 +135,24 @@ public:
BlessingOfTides = false;
- if (instance)
- {
- uint64 RAdvisors[MAX_ADVISORS];
- RAdvisors[0] = instance->GetData64(DATA_SHARKKIS);
- RAdvisors[1] = instance->GetData64(DATA_TIDALVESS);
- RAdvisors[2] = instance->GetData64(DATA_CARIBDIS);
- //Respawn of the 3 Advisors
- Creature* pAdvisor = NULL;
- for (int i=0; i<MAX_ADVISORS; ++i)
- if (RAdvisors[i])
+ uint64 RAdvisors[MAX_ADVISORS];
+ RAdvisors[0] = instance->GetData64(DATA_SHARKKIS);
+ RAdvisors[1] = instance->GetData64(DATA_TIDALVESS);
+ RAdvisors[2] = instance->GetData64(DATA_CARIBDIS);
+ //Respawn of the 3 Advisors
+ Creature* pAdvisor = NULL;
+ for (int i=0; i<MAX_ADVISORS; ++i)
+ if (RAdvisors[i])
+ {
+ pAdvisor = (Unit::GetCreature((*me), RAdvisors[i]));
+ if (pAdvisor && !pAdvisor->IsAlive())
{
- pAdvisor = (Unit::GetCreature((*me), RAdvisors[i]));
- if (pAdvisor && !pAdvisor->IsAlive())
- {
- pAdvisor->Respawn();
- pAdvisor->AI()->EnterEvadeMode();
- pAdvisor->GetMotionMaster()->MoveTargetedHome();
- }
+ pAdvisor->Respawn();
+ pAdvisor->AI()->EnterEvadeMode();
+ pAdvisor->GetMotionMaster()->MoveTargetedHome();
}
- instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
- }
+ }
+ instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
}
@@ -179,9 +176,6 @@ public:
void GetAdvisors()
{
- if (!instance)
- return;
-
Advisors[0] = instance->GetData64(DATA_SHARKKIS);
Advisors[1] = instance->GetData64(DATA_TIDALVESS);
Advisors[2] = instance->GetData64(DATA_CARIBDIS);
@@ -189,9 +183,6 @@ public:
void StartEvent(Unit* who)
{
- if (!instance)
- return;
-
GetAdvisors();
Talk(SAY_AGGRO);
@@ -210,8 +201,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, DONE);
+ instance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, DONE);
//support for quest 10944
me->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000);
@@ -293,7 +283,7 @@ public:
if (continueTriggering)
{
DoCast(me, SPELL_BLESSING_OF_THE_TIDES);
- me->MonsterYell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL, 0);
+ me->MonsterYell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_GAIN_BLESSING_OF_TIDES);
}
}
@@ -312,7 +302,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_fathomguard_sharkkisAI(creature);
+ return GetInstanceAI<boss_fathomguard_sharkkisAI>(creature);
}
struct boss_fathomguard_sharkkisAI : public ScriptedAI
@@ -320,6 +310,7 @@ public:
boss_fathomguard_sharkkisAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
+ SummonedPet = 0;
}
InstanceScript* instance;
@@ -350,26 +341,19 @@ public:
SummonedPet = 0;
- if (instance)
- instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
+ instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- {
- if (Creature* Karathress = (Unit::GetCreature((*me), instance->GetData64(DATA_KARATHRESS))))
- CAST_AI(boss_fathomlord_karathress::boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath();
- }
+ if (Creature* Karathress = (Unit::GetCreature((*me), instance->GetData64(DATA_KARATHRESS))))
+ CAST_AI(boss_fathomlord_karathress::boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath();
}
void EnterCombat(Unit* who) OVERRIDE
{
- if (instance)
- {
- instance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
- instance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
- }
+ instance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
+ instance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -459,7 +443,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_fathomguard_tidalvessAI(creature);
+ return GetInstanceAI<boss_fathomguard_tidalvessAI>(creature);
}
struct boss_fathomguard_tidalvessAI : public ScriptedAI
@@ -483,26 +467,19 @@ public:
PoisonCleansing_Timer = 30000;
Earthbind_Timer = 45000;
- if (instance)
- instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
+ instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- {
- if (Creature* Karathress = Unit::GetCreature((*me), instance->GetData64(DATA_KARATHRESS)))
- CAST_AI(boss_fathomlord_karathress::boss_fathomlord_karathressAI, Karathress->AI())->EventTidalvessDeath();
- }
+ if (Creature* Karathress = Unit::GetCreature((*me), instance->GetData64(DATA_KARATHRESS)))
+ CAST_AI(boss_fathomlord_karathress::boss_fathomlord_karathressAI, Karathress->AI())->EventTidalvessDeath();
}
void EnterCombat(Unit* who) OVERRIDE
{
- if (instance)
- {
- instance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
- instance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
- }
+ instance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
+ instance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
DoCast(me, SPELL_WINDFURY_WEAPON);
}
@@ -582,7 +559,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_fathomguard_caribdisAI(creature);
+ return GetInstanceAI<boss_fathomguard_caribdisAI>(creature);
}
struct boss_fathomguard_caribdisAI : public ScriptedAI
@@ -606,26 +583,19 @@ public:
Heal_Timer = 55000;
Cyclone_Timer = 30000+rand()%10000;
- if (instance)
- instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
+ instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- {
- if (Creature* Karathress = Unit::GetCreature((*me), instance->GetData64(DATA_KARATHRESS)))
- CAST_AI(boss_fathomlord_karathress::boss_fathomlord_karathressAI, Karathress->AI())->EventCaribdisDeath();
- }
+ if (Creature* Karathress = Unit::GetCreature((*me), instance->GetData64(DATA_KARATHRESS)))
+ CAST_AI(boss_fathomlord_karathress::boss_fathomlord_karathressAI, Karathress->AI())->EventCaribdisDeath();
}
void EnterCombat(Unit* who) OVERRIDE
{
- if (instance)
- {
- instance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
- instance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
- }
+ instance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID());
+ instance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -705,24 +675,21 @@ public:
Unit* selectAdvisorUnit()
{
Unit* unit = NULL;
- if (instance)
- {
- switch (rand()%4)
- {
- case 0:
- unit = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESS));
- break;
- case 1:
- unit = Unit::GetUnit(*me, instance->GetData64(DATA_SHARKKIS));
- break;
- case 2:
- unit = Unit::GetUnit(*me, instance->GetData64(DATA_TIDALVESS));
- break;
- case 3:
- unit = me;
- break;
- }
- } else unit = me;
+ switch (rand()%4)
+ {
+ case 0:
+ unit = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESS));
+ break;
+ case 1:
+ unit = Unit::GetUnit(*me, instance->GetData64(DATA_SHARKKIS));
+ break;
+ case 2:
+ unit = Unit::GetUnit(*me, instance->GetData64(DATA_TIDALVESS));
+ break;
+ case 3:
+ unit = me;
+ break;
+ }
return unit;
}
};
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 d6205cb3ec7..56055d8a5b4 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -86,7 +86,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_hydross_the_unstableAI(creature);
+ return GetInstanceAI<boss_hydross_the_unstableAI>(creature);
}
struct boss_hydross_the_unstableAI : public ScriptedAI
@@ -134,8 +134,7 @@ public:
me->SetDisplayId(MODEL_CLEAN);
- if (instance)
- instance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED);
+ instance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED);
beam = false;
Summons.DespawnAll();
}
@@ -174,8 +173,7 @@ public:
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, IN_PROGRESS);
+ instance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, IN_PROGRESS);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -208,8 +206,7 @@ public:
{
Talk(CorruptedForm ? SAY_CORRUPT_DEATH : SAY_CLEAN_DEATH);
- if (instance)
- instance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, DONE);
+ instance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, DONE);
Summons.DespawnAll();
}
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 1d233aa6da4..b421d9c1153 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -140,7 +140,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_lady_vashjAI(creature);
+ return GetInstanceAI<boss_lady_vashjAI>(creature);
}
struct boss_lady_vashjAI : public ScriptedAI
@@ -215,8 +215,7 @@ public:
}
}
- if (instance)
- instance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED);
+ instance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED);
me->SetCorpseDelay(1000*60*60);
}
@@ -237,8 +236,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_LADYVASHJEVENT, DONE);
+ instance->SetData(DATA_LADYVASHJEVENT, DONE);
}
void StartEvent()
@@ -247,21 +245,17 @@ public:
Phase = 1;
- if (instance)
- instance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS);
+ instance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS);
}
void EnterCombat(Unit* who) OVERRIDE
{
- if (instance)
- {
- // remove old tainted cores to prevent cheating in phase 2
- Map* map = me->GetMap();
- Map::PlayerList const &PlayerList = map->GetPlayers();
- for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
- if (Player* player = itr->GetSource())
- player->DestroyItemCount(31088, 1, true);
- }
+ // remove old tainted cores to prevent cheating in phase 2
+ Map* map = me->GetMap();
+ Map::PlayerList const &PlayerList = map->GetPlayers();
+ for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
+ if (Player* player = itr->GetSource())
+ player->DestroyItemCount(31088, 1, true);
StartEvent(); // this is EnterCombat(), so were are 100% in combat, start the event
if (Phase != 2)
@@ -556,7 +550,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_enchanted_elementalAI(creature);
+ return GetInstanceAI<npc_enchanted_elementalAI>(creature);
}
struct npc_enchanted_elementalAI : public ScriptedAI
@@ -580,8 +574,6 @@ public:
Move = 0;
Phase = 1;
- VashjGUID = 0;
-
X = ElementWPPos[0][0];
Y = ElementWPPos[0][1];
Z = ElementWPPos[0][2];
@@ -597,8 +589,7 @@ public:
}
}
- if (instance)
- VashjGUID = instance->GetData64(DATA_LADYVASHJ);
+ VashjGUID = instance->GetData64(DATA_LADYVASHJ);
}
void EnterCombat(Unit* /*who*/) OVERRIDE { }
@@ -608,9 +599,6 @@ public:
void UpdateAI(uint32 diff) OVERRIDE
{
- if (!instance)
- return;
-
if (!VashjGUID)
return;
@@ -651,7 +639,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_tainted_elementalAI(creature);
+ return GetInstanceAI<npc_tainted_elementalAI>(creature);
}
struct npc_tainted_elementalAI : public ScriptedAI
@@ -674,9 +662,8 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- if (Creature* vashj = Unit::GetCreature((*me), instance->GetData64(DATA_LADYVASHJ)))
- CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->EventTaintedElementalDeath();
+ if (Creature* vashj = Unit::GetCreature((*me), instance->GetData64(DATA_LADYVASHJ)))
+ CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->EventTaintedElementalDeath();
}
void EnterCombat(Unit* who) OVERRIDE
@@ -720,7 +707,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_toxic_sporebatAI(creature);
+ return GetInstanceAI<npc_toxic_sporebatAI>(creature);
}
struct npc_toxic_sporebatAI : public ScriptedAI
@@ -790,17 +777,14 @@ public:
// CheckTimer
if (CheckTimer <= diff)
{
- if (instance)
+ // check if vashj is death
+ Unit* Vashj = Unit::GetUnit(*me, instance->GetData64(DATA_LADYVASHJ));
+ if (!Vashj || !Vashj->IsAlive() || CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->ToCreature()->AI())->Phase != 3)
{
- // check if vashj is death
- Unit* Vashj = Unit::GetUnit(*me, instance->GetData64(DATA_LADYVASHJ));
- if (!Vashj || !Vashj->IsAlive() || CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->ToCreature()->AI())->Phase != 3)
- {
- // remove
- me->setDeathState(DEAD);
- me->RemoveCorpse();
- me->setFaction(35);
- }
+ // remove
+ me->setDeathState(DEAD);
+ me->RemoveCorpse();
+ me->setFaction(35);
}
CheckTimer = 1000;
@@ -819,7 +803,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_shield_generator_channelAI(creature);
+ return GetInstanceAI<npc_shield_generator_channelAI>(creature);
}
struct npc_shield_generator_channelAI : public ScriptedAI
@@ -831,12 +815,12 @@ public:
InstanceScript* instance;
uint32 CheckTimer;
- bool Casted;
+ bool Cast;
void Reset() OVERRIDE
{
CheckTimer = 0;
- Casted = false;
+ Cast = false;
me->SetDisplayId(11686); // invisible
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -847,9 +831,6 @@ public:
void UpdateAI(uint32 diff) OVERRIDE
{
- if (!instance)
- return;
-
if (CheckTimer <= diff)
{
Unit* vashj = Unit::GetUnit(*me, instance->GetData64(DATA_LADYVASHJ));
@@ -857,10 +838,10 @@ public:
if (vashj && vashj->IsAlive())
{
// start visual channel
- if (!Casted || !vashj->HasAura(SPELL_MAGIC_BARRIER))
+ if (!Cast || !vashj->HasAura(SPELL_MAGIC_BARRIER))
{
DoCast(vashj, SPELL_MAGIC_BARRIER, true);
- Casted = true;
+ Cast = true;
}
}
CheckTimer = 1000;
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 83ec5e053c0..a45e4ddb0a9 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -181,7 +181,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_leotheras_the_blindAI(creature);
+ return GetInstanceAI<boss_leotheras_the_blindAI>(creature);
}
struct boss_leotheras_the_blindAI : public ScriptedAI
@@ -242,8 +242,7 @@ public:
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
DoCast(me, SPELL_DUAL_WIELD, true);
me->SetCorpseDelay(1000*60*60);
- if (instance)
- instance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED);
+ instance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED);
}
void CheckChannelers(/*bool DoEvade = true*/)
@@ -290,8 +289,7 @@ public:
void StartEvent()
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_LEOTHERASTHEBLINDEVENT, IN_PROGRESS);
+ instance->SetData(DATA_LEOTHERASTHEBLINDEVENT, IN_PROGRESS);
}
void CheckBanish()
@@ -402,8 +400,7 @@ public:
if (Creature* pDemon = Unit::GetCreature(*me, Demon))
pDemon->DespawnOrUnsummon();
}
- if (instance)
- instance->SetData(DATA_LEOTHERASTHEBLINDEVENT, DONE);
+ instance->SetData(DATA_LEOTHERASTHEBLINDEVENT, DONE);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -677,7 +674,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_greyheart_spellbinderAI(creature);
+ return GetInstanceAI<npc_greyheart_spellbinderAI>(creature);
}
struct npc_greyheart_spellbinderAI : public ScriptedAI
@@ -703,20 +700,16 @@ public:
Mindblast_Timer = urand(3000, 8000);
Earthshock_Timer = urand(5000, 10000);
- if (instance)
- {
- instance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, 0);
- Creature* leotheras = Unit::GetCreature(*me, leotherasGUID);
- if (leotheras && leotheras->IsAlive())
- CAST_AI(boss_leotheras_the_blind::boss_leotheras_the_blindAI, leotheras->AI())->CheckChannelers(/*false*/);
- }
+ instance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, 0);
+ Creature* leotheras = Unit::GetCreature(*me, leotherasGUID);
+ if (leotheras && leotheras->IsAlive())
+ CAST_AI(boss_leotheras_the_blind::boss_leotheras_the_blindAI, leotheras->AI())->CheckChannelers(/*false*/);
}
void EnterCombat(Unit* who) OVERRIDE
{
me->InterruptNonMeleeSpells(false);
- if (instance)
- instance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, who->GetGUID());
+ instance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, who->GetGUID());
}
void JustRespawned() OVERRIDE
@@ -740,18 +733,15 @@ public:
void UpdateAI(uint32 diff) OVERRIDE
{
- if (instance)
- {
- if (!leotherasGUID)
- leotherasGUID = instance->GetData64(DATA_LEOTHERAS);
+ if (!leotherasGUID)
+ leotherasGUID = instance->GetData64(DATA_LEOTHERAS);
- if (!me->IsInCombat() && instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
- {
- Unit* victim = NULL;
- victim = Unit::GetUnit(*me, instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER));
- if (victim)
- AttackStart(victim);
- }
+ if (!me->IsInCombat() && instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
+ {
+ Unit* victim = NULL;
+ victim = Unit::GetUnit(*me, instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER));
+ if (victim)
+ AttackStart(victim);
}
if (!UpdateVictim())
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 0393379d26a..a6cd426f435 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -81,7 +81,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_the_lurker_belowAI(creature);
+ return GetInstanceAI<boss_the_lurker_belowAI>(creature);
}
struct boss_the_lurker_belowAI : public ScriptedAI
@@ -138,11 +138,8 @@ public:
Summons.DespawnAll();
- if (instance)
- {
- instance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED);
- instance->SetData(DATA_STRANGE_POOL, NOT_STARTED);
- }
+ instance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED);
+ instance->SetData(DATA_STRANGE_POOL, NOT_STARTED);
DoCast(me, SPELL_SUBMERGE); // submerge anim
me->SetVisible(false); // we start invis under water, submerged
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -151,19 +148,15 @@ public:
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- {
- instance->SetData(DATA_THELURKERBELOWEVENT, DONE);
- instance->SetData(DATA_STRANGE_POOL, IN_PROGRESS);
- }
+ instance->SetData(DATA_THELURKERBELOWEVENT, DONE);
+ instance->SetData(DATA_STRANGE_POOL, IN_PROGRESS);
Summons.DespawnAll();
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS);
+ instance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS);
}
void MoveInLineOfSight(Unit* who) OVERRIDE
@@ -240,7 +233,7 @@ public:
if (SpoutTimer <= diff)
{
- me->MonsterTextEmote(EMOTE_SPOUT, 0, true);
+ me->MonsterTextEmote(EMOTE_SPOUT, NULL, true);
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->MoveRotate(20000, urand(0, 1) ? ROTATE_DIRECTION_LEFT : ROTATE_DIRECTION_RIGHT);
SpoutTimer = 45000;
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp
index 48a4a1e5ecd..77fd36f2f5e 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -91,7 +91,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_morogrim_tidewalkerAI(creature);
+ return GetInstanceAI<boss_morogrim_tidewalkerAI>(creature);
}
struct boss_morogrim_tidewalkerAI : public ScriptedAI
@@ -130,16 +130,14 @@ public:
Earthquake = false;
Phase2 = false;
- if (instance)
- instance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED);
+ instance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED);
}
void StartEvent()
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS);
+ instance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -151,8 +149,7 @@ public:
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, DONE);
+ instance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, DONE);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
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 7590faee1db..528726723ed 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h
index 278b8169fca..f7f3bc9c24b 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp
index d6162fd1ea4..70b36e31713 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -41,7 +41,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_thespiaAI(creature);
+ return GetInstanceAI<boss_thespiaAI>(creature);
}
struct boss_thespiaAI : public ScriptedAI
@@ -63,16 +63,14 @@ public:
LungBurst_Timer = 7000;
EnvelopingWinds_Timer = 9000;
- if (instance)
- instance->SetBossState(DATA_HYDROMANCER_THESPIA, NOT_STARTED);
+ instance->SetBossState(DATA_HYDROMANCER_THESPIA, NOT_STARTED);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
Talk(SAY_DEAD);
- if (instance)
- instance->SetBossState(DATA_HYDROMANCER_THESPIA, DONE);
+ instance->SetBossState(DATA_HYDROMANCER_THESPIA, DONE);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -84,8 +82,7 @@ public:
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetBossState(DATA_HYDROMANCER_THESPIA, IN_PROGRESS);
+ instance->SetBossState(DATA_HYDROMANCER_THESPIA, IN_PROGRESS);
}
void UpdateAI(uint32 diff) OVERRIDE
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp
index 241d0f8fec2..42833fead04 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -57,7 +57,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_mekgineer_steamriggerAI(creature);
+ return GetInstanceAI<boss_mekgineer_steamriggerAI>(creature);
}
struct boss_mekgineer_steamriggerAI : public ScriptedAI
@@ -86,16 +86,14 @@ public:
Summon50 = false;
Summon25 = false;
- if (instance)
- instance->SetBossState(DATA_MEKGINEER_STEAMRIGGER, NOT_STARTED);
+ instance->SetBossState(DATA_MEKGINEER_STEAMRIGGER, NOT_STARTED);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetBossState(DATA_MEKGINEER_STEAMRIGGER, DONE);
+ instance->SetBossState(DATA_MEKGINEER_STEAMRIGGER, DONE);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -107,8 +105,7 @@ public:
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetBossState(DATA_MEKGINEER_STEAMRIGGER, IN_PROGRESS);
+ instance->SetBossState(DATA_MEKGINEER_STEAMRIGGER, IN_PROGRESS);
}
//no known summon spells exist
@@ -197,7 +194,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_steamrigger_mechanicAI(creature);
+ return GetInstanceAI<npc_steamrigger_mechanicAI>(creature);
}
struct npc_steamrigger_mechanicAI : public ScriptedAI
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 887d51a43bf..fe035fc1dec 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -50,7 +50,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_naga_distillerAI(creature);
+ return GetInstanceAI<npc_naga_distillerAI>(creature);
}
struct npc_naga_distillerAI : public ScriptedAI
@@ -68,13 +68,10 @@ public:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
//hack, due to really weird spell behaviour :(
- if (instance)
+ if (instance->GetData(DATA_DISTILLER) == IN_PROGRESS)
{
- if (instance->GetData(DATA_DISTILLER) == IN_PROGRESS)
- {
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
}
@@ -87,15 +84,13 @@ public:
DoCast(me, SPELL_WARLORDS_RAGE_NAGA, true);
- if (instance)
- instance->SetData(DATA_DISTILLER, IN_PROGRESS);
+ instance->SetData(DATA_DISTILLER, IN_PROGRESS);
}
void DamageTaken(Unit* /*done_by*/, uint32 &damage) OVERRIDE
{
if (me->GetHealth() <= damage)
- if (instance)
- instance->SetData(DATA_DISTILLER, DONE);
+ instance->SetData(DATA_DISTILLER, DONE);
}
};
@@ -108,7 +103,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_warlord_kalithreshAI(creature);
+ return GetInstanceAI<boss_warlord_kalithreshAI>(creature);
}
struct boss_warlord_kalithreshAI : public ScriptedAI
@@ -132,16 +127,14 @@ public:
Rage_Timer = 45000;
CanRage = false;
- if (instance)
- instance->SetBossState(DATA_WARLORD_KALITHRESH, NOT_STARTED);
+ instance->SetBossState(DATA_WARLORD_KALITHRESH, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetBossState(DATA_WARLORD_KALITHRESH, IN_PROGRESS);
+ instance->SetBossState(DATA_WARLORD_KALITHRESH, IN_PROGRESS);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -153,17 +146,15 @@ public:
{
//hack :(
if (spell->Id == SPELL_WARLORDS_RAGE_PROC)
- if (instance)
- if (instance->GetData(DATA_DISTILLER) == DONE)
- me->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC);
+ if (instance->GetData(DATA_DISTILLER) == DONE)
+ me->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
Talk(SAY_DEATH);
- if (instance)
- instance->SetBossState(DATA_WARLORD_KALITHRESH, DONE);
+ instance->SetBossState(DATA_WARLORD_KALITHRESH, DONE);
}
void UpdateAI(uint32 diff) OVERRIDE
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp
index 784b7c59736..bd2d4d5f416 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h
index c0832ed8909..e1761c80769 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h
+++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_mennu_the_betrayer.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_mennu_the_betrayer.cpp
index ba59aa3b463..7243b6e6738 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_mennu_the_betrayer.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_mennu_the_betrayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_quagmirran.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_quagmirran.cpp
index 6cef7291542..856e90405cb 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_quagmirran.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_quagmirran.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_rokmar_the_crackler.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_rokmar_the_crackler.cpp
index a025df5c3ae..a819b59d359 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_rokmar_the_crackler.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_rokmar_the_crackler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp
index 1c31bee7d4f..e942d0987fc 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 624ead7ef08..101268727b0 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_hungarfen.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_hungarfen.cpp
index ef3d317643b..1ea58bce0ca 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_hungarfen.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_hungarfen.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_the_black_stalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_the_black_stalker.cpp
index 47bd4e3bb6c..13ebf22436c 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_the_black_stalker.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/boss_the_black_stalker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/instance_the_underbog.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/instance_the_underbog.cpp
index 08d80d3dd82..9249cadbe49 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/instance_the_underbog.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheUnderbog/instance_the_underbog.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
index 0ae86f7c455..917dda1389a 100644
--- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
+++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp
index dd44d764987..f14e6badc35 100644
--- a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp
+++ b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/GruulsLair/gruuls_lair.h b/src/server/scripts/Outland/GruulsLair/gruuls_lair.h
index 1425a19aa47..81644a01567 100644
--- a/src/server/scripts/Outland/GruulsLair/gruuls_lair.h
+++ b/src/server/scripts/Outland/GruulsLair/gruuls_lair.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
index aa8a8d01d8a..caba33e1513 100644
--- a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
+++ b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
index 1303a80488e..b2097c34b33 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
@@ -1,6 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -16,32 +15,59 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef DEF_BLOOD_FURNACE_H
-#define DEF_BLOOD_FURNACE_H
+#ifndef BLOOD_FURNACE_H_
+#define BLOOD_FURNACE_H_
+
+#define BFScriptName "instance_blood_furnace"
+uint32 const EncounterCount = 3;
enum DataTypes
{
- DATA_THE_MAKER = 1,
- DATA_BROGGOK = 2,
- DATA_KELIDAN_THE_MAKER = 3,
- TYPE_THE_MAKER_EVENT = 4,
- TYPE_BROGGOK_EVENT = 5,
- TYPE_KELIDAN_THE_BREAKER_EVENT = 6,
- DATA_DOOR1 = 7,
- DATA_DOOR2 = 8,
- DATA_DOOR3 = 9,
- DATA_DOOR4 = 10,
- DATA_DOOR5 = 11,
- DATA_DOOR6 = 12,
- DATA_PRISON_CELL1 = 13,
- DATA_PRISON_CELL2 = 14,
- DATA_PRISON_CELL3 = 15,
- DATA_PRISON_CELL4 = 16,
- DATA_PRISON_CELL5 = 17,
- DATA_PRISON_CELL6 = 18,
- DATA_PRISON_CELL7 = 19,
- DATA_PRISON_CELL8 = 20,
- DATA_BROGGOK_LEVER = 21
+ // Encounter States/Boss GUIDs
+ DATA_THE_MAKER = 0,
+ DATA_BROGGOK = 1,
+ DATA_KELIDAN_THE_BREAKER = 2,
+
+ // Additional Data
+ DATA_DOOR_4 = 3,
+ DATA_PRISON_CELL1 = 4,
+ DATA_PRISON_CELL2 = 5,
+ DATA_PRISON_CELL3 = 6,
+ DATA_PRISON_CELL4 = 7,
+ DATA_PRISON_CELL5 = 8,
+ DATA_PRISON_CELL6 = 9,
+ DATA_PRISON_CELL7 = 10,
+ DATA_PRISON_CELL8 = 11,
+ DATA_BROGGOK_LEVER = 12
+};
+
+enum CreatureIds
+{
+ NPC_THE_MAKER = 17381,
+ NPC_BROGGOK = 17380,
+ NPC_KELIDAN_THE_BREAKER = 17377,
+ NPC_PRISONER = 17398
+};
+
+enum GameObjectIds
+{
+ GO_PRISON_DOOR_01 = 181766, // Final Exit Door
+ GO_PRISON_DOOR_02 = 181811, // The Maker Front Door
+ GO_PRISON_DOOR_03 = 181812, // The Maker Rear Door
+ GO_PRISON_DOOR_04 = 181819, // Broggok Rear Door
+ GO_PRISON_DOOR_05 = 181822, // Broggok Front Door
+ GO_SUMMON_DOOR = 181823, // Kelidan Exit Door
+
+ GO_PRISON_CELL_DOOR_1 = 181813, // The Maker Prison Cell front right
+ GO_PRISON_CELL_DOOR_2 = 181814, // The Maker Prison Cell back right
+ GO_PRISON_CELL_DOOR_3 = 181816, // The Maker Prison Cell front left
+ GO_PRISON_CELL_DOOR_4 = 181815, // The Maker Prison Cell back left
+ GO_PRISON_CELL_DOOR_5 = 181821, // Broggok Prison Cell front right
+ GO_PRISON_CELL_DOOR_6 = 181818, // Broggok Prison Cell back right
+ GO_PRISON_CELL_DOOR_7 = 181820, // Broggok Prison Cell front left
+ GO_PRISON_CELL_DOOR_8 = 181817, // Broggok Prison Cell back left
+
+ GO_BROGGOK_LEVER = 181982
};
enum ActionIds
@@ -51,5 +77,11 @@ enum ActionIds
ACTION_PREPARE_BROGGOK = 3
};
-#endif
+template<class AI>
+AI* GetBloodFurnaceAI(Creature* creature)
+{
+ return GetInstanceAI<AI>(creature, BFScriptName);
+}
+
+#endif // BLOOD_FURNACE_H_
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
index be4cac80adb..f610d6dd7e0 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -25,39 +25,32 @@ EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "blood_furnace.h"
enum Yells
{
- SAY_AGGRO = 0
+ SAY_AGGRO = 0
};
enum Spells
{
- SPELL_SLIME_SPRAY = 30913,
- SPELL_POISON_CLOUD = 30916,
- SPELL_POISON_BOLT = 30917,
+ SPELL_SLIME_SPRAY = 30913,
+ SPELL_POISON_CLOUD = 30916,
+ SPELL_POISON_BOLT = 30917,
- SPELL_POISON = 30914
+ SPELL_POISON_CLOUD_PASSIVE = 30914
};
class boss_broggok : public CreatureScript
{
public:
-
- boss_broggok()
- : CreatureScript("boss_broggok")
- {
- }
+ boss_broggok() : CreatureScript("boss_broggok") { }
struct boss_broggokAI : public BossAI
{
- boss_broggokAI(Creature* creature) : BossAI(creature, DATA_BROGGOK)
- {
- instance = creature->GetInstanceScript();
- }
-
- InstanceScript* instance;
+ boss_broggokAI(Creature* creature) : BossAI(creature, DATA_BROGGOK) { }
uint32 AcidSpray_Timer;
uint32 PoisonSpawn_Timer;
@@ -71,28 +64,22 @@ class boss_broggok : public CreatureScript
PoisonSpawn_Timer = 5000;
PoisonBolt_Timer = 7000;
DoAction(ACTION_RESET_BROGGOK);
- instance->SetData(TYPE_BROGGOK_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
+ _EnterCombat();
Talk(SAY_AGGRO);
}
- void JustSummoned(Creature* summoned) OVERRIDE
- {
- summoned->setFaction(16);
- summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- summoned->CastSpell(summoned, SPELL_POISON, false, 0, 0, me->GetGUID());
- }
-
void UpdateAI(uint32 diff) OVERRIDE
{
if (!UpdateVictim())
return;
+
if (!canAttack)
return;
+
if (AcidSpray_Timer <= diff)
{
DoCastVictim(SPELL_SLIME_SPRAY);
@@ -122,12 +109,7 @@ class boss_broggok : public CreatureScript
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- {
- instance->HandleGameObject(instance->GetData64(DATA_DOOR4), true);
- instance->HandleGameObject(instance->GetData64(DATA_DOOR5), true);
- instance->SetData(TYPE_BROGGOK_EVENT, DONE);
- }
+ _JustDied();
}
void DoAction(int32 action) OVERRIDE
@@ -154,7 +136,34 @@ class boss_broggok : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_broggokAI(creature);
+ return GetBloodFurnaceAI<boss_broggokAI>(creature);
+ }
+};
+
+class npc_broggok_poison_cloud : public CreatureScript
+{
+ public:
+ npc_broggok_poison_cloud() : CreatureScript("npc_broggok_poison_cloud") { }
+
+ struct npc_broggok_poison_cloudAI : public ScriptedAI
+ {
+ npc_broggok_poison_cloudAI(Creature* creature) : ScriptedAI(creature)
+ {
+ SetCombatMovement(false);
+ creature->SetReactState(REACT_PASSIVE);
+ }
+
+ void IsSummonedBy(Unit* /*summoner*/) OVERRIDE
+ {
+ DoCast(me, SPELL_POISON_CLOUD_PASSIVE, true);
+ }
+
+ void UpdateAI(uint32 /*diff*/) OVERRIDE { }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_broggok_poison_cloudAI(creature);
}
};
@@ -166,19 +175,60 @@ class go_broggok_lever : public GameObjectScript
bool OnGossipHello(Player* /*player*/, GameObject* go) OVERRIDE
{
if (InstanceScript* instance = go->GetInstanceScript())
- if (instance->GetData(TYPE_BROGGOK_EVENT) != DONE && instance->GetData(TYPE_BROGGOK_EVENT) != IN_PROGRESS)
+ if (instance->GetBossState(DATA_BROGGOK) != DONE && instance->GetBossState(DATA_BROGGOK) != IN_PROGRESS)
{
- instance->SetData(TYPE_BROGGOK_EVENT, IN_PROGRESS);
- if (Creature* broggok = Creature::GetCreature(*go, instance->GetData64(DATA_BROGGOK)))
+ instance->SetBossState(DATA_BROGGOK, IN_PROGRESS);
+ if (Creature* broggok = ObjectAccessor::GetCreature(*go, instance->GetData64(DATA_BROGGOK)))
broggok->AI()->DoAction(ACTION_PREPARE_BROGGOK);
}
+
go->UseDoorOrButton();
return false;
}
};
+// 30914, 38462 - Poison (Broggok)
+class spell_broggok_poison_cloud : public SpellScriptLoader
+{
+ public:
+ spell_broggok_poison_cloud() : SpellScriptLoader("spell_broggok_poison_cloud") { }
+
+ class spell_broggok_poison_cloud_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_broggok_poison_cloud_AuraScript);
+
+ bool Validate(SpellInfo const* spellInfo) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell))
+ return false;
+ return true;
+ }
+
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ PreventDefaultAction();
+
+ uint32 triggerSpell = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
+ int32 mod = int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) * 0.9f + 0.1f) * 10000 * 2 / 3);
+ GetTarget()->CastCustomSpell(triggerSpell, SPELLVALUE_RADIUS_MOD, mod, (Unit*)NULL, TRIGGERED_FULL_MASK, NULL, aurEff);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_broggok_poison_cloud_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const OVERRIDE
+ {
+ return new spell_broggok_poison_cloud_AuraScript();
+ }
+};
+
void AddSC_boss_broggok()
{
new boss_broggok();
+ new npc_broggok_poison_cloud();
new go_broggok_lever();
+ new spell_broggok_poison_cloud();
}
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 f6bceb78a14..4c04c06b091 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -16,18 +16,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Boss_Kelidan_The_Breaker
-SD%Complete: 100
-SDComment:
-SDCategory: Hellfire Citadel, Blood Furnace
-EndScriptData */
-
-/* ContentData
-boss_kelidan_the_breaker
-npc_shadowmoon_channeler
-EndContentData */
-
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellAuras.h"
@@ -71,23 +59,16 @@ const float ShadowmoonChannelers[5][4]=
class boss_kelidan_the_breaker : public CreatureScript
{
public:
+ boss_kelidan_the_breaker() : CreatureScript("boss_kelidan_the_breaker") { }
- boss_kelidan_the_breaker()
- : CreatureScript("boss_kelidan_the_breaker")
- {
- }
-
- struct boss_kelidan_the_breakerAI : public ScriptedAI
+ struct boss_kelidan_the_breakerAI : public BossAI
{
- boss_kelidan_the_breakerAI(Creature* creature) : ScriptedAI(creature)
+ boss_kelidan_the_breakerAI(Creature* creature) : BossAI(creature, DATA_KELIDAN_THE_BREAKER)
{
- instance = creature->GetInstanceScript();
- for (uint8 i=0; i<5; ++i)
+ for (uint8 i = 0; i < 5; ++i)
Channelers[i] = 0;
}
- InstanceScript* instance;
-
uint32 ShadowVolley_Timer;
uint32 BurningNova_Timer;
uint32 Firenova_Timer;
@@ -99,6 +80,7 @@ class boss_kelidan_the_breaker : public CreatureScript
void Reset() OVERRIDE
{
+ _Reset();
ShadowVolley_Timer = 1000;
BurningNova_Timer = 15000;
Corruption_Timer = 5000;
@@ -108,18 +90,15 @@ class boss_kelidan_the_breaker : public CreatureScript
SummonChannelers();
me->SetReactState(REACT_PASSIVE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
- if (instance)
- instance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* who) OVERRIDE
{
+ _EnterCombat();
Talk(SAY_WAKE);
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(true);
DoStartMovement(who);
- if (instance)
- instance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, IN_PROGRESS);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
@@ -191,14 +170,8 @@ class boss_kelidan_the_breaker : public CreatureScript
void JustDied(Unit* /*killer*/) OVERRIDE
{
+ _JustDied();
Talk(SAY_DIE);
-
- if (!instance)
- return;
-
- instance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, DONE);
- instance->HandleGameObject(instance->GetData64(DATA_DOOR1), true);
- instance->HandleGameObject(instance->GetData64(DATA_DOOR6), true);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -207,7 +180,7 @@ class boss_kelidan_the_breaker : public CreatureScript
{
if (check_Timer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
DoCast(me, SPELL_EVOCATION);
check_Timer = 5000;
}
@@ -248,7 +221,7 @@ class boss_kelidan_the_breaker : public CreatureScript
if (BurningNova_Timer <= diff)
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(true);
Talk(SAY_NOVA);
@@ -275,7 +248,7 @@ class boss_kelidan_the_breaker : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_kelidan_the_breakerAI(creature);
+ return GetBloodFurnaceAI<boss_kelidan_the_breakerAI>(creature);
}
};
@@ -311,7 +284,7 @@ class npc_shadowmoon_channeler : public CreatureScript
ShadowBolt_Timer = 1000+rand()%1000;
MarkOfShadow_Timer = 5000+rand()%2000;
check_Timer = 0;
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(true);
}
@@ -319,7 +292,7 @@ class npc_shadowmoon_channeler : public CreatureScript
{
if (Creature* Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100))
CAST_AI(boss_kelidan_the_breaker::boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerEngaged(who);
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(true);
DoStartMovement(who);
}
@@ -336,7 +309,7 @@ class npc_shadowmoon_channeler : public CreatureScript
{
if (check_Timer <= diff)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
if (Creature* Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100))
{
uint64 channeler = CAST_AI(boss_kelidan_the_breaker::boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(me);
@@ -373,7 +346,7 @@ class npc_shadowmoon_channeler : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_shadowmoon_channelerAI(creature);
+ return GetBloodFurnaceAI<npc_shadowmoon_channelerAI>(creature);
}
};
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp
index 33e23c12d14..6ab356bfa4a 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -45,20 +45,11 @@ enum Spells
class boss_the_maker : public CreatureScript
{
public:
+ boss_the_maker() : CreatureScript("boss_the_maker") { }
- boss_the_maker()
- : CreatureScript("boss_the_maker")
+ struct boss_the_makerAI : public BossAI
{
- }
-
- struct boss_the_makerAI : public ScriptedAI
- {
- boss_the_makerAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- }
-
- InstanceScript* instance;
+ boss_the_makerAI(Creature* creature) : BossAI(creature, DATA_THE_MAKER) { }
uint32 AcidSpray_Timer;
uint32 ExplodingBreaker_Timer;
@@ -67,46 +58,30 @@ class boss_the_maker : public CreatureScript
void Reset() OVERRIDE
{
+ _Reset();
AcidSpray_Timer = 15000;
ExplodingBreaker_Timer = 6000;
Domination_Timer = 120000;
Knockdown_Timer = 10000;
-
- if (!instance)
- return;
-
- instance->SetData(TYPE_THE_MAKER_EVENT, NOT_STARTED);
- instance->HandleGameObject(instance->GetData64(DATA_DOOR2), true);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
+ _EnterCombat();
Talk(SAY_AGGRO);
-
- if (!instance)
- return;
-
- instance->SetData(TYPE_THE_MAKER_EVENT, IN_PROGRESS);
- instance->HandleGameObject(instance->GetData64(DATA_DOOR2), false);
}
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_KILL);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_KILL);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
+ _JustDied();
Talk(SAY_DIE);
-
- if (!instance)
- return;
-
- instance->SetData(TYPE_THE_MAKER_EVENT, DONE);
- instance->HandleGameObject(instance->GetData64(DATA_DOOR2), true);
- instance->HandleGameObject(instance->GetData64(DATA_DOOR3), true);
-
- }
+ }
void UpdateAI(uint32 diff) OVERRIDE
{
@@ -156,7 +131,7 @@ class boss_the_maker : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_the_makerAI(creature);
+ return GetBloodFurnaceAI<boss_the_makerAI>(creature);
}
};
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 b8edd55a3ed..bc399e4b43f 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
@@ -1,6 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -16,292 +15,207 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Instance_Blood_Furnace
-SD%Complete: 85
-SDComment:
-SDCategory: Hellfire Citadel, Blood Furnace
-EndScriptData */
-
#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "InstanceScript.h"
#include "blood_furnace.h"
-#include "CreatureAI.h"
-#define ENTRY_SEWER1 181823
-#define ENTRY_SEWER2 181766
-#define MAX_ENCOUNTER 3
+DoorData const doorData[] =
+{
+ { GO_PRISON_DOOR_01, DATA_KELIDAN_THE_BREAKER, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
+ { GO_PRISON_DOOR_02, DATA_THE_MAKER, DOOR_TYPE_ROOM, BOUNDARY_NONE },
+ { GO_PRISON_DOOR_03, DATA_THE_MAKER, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
+ { GO_PRISON_DOOR_04, DATA_BROGGOK, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
+ { GO_PRISON_DOOR_05, DATA_BROGGOK, DOOR_TYPE_ROOM, BOUNDARY_NONE },
+ { GO_SUMMON_DOOR, DATA_KELIDAN_THE_BREAKER, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
+ { 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } // END
+};
class instance_blood_furnace : public InstanceMapScript
{
public:
- instance_blood_furnace()
- : InstanceMapScript("instance_blood_furnace", 542) { }
+ instance_blood_furnace() : InstanceMapScript(BFScriptName, 542) { }
struct instance_blood_furnace_InstanceMapScript : public InstanceScript
{
- instance_blood_furnace_InstanceMapScript(Map* map) : InstanceScript(map) { }
-
- uint64 The_MakerGUID;
- uint64 BroggokGUID;
- uint64 Kelidan_The_BreakerGUID;
-
- uint64 Door1GUID;
- uint64 Door2GUID;
- uint64 Door3GUID;
- uint64 Door4GUID;
- uint64 Door5GUID;
- uint64 Door6GUID;
-
- uint64 PrisonCell1GUID;
- uint64 PrisonCell2GUID;
- uint64 PrisonCell3GUID;
- uint64 PrisonCell4GUID;
- uint64 PrisonCell5GUID;
- uint64 PrisonCell6GUID;
- uint64 PrisonCell7GUID;
- uint64 PrisonCell8GUID;
-
- std::set<uint64> PrisonersCell5;
- std::set<uint64> PrisonersCell6;
- std::set<uint64> PrisonersCell7;
- std::set<uint64> PrisonersCell8;
-
- uint8 PrisonerCounter5;
- uint8 PrisonerCounter6;
- uint8 PrisonerCounter7;
- uint8 PrisonerCounter8;
+ instance_blood_furnace_InstanceMapScript(Map* map) : InstanceScript(map)
+ {
+ SetBossNumber(EncounterCount);
+ LoadDoorData(doorData);
- uint64 BroggokLeverGUID;
+ TheMakerGUID = 0;
+ BroggokGUID = 0;
+ KelidanTheBreakerGUID = 0;
- uint32 m_auiEncounter[MAX_ENCOUNTER];
- std::string str_data;
+ BroggokLeverGUID = 0;
+ PrisonDoor4GUID = 0;
- void Initialize() OVERRIDE
- {
- memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
-
- The_MakerGUID = 0;
- BroggokGUID = 0;
- Kelidan_The_BreakerGUID = 0;
-
- Door1GUID = 0;
- Door2GUID = 0;
- Door3GUID = 0;
- Door4GUID = 0;
- Door5GUID = 0;
- Door6GUID = 0;
-
- PrisonCell1GUID = 0;
- PrisonCell2GUID = 0;
- PrisonCell3GUID = 0;
- PrisonCell4GUID = 0;
- PrisonCell5GUID = 0;
- PrisonCell6GUID = 0;
- PrisonCell7GUID = 0;
- PrisonCell8GUID = 0;
+ memset(PrisonCellGUIDs, 0, 8 * sizeof(uint64));
PrisonersCell5.clear();
PrisonersCell6.clear();
PrisonersCell7.clear();
PrisonersCell8.clear();
- PrisonerCounter5 = 0;
- PrisonerCounter6 = 0;
- PrisonerCounter7 = 0;
- PrisonerCounter8 = 0;
-
- BroggokLeverGUID = 0;
+ PrisonerCounter5 = 0;
+ PrisonerCounter6 = 0;
+ PrisonerCounter7 = 0;
+ PrisonerCounter8 = 0;
}
void OnCreatureCreate(Creature* creature) OVERRIDE
{
switch (creature->GetEntry())
{
- case 17381:
- The_MakerGUID = creature->GetGUID();
+ case NPC_THE_MAKER:
+ TheMakerGUID = creature->GetGUID();
break;
- case 17380:
+ case NPC_BROGGOK:
BroggokGUID = creature->GetGUID();
break;
- case 17377:
- Kelidan_The_BreakerGUID = creature->GetGUID();
+ case NPC_KELIDAN_THE_BREAKER:
+ KelidanTheBreakerGUID = creature->GetGUID();
break;
- case 17398:
+ case NPC_PRISONER:
StorePrisoner(creature);
break;
+ default:
+ break;
}
}
void OnUnitDeath(Unit* unit) OVERRIDE
{
- if (unit && unit->GetTypeId() == TYPEID_UNIT && unit->GetEntry() == 17398)
+ if (unit->GetTypeId() == TYPEID_UNIT && unit->GetEntry() == NPC_PRISONER)
PrisonerDied(unit->GetGUID());
}
void OnGameObjectCreate(GameObject* go) OVERRIDE
{
- if (go->GetEntry() == 181766) //Final exit door
- Door1GUID = go->GetGUID();
- if (go->GetEntry() == 181811) //The Maker Front door
- Door2GUID = go->GetGUID();
- if (go->GetEntry() == 181812) //The Maker Rear door
- Door3GUID = go->GetGUID();
- if (go->GetEntry() == 181822) //Broggok Front door
- Door4GUID = go->GetGUID();
- if (go->GetEntry() == 181819) //Broggok Rear door
- Door5GUID = go->GetGUID();
- if (go->GetEntry() == 181823) //Kelidan exit door
- Door6GUID = go->GetGUID();
-
- if (go->GetEntry() == 181813) //The Maker prison cell front right
- PrisonCell1GUID = go->GetGUID();
- if (go->GetEntry() == 181814) //The Maker prison cell back right
- PrisonCell2GUID = go->GetGUID();
- if (go->GetEntry() == 181816) //The Maker prison cell front left
- PrisonCell3GUID = go->GetGUID();
- if (go->GetEntry() == 181815) //The Maker prison cell back left
- PrisonCell4GUID = go->GetGUID();
- if (go->GetEntry() == 181821) //Broggok prison cell front right
- PrisonCell5GUID = go->GetGUID();
- if (go->GetEntry() == 181818) //Broggok prison cell back right
- PrisonCell6GUID = go->GetGUID();
- if (go->GetEntry() == 181820) //Broggok prison cell front left
- PrisonCell7GUID = go->GetGUID();
- if (go->GetEntry() == 181817) //Broggok prison cell back left
- PrisonCell8GUID = go->GetGUID();
-
- if (go->GetEntry() == 181982)
- BroggokLeverGUID = go->GetGUID(); //Broggok lever
- }
-
- uint64 GetData64(uint32 data) const OVERRIDE
- {
- switch (data)
+ switch (go->GetEntry())
{
- case DATA_THE_MAKER: return The_MakerGUID;
- case DATA_BROGGOK: return BroggokGUID;
- case DATA_KELIDAN_THE_MAKER: return Kelidan_The_BreakerGUID;
- case DATA_DOOR1: return Door1GUID;
- case DATA_DOOR2: return Door2GUID;
- case DATA_DOOR3: return Door3GUID;
- case DATA_DOOR4: return Door4GUID;
- case DATA_DOOR5: return Door5GUID;
- case DATA_DOOR6: return Door6GUID;
- case DATA_PRISON_CELL1: return PrisonCell1GUID;
- case DATA_PRISON_CELL2: return PrisonCell2GUID;
- case DATA_PRISON_CELL3: return PrisonCell3GUID;
- case DATA_PRISON_CELL4: return PrisonCell4GUID;
- case DATA_PRISON_CELL5: return PrisonCell5GUID;
- case DATA_PRISON_CELL6: return PrisonCell6GUID;
- case DATA_PRISON_CELL7: return PrisonCell7GUID;
- case DATA_PRISON_CELL8: return PrisonCell8GUID;
- case DATA_BROGGOK_LEVER: return BroggokLeverGUID;
+ case GO_PRISON_DOOR_04:
+ PrisonDoor4GUID = go->GetGUID();
+ // no break
+ case GO_PRISON_DOOR_01:
+ case GO_PRISON_DOOR_02:
+ case GO_PRISON_DOOR_03:
+ case GO_PRISON_DOOR_05:
+ case GO_SUMMON_DOOR:
+ AddDoor(go, true);
+ break;
+ case GO_BROGGOK_LEVER:
+ BroggokLeverGUID = go->GetGUID();
+ break;
+ case GO_PRISON_CELL_DOOR_1:
+ PrisonCellGUIDs[DATA_PRISON_CELL1 - DATA_PRISON_CELL1] = go->GetGUID();
+ break;
+ case GO_PRISON_CELL_DOOR_2:
+ PrisonCellGUIDs[DATA_PRISON_CELL2 - DATA_PRISON_CELL1] = go->GetGUID();
+ break;
+ case GO_PRISON_CELL_DOOR_3:
+ PrisonCellGUIDs[DATA_PRISON_CELL3 - DATA_PRISON_CELL1] = go->GetGUID();
+ break;
+ case GO_PRISON_CELL_DOOR_4:
+ PrisonCellGUIDs[DATA_PRISON_CELL4 - DATA_PRISON_CELL1] = go->GetGUID();
+ break;
+ case GO_PRISON_CELL_DOOR_5:
+ PrisonCellGUIDs[DATA_PRISON_CELL5 - DATA_PRISON_CELL1] = go->GetGUID();
+ break;
+ case GO_PRISON_CELL_DOOR_6:
+ PrisonCellGUIDs[DATA_PRISON_CELL6 - DATA_PRISON_CELL1] = go->GetGUID();
+ break;
+ case GO_PRISON_CELL_DOOR_7:
+ PrisonCellGUIDs[DATA_PRISON_CELL7 - DATA_PRISON_CELL1] = go->GetGUID();
+ break;
+ case GO_PRISON_CELL_DOOR_8:
+ PrisonCellGUIDs[DATA_PRISON_CELL8 - DATA_PRISON_CELL1] = go->GetGUID();
+ break;
+ default:
+ break;
}
- return 0;
}
- void SetData(uint32 type, uint32 data) OVERRIDE
+ void OnGameObjectRemove(GameObject* go) OVERRIDE
{
- switch (type)
- {
- case TYPE_THE_MAKER_EVENT:
- m_auiEncounter[0] = data;
- break;
- case TYPE_BROGGOK_EVENT:
- m_auiEncounter[1] = data;
- UpdateBroggokEvent(data);
- break;
- case TYPE_KELIDAN_THE_BREAKER_EVENT:
- m_auiEncounter[2] = data;
- break;
- }
-
- if (data == DONE)
+ switch (go->GetEntry())
{
- OUT_SAVE_INST_DATA;
-
- std::ostringstream saveStream;
- saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2];
-
- str_data = saveStream.str();
-
- SaveToDB();
- OUT_SAVE_INST_DATA_COMPLETE;
+ 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;
}
}
- uint32 GetData(uint32 type) const OVERRIDE
+ uint64 GetData64(uint32 type) const OVERRIDE
{
switch (type)
{
- case TYPE_THE_MAKER_EVENT: return m_auiEncounter[0];
- case TYPE_BROGGOK_EVENT: return m_auiEncounter[1];
- case TYPE_KELIDAN_THE_BREAKER_EVENT: return m_auiEncounter[2];
+ case DATA_THE_MAKER:
+ return TheMakerGUID;
+ case DATA_BROGGOK:
+ return BroggokGUID;
+ case DATA_KELIDAN_THE_BREAKER:
+ return KelidanTheBreakerGUID;
+ case DATA_BROGGOK_LEVER:
+ return BroggokLeverGUID;
}
- return 0;
- }
- const char* Save()
- {
- return str_data.c_str();
+ return 0;
}
- void Load(const char* in) OVERRIDE
+ bool SetBossState(uint32 type, EncounterState state) OVERRIDE
{
- if (!in)
- {
- OUT_LOAD_INST_DATA_FAIL;
- return;
- }
-
- OUT_LOAD_INST_DATA(in);
+ if (!InstanceScript::SetBossState(type, state))
+ return false;
- std::istringstream loadStream(in);
- loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2];
-
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS || m_auiEncounter[i] == FAIL)
- m_auiEncounter[i] = NOT_STARTED;
-
- OUT_LOAD_INST_DATA_COMPLETE;
- }
-
- void UpdateBroggokEvent(uint32 data)
- {
- switch (data)
+ switch (type)
{
- case IN_PROGRESS:
- ActivateCell(DATA_PRISON_CELL5);
- HandleGameObject(Door4GUID, false);
+ case DATA_BROGGOK:
+ switch (state)
+ {
+ case IN_PROGRESS:
+ ActivateCell(DATA_PRISON_CELL5);
+ break;
+ case NOT_STARTED:
+ ResetPrisons();
+ if (GameObject* lever = instance->GetGameObject(BroggokLeverGUID))
+ lever->Respawn();
+ break;
+ default:
+ break;
+ }
break;
- case NOT_STARTED:
- ResetPrisons();
- HandleGameObject(Door5GUID, false);
- HandleGameObject(Door4GUID, true);
- if (GameObject* lever = instance->GetGameObject(BroggokLeverGUID))
- lever->Respawn();
+ default:
break;
}
+
+ return true;
}
void ResetPrisons()
{
PrisonerCounter5 = PrisonersCell5.size();
ResetPrisoners(PrisonersCell5);
- HandleGameObject(PrisonCell5GUID, false);
+ HandleGameObject(PrisonCellGUIDs[DATA_PRISON_CELL5 - DATA_PRISON_CELL1], false);
PrisonerCounter6 = PrisonersCell6.size();
ResetPrisoners(PrisonersCell6);
- HandleGameObject(PrisonCell6GUID, false);
+ HandleGameObject(PrisonCellGUIDs[DATA_PRISON_CELL6 - DATA_PRISON_CELL1], false);
PrisonerCounter7 = PrisonersCell7.size();
ResetPrisoners(PrisonersCell7);
- HandleGameObject(PrisonCell7GUID, false);
+ HandleGameObject(PrisonCellGUIDs[DATA_PRISON_CELL7 - DATA_PRISON_CELL1], false);
PrisonerCounter8 = PrisonersCell8.size();
ResetPrisoners(PrisonersCell8);
- HandleGameObject(PrisonCell8GUID, false);
+ HandleGameObject(PrisonCellGUIDs[DATA_PRISON_CELL8 - DATA_PRISON_CELL1], false);
}
void ResetPrisoners(const std::set<uint64>& prisoners)
@@ -367,7 +281,7 @@ class instance_blood_furnace : public InstanceMapScript
else if (PrisonersCell7.find(guid) != PrisonersCell7.end() && --PrisonerCounter7 <= 0)
ActivateCell(DATA_PRISON_CELL8);
else if (PrisonersCell8.find(guid) != PrisonersCell8.end() && --PrisonerCounter8 <= 0)
- ActivateCell(DATA_DOOR5);
+ ActivateCell(DATA_DOOR_4);
}
void ActivateCell(uint8 id)
@@ -375,30 +289,30 @@ class instance_blood_furnace : public InstanceMapScript
switch (id)
{
case DATA_PRISON_CELL5:
- HandleGameObject(PrisonCell5GUID, true);
+ HandleGameObject(PrisonCellGUIDs[id - DATA_PRISON_CELL1], true);
ActivatePrisoners(PrisonersCell5);
break;
case DATA_PRISON_CELL6:
- HandleGameObject(PrisonCell6GUID, true);
+ HandleGameObject(PrisonCellGUIDs[id - DATA_PRISON_CELL1], true);
ActivatePrisoners(PrisonersCell6);
break;
case DATA_PRISON_CELL7:
- HandleGameObject(PrisonCell7GUID, true);
+ HandleGameObject(PrisonCellGUIDs[id - DATA_PRISON_CELL1], true);
ActivatePrisoners(PrisonersCell7);
break;
case DATA_PRISON_CELL8:
- HandleGameObject(PrisonCell8GUID, true);
+ HandleGameObject(PrisonCellGUIDs[id - DATA_PRISON_CELL1], true);
ActivatePrisoners(PrisonersCell8);
break;
- case DATA_DOOR5:
- HandleGameObject(Door5GUID, true);
+ case DATA_DOOR_4:
+ HandleGameObject(PrisonDoor4GUID, true);
if (Creature* broggok = instance->GetCreature(BroggokGUID))
broggok->AI()->DoAction(ACTION_ACTIVATE_BROGGOK);
break;
}
}
- void ActivatePrisoners(const std::set<uint64>& prisoners)
+ void ActivatePrisoners(std::set<uint64> const& prisoners)
{
for (std::set<uint64>::const_iterator i = prisoners.begin(); i != prisoners.end(); ++i)
if (Creature* prisoner = instance->GetCreature(*i))
@@ -407,6 +321,69 @@ class instance_blood_furnace : public InstanceMapScript
prisoner->SetInCombatWithZone();
}
}
+
+ std::string GetSaveData() OVERRIDE
+ {
+ OUT_SAVE_INST_DATA;
+
+ std::ostringstream saveStream;
+ saveStream << "B F " << GetBossSaveData();
+
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return saveStream.str();
+ }
+
+ void Load(char const* str) OVERRIDE
+ {
+ if (!str)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+
+ OUT_LOAD_INST_DATA(str);
+
+ char dataHead1, dataHead2;
+
+ std::istringstream loadStream(str);
+ loadStream >> dataHead1 >> dataHead2;
+
+ if (dataHead1 == 'B' && dataHead2 == 'F')
+ {
+ for (uint32 i = 0; i < EncounterCount; ++i)
+ {
+ uint32 tmpState;
+ loadStream >> tmpState;
+ if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
+ tmpState = NOT_STARTED;
+ SetBossState(i, EncounterState(tmpState));
+ }
+ }
+ else
+ OUT_LOAD_INST_DATA_FAIL;
+
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+
+ protected:
+ uint64 TheMakerGUID;
+ uint64 BroggokGUID;
+ uint64 KelidanTheBreakerGUID;
+
+ uint64 BroggokLeverGUID;
+ uint64 PrisonDoor4GUID;
+
+ uint64 PrisonCellGUIDs[8];
+
+ std::set<uint64>PrisonersCell5;
+ std::set<uint64>PrisonersCell6;
+ std::set<uint64>PrisonersCell7;
+ std::set<uint64>PrisonersCell8;
+
+ uint8 PrisonerCounter5;
+ uint8 PrisonerCounter6;
+ uint8 PrisonerCounter7;
+ uint8 PrisonerCounter8;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE
diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp
index 7e80182f1e8..a68b3181e6f 100644
--- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -224,7 +224,7 @@ class boss_omor_the_unscarred : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_omor_the_unscarredAI(creature);
+ return GetInstanceAI<boss_omor_the_unscarredAI>(creature);
}
};
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 2388a67b3e5..1193e45e73b 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
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp
index 493630a7650..f1bf63397bf 100644
--- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h
index 880640659b0..61252d16527 100644
--- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h
+++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp
index 0c8df4c01e7..a8fd639de6d 100644
--- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
index f4ee716dc67..e1d83931166 100644
--- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@ enum Spells
SPELL_SHADOW_CAGE = 30168,
SPELL_SHADOW_GRASP = 30410,
SPELL_SHADOW_GRASP_VISUAL = 30166,
- SPELL_MIND_EXHAUSTION = 44032, //Casted by the cubes when channeling ends
+ SPELL_MIND_EXHAUSTION = 44032, //Cast by the cubes when channeling ends
SPELL_SHADOW_CAGE_C = 30205,
SPELL_SHADOW_GRASP_C = 30207,
SPELL_SHADOW_BOLT_VOLLEY = 30510,
@@ -249,11 +249,8 @@ class boss_magtheridon : public CreatureScript
void JustReachedHome() OVERRIDE
{
- if (instance)
- {
- instance->SetData(DATA_MAGTHERIDON_EVENT, NOT_STARTED);
- instance->SetData(DATA_COLLAPSE, false);
- }
+ instance->SetData(DATA_MAGTHERIDON_EVENT, NOT_STARTED);
+ instance->SetData(DATA_COLLAPSE, false);
}
void SetClicker(uint64 cubeGUID, uint64 clickerGUID)
@@ -314,8 +311,7 @@ class boss_magtheridon : public CreatureScript
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_MAGTHERIDON_EVENT, DONE);
+ instance->SetData(DATA_MAGTHERIDON_EVENT, DONE);
Talk(SAY_DEATH);
}
@@ -331,8 +327,7 @@ class boss_magtheridon : public CreatureScript
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_MAGTHERIDON_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_MAGTHERIDON_EVENT, IN_PROGRESS);
DoZoneInCombat();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -392,7 +387,7 @@ class boss_magtheridon : public CreatureScript
if (Quake_Timer <= diff)
{
// to avoid blastnova interruption
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
DoCast(me, SPELL_QUAKE_TRIGGER, true);
Quake_Timer = 50000;
@@ -421,7 +416,7 @@ class boss_magtheridon : public CreatureScript
Blaze_Timer -= diff;
if (!Phase3 && HealthBelowPct(30)
- && !me->IsNonMeleeSpellCasted(false) // blast nova
+ && !me->IsNonMeleeSpellCast(false) // blast nova
&& !me->HasUnitState(UNIT_STATE_STUNNED)) // shadow cage and earthquake
{
Phase3 = true;
@@ -429,8 +424,7 @@ class boss_magtheridon : public CreatureScript
DoCast(me, SPELL_CAMERA_SHAKE, true);
DoCast(me, SPELL_DEBRIS_KNOCKDOWN, true);
- if (instance)
- instance->SetData(DATA_COLLAPSE, true);
+ instance->SetData(DATA_COLLAPSE, true);
}
if (Phase3)
@@ -457,7 +451,7 @@ class boss_magtheridon : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_magtheridonAI(creature);
+ return GetInstanceAI<boss_magtheridonAI>(creature);
}
};
@@ -498,8 +492,7 @@ class npc_hellfire_channeler : public CreatureScript
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_CHANNELER_EVENT, IN_PROGRESS);
+ instance->SetData(DATA_CHANNELER_EVENT, IN_PROGRESS);
me->InterruptNonMeleeSpells(false);
DoZoneInCombat();
@@ -507,8 +500,7 @@ class npc_hellfire_channeler : public CreatureScript
void JustReachedHome() OVERRIDE
{
- if (instance)
- instance->SetData(DATA_CHANNELER_EVENT, NOT_STARTED);
+ instance->SetData(DATA_CHANNELER_EVENT, NOT_STARTED);
DoCast(me, SPELL_SHADOW_GRASP_C, false);
}
@@ -526,8 +518,7 @@ class npc_hellfire_channeler : public CreatureScript
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_CHANNELER_EVENT, DONE);
+ instance->SetData(DATA_CHANNELER_EVENT, DONE);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -576,7 +567,7 @@ class npc_hellfire_channeler : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_hellfire_channelerAI(creature);
+ return GetInstanceAI<npc_hellfire_channelerAI>(creature);
}
};
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 bfe829de9fd..73f741fade1 100644
--- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -180,7 +180,7 @@ class instance_magtheridons_lair : public InstanceMapScript
Creature* Magtheridon = instance->GetCreature(MagtheridonGUID);
if (Magtheridon && Magtheridon->IsAlive())
{
- Magtheridon->MonsterTextEmote(EMOTE_BONDS_WEAKEN, 0);
+ Magtheridon->MonsterTextEmote(EMOTE_BONDS_WEAKEN, NULL);
CageTimer = 120000;
}
HandleGameObject(DoorGUID, false);
diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h
index f67b8ff3256..d3921a8709b 100644
--- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h
+++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
index 981774a677b..69906880705 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -109,8 +109,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript
{
Talk(SAY_DIE);
- if (instance)
- instance->SetBossState(DATA_NETHEKURSE, DONE);
+ instance->SetBossState(DATA_NETHEKURSE, DONE);
}
void SetData(uint32 data, uint32 value) OVERRIDE
@@ -184,8 +183,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript
IntroOnce = true;
IsIntroEvent = true;
- if (instance)
- instance->SetBossState(DATA_NETHEKURSE, IN_PROGRESS);
+ instance->SetBossState(DATA_NETHEKURSE, IN_PROGRESS);
}
if (IsIntroEvent || !IsMainEvent)
@@ -219,9 +217,6 @@ class boss_grand_warlock_nethekurse : public CreatureScript
{
if (IsIntroEvent)
{
- if (!instance)
- return;
-
if (instance->GetBossState(DATA_NETHEKURSE) == IN_PROGRESS)
{
if (IntroEvent_Timer <= diff)
@@ -297,7 +292,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_grand_warlock_nethekurseAI(creature);
+ return GetInstanceAI<boss_grand_warlock_nethekurseAI>(creature);
}
};
@@ -328,22 +323,18 @@ class npc_fel_orc_convert : public CreatureScript
{
events.ScheduleEvent(EVENT_HEMORRHAGE, 3000);
- if (instance)
- if (Creature* Kurse = Unit::GetCreature(*me, instance->GetData64(NPC_GRAND_WARLOCK_NETHEKURSE)))
- if (Kurse && me->IsWithinDist(Kurse, 45.0f))
- Kurse->AI()->SetData(SETDATA_DATA, SETDATA_PEON_AGGRO);
+ if (Creature* Kurse = Unit::GetCreature(*me, instance->GetData64(NPC_GRAND_WARLOCK_NETHEKURSE)))
+ if (me->IsWithinDist(Kurse, 45.0f))
+ Kurse->AI()->SetData(SETDATA_DATA, SETDATA_PEON_AGGRO);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- {
- if (instance->GetBossState(DATA_NETHEKURSE) != IN_PROGRESS)
- return;
+ if (instance->GetBossState(DATA_NETHEKURSE) != IN_PROGRESS)
+ return;
- if (Creature* Kurse = Unit::GetCreature(*me, instance->GetData64(NPC_GRAND_WARLOCK_NETHEKURSE)))
- Kurse->AI()->SetData(SETDATA_DATA, SETDATA_PEON_DEATH);
- }
+ if (Creature* Kurse = Unit::GetCreature(*me, instance->GetData64(NPC_GRAND_WARLOCK_NETHEKURSE)))
+ Kurse->AI()->SetData(SETDATA_DATA, SETDATA_PEON_DEATH);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -369,7 +360,7 @@ class npc_fel_orc_convert : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_fel_orc_convertAI(creature);
+ return GetInstanceAI<npc_fel_orc_convertAI>(creature);
}
};
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp
index 9c4be7c0b1b..2ed70ded6ef 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -167,8 +167,7 @@ class boss_warbringer_omrogg : public CreatureScript
ThunderClap_Timer = 15000;
ResetThreat_Timer = 30000;
- if (instance)
- instance->SetData(DATA_OMROGG, NOT_STARTED); //End boss can use this later. O'mrogg must be defeated(DONE) or he will come to aid.
+ instance->SetData(DATA_OMROGG, NOT_STARTED); //End boss can use this later. O'mrogg must be defeated(DONE) or he will come to aid.
}
void DoYellForThreat()
@@ -204,8 +203,7 @@ class boss_warbringer_omrogg : public CreatureScript
AggroYell = true;
}
- if (instance)
- instance->SetBossState(DATA_OMROGG, IN_PROGRESS);
+ instance->SetBossState(DATA_OMROGG, IN_PROGRESS);
}
void JustSummoned(Creature* summoned) OVERRIDE
@@ -259,8 +257,7 @@ class boss_warbringer_omrogg : public CreatureScript
RightHead->AI()->SetData(SETDATA_DATA, SETDATA_YELL);
- if (instance)
- instance->SetBossState(DATA_OMROGG, DONE);
+ instance->SetBossState(DATA_OMROGG, DONE);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -388,7 +385,7 @@ class boss_warbringer_omrogg : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_warbringer_omroggAI(creature);
+ return GetInstanceAI<boss_warbringer_omroggAI>(creature);
}
};
@@ -438,7 +435,7 @@ class npc_omrogg_heads : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_omrogg_headsAI(creature);
+ return GetInstanceAI<npc_omrogg_headsAI>(creature);
}
};
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
index f9ec3edb362..bdb109910a8 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -90,8 +90,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript
Talk(SAY_DEATH);
removeAdds();
- if (instance)
- instance->SetBossState(DATA_KARGATH, DONE);
+ instance->SetBossState(DATA_KARGATH, DONE);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -311,7 +310,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_warchief_kargath_bladefistAI(creature);
+ return GetInstanceAI<boss_warchief_kargath_bladefistAI>(creature);
}
};
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 1484c5e9127..25ecf5331ad 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h
index 888a9cb5010..10e944d5bc4 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
index 5d789359864..d802e48f3b0 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -109,8 +109,7 @@ class boss_alar : public CreatureScript
void Reset() OVERRIDE
{
- if (instance)
- instance->SetData(DATA_ALAREVENT, NOT_STARTED);
+ instance->SetData(DATA_ALAREVENT, NOT_STARTED);
Berserk_Timer = 1200000;
Platforms_Move_Timer = 0;
@@ -136,8 +135,7 @@ class boss_alar : public CreatureScript
void EnterCombat(Unit* /*who*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_ALAREVENT, IN_PROGRESS);
+ instance->SetData(DATA_ALAREVENT, IN_PROGRESS);
me->SetDisableGravity(true); // after enterevademode will be set walk movement
DoZoneInCombat();
@@ -146,8 +144,7 @@ class boss_alar : public CreatureScript
void JustDied(Unit* /*killer*/) OVERRIDE
{
- if (instance)
- instance->SetData(DATA_ALAREVENT, DONE);
+ instance->SetData(DATA_ALAREVENT, DONE);
}
void JustSummoned(Creature* summon) OVERRIDE
@@ -426,7 +423,7 @@ class boss_alar : public CreatureScript
void DoMeleeAttackIfReady()
{
- if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
+ if (me->isAttackReady() && !me->IsNonMeleeSpellCast(false))
{
if (me->IsWithinMeleeRange(me->GetVictim()))
{
@@ -451,7 +448,7 @@ class boss_alar : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_alarAI(creature);
+ return GetInstanceAI<boss_alarAI>(creature);
}
};
@@ -528,7 +525,7 @@ class npc_ember_of_alar : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ember_of_alarAI(creature);
+ return GetInstanceAI<npc_ember_of_alarAI>(creature);
}
};
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
index c5c3f6deb12..7caf1fd1771 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -146,8 +146,7 @@ class boss_high_astromancer_solarian : public CreatureScript
Wrath_Timer = 20000+rand()%5000;//twice in phase one
Phase = 1;
- if (instance)
- instance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED);
+ instance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED);
me->SetArmor(defaultarmor);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -168,8 +167,7 @@ class boss_high_astromancer_solarian : public CreatureScript
me->SetObjectScale(defaultsize);
me->SetDisplayId(MODEL_HUMAN);
Talk(SAY_DEATH);
- if (instance)
- instance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, DONE);
+ instance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, DONE);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -177,8 +175,7 @@ class boss_high_astromancer_solarian : public CreatureScript
Talk(SAY_AGGRO);
DoZoneInCombat();
- if (instance)
- instance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, IN_PROGRESS);
+ instance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, IN_PROGRESS);
}
void SummonMinion(uint32 entry, float x, float y, float z)
@@ -419,7 +416,7 @@ class boss_high_astromancer_solarian : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_high_astromancer_solarianAI(creature);
+ return GetInstanceAI<boss_high_astromancer_solarianAI>(creature);
}
};
@@ -467,8 +464,7 @@ class npc_solarium_priest : public CreatureScript
switch (urand(0, 1))
{
case 0:
- if (instance)
- target = Unit::GetUnit(*me, instance->GetData64(DATA_ASTROMANCER));
+ target = Unit::GetUnit(*me, instance->GetData64(DATA_ASTROMANCER));
break;
case 1:
target = me;
@@ -506,7 +502,7 @@ class npc_solarium_priest : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_solarium_priestAI(creature);
+ return GetInstanceAI<npc_solarium_priestAI>(creature);
}
};
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
index 2f9e882d176..75b1bfe8ad1 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -308,7 +308,7 @@ class boss_kaelthas : public CreatureScript
uint32 Phase;
uint32 PhaseSubphase; //generic
uint32 Phase_Timer; //generic timer
- uint32 PyrosCasted;
+ uint32 PyrosCast;
bool InGravityLapse;
bool IsCastingFireball;
@@ -330,7 +330,7 @@ class boss_kaelthas : public CreatureScript
GravityLapse_Phase = 0;
NetherBeam_Timer = 8000;
NetherVapor_Timer = 10000;
- PyrosCasted = 0;
+ PyrosCast = 0;
Phase = 0;
InGravityLapse = false;
IsCastingFireball = false;
@@ -344,8 +344,7 @@ class boss_kaelthas : public CreatureScript
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if (instance)
- instance->SetData(DATA_KAELTHASEVENT, 0);
+ instance->SetData(DATA_KAELTHASEVENT, 0);
}
void PrepareAdvisors()
@@ -364,9 +363,6 @@ class boss_kaelthas : public CreatureScript
void StartEvent()
{
- if (!instance)
- return;
-
m_auiAdvisorGuid[0] = instance->GetData64(DATA_THALADREDTHEDARKENER);
m_auiAdvisorGuid[1] = instance->GetData64(DATA_LORDSANGUINAR);
m_auiAdvisorGuid[2] = instance->GetData64(DATA_GRANDASTROMANCERCAPERNIAN);
@@ -468,8 +464,7 @@ class boss_kaelthas : public CreatureScript
summons.DespawnAll();
- if (instance)
- instance->SetData(DATA_KAELTHASEVENT, 0);
+ instance->SetData(DATA_KAELTHASEVENT, 0);
for (uint8 i = 0; i < MAX_ADVISORS; ++i)
{
@@ -633,8 +628,7 @@ class boss_kaelthas : public CreatureScript
if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD))
{
Phase = 2;
- if (instance)
- instance->SetData(DATA_KAELTHASEVENT, 2);
+ instance->SetData(DATA_KAELTHASEVENT, 2);
Talk(SAY_PHASE2_WEAPON);
@@ -678,8 +672,7 @@ class boss_kaelthas : public CreatureScript
if (Phase_Timer <= diff)
{
Talk(SAY_PHASE3_ADVANCE);
- if (instance)
- instance->SetData(DATA_KAELTHASEVENT, 3);
+ instance->SetData(DATA_KAELTHASEVENT, 3);
Phase = 3;
PhaseSubphase = 0;
}
@@ -716,8 +709,7 @@ class boss_kaelthas : public CreatureScript
Talk(SAY_PHASE4_INTRO2);
Phase = 4;
- if (instance)
- instance->SetData(DATA_KAELTHASEVENT, 4);
+ instance->SetData(DATA_KAELTHASEVENT, 4);
// Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael.
DoResetThreat();
@@ -750,7 +742,7 @@ class boss_kaelthas : public CreatureScript
{
if (!IsCastingFireball)
{
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
//interruptable
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false);
@@ -821,8 +813,7 @@ class boss_kaelthas : public CreatureScript
{
if (HealthBelowPct(50))
{
- if (instance)
- instance->SetData(DATA_KAELTHASEVENT, 4);
+ instance->SetData(DATA_KAELTHASEVENT, 4);
Phase = 5;
Phase_Timer = 10000;
@@ -844,19 +835,19 @@ class boss_kaelthas : public CreatureScript
{
DoCast(me, SPELL_SHOCK_BARRIER);
ChainPyros = true;
- PyrosCasted = 0;
+ PyrosCast = 0;
ShockBarrier_Timer = 60000;
}
else
ShockBarrier_Timer -= diff;
//Chain Pyros (3 of them max)
- if (ChainPyros && !me->IsNonMeleeSpellCasted(false))
+ if (ChainPyros && !me->IsNonMeleeSpellCast(false))
{
- if (PyrosCasted < 3)
+ if (PyrosCast < 3)
{
DoCastVictim(SPELL_PYROBLAST);
- ++PyrosCasted;
+ ++PyrosCast;
}
else
{
@@ -1011,7 +1002,7 @@ class boss_kaelthas : public CreatureScript
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_kaelthasAI(creature);
+ return GetInstanceAI<boss_kaelthasAI>(creature);
}
};
@@ -1078,7 +1069,7 @@ class boss_thaladred_the_darkener : public CreatureScript
{
DoResetThreat();
me->AddThreat(target, 5000000.0f);
- Talk(EMOTE_THALADRED_GAZE, target->GetGUID());
+ Talk(EMOTE_THALADRED_GAZE, target);
Gaze_Timer = 8500;
}
}
@@ -1109,7 +1100,7 @@ class boss_thaladred_the_darkener : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_thaladred_the_darkenerAI(creature);
+ return GetInstanceAI<boss_thaladred_the_darkenerAI>(creature);
}
};
@@ -1177,7 +1168,7 @@ class boss_lord_sanguinar : public CreatureScript
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_lord_sanguinarAI(creature);
+ return GetInstanceAI<boss_lord_sanguinarAI>(creature);
}
};
//Grand Astromancer Capernian AI
@@ -1321,7 +1312,7 @@ class boss_grand_astromancer_capernian : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_grand_astromancer_capernianAI(creature);
+ return GetInstanceAI<boss_grand_astromancer_capernianAI>(creature);
}
};
@@ -1404,7 +1395,7 @@ class boss_master_engineer_telonicus : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_master_engineer_telonicusAI(creature);
+ return GetInstanceAI<boss_master_engineer_telonicusAI>(creature);
}
};
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp
index f842ed19f3c..a1917d6201c 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -91,16 +91,14 @@ class boss_void_reaver : public CreatureScript
Talk(SAY_DEATH);
DoZoneInCombat();
- if (instance)
- instance->SetData(DATA_VOIDREAVEREVENT, DONE);
+ instance->SetData(DATA_VOIDREAVEREVENT, DONE);
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_AGGRO);
- if (instance)
- instance->SetData(DATA_VOIDREAVEREVENT, IN_PROGRESS);
+ instance->SetData(DATA_VOIDREAVEREVENT, IN_PROGRESS);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -172,7 +170,7 @@ class boss_void_reaver : public CreatureScript
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new boss_void_reaverAI(creature);
+ return GetInstanceAI<boss_void_reaverAI>(creature);
}
};
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 f5f75d79b63..fcace2a3ab4 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp
index e8d52c3f819..a09dd4c756e 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h
index b9e44aff0a9..52061a54591 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h
+++ b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp
index 97a165453f8..05050b4be2e 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp
index 6a4de059eb7..e34e4ebdb23 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp
index 06296ca3ae2..b15318647a9 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
index b5172245b49..d7e8eabd32f 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -182,14 +182,11 @@ class npc_ragin_flames : public CreatureScript
//Check_Timer
if (Check_Timer <= diff)
{
- if (instance)
+ if (instance->GetData(DATA_NETHERMANCER_SEPRETHREA) != IN_PROGRESS)
{
- if (instance->GetData(DATA_NETHERMANCER_SEPRETHREA) != IN_PROGRESS)
- {
- //remove
- me->setDeathState(JUST_DIED);
- me->RemoveCorpse();
- }
+ //remove
+ me->setDeathState(JUST_DIED);
+ me->RemoveCorpse();
}
Check_Timer = 1000;
} else Check_Timer -= diff;
@@ -223,7 +220,7 @@ class npc_ragin_flames : public CreatureScript
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_ragin_flamesAI(creature);
+ return GetInstanceAI<npc_ragin_flamesAI>(creature);
}
};
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp
index 59dee587ef6..8d6dde82770 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp
index c293a995467..9d2556d809b 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h b/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h
index 0d3a4ea241d..34346e163c7 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
index ff3145c5c78..3cc2e5dcc89 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -116,11 +116,10 @@ class npc_millhouse_manastorm : public CreatureScript
}
}
- void EnterCombat(Unit* /*who*/) OVERRIDE { }
-
- void KilledUnit(Unit* /*victim*/) OVERRIDE
+ void KilledUnit(Unit* who) OVERRIDE
{
- Talk(SAY_KILL);
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_KILL);
}
void JustDied(Unit* /*killer*/) OVERRIDE
@@ -191,7 +190,7 @@ class npc_millhouse_manastorm : public CreatureScript
if (Pyroblast_Timer <= diff)
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
return;
Talk(SAY_PYRO);
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h
index 1ebfad4dfeb..889a900653f 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -32,11 +32,11 @@ enum DataTypes
// Additional Data
DATA_CONVERSATION = 4,
- DATA_WARDEN_1 = 5, // used by EventAI
- DATA_WARDEN_2 = 6, // used by EventAI
- DATA_WARDEN_3 = 7, // used by EventAI
- DATA_WARDEN_4 = 8, // used by EventAI
- DATA_WARDEN_5 = 9, // used by EventAI
+ DATA_WARDEN_1 = 5, // used by SmartAI
+ DATA_WARDEN_2 = 6, // used by SmartAI
+ DATA_WARDEN_3 = 7, // used by SmartAI
+ DATA_WARDEN_4 = 8, // used by SmartAI
+ DATA_WARDEN_5 = 9, // used by SmartAI
DATA_MELLICHAR = 10,
DATA_WARDENS_SHIELD = 11
};
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp
index 36377b4d715..bfc304e6a99 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp
index 48d955acbc3..e94de3af56e 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -137,7 +137,7 @@ class boss_harbinger_skyriss : public CreatureScript
void DoSplit(uint32 val)
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(false);
Talk(SAY_IMAGE);
@@ -211,7 +211,7 @@ class boss_harbinger_skyriss : public CreatureScript
if (Fear_Timer <= diff)
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
return;
Talk(SAY_FEAR);
@@ -228,7 +228,7 @@ class boss_harbinger_skyriss : public CreatureScript
if (Domination_Timer <= diff)
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
return;
Talk(SAY_MIND);
@@ -247,7 +247,7 @@ class boss_harbinger_skyriss : public CreatureScript
{
if (ManaBurn_Timer <= diff)
{
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
return;
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp
index 2d9bfc92583..044be4c1534 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_zereketh_the_unbound.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_zereketh_the_unbound.cpp
index 7659f191ff7..54246453100 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_zereketh_the_unbound.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_zereketh_the_unbound.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
index cb7cd3828e2..90feaa8d091 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp
index bd67f4be8b7..fefb791715f 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp
+++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp
index 1b362fe8a5a..db62a0e91b3 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp
+++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -126,7 +126,7 @@ class boss_high_botanist_freywinn : public CreatureScript
{
Talk(SAY_TREE);
- if (me->IsNonMeleeSpellCasted(false))
+ if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(true);
me->RemoveAllAuras();
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp
index fe9e7d87008..839b452e631 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp
+++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp
index d2a1b294698..cc3ffc26edf 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp
+++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
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 68b7c4e8117..7b83fa7009d 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
+++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp b/src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp
index 1bcfc9cbb21..72202c5d896 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp
+++ b/src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h b/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h
index d5657dc7048..ed0d6b0c98a 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h
+++ b/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
index 82849691fcd..3da0ee61aa3 100644
--- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
+++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/boss_doomwalker.cpp b/src/server/scripts/Outland/boss_doomwalker.cpp
index 295d86bbce3..46777abce6a 100644
--- a/src/server/scripts/Outland/boss_doomwalker.cpp
+++ b/src/server/scripts/Outland/boss_doomwalker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp
index 167fd7f2074..cc58be26664 100644
--- a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp
+++ b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -19,16 +19,15 @@
/* ScriptData
SDName: Blades_Edge_Mountains
SD%Complete: 90
-SDComment: Quest support: 10503, 10504, 10556, 10594, 10609, 10682, 10821, 10980. Ogri'la->Skettis Flight. (npc_daranelle needs bit more work before consider complete)
+SDComment: Quest support: 10503, 10504, 10556, 10594, 10609, 10821. Ogri'la->Skettis Flight. (npc_daranelle needs bit more work before consider complete)
SDCategory: Blade's Edge Mountains
EndScriptData */
/* ContentData
-npc_bladespire_ogre
+npc_bloodmaul_brutebane
+npc_bloodmaul_brute
npc_nether_drake
npc_daranelle
-npc_overseer_nuaar
-npc_saikkal_the_elder
go_legion_obelisk
go_thunderspike
EndContentData */
@@ -45,44 +44,173 @@ EndContentData */
#include "SpellAuras.h"
#include "SpellAuraEffects.h"
-//Support for quest: You're Fired! (10821)
-bool obelisk_one, obelisk_two, obelisk_three, obelisk_four, obelisk_five;
-
-#define LEGION_OBELISK_ONE 185193
-#define LEGION_OBELISK_TWO 185195
-#define LEGION_OBELISK_THREE 185196
-#define LEGION_OBELISK_FOUR 185197
-#define LEGION_OBELISK_FIVE 185198
-
/*######
-## npc_bladespire_ogre
+## npc_bloodmaul_brutebane
######*/
-/// @todo add support for quest 10512 + Creature abilities
-class npc_bladespire_ogre : public CreatureScript
+enum Bloodmaul
+{
+ NPC_OGRE_BRUTE = 19995,
+ NPC_QUEST_CREDIT = 21241,
+ GO_KEG = 184315,
+ QUEST_GETTING_THE_BLADESPIRE_TANKED = 10512,
+ QUEST_BLADESPIRE_KEGGER = 10545
+};
+
+class npc_bloodmaul_brutebane : public CreatureScript
{
public:
- npc_bladespire_ogre() : CreatureScript("npc_bladespire_ogre") { }
+ npc_bloodmaul_brutebane() : CreatureScript("npc_bloodmaul_brutebane") { }
+
+ struct npc_bloodmaul_brutebaneAI : public ScriptedAI
+ {
+ npc_bloodmaul_brutebaneAI(Creature* creature) : ScriptedAI(creature)
+ {
+ if (Creature* Ogre = me->FindNearestCreature(NPC_OGRE_BRUTE, 50, true))
+ {
+ Ogre->SetReactState(REACT_DEFENSIVE);
+ Ogre->GetMotionMaster()->MovePoint(1, me->GetPositionX()-1, me->GetPositionY()+1, me->GetPositionZ());
+ }
+ }
+
+ uint64 OgreGUID;
+
+ void Reset() OVERRIDE
+ {
+ OgreGUID = 0;
+ }
+
+ void UpdateAI(uint32 /*diff*/) OVERRIDE { }
+ };
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- return new npc_bladespire_ogreAI(creature);
+ return new npc_bloodmaul_brutebaneAI(creature);
}
+};
+
+/*######
+## npc_bloodmaul_brute
+######*/
+
+enum BloodmaulBrute
+{
+ EVENT_CLEAVE = 1,
+ EVENT_DEBILITATING_STRIKE = 2,
+ SAY_AGGRO = 0,
+ SAY_DEATH = 1,
+ SAY_ENRAGE = 2,
+ SPELL_CLEAVE = 15496,
+ SPELL_DEBILITATING_STRIKE = 37577,
+ SPELL_ENRAGE = 8599,
+ QUEST_INTO_THE_SOULGRINDER = 11000
+};
- struct npc_bladespire_ogreAI : public ScriptedAI
+class npc_bloodmaul_brute : public CreatureScript
+{
+public:
+ npc_bloodmaul_brute() : CreatureScript("npc_bloodmaul_brute") { }
+
+ struct npc_bloodmaul_bruteAI : public ScriptedAI
{
- npc_bladespire_ogreAI(Creature* creature) : ScriptedAI(creature) { }
+ npc_bloodmaul_bruteAI(Creature* creature) : ScriptedAI(creature) { }
- void Reset() OVERRIDE { }
+ void Reset() OVERRIDE
+ {
+ PlayerGUID = 0;
+ hp30 = false;
+ }
- void UpdateAI(uint32 /*uiDiff*/) OVERRIDE
+ void EnterCombat(Unit* /*who*/) OVERRIDE
+ {
+ if (urand (0, 100) < 35)
+ Talk(SAY_AGGRO);
+
+ events.ScheduleEvent(EVENT_CLEAVE, urand(9000,12000));
+ events.ScheduleEvent(EVENT_DEBILITATING_STRIKE, 15000);
+ }
+
+ void JustDied(Unit* killer) OVERRIDE
+ {
+ if (killer->GetTypeId() == TYPEID_PLAYER)
+ if (killer->ToPlayer()->GetQuestRewardStatus(QUEST_INTO_THE_SOULGRINDER))
+ Talk(SAY_DEATH);
+ }
+
+ void MoveInLineOfSight(Unit* who) OVERRIDE
+ {
+ if (!who || (!who->IsAlive()))
+ return;
+
+ if (me->IsWithinDistInMap(who, 50.0f))
+ {
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ if (who->ToPlayer()->GetQuestStatus(QUEST_GETTING_THE_BLADESPIRE_TANKED) == QUEST_STATUS_INCOMPLETE
+ || who->ToPlayer()->GetQuestStatus(QUEST_BLADESPIRE_KEGGER) == QUEST_STATUS_INCOMPLETE)
+ PlayerGUID = who->GetGUID();
+ }
+ }
+
+ void MovementInform(uint32 /*type*/, uint32 id) OVERRIDE
+ {
+ if (id == 1)
+ {
+ if (GameObject* Keg = me->FindNearestGameObject(GO_KEG, 20))
+ Keg->Delete();
+
+ me->HandleEmoteCommand(7);
+ me->SetReactState(REACT_AGGRESSIVE);
+ me->GetMotionMaster()->MoveTargetedHome();
+
+ Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID);
+ Creature* Credit = me->FindNearestCreature(NPC_QUEST_CREDIT, 50, true);
+ if (player && Credit)
+ player->KilledMonster(Credit->GetCreatureTemplate(), Credit->GetGUID());
+ }
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
{
if (!UpdateVictim())
return;
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_CLEAVE:
+ DoCast(me, SPELL_CLEAVE);
+ events.ScheduleEvent(EVENT_CLEAVE, urand(9000,12000));
+ break;
+ case EVENT_DEBILITATING_STRIKE:
+ DoCastVictim(SPELL_DEBILITATING_STRIKE);
+ events.ScheduleEvent(EVENT_DEBILITATING_STRIKE, urand(18000,22000));
+ break;
+ }
+ }
+
+ if (!hp30 && HealthBelowPct(30))
+ {
+ hp30 = true;
+ Talk(SAY_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
+ }
+
DoMeleeAttackIfReady();
}
+
+ private:
+ EventMap events;
+ uint64 PlayerGUID;
+ bool hp30;
};
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_bloodmaul_bruteAI(creature);
+ }
};
/*######
@@ -116,11 +244,6 @@ class npc_nether_drake : public CreatureScript
public:
npc_nether_drake() : CreatureScript("npc_nether_drake") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_nether_drakeAI(creature);
- }
-
struct npc_nether_drakeAI : public ScriptedAI
{
npc_nether_drakeAI(Creature* creature) : ScriptedAI(creature) { }
@@ -264,6 +387,11 @@ public:
DoMeleeAttackIfReady();
}
};
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_nether_drakeAI(creature);
+ }
};
/*######
@@ -272,8 +400,9 @@ public:
enum Daranelle
{
- SAY_SPELL_INFLUENCE = 0,
- SPELL_LASHHAN_CHANNEL = 36904
+ SAY_SPELL_INFLUENCE = 0,
+ SPELL_LASHHAN_CHANNEL = 36904,
+ SPELL_DISPELLING_ANALYSIS = 37028
};
class npc_daranelle : public CreatureScript
@@ -281,11 +410,6 @@ class npc_daranelle : public CreatureScript
public:
npc_daranelle() : CreatureScript("npc_daranelle") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_daranelleAI(creature);
- }
-
struct npc_daranelleAI : public ScriptedAI
{
npc_daranelleAI(Creature* creature) : ScriptedAI(creature) { }
@@ -301,88 +425,34 @@ public:
{
if (who->HasAura(SPELL_LASHHAN_CHANNEL) && me->IsWithinDistInMap(who, 10.0f))
{
- Talk(SAY_SPELL_INFLUENCE, who->GetGUID());
+ Talk(SAY_SPELL_INFLUENCE, who);
/// @todo Move the below to updateAI and run if this statement == true
- DoCast(who, 37028, true);
+ DoCast(who, SPELL_DISPELLING_ANALYSIS, true);
}
}
ScriptedAI::MoveInLineOfSight(who);
}
};
-};
-
-/*######
-## npc_overseer_nuaar
-######*/
-
-#define GOSSIP_HELLO_ON "Overseer, I am here to negotiate on behalf of the Cenarion Expedition."
-
-class npc_overseer_nuaar : public CreatureScript
-{
-public:
- npc_overseer_nuaar() : CreatureScript("npc_overseer_nuaar") { }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->SEND_GOSSIP_MENU(10533, creature->GetGUID());
- player->AreaExploredOrEventHappens(10682);
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- if (player->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(10532, creature->GetGUID());
-
- return true;
+ return new npc_daranelleAI(creature);
}
};
-/*######
-## npc_saikkal_the_elder
-######*/
-
-#define GOSSIP_HELLO_STE "Yes... yes, it's me."
-#define GOSSIP_SELECT_STE "Yes elder. Tell me more of the book."
+//Support for quest: You're Fired! (10821)
+bool obelisk_one, obelisk_two, obelisk_three, obelisk_four, obelisk_five;
-class npc_saikkal_the_elder : public CreatureScript
+enum LegionObelisk
{
-public:
- npc_saikkal_the_elder() : CreatureScript("npc_saikkal_the_elder") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_STE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(10795, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
- player->SEND_GOSSIP_MENU(10796, creature->GetGUID());
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
- {
- if (player->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_STE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(10794, creature->GetGUID());
-
- return true;
- }
+ GO_LEGION_OBELISK_ONE = 185193,
+ GO_LEGION_OBELISK_TWO = 185195,
+ GO_LEGION_OBELISK_THREE = 185196,
+ GO_LEGION_OBELISK_FOUR = 185197,
+ GO_LEGION_OBELISK_FIVE = 185198,
+ NPC_DOOMCRYER = 19963,
+ QUEST_YOURE_FIRED = 10821
};
/*######
@@ -396,30 +466,30 @@ public:
bool OnGossipHello(Player* player, GameObject* go) OVERRIDE
{
- if (player->GetQuestStatus(10821) == QUEST_STATUS_INCOMPLETE)
+ if (player->GetQuestStatus(QUEST_YOURE_FIRED) == QUEST_STATUS_INCOMPLETE)
{
switch (go->GetEntry())
{
- case LEGION_OBELISK_ONE:
+ case GO_LEGION_OBELISK_ONE:
obelisk_one = true;
break;
- case LEGION_OBELISK_TWO:
+ case GO_LEGION_OBELISK_TWO:
obelisk_two = true;
break;
- case LEGION_OBELISK_THREE:
+ case GO_LEGION_OBELISK_THREE:
obelisk_three = true;
break;
- case LEGION_OBELISK_FOUR:
+ case GO_LEGION_OBELISK_FOUR:
obelisk_four = true;
break;
- case LEGION_OBELISK_FIVE:
+ case GO_LEGION_OBELISK_FIVE:
obelisk_five = true;
break;
}
if (obelisk_one == true && obelisk_two == true && obelisk_three == true && obelisk_four == true && obelisk_five == true)
{
- go->SummonCreature(19963, 2943.40f, 4778.20f, 284.49f, 0.94f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
+ go->SummonCreature(NPC_DOOMCRYER, 2943.40f, 4778.20f, 284.49f, 0.94f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
//reset global var
obelisk_one = false;
obelisk_two = false;
@@ -434,117 +504,6 @@ public:
};
/*######
-## npc_bloodmaul_brutebane
-######*/
-
-enum Bloodmaul
-{
- NPC_OGRE_BRUTE = 19995,
- NPC_QUEST_CREDIT = 21241,
- GO_KEG = 184315,
- QUEST_GETTING_THE_BLADESPIRE_TANKED = 10512,
- QUEST_BLADESPIRE_KEGGER = 10545,
-};
-
-class npc_bloodmaul_brutebane : public CreatureScript
-{
-public:
- npc_bloodmaul_brutebane() : CreatureScript("npc_bloodmaul_brutebane") { }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_bloodmaul_brutebaneAI(creature);
- }
-
- struct npc_bloodmaul_brutebaneAI : public ScriptedAI
- {
- npc_bloodmaul_brutebaneAI(Creature* creature) : ScriptedAI(creature)
- {
- if (Creature* Ogre = me->FindNearestCreature(NPC_OGRE_BRUTE, 50, true))
- {
- Ogre->SetReactState(REACT_DEFENSIVE);
- Ogre->GetMotionMaster()->MovePoint(1, me->GetPositionX()-1, me->GetPositionY()+1, me->GetPositionZ());
- }
- }
-
- uint64 OgreGUID;
-
- void Reset() OVERRIDE
- {
- OgreGUID = 0;
- }
-
- void UpdateAI(uint32 /*uiDiff*/) OVERRIDE { }
- };
-};
-
-/*######
-## npc_ogre_brute
-######*/
-
-class npc_ogre_brute : public CreatureScript
-{
-public:
- npc_ogre_brute() : CreatureScript("npc_ogre_brute") { }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_ogre_bruteAI(creature);
- }
-
- struct npc_ogre_bruteAI : public ScriptedAI
- {
- npc_ogre_bruteAI(Creature* creature) : ScriptedAI(creature) { }
-
- uint64 PlayerGUID;
-
- void Reset() OVERRIDE
- {
- PlayerGUID = 0;
- }
-
- void MoveInLineOfSight(Unit* who) OVERRIDE
- {
- if (!who || (!who->IsAlive()))
- return;
-
- if (me->IsWithinDistInMap(who, 50.0f))
- {
- if (who->GetTypeId() == TYPEID_PLAYER)
- if (who->ToPlayer()->GetQuestStatus(QUEST_GETTING_THE_BLADESPIRE_TANKED) == QUEST_STATUS_INCOMPLETE
- || who->ToPlayer()->GetQuestStatus(QUEST_BLADESPIRE_KEGGER) == QUEST_STATUS_INCOMPLETE)
- PlayerGUID = who->GetGUID();
- }
- }
-
- void MovementInform(uint32 /*type*/, uint32 id) OVERRIDE
- {
- if (id == 1)
- {
- if (GameObject* Keg = me->FindNearestGameObject(GO_KEG, 20))
- Keg->Delete();
-
- me->HandleEmoteCommand(7);
- me->SetReactState(REACT_AGGRESSIVE);
- me->GetMotionMaster()->MoveTargetedHome();
-
- Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID);
- Creature* Credit = me->FindNearestCreature(NPC_QUEST_CREDIT, 50, true);
- if (player && Credit)
- player->KilledMonster(Credit->GetCreatureTemplate(), Credit->GetGUID());
- }
- }
-
- void UpdateAI(uint32 /*diff*/) OVERRIDE
- {
- if (!UpdateVictim())
- return;
- DoMeleeAttackIfReady();
- }
- };
-};
-
-/*######
## go_thunderspike
######*/
@@ -923,7 +882,7 @@ class npc_simon_bunny : public CreatureScript
/*
Called when AI is playing the sequence for player. We cast the visual spell and then remove the
- casted color from the casting sequence.
+ cast color from the casting sequence.
*/
void PlayNextColor()
{
@@ -1154,6 +1113,7 @@ class go_apexis_relic : public GameObjectScript
enum ScannerMasterBunny
{
NPC_OSCILLATING_FREQUENCY_SCANNER_TOP_BUNNY = 21759,
+ GO_OSCILLATING_FREQUENCY_SCANNER = 184926,
SPELL_OSCILLATION_FIELD = 37408,
QUEST_GAUGING_THE_RESONANT_FREQUENCY = 10594
};
@@ -1165,7 +1125,10 @@ public:
struct npc_oscillating_frequency_scanner_master_bunnyAI : public ScriptedAI
{
- npc_oscillating_frequency_scanner_master_bunnyAI(Creature* creature) : ScriptedAI(creature) { }
+ npc_oscillating_frequency_scanner_master_bunnyAI(Creature* creature) : ScriptedAI(creature)
+ {
+ playerGuid = 0;
+ }
void Reset() OVERRIDE
{
@@ -1174,8 +1137,8 @@ public:
else
{
// Spell 37392 does not exist in dbc, manually spawning
- me->SummonCreature(21759, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 0.5f, me->GetOrientation(), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 50000);
- me->SummonGameObject(184926, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), 0, 0, 0, 0, 50000);
+ me->SummonCreature(NPC_OSCILLATING_FREQUENCY_SCANNER_TOP_BUNNY, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 0.5f, me->GetOrientation(), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 50000);
+ me->SummonGameObject(GO_OSCILLATING_FREQUENCY_SCANNER, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), 0, 0, 0, 0, 50000);
me->DespawnOrUnsummon(50000);
}
@@ -1242,14 +1205,11 @@ class spell_oscillating_field : public SpellScriptLoader
void AddSC_blades_edge_mountains()
{
- new npc_bladespire_ogre();
+ new npc_bloodmaul_brutebane();
+ new npc_bloodmaul_brute();
new npc_nether_drake();
new npc_daranelle();
- new npc_overseer_nuaar();
- new npc_saikkal_the_elder();
new go_legion_obelisk();
- new npc_bloodmaul_brutebane();
- new npc_ogre_brute();
new go_thunderspike();
new npc_simon_bunny();
new go_simon_cluster();
diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
index 0aad4973000..3736994e9a3 100644
--- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
+++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -19,18 +19,15 @@
/* ScriptData
SDName: Hellfire_Peninsula
SD%Complete: 100
-SDComment: Quest support: 9375, 9410, 9418, 10129, 10146, 10162, 10163, 10340, 10346, 10347, 10382 (Special flight paths)
+SDComment: Quest support: 9375, 9410, 9418, 10129, 10146, 10162, 10163, 10340, 10346, 10347, 10382 (Special flight paths) "Needs update"
SDCategory: Hellfire Peninsula
EndScriptData */
/* ContentData
npc_aeranas
npc_ancestral_wolf
-go_haaleshi_altar
-npc_naladu
-npc_tracy_proudwell
-npc_trollbane
npc_wounded_blood_elf
+npc_fel_guard_hound
EndContentData */
#include "ScriptMgr.h"
@@ -46,14 +43,12 @@ EndContentData */
enum Aeranas
{
- SAY_SUMMON = 0,
- SAY_FREE = 1,
-
- FACTION_HOSTILE = 16,
- FACTION_FRIENDLY = 35,
-
- SPELL_ENVELOPING_WINDS = 15535,
- SPELL_SHOCK = 12553
+ SAY_SUMMON = 0,
+ SAY_FREE = 1,
+ FACTION_HOSTILE = 16,
+ FACTION_FRIENDLY = 35,
+ SPELL_ENVELOPING_WINDS = 15535,
+ SPELL_SHOCK = 12553
};
class npc_aeranas : public CreatureScript
@@ -61,24 +56,15 @@ class npc_aeranas : public CreatureScript
public:
npc_aeranas() : CreatureScript("npc_aeranas") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_aeranasAI(creature);
- }
-
struct npc_aeranasAI : public ScriptedAI
{
npc_aeranasAI(Creature* creature) : ScriptedAI(creature) { }
- uint32 Faction_Timer;
- uint32 EnvelopingWinds_Timer;
- uint32 Shock_Timer;
-
void Reset() OVERRIDE
{
- Faction_Timer = 8000;
- EnvelopingWinds_Timer = 9000;
- Shock_Timer = 5000;
+ faction_Timer = 8000;
+ envelopingWinds_Timer = 9000;
+ shock_Timer = 5000;
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
me->setFaction(FACTION_FRIENDLY);
@@ -88,13 +74,13 @@ public:
void UpdateAI(uint32 diff) OVERRIDE
{
- if (Faction_Timer)
+ if (faction_Timer)
{
- if (Faction_Timer <= diff)
+ if (faction_Timer <= diff)
{
me->setFaction(FACTION_HOSTILE);
- Faction_Timer = 0;
- } else Faction_Timer -= diff;
+ faction_Timer = 0;
+ } else faction_Timer -= diff;
}
if (!UpdateVictim())
@@ -111,21 +97,31 @@ public:
return;
}
- if (Shock_Timer <= diff)
+ if (shock_Timer <= diff)
{
DoCastVictim(SPELL_SHOCK);
- Shock_Timer = 10000;
- } else Shock_Timer -= diff;
+ shock_Timer = 10000;
+ } else shock_Timer -= diff;
- if (EnvelopingWinds_Timer <= diff)
+ if (envelopingWinds_Timer <= diff)
{
DoCastVictim(SPELL_ENVELOPING_WINDS);
- EnvelopingWinds_Timer = 25000;
- } else EnvelopingWinds_Timer -= diff;
+ envelopingWinds_Timer = 25000;
+ } else envelopingWinds_Timer -= diff;
DoMeleeAttackIfReady();
}
+
+ private:
+ uint32 faction_Timer;
+ uint32 envelopingWinds_Timer;
+ uint32 shock_Timer;
};
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_aeranasAI(creature);
+ }
};
/*######
@@ -134,13 +130,11 @@ public:
enum AncestralWolf
{
- EMOTE_WOLF_LIFT_HEAD = 0,
- EMOTE_WOLF_HOWL = 1,
- SAY_WOLF_WELCOME = 2,
-
- SPELL_ANCESTRAL_WOLF_BUFF = 29981,
-
- NPC_RYGA = 17123
+ EMOTE_WOLF_LIFT_HEAD = 0,
+ EMOTE_WOLF_HOWL = 1,
+ SAY_WOLF_WELCOME = 2,
+ SPELL_ANCESTRAL_WOLF_BUFF = 29981,
+ NPC_RYGA = 17123
};
class npc_ancestral_wolf : public CreatureScript
@@ -148,11 +142,6 @@ class npc_ancestral_wolf : public CreatureScript
public:
npc_ancestral_wolf() : CreatureScript("npc_ancestral_wolf") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_ancestral_wolfAI(creature);
- }
-
struct npc_ancestral_wolfAI : public npc_escortAI
{
npc_ancestral_wolfAI(Creature* creature) : npc_escortAI(creature)
@@ -166,20 +155,18 @@ public:
Reset();
}
- Creature* pRyga;
-
void Reset() OVERRIDE
{
- pRyga = NULL;
+ ryga = NULL;
DoCast(me, SPELL_ANCESTRAL_WOLF_BUFF, true);
}
void MoveInLineOfSight(Unit* who) OVERRIDE
{
- if (!pRyga && who->GetEntry() == NPC_RYGA && me->IsWithinDistInMap(who, 15.0f))
+ if (!ryga && who->GetEntry() == NPC_RYGA && me->IsWithinDistInMap(who, 15.0f))
if (Creature* temp = who->ToCreature())
- pRyga = temp;
+ ryga = temp;
npc_escortAI::MoveInLineOfSight(who);
}
@@ -195,154 +182,19 @@ public:
Talk(EMOTE_WOLF_HOWL);
break;
case 50:
- if (pRyga && pRyga->IsAlive() && !pRyga->IsInCombat())
- pRyga->AI()->Talk(SAY_WOLF_WELCOME);
+ if (ryga && ryga->IsAlive() && !ryga->IsInCombat())
+ ryga->AI()->Talk(SAY_WOLF_WELCOME);
break;
}
}
- };
-};
-
-/*######
-## npc_naladu
-######*/
-
-#define GOSSIP_NALADU_ITEM1 "Why don't you escape?"
-
-enum Naladu
-{
- GOSSIP_TEXTID_NALADU1 = 9788
-};
-
-class npc_naladu : public CreatureScript
-{
-public:
- npc_naladu() : CreatureScript("npc_naladu") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_NALADU1, creature->GetGUID());
-
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_NALADU_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
-};
-
-/*######
-## npc_tracy_proudwell
-######*/
-
-#define GOSSIP_TEXT_REDEEM_MARKS "I have marks to redeem!"
-#define GOSSIP_TRACY_PROUDWELL_ITEM1 "I heard that your dog Fei Fei took Klatu's prayer beads..."
-#define GOSSIP_TRACY_PROUDWELL_ITEM2 "<back>"
-
-enum Tracy
-{
- GOSSIP_TEXTID_TRACY_PROUDWELL1 = 10689,
- QUEST_DIGGING_FOR_PRAYER_BEADS = 10916
-};
-
-class npc_tracy_proudwell : public CreatureScript
-{
-public:
- npc_tracy_proudwell() : CreatureScript("npc_tracy_proudwell") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TRACY_PROUDWELL_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TRACY_PROUDWELL1, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- break;
- case GOSSIP_ACTION_TRADE:
- player->GetSession()->SendListInventory(creature->GetGUID());
- break;
- }
-
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (creature->IsVendor())
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_REDEEM_MARKS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-
- if (player->GetQuestStatus(QUEST_DIGGING_FOR_PRAYER_BEADS) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TRACY_PROUDWELL_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
-};
-
-/*######
-## npc_trollbane
-######*/
-
-#define GOSSIP_TROLLBANE_ITEM1 "Tell me of the Sons of Lothar."
-#define GOSSIP_TROLLBANE_ITEM2 "<more>"
-#define GOSSIP_TROLLBANE_ITEM3 "Tell me of your homeland."
-
-enum Trollbane
-{
- GOSSIP_TEXTID_TROLLBANE1 = 9932,
- GOSSIP_TEXTID_TROLLBANE2 = 9933,
- GOSSIP_TEXTID_TROLLBANE3 = 8772
-};
-class npc_trollbane : public CreatureScript
-{
-public:
- npc_trollbane() : CreatureScript("npc_trollbane") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TROLLBANE1, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TROLLBANE2, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TROLLBANE3, creature->GetGUID());
- break;
- }
-
- return true;
- }
+ private:
+ Creature* ryga;
+ };
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
+ return new npc_ancestral_wolfAI(creature);
}
};
@@ -358,8 +210,10 @@ enum WoundedBloodElf
SAY_ELF_SUMMON2 = 3,
SAY_ELF_COMPLETE = 4,
SAY_ELF_AGGRO = 5,
-
- QUEST_ROAD_TO_FALCON_WATCH = 9375
+ QUEST_ROAD_TO_FALCON_WATCH = 9375,
+ NPC_HAALESHI_WINDWALKER = 16966,
+ NPC_HAALESHI_TALONGUARD = 16967,
+ FACTION_FALCON_WATCH_QUEST = 775
};
class npc_wounded_blood_elf : public CreatureScript
@@ -367,28 +221,31 @@ class npc_wounded_blood_elf : public CreatureScript
public:
npc_wounded_blood_elf() : CreatureScript("npc_wounded_blood_elf") { }
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
+ struct npc_wounded_blood_elfAI : public npc_escortAI
{
- if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH)
- {
- if (npc_escortAI* pEscortAI = CAST_AI(npc_wounded_blood_elf::npc_wounded_blood_elfAI, creature->AI()))
- pEscortAI->Start(true, false, player->GetGUID());
+ npc_wounded_blood_elfAI(Creature* creature) : npc_escortAI(creature) { }
- // Change faction so mobs attack
- creature->setFaction(775);
- }
+ void Reset() OVERRIDE { }
- return true;
- }
+ void EnterCombat(Unit* /*who*/) OVERRIDE
+ {
+ if (HasEscortState(STATE_ESCORT_ESCORTING))
+ Talk(SAY_ELF_AGGRO);
+ }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_wounded_blood_elfAI(creature);
- }
+ void JustSummoned(Creature* summoned) OVERRIDE
+ {
+ summoned->AI()->AttackStart(me);
+ }
- struct npc_wounded_blood_elfAI : public npc_escortAI
- {
- npc_wounded_blood_elfAI(Creature* creature) : npc_escortAI(creature) { }
+ void sQuestAccept(Player* player, Quest const* quest)
+ {
+ if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH)
+ {
+ me->setFaction(FACTION_FALCON_WATCH_QUEST);
+ npc_escortAI::Start(true, false, player->GetGUID());
+ }
+ }
void WaypointReached(uint32 waypointId) OVERRIDE
{
@@ -399,44 +256,36 @@ public:
switch (waypointId)
{
case 0:
- Talk(SAY_ELF_START, player->GetGUID());
+ Talk(SAY_ELF_START, player);
break;
case 9:
- Talk(SAY_ELF_SUMMON1, player->GetGUID());
+ Talk(SAY_ELF_SUMMON1, player);
// Spawn two Haal'eshi Talonguard
- DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ DoSpawnCreature(NPC_HAALESHI_TALONGUARD, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ DoSpawnCreature(NPC_HAALESHI_TALONGUARD, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break;
case 13:
- Talk(SAY_ELF_RESTING, player->GetGUID());
+ Talk(SAY_ELF_RESTING, player);
break;
case 14:
- Talk(SAY_ELF_SUMMON2, player->GetGUID());
+ Talk(SAY_ELF_SUMMON2, player);
// Spawn two Haal'eshi Windwalker
- DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ DoSpawnCreature(NPC_HAALESHI_WINDWALKER, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ DoSpawnCreature(NPC_HAALESHI_WINDWALKER, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
break;
case 27:
- Talk(SAY_ELF_COMPLETE, player->GetGUID());
+ Talk(SAY_ELF_COMPLETE, player);
// Award quest credit
player->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH, me);
break;
}
}
-
- void Reset() OVERRIDE { }
-
- void EnterCombat(Unit* /*who*/) OVERRIDE
- {
- if (HasEscortState(STATE_ESCORT_ESCORTING))
- Talk(SAY_ELF_AGGRO);
- }
-
- void JustSummoned(Creature* summoned) OVERRIDE
- {
- summoned->AI()->AttackStart(me);
- }
};
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_wounded_blood_elfAI(creature);
+ }
};
/*######
@@ -445,9 +294,8 @@ public:
enum FelGuard
{
- SPELL_SUMMON_POO = 37688,
-
- NPC_DERANGED_HELBOAR = 16863
+ SPELL_SUMMON_POO = 37688,
+ NPC_DERANGED_HELBOAR = 16863
};
class npc_fel_guard_hound : public CreatureScript
@@ -455,32 +303,24 @@ class npc_fel_guard_hound : public CreatureScript
public:
npc_fel_guard_hound() : CreatureScript("npc_fel_guard_hound") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_fel_guard_houndAI(creature);
- }
-
struct npc_fel_guard_houndAI : public ScriptedAI
{
npc_fel_guard_houndAI(Creature* creature) : ScriptedAI(creature) { }
- uint32 uiCheckTimer;
- uint64 uiHelboarGUID;
-
void Reset() OVERRIDE
{
- uiCheckTimer = 5000; //check for creature every 5 sec
- uiHelboarGUID = 0;
+ checkTimer = 5000; //check for creature every 5 sec
+ helboarGUID = 0;
}
- void MovementInform(uint32 uiType, uint32 uiId) OVERRIDE
+ void MovementInform(uint32 type, uint32 id) OVERRIDE
{
- if (uiType != POINT_MOTION_TYPE || uiId != 1)
+ if (type != POINT_MOTION_TYPE || id != 1)
return;
- if (Creature* pHelboar = me->GetCreature(*me, uiHelboarGUID))
+ if (Creature* helboar = me->GetCreature(*me, helboarGUID))
{
- pHelboar->RemoveCorpse();
+ helboar->RemoveCorpse();
DoCast(SPELL_SUMMON_POO);
if (Player* owner = me->GetCharmerOrOwnerPlayerOrPlayerItself())
@@ -488,36 +328,43 @@ public:
}
}
- void UpdateAI(uint32 uiDiff) OVERRIDE
+ void UpdateAI(uint32 diff) OVERRIDE
{
- if (uiCheckTimer <= uiDiff)
+ if (checkTimer <= diff)
{
- if (Creature* pHelboar = me->FindNearestCreature(NPC_DERANGED_HELBOAR, 10.0f, false))
+ if (Creature* helboar = me->FindNearestCreature(NPC_DERANGED_HELBOAR, 10.0f, false))
{
- if (pHelboar->GetGUID() != uiHelboarGUID && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && !me->FindCurrentSpellBySpellId(SPELL_SUMMON_POO))
+ if (helboar->GetGUID() != helboarGUID && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && !me->FindCurrentSpellBySpellId(SPELL_SUMMON_POO))
{
- uiHelboarGUID = pHelboar->GetGUID();
- me->GetMotionMaster()->MovePoint(1, pHelboar->GetPositionX(), pHelboar->GetPositionY(), pHelboar->GetPositionZ());
+ helboarGUID = helboar->GetGUID();
+ me->GetMotionMaster()->MovePoint(1, helboar->GetPositionX(), helboar->GetPositionY(), helboar->GetPositionZ());
}
}
- uiCheckTimer = 5000;
- }else uiCheckTimer -= uiDiff;
+ checkTimer = 5000;
+ }
+ else checkTimer -= diff;
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
+
+ private:
+ uint32 checkTimer;
+ uint64 helboarGUID;
};
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_fel_guard_houndAI(creature);
+ }
};
void AddSC_hellfire_peninsula()
{
new npc_aeranas();
new npc_ancestral_wolf();
- new npc_naladu();
- new npc_tracy_proudwell();
- new npc_trollbane();
new npc_wounded_blood_elf();
new npc_fel_guard_hound();
}
diff --git a/src/server/scripts/Outland/zone_nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp
index c8e4241974e..8d5c81d1c01 100644
--- a/src/server/scripts/Outland/zone_nagrand.cpp
+++ b/src/server/scripts/Outland/zone_nagrand.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -688,7 +688,7 @@ class go_warmaul_prison : public GameObjectScript
{
player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0);
- prisoner->AI()->Talk(SAY_FREE, player->GetGUID());
+ prisoner->AI()->Talk(SAY_FREE, player);
prisoner->DespawnOrUnsummon(6000);
}
return true;
diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp
index 5cf152bd6e2..72e7332381b 100644
--- a/src/server/scripts/Outland/zone_netherstorm.cpp
+++ b/src/server/scripts/Outland/zone_netherstorm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -245,7 +245,7 @@ public:
{
Unit* u = Unit::GetUnit(*me, someplayer);
if (u && u->GetTypeId() == TYPEID_PLAYER)
- Talk(EMOTE_START, u->GetGUID());
+ Talk(EMOTE_START, u);
}
Event_Timer = 60000;
Wave = true;
@@ -400,7 +400,7 @@ public:
struct npc_commander_dawnforgeAI : public ScriptedAI
{
- npc_commander_dawnforgeAI(Creature* creature) : ScriptedAI(creature) { Reset(); }
+ npc_commander_dawnforgeAI(Creature* creature) : ScriptedAI(creature) { }
uint64 PlayerGUID;
uint64 ardonisGUID;
@@ -411,9 +411,6 @@ public:
uint32 Phase_Timer;
bool isEvent;
- float angle_dawnforge;
- float angle_ardonis;
-
void Reset() OVERRIDE
{
PlayerGUID = 0;
@@ -438,21 +435,15 @@ public:
{
Creature* ardonis = ObjectAccessor::GetCreature(*me, ardonisGUID);
Creature* pathaleon = ObjectAccessor::GetCreature(*me, pathaleonGUID);
- Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID);
- if (!ardonis || !pathaleon || !player)
+ if (!ardonis || !pathaleon)
return;
- //Calculate the angle to Pathaleon
- angle_dawnforge = me->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
- angle_ardonis = ardonis->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
+ // Turn Dawnforge
+ me->SetFacingToObject(pathaleon);
- //Turn Dawnforge and update
- me->SetOrientation(angle_dawnforge);
- me->SendUpdateToPlayer(player);
- //Turn Ardonis and update
- ardonis->SetOrientation(angle_ardonis);
- ardonis->SendUpdateToPlayer(player);
+ // Turn Ardonis
+ ardonis->SetFacingToObject(pathaleon);
//Set them to kneel
me->SetStandState(UNIT_STAND_STATE_KNEEL);
@@ -464,20 +455,11 @@ public:
{
if (Unit* ardonis = ObjectAccessor::GetUnit(*me, ardonisGUID))
{
- Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID);
-
- if (!player)
- return;
-
- angle_dawnforge = me->GetAngle(ardonis->GetPositionX(), ardonis->GetPositionY());
- angle_ardonis = ardonis->GetAngle(me->GetPositionX(), me->GetPositionY());
+ // Turn Dawnforge
+ me->SetFacingToObject(ardonis);
- //Turn Dawnforge and update
- me->SetOrientation(angle_dawnforge);
- me->SendUpdateToPlayer(player);
- //Turn Ardonis and update
- ardonis->SetOrientation(angle_ardonis);
- ardonis->SendUpdateToPlayer(player);
+ // Turn Ardonis
+ ardonis->SetFacingToObject(me);
//Set state
me->SetStandState(UNIT_STAND_STATE_STAND);
@@ -685,7 +667,7 @@ public:
//OnQuestAccept:
//if (quest->GetQuestId() == QUEST_DIMENSIUS)
- //creature->AI()->Talk(WHISPER_DABIRI, player->GetGUID());
+ //creature->AI()->Talk(WHISPER_DABIRI, player);
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
{
@@ -914,7 +896,7 @@ public:
break;
case 13:
if (me->FindNearestCreature(N_THADELL, 30))
- Talk(SAY_THADELL_2, player->GetGUID());
+ Talk(SAY_THADELL_2, player);
break;
}
}
diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
index 41abc490d2b..f0defe88083 100644
--- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
+++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -19,7 +19,7 @@
/* ScriptData
SDName: Shadowmoon_Valley
SD%Complete: 100
-SDComment: Quest support: 10519, 10583, 10601, 10804, 10854, 10458, 10481, 10480, 11082, 10781, 10451. Vendor Drake Dealer Hurlunk.
+SDComment: Quest support: 10519, 10583, 10601, 10804, 10854, 10458, 10481, 10480, 10781, 10451. Vendor Drake Dealer Hurlunk.
SDCategory: Shadowmoon Valley
EndScriptData */
@@ -28,7 +28,6 @@ npc_mature_netherwing_drake
npc_enslaved_netherwing_drake
npc_drake_dealer_hurlunk
npcs_flanis_swiftwing_and_kagrosh
-npc_murkblood_overseer
npc_karynaku
npc_oronok_tornheart
npc_overlord_morghor
@@ -493,74 +492,6 @@ public:
};
/*######
-## npc_murkblood_overseer
-######*/
-
-#define QUEST_11082 11082
-
-#define GOSSIP_HMO "I am here for you, overseer."
-#define GOSSIP_SMO1 "How dare you question an overseer of the Dragonmaw!"
-#define GOSSIP_SMO2 "Who speaks of me? What are you talking about, broken?"
-#define GOSSIP_SMO3 "Continue please."
-#define GOSSIP_SMO4 "Who are these bidders?"
-#define GOSSIP_SMO5 "Well... yes."
-
-class npc_murkblood_overseer : public CreatureScript
-{
-public:
- npc_murkblood_overseer() : CreatureScript("npc_murkblood_overseer") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- //correct id not known
- player->SEND_GOSSIP_MENU(10940, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- //correct id not known
- player->SEND_GOSSIP_MENU(10940, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- //correct id not known
- player->SEND_GOSSIP_MENU(10940, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- //correct id not known
- player->SEND_GOSSIP_MENU(10940, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- //correct id not known
- player->SEND_GOSSIP_MENU(10940, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- //correct id not known
- player->SEND_GOSSIP_MENU(10940, creature->GetGUID());
- creature->CastSpell(player, 41121, false);
- player->AreaExploredOrEventHappens(QUEST_11082);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
- {
- if (player->GetQuestStatus(QUEST_11082) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(0, GOSSIP_HMO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(10940, creature->GetGUID());
- return true;
- }
-};
-
-/*######
## npc_oronok
######*/
@@ -762,7 +693,7 @@ public:
{
Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID);
if (player)
- Talk(OVERLORD_SAY_1, player->GetGUID());
+ Talk(OVERLORD_SAY_1, player);
}
ConversationTimer = 4200;
Step = 0;
@@ -790,7 +721,7 @@ public:
return 9000;
break;
case 2:
- Talk(OVERLORD_YELL_1, player->GetGUID());
+ Talk(OVERLORD_YELL_1, player);
return 4500;
break;
case 3:
@@ -798,7 +729,7 @@ public:
return 3200;
break;
case 4:
- Talk(OVERLORD_SAY_2, player->GetGUID());
+ Talk(OVERLORD_SAY_2, player);
return 2000;
break;
case 5:
@@ -837,7 +768,7 @@ public:
return 5000;
break;
case 11:
- Talk(OVERLORD_SAY_4, player->GetGUID());
+ Talk(OVERLORD_SAY_4, player);
return 6000;
break;
case 12:
@@ -936,7 +867,7 @@ public:
case 29:
{
if (Creature* Yarzill = me->FindNearestCreature(C_YARZILL, 50.0f))
- Yarzill->AI()->Talk(YARZILL_THE_MERC_SAY, player->GetGUID());
+ Yarzill->AI()->Talk(YARZILL_THE_MERC_SAY, player);
return 5000;
}
break;
@@ -1016,7 +947,7 @@ public:
{
if (quest->GetQuestId() == QUEST_ESCAPE_COILSCAR)
{
- creature->AI()->Talk(SAY_WIL_START, player->GetGUID());
+ creature->AI()->Talk(SAY_WIL_START, player);
creature->setFaction(FACTION_EARTHEN);
if (npc_earthmender_wildaAI* pEscortAI = CAST_AI(npc_earthmender_wilda::npc_earthmender_wildaAI, creature->AI()))
@@ -1050,14 +981,14 @@ public:
switch (waypointId)
{
case 13:
- Talk(SAY_WIL_PROGRESS1, player->GetGUID());
+ Talk(SAY_WIL_PROGRESS1, player);
DoSpawnAssassin();
break;
case 14:
DoSpawnAssassin();
break;
case 15:
- Talk(SAY_WIL_FIND_EXIT, player->GetGUID());
+ Talk(SAY_WIL_FIND_EXIT, player);
break;
case 19:
DoRandomSay();
@@ -1084,7 +1015,7 @@ public:
DoSpawnAssassin();
break;
case 39:
- Talk(SAY_WIL_JUST_AHEAD, player->GetGUID());
+ Talk(SAY_WIL_JUST_AHEAD, player);
break;
case 43:
DoRandomSay();
@@ -1093,7 +1024,7 @@ public:
DoSpawnAssassin();
break;
case 50:
- Talk(SAY_WIL_END, player->GetGUID());
+ Talk(SAY_WIL_END, player);
player->GroupEventHappens(QUEST_ESCAPE_COILSCAR, me);
break;
}
@@ -2011,7 +1942,6 @@ void AddSC_shadowmoon_valley()
new npc_dragonmaw_peon();
new npc_drake_dealer_hurlunk();
new npcs_flanis_swiftwing_and_kagrosh();
- new npc_murkblood_overseer();
new npc_karynaku();
new npc_oronok_tornheart();
new npc_overlord_morghor();
diff --git a/src/server/scripts/Outland/zone_shattrath_city.cpp b/src/server/scripts/Outland/zone_shattrath_city.cpp
index adbec22ca2d..a5cdb600311 100644
--- a/src/server/scripts/Outland/zone_shattrath_city.cpp
+++ b/src/server/scripts/Outland/zone_shattrath_city.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -342,70 +342,70 @@ public:
switch (waypointId)
{
case 0:
- Talk(SAY1, player->GetGUID());
+ Talk(SAY1, player);
break;
case 4:
- Talk(WHISP1, player->GetGUID());
+ Talk(WHISP1, player);
break;
case 6:
- Talk(WHISP2, player->GetGUID());
+ Talk(WHISP2, player);
break;
case 7:
- Talk(WHISP3, player->GetGUID());
+ Talk(WHISP3, player);
break;
case 8:
- Talk(WHISP4, player->GetGUID());
+ Talk(WHISP4, player);
break;
case 17:
- Talk(WHISP5, player->GetGUID());
+ Talk(WHISP5, player);
break;
case 18:
- Talk(WHISP6, player->GetGUID());
+ Talk(WHISP6, player);
break;
case 19:
- Talk(WHISP7, player->GetGUID());
+ Talk(WHISP7, player);
break;
case 33:
- Talk(WHISP8, player->GetGUID());
+ Talk(WHISP8, player);
break;
case 34:
- Talk(WHISP9, player->GetGUID());
+ Talk(WHISP9, player);
break;
case 35:
- Talk(WHISP10, player->GetGUID());
+ Talk(WHISP10, player);
break;
case 36:
- Talk(WHISP11, player->GetGUID());
+ Talk(WHISP11, player);
break;
case 43:
- Talk(WHISP12, player->GetGUID());
+ Talk(WHISP12, player);
break;
case 44:
- Talk(WHISP13, player->GetGUID());
+ Talk(WHISP13, player);
break;
case 49:
- Talk(WHISP14, player->GetGUID());
+ Talk(WHISP14, player);
break;
case 50:
- Talk(WHISP15, player->GetGUID());
+ Talk(WHISP15, player);
break;
case 51:
- Talk(WHISP16, player->GetGUID());
+ Talk(WHISP16, player);
break;
case 52:
- Talk(WHISP17, player->GetGUID());
+ Talk(WHISP17, player);
break;
case 53:
- Talk(WHISP18, player->GetGUID());
+ Talk(WHISP18, player);
break;
case 54:
- Talk(WHISP19, player->GetGUID());
+ Talk(WHISP19, player);
break;
case 55:
- Talk(WHISP20, player->GetGUID());
+ Talk(WHISP20, player);
break;
case 56:
- Talk(WHISP21, player->GetGUID());
+ Talk(WHISP21, player);
player->GroupEventHappens(10211, me);
break;
}
diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp
index ec7f5f976fd..3fb106e8cd8 100644
--- a/src/server/scripts/Outland/zone_terokkar_forest.cpp
+++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -373,7 +373,7 @@ public:
{
player->CLOSE_GOSSIP_MENU();
creature->setFaction(FACTION_HOSTILE_FL);
- creature->AI()->Talk(SAY_FLOON_ATTACK, player->GetGUID());
+ creature->AI()->Talk(SAY_FLOON_ATTACK, player);
creature->AI()->AttackStart(player);
}
return true;
@@ -482,16 +482,16 @@ public:
Cage->SetGoState(GO_STATE_ACTIVE);
break;
case 2:
- Talk(SAY_PROGRESS_1, player->GetGUID());
+ Talk(SAY_PROGRESS_1, player);
break;
case 5:
- Talk(SAY_PROGRESS_2, player->GetGUID());
+ Talk(SAY_PROGRESS_2, player);
break;
case 6:
- Talk(SAY_PROGRESS_3, player->GetGUID());
+ Talk(SAY_PROGRESS_3, player);
break;
case 29:
- Talk(SAY_PROGRESS_4, player->GetGUID());
+ Talk(SAY_PROGRESS_4, player);
if (player->GetTeam() == ALLIANCE)
player->GroupEventHappens(QUEST_EFTW_A, me);
else if (player->GetTeam() == HORDE)
diff --git a/src/server/scripts/Outland/zone_zangarmarsh.cpp b/src/server/scripts/Outland/zone_zangarmarsh.cpp
index 2497df76bb1..f8ef3d7c3bd 100644
--- a/src/server/scripts/Outland/zone_zangarmarsh.cpp
+++ b/src/server/scripts/Outland/zone_zangarmarsh.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -355,16 +355,16 @@ public:
switch (waypointId)
{
case 4:
- Talk(SAY_AMBUSH1, player->GetGUID());
+ Talk(SAY_AMBUSH1, player);
DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 5:
- Talk(SAY_PROGRESS, player->GetGUID());
+ Talk(SAY_PROGRESS, player);
SetRun();
break;
case 16:
- Talk(SAY_AMBUSH2, player->GetGUID());
+ Talk(SAY_AMBUSH2, player);
DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
@@ -372,7 +372,7 @@ public:
SetRun(false);
break;
case 25:
- Talk(SAY_END, player->GetGUID());
+ Talk(SAY_END, player);
player->GroupEventHappens(QUEST_ESCAPE_FROM, me);
break;
}
@@ -383,7 +383,7 @@ public:
{
if (quest->GetQuestId() == QUEST_ESCAPE_FROM)
{
- creature->AI()->Talk(SAY_START, player->GetGUID());
+ creature->AI()->Talk(SAY_START, player);
if (npc_escortAI* pEscortAI = CAST_AI(npc_kayra_longmane::npc_kayra_longmaneAI, creature->AI()))
pEscortAI->Start(false, false, player->GetGUID());
diff --git a/src/server/scripts/Pet/CMakeLists.txt b/src/server/scripts/Pet/CMakeLists.txt
index 87bbfd63c69..fce34098f41 100644
--- a/src/server/scripts/Pet/CMakeLists.txt
+++ b/src/server/scripts/Pet/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/scripts/Pet/pet_dk.cpp b/src/server/scripts/Pet/pet_dk.cpp
index 31a6af2fc1c..61c3de0e6b1 100644
--- a/src/server/scripts/Pet/pet_dk.cpp
+++ b/src/server/scripts/Pet/pet_dk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -47,13 +47,14 @@ class npc_pet_dk_ebon_gargoyle : public CreatureScript
void InitializeAI() OVERRIDE
{
+ // Not needed to be despawned now
+ _despawnTimer = 0;
+
CasterAI::InitializeAI();
uint64 ownerGuid = me->GetOwnerGUID();
if (!ownerGuid)
return;
- // Not needed to be despawned now
- _despawnTimer = 0;
// Find victim of Summon Gargoyle spell
std::list<Unit*> targets;
Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(me, me, 30.0f);
diff --git a/src/server/scripts/Pet/pet_generic.cpp b/src/server/scripts/Pet/pet_generic.cpp
index f10a14716c6..2a41b293967 100644
--- a/src/server/scripts/Pet/pet_generic.cpp
+++ b/src/server/scripts/Pet/pet_generic.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -62,7 +62,7 @@ class npc_pet_gen_mojo : public CreatureScript
return;
}
- Talk(SAY_MOJO, player->GetGUID());
+ Talk(SAY_MOJO, player);
if (_victimGUID)
if (Player* victim = ObjectAccessor::GetPlayer(*me, _victimGUID))
diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp
index 80551be9131..8a0b78b5478 100644
--- a/src/server/scripts/Pet/pet_hunter.cpp
+++ b/src/server/scripts/Pet/pet_hunter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -25,9 +25,9 @@
enum HunterSpells
{
- SPELL_HUNTER_CRIPPLING_POISON = 30981, // Viper
- SPELL_HUNTER_DEADLY_POISON = 34655, // Venomous Snake
- SPELL_HUNTER_MIND_NUMBING_POISON = 25810 // Viper
+ SPELL_HUNTER_CRIPPLING_POISON = 30981, // Viper
+ SPELL_HUNTER_DEADLY_POISON_PASSIVE = 34657, // Venomous Snake
+ SPELL_HUNTER_MIND_NUMBING_POISON = 25810 // Viper
};
enum HunterCreatures
@@ -57,14 +57,17 @@ class npc_pet_hunter_snake_trap : public CreatureScript
me->SetMaxHealth(uint32(107 * (me->getLevel() - 40) * 0.025f));
// Add delta to make them not all hit the same time
uint32 delta = (rand() % 7) * 100;
- me->SetStatFloatValue(UNIT_FIELD_BASEATTACKTIME, float(Info->baseattacktime + delta));
- me->SetStatFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER, float(Info->attackpower));
+ me->SetAttackTime(BASE_ATTACK, Info->baseattacktime + delta);
+ //me->SetStatFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER, float(Info->attackpower));
// Start attacking attacker of owner on first ai update after spawn - move in line of sight may choose better target
if (!me->GetVictim() && me->IsSummon())
if (Unit* Owner = me->ToTempSummon()->GetSummoner())
if (Owner->getAttackerForHelper())
AttackStart(Owner->getAttackerForHelper());
+
+ if (!_isViper)
+ DoCast(me, SPELL_HUNTER_DEADLY_POISON_PASSIVE, true);
}
// Redefined for random target selection:
@@ -99,32 +102,19 @@ class npc_pet_hunter_snake_trap : public CreatureScript
return;
}
- if (_spellTimer <= diff)
+ // Viper
+ if (_isViper)
{
- if (_isViper) // Viper
+ if (_spellTimer <= diff)
{
- if (urand(0, 2) == 0) //33% chance to cast
- {
- uint32 spell;
- if (urand(0, 1) == 0)
- spell = SPELL_HUNTER_MIND_NUMBING_POISON;
- else
- spell = SPELL_HUNTER_CRIPPLING_POISON;
-
- DoCastVictim(spell);
- }
+ if (urand(0, 2) == 0) // 33% chance to cast
+ DoCastVictim(RAND(SPELL_HUNTER_MIND_NUMBING_POISON, SPELL_HUNTER_CRIPPLING_POISON));
_spellTimer = 3000;
}
- else // Venomous Snake
- {
- if (urand(0, 2) == 0) // 33% chance to cast
- DoCastVictim(SPELL_HUNTER_DEADLY_POISON);
- _spellTimer = 1500 + (rand() % 5) * 100;
- }
+ else
+ _spellTimer -= diff;
}
- else
- _spellTimer -= diff;
DoMeleeAttackIfReady();
}
diff --git a/src/server/scripts/Pet/pet_mage.cpp b/src/server/scripts/Pet/pet_mage.cpp
index 85247b29f84..69e924c0d43 100644
--- a/src/server/scripts/Pet/pet_mage.cpp
+++ b/src/server/scripts/Pet/pet_mage.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -49,7 +49,7 @@ class npc_pet_mage_mirror_image : public CreatureScript
// Inherit Master's Threat List (not yet implemented)
owner->CastSpell((Unit*)NULL, SPELL_MAGE_MASTERS_THREAT_LIST, true);
// here mirror image casts on summoner spell (not present in client dbc) 49866
- // here should be auras (not present in client dbc): 35657, 35658, 35659, 35660 selfcasted by mirror images (stats related?)
+ // here should be auras (not present in client dbc): 35657, 35658, 35659, 35660 selfcast by mirror images (stats related?)
// Clone Me!
owner->CastSpell(me, SPELL_MAGE_CLONE_ME, false);
}
diff --git a/src/server/scripts/Pet/pet_priest.cpp b/src/server/scripts/Pet/pet_priest.cpp
index 4b565aaec10..fc106a2a786 100644
--- a/src/server/scripts/Pet/pet_priest.cpp
+++ b/src/server/scripts/Pet/pet_priest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Pet/pet_shaman.cpp b/src/server/scripts/Pet/pet_shaman.cpp
index 989d6f46327..03e6c55b109 100644
--- a/src/server/scripts/Pet/pet_shaman.cpp
+++ b/src/server/scripts/Pet/pet_shaman.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Spells/CMakeLists.txt b/src/server/scripts/Spells/CMakeLists.txt
index 077b4ccab5e..4e1d41b7261 100644
--- a/src/server/scripts/Spells/CMakeLists.txt
+++ b/src/server/scripts/Spells/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index e78d690d3c0..e1ef9ea6862 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -879,7 +879,7 @@ class spell_dk_presence : public SpellScriptLoader
{
Unit* target = GetTarget();
- if (GetSpellInfo()->Id == SPELL_DK_BLOOD_PRESENCE)
+ if (GetId() == SPELL_DK_BLOOD_PRESENCE)
target->CastSpell(target, SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED, true);
else if (AuraEffect const* impAurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1, EFFECT_0))
if (!target->HasAura(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED))
@@ -890,7 +890,7 @@ class spell_dk_presence : public SpellScriptLoader
{
Unit* target = GetTarget();
- if (GetSpellInfo()->Id == SPELL_DK_FROST_PRESENCE)
+ if (GetId() == SPELL_DK_FROST_PRESENCE)
target->CastSpell(target, SPELL_DK_FROST_PRESENCE_TRIGGERED, true);
else if (AuraEffect const* impAurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_FROST_PRESENCE_R1, EFFECT_0))
if (!target->HasAura(SPELL_DK_FROST_PRESENCE_TRIGGERED))
@@ -901,12 +901,12 @@ class spell_dk_presence : public SpellScriptLoader
{
Unit* target = GetTarget();
- if (GetSpellInfo()->Id == SPELL_DK_UNHOLY_PRESENCE)
+ if (GetId() == SPELL_DK_UNHOLY_PRESENCE)
target->CastSpell(target, SPELL_DK_UNHOLY_PRESENCE_TRIGGERED, true);
if (AuraEffect const* impAurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1, EFFECT_0))
{
- if (GetSpellInfo()->Id == SPELL_DK_UNHOLY_PRESENCE)
+ if (GetId() == SPELL_DK_UNHOLY_PRESENCE)
{
// Not listed as any effect, only base points set
int32 bp = impAurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue();
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 61966ef8a8e..9fd43807fd5 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 98ed2c8b331..3feb9821177 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -475,20 +475,20 @@ class spell_gen_bonked : public SpellScriptLoader
+ EFFECT_0: SCRIPT_EFFECT
+ EFFECT_1: NONE
+ EFFECT_2: NONE
- - Spells casted by players triggered by script:
+ - Spells cast by players triggered by script:
+ EFFECT_0: SCHOOL_DAMAGE
+ EFFECT_1: SCRIPT_EFFECT
+ EFFECT_2: FORCE_CAST
- - Spells casted by NPCs on players:
+ - Spells cast by NPCs on players:
+ EFFECT_0: SCHOOL_DAMAGE
+ EFFECT_1: SCRIPT_EFFECT
+ EFFECT_2: NONE
In the following script we handle the SCRIPT_EFFECT for effIndex EFFECT_0 and EFFECT_1.
- When handling EFFECT_0 we're in the "Spells on vehicle bar used by players" case
- and we'll trigger "Spells casted by players triggered by script"
- - When handling EFFECT_1 we're in the "Spells casted by players triggered by script"
- or "Spells casted by NPCs on players" so we'll search for the first defend layer and drop it.
+ and we'll trigger "Spells cast by players triggered by script"
+ - When handling EFFECT_1 we're in the "Spells cast by players triggered by script"
+ or "Spells cast by NPCs on players" so we'll search for the first defend layer and drop it.
*/
enum BreakShieldSpells
@@ -1193,7 +1193,7 @@ class spell_gen_defend : public SpellScriptLoader
{
SpellInfo const* spell = sSpellMgr->GetSpellInfo(m_scriptSpellId);
- // Defend spells casted by NPCs (add visuals)
+ // Defend spells cast by NPCs (add visuals)
if (spell->Effects[EFFECT_0].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)
{
AfterEffectApply += AuraEffectApplyFn(spell_gen_defend_AuraScript::RefreshVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
@@ -1204,7 +1204,7 @@ class spell_gen_defend : public SpellScriptLoader
if (spell->Effects[EFFECT_2].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)
OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend_AuraScript::RemoveDummyFromDriver, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL);
- // Defend spells casted by players (add/remove visuals)
+ // Defend spells cast by players (add/remove visuals)
if (spell->Effects[EFFECT_1].ApplyAuraName == SPELL_AURA_DUMMY)
{
AfterEffectApply += AuraEffectApplyFn(spell_gen_defend_AuraScript::RefreshVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
@@ -2039,15 +2039,15 @@ class spell_gen_mount : public SpellScriptLoader
+ EFFECT_0: SCRIPT_EFFECT
+ EFFECT_1: TRIGGER_SPELL
+ EFFECT_2: NONE
- - Spells casted by player's mounts triggered by script:
+ - Spells cast by player's mounts triggered by script:
+ EFFECT_0: CHARGE
+ EFFECT_1: TRIGGER_SPELL
+ EFFECT_2: APPLY_AURA
- - Spells casted by players on the target triggered by script:
+ - Spells cast by players on the target triggered by script:
+ EFFECT_0: SCHOOL_DAMAGE
+ EFFECT_1: SCRIPT_EFFECT
+ EFFECT_2: NONE
- - Spells casted by NPCs on players:
+ - Spells cast by NPCs on players:
+ EFFECT_0: SCHOOL_DAMAGE
+ EFFECT_1: CHARGE
+ EFFECT_2: SCRIPT_EFFECT
@@ -2055,12 +2055,12 @@ class spell_gen_mount : public SpellScriptLoader
In the following script we handle the SCRIPT_EFFECT and CHARGE
- When handling SCRIPT_EFFECT:
+ EFFECT_0: Corresponds to "Spells on vehicle bar used by players" and we make player's mount cast
- the charge effect on the current target ("Spells casted by player's mounts triggered by script").
- + EFFECT_1 and EFFECT_2: Triggered when "Spells casted by player's mounts triggered by script" hits target,
- corresponding to "Spells casted by players on the target triggered by script" and "Spells casted by
+ the charge effect on the current target ("Spells cast by player's mounts triggered by script").
+ + EFFECT_1 and EFFECT_2: Triggered when "Spells cast by player's mounts triggered by script" hits target,
+ corresponding to "Spells cast by players on the target triggered by script" and "Spells cast by
NPCs on players" and we check Defend layers and drop a charge of the first found.
- When handling CHARGE:
- + Only launched for "Spells casted by player's mounts triggered by script", makes the player cast the
+ + Only launched for "Spells cast by player's mounts triggered by script", makes the player cast the
damaging spell on target with a small chance of failing it.
*/
diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp
index 73db091eee1..bb84606dece 100644
--- a/src/server/scripts/Spells/spell_holiday.cpp
+++ b/src/server/scripts/Spells/spell_holiday.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index b93efe3b0f2..2f8a5daae84 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 630485b0b88..8b3716f8f7d 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp
index 680c2e35b35..ba59f701445 100644
--- a/src/server/scripts/Spells/spell_mage.cpp
+++ b/src/server/scripts/Spells/spell_mage.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 18d3e07d43b..0b790f01d29 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp
index b3feac0f081..3d6853daf2c 100644
--- a/src/server/scripts/Spells/spell_pet.cpp
+++ b/src/server/scripts/Spells/spell_pet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index 0d3da30377a..4a702c7559c 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index 3d84d9bbca9..4dd06b762a1 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -1137,9 +1137,9 @@ public:
// player must cast kill credit and do emote text, according to sniff
if (Player* target = GetTarget()->ToPlayer())
{
- target->MonsterWhisper(SAY_1, target->GetGUID(), true);
+ target->MonsterWhisper(SAY_1, target, true);
target->KilledMonsterCredit(NPC_KILLCREDIT, 0);
- target->MonsterWhisper(SAY_2, target->GetGUID(), true);
+ target->MonsterWhisper(SAY_2, target, true);
}
}
@@ -1367,7 +1367,7 @@ class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScriptLoad
}
};
-// ID - 50287 Azure Dragon: On Death Force Cast Wyrmrest Defender to Whisper to Controller - Random (casted from Azure Dragons and Azure Drakes on death)
+// ID - 50287 Azure Dragon: On Death Force Cast Wyrmrest Defender to Whisper to Controller - Random (cast from Azure Dragons and Azure Drakes on death)
class spell_q12372_azure_on_death_force_whisper : public SpellScriptLoader
{
public:
@@ -1380,7 +1380,7 @@ class spell_q12372_azure_on_death_force_whisper : public SpellScriptLoader
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Creature* defender = GetHitCreature())
- defender->AI()->Talk(WHISPER_ON_HIT_BY_FORCE_WHISPER, defender->GetCharmerOrOwnerGUID());
+ defender->AI()->Talk(WHISPER_ON_HIT_BY_FORCE_WHISPER, defender->GetCharmerOrOwner());
}
void Register() OVERRIDE
@@ -1823,7 +1823,7 @@ class spell_q13011_bear_flank_master : public SpellScriptLoader
if (failed)
{
player->CastSpell(creature, SPELL_BEAR_FLANK_FAIL);
- creature->AI()->Talk(0, player->GetGUID());
+ creature->AI()->Talk(0, player);
}
else
player->CastSpell(player, SPELL_CREATE_BEAR_FLANK);
@@ -2241,6 +2241,47 @@ class spell_q12919_gymers_throw : public SpellScriptLoader
}
};
+enum Quest_The_Hunter_And_The_Prince
+{
+ SPELL_ILLIDAN_KILL_CREDIT = 61748
+};
+
+class spell_q13400_illidan_kill_master : public SpellScriptLoader
+{
+ public:
+ spell_q13400_illidan_kill_master() : SpellScriptLoader("spell_q13400_illidan_kill_master") { }
+
+ class spell_q13400_illidan_kill_master_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q13400_illidan_kill_master_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_ILLIDAN_KILL_CREDIT))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ if (caster->IsVehicle())
+ if (Unit* passenger = caster->GetVehicleKit()->GetPassenger(0))
+ passenger->CastSpell(passenger, SPELL_ILLIDAN_KILL_CREDIT, true);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q13400_illidan_kill_master_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_q13400_illidan_kill_master_SpellScript();
+ }
+};
+
void AddSC_quest_spell_scripts()
{
new spell_q55_sacred_cleansing();
@@ -2295,4 +2336,5 @@ void AddSC_quest_spell_scripts()
new spell_q12619_emblazon_runeblade_effect();
new spell_q12919_gymers_grab();
new spell_q12919_gymers_throw();
+ new spell_q13400_illidan_kill_master();
}
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index 6e88fb76c7e..4670117f0ea 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index eb717315179..c8fa5b3f1fe 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index 45518fcfef1..36e63b5a94e 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index d022eef65b9..cafe510cc4f 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/World/CMakeLists.txt b/src/server/scripts/World/CMakeLists.txt
index c8fd16dca36..7d1b46732cf 100644
--- a/src/server/scripts/World/CMakeLists.txt
+++ b/src/server/scripts/World/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/scripts/World/achievement_scripts.cpp b/src/server/scripts/World/achievement_scripts.cpp
index 40af44911ed..8ddfb0e9335 100644
--- a/src/server/scripts/World/achievement_scripts.cpp
+++ b/src/server/scripts/World/achievement_scripts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp
index 2f8d5fa2ce4..d95c4f878fa 100644
--- a/src/server/scripts/World/areatrigger_scripts.cpp
+++ b/src/server/scripts/World/areatrigger_scripts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -342,11 +342,11 @@ class AreaTrigger_at_brewfest : public AreaTriggerScript
{
case AT_BREWFEST_DUROTAR:
if (Creature* tapper = player->FindNearestCreature(NPC_TAPPER_SWINDLEKEG, 20.0f))
- tapper->AI()->Talk(SAY_WELCOME, player->GetGUID());
+ tapper->AI()->Talk(SAY_WELCOME, player);
break;
case AT_BREWFEST_DUN_MOROGH:
if (Creature* ipfelkofer = player->FindNearestCreature(NPC_IPFELKOFER_IRONKEG, 20.0f))
- ipfelkofer->AI()->Talk(SAY_WELCOME, player->GetGUID());
+ ipfelkofer->AI()->Talk(SAY_WELCOME, player);
break;
default:
break;
diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp
index ca0083a1268..c74405628b5 100644
--- a/src/server/scripts/World/boss_emerald_dragons.cpp
+++ b/src/server/scripts/World/boss_emerald_dragons.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/World/chat_log.cpp b/src/server/scripts/World/chat_log.cpp
index 11fbeeca852..ef854246d20 100644
--- a/src/server/scripts/World/chat_log.cpp
+++ b/src/server/scripts/World/chat_log.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp
index 3a0c5b0dfd2..ddb4cc4c8d1 100644
--- a/src/server/scripts/World/go_scripts.cpp
+++ b/src/server/scripts/World/go_scripts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp
index 95f97b1dc84..676eb7bd64f 100644
--- a/src/server/scripts/World/guards.cpp
+++ b/src/server/scripts/World/guards.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -65,7 +65,7 @@ public:
void EnterCombat(Unit* who) OVERRIDE
{
if (me->GetEntry() == NPC_CENARION_HOLD_INFANTRY)
- Talk(SAY_GUARD_SIL_AGGRO, who->GetGUID());
+ Talk(SAY_GUARD_SIL_AGGRO, who);
if (SpellInfo const* spell = me->reachWithSpellAttack(who))
DoCast(who, spell->Id);
}
@@ -106,7 +106,7 @@ public:
return;
// Make sure our attack is ready and we arn't currently casting
- if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
+ if (me->isAttackReady() && !me->IsNonMeleeSpellCast(false))
{
//If we are within range melee the target
if (me->IsWithinMeleeRange(me->GetVictim()))
@@ -145,7 +145,7 @@ public:
else
{
//Only run this code if we arn't already casting
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
bool healing = false;
SpellInfo const* info = NULL;
diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp
index 5b8e780e3d3..545ee9f4b43 100644
--- a/src/server/scripts/World/item_scripts.cpp
+++ b/src/server/scripts/World/item_scripts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp
index ed086712ca2..19ea4f9b60b 100644
--- a/src/server/scripts/World/mob_generic_creature.cpp
+++ b/src/server/scripts/World/mob_generic_creature.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -93,7 +93,7 @@ public:
if (me->IsWithinMeleeRange(me->GetVictim()))
{
//Make sure our attack is ready and we arn't currently casting
- if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
+ if (me->isAttackReady() && !me->IsNonMeleeSpellCast(false))
{
bool Healing = false;
SpellInfo const* info = NULL;
@@ -124,7 +124,7 @@ public:
else
{
//Only run this code if we arn't already casting
- if (!me->IsNonMeleeSpellCasted(false))
+ if (!me->IsNonMeleeSpellCast(false))
{
bool Healing = false;
SpellInfo const* info = NULL;
diff --git a/src/server/scripts/World/npc_innkeeper.cpp b/src/server/scripts/World/npc_innkeeper.cpp
index 9c92dd0d27e..7a766fb9eb1 100644
--- a/src/server/scripts/World/npc_innkeeper.cpp
+++ b/src/server/scripts/World/npc_innkeeper.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp
index 8d0f917eb2f..5cbc54923e0 100644
--- a/src/server/scripts/World/npc_professions.cpp
+++ b/src/server/scripts/World/npc_professions.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/World/npc_taxi.cpp b/src/server/scripts/World/npc_taxi.cpp
index bf742d606f2..730523c85f4 100644
--- a/src/server/scripts/World/npc_taxi.cpp
+++ b/src/server/scripts/World/npc_taxi.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -54,8 +54,6 @@ EndScriptData
#define GOSSIP_TORASTRASZA1 "I would like to see Lord Of Afrasastrasz, in the middle of the temple."
#define GOSSIP_TORASTRASZA2 "Yes, Please. I would like to return to the ground floor of the temple."
#define GOSSIP_CRIMSONWING "<Ride the gryphons to Survey Alcaz Island>"
-#define GOSSIP_THRICESTAR1 "Do you think I could take a ride on one of those flying machines?"
-#define GOSSIP_THRICESTAR2 "Kara, I need to be flown out the Dens of Dying to find Bixie."
#define GOSSIP_WILLIAMKEILAR1 "Take me to Northpass Tower."
#define GOSSIP_WILLIAMKEILAR2 "Take me to Eastwall Tower."
#define GOSSIP_WILLIAMKEILAR3 "Take me to Crown Guard Tower."
@@ -163,13 +161,6 @@ public:
if (player->GetQuestStatus(11142) == QUEST_STATUS_INCOMPLETE)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CRIMSONWING, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+25);
break;
- case 26602:
- if (creature->IsTaxi())
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TAXI, GOSSIP_THRICESTAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 26);
-
- if (player->GetQuestStatus(11692) == QUEST_STATUS_COMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_THRICESTAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 27);
- break;
case 17209:
player->SetTaxiCheater(true);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WILLIAMKEILAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 28);
@@ -299,21 +290,14 @@ public:
player->CastSpell(player, 42295, true);
break;
case GOSSIP_ACTION_INFO_DEF + 26:
- player->GetSession()->SendTaxiMenu(creature);
- break;
- case GOSSIP_ACTION_INFO_DEF + 27:
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, 51446, false);
- break;
- case GOSSIP_ACTION_INFO_DEF + 28:
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(494);
break;
- case GOSSIP_ACTION_INFO_DEF + 29:
+ case GOSSIP_ACTION_INFO_DEF + 27:
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(495);
break;
- case GOSSIP_ACTION_INFO_DEF + 30:
+ case GOSSIP_ACTION_INFO_DEF + 28:
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(496);
break;
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index d7d18d5d36a..ac30f6f1e80 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -34,7 +34,6 @@ npc_garments_of_quests 80% NPC's related to all Garments of-quests 5621, 56
npc_injured_patient 100% patients for triage-quests (6622 and 6624)
npc_doctor 100% Gustaf Vanhowzen and Gregory Victor, quest 6622 and 6624 (Triage)
npc_mount_vendor 100% Regular mount vendors all over the world. Display gossip if player doesn't meet the requirements to buy
-npc_rogue_trainer 80% Scripted trainers, so they are able to offer item 17126 for class quest 6681
npc_sayge 100% Darkmoon event fortune teller, buff player based on answers given
npc_snake_trap_serpents 80% AI for snakes that summoned by Snake Trap
npc_shadowfiend 100% restore 5% of owner's mana when shadowfiend die from damage
@@ -965,14 +964,14 @@ public:
{
if (IsHealed && !CanRun && spell->Id == SPELL_FORTITUDE_R1)
{
- Talk(SAY_THANKS, caster->GetGUID());
+ Talk(SAY_THANKS, caster);
CanRun = true;
}
else if (!IsHealed && spell->Id == SPELL_LESSER_HEAL_R2)
{
CasterGUID = caster->GetGUID();
me->SetStandState(UNIT_STAND_STATE_STAND);
- Talk(SAY_HEALED, caster->GetGUID());
+ Talk(SAY_HEALED, caster);
IsHealed = true;
}
}
@@ -982,14 +981,14 @@ public:
{
if (IsHealed && !CanRun && spell->Id == SPELL_FORTITUDE_R1)
{
- Talk(SAY_THANKS, caster->GetGUID());
+ Talk(SAY_THANKS, caster);
CanRun = true;
}
else if (!IsHealed && spell->Id == SPELL_LESSER_HEAL_R2)
{
CasterGUID = caster->GetGUID();
me->SetStandState(UNIT_STAND_STATE_STAND);
- Talk(SAY_HEALED, caster->GetGUID());
+ Talk(SAY_HEALED, caster);
IsHealed = true;
}
}
@@ -999,14 +998,14 @@ public:
{
if (IsHealed && !CanRun && spell->Id == SPELL_FORTITUDE_R1)
{
- Talk(SAY_THANKS, caster->GetGUID());
+ Talk(SAY_THANKS, caster);
CanRun = true;
}
else if (!IsHealed && spell->Id == SPELL_LESSER_HEAL_R2)
{
CasterGUID = caster->GetGUID();
me->SetStandState(UNIT_STAND_STATE_STAND);
- Talk(SAY_HEALED, caster->GetGUID());
+ Talk(SAY_HEALED, caster);
IsHealed = true;
}
}
@@ -1016,14 +1015,14 @@ public:
{
if (IsHealed && !CanRun && spell->Id == SPELL_FORTITUDE_R1)
{
- Talk(SAY_THANKS, caster->GetGUID());
+ Talk(SAY_THANKS, caster);
CanRun = true;
}
else if (!IsHealed && spell->Id == SPELL_LESSER_HEAL_R2)
{
CasterGUID = caster->GetGUID();
me->SetStandState(UNIT_STAND_STATE_STAND);
- Talk(SAY_HEALED, caster->GetGUID());
+ Talk(SAY_HEALED, caster);
IsHealed = true;
}
}
@@ -1033,14 +1032,14 @@ public:
{
if (IsHealed && !CanRun && spell->Id == SPELL_FORTITUDE_R1)
{
- Talk(SAY_THANKS, caster->GetGUID());
+ Talk(SAY_THANKS, caster);
CanRun = true;
}
else if (!IsHealed && spell->Id == SPELL_LESSER_HEAL_R2)
{
CasterGUID = caster->GetGUID();
me->SetStandState(UNIT_STAND_STATE_STAND);
- Talk(SAY_HEALED, caster->GetGUID());
+ Talk(SAY_HEALED, caster);
IsHealed = true;
}
}
@@ -1070,19 +1069,11 @@ public:
switch (me->GetEntry())
{
case ENTRY_SHAYA:
- Talk(SAY_GOODBYE, unit->GetGUID());
- break;
case ENTRY_ROBERTS:
- Talk(SAY_GOODBYE, unit->GetGUID());
- break;
case ENTRY_DOLF:
- Talk(SAY_GOODBYE, unit->GetGUID());
- break;
case ENTRY_KORJA:
- Talk(SAY_GOODBYE, unit->GetGUID());
- break;
case ENTRY_DG_KEL:
- Talk(SAY_GOODBYE, unit->GetGUID());
+ Talk(SAY_GOODBYE, unit);
break;
}
@@ -1247,86 +1238,6 @@ public:
}
};
-/*######
-## npc_rogue_trainer
-######*/
-
-#define GOSSIP_HELLO_ROGUE1 "I wish to unlearn my talents"
-#define GOSSIP_HELLO_ROGUE2 "<Take the letter>"
-#define GOSSIP_HELLO_ROGUE3 "Purchase a Dual Talent Specialization."
-
-class npc_rogue_trainer : public CreatureScript
-{
-public:
- npc_rogue_trainer() : CreatureScript("npc_rogue_trainer") { }
-
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (creature->IsTrainer())
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
-
- if (player->getClass() == CLASS_ROGUE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_HELLO_ROGUE1, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_UNLEARNTALENTS);
-
- if (player->GetSpecsCount() == 1 && player->getLevel() >= sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_HELLO_ROGUE3, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_LEARNDUALSPEC);
-
- if (player->getClass() == CLASS_ROGUE && player->getLevel() >= 24 && !player->HasItemCount(17126) && !player->GetQuestRewardStatus(6681))
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_ROGUE2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(5996, creature->GetGUID());
- } else
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, 21100, false);
- break;
- case GOSSIP_ACTION_TRAIN:
- player->GetSession()->SendTrainerList(creature->GetGUID());
- break;
- case GOSSIP_OPTION_UNLEARNTALENTS:
- player->CLOSE_GOSSIP_MENU();
- player->SendTalentWipeConfirm(creature->GetGUID());
- break;
- case GOSSIP_OPTION_LEARNDUALSPEC:
- if (player->GetSpecsCount() == 1 && !(player->getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL)))
- {
- if (!player->HasEnoughMoney(10000000))
- {
- player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0);
- player->PlayerTalkClass->SendCloseGossip();
- break;
- }
- else
- {
- player->ModifyMoney(-10000000);
-
- // Cast spells that teach dual spec
- // Both are also ImplicitTarget self and must be cast by player
- player->CastSpell(player, 63680, true, NULL, NULL, player->GetGUID());
- player->CastSpell(player, 63624, true, NULL, NULL, player->GetGUID());
-
- // Should show another Gossip text with "Congratulations..."
- player->PlayerTalkClass->SendCloseGossip();
- }
- }
- break;
- }
- return true;
- }
-};
/*######
## npc_sayge
@@ -2453,7 +2364,6 @@ void AddSC_npcs_special()
new npc_garments_of_quests();
new npc_guardian();
new npc_mount_vendor();
- new npc_rogue_trainer();
new npc_sayge();
new npc_steam_tonk();
new npc_tonk_mine();
diff --git a/src/server/shared/AutoPtr.h b/src/server/shared/AutoPtr.h
index 621e0007f64..96ecbfc79fe 100644
--- a/src/server/shared/AutoPtr.h
+++ b/src/server/shared/AutoPtr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/CMakeLists.txt b/src/server/shared/CMakeLists.txt
index 4fc318f57eb..af113801067 100644
--- a/src/server/shared/CMakeLists.txt
+++ b/src/server/shared/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/shared/Common.cpp b/src/server/shared/Common.cpp
index 28f987cf0b7..e45813b9d50 100644
--- a/src/server/shared/Common.cpp
+++ b/src/server/shared/Common.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Common.h b/src/server/shared/Common.h
index e3074ef45b9..5dea589da25 100644
--- a/src/server/shared/Common.h
+++ b/src/server/shared/Common.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/CompilerDefs.h b/src/server/shared/CompilerDefs.h
index 909dcd1707b..71b20a4d175 100644
--- a/src/server/shared/CompilerDefs.h
+++ b/src/server/shared/CompilerDefs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Configuration/Config.cpp b/src/server/shared/Configuration/Config.cpp
index 055c33b40ee..3f8997e6d55 100644
--- a/src/server/shared/Configuration/Config.cpp
+++ b/src/server/shared/Configuration/Config.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Configuration/Config.h b/src/server/shared/Configuration/Config.h
index 49f5c5e07fb..4693b21a0c7 100644
--- a/src/server/shared/Configuration/Config.h
+++ b/src/server/shared/Configuration/Config.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Containers.h b/src/server/shared/Containers.h
index b33954d7ea4..d6ba98e4ed4 100644
--- a/src/server/shared/Containers.h
+++ b/src/server/shared/Containers.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Cryptography/ARC4.cpp b/src/server/shared/Cryptography/ARC4.cpp
index 6395ff99bfa..90f38d98d51 100644
--- a/src/server/shared/Cryptography/ARC4.cpp
+++ b/src/server/shared/Cryptography/ARC4.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/ARC4.h b/src/server/shared/Cryptography/ARC4.h
index 0804971f696..5304b0730a6 100644
--- a/src/server/shared/Cryptography/ARC4.h
+++ b/src/server/shared/Cryptography/ARC4.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp b/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp
index 003c09e4589..ff94f307254 100644
--- a/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp
+++ b/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/Authentication/AuthCrypt.h b/src/server/shared/Cryptography/Authentication/AuthCrypt.h
index 95e773b586e..8fa150068a2 100644
--- a/src/server/shared/Cryptography/Authentication/AuthCrypt.h
+++ b/src/server/shared/Cryptography/Authentication/AuthCrypt.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/BigNumber.cpp b/src/server/shared/Cryptography/BigNumber.cpp
index bfe92cd6051..1f3fc96e28d 100644
--- a/src/server/shared/Cryptography/BigNumber.cpp
+++ b/src/server/shared/Cryptography/BigNumber.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/BigNumber.h b/src/server/shared/Cryptography/BigNumber.h
index 6129a24d1bc..dc553babec9 100644
--- a/src/server/shared/Cryptography/BigNumber.h
+++ b/src/server/shared/Cryptography/BigNumber.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/HMACSHA1.cpp b/src/server/shared/Cryptography/HMACSHA1.cpp
index 2585fa64ea1..2148a3b8a7b 100644
--- a/src/server/shared/Cryptography/HMACSHA1.cpp
+++ b/src/server/shared/Cryptography/HMACSHA1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/HMACSHA1.h b/src/server/shared/Cryptography/HMACSHA1.h
index 04b8f7d0277..de1556d3c98 100644
--- a/src/server/shared/Cryptography/HMACSHA1.h
+++ b/src/server/shared/Cryptography/HMACSHA1.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/OpenSSLCrypto.cpp b/src/server/shared/Cryptography/OpenSSLCrypto.cpp
index 417be813347..10ea595640a 100644
--- a/src/server/shared/Cryptography/OpenSSLCrypto.cpp
+++ b/src/server/shared/Cryptography/OpenSSLCrypto.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Cryptography/OpenSSLCrypto.h b/src/server/shared/Cryptography/OpenSSLCrypto.h
index 70071007c5f..26bd1357d39 100644
--- a/src/server/shared/Cryptography/OpenSSLCrypto.h
+++ b/src/server/shared/Cryptography/OpenSSLCrypto.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Cryptography/SHA1.cpp b/src/server/shared/Cryptography/SHA1.cpp
index 1f65c88a6f3..c89469bafb5 100644
--- a/src/server/shared/Cryptography/SHA1.cpp
+++ b/src/server/shared/Cryptography/SHA1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/SHA1.h b/src/server/shared/Cryptography/SHA1.h
index a4232f4e75f..2738d48931e 100644
--- a/src/server/shared/Cryptography/SHA1.h
+++ b/src/server/shared/Cryptography/SHA1.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Cryptography/WardenKeyGeneration.h b/src/server/shared/Cryptography/WardenKeyGeneration.h
index 6d5fd563ba3..11bc00d641a 100644
--- a/src/server/shared/Cryptography/WardenKeyGeneration.h
+++ b/src/server/shared/Cryptography/WardenKeyGeneration.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/DataStores/DBCFileLoader.cpp b/src/server/shared/DataStores/DBCFileLoader.cpp
index 3c02d5f533d..d027d7539ad 100644
--- a/src/server/shared/DataStores/DBCFileLoader.cpp
+++ b/src/server/shared/DataStores/DBCFileLoader.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/DataStores/DBCFileLoader.h b/src/server/shared/DataStores/DBCFileLoader.h
index 1f8768e5da4..c5194d20530 100644
--- a/src/server/shared/DataStores/DBCFileLoader.h
+++ b/src/server/shared/DataStores/DBCFileLoader.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/DataStores/DBCStore.h b/src/server/shared/DataStores/DBCStore.h
index ad13b2a02af..78f7bb28580 100644
--- a/src/server/shared/DataStores/DBCStore.h
+++ b/src/server/shared/DataStores/DBCStore.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Database/AdhocStatement.cpp b/src/server/shared/Database/AdhocStatement.cpp
index 23175cd2273..15732f20849 100644
--- a/src/server/shared/Database/AdhocStatement.cpp
+++ b/src/server/shared/Database/AdhocStatement.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/AdhocStatement.h b/src/server/shared/Database/AdhocStatement.h
index 7b41b43725c..44a9fa3d3ee 100644
--- a/src/server/shared/Database/AdhocStatement.h
+++ b/src/server/shared/Database/AdhocStatement.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/DatabaseEnv.h b/src/server/shared/Database/DatabaseEnv.h
index f45a468f617..d58fa81d608 100644
--- a/src/server/shared/Database/DatabaseEnv.h
+++ b/src/server/shared/Database/DatabaseEnv.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Database/DatabaseWorker.cpp b/src/server/shared/Database/DatabaseWorker.cpp
index 1333ba14632..3581f8e0211 100644
--- a/src/server/shared/Database/DatabaseWorker.cpp
+++ b/src/server/shared/Database/DatabaseWorker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/DatabaseWorker.h b/src/server/shared/Database/DatabaseWorker.h
index 179806d29cb..14e92924ed2 100644
--- a/src/server/shared/Database/DatabaseWorker.h
+++ b/src/server/shared/Database/DatabaseWorker.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h
index 33075accc04..6c2e961d2ad 100644
--- a/src/server/shared/Database/DatabaseWorkerPool.h
+++ b/src/server/shared/Database/DatabaseWorkerPool.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/Field.cpp b/src/server/shared/Database/Field.cpp
index 51d918e716e..866a96b58b6 100644
--- a/src/server/shared/Database/Field.cpp
+++ b/src/server/shared/Database/Field.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -35,7 +35,7 @@ void Field::SetByteValue(const void* newValue, const size_t newSize, enum_field_
if (data.value)
CleanUp();
- // This value stores raw bytes that have to be explicitly casted later
+ // This value stores raw bytes that have to be explicitly cast later
if (newValue)
{
data.value = new char[newSize];
diff --git a/src/server/shared/Database/Field.h b/src/server/shared/Database/Field.h
index 5460f5cc4f6..5f427a5871b 100644
--- a/src/server/shared/Database/Field.h
+++ b/src/server/shared/Database/Field.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp
index da99d6c3537..aa7c2e96fba 100644
--- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp
+++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h
index aa47fb53097..6768e4a197f 100644
--- a/src/server/shared/Database/Implementation/CharacterDatabase.h
+++ b/src/server/shared/Database/Implementation/CharacterDatabase.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp
index f6754629e38..de1e5b992e6 100644
--- a/src/server/shared/Database/Implementation/LoginDatabase.cpp
+++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
@@ -24,7 +24,7 @@ void LoginDatabaseConnection::DoPrepareStatements()
PrepareStatement(LOGIN_SEL_REALMLIST, "SELECT id, name, address, localAddress, localSubnetMask, port, icon, flag, timezone, allowedSecurityLevel, population, gamebuild FROM realmlist WHERE flag <> 3 ORDER BY name", CONNECTION_SYNCH);
PrepareStatement(LOGIN_DEL_EXPIRED_IP_BANS, "DELETE FROM ip_banned WHERE unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC);
- PrepareStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS, "UPDATE account_banned SET active = 0 WHERE active = 1 AND unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC);
+ PrepareStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS, "UPDATE account_banned SET active = 0 WHERE active = 1 AND unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_IP_BANNED, "SELECT * FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_INS_IP_AUTO_BANNED, "INSERT INTO ip_banned (ip, bandate, unbandate, bannedby, banreason) VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban')", CONNECTION_ASYNC);
PrepareStatement(LOGIN_SEL_IP_BANNED_ALL, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) ORDER BY unbandate", CONNECTION_SYNCH);
diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h
index c9d34a26617..01f9fd973b6 100644
--- a/src/server/shared/Database/Implementation/LoginDatabase.h
+++ b/src/server/shared/Database/Implementation/LoginDatabase.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp
index f27ee2b72e0..644d3b330fb 100644
--- a/src/server/shared/Database/Implementation/WorldDatabase.cpp
+++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/Implementation/WorldDatabase.h b/src/server/shared/Database/Implementation/WorldDatabase.h
index 0126cdc3a80..a815373a1c6 100644
--- a/src/server/shared/Database/Implementation/WorldDatabase.h
+++ b/src/server/shared/Database/Implementation/WorldDatabase.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp
index f569b8352d3..55d47c76430 100644
--- a/src/server/shared/Database/MySQLConnection.cpp
+++ b/src/server/shared/Database/MySQLConnection.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/MySQLConnection.h b/src/server/shared/Database/MySQLConnection.h
index 656d7917315..161f459a7ad 100644
--- a/src/server/shared/Database/MySQLConnection.h
+++ b/src/server/shared/Database/MySQLConnection.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/MySQLThreading.h b/src/server/shared/Database/MySQLThreading.h
index 38c0d349a1c..0f6af8ace20 100644
--- a/src/server/shared/Database/MySQLThreading.h
+++ b/src/server/shared/Database/MySQLThreading.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp
index 30089cfb197..fe052bf5043 100644
--- a/src/server/shared/Database/PreparedStatement.cpp
+++ b/src/server/shared/Database/PreparedStatement.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/PreparedStatement.h b/src/server/shared/Database/PreparedStatement.h
index 2cab6e40de0..6a4d03bfb4d 100644
--- a/src/server/shared/Database/PreparedStatement.h
+++ b/src/server/shared/Database/PreparedStatement.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/QueryHolder.cpp b/src/server/shared/Database/QueryHolder.cpp
index 77980c4f66e..0c80f70acd2 100644
--- a/src/server/shared/Database/QueryHolder.cpp
+++ b/src/server/shared/Database/QueryHolder.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/QueryHolder.h b/src/server/shared/Database/QueryHolder.h
index 05c9e869290..b92b2e5327e 100644
--- a/src/server/shared/Database/QueryHolder.h
+++ b/src/server/shared/Database/QueryHolder.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/QueryResult.cpp b/src/server/shared/Database/QueryResult.cpp
index be81570318a..58ac8d37270 100644
--- a/src/server/shared/Database/QueryResult.cpp
+++ b/src/server/shared/Database/QueryResult.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Database/QueryResult.h b/src/server/shared/Database/QueryResult.h
index 1a721ce9e96..74320aeba19 100644
--- a/src/server/shared/Database/QueryResult.h
+++ b/src/server/shared/Database/QueryResult.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Database/SQLOperation.h b/src/server/shared/Database/SQLOperation.h
index d7870a7d22e..2c404c131ae 100644
--- a/src/server/shared/Database/SQLOperation.h
+++ b/src/server/shared/Database/SQLOperation.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/Transaction.cpp b/src/server/shared/Database/Transaction.cpp
index a1c900a51b9..2aadafa8f5d 100644
--- a/src/server/shared/Database/Transaction.cpp
+++ b/src/server/shared/Database/Transaction.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Database/Transaction.h b/src/server/shared/Database/Transaction.h
index e8e5a743a63..cb28f0ad876 100644
--- a/src/server/shared/Database/Transaction.h
+++ b/src/server/shared/Database/Transaction.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Debugging/Errors.cpp b/src/server/shared/Debugging/Errors.cpp
index 1bfe8c8e949..d656dc3fb4a 100644
--- a/src/server/shared/Debugging/Errors.cpp
+++ b/src/server/shared/Debugging/Errors.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Debugging/Errors.h b/src/server/shared/Debugging/Errors.h
index 2821ca504e7..7d521fefca0 100644
--- a/src/server/shared/Debugging/Errors.h
+++ b/src/server/shared/Debugging/Errors.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Debugging/WheatyExceptionReport.cpp b/src/server/shared/Debugging/WheatyExceptionReport.cpp
index f4da4093dfa..33f1492bb7f 100644
--- a/src/server/shared/Debugging/WheatyExceptionReport.cpp
+++ b/src/server/shared/Debugging/WheatyExceptionReport.cpp
@@ -566,6 +566,9 @@ PVOID addr, PTSTR szModule, DWORD len, DWORD& section, DWORD_PTR& offset)
DWORD_PTR hMod = (DWORD_PTR)mbi.AllocationBase;
+ if (!hMod)
+ return FALSE;
+
if (!GetModuleFileName((HMODULE)hMod, szModule, len))
return FALSE;
@@ -708,7 +711,7 @@ bool bWriteVariables, HANDLE pThreadHandle)
}
// Get the source line for this stack frame entry
- IMAGEHLP_LINE64 lineInfo = { sizeof(IMAGEHLP_LINE) };
+ IMAGEHLP_LINE64 lineInfo = { sizeof(IMAGEHLP_LINE64) };
DWORD dwLineDisplacement;
if (SymGetLineFromAddr64(m_hProcess, sf.AddrPC.Offset,
&dwLineDisplacement, &lineInfo))
@@ -746,11 +749,11 @@ ULONG /*SymbolSize*/,
PVOID UserContext)
{
- char szBuffer[2048];
+ char szBuffer[4092];
__try
{
- if (FormatSymbolValue(pSymInfo, (STACKFRAME*)UserContext,
+ if (FormatSymbolValue(pSymInfo, (STACKFRAME64*)UserContext,
szBuffer, sizeof(szBuffer)))
_tprintf(_T("\t%s\r\n"), szBuffer);
}
@@ -769,7 +772,7 @@ PVOID UserContext)
//////////////////////////////////////////////////////////////////////////////
bool WheatyExceptionReport::FormatSymbolValue(
PSYMBOL_INFO pSym,
-STACKFRAME * sf,
+STACKFRAME64 * sf,
char * pszBuffer,
unsigned /*cbBuffer*/)
{
@@ -782,7 +785,7 @@ unsigned /*cbBuffer*/)
pszCurrBuffer += sprintf(pszCurrBuffer, "Local ");
// If it's a function, don't do anything.
- if (pSym->Tag == 5) // SymTagFunction from CVCONST.H from the DIA SDK
+ if (pSym->Tag == SymTagFunction) // SymTagFunction from CVCONST.H from the DIA SDK
return false;
DWORD_PTR pVariable = 0; // Will point to the variable's data in memory
@@ -791,7 +794,11 @@ unsigned /*cbBuffer*/)
{
// if (pSym->Register == 8) // EBP is the value 8 (in DBGHELP 5.1)
{ // This may change!!!
+#ifdef _M_IX86
pVariable = sf->AddrFrame.Offset;
+#elif _M_X64
+ pVariable = sf->AddrStack.Offset;
+#endif
pVariable += (DWORD_PTR)pSym->Address;
}
// else
@@ -889,6 +896,12 @@ char* /*Name*/)
// Iterate through each of the children
for (unsigned i = 0; i < dwChildrenCount; i++)
{
+ DWORD symTag;
+ SymGetTypeInfo(m_hProcess, modBase, children.ChildId[i], TI_GET_SYMTAG, &symTag);
+
+ if (symTag == SymTagFunction || symTag == SymTagTypedef)
+ continue;
+
// Add appropriate indentation level (since this routine is recursive)
for (unsigned j = 0; j <= nestingLevel+1; j++)
pszCurrBuffer += sprintf(pszCurrBuffer, "\t");
@@ -1017,7 +1030,7 @@ WheatyExceptionReport::GetBasicType(DWORD typeIndex, DWORD64 modBase)
//============================================================================
int __cdecl WheatyExceptionReport::_tprintf(const TCHAR * format, ...)
{
- TCHAR szBuff[1024];
+ TCHAR szBuff[4092];
int retValue;
DWORD cbWritten;
va_list argptr;
diff --git a/src/server/shared/Debugging/WheatyExceptionReport.h b/src/server/shared/Debugging/WheatyExceptionReport.h
index 582f1f157b8..a4ba69d3ff3 100644
--- a/src/server/shared/Debugging/WheatyExceptionReport.h
+++ b/src/server/shared/Debugging/WheatyExceptionReport.h
@@ -98,7 +98,7 @@ class WheatyExceptionReport
static BOOL CALLBACK EnumerateSymbolsCallback(PSYMBOL_INFO, ULONG, PVOID);
- static bool FormatSymbolValue(PSYMBOL_INFO, STACKFRAME *, char * pszBuffer, unsigned cbBuffer);
+ static bool FormatSymbolValue(PSYMBOL_INFO, STACKFRAME64 *, char * pszBuffer, unsigned cbBuffer);
static char * DumpTypeIndex(char *, DWORD64, DWORD, unsigned, DWORD_PTR, bool &, char*);
diff --git a/src/server/shared/Define.h b/src/server/shared/Define.h
index d18f160aeaf..27973694818 100644
--- a/src/server/shared/Define.h
+++ b/src/server/shared/Define.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Dynamic/FactoryHolder.h b/src/server/shared/Dynamic/FactoryHolder.h
index cea8cb9c0bb..aee84ab151e 100644
--- a/src/server/shared/Dynamic/FactoryHolder.h
+++ b/src/server/shared/Dynamic/FactoryHolder.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Dynamic/HashNamespace.h b/src/server/shared/Dynamic/HashNamespace.h
index 88fa8c6f00e..0e95332c05f 100644
--- a/src/server/shared/Dynamic/HashNamespace.h
+++ b/src/server/shared/Dynamic/HashNamespace.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Dynamic/LinkedList.h b/src/server/shared/Dynamic/LinkedList.h
index c8a6a88e473..72d035c2cb6 100644
--- a/src/server/shared/Dynamic/LinkedList.h
+++ b/src/server/shared/Dynamic/LinkedList.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Dynamic/LinkedReference/RefManager.h b/src/server/shared/Dynamic/LinkedReference/RefManager.h
index e3a42b4bdc9..584066dde5c 100644
--- a/src/server/shared/Dynamic/LinkedReference/RefManager.h
+++ b/src/server/shared/Dynamic/LinkedReference/RefManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Dynamic/LinkedReference/Reference.h b/src/server/shared/Dynamic/LinkedReference/Reference.h
index 8604f3431e0..1ba41f1f454 100644
--- a/src/server/shared/Dynamic/LinkedReference/Reference.h
+++ b/src/server/shared/Dynamic/LinkedReference/Reference.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Dynamic/ObjectRegistry.h b/src/server/shared/Dynamic/ObjectRegistry.h
index 1b402eb3be1..4b17b2fc558 100644
--- a/src/server/shared/Dynamic/ObjectRegistry.h
+++ b/src/server/shared/Dynamic/ObjectRegistry.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Dynamic/TypeContainer.h b/src/server/shared/Dynamic/TypeContainer.h
index a99a448e0b8..5fe5c947dfe 100644
--- a/src/server/shared/Dynamic/TypeContainer.h
+++ b/src/server/shared/Dynamic/TypeContainer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Dynamic/TypeContainerFunctions.h b/src/server/shared/Dynamic/TypeContainerFunctions.h
index 22f8be4ed5f..16701e1ab5a 100644
--- a/src/server/shared/Dynamic/TypeContainerFunctions.h
+++ b/src/server/shared/Dynamic/TypeContainerFunctions.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Dynamic/TypeContainerVisitor.h b/src/server/shared/Dynamic/TypeContainerVisitor.h
index 8ca3ee8dbc4..120d9880f03 100644
--- a/src/server/shared/Dynamic/TypeContainerVisitor.h
+++ b/src/server/shared/Dynamic/TypeContainerVisitor.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Dynamic/TypeList.h b/src/server/shared/Dynamic/TypeList.h
index f32a0ef1d64..c5dc1ee21a4 100644
--- a/src/server/shared/Dynamic/TypeList.h
+++ b/src/server/shared/Dynamic/TypeList.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Dynamic/UnorderedMap.h b/src/server/shared/Dynamic/UnorderedMap.h
index 701e7f339e2..f97c4830c75 100644
--- a/src/server/shared/Dynamic/UnorderedMap.h
+++ b/src/server/shared/Dynamic/UnorderedMap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Dynamic/UnorderedSet.h b/src/server/shared/Dynamic/UnorderedSet.h
index 862358e7fe7..0e084698c47 100644
--- a/src/server/shared/Dynamic/UnorderedSet.h
+++ b/src/server/shared/Dynamic/UnorderedSet.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Logging/Appender.cpp b/src/server/shared/Logging/Appender.cpp
index 06aa6159014..718c3a406f1 100644
--- a/src/server/shared/Logging/Appender.cpp
+++ b/src/server/shared/Logging/Appender.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Logging/Appender.h b/src/server/shared/Logging/Appender.h
index 437c301ea6b..b373f0459c9 100644
--- a/src/server/shared/Logging/Appender.h
+++ b/src/server/shared/Logging/Appender.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Logging/AppenderConsole.cpp b/src/server/shared/Logging/AppenderConsole.cpp
index 78350029205..14d434e35b8 100644
--- a/src/server/shared/Logging/AppenderConsole.cpp
+++ b/src/server/shared/Logging/AppenderConsole.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Logging/AppenderConsole.h b/src/server/shared/Logging/AppenderConsole.h
index 6f3fcca901c..1aaa74e96ec 100644
--- a/src/server/shared/Logging/AppenderConsole.h
+++ b/src/server/shared/Logging/AppenderConsole.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Logging/AppenderDB.cpp b/src/server/shared/Logging/AppenderDB.cpp
index 204592720dc..d18a5ad8a50 100644
--- a/src/server/shared/Logging/AppenderDB.cpp
+++ b/src/server/shared/Logging/AppenderDB.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Logging/AppenderDB.h b/src/server/shared/Logging/AppenderDB.h
index f9dde0a1e82..660992261fd 100644
--- a/src/server/shared/Logging/AppenderDB.h
+++ b/src/server/shared/Logging/AppenderDB.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Logging/AppenderFile.cpp b/src/server/shared/Logging/AppenderFile.cpp
index d5410112b97..b9c2fd7339d 100644
--- a/src/server/shared/Logging/AppenderFile.cpp
+++ b/src/server/shared/Logging/AppenderFile.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Logging/AppenderFile.h b/src/server/shared/Logging/AppenderFile.h
index de94a46d692..1034b41f665 100644
--- a/src/server/shared/Logging/AppenderFile.h
+++ b/src/server/shared/Logging/AppenderFile.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp
index bca150b7059..d7d70e7d4ea 100644
--- a/src/server/shared/Logging/Log.cpp
+++ b/src/server/shared/Logging/Log.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -267,7 +267,7 @@ void Log::vlog(std::string const& filter, LogLevel level, char const* str, va_li
write(new LogMessage(level, filter, text));
}
-void Log::write(LogMessage* msg) const
+void Log::write(LogMessage* msg)
{
Logger const* logger = GetLoggerByType(msg->type);
msg->text.append("\n");
@@ -376,6 +376,7 @@ void Log::Close()
delete worker;
worker = NULL;
loggers.clear();
+ cachedLoggers.clear();
for (AppenderMap::iterator it = appenders.begin(); it != appenders.end(); ++it)
{
delete it->second;
diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h
index af522a6745f..dcac93e5a60 100644
--- a/src/server/shared/Logging/Log.h
+++ b/src/server/shared/Logging/Log.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@ class Log
friend class ACE_Singleton<Log, ACE_Thread_Mutex>;
typedef UNORDERED_MAP<std::string, Logger> LoggerMap;
+ typedef UNORDERED_MAP<std::string, Logger const*> CachedLoggerContainer;
private:
Log();
@@ -43,7 +44,7 @@ class Log
public:
void LoadFromConfig();
void Close();
- bool ShouldLog(std::string const& type, LogLevel level) const;
+ bool ShouldLog(std::string const& type, LogLevel level);
bool SetLogLevel(std::string const& name, char const* level, bool isLogger = true);
void outMessage(std::string const& f, LogLevel level, char const* str, ...) ATTR_PRINTF(4, 5);
@@ -56,9 +57,9 @@ class Log
private:
static std::string GetTimestampStr();
void vlog(std::string const& f, LogLevel level, char const* str, va_list argptr);
- void write(LogMessage* msg) const;
+ void write(LogMessage* msg);
- Logger const* GetLoggerByType(std::string const& type) const;
+ Logger const* GetLoggerByType(std::string const& type);
Appender* GetAppenderByName(std::string const& name);
uint8 NextAppenderId();
void CreateAppenderFromConfig(std::string const& name);
@@ -68,6 +69,7 @@ class Log
AppenderMap appenders;
LoggerMap loggers;
+ CachedLoggerContainer cachedLoggers;
uint8 AppenderId;
std::string m_logsDir;
@@ -76,24 +78,36 @@ class Log
LogWorker* worker;
};
-inline Logger const* Log::GetLoggerByType(std::string const& type) const
+inline Logger const* Log::GetLoggerByType(std::string const& originalType)
{
- LoggerMap::const_iterator it = loggers.find(type);
- if (it != loggers.end())
- return &(it->second);
-
- if (type == LOGGER_ROOT)
- return NULL;
-
- std::string parentLogger = LOGGER_ROOT;
- size_t found = type.find_last_of(".");
- if (found != std::string::npos)
- parentLogger = type.substr(0,found);
-
- return GetLoggerByType(parentLogger);
+ // Check if already cached
+ CachedLoggerContainer::const_iterator itCached = cachedLoggers.find(originalType);
+ if (itCached != cachedLoggers.end())
+ return itCached->second;
+
+ Logger const* logger = NULL;
+ std::string type(originalType);
+
+ do
+ {
+ // Search for the logger "type.subtype"
+ LoggerMap::const_iterator it = loggers.find(type);
+ if (it == loggers.end())
+ {
+ // Search for the logger "type", if our logger contains '.', otherwise search for LOGGER_ROOT
+ size_t found = type.find_last_of(".");
+ type = found != std::string::npos ? type.substr(0, found) : LOGGER_ROOT;
+ }
+ else
+ logger = &(it->second);
+ }
+ while (!logger);
+
+ cachedLoggers[type] = logger;
+ return logger;
}
-inline bool Log::ShouldLog(std::string const& type, LogLevel level) const
+inline bool Log::ShouldLog(std::string const& type, LogLevel level)
{
// TODO: Use cache to store "Type.sub1.sub2": "Type" equivalence, should
// Speed up in cases where requesting "Type.sub1.sub2" but only configured
@@ -119,7 +133,7 @@ inline void Log::outMessage(std::string const& filter, LogLevel level, const cha
#define sLog ACE_Singleton<Log, ACE_Thread_Mutex>::instance()
-#if COMPILER != COMPILER_MICROSOFT
+#if PLATFORM != PLATFORM_WINDOWS
#define TC_LOG_MESSAGE_BODY(filterType__, level__, ...) \
do { \
if (sLog->ShouldLog(filterType__, level__)) \
diff --git a/src/server/shared/Logging/LogOperation.cpp b/src/server/shared/Logging/LogOperation.cpp
index f3d3649aa97..5f241d89712 100644
--- a/src/server/shared/Logging/LogOperation.cpp
+++ b/src/server/shared/Logging/LogOperation.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Logging/LogOperation.h b/src/server/shared/Logging/LogOperation.h
index 237f50de4ad..bd90da254a6 100644
--- a/src/server/shared/Logging/LogOperation.h
+++ b/src/server/shared/Logging/LogOperation.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Logging/LogWorker.cpp b/src/server/shared/Logging/LogWorker.cpp
index 857deb926fe..b0c82b614f4 100644
--- a/src/server/shared/Logging/LogWorker.cpp
+++ b/src/server/shared/Logging/LogWorker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Logging/LogWorker.h b/src/server/shared/Logging/LogWorker.h
index 78571b596d7..25a57842e08 100644
--- a/src/server/shared/Logging/LogWorker.h
+++ b/src/server/shared/Logging/LogWorker.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Logging/Logger.cpp b/src/server/shared/Logging/Logger.cpp
index 6fff993e2ae..dae8edc6ca9 100644
--- a/src/server/shared/Logging/Logger.cpp
+++ b/src/server/shared/Logging/Logger.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Logging/Logger.h b/src/server/shared/Logging/Logger.h
index 24727ce1016..c7826f0615c 100644
--- a/src/server/shared/Logging/Logger.h
+++ b/src/server/shared/Logging/Logger.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp
index 8fba0fc23a4..b8cb5215665 100644
--- a/src/server/shared/Packets/ByteBuffer.cpp
+++ b/src/server/shared/Packets/ByteBuffer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h
index d2677538805..33d33519c8f 100644
--- a/src/server/shared/Packets/ByteBuffer.h
+++ b/src/server/shared/Packets/ByteBuffer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Packets/WorldPacket.h b/src/server/shared/Packets/WorldPacket.h
index 7ec2b5d1e1e..6703c5ed2ea 100644
--- a/src/server/shared/Packets/WorldPacket.h
+++ b/src/server/shared/Packets/WorldPacket.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/SystemConfig.h b/src/server/shared/SystemConfig.h
index c3e54763ff0..dd5e9a2f90d 100644
--- a/src/server/shared/SystemConfig.h
+++ b/src/server/shared/SystemConfig.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Threading/Callback.h b/src/server/shared/Threading/Callback.h
index d4214cf0843..b074ff49c3c 100644
--- a/src/server/shared/Threading/Callback.h
+++ b/src/server/shared/Threading/Callback.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/shared/Threading/LockedQueue.h b/src/server/shared/Threading/LockedQueue.h
index d356d01606f..5709724c9a2 100644
--- a/src/server/shared/Threading/LockedQueue.h
+++ b/src/server/shared/Threading/LockedQueue.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Threading/Threading.cpp b/src/server/shared/Threading/Threading.cpp
index 1ed29d5106a..f67a985943a 100644
--- a/src/server/shared/Threading/Threading.cpp
+++ b/src/server/shared/Threading/Threading.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Threading/Threading.h b/src/server/shared/Threading/Threading.h
index 00be82c6555..9d416109e9f 100644
--- a/src/server/shared/Threading/Threading.h
+++ b/src/server/shared/Threading/Threading.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Utilities/ByteConverter.h b/src/server/shared/Utilities/ByteConverter.h
index b114f8915a4..bf1342a10e4 100644
--- a/src/server/shared/Utilities/ByteConverter.h
+++ b/src/server/shared/Utilities/ByteConverter.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Utilities/EventProcessor.cpp b/src/server/shared/Utilities/EventProcessor.cpp
index aeb67869882..fcae42cf27d 100644
--- a/src/server/shared/Utilities/EventProcessor.cpp
+++ b/src/server/shared/Utilities/EventProcessor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Utilities/EventProcessor.h b/src/server/shared/Utilities/EventProcessor.h
index 8abf0f09dfe..10ae6aa954c 100644
--- a/src/server/shared/Utilities/EventProcessor.h
+++ b/src/server/shared/Utilities/EventProcessor.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -28,7 +28,12 @@
class BasicEvent
{
public:
- BasicEvent() { to_Abort = false; }
+ BasicEvent()
+ {
+ to_Abort = false;
+ m_addTime = 0;
+ m_execTime = 0;
+ }
virtual ~BasicEvent() { } // override destructor to perform some actions on event removal
// this method executes when the event is triggered
diff --git a/src/server/shared/Utilities/ServiceWin32.cpp b/src/server/shared/Utilities/ServiceWin32.cpp
index c50aca87c09..ec472b33f40 100644
--- a/src/server/shared/Utilities/ServiceWin32.cpp
+++ b/src/server/shared/Utilities/ServiceWin32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Utilities/ServiceWin32.h b/src/server/shared/Utilities/ServiceWin32.h
index bc2917d4bcb..52223ccc7f6 100644
--- a/src/server/shared/Utilities/ServiceWin32.h
+++ b/src/server/shared/Utilities/ServiceWin32.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Utilities/SignalHandler.h b/src/server/shared/Utilities/SignalHandler.h
index 51bb9a4b27b..41e867c3d1a 100644
--- a/src/server/shared/Utilities/SignalHandler.h
+++ b/src/server/shared/Utilities/SignalHandler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Utilities/Timer.h b/src/server/shared/Utilities/Timer.h
index b0b395865b4..c809a59c20f 100644
--- a/src/server/shared/Utilities/Timer.h
+++ b/src/server/shared/Utilities/Timer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp
index 48012b6eea8..499ad0502b7 100644
--- a/src/server/shared/Utilities/Util.cpp
+++ b/src/server/shared/Utilities/Util.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h
index 30a6b27f186..b086a28134c 100644
--- a/src/server/shared/Utilities/Util.h
+++ b/src/server/shared/Utilities/Util.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt
index 99ea60ba76f..d1d2ef11848 100644
--- a/src/server/worldserver/CMakeLists.txt
+++ b/src/server/worldserver/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp
index 218fe052cb3..ac46b218305 100644
--- a/src/server/worldserver/CommandLine/CliRunnable.cpp
+++ b/src/server/worldserver/CommandLine/CliRunnable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/worldserver/CommandLine/CliRunnable.h b/src/server/worldserver/CommandLine/CliRunnable.h
index 6e608f60881..0306109ab54 100644
--- a/src/server/worldserver/CommandLine/CliRunnable.h
+++ b/src/server/worldserver/CommandLine/CliRunnable.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp
index a5f07c036c2..75d9ca5145d 100644
--- a/src/server/worldserver/Main.cpp
+++ b/src/server/worldserver/Main.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp
index 3fcd4c28f0f..f4b2b542de6 100644
--- a/src/server/worldserver/Master.cpp
+++ b/src/server/worldserver/Master.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -86,8 +86,8 @@ private:
uint32 _lastChange;
uint32 _delaytime;
public:
- FreezeDetectorRunnable()
- {
+ FreezeDetectorRunnable()
+ {
_loops = 0;
_lastChange = 0;
_delaytime = 0;
@@ -251,7 +251,7 @@ int Master::Run()
{
CPU_ZERO(&mask);
sched_getaffinity(0, sizeof(mask), &mask);
- TC_LOG_INFO("server.worldserver", "Using processors (bitmask, hex): %x", *(uint32*)(&mask));
+ TC_LOG_INFO("server.worldserver", "Using processors (bitmask, hex): %lx", *(__cpu_mask*)(&mask));
}
}
diff --git a/src/server/worldserver/Master.h b/src/server/worldserver/Master.h
index 93b2387feec..9ee94a44acb 100644
--- a/src/server/worldserver/Master.h
+++ b/src/server/worldserver/Master.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/worldserver/RemoteAccess/RARunnable.cpp b/src/server/worldserver/RemoteAccess/RARunnable.cpp
index 424c3b9a5a6..44b07163294 100644
--- a/src/server/worldserver/RemoteAccess/RARunnable.cpp
+++ b/src/server/worldserver/RemoteAccess/RARunnable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/worldserver/RemoteAccess/RARunnable.h b/src/server/worldserver/RemoteAccess/RARunnable.h
index a03e16e2154..052b532572e 100644
--- a/src/server/worldserver/RemoteAccess/RARunnable.h
+++ b/src/server/worldserver/RemoteAccess/RARunnable.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp
index 195b2992244..6e621ddfffe 100644
--- a/src/server/worldserver/RemoteAccess/RASocket.cpp
+++ b/src/server/worldserver/RemoteAccess/RASocket.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/worldserver/RemoteAccess/RASocket.h b/src/server/worldserver/RemoteAccess/RASocket.h
index add23198bde..ae201747010 100644
--- a/src/server/worldserver/RemoteAccess/RASocket.h
+++ b/src/server/worldserver/RemoteAccess/RASocket.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/worldserver/TCSoap/TCSoap.cpp b/src/server/worldserver/TCSoap/TCSoap.cpp
index c76298b0de9..1549019352d 100644
--- a/src/server/worldserver/TCSoap/TCSoap.cpp
+++ b/src/server/worldserver/TCSoap/TCSoap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/worldserver/TCSoap/TCSoap.h b/src/server/worldserver/TCSoap/TCSoap.h
index ff2a49a4d7e..34a3b336464 100644
--- a/src/server/worldserver/TCSoap/TCSoap.h
+++ b/src/server/worldserver/TCSoap/TCSoap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/server/worldserver/WorldThread/WorldRunnable.cpp b/src/server/worldserver/WorldThread/WorldRunnable.cpp
index 01208e3ef3a..476007f6ea0 100644
--- a/src/server/worldserver/WorldThread/WorldRunnable.cpp
+++ b/src/server/worldserver/WorldThread/WorldRunnable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/worldserver/WorldThread/WorldRunnable.h b/src/server/worldserver/WorldThread/WorldRunnable.h
index 56a3b41eae7..563a6b03827 100644
--- a/src/server/worldserver/WorldThread/WorldRunnable.h
+++ b/src/server/worldserver/WorldThread/WorldRunnable.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index 4e594fc88c0..2a47c8f989e 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -138,7 +138,7 @@ WorldServerPort = 8085
#
# BindIP
-# Description: Bind world server to IP/hostname
+# Description: Bind world server to IP/hostname.
# Default: "0.0.0.0" - (Bind to all IPs on the system)
BindIP = "0.0.0.0"
@@ -152,7 +152,7 @@ BindIP = "0.0.0.0"
# UseProcessors
# Description: Processors mask for Windows and Linux based multi-processor systems.
# Example: A computer with 2 CPUs:
-# 1 - 1st CPU only, 2 - 2nd CPU only, 3 - 1st and 2nd CPU, because 1 | 2 is 3
+# 1 - 1st CPU only, 2 - 2nd CPU only, 3 - 1st and 2nd CPU, because 1 | 2 is 3
# Default: 0 - (Selected by OS)
# 1+ - (Bit mask value of selected processors)
@@ -169,7 +169,7 @@ ProcessPriority = 0
#
# Compression
-# Description: Compression level for client update packages
+# Description: Compression level for client update packages.
# Range: 1-9
# Default: 1 - (Speed)
# 9 - (Best compression)
@@ -275,7 +275,7 @@ PlayerSave.Stats.SaveOnlyOnLogout = 1
#
# mmap.enablePathFinding
-# Description: Enable/Disable pathfinding using mmaps - experimental
+# Description: Enable/Disable pathfinding using mmaps - experimental.
# Default: 0 - (Disabled)
# 1 - (Enabled)
@@ -395,7 +395,7 @@ PersistentCharacterCleanFlags = 0
# SERVER LOGGING
#
# PidFile
-# Description: World daemon PID file
+# Description: World daemon PID file.
# Example: "./world.pid" - (Enabled)
# Default: "" - (Disabled)
@@ -440,7 +440,6 @@ ChatLogs.SysChan = 0
# Default: 0 - (Disabled)
# 1 - (Enabled)
-
ChatLogs.Party = 0
#
@@ -449,7 +448,6 @@ ChatLogs.Party = 0
# Default: 0 - (Disabled)
# 1 - (Enabled)
-
ChatLogs.Raid = 0
#
@@ -698,6 +696,7 @@ CharacterCreating.Disabled.ClassMask = 0
# Default: 50
CharactersPerAccount = 50
+
#
# CharactersPerRealm
# Description: Limit number of characters per account on this realm.
@@ -717,7 +716,7 @@ HeroicCharactersPerRealm = 1
#
# CharacterCreating.MinLevelForHeroicCharacter
# Description: Limit creating heroic characters only for account with another
-# character of specific level (ignored for GM accounts)
+# character of specific level (ignored for GM accounts).
# Default: 55 - (Enabled, Requires at least another level 55 character)
# 0 - (Disabled)
# 1 - (Enabled, Requires at least another level 1 character)
@@ -745,7 +744,7 @@ MaxPlayerLevel = 80
#
# MinDualSpecLevel
-# Description: Level requirement for Dual Talent Specialization
+# Description: Level requirement for Dual Talent Specialization.
# Default: 40
MinDualSpecLevel = 40
@@ -913,6 +912,7 @@ Instance.UnloadDelay = 1800000
# true - (Enabled, show)
InstancesResetAnnounce = false
+
#
# Quests.LowLevelHideDiff
# Description: Level difference between player and quest level at which quests are
@@ -1125,7 +1125,7 @@ DBC.EnforceItemAttributes = 1
#
# AccountInstancesPerHour
-# Description: Controls the max amount of different instances player can enter within hour
+# Description: Controls the max amount of different instances player can enter within hour.
# Default: 5
AccountInstancesPerHour = 5
@@ -1813,7 +1813,7 @@ Rate.Damage.Fall = 1
# Rate.Auction.Deposit
# Rate.Auction.Cut
# Description: Auction rates (auction time, deposit get at auction start,
-# auction cut from price at auction end)
+# auction cut from price at auction end).
# Default: 1 - (Rate.Auction.Time)
# 1 - (Rate.Auction.Deposit)
# 1 - (Rate.Auction.Cut)
@@ -2018,14 +2018,14 @@ Die.Command.Mode = 1
# STATS LIMITS
#
# Stats.Limits.Enable
-# Description: Enable or disable stats system
+# Description: Enable or disable stats system.
# Default: 0 - Disabled
Stats.Limits.Enable = 0
#
# Stats.Limit.[STAT]
-# Description: Set percentage limit for dodge, parry, block and crit rating
+# Description: Set percentage limit for dodge, parry, block and crit rating.
# Default: 95.0 (95%)
Stats.Limits.Dodge = 95.0
@@ -2142,7 +2142,7 @@ Battleground.Random.ResetHour = 6
# Battleground.RewardWinnerArenaLast
# Battleground.RewardLoserHonorFirst
# Battleground.RewardLoserHonorLast
-# Description: Random Battlegrounds / call to the arms rewards
+# Description: Random Battlegrounds / call to the arms rewards.
# Default: 30 - Battleground.RewardWinnerHonorFirst
# 25 - Battleground.RewardWinnerArenaFirst
# 15 - Battleground.RewardWinnerHonorLast
@@ -2238,7 +2238,7 @@ Arena.RatingDiscardTimer = 600000
#
# Arena.RatedUpdateTimer
-# Description: Time (in milliseconds) between checks for matchups in rated arena
+# Description: Time (in milliseconds) between checks for matchups in rated arena.
# Default: 5000 - (5 seconds)
Arena.RatedUpdateTimer = 5000
@@ -2392,7 +2392,7 @@ Ra.MinLevel = 3
#
# SOAP.Enable
-# Description: Enable soap service
+# Description: Enable soap service.
# Default: 0 - (Disabled)
# 1 - (Enabled)
@@ -2400,7 +2400,7 @@ SOAP.Enabled = 0
#
# SOAP.IP
-# Description: Bind SOAP service to IP/hostname
+# Description: Bind SOAP service to IP/hostname.
# Default: "127.0.0.1" - (Bind to localhost)
SOAP.IP = "127.0.0.1"
@@ -2554,12 +2554,29 @@ Guild.AllowMultipleGuildMaster = 0
#
# ShowKickInWorld
# Description: Determines whether a message is broadcasted to the entire server when a
-# player gets kicked
+# player gets kicked.
# Default: 0 - (Disabled)
# 1 - (Enabled)
ShowKickInWorld = 0
+# ShowMuteInWorld
+# Description: Determines whether a message is broadcasted to the entire server when a
+# player gets muted.
+# Default: 0 - (Disabled)
+# 1 - (Enabled)
+
+ShowMuteInWorld = 0
+
+#
+# ShowBanInWorld
+# Description: Determines whether a message is broadcasted to the entire server when a
+# player gets banned.
+# Default: 0 - (Disabled)
+# 1 - (Enabled)
+
+ShowBanInWorld = 0
+
#
# RecordUpdateTimeDiffInterval
# Description: Time (in milliseconds) update time diff is written to the log file.
@@ -2569,6 +2586,7 @@ ShowKickInWorld = 0
# 0 - (Disabled)
RecordUpdateTimeDiffInterval = 60000
+
#
# MinRecordUpdateTimeDiff
# Description: Only record update time diff which is greater than this value.
@@ -2628,8 +2646,8 @@ PlayerDump.DisallowOverwrite = 1
#
# UI.ShowQuestLevelsInDialogs
# Description: Show quest levels next to quest titles in UI dialogs
-# Example: [13] Westfall Stew
-# Default: 0 (do not show)
+# Example: [13] Westfall Stew
+# Default: 0 - (Do not show)
UI.ShowQuestLevelsInDialogs = 0
@@ -2641,7 +2659,7 @@ UI.ShowQuestLevelsInDialogs = 0
#
# Appender config values: Given a appender "name"
# Appender.name
-# Description: Defines 'where to log'
+# Description: Defines 'where to log'.
# Format: Type,LogLevel,Flags,optional1,optional2,optional3
#
# Type
@@ -2789,18 +2807,18 @@ Log.Async.Enable = 0
#
# PacketSpoof.Policy
# Description: Determines the course of action when packet spoofing is detected.
-# Default: 1 - Log + kick
-# 0 - Log only ("network")
-# 2 - Log + kick + ban
+# Default: 1 - (Log + kick)
+# 0 - (Log only 'network')
+# 2 - (Log + kick + ban)
PacketSpoof.Policy = 1
#
# PacketSpoof.BanMode
# Description: If PacketSpoof.Policy equals 2, this will determine the ban mode.
-# Note: Banning by character not supported for logical reasons.
-# Default: 0 - Ban Account
-# 2 - Ban IP
+# Note: Banning by character not supported for logical reasons.
+# Default: 0 - Ban Account
+# 2 - Ban IP
#
PacketSpoof.BanMode = 0
diff --git a/src/server/worldserver/worldserver.rc b/src/server/worldserver/worldserver.rc
index c2e5d5e168e..104d9b162df 100644
--- a/src/server/worldserver/worldserver.rc
+++ b/src/server/worldserver/worldserver.rc
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
index 3adccf105de..c2ea8a85926 100644
--- a/src/tools/CMakeLists.txt
+++ b/src/tools/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/tools/map_extractor/CMakeLists.txt b/src/tools/map_extractor/CMakeLists.txt
index ea073456680..f05424d6bbe 100644
--- a/src/tools/map_extractor/CMakeLists.txt
+++ b/src/tools/map_extractor/CMakeLists.txt
@@ -1,5 +1,5 @@
# Copyright (C) 2005-2009 MaNGOS project <http://getmangos.com/>
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp
index 3dd311c2da5..ca04e5a2081 100644
--- a/src/tools/map_extractor/System.cpp
+++ b/src/tools/map_extractor/System.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/map_extractor/adt.cpp b/src/tools/map_extractor/adt.cpp
index 04d1ea9aa45..095f598501a 100644
--- a/src/tools/map_extractor/adt.cpp
+++ b/src/tools/map_extractor/adt.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/map_extractor/adt.h b/src/tools/map_extractor/adt.h
index 46a517f3e84..5cb45d488d5 100644
--- a/src/tools/map_extractor/adt.h
+++ b/src/tools/map_extractor/adt.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -255,7 +255,7 @@ public:
if (h->offsData2a)
return *((uint64 *)((uint8*)this + 8 + h->offsData2a));
else
- return 0xFFFFFFFFFFFFFFFFLL;
+ return 0xFFFFFFFFFFFFFFFFuLL;
}
};
diff --git a/src/tools/map_extractor/dbcfile.cpp b/src/tools/map_extractor/dbcfile.cpp
index 0a1aa6a8341..653b48ff949 100644
--- a/src/tools/map_extractor/dbcfile.cpp
+++ b/src/tools/map_extractor/dbcfile.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/map_extractor/dbcfile.h b/src/tools/map_extractor/dbcfile.h
index 8c519a1b745..526c553e0f0 100644
--- a/src/tools/map_extractor/dbcfile.h
+++ b/src/tools/map_extractor/dbcfile.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/map_extractor/loadlib.cpp b/src/tools/map_extractor/loadlib.cpp
index 6b103c282b5..ebe1bd61b65 100644
--- a/src/tools/map_extractor/loadlib.cpp
+++ b/src/tools/map_extractor/loadlib.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/map_extractor/loadlib/loadlib.h b/src/tools/map_extractor/loadlib/loadlib.h
index 7fc1f92728d..724c41ef3c9 100644
--- a/src/tools/map_extractor/loadlib/loadlib.h
+++ b/src/tools/map_extractor/loadlib/loadlib.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/map_extractor/mpq_libmpq.cpp b/src/tools/map_extractor/mpq_libmpq.cpp
index 7f63cebc66e..df9eb78fc65 100644
--- a/src/tools/map_extractor/mpq_libmpq.cpp
+++ b/src/tools/map_extractor/mpq_libmpq.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/map_extractor/mpq_libmpq04.h b/src/tools/map_extractor/mpq_libmpq04.h
index 95e87fd7a7a..76778c663a6 100644
--- a/src/tools/map_extractor/mpq_libmpq04.h
+++ b/src/tools/map_extractor/mpq_libmpq04.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/map_extractor/wdt.cpp b/src/tools/map_extractor/wdt.cpp
index cc97c12371e..fbb0b78567b 100644
--- a/src/tools/map_extractor/wdt.cpp
+++ b/src/tools/map_extractor/wdt.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/map_extractor/wdt.h b/src/tools/map_extractor/wdt.h
index 9d1ca50e6b9..a55598105b3 100644
--- a/src/tools/map_extractor/wdt.h
+++ b/src/tools/map_extractor/wdt.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/mesh_extractor/ADT.cpp b/src/tools/mesh_extractor/ADT.cpp
index a32276f9856..a55bdd5e4bb 100644
--- a/src/tools/mesh_extractor/ADT.cpp
+++ b/src/tools/mesh_extractor/ADT.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/ADT.h b/src/tools/mesh_extractor/ADT.h
index e5d27708bfc..ac16b7278ed 100644
--- a/src/tools/mesh_extractor/ADT.h
+++ b/src/tools/mesh_extractor/ADT.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/CMakeLists.txt b/src/tools/mesh_extractor/CMakeLists.txt
index 9ed8472051d..99fa136fccb 100644
--- a/src/tools/mesh_extractor/CMakeLists.txt
+++ b/src/tools/mesh_extractor/CMakeLists.txt
@@ -1,5 +1,5 @@
# Copyright (C) 2005-2009 MaNGOS project <http://getmangos.com/>
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/tools/mesh_extractor/Cache.h b/src/tools/mesh_extractor/Cache.h
index 017b4c53f72..5d8c02252c9 100644
--- a/src/tools/mesh_extractor/Cache.h
+++ b/src/tools/mesh_extractor/Cache.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/Chunk.cpp b/src/tools/mesh_extractor/Chunk.cpp
index 42eb9e14881..e4b2f60ff99 100644
--- a/src/tools/mesh_extractor/Chunk.cpp
+++ b/src/tools/mesh_extractor/Chunk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/Chunk.h b/src/tools/mesh_extractor/Chunk.h
index 0641eb1dc3c..87201928435 100644
--- a/src/tools/mesh_extractor/Chunk.h
+++ b/src/tools/mesh_extractor/Chunk.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/ChunkedData.cpp b/src/tools/mesh_extractor/ChunkedData.cpp
index 1330e4b47f9..ae7827d98ea 100644
--- a/src/tools/mesh_extractor/ChunkedData.cpp
+++ b/src/tools/mesh_extractor/ChunkedData.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/ChunkedData.h b/src/tools/mesh_extractor/ChunkedData.h
index 5befdf30dd1..48bb61f6959 100644
--- a/src/tools/mesh_extractor/ChunkedData.h
+++ b/src/tools/mesh_extractor/ChunkedData.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/Constants.h b/src/tools/mesh_extractor/Constants.h
index 5a89be9fe9c..75e08bcf6fd 100644
--- a/src/tools/mesh_extractor/Constants.h
+++ b/src/tools/mesh_extractor/Constants.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/ContinentBuilder.cpp b/src/tools/mesh_extractor/ContinentBuilder.cpp
index 841d7a608e4..8f6a918ef8d 100644
--- a/src/tools/mesh_extractor/ContinentBuilder.cpp
+++ b/src/tools/mesh_extractor/ContinentBuilder.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/ContinentBuilder.h b/src/tools/mesh_extractor/ContinentBuilder.h
index 5349b8e1ba5..7f0d23b0418 100644
--- a/src/tools/mesh_extractor/ContinentBuilder.h
+++ b/src/tools/mesh_extractor/ContinentBuilder.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/DBC.cpp b/src/tools/mesh_extractor/DBC.cpp
index 9249e320563..d1b95076ecd 100644
--- a/src/tools/mesh_extractor/DBC.cpp
+++ b/src/tools/mesh_extractor/DBC.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/DBC.h b/src/tools/mesh_extractor/DBC.h
index 0d3b85d8c78..d0951e36737 100644
--- a/src/tools/mesh_extractor/DBC.h
+++ b/src/tools/mesh_extractor/DBC.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/DoodadHandler.cpp b/src/tools/mesh_extractor/DoodadHandler.cpp
index 2e0743134d4..d56ba4c3bdf 100644
--- a/src/tools/mesh_extractor/DoodadHandler.cpp
+++ b/src/tools/mesh_extractor/DoodadHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/DoodadHandler.h b/src/tools/mesh_extractor/DoodadHandler.h
index c3a8d645016..3e179f63539 100644
--- a/src/tools/mesh_extractor/DoodadHandler.h
+++ b/src/tools/mesh_extractor/DoodadHandler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/Geometry.cpp b/src/tools/mesh_extractor/Geometry.cpp
index 0c7b7a492c5..e81dd8a7660 100644
--- a/src/tools/mesh_extractor/Geometry.cpp
+++ b/src/tools/mesh_extractor/Geometry.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/Geometry.h b/src/tools/mesh_extractor/Geometry.h
index f2ea43e381e..d54cdbde5dd 100644
--- a/src/tools/mesh_extractor/Geometry.h
+++ b/src/tools/mesh_extractor/Geometry.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/LiquidHandler.cpp b/src/tools/mesh_extractor/LiquidHandler.cpp
index eef36d8ea92..0a76dbfb54c 100644
--- a/src/tools/mesh_extractor/LiquidHandler.cpp
+++ b/src/tools/mesh_extractor/LiquidHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/LiquidHandler.h b/src/tools/mesh_extractor/LiquidHandler.h
index c053b621088..424dbde7e63 100644
--- a/src/tools/mesh_extractor/LiquidHandler.h
+++ b/src/tools/mesh_extractor/LiquidHandler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/MPQ.cpp b/src/tools/mesh_extractor/MPQ.cpp
index 5a2957cac0b..b75a5bbdd85 100644
--- a/src/tools/mesh_extractor/MPQ.cpp
+++ b/src/tools/mesh_extractor/MPQ.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/MPQ.h b/src/tools/mesh_extractor/MPQ.h
index 17dbe74dcaa..7eb048480b9 100644
--- a/src/tools/mesh_extractor/MPQ.h
+++ b/src/tools/mesh_extractor/MPQ.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/MPQManager.cpp b/src/tools/mesh_extractor/MPQManager.cpp
index 8954da6c154..5f6e4a331ac 100644
--- a/src/tools/mesh_extractor/MPQManager.cpp
+++ b/src/tools/mesh_extractor/MPQManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/MPQManager.h b/src/tools/mesh_extractor/MPQManager.h
index 6172237df49..588052bb844 100644
--- a/src/tools/mesh_extractor/MPQManager.h
+++ b/src/tools/mesh_extractor/MPQManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/MapChunk.cpp b/src/tools/mesh_extractor/MapChunk.cpp
index 4cd5afad3f1..76280dcc973 100644
--- a/src/tools/mesh_extractor/MapChunk.cpp
+++ b/src/tools/mesh_extractor/MapChunk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/MapChunk.h b/src/tools/mesh_extractor/MapChunk.h
index 95bce9ffcd6..97adc790e94 100644
--- a/src/tools/mesh_extractor/MapChunk.h
+++ b/src/tools/mesh_extractor/MapChunk.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/MeshExtractor.cpp b/src/tools/mesh_extractor/MeshExtractor.cpp
index e60e11b1db8..1926734ac72 100644
--- a/src/tools/mesh_extractor/MeshExtractor.cpp
+++ b/src/tools/mesh_extractor/MeshExtractor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/Model.cpp b/src/tools/mesh_extractor/Model.cpp
index 2a1a80f41eb..48c60d9d644 100644
--- a/src/tools/mesh_extractor/Model.cpp
+++ b/src/tools/mesh_extractor/Model.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/Model.h b/src/tools/mesh_extractor/Model.h
index a1f224729dd..8f43b2963ea 100644
--- a/src/tools/mesh_extractor/Model.h
+++ b/src/tools/mesh_extractor/Model.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/ObjectDataHandler.cpp b/src/tools/mesh_extractor/ObjectDataHandler.cpp
index 0e06a9f7e56..d8308fc25d0 100644
--- a/src/tools/mesh_extractor/ObjectDataHandler.cpp
+++ b/src/tools/mesh_extractor/ObjectDataHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/ObjectDataHandler.h b/src/tools/mesh_extractor/ObjectDataHandler.h
index 3b18427db47..dc57301563a 100644
--- a/src/tools/mesh_extractor/ObjectDataHandler.h
+++ b/src/tools/mesh_extractor/ObjectDataHandler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/TileBuilder.cpp b/src/tools/mesh_extractor/TileBuilder.cpp
index 7b70ccca44c..768314e5101 100644
--- a/src/tools/mesh_extractor/TileBuilder.cpp
+++ b/src/tools/mesh_extractor/TileBuilder.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/TileBuilder.h b/src/tools/mesh_extractor/TileBuilder.h
index fb8950c552b..b88966190b0 100644
--- a/src/tools/mesh_extractor/TileBuilder.h
+++ b/src/tools/mesh_extractor/TileBuilder.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/Utils.cpp b/src/tools/mesh_extractor/Utils.cpp
index f82eb6ed1c8..704acf967ee 100644
--- a/src/tools/mesh_extractor/Utils.cpp
+++ b/src/tools/mesh_extractor/Utils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/Utils.h b/src/tools/mesh_extractor/Utils.h
index 612282f3e8f..267a32c27cd 100644
--- a/src/tools/mesh_extractor/Utils.h
+++ b/src/tools/mesh_extractor/Utils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/WDT.cpp b/src/tools/mesh_extractor/WDT.cpp
index 07aec95365e..593127e0d34 100644
--- a/src/tools/mesh_extractor/WDT.cpp
+++ b/src/tools/mesh_extractor/WDT.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/WDT.h b/src/tools/mesh_extractor/WDT.h
index d1e8e30918d..55a1a9861ff 100644
--- a/src/tools/mesh_extractor/WDT.h
+++ b/src/tools/mesh_extractor/WDT.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/WorldModelGroup.cpp b/src/tools/mesh_extractor/WorldModelGroup.cpp
index 6ea72d6edbe..9d32a096592 100644
--- a/src/tools/mesh_extractor/WorldModelGroup.cpp
+++ b/src/tools/mesh_extractor/WorldModelGroup.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/WorldModelGroup.h b/src/tools/mesh_extractor/WorldModelGroup.h
index b3c2c2bd940..cf98dc8768a 100644
--- a/src/tools/mesh_extractor/WorldModelGroup.h
+++ b/src/tools/mesh_extractor/WorldModelGroup.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/WorldModelHandler.cpp b/src/tools/mesh_extractor/WorldModelHandler.cpp
index 7c0acbc38e4..c272496c0a7 100644
--- a/src/tools/mesh_extractor/WorldModelHandler.cpp
+++ b/src/tools/mesh_extractor/WorldModelHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/WorldModelHandler.h b/src/tools/mesh_extractor/WorldModelHandler.h
index dd030e4521f..972dda0f5d8 100644
--- a/src/tools/mesh_extractor/WorldModelHandler.h
+++ b/src/tools/mesh_extractor/WorldModelHandler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/WorldModelRoot.cpp b/src/tools/mesh_extractor/WorldModelRoot.cpp
index 4b6e4e189a4..d9bc4e550b3 100644
--- a/src/tools/mesh_extractor/WorldModelRoot.cpp
+++ b/src/tools/mesh_extractor/WorldModelRoot.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mesh_extractor/WorldModelRoot.h b/src/tools/mesh_extractor/WorldModelRoot.h
index c2303ceafe4..7fbc04d2b6d 100644
--- a/src/tools/mesh_extractor/WorldModelRoot.h
+++ b/src/tools/mesh_extractor/WorldModelRoot.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
*
* 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
diff --git a/src/tools/mmaps_generator/CMakeLists.txt b/src/tools/mmaps_generator/CMakeLists.txt
index b168691c994..591e0cc8e98 100644
--- a/src/tools/mmaps_generator/CMakeLists.txt
+++ b/src/tools/mmaps_generator/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/tools/mmaps_generator/IntermediateValues.cpp b/src/tools/mmaps_generator/IntermediateValues.cpp
index a490273ad80..6c9abf719bb 100644
--- a/src/tools/mmaps_generator/IntermediateValues.cpp
+++ b/src/tools/mmaps_generator/IntermediateValues.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/mmaps_generator/IntermediateValues.h b/src/tools/mmaps_generator/IntermediateValues.h
index 89a5c3ae4c2..5933c0137f1 100644
--- a/src/tools/mmaps_generator/IntermediateValues.h
+++ b/src/tools/mmaps_generator/IntermediateValues.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/mmaps_generator/MapBuilder.cpp b/src/tools/mmaps_generator/MapBuilder.cpp
index 9c2dda51621..805926defa0 100644
--- a/src/tools/mmaps_generator/MapBuilder.cpp
+++ b/src/tools/mmaps_generator/MapBuilder.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/mmaps_generator/MapBuilder.h b/src/tools/mmaps_generator/MapBuilder.h
index 6ab0b312af8..33f45a86549 100644
--- a/src/tools/mmaps_generator/MapBuilder.h
+++ b/src/tools/mmaps_generator/MapBuilder.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/mmaps_generator/PathCommon.h b/src/tools/mmaps_generator/PathCommon.h
index 94a11e01730..a035bea3b6f 100644
--- a/src/tools/mmaps_generator/PathCommon.h
+++ b/src/tools/mmaps_generator/PathCommon.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/mmaps_generator/PathGenerator.cpp b/src/tools/mmaps_generator/PathGenerator.cpp
index 8ccd04f4924..1df24cfa332 100644
--- a/src/tools/mmaps_generator/PathGenerator.cpp
+++ b/src/tools/mmaps_generator/PathGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/mmaps_generator/TerrainBuilder.cpp b/src/tools/mmaps_generator/TerrainBuilder.cpp
index 5c76161c0d6..19112d84266 100644
--- a/src/tools/mmaps_generator/TerrainBuilder.cpp
+++ b/src/tools/mmaps_generator/TerrainBuilder.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/mmaps_generator/TerrainBuilder.h b/src/tools/mmaps_generator/TerrainBuilder.h
index e9ff2a3c175..6ed88ff985f 100644
--- a/src/tools/mmaps_generator/TerrainBuilder.h
+++ b/src/tools/mmaps_generator/TerrainBuilder.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/mmaps_generator/VMapExtensions.cpp b/src/tools/mmaps_generator/VMapExtensions.cpp
index 08929e5259d..d9437f8bdee 100644
--- a/src/tools/mmaps_generator/VMapExtensions.cpp
+++ b/src/tools/mmaps_generator/VMapExtensions.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_assembler/CMakeLists.txt b/src/tools/vmap4_assembler/CMakeLists.txt
index 8d455eae6ee..33e8188aee1 100644
--- a/src/tools/vmap4_assembler/CMakeLists.txt
+++ b/src/tools/vmap4_assembler/CMakeLists.txt
@@ -1,5 +1,5 @@
# Copyright (C) 2005-2009 MaNGOS project <http://getmangos.com/>
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/tools/vmap4_assembler/VMapAssembler.cpp b/src/tools/vmap4_assembler/VMapAssembler.cpp
index 56368e4a78d..445d5b791d1 100644
--- a/src/tools/vmap4_assembler/VMapAssembler.cpp
+++ b/src/tools/vmap4_assembler/VMapAssembler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/CMakeLists.txt b/src/tools/vmap4_extractor/CMakeLists.txt
index 023f5447f85..90d2c68977f 100644
--- a/src/tools/vmap4_extractor/CMakeLists.txt
+++ b/src/tools/vmap4_extractor/CMakeLists.txt
@@ -1,5 +1,5 @@
# Copyright (C) 2005-2009 MaNGOS project <http://getmangos.com/>
-# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/tools/vmap4_extractor/adtfile.cpp b/src/tools/vmap4_extractor/adtfile.cpp
index 82f26afbdc2..246b448380a 100644
--- a/src/tools/vmap4_extractor/adtfile.cpp
+++ b/src/tools/vmap4_extractor/adtfile.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/adtfile.h b/src/tools/vmap4_extractor/adtfile.h
index 88693659e52..aafcb46ce84 100644
--- a/src/tools/vmap4_extractor/adtfile.h
+++ b/src/tools/vmap4_extractor/adtfile.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/dbcfile.cpp b/src/tools/vmap4_extractor/dbcfile.cpp
index c96174bae59..66c5669b88b 100644
--- a/src/tools/vmap4_extractor/dbcfile.cpp
+++ b/src/tools/vmap4_extractor/dbcfile.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/dbcfile.h b/src/tools/vmap4_extractor/dbcfile.h
index 0e58c942919..7551de8594c 100644
--- a/src/tools/vmap4_extractor/dbcfile.h
+++ b/src/tools/vmap4_extractor/dbcfile.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/gameobject_extract.cpp b/src/tools/vmap4_extractor/gameobject_extract.cpp
index 73bd2f77d18..59871012ea5 100644
--- a/src/tools/vmap4_extractor/gameobject_extract.cpp
+++ b/src/tools/vmap4_extractor/gameobject_extract.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/loadlib/loadlib.h b/src/tools/vmap4_extractor/loadlib/loadlib.h
index 2d95cfb3bd1..1b44d13a9d3 100644
--- a/src/tools/vmap4_extractor/loadlib/loadlib.h
+++ b/src/tools/vmap4_extractor/loadlib/loadlib.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/model.cpp b/src/tools/vmap4_extractor/model.cpp
index 2a8417bafc1..825a2697c16 100644
--- a/src/tools/vmap4_extractor/model.cpp
+++ b/src/tools/vmap4_extractor/model.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/model.h b/src/tools/vmap4_extractor/model.h
index 66e42bd7947..a1766ed0bb2 100644
--- a/src/tools/vmap4_extractor/model.h
+++ b/src/tools/vmap4_extractor/model.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/modelheaders.h b/src/tools/vmap4_extractor/modelheaders.h
index e0a6c46ca17..b0d729dd238 100644
--- a/src/tools/vmap4_extractor/modelheaders.h
+++ b/src/tools/vmap4_extractor/modelheaders.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/mpq_libmpq.cpp b/src/tools/vmap4_extractor/mpq_libmpq.cpp
index b06470d3c80..265ae99528f 100644
--- a/src/tools/vmap4_extractor/mpq_libmpq.cpp
+++ b/src/tools/vmap4_extractor/mpq_libmpq.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/mpq_libmpq04.h b/src/tools/vmap4_extractor/mpq_libmpq04.h
index 87321912135..d045abe307a 100644
--- a/src/tools/vmap4_extractor/mpq_libmpq04.h
+++ b/src/tools/vmap4_extractor/mpq_libmpq04.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/vec3d.h b/src/tools/vmap4_extractor/vec3d.h
index 59150229ac7..b53b1003483 100644
--- a/src/tools/vmap4_extractor/vec3d.h
+++ b/src/tools/vmap4_extractor/vec3d.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp
index a5173638df4..b28ed84e105 100644
--- a/src/tools/vmap4_extractor/vmapexport.cpp
+++ b/src/tools/vmap4_extractor/vmapexport.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/vmapexport.h b/src/tools/vmap4_extractor/vmapexport.h
index e9436eb7d0d..e51938ea923 100644
--- a/src/tools/vmap4_extractor/vmapexport.h
+++ b/src/tools/vmap4_extractor/vmapexport.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/wdtfile.cpp b/src/tools/vmap4_extractor/wdtfile.cpp
index 87e63f201e6..20bee313e70 100644
--- a/src/tools/vmap4_extractor/wdtfile.cpp
+++ b/src/tools/vmap4_extractor/wdtfile.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/wdtfile.h b/src/tools/vmap4_extractor/wdtfile.h
index af0979e981b..8545fd67560 100644
--- a/src/tools/vmap4_extractor/wdtfile.h
+++ b/src/tools/vmap4_extractor/wdtfile.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/wmo.cpp b/src/tools/vmap4_extractor/wmo.cpp
index e4e66c682b3..8efdb899cab 100644
--- a/src/tools/vmap4_extractor/wmo.cpp
+++ b/src/tools/vmap4_extractor/wmo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/tools/vmap4_extractor/wmo.h b/src/tools/vmap4_extractor/wmo.h
index 493c84f422f..0f1f0772bd3 100644
--- a/src/tools/vmap4_extractor/wmo.h
+++ b/src/tools/vmap4_extractor/wmo.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it