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
-rwxr-xr-xsrc/server/authserver/Authentication/AuthCodes.h2
-rw-r--r--src/server/authserver/CMakeLists.txt2
-rwxr-xr-xsrc/server/authserver/Main.cpp2
-rwxr-xr-xsrc/server/authserver/Realms/RealmList.cpp4
-rwxr-xr-xsrc/server/authserver/Realms/RealmList.h2
-rwxr-xr-xsrc/server/authserver/Server/AuthSocket.cpp67
-rwxr-xr-xsrc/server/authserver/Server/AuthSocket.h2
-rwxr-xr-xsrc/server/authserver/Server/RealmAcceptor.h2
-rwxr-xr-xsrc/server/authserver/Server/RealmSocket.cpp16
-rwxr-xr-xsrc/server/authserver/Server/RealmSocket.h9
-rwxr-xr-xsrc/server/authserver/authserver.rc2
-rwxr-xr-xsrc/server/collision/BoundingIntervalHierarchy.cpp2
-rwxr-xr-xsrc/server/collision/BoundingIntervalHierarchy.h2
-rw-r--r--src/server/collision/CMakeLists.txt2
-rwxr-xr-xsrc/server/collision/Management/IVMapManager.h2
-rwxr-xr-xsrc/server/collision/Management/VMapFactory.cpp2
-rwxr-xr-xsrc/server/collision/Management/VMapFactory.h2
-rw-r--r--src/server/collision/Management/VMapManager2.cpp2
-rwxr-xr-xsrc/server/collision/Management/VMapManager2.h2
-rw-r--r--src/server/collision/Maps/MapTree.cpp2
-rwxr-xr-xsrc/server/collision/Maps/MapTree.h2
-rw-r--r--src/server/collision/Maps/TileAssembler.cpp2
-rwxr-xr-xsrc/server/collision/Maps/TileAssembler.h2
-rw-r--r--src/server/collision/Models/ModelInstance.cpp2
-rwxr-xr-xsrc/server/collision/Models/ModelInstance.h2
-rw-r--r--src/server/collision/Models/WorldModel.cpp2
-rwxr-xr-xsrc/server/collision/Models/WorldModel.h2
-rw-r--r--src/server/collision/VMapDefinitions.h2
-rwxr-xr-xsrc/server/collision/VMapTools.h2
-rwxr-xr-xsrc/server/game/AI/CoreAI/CombatAI.cpp12
-rwxr-xr-xsrc/server/game/AI/CoreAI/CombatAI.h2
-rw-r--r--src/server/game/AI/CoreAI/GameObjectAI.cpp2
-rw-r--r--src/server/game/AI/CoreAI/GameObjectAI.h3
-rwxr-xr-xsrc/server/game/AI/CoreAI/GuardAI.cpp6
-rwxr-xr-xsrc/server/game/AI/CoreAI/GuardAI.h2
-rwxr-xr-xsrc/server/game/AI/CoreAI/PassiveAI.cpp10
-rwxr-xr-xsrc/server/game/AI/CoreAI/PassiveAI.h2
-rwxr-xr-xsrc/server/game/AI/CoreAI/PetAI.cpp44
-rwxr-xr-xsrc/server/game/AI/CoreAI/PetAI.h4
-rwxr-xr-xsrc/server/game/AI/CoreAI/ReactorAI.cpp2
-rwxr-xr-xsrc/server/game/AI/CoreAI/ReactorAI.h2
-rwxr-xr-xsrc/server/game/AI/CoreAI/TotemAI.cpp2
-rwxr-xr-xsrc/server/game/AI/CoreAI/TotemAI.h2
-rwxr-xr-xsrc/server/game/AI/CoreAI/UnitAI.cpp6
-rwxr-xr-xsrc/server/game/AI/CoreAI/UnitAI.h2
-rwxr-xr-xsrc/server/game/AI/CreatureAI.cpp2
-rwxr-xr-xsrc/server/game/AI/CreatureAI.h2
-rwxr-xr-xsrc/server/game/AI/CreatureAIFactory.h2
-rwxr-xr-xsrc/server/game/AI/CreatureAIImpl.h6
-rwxr-xr-xsrc/server/game/AI/CreatureAIRegistry.cpp2
-rwxr-xr-xsrc/server/game/AI/CreatureAIRegistry.h2
-rwxr-xr-xsrc/server/game/AI/CreatureAISelector.cpp2
-rwxr-xr-xsrc/server/game/AI/CreatureAISelector.h2
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAI.cpp11
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAI.h2
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAIMgr.cpp2
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAIMgr.h2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.cpp9
-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/ScriptedFollowerAI.cpp18
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedGossip.h2
-rwxr-xr-xsrc/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp2
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp29
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.h8
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp323
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.h4
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp17
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h26
-rwxr-xr-xsrc/server/game/Accounts/AccountMgr.cpp10
-rwxr-xr-xsrc/server/game/Accounts/AccountMgr.h2
-rwxr-xr-xsrc/server/game/Achievements/AchievementMgr.cpp39
-rwxr-xr-xsrc/server/game/Achievements/AchievementMgr.h6
-rwxr-xr-xsrc/server/game/Addons/AddonMgr.cpp4
-rwxr-xr-xsrc/server/game/Addons/AddonMgr.h2
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseMgr.cpp12
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseMgr.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/ArenaTeam.cpp30
-rwxr-xr-xsrc/server/game/Battlegrounds/ArenaTeam.h4
-rw-r--r--src/server/game/Battlegrounds/ArenaTeamMgr.cpp2
-rw-r--r--src/server/game/Battlegrounds/ArenaTeamMgr.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/Battleground.cpp24
-rwxr-xr-xsrc/server/game/Battlegrounds/Battleground.h6
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundMgr.cpp2
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundMgr.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundQueue.cpp4
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundQueue.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAA.cpp2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAA.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAB.cpp16
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAB.h12
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAV.cpp5
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAV.h4
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundBE.cpp2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundBE.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundDS.cpp2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundDS.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundEY.cpp10
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundEY.h8
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundIC.cpp8
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundIC.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundNA.cpp2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundNA.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundRB.cpp2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundRB.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundRL.cpp2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundRL.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundRV.cpp2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundRV.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundSA.cpp4
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundSA.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundWS.cpp2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundWS.h2
-rw-r--r--src/server/game/CMakeLists.txt10
-rwxr-xr-xsrc/server/game/Calendar/Calendar.cpp2
-rwxr-xr-xsrc/server/game/Calendar/Calendar.h2
-rwxr-xr-xsrc/server/game/Chat/Channels/Channel.cpp10
-rwxr-xr-xsrc/server/game/Chat/Channels/Channel.h2
-rwxr-xr-xsrc/server/game/Chat/Channels/ChannelMgr.cpp2
-rwxr-xr-xsrc/server/game/Chat/Channels/ChannelMgr.h2
-rwxr-xr-xsrc/server/game/Chat/Chat.cpp10
-rwxr-xr-xsrc/server/game/Chat/Chat.h2
-rw-r--r--src/server/game/Chat/ChatLink.cpp2
-rw-r--r--src/server/game/Chat/ChatLink.h2
-rwxr-xr-xsrc/server/game/Chat/Commands/Level0.cpp2
-rwxr-xr-xsrc/server/game/Chat/Commands/Level1.cpp2
-rwxr-xr-xsrc/server/game/Chat/Commands/Level2.cpp47
-rwxr-xr-xsrc/server/game/Chat/Commands/Level3.cpp85
-rwxr-xr-xsrc/server/game/Chat/Commands/TicketCommands.cpp2
-rwxr-xr-xsrc/server/game/Combat/HostileRefManager.cpp2
-rwxr-xr-xsrc/server/game/Combat/HostileRefManager.h2
-rwxr-xr-xsrc/server/game/Combat/ThreatManager.cpp4
-rwxr-xr-xsrc/server/game/Combat/ThreatManager.h2
-rwxr-xr-xsrc/server/game/Combat/UnitEvents.h2
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.cpp229
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.h32
-rwxr-xr-xsrc/server/game/Conditions/DisableMgr.cpp2
-rwxr-xr-xsrc/server/game/Conditions/DisableMgr.h2
-rwxr-xr-xsrc/server/game/DataStores/DBCEnums.h2
-rwxr-xr-xsrc/server/game/DataStores/DBCStores.cpp7
-rwxr-xr-xsrc/server/game/DataStores/DBCStores.h2
-rwxr-xr-xsrc/server/game/DataStores/DBCStructure.h2
-rwxr-xr-xsrc/server/game/DataStores/DBCfmt.h2
-rwxr-xr-xsrc/server/game/DungeonFinding/LFG.h2
-rw-r--r--src/server/game/DungeonFinding/LFGGroupData.cpp2
-rw-r--r--src/server/game/DungeonFinding/LFGGroupData.h2
-rwxr-xr-xsrc/server/game/DungeonFinding/LFGMgr.cpp121
-rwxr-xr-xsrc/server/game/DungeonFinding/LFGMgr.h10
-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/LFGScripts.cpp2
-rw-r--r--src/server/game/DungeonFinding/LFGScripts.h2
-rwxr-xr-xsrc/server/game/Entities/Corpse/Corpse.cpp4
-rwxr-xr-xsrc/server/game/Entities/Corpse/Corpse.h2
-rwxr-xr-xsrc/server/game/Entities/Creature/Creature.cpp106
-rwxr-xr-xsrc/server/game/Entities/Creature/Creature.h8
-rwxr-xr-xsrc/server/game/Entities/Creature/CreatureGroups.cpp8
-rwxr-xr-xsrc/server/game/Entities/Creature/CreatureGroups.h2
-rwxr-xr-xsrc/server/game/Entities/Creature/GossipDef.cpp2
-rwxr-xr-xsrc/server/game/Entities/Creature/GossipDef.h2
-rwxr-xr-xsrc/server/game/Entities/Creature/TemporarySummon.cpp2
-rwxr-xr-xsrc/server/game/Entities/Creature/TemporarySummon.h2
-rwxr-xr-xsrc/server/game/Entities/DynamicObject/DynamicObject.cpp2
-rwxr-xr-xsrc/server/game/Entities/DynamicObject/DynamicObject.h2
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.cpp16
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.h7
-rwxr-xr-xsrc/server/game/Entities/Item/Container/Bag.cpp2
-rwxr-xr-xsrc/server/game/Entities/Item/Container/Bag.h2
-rwxr-xr-xsrc/server/game/Entities/Item/Item.cpp31
-rwxr-xr-xsrc/server/game/Entities/Item/Item.h2
-rwxr-xr-xsrc/server/game/Entities/Item/ItemEnchantmentMgr.cpp2
-rwxr-xr-xsrc/server/game/Entities/Item/ItemEnchantmentMgr.h2
-rwxr-xr-xsrc/server/game/Entities/Item/ItemPrototype.h2
-rwxr-xr-xsrc/server/game/Entities/Object/Object.cpp154
-rwxr-xr-xsrc/server/game/Entities/Object/Object.h5
-rwxr-xr-xsrc/server/game/Entities/Object/ObjectDefines.h2
-rwxr-xr-xsrc/server/game/Entities/Object/ObjectPosSelector.cpp2
-rwxr-xr-xsrc/server/game/Entities/Object/ObjectPosSelector.h2
-rwxr-xr-xsrc/server/game/Entities/Object/Updates/UpdateData.cpp2
-rwxr-xr-xsrc/server/game/Entities/Object/Updates/UpdateData.h2
-rwxr-xr-xsrc/server/game/Entities/Object/Updates/UpdateFields.h2
-rwxr-xr-xsrc/server/game/Entities/Object/Updates/UpdateMask.h2
-rwxr-xr-xsrc/server/game/Entities/Pet/Pet.cpp10
-rwxr-xr-xsrc/server/game/Entities/Pet/Pet.h2
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp543
-rwxr-xr-xsrc/server/game/Entities/Player/Player.h29
-rwxr-xr-xsrc/server/game/Entities/Player/SocialMgr.cpp66
-rwxr-xr-xsrc/server/game/Entities/Player/SocialMgr.h4
-rwxr-xr-xsrc/server/game/Entities/Totem/Totem.cpp2
-rwxr-xr-xsrc/server/game/Entities/Totem/Totem.h2
-rwxr-xr-xsrc/server/game/Entities/Transport/Transport.cpp2
-rwxr-xr-xsrc/server/game/Entities/Transport/Transport.h2
-rwxr-xr-xsrc/server/game/Entities/Unit/StatSystem.cpp2
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp650
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.h229
-rwxr-xr-xsrc/server/game/Entities/Vehicle/Vehicle.cpp10
-rwxr-xr-xsrc/server/game/Entities/Vehicle/Vehicle.h2
-rw-r--r--src/server/game/Entities/Vehicle/VehicleDefines.h2
-rwxr-xr-xsrc/server/game/Events/GameEventMgr.cpp66
-rwxr-xr-xsrc/server/game/Events/GameEventMgr.h5
-rwxr-xr-xsrc/server/game/Globals/ObjectAccessor.cpp2
-rwxr-xr-xsrc/server/game/Globals/ObjectAccessor.h2
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.cpp114
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.h13
-rwxr-xr-xsrc/server/game/Grids/Cells/Cell.h2
-rw-r--r--src/server/game/Grids/Cells/CellImpl.h2
-rwxr-xr-xsrc/server/game/Grids/Grid.h2
-rw-r--r--src/server/game/Grids/GridDefines.h2
-rwxr-xr-xsrc/server/game/Grids/GridLoader.h2
-rwxr-xr-xsrc/server/game/Grids/GridRefManager.h2
-rwxr-xr-xsrc/server/game/Grids/GridReference.h2
-rwxr-xr-xsrc/server/game/Grids/GridStates.cpp2
-rwxr-xr-xsrc/server/game/Grids/GridStates.h2
-rwxr-xr-xsrc/server/game/Grids/NGrid.h2
-rwxr-xr-xsrc/server/game/Grids/Notifiers/GridNotifiers.cpp4
-rwxr-xr-xsrc/server/game/Grids/Notifiers/GridNotifiers.h4
-rwxr-xr-xsrc/server/game/Grids/Notifiers/GridNotifiersImpl.h2
-rwxr-xr-xsrc/server/game/Grids/ObjectGridLoader.cpp2
-rwxr-xr-xsrc/server/game/Grids/ObjectGridLoader.h2
-rwxr-xr-xsrc/server/game/Groups/Group.cpp152
-rwxr-xr-xsrc/server/game/Groups/Group.h5
-rw-r--r--src/server/game/Groups/GroupMgr.cpp10
-rw-r--r--src/server/game/Groups/GroupMgr.h2
-rwxr-xr-xsrc/server/game/Groups/GroupRefManager.h2
-rwxr-xr-xsrc/server/game/Groups/GroupReference.cpp6
-rwxr-xr-xsrc/server/game/Groups/GroupReference.h2
-rwxr-xr-xsrc/server/game/Guilds/Guild.cpp60
-rwxr-xr-xsrc/server/game/Guilds/Guild.h2
-rw-r--r--src/server/game/Guilds/GuildMgr.cpp2
-rw-r--r--src/server/game/Guilds/GuildMgr.h2
-rwxr-xr-xsrc/server/game/Handlers/AddonHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/AddonHandler.cpp)2
-rwxr-xr-xsrc/server/game/Handlers/AddonHandler.h (renamed from src/server/game/Server/Protocol/Handlers/AddonHandler.h)2
-rwxr-xr-xsrc/server/game/Handlers/ArenaTeamHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp)2
-rwxr-xr-xsrc/server/game/Handlers/AuctionHouseHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp)32
-rwxr-xr-xsrc/server/game/Handlers/AuthHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/AuthHandler.cpp)2
-rwxr-xr-xsrc/server/game/Handlers/BattleGroundHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp)2
-rwxr-xr-xsrc/server/game/Handlers/CalendarHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp)2
-rwxr-xr-xsrc/server/game/Handlers/ChannelHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp)2
-rw-r--r--[-rwxr-xr-x]src/server/game/Handlers/CharacterHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp)168
-rwxr-xr-xsrc/server/game/Handlers/ChatHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/ChatHandler.cpp)6
-rwxr-xr-xsrc/server/game/Handlers/CombatHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/CombatHandler.cpp)2
-rwxr-xr-xsrc/server/game/Handlers/DuelHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/DuelHandler.cpp)2
-rwxr-xr-xsrc/server/game/Handlers/GroupHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/GroupHandler.cpp)2
-rwxr-xr-xsrc/server/game/Handlers/GuildHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/GuildHandler.cpp)4
-rwxr-xr-xsrc/server/game/Handlers/ItemHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/ItemHandler.cpp)10
-rwxr-xr-xsrc/server/game/Handlers/LFGHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/LFGHandler.cpp)5
-rwxr-xr-xsrc/server/game/Handlers/LootHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/LootHandler.cpp)4
-rwxr-xr-xsrc/server/game/Handlers/MailHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/MailHandler.cpp)2
-rwxr-xr-xsrc/server/game/Handlers/MiscHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/MiscHandler.cpp)18
-rwxr-xr-xsrc/server/game/Handlers/MovementHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/MovementHandler.cpp)18
-rwxr-xr-xsrc/server/game/Handlers/NPCHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/NPCHandler.cpp)40
-rwxr-xr-xsrc/server/game/Handlers/NPCHandler.h (renamed from src/server/game/Server/Protocol/Handlers/NPCHandler.h)2
-rwxr-xr-xsrc/server/game/Handlers/PetHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/PetHandler.cpp)7
-rwxr-xr-xsrc/server/game/Handlers/PetitionsHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp)10
-rwxr-xr-xsrc/server/game/Handlers/QueryHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/QueryHandler.cpp)2
-rwxr-xr-xsrc/server/game/Handlers/QuestHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/QuestHandler.cpp)4
-rw-r--r--src/server/game/Handlers/ReferAFriendHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/ReferAFriendHandler.cpp)0
-rwxr-xr-xsrc/server/game/Handlers/SkillHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/SkillHandler.cpp)4
-rwxr-xr-xsrc/server/game/Handlers/SpellHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/SpellHandler.cpp)2
-rwxr-xr-xsrc/server/game/Handlers/TaxiHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp)7
-rwxr-xr-xsrc/server/game/Handlers/TicketHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/TicketHandler.cpp)8
-rwxr-xr-xsrc/server/game/Handlers/TradeHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/TradeHandler.cpp)6
-rw-r--r--src/server/game/Handlers/VehicleHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/VehicleHandler.cpp)2
-rwxr-xr-xsrc/server/game/Handlers/VoiceChatHandler.cpp (renamed from src/server/game/Server/Protocol/Handlers/VoiceChatHandler.cpp)2
-rwxr-xr-xsrc/server/game/Instances/InstanceSaveMgr.cpp16
-rwxr-xr-xsrc/server/game/Instances/InstanceSaveMgr.h2
-rwxr-xr-xsrc/server/game/Instances/InstanceScript.cpp22
-rwxr-xr-xsrc/server/game/Instances/InstanceScript.h2
-rwxr-xr-xsrc/server/game/Loot/LootMgr.cpp2
-rwxr-xr-xsrc/server/game/Loot/LootMgr.h2
-rwxr-xr-xsrc/server/game/Mails/Mail.cpp8
-rwxr-xr-xsrc/server/game/Mails/Mail.h2
-rwxr-xr-xsrc/server/game/Maps/Map.cpp20
-rwxr-xr-xsrc/server/game/Maps/Map.h4
-rwxr-xr-xsrc/server/game/Maps/MapInstanced.cpp14
-rwxr-xr-xsrc/server/game/Maps/MapInstanced.h2
-rwxr-xr-xsrc/server/game/Maps/MapManager.cpp3
-rwxr-xr-xsrc/server/game/Maps/MapManager.h2
-rwxr-xr-xsrc/server/game/Maps/MapRefManager.h2
-rwxr-xr-xsrc/server/game/Maps/MapReference.h2
-rwxr-xr-xsrc/server/game/Maps/ZoneScript.h4
-rwxr-xr-xsrc/server/game/Miscellaneous/Formulas.h2
-rwxr-xr-xsrc/server/game/Miscellaneous/Language.h14
-rwxr-xr-xsrc/server/game/Miscellaneous/SharedDefines.h1097
-rwxr-xr-xsrc/server/game/Movement/DestinationHolder.cpp20
-rwxr-xr-xsrc/server/game/Movement/DestinationHolder.h65
-rwxr-xr-xsrc/server/game/Movement/DestinationHolderImp.h215
-rwxr-xr-xsrc/server/game/Movement/FollowerRefManager.h2
-rwxr-xr-xsrc/server/game/Movement/FollowerReference.cpp2
-rwxr-xr-xsrc/server/game/Movement/FollowerReference.h2
-rwxr-xr-xsrc/server/game/Movement/MotionMaster.cpp172
-rwxr-xr-xsrc/server/game/Movement/MotionMaster.h19
-rwxr-xr-xsrc/server/game/Movement/MovementGenerator.cpp3
-rwxr-xr-xsrc/server/game/Movement/MovementGenerator.h4
-rwxr-xr-xsrc/server/game/Movement/MovementGeneratorImpl.h2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp129
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h15
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp131
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h9
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp65
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/HomeMovementGenerator.h14
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp16
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/IdleMovementGenerator.h2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp107
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/PointMovementGenerator.h32
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp192
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/RandomMovementGenerator.h14
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp372
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h93
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp421
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h92
-rw-r--r--src/server/game/Movement/Spline/MoveSpline.cpp316
-rw-r--r--src/server/game/Movement/Spline/MoveSpline.h127
-rw-r--r--src/server/game/Movement/Spline/MoveSplineFlag.h143
-rw-r--r--src/server/game/Movement/Spline/MoveSplineInit.cpp118
-rw-r--r--src/server/game/Movement/Spline/MoveSplineInit.h170
-rw-r--r--src/server/game/Movement/Spline/MoveSplineInitArgs.h67
-rw-r--r--src/server/game/Movement/Spline/MovementPacketBuilder.cpp188
-rw-r--r--src/server/game/Movement/Spline/MovementPacketBuilder.h37
-rw-r--r--src/server/game/Movement/Spline/MovementTypedefs.h81
-rw-r--r--src/server/game/Movement/Spline/MovementUtil.cpp208
-rw-r--r--src/server/game/Movement/Spline/Spline.cpp307
-rw-r--r--src/server/game/Movement/Spline/Spline.h212
-rw-r--r--src/server/game/Movement/Spline/SplineImpl.h97
-rwxr-xr-xsrc/server/game/Movement/Traveller.h152
-rwxr-xr-xsrc/server/game/Movement/Waypoints/Path.h2
-rwxr-xr-xsrc/server/game/Movement/Waypoints/WaypointManager.cpp2
-rwxr-xr-xsrc/server/game/Movement/Waypoints/WaypointManager.h2
-rwxr-xr-xsrc/server/game/OutdoorPvP/OutdoorPvP.cpp2
-rwxr-xr-xsrc/server/game/OutdoorPvP/OutdoorPvP.h2
-rwxr-xr-xsrc/server/game/OutdoorPvP/OutdoorPvPMgr.cpp2
-rwxr-xr-xsrc/server/game/OutdoorPvP/OutdoorPvPMgr.h2
-rwxr-xr-xsrc/server/game/Pools/PoolMgr.cpp6
-rwxr-xr-xsrc/server/game/Pools/PoolMgr.h2
-rwxr-xr-xsrc/server/game/Quests/QuestDef.cpp8
-rwxr-xr-xsrc/server/game/Quests/QuestDef.h3
-rwxr-xr-xsrc/server/game/Reputation/ReputationMgr.cpp2
-rwxr-xr-xsrc/server/game/Reputation/ReputationMgr.h2
-rwxr-xr-xsrc/server/game/Scripting/MapScripts.cpp12
-rwxr-xr-xsrc/server/game/Scripting/ScriptLoader.cpp6
-rwxr-xr-xsrc/server/game/Scripting/ScriptMgr.cpp2
-rwxr-xr-xsrc/server/game/Scripting/ScriptMgr.h2
-rwxr-xr-xsrc/server/game/Scripting/ScriptSystem.cpp2
-rwxr-xr-xsrc/server/game/Server/Protocol/Opcodes.cpp2
-rwxr-xr-xsrc/server/game/Server/Protocol/Opcodes.h2
-rwxr-xr-xsrc/server/game/Server/Protocol/WorldLog.cpp2
-rwxr-xr-xsrc/server/game/Server/Protocol/WorldLog.h2
-rwxr-xr-xsrc/server/game/Server/WorldSession.cpp20
-rwxr-xr-xsrc/server/game/Server/WorldSession.h3
-rwxr-xr-xsrc/server/game/Server/WorldSocket.cpp6
-rwxr-xr-xsrc/server/game/Server/WorldSocket.h2
-rw-r--r--src/server/game/Server/WorldSocketAcceptor.h2
-rwxr-xr-xsrc/server/game/Server/WorldSocketMgr.cpp2
-rwxr-xr-xsrc/server/game/Server/WorldSocketMgr.h2
-rwxr-xr-xsrc/server/game/Skills/SkillDiscovery.cpp2
-rwxr-xr-xsrc/server/game/Skills/SkillDiscovery.h2
-rwxr-xr-xsrc/server/game/Skills/SkillExtraItems.cpp2
-rwxr-xr-xsrc/server/game/Skills/SkillExtraItems.h2
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraDefines.h2
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp48
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h2
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuras.cpp64
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuras.h7
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp118
-rwxr-xr-xsrc/server/game/Spells/Spell.h7
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp116
-rw-r--r--src/server/game/Spells/SpellInfo.cpp27
-rw-r--r--src/server/game/Spells/SpellInfo.h8
-rwxr-xr-xsrc/server/game/Spells/SpellMgr.cpp33
-rwxr-xr-xsrc/server/game/Spells/SpellMgr.h2
-rwxr-xr-xsrc/server/game/Spells/SpellScript.cpp35
-rwxr-xr-xsrc/server/game/Spells/SpellScript.h67
-rwxr-xr-xsrc/server/game/Texts/CreatureTextMgr.cpp4
-rwxr-xr-xsrc/server/game/Texts/CreatureTextMgr.h2
-rwxr-xr-xsrc/server/game/Tickets/TicketMgr.cpp6
-rwxr-xr-xsrc/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
-rwxr-xr-xsrc/server/game/Tools/PlayerDump.h2
-rwxr-xr-xsrc/server/game/Weather/Weather.cpp2
-rwxr-xr-xsrc/server/game/Weather/Weather.h2
-rwxr-xr-xsrc/server/game/Weather/WeatherMgr.cpp2
-rwxr-xr-xsrc/server/game/Weather/WeatherMgr.h2
-rwxr-xr-xsrc/server/game/World/World.cpp90
-rwxr-xr-xsrc/server/game/World/World.h3
-rw-r--r--src/server/scripts/CMakeLists.txt6
-rw-r--r--src/server/scripts/Commands/cs_account.cpp44
-rw-r--r--src/server/scripts/Commands/cs_achievement.cpp2
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp2
-rw-r--r--src/server/scripts/Commands/cs_event.cpp2
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp5
-rw-r--r--src/server/scripts/Commands/cs_go.cpp2
-rw-r--r--src/server/scripts/Commands/cs_gobject.cpp4
-rw-r--r--src/server/scripts/Commands/cs_gps.cpp2
-rw-r--r--src/server/scripts/Commands/cs_honor.cpp2
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp2
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp2
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp2
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp111
-rw-r--r--src/server/scripts/Commands/cs_quest.cpp2
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp229
-rw-r--r--src/server/scripts/Commands/cs_tele.cpp2
-rw-r--r--src/server/scripts/Commands/cs_titles.cpp2
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp200
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp11
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp22
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp25
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp32
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp9
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp19
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp93
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp27
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp73
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp84
-rw-r--r--src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp2
-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.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp2
-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.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/karazhan.h2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h2
-rw-r--r--src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp24
-rw-r--r--src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp12
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp26
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp14
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp27
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp17
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp164
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp51
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp24
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp17
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp190
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp32
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp26
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h21
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp2
-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.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/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.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp2
-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.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp14
-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/Uldaman/boss_archaedas.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp2
-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.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/zulaman.h2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp2
-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.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h2
-rw-r--r--src/server/scripts/EasternKingdoms/alterac_mountains.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/arathi_highlands.cpp42
-rw-r--r--src/server/scripts/EasternKingdoms/blasted_lands.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/boss_kruul.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/burning_steppes.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/duskwood.cpp18
-rw-r--r--src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/eversong_woods.cpp18
-rw-r--r--src/server/scripts/EasternKingdoms/ghostlands.cpp42
-rw-r--r--src/server/scripts/EasternKingdoms/hinterlands.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ironforge.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/loch_modan.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/redridge_mountains.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/searing_gorge.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/silvermoon_city.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/silverpine_forest.cpp73
-rw-r--r--src/server/scripts/EasternKingdoms/stormwind_city.cpp76
-rw-r--r--src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/tirisfal_glades.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/undercity.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/western_plaguelands.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/westfall.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/wetlands.cpp2
-rw-r--r--src/server/scripts/Examples/example_commandscript.cpp2
-rw-r--r--src/server/scripts/Examples/example_creature.cpp2
-rw-r--r--src/server/scripts/Examples/example_escort.cpp2
-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.cpp40
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp49
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h2
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp17
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp17
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp27
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp165
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp4
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp56
-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.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.h2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp2
-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.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h2
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp23
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp23
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp25
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp32
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp2
-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/RazorfenDowns/boss_amnennar_the_coldbringer.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h2
-rw-r--r--src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h2
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp4
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp4
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp4
-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.cpp2
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp2
-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.cpp2
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp4
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp12
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp2
-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.cpp6
-rw-r--r--src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h2
-rw-r--r--src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp2
-rw-r--r--src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp2
-rw-r--r--src/server/scripts/Kalimdor/ashenvale.cpp48
-rw-r--r--src/server/scripts/Kalimdor/azshara.cpp2
-rw-r--r--src/server/scripts/Kalimdor/azuremyst_isle.cpp2
-rw-r--r--src/server/scripts/Kalimdor/bloodmyst_isle.cpp2
-rw-r--r--src/server/scripts/Kalimdor/boss_azuregos.cpp2
-rw-r--r--src/server/scripts/Kalimdor/darkshore.cpp2
-rw-r--r--src/server/scripts/Kalimdor/desolace.cpp2
-rw-r--r--src/server/scripts/Kalimdor/durotar.cpp4
-rw-r--r--src/server/scripts/Kalimdor/dustwallow_marsh.cpp8
-rw-r--r--src/server/scripts/Kalimdor/felwood.cpp2
-rw-r--r--src/server/scripts/Kalimdor/feralas.cpp2
-rw-r--r--src/server/scripts/Kalimdor/moonglade.cpp148
-rw-r--r--src/server/scripts/Kalimdor/mulgore.cpp4
-rw-r--r--src/server/scripts/Kalimdor/orgrimmar.cpp2
-rw-r--r--src/server/scripts/Kalimdor/silithus.cpp2
-rw-r--r--src/server/scripts/Kalimdor/stonetalon_mountains.cpp4
-rw-r--r--src/server/scripts/Kalimdor/tanaris.cpp4
-rw-r--r--src/server/scripts/Kalimdor/teldrassil.cpp2
-rw-r--r--src/server/scripts/Kalimdor/the_barrens.cpp4
-rw-r--r--src/server/scripts/Kalimdor/thousand_needles.cpp2
-rw-r--r--src/server/scripts/Kalimdor/thunder_bluff.cpp2
-rw-r--r--src/server/scripts/Kalimdor/ungoro_crater.cpp2
-rw-r--r--src/server/scripts/Kalimdor/winterspring.cpp2
-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.cpp2
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp8
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp2
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp6
-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.cpp4
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp2
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp2
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp2
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp2
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp2
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h2
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp6
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp8
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp4
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp6
-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.cpp2
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp14
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp14
-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.cpp2
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h2
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp123
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp6
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp2
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp156
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp8
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp2
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp14
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp2
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp10
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp2
-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.cpp2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp20
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp6
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp18
-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.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp12
-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.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp2
-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.cpp6
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h2
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp16
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_eck.cpp2
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp10
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp2
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp2
-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.cpp32
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp4
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp16
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp6
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp10
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp5
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp39
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp6
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp22
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp59
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp14
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp26
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h2
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp2
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp8
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp4
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp4
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp6
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp4
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp206
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_noth.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp2
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp130
-rw-r--r--src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp214
-rw-r--r--src/server/scripts/Northrend/Naxxramas/naxxramas.h2
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp6
-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.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp6
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp2
-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.cpp4
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp4
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp10
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp8
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/oculus.h2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp22
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp6
-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.cpp4
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.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.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp10
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp8
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp8
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp14
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp6
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp22
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp4
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp6
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp4
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp4
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp8
-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.cpp154
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp429
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp2
-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.cpp14
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp4
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp773
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp11
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h4
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp6
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp6
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp4
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp6
-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.cpp2
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_erekem.cpp10
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp4
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp4
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_moragg.cpp4
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp4
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp4
-rw-r--r--src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp20
-rw-r--r--src/server/scripts/Northrend/VioletHold/violet_hold.cpp4
-rw-r--r--src/server/scripts/Northrend/VioletHold/violet_hold.h2
-rw-r--r--src/server/scripts/Northrend/borean_tundra.cpp8
-rw-r--r--src/server/scripts/Northrend/crystalsong_forest.cpp2
-rw-r--r--src/server/scripts/Northrend/dalaran.cpp15
-rw-r--r--src/server/scripts/Northrend/dragonblight.cpp2
-rw-r--r--src/server/scripts/Northrend/grizzly_hills.cpp117
-rw-r--r--src/server/scripts/Northrend/howling_fjord.cpp2
-rw-r--r--src/server/scripts/Northrend/icecrown.cpp252
-rw-r--r--src/server/scripts/Northrend/isle_of_conquest.cpp2
-rw-r--r--src/server/scripts/Northrend/sholazar_basin.cpp83
-rw-r--r--src/server/scripts/Northrend/storm_peaks.cpp2
-rw-r--r--src/server/scripts/Northrend/zuldrak.cpp14
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPEP.h2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPHP.h2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPNA.h2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPSI.h2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPTF.h2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPZM.h2
-rw-r--r--src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp2
-rw-r--r--src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp4
-rw-r--r--src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp4
-rw-r--r--src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp2
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp2
-rw-r--r--src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp2
-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.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/black_temple.h2
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_illidan.cpp6
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_supremus.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/illidari_council.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp2
-rw-r--r--src/server/scripts/Outland/CMakeLists.txt1
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp10
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp2
-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.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp2
-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/underbog/boss_hungarfen.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp2
-rw-r--r--src/server/scripts/Outland/GruulsLair/boss_gruul.cpp4
-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.h2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp6
-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.cpp12
-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.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp2
-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.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp8
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp2
-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.cpp102
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp2
-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.cpp95
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h2
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp6
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp2
-rw-r--r--src/server/scripts/Outland/blades_edge_mountains.cpp563
-rw-r--r--src/server/scripts/Outland/boss_doomlord_kazzak.cpp4
-rw-r--r--src/server/scripts/Outland/boss_doomwalker.cpp4
-rw-r--r--src/server/scripts/Outland/hellfire_peninsula.cpp2
-rw-r--r--src/server/scripts/Outland/nagrand.cpp4
-rw-r--r--src/server/scripts/Outland/netherstorm.cpp4
-rw-r--r--src/server/scripts/Outland/shadowmoon_valley.cpp8
-rw-r--r--src/server/scripts/Outland/shattrath_city.cpp2
-rw-r--r--src/server/scripts/Outland/terokkar_forest.cpp2
-rw-r--r--src/server/scripts/Outland/zangarmarsh.cpp2
-rw-r--r--src/server/scripts/Spells/CMakeLists.txt1
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp2
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp2
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp913
-rw-r--r--src/server/scripts/Spells/spell_holiday.cpp110
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp2
-rw-r--r--src/server/scripts/Spells/spell_item.cpp48
-rw-r--r--src/server/scripts/Spells/spell_mage.cpp2
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp41
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp2
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp8
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp2
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp32
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp2
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp2
-rwxr-xr-xsrc/server/scripts/World/achievement_scripts.cpp31
-rw-r--r--src/server/scripts/World/areatrigger_scripts.cpp2
-rw-r--r--src/server/scripts/World/boss_emerald_dragons.cpp4
-rwxr-xr-xsrc/server/scripts/World/chat_log.cpp2
-rw-r--r--src/server/scripts/World/go_scripts.cpp2
-rw-r--r--src/server/scripts/World/guards.cpp4
-rw-r--r--src/server/scripts/World/item_scripts.cpp4
-rw-r--r--src/server/scripts/World/mob_generic_creature.cpp2
-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.cpp2
-rw-r--r--src/server/scripts/World/npcs_special.cpp394
-rw-r--r--src/server/shared/CMakeLists.txt2
-rwxr-xr-xsrc/server/shared/Common.cpp2
-rwxr-xr-xsrc/server/shared/Common.h2
-rwxr-xr-xsrc/server/shared/CompilerDefs.h2
-rwxr-xr-xsrc/server/shared/Configuration/Config.cpp2
-rwxr-xr-xsrc/server/shared/Configuration/Config.h2
-rwxr-xr-xsrc/server/shared/Cryptography/ARC4.cpp2
-rwxr-xr-xsrc/server/shared/Cryptography/ARC4.h2
-rwxr-xr-xsrc/server/shared/Cryptography/Authentication/AuthCrypt.cpp2
-rwxr-xr-xsrc/server/shared/Cryptography/Authentication/AuthCrypt.h2
-rwxr-xr-xsrc/server/shared/Cryptography/BigNumber.cpp2
-rwxr-xr-xsrc/server/shared/Cryptography/BigNumber.h2
-rwxr-xr-xsrc/server/shared/Cryptography/HMACSHA1.cpp3
-rwxr-xr-xsrc/server/shared/Cryptography/HMACSHA1.h2
-rwxr-xr-xsrc/server/shared/Cryptography/SHA1.cpp2
-rwxr-xr-xsrc/server/shared/Cryptography/SHA1.h2
-rwxr-xr-xsrc/server/shared/DataStores/DBCFileLoader.cpp2
-rwxr-xr-xsrc/server/shared/DataStores/DBCFileLoader.h2
-rwxr-xr-xsrc/server/shared/DataStores/DBCStore.h2
-rwxr-xr-xsrc/server/shared/Database/AdhocStatement.cpp2
-rwxr-xr-xsrc/server/shared/Database/AdhocStatement.h2
-rwxr-xr-xsrc/server/shared/Database/DatabaseEnv.h2
-rw-r--r--src/server/shared/Database/DatabaseWorker.cpp2
-rwxr-xr-xsrc/server/shared/Database/DatabaseWorker.h2
-rwxr-xr-xsrc/server/shared/Database/DatabaseWorkerPool.h2
-rwxr-xr-xsrc/server/shared/Database/Field.cpp2
-rwxr-xr-xsrc/server/shared/Database/Field.h2
-rw-r--r--[-rwxr-xr-x]src/server/shared/Database/Implementation/CharacterDatabase.cpp412
-rw-r--r--[-rwxr-xr-x]src/server/shared/Database/Implementation/CharacterDatabase.h410
-rwxr-xr-xsrc/server/shared/Database/Implementation/LoginDatabase.cpp72
-rwxr-xr-xsrc/server/shared/Database/Implementation/LoginDatabase.h74
-rwxr-xr-xsrc/server/shared/Database/Implementation/WorldDatabase.cpp42
-rwxr-xr-xsrc/server/shared/Database/Implementation/WorldDatabase.h44
-rwxr-xr-xsrc/server/shared/Database/MySQLConnection.cpp2
-rwxr-xr-xsrc/server/shared/Database/MySQLConnection.h2
-rwxr-xr-xsrc/server/shared/Database/MySQLThreading.h2
-rwxr-xr-xsrc/server/shared/Database/PreparedStatement.cpp2
-rwxr-xr-xsrc/server/shared/Database/PreparedStatement.h2
-rwxr-xr-xsrc/server/shared/Database/QueryHolder.cpp2
-rwxr-xr-xsrc/server/shared/Database/QueryHolder.h2
-rwxr-xr-xsrc/server/shared/Database/QueryResult.cpp2
-rwxr-xr-xsrc/server/shared/Database/QueryResult.h2
-rwxr-xr-xsrc/server/shared/Database/SQLOperation.h2
-rwxr-xr-xsrc/server/shared/Database/Transaction.cpp2
-rwxr-xr-xsrc/server/shared/Database/Transaction.h2
-rwxr-xr-xsrc/server/shared/Debugging/Errors.h2
-rwxr-xr-xsrc/server/shared/Define.h2
-rwxr-xr-xsrc/server/shared/Dynamic/FactoryHolder.h2
-rwxr-xr-xsrc/server/shared/Dynamic/LinkedList.h2
-rwxr-xr-xsrc/server/shared/Dynamic/LinkedReference/RefManager.h2
-rwxr-xr-xsrc/server/shared/Dynamic/LinkedReference/Reference.h2
-rwxr-xr-xsrc/server/shared/Dynamic/ObjectRegistry.h2
-rwxr-xr-xsrc/server/shared/Dynamic/TypeContainer.h2
-rwxr-xr-xsrc/server/shared/Dynamic/TypeContainerFunctions.h2
-rwxr-xr-xsrc/server/shared/Dynamic/TypeContainerFunctionsPtr.h2
-rwxr-xr-xsrc/server/shared/Dynamic/TypeContainerVisitor.h2
-rwxr-xr-xsrc/server/shared/Dynamic/TypeList.h2
-rwxr-xr-xsrc/server/shared/Dynamic/UnorderedMap.h2
-rwxr-xr-xsrc/server/shared/Logging/Log.cpp4
-rwxr-xr-xsrc/server/shared/Logging/Log.h2
-rwxr-xr-xsrc/server/shared/Packets/ByteBuffer.h2
-rwxr-xr-xsrc/server/shared/Packets/WorldPacket.h2
-rwxr-xr-xsrc/server/shared/SystemConfig.h2
-rwxr-xr-xsrc/server/shared/Threading/Callback.h2
-rwxr-xr-xsrc/server/shared/Threading/LockedQueue.h2
-rwxr-xr-xsrc/server/shared/Threading/Threading.cpp2
-rwxr-xr-xsrc/server/shared/Threading/Threading.h2
-rwxr-xr-xsrc/server/shared/Utilities/ByteConverter.h2
-rwxr-xr-xsrc/server/shared/Utilities/EventProcessor.cpp2
-rwxr-xr-xsrc/server/shared/Utilities/EventProcessor.h2
-rwxr-xr-xsrc/server/shared/Utilities/ServiceWin32.cpp2
-rwxr-xr-xsrc/server/shared/Utilities/ServiceWin32.h2
-rwxr-xr-xsrc/server/shared/Utilities/SignalHandler.h2
-rwxr-xr-xsrc/server/shared/Utilities/Timer.h4
-rwxr-xr-xsrc/server/shared/Utilities/Util.cpp27
-rwxr-xr-xsrc/server/shared/Utilities/Util.h5
-rw-r--r--src/server/worldserver/CMakeLists.txt6
-rwxr-xr-xsrc/server/worldserver/CommandLine/CliRunnable.cpp11
-rwxr-xr-xsrc/server/worldserver/CommandLine/CliRunnable.h2
-rwxr-xr-xsrc/server/worldserver/Main.cpp2
-rwxr-xr-xsrc/server/worldserver/Master.cpp6
-rwxr-xr-xsrc/server/worldserver/Master.h2
-rw-r--r--src/server/worldserver/RemoteAccess/RARunnable.cpp2
-rw-r--r--src/server/worldserver/RemoteAccess/RARunnable.h2
-rwxr-xr-xsrc/server/worldserver/RemoteAccess/RASocket.cpp2
-rwxr-xr-xsrc/server/worldserver/RemoteAccess/RASocket.h2
-rwxr-xr-xsrc/server/worldserver/TCSoap/TCSoap.cpp2
-rwxr-xr-xsrc/server/worldserver/TCSoap/TCSoap.h2
-rwxr-xr-xsrc/server/worldserver/WorldThread/WorldRunnable.cpp2
-rwxr-xr-xsrc/server/worldserver/WorldThread/WorldRunnable.h2
-rwxr-xr-xsrc/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/vmap3_assembler/CMakeLists.txt2
-rw-r--r--src/tools/vmap3_extractor/CMakeLists.txt2
1120 files changed, 13974 insertions, 7679 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c372d12418b..7c2ebe9906c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2012 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 26ea738ee25..022ff5b2f6f 100644
--- a/src/genrev/CMakeLists.txt
+++ b/src/genrev/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2012 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 561ee50f439..2b6c553e10b 100644
--- a/src/server/CMakeLists.txt
+++ b/src/server/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2012 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 cd8401565ba..ace18e7b45c 100644
--- a/src/server/authserver/Authentication/AuthCodes.cpp
+++ b/src/server/authserver/Authentication/AuthCodes.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 11b1b9fb33d..f940d459d40 100755
--- a/src/server/authserver/Authentication/AuthCodes.h
+++ b/src/server/authserver/Authentication/AuthCodes.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/CMakeLists.txt b/src/server/authserver/CMakeLists.txt
index 3abfe380297..0d94dc47407 100644
--- a/src/server/authserver/CMakeLists.txt
+++ b/src/server/authserver/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2012 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 8226868fa7a..01a33d836d6 100755
--- a/src/server/authserver/Main.cpp
+++ b/src/server/authserver/Main.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.cpp b/src/server/authserver/Realms/RealmList.cpp
index c81af80d31d..245b9c7cc8c 100755
--- a/src/server/authserver/Realms/RealmList.cpp
+++ b/src/server/authserver/Realms/RealmList.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,7 +70,7 @@ void RealmList::UpdateRealms(bool init)
{
sLog->outDetail("Updating Realm List...");
- PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_REALMLIST);
+ PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST);
PreparedQueryResult result = LoginDatabase.Query(stmt);
// Circle through results and add them to the realm map
diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h
index 3fe04b0031e..698026876fb 100755
--- a/src/server/authserver/Realms/RealmList.h
+++ b/src/server/authserver/Realms/RealmList.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 c24012efcef..6d295a0bbee 100755
--- a/src/server/authserver/Server/AuthSocket.cpp
+++ b/src/server/authserver/Server/AuthSocket.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 @@ AuthSocket::~AuthSocket(void) {}
// Accept the connection and set the s random value for SRP6
void AuthSocket::OnAccept(void)
{
- sLog->outBasic("Accepting connection from '%s'", socket().get_remote_address().c_str());
+ sLog->outBasic("'%s:%d' Accepting connection", socket().getRemoteAddress().c_str(), socket().getRemotePort());
}
void AuthSocket::OnClose(void)
@@ -247,7 +247,7 @@ void AuthSocket::OnRead()
// Report unknown packets in the error log
if (i == AUTH_TOTAL_COMMANDS)
{
- sLog->outError("[Auth] got unknown packet from '%s'", socket().get_remote_address().c_str());
+ sLog->outError("[Auth] got unknown packet from '%s'", socket().getRemoteAddress().c_str());
socket().shutdown();
return;
}
@@ -283,7 +283,7 @@ void AuthSocket::_SetVSFields(const std::string& rI)
v_hex = v.AsHexStr();
s_hex = s.AsHexStr();
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SET_VS);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_VS);
stmt->setString(0, v_hex);
stmt->setString(1, s_hex);
stmt->setString(2, _login);
@@ -348,22 +348,22 @@ bool AuthSocket::_HandleLogonChallenge()
pkt << (uint8)0x00;
// Verify that this IP is not in the ip_banned table
- LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_SET_EXPIREDIPBANS));
+ LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS));
- const std::string& ip_address = socket().get_remote_address();
- PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_IPBANNED);
+ const std::string& ip_address = socket().getRemoteAddress();
+ PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED);
stmt->setString(0, ip_address);
PreparedQueryResult result = LoginDatabase.Query(stmt);
if (result)
{
pkt << (uint8)WOW_FAIL_BANNED;
- sLog->outBasic("[AuthChallenge] Banned ip %s tried to login!", ip_address.c_str());
+ sLog->outBasic("'%s:%d' [AuthChallenge] Banned ip tries to login!",socket().getRemoteAddress().c_str(), socket().getRemotePort());
}
else
{
// Get the account details from the account table
// No SQL injection (prepared statement)
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_LOGONCHALLENGE);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LOGONCHALLENGE);
stmt->setString(0, _login);
PreparedQueryResult res2 = LoginDatabase.Query(stmt);
@@ -393,10 +393,10 @@ bool AuthSocket::_HandleLogonChallenge()
if (!locked)
{
//set expired bans to inactive
- LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_SET_EXPIREDACCBANS));
+ LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS));
// If the account is banned, reject the logon attempt
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_ACCBANNED);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BANNED);
stmt->setUInt32(0, fields[1].GetUInt32());
PreparedQueryResult banresult = LoginDatabase.Query(stmt);
if (banresult)
@@ -404,12 +404,12 @@ bool AuthSocket::_HandleLogonChallenge()
if ((*banresult)[0].GetUInt64() == (*banresult)[1].GetUInt64())
{
pkt << (uint8)WOW_FAIL_BANNED;
- sLog->outBasic("[AuthChallenge] Banned account %s tried to login!", _login.c_str());
+ sLog->outBasic("'%s:%d' [AuthChallenge] Banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ());
}
else
{
pkt << (uint8)WOW_FAIL_SUSPENDED;
- sLog->outBasic("[AuthChallenge] Temporarily banned account %s tried to login!", _login.c_str());
+ sLog->outBasic("'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ());
}
}
else
@@ -480,7 +480,9 @@ bool AuthSocket::_HandleLogonChallenge()
for (int i = 0; i < 4; ++i)
_localizationName[i] = ch->country[4-i-1];
- sLog->outBasic("[AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", _login.c_str (), ch->country[3], ch->country[2], ch->country[1], ch->country[0], GetLocaleByName(_localizationName));
+ sLog->outBasic("'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", socket().getRemoteAddress().c_str(), socket().getRemotePort(),
+ _login.c_str (), ch->country[3], ch->country[2], ch->country[1], ch->country[0], GetLocaleByName(_localizationName)
+ );
}
}
}
@@ -590,15 +592,15 @@ bool AuthSocket::_HandleLogonProof()
// Check if SRP6 results match (password is correct), else send an error
if (!memcmp(M.AsByteArray(), lp.M1, 20))
{
- sLog->outBasic("User '%s' successfully authenticated", _login.c_str());
+ sLog->outBasic("'%s:%d' User '%s' successfully authenticated", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str());
// Update the sessionkey, last_ip, last login time and reset number of failed logins in the account table for this account
// No SQL injection (escaped user name) and IP address as received by socket
const char *K_hex = K.AsHexStr();
- PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SET_LOGONPROOF);
+ PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGONPROOF);
stmt->setString(0, K_hex);
- stmt->setString(1, socket().get_remote_address().c_str());
+ stmt->setString(1, socket().getRemoteAddress().c_str());
stmt->setUInt32(2, GetLocaleByName(_localizationName));
stmt->setString(3, _login);
LoginDatabase.Execute(stmt);
@@ -638,17 +640,17 @@ bool AuthSocket::_HandleLogonProof()
char data[4] = { AUTH_LOGON_PROOF, WOW_FAIL_UNKNOWN_ACCOUNT, 3, 0 };
socket().send(data, sizeof(data));
- sLog->outBasic("[AuthChallenge] account %s tried to login with wrong password!", _login.c_str());
+ sLog->outBasic("'%s:%d' [AuthChallenge] account %s tried to login with invalid password!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ());
uint32 MaxWrongPassCount = ConfigMgr::GetIntDefault("WrongPass.MaxCount", 0);
if (MaxWrongPassCount > 0)
{
//Increment number of failed logins by one and if it reaches the limit temporarily ban that account or IP
- PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SET_FAILEDLOGINS);
+ PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_FAILEDLOGINS);
stmt->setString(0, _login);
LoginDatabase.Execute(stmt);
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_FAILEDLOGINS);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_FAILEDLOGINS);
stmt->setString(0, _login);
if (PreparedQueryResult loginfail = LoginDatabase.Query(stmt))
@@ -663,22 +665,23 @@ bool AuthSocket::_HandleLogonProof()
if (WrongPassBanType)
{
uint32 acc_id = (*loginfail)[0].GetUInt32();
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SET_ACCAUTOBANNED);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED);
stmt->setUInt32(0, acc_id);
stmt->setUInt32(1, WrongPassBanTime);
LoginDatabase.Execute(stmt);
- sLog->outBasic("[AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times",
- _login.c_str(), WrongPassBanTime, failed_logins);
+ sLog->outBasic("'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times",
+ socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str(), WrongPassBanTime, failed_logins);
}
else
{
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SET_IPAUTOBANNED);
- stmt->setString(0, socket().get_remote_address());
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_IP_AUTO_BANNED);
+ stmt->setString(0, socket().getRemoteAddress());
stmt->setUInt32(1, WrongPassBanTime);
LoginDatabase.Execute(stmt);
- sLog->outBasic("[AuthChallenge] IP %s got banned for '%u' seconds because account %s failed to authenticate '%u' times", socket().get_remote_address().c_str(), WrongPassBanTime, _login.c_str(), failed_logins);
+ sLog->outBasic("'%s:%d' [AuthChallenge] IP %s got banned for '%u' seconds because account %s failed to authenticate '%u' times",
+ socket().getRemoteAddress().c_str(), socket().getRemotePort(), socket().getRemoteAddress().c_str(), WrongPassBanTime, _login.c_str(), failed_logins);
}
}
}
@@ -723,14 +726,14 @@ bool AuthSocket::_HandleReconnectChallenge()
_login = (const char*)ch->I;
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_SESSIONKEY);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_SESSIONKEY);
stmt->setString(0, _login);
PreparedQueryResult result = LoginDatabase.Query(stmt);
// Stop if the account is not found
if (!result)
{
- sLog->outError("[ERROR] user %s tried to login and we cannot find his session key in the database.", _login.c_str());
+ sLog->outError("'%s:%d' [ERROR] user %s tried to login and we cannot find his session key in the database.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str());
socket().shutdown();
return false;
}
@@ -790,7 +793,7 @@ bool AuthSocket::_HandleReconnectProof()
}
else
{
- sLog->outError("[ERROR] user %s tried to login, but session invalid.", _login.c_str());
+ sLog->outError("'%s:%d' [ERROR] user %s tried to login, but session is invalid.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str());
socket().shutdown();
return false;
}
@@ -807,12 +810,12 @@ bool AuthSocket::_HandleRealmList()
// Get the user id (else close the connection)
// No SQL injection (prepared statement)
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_ACCIDBYNAME);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME);
stmt->setString(0, _login);
PreparedQueryResult result = LoginDatabase.Query(stmt);
if (!result)
{
- sLog->outError("[ERROR] user %s tried to login and we cannot find him in the database.", _login.c_str());
+ sLog->outError("'%s:%d' [ERROR] user %s tried to login but we cannot find him in the database.", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str());
socket().shutdown();
return false;
}
@@ -838,7 +841,7 @@ bool AuthSocket::_HandleRealmList()
uint8 AmountOfCharacters;
// No SQL injection. id of realm is controlled by the database.
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_NUMCHARSONREALM);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_NUM_CHARS_ON_REALM);
stmt->setUInt32(0, i->second.m_ID);
stmt->setUInt32(1, id);
result = LoginDatabase.Query(stmt);
diff --git a/src/server/authserver/Server/AuthSocket.h b/src/server/authserver/Server/AuthSocket.h
index 75df3d69a05..490b0db2149 100755
--- a/src/server/authserver/Server/AuthSocket.h
+++ b/src/server/authserver/Server/AuthSocket.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 fc302adfccb..32f4f3e4122 100755
--- a/src/server/authserver/Server/RealmAcceptor.h
+++ b/src/server/authserver/Server/RealmAcceptor.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 4d92747d262..72c36fc6646 100755
--- a/src/server/authserver/Server/RealmSocket.cpp
+++ b/src/server/authserver/Server/RealmSocket.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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
@@ -31,7 +31,7 @@ RealmSocket::Session::Session(void) {}
RealmSocket::Session::~Session(void) { }
-RealmSocket::RealmSocket(void) : input_buffer_(4096), session_(NULL), remote_address_()
+RealmSocket::RealmSocket(void) : input_buffer_(4096), session_(NULL), _remoteAddress()
{
reference_counting_policy().value(ACE_Event_Handler::Reference_Counting_Policy::ENABLED);
@@ -63,7 +63,8 @@ int RealmSocket::open(void * arg)
return -1;
}
- remote_address_ = addr.get_host_addr();
+ _remoteAddress = addr.get_host_addr();
+ _remotePort = addr.get_port_number();
// Register with ACE Reactor
if (Base::open(arg) == -1)
@@ -89,9 +90,14 @@ int RealmSocket::close(int)
return 0;
}
-const std::string& RealmSocket::get_remote_address(void) const
+const std::string& RealmSocket::getRemoteAddress(void) const
{
- return remote_address_;
+ return _remoteAddress;
+}
+
+const uint16 RealmSocket::getRemotePort(void) const
+{
+ return _remotePort;
}
size_t RealmSocket::recv_len(void) const
diff --git a/src/server/authserver/Server/RealmSocket.h b/src/server/authserver/Server/RealmSocket.h
index 12769c07185..9682b5e4559 100755
--- a/src/server/authserver/Server/RealmSocket.h
+++ b/src/server/authserver/Server/RealmSocket.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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
@@ -52,7 +52,9 @@ public:
bool send(const char *buf, size_t len);
- const std::string& get_remote_address(void) const;
+ const std::string& getRemoteAddress(void) const;
+
+ const uint16 getRemotePort(void) const;
virtual int open(void *);
@@ -70,7 +72,8 @@ private:
ACE_Message_Block input_buffer_;
Session* session_;
- std::string remote_address_;
+ std::string _remoteAddress;
+ uint16 _remotePort;
};
#endif /* __REALMSOCKET_H__ */
diff --git a/src/server/authserver/authserver.rc b/src/server/authserver/authserver.rc
index 850fa6041b8..97de89432bf 100755
--- a/src/server/authserver/authserver.rc
+++ b/src/server/authserver/authserver.rc
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 1540d1af667..8e90cac92f5 100755
--- a/src/server/collision/BoundingIntervalHierarchy.cpp
+++ b/src/server/collision/BoundingIntervalHierarchy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 cb6158e94eb..b0c35237a9d 100755
--- a/src/server/collision/BoundingIntervalHierarchy.h
+++ b/src/server/collision/BoundingIntervalHierarchy.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 0ea62fb1ed0..e2e182626c7 100644
--- a/src/server/collision/CMakeLists.txt
+++ b/src/server/collision/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2012 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/Management/IVMapManager.h b/src/server/collision/Management/IVMapManager.h
index a600dcb4895..a645e88ef05 100755
--- a/src/server/collision/Management/IVMapManager.h
+++ b/src/server/collision/Management/IVMapManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 438b854de16..657f989a0c0 100755
--- a/src/server/collision/Management/VMapFactory.cpp
+++ b/src/server/collision/Management/VMapFactory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 45ab1309049..27bce523c43 100755
--- a/src/server/collision/Management/VMapFactory.h
+++ b/src/server/collision/Management/VMapFactory.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 0632542f82e..62abc31831a 100644
--- a/src/server/collision/Management/VMapManager2.cpp
+++ b/src/server/collision/Management/VMapManager2.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 83fec0f0d11..1fba108388a 100755
--- a/src/server/collision/Management/VMapManager2.h
+++ b/src/server/collision/Management/VMapManager2.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 6b5c9b5a2c6..fda0535e8a7 100644
--- a/src/server/collision/Maps/MapTree.cpp
+++ b/src/server/collision/Maps/MapTree.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 47716a925b5..1732209c6bc 100755
--- a/src/server/collision/Maps/MapTree.h
+++ b/src/server/collision/Maps/MapTree.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 55051fda4bb..355ef6b1944 100644
--- a/src/server/collision/Maps/TileAssembler.cpp
+++ b/src/server/collision/Maps/TileAssembler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 fcb9a8db1c8..6128a0d2a53 100755
--- a/src/server/collision/Maps/TileAssembler.h
+++ b/src/server/collision/Maps/TileAssembler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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.cpp b/src/server/collision/Models/ModelInstance.cpp
index f0bff0cef73..dd6b16be777 100644
--- a/src/server/collision/Models/ModelInstance.cpp
+++ b/src/server/collision/Models/ModelInstance.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 c29f6756654..1118b654578 100755
--- a/src/server/collision/Models/ModelInstance.h
+++ b/src/server/collision/Models/ModelInstance.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 118ae098c25..a7de37d41e6 100644
--- a/src/server/collision/Models/WorldModel.cpp
+++ b/src/server/collision/Models/WorldModel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 7acd3c80376..52ecf498700 100755
--- a/src/server/collision/Models/WorldModel.h
+++ b/src/server/collision/Models/WorldModel.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 74e5a9f1dbb..f7d6f0ddaa1 100644
--- a/src/server/collision/VMapDefinitions.h
+++ b/src/server/collision/VMapDefinitions.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 09f931dbad2..72d9e8988c1 100755
--- a/src/server/collision/VMapTools.h
+++ b/src/server/collision/VMapTools.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 67e75633b05..6ce8ce330cf 100755
--- a/src/server/game/AI/CoreAI/CombatAI.cpp
+++ b/src/server/game/AI/CoreAI/CombatAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -99,7 +99,7 @@ void CombatAI::UpdateAI(const uint32 diff)
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if (uint32 spellId = events.ExecuteEvent())
@@ -158,7 +158,13 @@ void CasterAI::UpdateAI(const uint32 diff)
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->getVictim()->HasBreakableByDamageCrowdControlAura(me))
+ {
+ me->InterruptNonMeleeSpells(false);
+ return;
+ }
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if (uint32 spellId = events.ExecuteEvent())
diff --git a/src/server/game/AI/CoreAI/CombatAI.h b/src/server/game/AI/CoreAI/CombatAI.h
index fca964826d3..ad98cec0779 100755
--- a/src/server/game/AI/CoreAI/CombatAI.h
+++ b/src/server/game/AI/CoreAI/CombatAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.cpp b/src/server/game/AI/CoreAI/GameObjectAI.cpp
index e47d75fc514..1a08ac1afbe 100644
--- a/src/server/game/AI/CoreAI/GameObjectAI.cpp
+++ b/src/server/game/AI/CoreAI/GameObjectAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 93cd3a6d237..b9d385ba675 100644
--- a/src/server/game/AI/CoreAI/GameObjectAI.h
+++ b/src/server/game/AI/CoreAI/GameObjectAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 @@ class GameObjectAI
virtual void Destroyed(Player* /*player*/, uint32 /*eventId*/) {}
virtual void SetData(uint32 /*id*/, uint32 /*value*/) {}
virtual void OnGameEvent(bool /*start*/, uint16 /*eventId*/) {}
+ virtual void OnStateChanged(uint32 /*state*/, Unit* /*unit*/) { }
};
class NullGameObjectAI : public GameObjectAI
diff --git a/src/server/game/AI/CoreAI/GuardAI.cpp b/src/server/game/AI/CoreAI/GuardAI.cpp
index 2efe0eebee0..b78fec7c142 100755
--- a/src/server/game/AI/CoreAI/GuardAI.cpp
+++ b/src/server/game/AI/CoreAI/GuardAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,8 +115,8 @@ void GuardAI::EnterEvadeMode()
me->CombatStop(true);
i_state = STATE_NORMAL;
- // Remove TargetedMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead
- if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ // Remove ChaseMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
me->GetMotionMaster()->MoveTargetedHome();
}
diff --git a/src/server/game/AI/CoreAI/GuardAI.h b/src/server/game/AI/CoreAI/GuardAI.h
index c0b80ac5174..c80c5a6c343 100755
--- a/src/server/game/AI/CoreAI/GuardAI.h
+++ b/src/server/game/AI/CoreAI/GuardAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 1656e3cf181..3738d5bab6c 100755
--- a/src/server/game/AI/CoreAI/PassiveAI.cpp
+++ b/src/server/game/AI/CoreAI/PassiveAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -61,14 +61,14 @@ void PossessedAI::KilledUnit(Unit* victim)
void CritterAI::DamageTaken(Unit* /*done_by*/, uint32&)
{
- if (!me->HasUnitState(UNIT_STAT_FLEEING))
- me->SetControlled(true, UNIT_STAT_FLEEING);
+ if (!me->HasUnitState(UNIT_STATE_FLEEING))
+ me->SetControlled(true, UNIT_STATE_FLEEING);
}
void CritterAI::EnterEvadeMode()
{
- if (me->HasUnitState(UNIT_STAT_FLEEING))
- me->SetControlled(false, UNIT_STAT_FLEEING);
+ if (me->HasUnitState(UNIT_STATE_FLEEING))
+ me->SetControlled(false, UNIT_STATE_FLEEING);
CreatureAI::EnterEvadeMode();
}
diff --git a/src/server/game/AI/CoreAI/PassiveAI.h b/src/server/game/AI/CoreAI/PassiveAI.h
index e23fb41d608..d7bf8656f23 100755
--- a/src/server/game/AI/CoreAI/PassiveAI.h
+++ b/src/server/game/AI/CoreAI/PassiveAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 e009bf9d12a..30ebd06745f 100755
--- a/src/server/game/AI/CoreAI/PetAI.cpp
+++ b/src/server/game/AI/CoreAI/PetAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -42,7 +42,6 @@ PetAI::PetAI(Creature* c) : CreatureAI(c), i_tracker(TIME_INTERVAL_LOOK)
{
m_AllySet.clear();
UpdateAllies();
- targetHasCC = false;
}
void PetAI::EnterEvadeMode()
@@ -55,9 +54,6 @@ bool PetAI::_needToStop()
if (me->isCharmed() && me->getVictim() == me->GetCharmer())
return true;
- if (_CheckTargetCC(me->getVictim()) && !targetHasCC)
- return true;
-
return !me->IsValidAttackTarget(me->getVictim());
}
@@ -95,13 +91,19 @@ void PetAI::UpdateAI(const uint32 diff)
// me->getVictim() can't be used for check in case stop fighting, me->getVictim() clear at Unit death etc.
if (me->getVictim())
{
+ // is only necessary to stop casting, the pet must not exit combat
+ if (me->getVictim()->HasBreakableByDamageCrowdControlAura(me))
+ {
+ me->InterruptNonMeleeSpells(false);
+ return;
+ }
+
if (_needToStop())
{
sLog->outStaticDebug("Pet AI stopped attacking [guid=%u]", me->GetGUIDLow());
_stopAttack();
return;
}
- targetHasCC = _CheckTargetCC(me->getVictim());
DoMeleeAttackIfReady();
}
@@ -116,14 +118,14 @@ void PetAI::UpdateAI(const uint32 diff)
else
HandleReturnMovement();
}
- else if (owner && !me->HasUnitState(UNIT_STAT_FOLLOW)) // no charm info and no victim
+ else if (owner && !me->HasUnitState(UNIT_STATE_FOLLOW)) // no charm info and no victim
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
if (!me->GetCharmInfo())
return;
// Autocast (casted only in combat or persistent spells in any state)
- if (!me->HasUnitState(UNIT_STAT_CASTING))
+ if (!me->HasUnitState(UNIT_STATE_CASTING))
{
typedef std::vector<std::pair<Unit*, Spell*> > TargetSpellList;
TargetSpellList targetSpellStore;
@@ -293,8 +295,6 @@ void PetAI::AttackStart(Unit* target)
if (!CanAttack(target))
return;
- targetHasCC = _CheckTargetCC(target);
-
if (Unit* owner = me->GetOwner())
owner->SetInCombatWith(target);
@@ -310,22 +310,21 @@ Unit* PetAI::SelectNextTarget()
return NULL;
Unit* target = me->getAttackerForHelper();
- targetHasCC = false;
// Check pet's attackers first to prevent dragging mobs back to owner
- if (target && !_CheckTargetCC(target))
+ if (target && !target->HasBreakableByDamageCrowdControlAura())
return target;
if (me->GetCharmerOrOwner())
{
// Check owner's attackers if pet didn't have any
target = me->GetCharmerOrOwner()->getAttackerForHelper();
- if (target && !_CheckTargetCC(target))
+ if (target && !target->HasBreakableByDamageCrowdControlAura())
return target;
// 3.0.2 - Pets now start attacking their owners target in defensive mode as soon as the hunter does
target = me->GetCharmerOrOwner()->getVictim();
- if (target && !_CheckTargetCC(target))
+ if (target && !target->HasBreakableByDamageCrowdControlAura())
return target;
}
@@ -417,10 +416,9 @@ void PetAI::MovementInform(uint32 moveType, uint32 data)
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
}
+ break;
}
- break;
-
- case TARGETED_MOTION_TYPE:
+ case FOLLOW_MOTION_TYPE:
{
// If data is owner's GUIDLow then we've reached follow point,
// otherwise we're probably chasing a creature
@@ -430,11 +428,9 @@ void PetAI::MovementInform(uint32 moveType, uint32 data)
me->GetCharmInfo()->SetIsReturning(false);
me->GetCharmInfo()->SetIsFollowing(true);
me->GetCharmInfo()->SetIsCommandAttack(false);
- me->AddUnitState(UNIT_STAT_FOLLOW);
}
+ break;
}
- break;
-
default:
break;
}
@@ -470,11 +466,3 @@ bool PetAI::CanAttack(Unit* target)
// default, though we shouldn't ever get here
return false;
}
-
-bool PetAI::_CheckTargetCC(Unit* target)
-{
- if (me->GetCharmerOrOwnerGUID() && target->HasNegativeAuraWithAttribute(SPELL_ATTR0_BREAKABLE_BY_DAMAGE, me->GetCharmerOrOwnerGUID()))
- return true;
-
- return false;
-}
diff --git a/src/server/game/AI/CoreAI/PetAI.h b/src/server/game/AI/CoreAI/PetAI.h
index 8d72b34cf8f..730ab12a3ca 100755
--- a/src/server/game/AI/CoreAI/PetAI.h
+++ b/src/server/game/AI/CoreAI/PetAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,7 +50,6 @@ class PetAI : public CreatureAI
TimeTracker i_tracker;
bool inCombat;
- bool targetHasCC;
std::set<uint64> m_AllySet;
uint32 m_updateAlliesTimer;
@@ -58,7 +57,6 @@ class PetAI : public CreatureAI
void HandleReturnMovement();
void DoAttack(Unit* target, bool chase);
bool CanAttack(Unit* target);
- bool _CheckTargetCC(Unit* target);
};
#endif
diff --git a/src/server/game/AI/CoreAI/ReactorAI.cpp b/src/server/game/AI/CoreAI/ReactorAI.cpp
index df914fbf500..4683a75a44e 100755
--- a/src/server/game/AI/CoreAI/ReactorAI.cpp
+++ b/src/server/game/AI/CoreAI/ReactorAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 e66b382ef68..4a95dcf04e8 100755
--- a/src/server/game/AI/CoreAI/ReactorAI.h
+++ b/src/server/game/AI/CoreAI/ReactorAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 96da4c4f4e2..0739b62b605 100755
--- a/src/server/game/AI/CoreAI/TotemAI.cpp
+++ b/src/server/game/AI/CoreAI/TotemAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.h b/src/server/game/AI/CoreAI/TotemAI.h
index 4791c3af92a..0fa2920888f 100755
--- a/src/server/game/AI/CoreAI/TotemAI.h
+++ b/src/server/game/AI/CoreAI/TotemAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 8397ad7954e..bf50909eeee 100755
--- a/src/server/game/AI/CoreAI/UnitAI.cpp
+++ b/src/server/game/AI/CoreAI/UnitAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@ void UnitAI::AttackStartCaster(Unit* victim, float dist)
void UnitAI::DoMeleeAttackIfReady()
{
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
Unit* victim = me->getVictim();
@@ -60,7 +60,7 @@ void UnitAI::DoMeleeAttackIfReady()
bool UnitAI::DoSpellAttackIfReady(uint32 spell)
{
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return true;
if (me->isAttackReady())
diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h
index 444dce0339e..b871a25835b 100755
--- a/src/server/game/AI/CoreAI/UnitAI.h
+++ b/src/server/game/AI/CoreAI/UnitAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 5752fcede7b..c8818f84e5b 100755
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.h b/src/server/game/AI/CreatureAI.h
index 662ed3ab3dd..dafd3e4e137 100755
--- a/src/server/game/AI/CreatureAI.h
+++ b/src/server/game/AI/CreatureAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/CreatureAIFactory.h b/src/server/game/AI/CreatureAIFactory.h
index 4cedb3d9545..f4147826811 100755
--- a/src/server/game/AI/CreatureAIFactory.h
+++ b/src/server/game/AI/CreatureAIFactory.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 848c2561f3f..f568da80b49 100755
--- a/src/server/game/AI/CreatureAIImpl.h
+++ b/src/server/game/AI/CreatureAIImpl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -596,7 +596,7 @@ inline bool CreatureAI::_EnterEvadeMode()
inline void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered)
{
- if (!victim || (me->HasUnitState(UNIT_STAT_CASTING) && !triggered))
+ if (!victim || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered))
return;
me->CastSpell(victim, spellId, triggered);
@@ -609,7 +609,7 @@ inline void UnitAI::DoCastVictim(uint32 spellId, bool triggered)
inline void UnitAI::DoCastAOE(uint32 spellId, bool triggered)
{
- if (!triggered && me->HasUnitState(UNIT_STAT_CASTING))
+ if (!triggered && me->HasUnitState(UNIT_STATE_CASTING))
return;
me->CastSpell((Unit*)NULL, spellId, triggered);
diff --git a/src/server/game/AI/CreatureAIRegistry.cpp b/src/server/game/AI/CreatureAIRegistry.cpp
index 6fb04746111..e4cb62c56de 100755
--- a/src/server/game/AI/CreatureAIRegistry.cpp
+++ b/src/server/game/AI/CreatureAIRegistry.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 4b054e3de29..39d792a0d77 100755
--- a/src/server/game/AI/CreatureAIRegistry.h
+++ b/src/server/game/AI/CreatureAIRegistry.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 5b7ee7750bc..ab616d78a8c 100755
--- a/src/server/game/AI/CreatureAISelector.cpp
+++ b/src/server/game/AI/CreatureAISelector.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 64bf96c01af..933ec16f75c 100755
--- a/src/server/game/AI/CreatureAISelector.h
+++ b/src/server/game/AI/CreatureAISelector.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp
index 1db6bbd550e..5db9d0b1cdb 100755
--- a/src/server/game/AI/EventAI/CreatureEventAI.cpp
+++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -475,7 +475,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
//Melee current victim if flag not set
if (!(action.cast.castFlags & CAST_NO_MELEE_IF_OOM))
{
- if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
{
m_AttackDistance = 0.0f;
m_AttackAngle = 0.0f;
@@ -483,7 +483,6 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
me->GetMotionMaster()->MoveChase(me->getVictim(), m_AttackDistance, m_AttackAngle);
}
}
-
}
else
{
@@ -578,7 +577,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
{
if (action.combat_movement.melee)
{
- me->AddUnitState(UNIT_STAT_MELEE_ATTACKING);
+ me->AddUnitState(UNIT_STATE_MELEE_ATTACKING);
me->SendMeleeAttackStart(victim);
}
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE)
@@ -592,10 +591,10 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
Unit* victim = me->getVictim();
if (action.combat_movement.melee && victim)
{
- me->ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
+ me->ClearUnitState(UNIT_STATE_MELEE_ATTACKING);
me->SendMeleeAttackStop(victim);
}
- if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
me->GetMotionMaster()->MoveIdle();
}
}
diff --git a/src/server/game/AI/EventAI/CreatureEventAI.h b/src/server/game/AI/EventAI/CreatureEventAI.h
index 9cc8c8f9c4a..c4daf2563e0 100755
--- a/src/server/game/AI/EventAI/CreatureEventAI.h
+++ b/src/server/game/AI/EventAI/CreatureEventAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp
index c27613f320f..8f2cf6b471f 100755
--- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp
+++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/EventAI/CreatureEventAIMgr.h b/src/server/game/AI/EventAI/CreatureEventAIMgr.h
index 50af460541f..93e953681b6 100755
--- a/src/server/game/AI/EventAI/CreatureEventAIMgr.h
+++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 953bbf7521a..bd6c901f99c 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/>
+/* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
@@ -298,7 +298,8 @@ void ScriptedAI::DoModifyThreatPercent(Unit* unit, int32 pct)
void ScriptedAI::DoTeleportTo(float x, float y, float z, uint32 time)
{
me->Relocate(x, y, z);
- me->SendMonsterMove(x, y, z, time);
+ float speed = me->GetDistance(x, y, z) / ((float)time * 0.001f);
+ me->MonsterMoveWithSpeed(x, y, z, speed);
}
void ScriptedAI::DoTeleportTo(const float position[4])
@@ -594,7 +595,7 @@ void BossAI::UpdateAI(uint32 const diff)
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -653,7 +654,7 @@ void WorldBossAI::UpdateAI(uint32 const diff)
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
index 92c6565be9f..a01c993cab6 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 c5f04d4ff5f..048cc8b3d68 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -90,7 +90,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* who)
void npc_escortAI::MoveInLineOfSight(Unit* who)
{
- if (!me->HasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
+ if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
{
if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(who))
return;
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index 1e0b212dd45..d83ad9b756c 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -38,8 +38,8 @@ void FollowerAI::AttackStart(Unit* who)
me->SetInCombatWith(who);
who->SetInCombatWith(me);
- if (me->HasUnitState(UNIT_STAT_FOLLOW))
- me->ClearUnitState(UNIT_STAT_FOLLOW);
+ if (me->HasUnitState(UNIT_STATE_FOLLOW))
+ me->ClearUnitState(UNIT_STATE_FOLLOW);
if (IsCombatMovementAllowed())
me->GetMotionMaster()->MoveChase(who);
@@ -88,7 +88,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who)
void FollowerAI::MoveInLineOfSight(Unit* who)
{
- if (!me->HasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
+ if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
{
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(who))
return;
@@ -167,7 +167,7 @@ void FollowerAI::EnterEvadeMode()
{
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI left combat, returning to CombatStartPosition.");
- if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
{
float fPosX, fPosY, fPosZ;
me->GetPosition(fPosX, fPosY, fPosZ);
@@ -176,7 +176,7 @@ void FollowerAI::EnterEvadeMode()
}
else
{
- if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
me->GetMotionMaster()->MoveTargetedHome();
}
@@ -340,9 +340,9 @@ Player* FollowerAI::GetLeaderForFollower()
void FollowerAI::SetFollowComplete(bool bWithEndEvent)
{
- if (me->HasUnitState(UNIT_STAT_FOLLOW))
+ if (me->HasUnitState(UNIT_STATE_FOLLOW))
{
- me->ClearUnitState(UNIT_STAT_FOLLOW);
+ me->ClearUnitState(UNIT_STATE_FOLLOW);
me->StopMoving();
me->GetMotionMaster()->Clear();
@@ -369,9 +369,9 @@ void FollowerAI::SetFollowPaused(bool paused)
{
AddFollowState(STATE_FOLLOW_PAUSED);
- if (me->HasUnitState(UNIT_STAT_FOLLOW))
+ if (me->HasUnitState(UNIT_STATE_FOLLOW))
{
- me->ClearUnitState(UNIT_STAT_FOLLOW);
+ me->ClearUnitState(UNIT_STATE_FOLLOW);
me->StopMoving();
me->GetMotionMaster()->Clear();
diff --git a/src/server/game/AI/ScriptedAI/ScriptedGossip.h b/src/server/game/AI/ScriptedAI/ScriptedGossip.h
index 5d376be888e..34300ff406c 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedGossip.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedGossip.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/>
+/* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
diff --git a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp
index c4142ba2b1b..25c7f6f44b7 100755
--- a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 7dd793a302b..07a8e3fdca7 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -46,7 +46,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
// spawn in run mode
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
- mRun = true;
+ mRun = false;
me->GetPosition(&mLastOOCPos);
@@ -68,6 +68,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
mFollowCredit = 0;
mFollowArrivedEntry = 0;
mFollowCreditType = 0;
+ mInvinceabilityHpLevel = 0;
}
void SmartAI::UpdateDespawn(const uint32 diff)
@@ -89,7 +90,7 @@ void SmartAI::UpdateDespawn(const uint32 diff)
void SmartAI::Reset()
{
if (!HasEscortState(SMART_ESCORT_ESCORTING))//dont mess up escort movement after combat
- SetRun(true);
+ SetRun(mRun);
GetScript()->OnReset();
}
@@ -431,12 +432,25 @@ void SmartAI::MovementInform(uint32 MovementType, uint32 Data)
MovepointReached(Data);
}
+void SmartAI::RemoveAuras()
+{
+ // Only loop throught the applied auras, because here is where all auras on the current unit are stored
+ Unit::AuraApplicationMap appliedAuras = me->GetAppliedAuras();
+ for (Unit::AuraApplicationMap::iterator iter = appliedAuras.begin(); iter != appliedAuras.end(); ++iter)
+ {
+ Aura const* aura = iter->second->GetBase();
+ if (!aura->GetSpellInfo()->IsPassive() && !aura->GetSpellInfo()->HasAura(SPELL_AURA_CONTROL_VEHICLE) && aura->GetCaster() != me)
+ me->RemoveAurasDueToSpell(aura->GetId());
+ }
+}
+
void SmartAI::EnterEvadeMode()
{
if (!me->isAlive())
return;
- me->RemoveAllAuras();
+ RemoveAuras();
+
me->DeleteThreatList();
me->CombatStop(true);
me->LoadCreaturesAddon();
@@ -624,6 +638,8 @@ void SmartAI::SpellHitTarget(Unit* target, const SpellInfo* spellInfo)
void SmartAI::DamageTaken(Unit* doneBy, uint32& damage)
{
GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED, doneBy, damage);
+ if ((me->GetHealth() - damage) <= mInvinceabilityHpLevel)
+ damage -= mInvinceabilityHpLevel;
}
void SmartAI::HealReceived(Unit* doneBy, uint32& addhealth)
@@ -924,6 +940,11 @@ void SmartGameObjectAI::OnGameEvent(bool start, uint16 eventId)
GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, NULL, eventId);
}
+void SmartGameObjectAI::OnStateChanged(uint32 state, Unit* unit)
+{
+ GetScript()->ProcessEventsFor(SMART_EVENT_GO_STATE_CHANGED, unit, state);
+}
+
class SmartTrigger : public AreaTriggerScript
{
public:
diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h
index dc1f901d477..a40254fe384 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.h
+++ b/src/server/game/AI/SmartScripts/SmartAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -175,6 +175,8 @@ class SmartAI : public CreatureAI
void SetSwim(bool swim = true);
+ void SetInvinceabilityHpLevel(uint32 level) { mInvinceabilityHpLevel = level; }
+
void sGossipHello(Player* player);
void sGossipSelect(Player* player, uint32 sender, uint32 action);
void sGossipSelectCode(Player* player, uint32 sender, uint32 action, const char* code);
@@ -193,6 +195,8 @@ class SmartAI : public CreatureAI
mDespawnState = t ? 1 : 0;
}
void StartDespawn() { mDespawnState = 2; }
+
+ void RemoveAuras();
private:
uint32 mFollowCreditType;
@@ -220,6 +224,7 @@ class SmartAI : public CreatureAI
bool mCanAutoAttack;
bool mCanCombatMove;
bool mForcedPaused;
+ uint32 mInvinceabilityHpLevel;
bool AssistPlayerInCombat(Unit* who);
@@ -251,6 +256,7 @@ public:
void SetData(uint32 id, uint32 value);
void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker);
void OnGameEvent(bool start, uint16 eventId);
+ void OnStateChanged(uint32 state, Unit* unit);
protected:
GameObject* const go;
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 34d465a5e7e..a6923ea19e0 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,6 @@ SmartScript::SmartScript()
go = NULL;
me = NULL;
mEventPhase = 0;
- mInvinceabilityHpLevel = 0;
mPathId = 0;
mTargetStorage = new ObjectListMap();
mStoredEvents.clear();
@@ -51,7 +50,6 @@ SmartScript::SmartScript()
mTemplate = SMARTAI_TEMPLATE_BASIC;
meOrigGUID = 0;
goOrigGUID = 0;
- mResumeActionList = true;
mLastInvoker = 0;
}
@@ -78,22 +76,6 @@ void SmartScript::OnReset()
void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob)
{
- if (e == SMART_EVENT_AGGRO)
- {
- if (!mResumeActionList)
- mTimedActionList.clear();//clear action list if it is not resumable
- else
- {
- for (SmartAIEventList::iterator itr = mTimedActionList.begin(); itr != mTimedActionList.end(); ++itr)
- {
- if (itr->enableTimed)
- {
- InitTimer((*itr));//re-init the currently enabled timer, so it restarts the timer when resumed
- break;
- }
- }
- }
- }
for (SmartAIEventList::iterator i = mEvents.begin(); i != mEvents.end(); ++i)
{
SMART_EVENT eventType = SMART_EVENT((*i).GetEventType());
@@ -101,7 +83,20 @@ void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint3
continue;
if (eventType == e/* && (!(*i).event.event_phase_mask || IsInPhase((*i).event.event_phase_mask)) && !((*i).event.event_flags & SMART_EVENT_FLAG_NOT_REPEATABLE && (*i).runOnce)*/)
- ProcessEvent(*i, unit, var0, var1, bvar, spell, gob);
+ {
+ bool meets = true;
+ if (unit)
+ {
+ if (Player* player = unit->ToPlayer())
+ {
+ ConditionList conds = sConditionMgr->GetConditionsForSmartEvent((*i).entryOrGuid, (*i).event_id, (*i).source_type);
+ meets = sConditionMgr->IsPlayerMeetToConditions(player, conds);
+ }
+ }
+
+ if (meets)
+ ProcessEvent(*i, unit, var0, var1, bvar, spell, gob);
+ }
}
}
@@ -119,15 +114,6 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (unit)
mLastInvoker = unit->GetGUID();
- if (e.link && e.link != e.event_id)
- {
- SmartScriptHolder linked = FindLinkedEvent(e.link);
- if (linked.GetActionType() && linked.GetEventType() == SMART_EVENT_LINK)
- ProcessEvent(linked, unit, var0, var1, bvar, spell, gob);
- else
- sLog->outErrorDb("SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Link Event %u not found or invalid, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.link);
- }
-
if (Unit* tempInvoker = GetLastInvoker())
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: Invoker: %s (guidlow: %u)", tempInvoker->GetName(), tempInvoker->GetGUIDLow());
@@ -136,7 +122,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_TALK:
{
if (!me)
- return;
+ break;
ObjectList* targets = GetTargets(e, unit);
Creature* talker = me;
@@ -274,7 +260,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -317,7 +303,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -336,7 +322,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -357,7 +343,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_SET_REACT_STATE:
{
if (!me)
- return;
+ break;
me->SetReactState(ReactStates(e.action.react.state));
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_REACT_STATE: Creature guidLow %u set reactstate %u",
@@ -368,7 +354,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
uint32 emotes[SMART_ACTION_PARAM_COUNT];
emotes[0] = e.action.randomEmote.emote1;
@@ -405,7 +391,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_THREAT_ALL_PCT:
{
if (!me)
- return;
+ break;
std::list<HostileReference*> const& threatList = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
@@ -422,11 +408,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_THREAT_SINGLE_PCT:
{
if (!me)
- return;
+ break;
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -445,7 +431,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -463,11 +449,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_SEND_CASTCREATUREORGO:
{
if (!GetBaseObject())
- return;
+ break;
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -485,11 +471,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_CAST:
{
if (!me)
- return;
+ break;
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -511,11 +497,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
Unit* tempLastInvoker = GetLastInvoker();
if (!tempLastInvoker)
- return;
+ break;
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -537,7 +523,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -556,7 +542,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -564,7 +550,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
// Activate
(*itr)->ToGameObject()->SetLootState(GO_READY);
- (*itr)->ToGameObject()->UseDoorOrButton();
+ (*itr)->ToGameObject()->UseDoorOrButton(0, false, unit);
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject %u (entry: %u) activated",
(*itr)->GetGUIDLow(), (*itr)->GetEntry());
}
@@ -577,7 +563,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -596,7 +582,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -615,7 +601,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -634,7 +620,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -652,7 +638,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_AUTO_ATTACK:
{
if (!IsSmart())
- return;
+ break;
CAST_AI(SmartAI, me->AI())->SetAutoAttack(e.action.autoAttack.attack ? true : false);
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_AUTO_ATTACK: Creature: %u bool on = %u",
@@ -662,7 +648,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_ALLOW_COMBAT_MOVEMENT:
{
if (!IsSmart())
- return;
+ break;
bool move = e.action.combatMove.move ? true : false;
CAST_AI(SmartAI, me->AI())->SetCombatMove(move);
@@ -673,7 +659,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_SET_EVENT_PHASE:
{
if (!GetBaseObject())
- return;
+ break;
SetPhase(e.action.setEventPhase.phase);
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EVENT_PHASE: Creature %u set event phase %u",
@@ -683,7 +669,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_INC_EVENT_PHASE:
{
if (!GetBaseObject())
- return;
+ break;
IncPhase(e.action.incEventPhase.inc);
DecPhase(e.action.incEventPhase.dec);
@@ -694,7 +680,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_EVADE:
{
if (!me)
- return;
+ break;
me->AI()->EnterEvadeMode();
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_EVADE: Creature %u EnterEvadeMode", me->GetGUIDLow());
@@ -703,7 +689,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_FLEE_FOR_ASSIST:
{
if (!me)
- return;
+ break;
me->DoFleeToGetAssistance();
if (e.action.flee.withEmote)
@@ -724,11 +710,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_CALL_CASTEDCREATUREORGO:
{
if (!GetBaseObject())
- return;
+ break;
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -747,7 +733,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -765,11 +751,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_FOLLOW:
{
if (!IsSmart())
- return;
+ break;
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -788,7 +774,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_RANDOM_PHASE:
{
if (!GetBaseObject())
- return;
+ break;
uint32 phases[SMART_ACTION_PARAM_COUNT];
phases[0] = e.action.randomPhase.phase1;
@@ -817,7 +803,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_RANDOM_PHASE_RANGE:
{
if (!GetBaseObject())
- return;
+ break;
uint32 phase = urand(e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax);
SetPhase(phase);
@@ -837,7 +823,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -866,13 +852,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
obj = unit;
if (!obj)
- return;
+ break;
InstanceScript* instance = obj->GetInstanceScript();
if (!instance)
{
sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid);
- return;
+ break;
}
instance->SetData(e.action.setInstanceData.field, e.action.setInstanceData.data);
@@ -887,18 +873,18 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
obj = unit;
if (!obj)
- return;
+ break;
InstanceScript* instance = obj->GetInstanceScript();
if (!instance)
{
sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid);
- return;
+ break;
}
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
instance->SetData64(e.action.setInstanceData64.field, targets->front()->GetGUID());
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: "UI64FMTD,
@@ -910,7 +896,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_UPDATE_TEMPLATE:
{
if (!me || me->GetEntry() == e.action.updateTemplate.creature)
- return;
+ break;
me->UpdateEntry(e.action.updateTemplate.creature, e.action.updateTemplate.team ? HORDE : ALLIANCE);
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_UPDATE_TEMPLATE: Creature %u, Template: %u, Team: %u",
@@ -957,7 +943,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_FORCE_DESPAWN:
{
if (!IsSmart())
- return;
+ break;
CAST_AI(SmartAI, me->AI())->SetDespawnTime(e.action.forceDespawn.delay + 1);//next tick
CAST_AI(SmartAI, me->AI())->StartDespawn();
@@ -973,7 +959,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -1003,19 +989,24 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL:
{
if (!me)
- return;
+ break;
+
+ SmartAI* ai = CAST_AI(SmartAI, me->AI());
+
+ if (!ai)
+ break;
if (e.action.invincHP.percent)
- mInvinceabilityHpLevel = me->CountPctFromMaxHealth(e.action.invincHP.percent);
+ ai->SetInvinceabilityHpLevel(me->CountPctFromMaxHealth(e.action.invincHP.percent));
else
- mInvinceabilityHpLevel = e.action.invincHP.minHP;
+ ai->SetInvinceabilityHpLevel(e.action.invincHP.minHP);
break;
}
case SMART_ACTION_SET_DATA:
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -1031,7 +1022,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_MOVE_FORWARD:
{
if (!me)
- return;
+ break;
float x, y, z;
me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, (float)e.action.moveRandom.distance);
@@ -1053,11 +1044,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_ATTACK_START:
{
if (!me)
- return;
+ break;
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -1092,7 +1083,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
if (e.GetTargetType() != SMART_TARGET_POSITION)
- return;
+ break;
if (Creature* summon = GetBaseObject()->SummonCreature(e.action.summonCreature.creature, e.target.x, e.target.y, e.target.z, e.target.o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration))
if (unit && e.action.summonCreature.attackInvoker)
@@ -1102,7 +1093,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_SUMMON_GO:
{
if (!GetBaseObject())
- return;
+ break;
float x, y, z, o;
ObjectList* targets = GetTargets(e, unit);
@@ -1121,7 +1112,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
if (e.GetTargetType() != SMART_TARGET_POSITION)
- return;
+ break;
GetBaseObject()->SummonGameObject(e.action.summonGO.entry, e.target.x, e.target.y, e.target.z, e.target.o, 0, 0, 0, 0, e.action.summonGO.despawnTime);
break;
@@ -1130,7 +1121,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -1152,7 +1143,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -1169,7 +1160,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -1199,7 +1190,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -1215,7 +1206,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_SET_FLY:
{
if (!IsSmart())
- return;
+ break;
CAST_AI(SmartAI, me->AI())->SetFly(e.action.setFly.fly ? true : false);
break;
@@ -1223,7 +1214,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_SET_RUN:
{
if (!IsSmart())
- return;
+ break;
CAST_AI(SmartAI, me->AI())->SetRun(e.action.setRun.run ? true : false);
break;
@@ -1231,7 +1222,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_SET_SWIM:
{
if (!IsSmart())
- return;
+ break;
CAST_AI(SmartAI, me->AI())->SetSwim(e.action.setSwim.swim ? true : false);
break;
@@ -1239,7 +1230,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_WP_START:
{
if (!IsSmart())
- return;
+ break;
bool run = e.action.wpStart.run ? true : false;
uint32 entry = e.action.wpStart.pathID;
@@ -1258,7 +1249,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_WP_PAUSE:
{
if (!IsSmart())
- return;
+ break;
uint32 delay = e.action.wpPause.delay;
CAST_AI(SmartAI, me->AI())->PausePath(delay, e.GetEventType() == SMART_EVENT_WAYPOINT_REACHED ? false : true);
@@ -1267,7 +1258,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_WP_STOP:
{
if (!IsSmart())
- return;
+ break;
uint32 DespawnTime = e.action.wpStop.despawnTime;
uint32 quest = e.action.wpStop.quest;
@@ -1278,7 +1269,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_WP_RESUME:
{
if (!IsSmart())
- return;
+ break;
CAST_AI(SmartAI, me->AI())->ResumePath();
break;
@@ -1286,15 +1277,15 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_SET_ORIENTATION:
{
if (!me)
- return;
+ break;
ObjectList* targets = GetTargets(e, unit);
if (e.GetTargetType() == SMART_TARGET_SELF)
- me->SetFacing(me->GetHomePosition().GetOrientation(), NULL);
+ me->SetFacingTo(me->GetHomePosition().GetOrientation());
else if (e.GetTargetType() == SMART_TARGET_POSITION)
- me->SetFacing(e.target.o, NULL);
+ me->SetFacingTo(e.target.o);
else if (targets && !targets->empty())
- me->SetFacing(0, (*targets->begin()));
+ me->SetFacingToObject(*targets->begin());
delete targets;
break;
@@ -1303,7 +1294,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -1319,18 +1310,34 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_MOVE_TO_POS:
{
if (!IsSmart())
- return;
+ break;
+
+ WorldObject* target = NULL;
+
+ if (e.GetTargetType() == SMART_TARGET_CREATURE_RANGE || e.GetTargetType() == SMART_TARGET_CREATURE_GUID ||
+ e.GetTargetType() == SMART_TARGET_CREATURE_DISTANCE || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_RANGE ||
+ e.GetTargetType() == SMART_TARGET_GAMEOBJECT_GUID || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_DISTANCE ||
+ e.GetTargetType() == SMART_TARGET_CLOSEST_CREATURE || e.GetTargetType() == SMART_TARGET_CLOSEST_GAMEOBJECT ||
+ e.GetTargetType() == SMART_TARGET_OWNER_OR_SUMMONER)
+ {
+ ObjectList* targets = GetTargets(e, unit);
+ if (!targets)
+ break;
+
+ target = targets->front();
+ }
- bool run = e.action.setRun.run ? true : false;
- CAST_AI(SmartAI, me->AI())->SetRun(run);
- me->GetMotionMaster()->MovePoint(0, e.target.x, e.target.y, e.target.z);
+ if(!target)
+ me->GetMotionMaster()->MovePoint(0, e.target.x, e.target.y, e.target.z);
+ else
+ me->GetMotionMaster()->MovePoint(0, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
break;
}
case SMART_ACTION_RESPAWN_TARGET:
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -1347,7 +1354,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsPlayer(*itr))
@@ -1360,7 +1367,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -1437,7 +1444,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -1477,7 +1484,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (e.GetTargetType() == SMART_TARGET_NONE)
{
sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
- return;
+ break;
}
ObjectList* targets = GetTargets(e, unit);
@@ -1505,7 +1512,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
@@ -1518,7 +1525,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
@@ -1531,7 +1538,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
@@ -1544,13 +1551,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* casters = GetTargets(CreateEvent(SMART_EVENT_UPDATE_IC, 0, 0, 0, 0, 0, SMART_ACTION_NONE, 0, 0, 0, 0, 0, 0, (SMARTAI_TARGETS)e.action.cast.targetType, e.action.cast.targetParam1, e.action.cast.targetParam2, e.action.cast.targetParam3, 0), unit);
if (!casters)
- return;
+ break;
ObjectList* targets = GetTargets(e, unit);
if (!targets)
{
delete casters; // casters already validated, delete now
- return;
+ break;
}
for (ObjectList::const_iterator itr = casters->begin(); itr != casters->end(); ++itr)
@@ -1594,7 +1601,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (e.GetTargetType() == SMART_TARGET_NONE)
{
sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
- return;
+ break;
}
ObjectList* targets = GetTargets(e, unit);
@@ -1624,7 +1631,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (e.GetTargetType() == SMART_TARGET_NONE)
{
sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
- return;
+ break;
}
ObjectList* targets = GetTargets(e, unit);
@@ -1652,7 +1659,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsPlayer(*itr))
@@ -1665,7 +1672,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -1685,7 +1692,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
(*itr)->ToUnit()->SetByteFlag(UNIT_FIELD_BYTES_1, 0, e.action.setunitByte.byte1);
@@ -1697,7 +1704,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
@@ -1710,7 +1717,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
@@ -1723,7 +1730,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsGameObject(*itr))
@@ -1736,7 +1743,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
@@ -1749,7 +1756,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
@@ -1762,7 +1769,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
@@ -1774,24 +1781,65 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_JUMP_TO_POS:
{
if (!me)
- return;
+ break;
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveJump(e.target.x, e.target.y, e.target.z, (float)e.action.jump.speedxy, (float)e.action.jump.speedz);
// TODO: Resume path when reached jump location
break;
}
+ case SMART_ACTION_GO_SET_LOOT_STATE:
+ {
+ ObjectList* targets = GetTargets(e, unit);
+
+ if (!targets)
+ break;
+
+ for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
+ if (IsGameObject(*itr))
+ (*itr)->ToGameObject()->SetLootState((LootState)e.action.setGoLootState.state);
+
+ delete targets;
+ break;
+ }
+ case SMART_ACTION_SEND_TARGET_TO_TARGET:
+ {
+ ObjectList* targets = GetTargets(e, unit);
+ if (!targets)
+ break;
+
+ for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
+ {
+ if (IsCreature(*itr))
+ {
+ if (SmartAI* ai = CAST_AI(SmartAI, (*itr)->ToCreature()->AI()))
+ ai->GetScript()->StoreTargetList(GetTargetList(e.action.sendTargetToTarget.id), e.action.sendTargetToTarget.id);
+ else
+ sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping");
+ }
+ else if (IsGameObject(*itr))
+ {
+ if (SmartGameObjectAI* ai = CAST_AI(SmartGameObjectAI, (*itr)->ToGameObject()->AI()))
+ ai->GetScript()->StoreTargetList(GetTargetList(e.action.sendTargetToTarget.id), e.action.sendTargetToTarget.id);
+ else
+ sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping");
+ }
+ }
+
+ delete targets;
+ break;
+ }
case SMART_ACTION_SEND_GOSSIP_MENU:
{
if (!GetBaseObject())
- return;
+ break;
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId %d, gossipNpcTextId %d",
e.action.sendGossipMenu.gossipMenuId, e.action.sendGossipMenu.gossipNpcTextId);
ObjectList* targets = GetTargets(e, unit);
if (!targets)
- return;
+ break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (Player* player = (*itr)->ToPlayer())
@@ -1811,6 +1859,15 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
sLog->outErrorDb("SmartScript::ProcessAction: Unhandled Action type %u", e.GetActionType());
break;
}
+
+ if (e.link && e.link != e.event_id)
+ {
+ SmartScriptHolder linked = FindLinkedEvent(e.link);
+ if (linked.GetActionType() && linked.GetEventType() == SMART_EVENT_LINK)
+ ProcessEvent(linked, unit, var0, var1, bvar, spell, gob);
+ else
+ sLog->outErrorDb("SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Link Event %u not found or invalid, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.link);
+ }
}
void SmartScript::InstallTemplate(SmartScriptHolder const& e)
@@ -2603,6 +2660,13 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
ProcessAction(e, NULL, var0);
break;
}
+ case SMART_EVENT_GO_STATE_CHANGED:
+ {
+ if (e.event.goStateChanged.state != var0)
+ return;
+ ProcessAction(e, unit, var0, var1);
+ break;
+ }
default:
sLog->outErrorDb("SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType());
break;
@@ -2654,7 +2718,7 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff)
{
if (!(e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS))
{
- if (me && me->HasUnitState(UNIT_STAT_CASTING))
+ if (me && me->HasUnitState(UNIT_STATE_CASTING))
{
e.timer = 1;
return;
@@ -3001,7 +3065,6 @@ void SmartScript::SetScript9(SmartScriptHolder& e, uint32 entry)
i->event.type = SMART_EVENT_UPDATE_IC;
else if (e.action.timedActionList.timerType > 1)
i->event.type = SMART_EVENT_UPDATE;
- mResumeActionList = e.action.timedActionList.dontResume ? false : true;
InitTimer((*i));
}
}
diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h
index 7ebe8ca500f..fec38a690ed 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.h
+++ b/src/server/game/AI/SmartScripts/SmartScript.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -228,7 +228,6 @@ class SmartScript
SmartAIEventList mEvents;
SmartAIEventList mInstallEvents;
SmartAIEventList mTimedActionList;
- bool mResumeActionList;
Creature* me;
uint64 meOrigGUID;
GameObject* go;
@@ -237,7 +236,6 @@ class SmartScript
SmartScriptType mScriptType;
uint32 mEventPhase;
- uint32 mInvinceabilityHpLevel;
UNORDERED_MAP<int32, int32> mStoredDecimals;
uint32 mPathId;
SmartAIEventList mStoredEvents;
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 1df5849ca75..9a23d9e1390 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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 @@ void SmartWaypointMgr::LoadFromDB()
waypoint_map.clear();
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_LOAD_SMARTAI_WP);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_SMARTAI_WP);
PreparedQueryResult result = WorldDatabase.Query(stmt);
if (!result)
@@ -99,7 +99,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
for (uint8 i = 0; i < SMART_SCRIPT_TYPE_MAX; i++)
mEventMap[i].clear(); //Drop Existing SmartAI List
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_LOAD_SMART_SCRIPTS);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_SMART_SCRIPTS);
PreparedQueryResult result = WorldDatabase.Query(stmt);
if (!result)
@@ -254,12 +254,14 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
}
case SMART_TARGET_CREATURE_GUID:
{
- if (e.target.unitGUID.entry && !IsCreatureValid(e, e.target.unitGUID.entry)) return false;
+ if (e.target.unitGUID.entry && !IsCreatureValid(e, e.target.unitGUID.entry))
+ return false;
break;
}
case SMART_TARGET_GAMEOBJECT_GUID:
{
- if (e.target.goGUID.entry && !IsGameObjectValid(e, e.target.goGUID.entry)) return false;
+ if (e.target.goGUID.entry && !IsGameObjectValid(e, e.target.goGUID.entry))
+ return false;
break;
}
case SMART_TARGET_PLAYER_DISTANCE:
@@ -280,6 +282,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
case SMART_TARGET_HOSTILE_RANDOM:
case SMART_TARGET_HOSTILE_RANDOM_NOT_TOP:
case SMART_TARGET_ACTION_INVOKER:
+ case SMART_TARGET_INVOKER_PARTY:
case SMART_TARGET_POSITION:
case SMART_TARGET_NONE:
case SMART_TARGET_ACTION_INVOKER_VEHICLE:
@@ -287,6 +290,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
case SMART_TARGET_THREAT_LIST:
case SMART_TARGET_CLOSEST_GAMEOBJECT:
case SMART_TARGET_CLOSEST_CREATURE:
+ case SMART_TARGET_STORED:
break;
default:
sLog->outErrorDb("SmartAIMgr: Not handled target_type(%u), Entry %d SourceType %u Event %u Action %u, skipped.", e.GetTargetType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
@@ -475,6 +479,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
return false;
break;
}
+ case SMART_EVENT_GO_STATE_CHANGED:
case SMART_EVENT_TIMED_EVENT_TRIGGERED:
case SMART_EVENT_INSTANCE_PLAYER_ENTER:
case SMART_EVENT_TRANSPORT_RELOCATE:
@@ -797,6 +802,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_REMOVE_DYNAMIC_FLAG:
case SMART_ACTION_JUMP_TO_POS:
case SMART_ACTION_SEND_GOSSIP_MENU:
+ case SMART_ACTION_GO_SET_LOOT_STATE:
+ case SMART_ACTION_SEND_TARGET_TO_TARGET:
break;
default:
sLog->outErrorDb("SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index e8ec80672fc..e08fe331d3d 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -154,8 +154,9 @@ enum SMART_EVENT
SMART_EVENT_IS_BEHIND_TARGET = 67, //1 // cooldownMin, CooldownMax
SMART_EVENT_GAME_EVENT_START = 68, //1 // game_event.Entry
SMART_EVENT_GAME_EVENT_END = 69, //1 // game_event.Entry
+ SMART_EVENT_GO_STATE_CHANGED = 70, // go state
- SMART_EVENT_END = 70,
+ SMART_EVENT_END = 71,
};
struct SmartEvent
@@ -347,6 +348,11 @@ struct SmartEvent
struct
{
+ uint32 state;
+ } goStateChanged;
+
+ struct
+ {
uint32 param1;
uint32 param2;
uint32 param3;
@@ -466,8 +472,10 @@ enum SMART_ACTION
SMART_ACTION_REMOVE_DYNAMIC_FLAG = 96, // Flags
SMART_ACTION_JUMP_TO_POS = 97, // speedXY, speedZ, targetX, targetY, targetZ
SMART_ACTION_SEND_GOSSIP_MENU = 98, // menuId, optionId
+ SMART_ACTION_GO_SET_LOOT_STATE = 99, // state
+ SMART_ACTION_SEND_TARGET_TO_TARGET = 100, // id
- SMART_ACTION_END = 99,
+ SMART_ACTION_END = 101,
};
struct SmartAction
@@ -824,7 +832,6 @@ struct SmartAction
struct
{
uint32 id;
- uint32 dontResume;
uint32 timerType;
} timedActionList;
@@ -874,6 +881,16 @@ struct SmartAction
struct
{
+ uint32 state;
+ } setGoLootState;
+
+ struct
+ {
+ uint32 id;
+ } sendTargetToTarget;
+
+ struct
+ {
uint32 param1;
uint32 param2;
uint32 param3;
@@ -1138,6 +1155,7 @@ const uint32 SmartAIEventMask[SMART_EVENT_END][2] =
{SMART_EVENT_IS_BEHIND_TARGET, SMART_SCRIPT_TYPE_MASK_CREATURE },
{SMART_EVENT_GAME_EVENT_START, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
{SMART_EVENT_GAME_EVENT_END, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
+ {SMART_EVENT_GO_STATE_CHANGED, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
};
diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp
index 6c3dd69c0da..a6ae300e25d 100755
--- a/src/server/game/Accounts/AccountMgr.cpp
+++ b/src/server/game/Accounts/AccountMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,14 +37,14 @@ AccountOpResult CreateAccount(std::string username, std::string password)
if (GetId(username))
return AOR_NAME_ALREDY_EXIST; // username does already exist
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_ADD_ACCOUNT);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT);
stmt->setString(0, username);
stmt->setString(1, CalculateShaPassHash(username, password));
LoginDatabase.Execute(stmt);
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_ADD_REALM_CHARS);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_REALM_CHARACTERS_INIT);
LoginDatabase.Execute(stmt);
@@ -112,7 +112,7 @@ AccountOpResult ChangeUsername(uint32 accountId, std::string newUsername, std::s
normalizeString(newUsername);
normalizeString(newPassword);
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPDATE_USERNAME);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_USERNAME);
stmt->setString(0, newUsername);
stmt->setString(1, CalculateShaPassHash(newUsername, newPassword));
@@ -136,7 +136,7 @@ AccountOpResult ChangePassword(uint32 accountId, std::string newPassword)
normalizeString(username);
normalizeString(newPassword);
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPDATE_PASSWORD);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_PASSWORD);
stmt->setString(0, CalculateShaPassHash(username, newPassword));
stmt->setUInt32(1, accountId);
diff --git a/src/server/game/Accounts/AccountMgr.h b/src/server/game/Accounts/AccountMgr.h
index aca24e9522f..1b1ecfa994a 100755
--- a/src/server/game/Accounts/AccountMgr.h
+++ b/src/server/game/Accounts/AccountMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp
index 030837b2649..271e78abf67 100755
--- a/src/server/game/Achievements/AchievementMgr.cpp
+++ b/src/server/game/Achievements/AchievementMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -130,19 +130,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE:
if (!classRace.class_id && !classRace.race_id)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.",
+ sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.",
criteria->ID, criteria->requiredType, dataType);
return false;
}
if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.",
+ sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, classRace.class_id);
return false;
}
if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE) == 0)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_CLASS_RACE (%u) has non-existing race in value2 (%u), ignored.",
+ sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) has non-existing race in value2 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, classRace.race_id);
return false;
}
@@ -277,6 +277,26 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
return false;
}
return true;
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE:
+ if (!classRace.class_id && !classRace.race_id)
+ {
+ sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.",
+ criteria->ID, criteria->requiredType, dataType);
+ return false;
+ }
+ if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0)
+ {
+ sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.",
+ criteria->ID, criteria->requiredType, dataType, classRace.class_id);
+ return false;
+ }
+ if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE) == 0)
+ {
+ sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) has non-existing race in value2 (%u), ignored.",
+ criteria->ID, criteria->requiredType, dataType, classRace.race_id);
+ return false;
+ }
+ return true;
default:
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) has data for non-supported data type (%u), ignored.", criteria->ID, criteria->requiredType, dataType);
return false;
@@ -301,6 +321,14 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
if (classRace.race_id && classRace.race_id != target->ToPlayer()->getRace())
return false;
return true;
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE:
+ if (!source || source->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ if (classRace.class_id && classRace.class_id != source->ToPlayer()->getClass())
+ return false;
+ if (classRace.race_id && classRace.race_id != source->ToPlayer()->getRace())
+ return false;
+ return true;
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_LESS_HEALTH:
if (!target || target->GetTypeId() != TYPEID_PLAYER)
return false;
@@ -1148,10 +1176,9 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
// speedup for non-login case
if (miscValue1 && achievementCriteria->own_item.itemID != miscValue1)
continue;
- SetCriteriaProgress(achievementCriteria, GetPlayer()->GetItemCount(achievementCriteria->own_item.itemID, true));
+ SetCriteriaProgress(achievementCriteria, miscValue2, PROGRESS_ACCUMULATE);
break;
case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA:
- // miscvalue1 contains the personal rating
if (!miscValue1) // no update at login
continue;
diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h
index f88be974c9d..c7d838fcb44 100755
--- a/src/server/game/Achievements/AchievementMgr.h
+++ b/src/server/game/Achievements/AchievementMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,9 +63,10 @@ enum AchievementCriteriaDataType
ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT = 18, // 0 0 maker instance script call for check current criteria requirements fit
ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM = 19, // item_level item_quality for equipped item in slot to check item level and quality
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID = 20, // map_id 0 player must be on map with id in map_id
+ ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE = 21, // class_id race_id
};
-#define MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 21 // maximum value in AchievementCriteriaDataType enum
+#define MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 22 // maximum value in AchievementCriteriaDataType enum
class Player;
class Unit;
@@ -82,6 +83,7 @@ struct AchievementCriteriaData
uint32 id;
} creature;
// ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE = 2
+ // ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE = 21
struct
{
uint32 class_id;
diff --git a/src/server/game/Addons/AddonMgr.cpp b/src/server/game/Addons/AddonMgr.cpp
index ff6d16bef4d..528e682e8d4 100755
--- a/src/server/game/Addons/AddonMgr.cpp
+++ b/src/server/game/Addons/AddonMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@ void SaveAddon(AddonInfo const& addon)
{
std::string name = addon.Name;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_ADDON);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ADDON);
stmt->setString(0, name);
stmt->setUInt32(1, addon.CRC);
diff --git a/src/server/game/Addons/AddonMgr.h b/src/server/game/Addons/AddonMgr.h
index 72edc3d1f6f..38338b3980f 100755
--- a/src/server/game/Addons/AddonMgr.h
+++ b/src/server/game/Addons/AddonMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 0a2ff750a1b..e7504b4ddd2 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -145,7 +145,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction&
// set owner to bidder (to prevent delete item with sender char deleting)
// owner in `data` will set at mail receive and item extracting
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_ITEM_OWNER);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_OWNER);
stmt->setUInt32(0, auction->bidder);
stmt->setUInt32(1, pItem->GetGUIDLow());
trans->Append(stmt);
@@ -308,7 +308,7 @@ void AuctionHouseMgr::LoadAuctionItems()
uint32 oldMSTime = getMSTime();
// data needs to be at first place for Item::LoadFromDB
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_AUCTION_ITEMS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTION_ITEMS);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
@@ -355,7 +355,7 @@ void AuctionHouseMgr::LoadAuctions()
{
uint32 oldMSTime = getMSTime();
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_AUCTIONS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONS);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
@@ -704,7 +704,7 @@ void AuctionEntry::DeleteFromDB(SQLTransaction& trans) const
void AuctionEntry::SaveToDB(SQLTransaction& trans) const
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_AUCTION);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_AUCTION);
stmt->setUInt32(0, Id);
stmt->setUInt32(1, auctioneer);
stmt->setUInt32(2, item_guidlow);
@@ -776,7 +776,7 @@ void AuctionHouseMgr::DeleteExpiredAuctionsAtStartup()
time_t curTime = sWorld->GetGameTime();
// Query the DB to see if there are any expired auctions
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_EXPIRED_AUCTIONS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_EXPIRED_AUCTIONS);
stmt->setUInt32(0, (uint32)curTime+60);
PreparedQueryResult expAuctions = CharacterDatabase.Query(stmt);
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h
index d1fb26cbc80..f81393be761 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.h
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp
index b9fb5a13980..02707261d13 100755
--- a/src/server/game/Battlegrounds/ArenaTeam.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeam.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@ bool ArenaTeam::Create(uint64 captainGuid, uint8 type, std::string teamName, uin
uint32 captainLowGuid = GUID_LOPART(captainGuid);
// Save arena team to db
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_ARENA_TEAM);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_TEAM);
stmt->setUInt32(0, TeamId);
stmt->setString(1, TeamName);
stmt->setUInt32(2, captainLowGuid);
@@ -111,7 +111,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid)
{
// 0 1
// SELECT name, class FROM characters WHERE guid = ?
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_NAME_CLASS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_CLASS);
stmt->setUInt32(0, GUID_LOPART(playerGuid));
PreparedQueryResult result = CharacterDatabase.Query(stmt);
@@ -138,7 +138,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid)
personalRating = 1000;
// Try to get player's match maker rating from db and fall back to config setting if not found
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_MATCH_MAKER_RATING);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MATCH_MAKER_RATING);
stmt->setUInt32(0, GUID_LOPART(playerGuid));
stmt->setUInt8(1, GetSlot());
PreparedQueryResult result = CharacterDatabase.Query(stmt);
@@ -168,7 +168,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid)
Members.push_back(newmember);
// Save player's arena team membership to db
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_ARENA_TEAM_MEMBER);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_TEAM_MEMBER);
stmt->setUInt32(0, TeamId);
stmt->setUInt32(1, GUID_LOPART(playerGuid));
CharacterDatabase.Execute(stmt);
@@ -285,7 +285,7 @@ void ArenaTeam::SetCaptain(uint64 guid)
CaptainGuid = guid;
// Update database
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_ARENA_TEAM_CAPTAIN);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_CAPTAIN);
stmt->setUInt32(0, GUID_LOPART(guid));
stmt->setUInt32(1, GetId());
CharacterDatabase.Execute(stmt);
@@ -455,7 +455,7 @@ void ArenaTeam::Inspect(WorldSession* session, uint64 guid)
session->SendPacket(&data);
}
-void ArenaTeamMember::ModifyPersonalRating(Player* player, int32 mod, uint32 slot)
+void ArenaTeamMember::ModifyPersonalRating(Player* player, int32 mod, uint32 type)
{
if (int32(PersonalRating) + mod < 0)
PersonalRating = 0;
@@ -464,8 +464,8 @@ void ArenaTeamMember::ModifyPersonalRating(Player* player, int32 mod, uint32 slo
if (player)
{
- player->SetArenaTeamInfoField(slot, ARENA_TEAM_PERSONAL_RATING, PersonalRating);
- player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING, PersonalRating, slot);
+ player->SetArenaTeamInfoField(ArenaTeam::GetSlotByType(type), ARENA_TEAM_PERSONAL_RATING, PersonalRating);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING, PersonalRating, type);
}
}
@@ -725,7 +725,7 @@ void ArenaTeam::MemberLost(Player* player, uint32 againstMatchmakerRating, int32
{
// Update personal rating
int32 mod = GetRatingMod(itr->PersonalRating, againstMatchmakerRating, false);
- itr->ModifyPersonalRating(player, mod, GetSlot());
+ itr->ModifyPersonalRating(player, mod, GetType());
// Update matchmaker rating
itr->ModifyMatchmakerRating(MatchmakerRatingChange, GetSlot());
@@ -751,7 +751,7 @@ void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, i
{
// update personal rating
int32 mod = GetRatingMod(itr->PersonalRating, againstMatchmakerRating, false);
- itr->ModifyPersonalRating(NULL, mod, GetSlot());
+ itr->ModifyPersonalRating(NULL, mod, GetType());
// update matchmaker rating
itr->ModifyMatchmakerRating(MatchmakerRatingChange, GetSlot());
@@ -773,7 +773,7 @@ void ArenaTeam::MemberWon(Player* player, uint32 againstMatchmakerRating, int32
{
// update personal rating
int32 mod = GetRatingMod(itr->PersonalRating, againstMatchmakerRating, true);
- itr->ModifyPersonalRating(player, mod, GetSlot());
+ itr->ModifyPersonalRating(player, mod, GetType());
// update matchmaker rating
itr->ModifyMatchmakerRating(MatchmakerRatingChange, GetSlot());
@@ -828,7 +828,7 @@ void ArenaTeam::SaveToDB()
SQLTransaction trans = CharacterDatabase.BeginTransaction();
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_ARENA_TEAM_STATS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_STATS);
stmt->setUInt16(0, Stats.Rating);
stmt->setUInt16(1, Stats.WeekGames);
stmt->setUInt16(2, Stats.WeekWins);
@@ -840,7 +840,7 @@ void ArenaTeam::SaveToDB()
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_ARENA_TEAM_MEMBER);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_MEMBER);
stmt->setUInt16(0, itr->PersonalRating);
stmt->setUInt16(1, itr->WeekGames);
stmt->setUInt16(2, itr->WeekWins);
@@ -850,7 +850,7 @@ void ArenaTeam::SaveToDB()
stmt->setUInt32(6, GUID_LOPART(itr->Guid));
trans->Append(stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_CHARACTER_ARENA_STATS);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CHARACTER_ARENA_STATS);
stmt->setUInt32(0, GUID_LOPART(itr->Guid));
stmt->setUInt8(1, GetSlot());
stmt->setUInt16(2, itr->MatchMakerRating);
diff --git a/src/server/game/Battlegrounds/ArenaTeam.h b/src/server/game/Battlegrounds/ArenaTeam.h
index dce8c5776b7..d8ad2c09e59 100755
--- a/src/server/game/Battlegrounds/ArenaTeam.h
+++ b/src/server/game/Battlegrounds/ArenaTeam.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -97,7 +97,7 @@ struct ArenaTeamMember
uint16 PersonalRating;
uint16 MatchMakerRating;
- void ModifyPersonalRating(Player* player, int32 mod, uint32 slot);
+ void ModifyPersonalRating(Player* player, int32 mod, uint32 type);
void ModifyMatchmakerRating(int32 mod, uint32 slot);
};
diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
index cf335ec1971..719206ac625 100644
--- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 31f0a1773da..bf06418145d 100644
--- a/src/server/game/Battlegrounds/ArenaTeamMgr.h
+++ b/src/server/game/Battlegrounds/ArenaTeamMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 4ad00f5d7aa..08ca406e373 100755
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -771,6 +771,7 @@ void Battleground::EndBattleground(uint32 winner)
}
}
+ uint8 aliveWinners = GetAlivePlayersCountByTeam(winner);
for (BattlegroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
uint32 team = itr->second.Team;
@@ -796,6 +797,10 @@ void Battleground::EndBattleground(uint32 winner)
if (player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
+ // Last standing - Rated 5v5 arena & be solely alive player
+ if (team == winner && isArena() && isRated() && GetArenaType() == ARENA_TYPE_5v5 && aliveWinners == 1 && player->isAlive())
+ player->CastSpell(player, SPELL_THE_LAST_STANDING, true);
+
if (!player->isAlive())
{
player->ResurrectPlayer(1.0f);
@@ -819,7 +824,7 @@ void Battleground::EndBattleground(uint32 winner)
// update achievement BEFORE personal rating update
ArenaTeamMember* member = winner_arena_team->GetMember(player->GetGUID());
if (member)
- player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, member->PersonalRating);
+ player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, 1);
winner_arena_team->MemberWon(player, loser_matchmaker_rating, winner_matchmaker_change);
}
@@ -895,19 +900,6 @@ uint32 Battleground::GetBonusHonorFromKill(uint32 kills) const
return Trinity::Honor::hk_honor_at_level(maxLevel, float(kills));
}
-uint32 Battleground::GetBattlemasterEntry() const
-{
- switch (GetTypeID(true))
- {
- case BATTLEGROUND_AV: return 15972;
- case BATTLEGROUND_WS: return 14623;
- case BATTLEGROUND_AB: return 14879;
- case BATTLEGROUND_EY: return 22516;
- case BATTLEGROUND_NA: return 20200;
- default: return 0;
- }
-}
-
void Battleground::BlockMovement(Player* player)
{
player->SetClientControl(player, 0); // movement disabled NOTE: the effect will be automatically removed by client when the player is teleported from the battleground, so no need to send with uint8(1) in RemovePlayerAtLeave()
@@ -1245,8 +1237,6 @@ void Battleground::EventPlayerLoggedOut(Player* player)
if (GetAlivePlayersCountByTeam(player->GetTeam()) <= 1 && GetPlayersCountByTeam(GetOtherTeam(player->GetTeam())))
EndBattleground(GetOtherTeam(player->GetTeam()));
}
-
- player->LeaveBattleground();
}
// This method should be called only once ... it adds pointer to queue
diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h
index 9856312c337..6eb64a2caba 100755
--- a/src/server/game/Battlegrounds/Battleground.h
+++ b/src/server/game/Battlegrounds/Battleground.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -98,7 +98,8 @@ enum BattlegroundSpells
SPELL_RECENTLY_DROPPED_FLAG = 42792, // Recently Dropped Flag
SPELL_AURA_PLAYER_INACTIVE = 43681, // Inactive
SPELL_HONORABLE_DEFENDER_25Y = 68652, // +50% honor when standing at a capture point that you control, 25yards radius (added in 3.2)
- SPELL_HONORABLE_DEFENDER_60Y = 66157 // +50% honor when standing at a capture point that you control, 60yards radius (added in 3.2), probably for 40+ player battlegrounds
+ SPELL_HONORABLE_DEFENDER_60Y = 66157, // +50% honor when standing at a capture point that you control, 60yards radius (added in 3.2), probably for 40+ player battlegrounds
+ SPELL_THE_LAST_STANDING = 26549, // Arena achievement related
};
enum BattlegroundTimeIntervals
@@ -360,7 +361,6 @@ class Battleground
uint8 GetArenaType() const { return m_ArenaType; }
uint8 GetWinner() const { return m_Winner; }
uint32 GetScriptId() const { return ScriptId; }
- uint32 GetBattlemasterEntry() const;
uint32 GetBonusHonorFromKill(uint32 kills) const;
bool IsRandom() const { return m_IsRandom; }
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index b1a708b3d7f..77b985b205f 100755
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.h b/src/server/game/Battlegrounds/BattlegroundMgr.h
index 989509111bb..88559d07993 100755
--- a/src/server/game/Battlegrounds/BattlegroundMgr.h
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 963a41435c7..a5b00ed9db1 100755
--- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -731,7 +731,7 @@ this method is called when group is inserted, or player / group is removed from
it must be called after fully adding the members of a group to ensure group joining
should be called from Battleground::RemovePlayer function in some cases
*/
-void BattlegroundQueue::BattlegroundQueueUpdate(uint32 diff, BattlegroundTypeId bgTypeId, BattlegroundBracketId bracket_id, uint8 arenaType, bool isRated, uint32 arenaRating)
+void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundTypeId bgTypeId, BattlegroundBracketId bracket_id, uint8 arenaType, bool isRated, uint32 arenaRating)
{
//if no players in queue - do nothing
if (m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].empty() &&
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.h b/src/server/game/Battlegrounds/BattlegroundQueue.h
index 38c1d93bd7c..5cf5afc50ca 100755
--- a/src/server/game/Battlegrounds/BattlegroundQueue.h
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/BattlegroundAA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAA.cpp
index 1e8973edf10..61180ae88ea 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAA.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/BattlegroundAA.h b/src/server/game/Battlegrounds/Zones/BattlegroundAA.h
index bdf1ad7eedd..79af4269fbf 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAA.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAA.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 028773c5229..1e128429533 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,17 +28,6 @@
#include "Player.h"
#include "Util.h"
-// these variables aren't used outside of this file, so declare them only here
-uint32 BG_AB_HonorScoreTicks[BG_HONOR_MODE_NUM] = {
- 330, // normal honor
- 200 // holiday
-};
-
-uint32 BG_AB_ReputationScoreTicks[BG_HONOR_MODE_NUM] = {
- 200, // normal honor
- 150 // holiday
-};
-
BattlegroundAB::BattlegroundAB()
{
m_BuffChange = true;
@@ -202,6 +191,9 @@ void BattlegroundAB::StartingEventOpenDoors()
}
DoorOpen(BG_AB_OBJECT_GATE_A);
DoorOpen(BG_AB_OBJECT_GATE_H);
+
+ // Achievement: Let's Get This Done
+ StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, AB_EVENT_START_BATTLE);
}
void BattlegroundAB::AddPlayer(Player* player)
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h
index 39f3727d68e..50020a580b1 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -176,10 +176,12 @@ enum BG_AB_Objectives
AB_OBJECTIVE_DEFEND_BASE = 123
};
-#define BG_AB_NotABBGWeekendHonorTicks 330
-#define BG_AB_ABBGWeekendHonorTicks 200
-#define BG_AB_NotABBGWeekendReputationTicks 200
-#define BG_AB_ABBGWeekendReputationTicks 150
+#define BG_AB_NotABBGWeekendHonorTicks 260
+#define BG_AB_ABBGWeekendHonorTicks 160
+#define BG_AB_NotABBGWeekendReputationTicks 160
+#define BG_AB_ABBGWeekendReputationTicks 120
+
+#define AB_EVENT_START_BATTLE 9158 // Achievement: Let's Get This Done
// x, y, z, o
const float BG_AB_NodePositions[BG_AB_DYNAMIC_NODES_COUNT][4] = {
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
index fe570930870..f2e8c2bf0af 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -420,6 +420,9 @@ void BattlegroundAV::StartingEventOpenDoors()
DoorOpen(BG_AV_OBJECT_DOOR_H);
DoorOpen(BG_AV_OBJECT_DOOR_A);
+
+ // Achievement: The Alterac Blitz
+ StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, AV_EVENT_START_BATTLE);
}
void BattlegroundAV::AddPlayer(Player* player)
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
index 2c8ffc0cf72..82e231c63fa 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,8 @@ class Battleground;
#define BG_AV_KILL_SURVIVING_CAPTAIN 2
#define BG_AV_REP_SURVIVING_CAPTAIN 125
+#define AV_EVENT_START_BATTLE 9166 // Achievement: The Alterac Blitz
+
enum BG_AV_Sounds
{ //TODO: get out if there comes a sound when neutral team captures mine
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp
index 88b9aa6184e..0e79296b6f4 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 1b4fa8ebd64..8c0df2bc329 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 754005f3f33..87f4ca48378 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.h b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h
index 625eb1c7533..f2ba2cea1e7 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
index c790d64e986..b7994d0052c 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -30,8 +30,8 @@
// these variables aren't used outside of this file, so declare them only here
uint32 BG_EY_HonorScoreTicks[BG_HONOR_MODE_NUM] = {
- 330, // normal honor
- 200 // holiday
+ 260, // normal honor
+ 160 // holiday
};
BattlegroundEY::BattlegroundEY()
@@ -120,6 +120,9 @@ void BattlegroundEY::StartingEventOpenDoors()
uint8 buff = urand(0, 2);
SpawnBGObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + buff + i * 3, RESPAWN_IMMEDIATELY);
}
+
+ // Achievement: Flurry
+ StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EY_EVENT_START_BATTLE);
}
void BattlegroundEY::AddPoints(uint32 Team, uint32 Points)
@@ -193,7 +196,6 @@ void BattlegroundEY::CheckSomeoneLeftPoint()
//move not existed player to "free space" - this will cause many error showing in log, but it is a very important bug
m_PlayersNearPoint[EY_POINTS_MAX].push_back(m_PlayersNearPoint[i][j]);
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
- ++j;
continue;
}
if (!player->CanCaptureTowerPoint() || !player->IsWithinDistInMap(obj, BG_EY_POINT_RADIUS))
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h
index aba5754752a..026fbccc320 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -217,8 +217,10 @@ enum EYBattlegroundObjectTypes
BG_EY_OBJECT_MAX = 59
};
-#define BG_EY_NotEYWeekendHonorTicks 330
-#define BG_EY_EYWeekendHonorTicks 200
+#define BG_EY_NotEYWeekendHonorTicks 260
+#define BG_EY_EYWeekendHonorTicks 160
+
+#define EY_EVENT_START_BATTLE 13180 // Achievement: Flurry
enum BG_EY_Score
{
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
index f17df3aaf67..40f31cef394 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,9 +175,9 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
{
if (siege->isAlive())
{
- if (siege->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_OOC_NOT_ATTACKABLE))
+ if (siege->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_IMMUNE_TO_PC))
// following sniffs the vehicle always has UNIT_FLAG_UNK_14
- siege->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ siege->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_IMMUNE_TO_PC);
else
siege->SetHealth(siege->GetMaxHealth());
}
@@ -793,7 +793,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
if (Creature* siegeEngine = GetBGCreature(siegeType))
{
- siegeEngine->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ siegeEngine->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_IMMUNE_TO_PC);
siegeEngine->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h
index 552b79ce608..90f39a61e12 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 37fdd2559c4..cee8cb2b4da 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 e7fe08063a4..53c0faf1c6f 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundNA.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundNA.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/BattlegroundRB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRB.cpp
index ba4d787b215..c304c194a71 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundRB.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundRB.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/BattlegroundRB.h b/src/server/game/Battlegrounds/Zones/BattlegroundRB.h
index ef6283ed96a..cda1351ca12 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundRB.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundRB.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 3d1ebe8fec9..f1602507cc1 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 5528d0ccf9e..dc041a18a1c 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundRL.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundRL.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 0c44c5d3d96..539419d6c50 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.h b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h
index 70417c1dfce..4f99af268db 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 aaa29e1ca20..5ee1a7bcc58 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -783,7 +783,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
{
- if (object->GetEntry() == BG_SA_ObjEntries[BG_SA_TITAN_RELIC] && GateStatus[BG_SA_ANCIENT_GATE] == BG_SA_GATE_DESTROYED)
+ if (object->GetEntry() == BG_SA_ObjEntries[BG_SA_TITAN_RELIC] && GateStatus[BG_SA_ANCIENT_GATE] == BG_SA_GATE_DESTROYED && GateStatus[BG_SA_YELLOW_GATE] == BG_SA_GATE_DESTROYED && (GateStatus[BG_SA_PURPLE_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_RED_GATE] == BG_SA_GATE_DESTROYED) && (GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED))
{
if (Source->GetTeamId() == Attackers)
{
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h
index 8b446fccb9e..76a772ff978 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 a6aa6f41db2..226bf172a09 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.h b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h
index b3c2c88c306..063d04253a5 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 65ba16007d4..ac1bb9e5cac 100644
--- a/src/server/game/CMakeLists.txt
+++ b/src/server/game/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2012 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
@@ -30,6 +30,7 @@ file(GLOB_RECURSE sources_Globals Globals/*.cpp Globals/*.h)
file(GLOB_RECURSE sources_Grids Grids/*.cpp Grids/*.h)
file(GLOB_RECURSE sources_Groups Groups/*.cpp Groups/*.h)
file(GLOB_RECURSE sources_Guilds Guilds/*.cpp Guilds/*.h)
+file(GLOB_RECURSE sources_Handlers Handlers/*.cpp Handlers/*.h)
file(GLOB_RECURSE sources_Instances Instances/*.cpp Instances/*.h)
file(GLOB_RECURSE sources_Loot Loot/*.cpp Loot/*.h)
file(GLOB_RECURSE sources_Mails Mails/*.cpp Mails/*.h)
@@ -79,6 +80,7 @@ set(game_STAT_SRCS
${sources_Grids}
${sources_Groups}
${sources_Guilds}
+ ${sources_Handlers}
${sources_Instances}
${sources_Loot}
${sources_Mails}
@@ -102,6 +104,7 @@ set(game_STAT_SRCS
include_directories(
${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/dep/g3dlite/include
${CMAKE_SOURCE_DIR}/dep/mersennetwister
${CMAKE_SOURCE_DIR}/dep/SFMT
${CMAKE_SOURCE_DIR}/dep/zlib
@@ -114,12 +117,10 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/shared/Database
${CMAKE_SOURCE_DIR}/src/server/shared/DataStores
${CMAKE_SOURCE_DIR}/src/server/shared/Debugging
- ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/CountedReference
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic
${CMAKE_SOURCE_DIR}/src/server/shared/Logging
${CMAKE_SOURCE_DIR}/src/server/shared/Packets
- ${CMAKE_SOURCE_DIR}/src/server/shared/Policies
${CMAKE_SOURCE_DIR}/src/server/shared/Threading
${CMAKE_SOURCE_DIR}/src/server/shared/Utilities
${CMAKE_CURRENT_SOURCE_DIR}
@@ -164,12 +165,14 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/Grids
${CMAKE_CURRENT_SOURCE_DIR}/Groups
${CMAKE_CURRENT_SOURCE_DIR}/Guilds
+ ${CMAKE_CURRENT_SOURCE_DIR}/Handlers
${CMAKE_CURRENT_SOURCE_DIR}/Instances
${CMAKE_CURRENT_SOURCE_DIR}/Loot
${CMAKE_CURRENT_SOURCE_DIR}/Mails
${CMAKE_CURRENT_SOURCE_DIR}/Maps
${CMAKE_CURRENT_SOURCE_DIR}/Miscellaneous
${CMAKE_CURRENT_SOURCE_DIR}/Movement
+ ${CMAKE_CURRENT_SOURCE_DIR}/Movement/Spline
${CMAKE_CURRENT_SOURCE_DIR}/Movement/MovementGenerators
${CMAKE_CURRENT_SOURCE_DIR}/Movement/Waypoints
${CMAKE_CURRENT_SOURCE_DIR}/OutdoorPvP
@@ -179,7 +182,6 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/Reputation
${CMAKE_CURRENT_SOURCE_DIR}/Scripting
${CMAKE_CURRENT_SOURCE_DIR}/Server/Protocol
- ${CMAKE_CURRENT_SOURCE_DIR}/Server/Protocol/Handlers
${CMAKE_CURRENT_SOURCE_DIR}/Server
${CMAKE_CURRENT_SOURCE_DIR}/Skills
${CMAKE_CURRENT_SOURCE_DIR}/Spells
diff --git a/src/server/game/Calendar/Calendar.cpp b/src/server/game/Calendar/Calendar.cpp
index e31f2763d23..2c4ad943dd6 100755
--- a/src/server/game/Calendar/Calendar.cpp
+++ b/src/server/game/Calendar/Calendar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Calendar/Calendar.h b/src/server/game/Calendar/Calendar.h
index 2aa0ad65640..dfc88e477f9 100755
--- a/src/server/game/Calendar/Calendar.h
+++ b/src/server/game/Calendar/Calendar.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp
index 244c05ec0ad..b6e9dd30d28 100755
--- a/src/server/game/Chat/Channels/Channel.cpp
+++ b/src/server/game/Chat/Channels/Channel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
// If storing custom channels in the db is enabled either load or save the channel
if (sWorld->getBoolConfig(CONFIG_PRESERVE_CUSTOM_CHANNELS))
{
- PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_CHANNEL);
+ PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHANNEL);
stmt->setString(0, name);
stmt->setUInt32(1, m_Team);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
@@ -85,7 +85,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
}
else // save
{
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_CHANNEL);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHANNEL);
stmt->setString(0, name);
stmt->setUInt32(1, m_Team);
CharacterDatabase.Execute(stmt);
@@ -108,7 +108,7 @@ void Channel::UpdateChannelInDB() const
std::string banListStr = banlist.str();
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_CHANNEL);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL);
stmt->setBool(0, m_announce);
stmt->setBool(1, m_ownership);
stmt->setString(2, m_password);
@@ -124,7 +124,7 @@ void Channel::UpdateChannelInDB() const
void Channel::UpdateChannelUseageInDB() const
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_CHANNEL_USAGE);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_USAGE);
stmt->setString(0, m_name);
stmt->setUInt32(1, m_Team);
CharacterDatabase.Execute(stmt);
diff --git a/src/server/game/Chat/Channels/Channel.h b/src/server/game/Chat/Channels/Channel.h
index 8ce13a6afa1..9564dbb381e 100755
--- a/src/server/game/Chat/Channels/Channel.h
+++ b/src/server/game/Chat/Channels/Channel.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 651e5d15647..75436e1eb5f 100755
--- a/src/server/game/Chat/Channels/ChannelMgr.cpp
+++ b/src/server/game/Chat/Channels/ChannelMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 f46f8d360c1..ac030ffb73f 100755
--- a/src/server/game/Chat/Channels/ChannelMgr.h
+++ b/src/server/game/Chat/Channels/ChannelMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 185ac487481..035fbaf5b78 100755
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -885,11 +885,11 @@ bool ChatHandler::ShowHelpForSubCommands(ChatCommand* table, char const* cmd, ch
std::string list;
for (uint32 i = 0; table[i].Name != NULL; ++i)
{
- // must be available (ignore handler existence for show command with possibe avalable subcomands
+ // must be available (ignore handler existence for show command with possible available subcommands)
if (!isAvailable(table[i]))
continue;
- /// for empty subcmd show all available
+ // for empty subcmd show all available
if (*subcmd && !hasStringAbbr(table[i].Name, subcmd))
continue;
@@ -924,7 +924,7 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand* table, const char* cmd)
{
for (uint32 i = 0; table[i].Name != NULL; ++i)
{
- // must be available (ignore handler existence for show command with possibe avalable subcomands
+ // must be available (ignore handler existence for show command with possible available subcommands)
if (!isAvailable(table[i]))
continue;
@@ -954,7 +954,7 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand* table, const char* cmd)
{
for (uint32 i = 0; table[i].Name != NULL; ++i)
{
- // must be available (ignore handler existence for show command with possibe avalable subcomands
+ // must be available (ignore handler existence for show command with possible available subcommands)
if (!isAvailable(table[i]))
continue;
diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h
index d9190265bbb..2311f4b8e5e 100755
--- a/src/server/game/Chat/Chat.h
+++ b/src/server/game/Chat/Chat.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp
index 26f63aa77ee..d26f937c43d 100644
--- a/src/server/game/Chat/ChatLink.cpp
+++ b/src/server/game/Chat/ChatLink.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 4b27cab29d3..392d28aca54 100644
--- a/src/server/game/Chat/ChatLink.h
+++ b/src/server/game/Chat/ChatLink.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp
index 7ff7a82bf58..6d33a5761f4 100755
--- a/src/server/game/Chat/Commands/Level0.cpp
+++ b/src/server/game/Chat/Commands/Level0.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp
index f06f8a7e89c..57d5e8cfa94 100755
--- a/src/server/game/Chat/Commands/Level1.cpp
+++ b/src/server/game/Chat/Commands/Level1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp
index 5411b1364c0..68961b9de61 100755
--- a/src/server/game/Chat/Commands/Level2.cpp
+++ b/src/server/game/Chat/Commands/Level2.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -76,7 +76,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
if (HasLowerSecurity (target, target_guid, true))
return false;
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPDATE_MUTE_TIME);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
if (target)
{
@@ -139,7 +139,7 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
target->GetSession()->m_muteTime = 0;
}
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPDATE_MUTE_TIME);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
stmt->setInt64(0, 0);
stmt->setUInt32(1, accountId);
@@ -332,8 +332,8 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel, a.email, a.last_ip, a.last_login, a.mutetime "
"FROM account a "
"LEFT JOIN account_access aa "
- "ON (a.id = aa.id) "
- "WHERE a.id = '%u'", accId);
+ "ON (a.id = aa.id AND (aa.RealmID = -1 OR aa.RealmID = %u)) "
+ "WHERE a.id = '%u'", realmID, accId);
if (result)
{
Field* fields = result->Fetch();
@@ -479,7 +479,7 @@ bool ChatHandler::HandleCharacterRenameCommand(const char* args)
PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_AT_LOGIN_FLAG);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_RENAME));
stmt->setUInt32(1, GUID_LOPART(targetGuid));
@@ -499,7 +499,7 @@ bool ChatHandler::HandleCharacterCustomizeCommand(const char* args)
if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_AT_LOGIN_FLAG);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE));
@@ -533,7 +533,7 @@ bool ChatHandler::HandleCharacterChangeFactionCommand(const char* args)
if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_AT_LOGIN_FLAG);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_FACTION));
@@ -566,9 +566,9 @@ bool ChatHandler::HandleCharacterChangeRaceCommand(const char * args)
if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_AT_LOGIN_FLAG);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
- stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_FACTION));
+ stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_RACE));
if (target)
{
@@ -707,19 +707,32 @@ bool ChatHandler::HandleCombatStopCommand(const char* args)
bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
{
+ std::string ip;
+ int32 limit;
+ char* limit_str;
+ Player *chr = getSelectedPlayer();
if (!*args)
- return false;
+ {
+ // NULL only if used from console
+ if (!chr || chr == GetSession()->GetPlayer())
+ return false;
- std::string ip = strtok ((char*)args, " ");
- char* limit_str = strtok (NULL, " ");
- int32 limit = limit_str ? atoi (limit_str) : -1;
+ ip = chr->GetSession()->GetRemoteAddress();
+ limit = -1;
+ }
+ else
+ {
+ ip = strtok ((char*)args, " ");
+ limit_str = strtok (NULL, " ");
+ limit = limit_str ? atoi (limit_str) : -1;
+ }
- LoginDatabase.EscapeString (ip);
+ LoginDatabase.EscapeString(ip);
- QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE last_ip = '%s'", ip.c_str ());
+ QueryResult result = LoginDatabase.PQuery("SELECT id, username FROM account WHERE last_ip = '%s'", ip.c_str());
- return LookupPlayerSearchCommand (result, limit);
+ return LookupPlayerSearchCommand(result, limit);
}
bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args)
diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp
index 9b29483bcb4..cb3eb825354 100755
--- a/src/server/game/Chat/Commands/Level3.cpp
+++ b/src/server/game/Chat/Commands/Level3.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -2198,7 +2198,7 @@ void ChatHandler::HandleCharacterLevel(Player* player, uint64 playerGuid, uint32
else
{
// Update level and reset XP, everything else will be updated at login
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_LEVEL);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL);
stmt->setUInt8(0, uint8(newLevel));
stmt->setUInt32(1, GUID_LOPART(playerGuid));
@@ -2585,7 +2585,7 @@ bool ChatHandler::HandleResetSpellsCommand(const char* args)
}
else
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_AT_LOGIN_FLAG);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_RESET_SPELLS));
stmt->setUInt32(1, GUID_LOPART(targetGuid));
@@ -2643,7 +2643,7 @@ bool ChatHandler::HandleResetTalentsCommand(const char* args)
}
else if (targetGuid)
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_AT_LOGIN_FLAG);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS));
stmt->setUInt32(1, GUID_LOPART(targetGuid));
@@ -2691,7 +2691,7 @@ bool ChatHandler::HandleResetAllCommand(const char * args)
return false;
}
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_ALL_AT_LOGIN_FLAGS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ALL_AT_LOGIN_FLAGS);
stmt->setUInt16(0, uint16(atLogin));
@@ -3112,7 +3112,7 @@ bool ChatHandler::HandleBanInfoCharacterCommand(const char *args)
if (!target)
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_GUID_BY_NAME);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME);
stmt->setString(0, name);
PreparedQueryResult resultCharacter = CharacterDatabase.Query(stmt);
@@ -3127,7 +3127,7 @@ bool ChatHandler::HandleBanInfoCharacterCommand(const char *args)
else
target_guid = target->GetGUIDLow();
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_BANINFO);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO);
stmt->setUInt32(0, target_guid);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
@@ -3222,7 +3222,7 @@ bool ChatHandler::HandleBanListCharacterCommand(const char *args)
return false;
std::string filter(cFilter);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_GUID_BY_NAME_FILTER);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME_FILTER);
stmt->setString(0, filter.c_str());
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
@@ -3239,7 +3239,7 @@ bool ChatHandler::HandleBanListCharacterCommand(const char *args)
do
{
Field* fields = result->Fetch();
- PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_GET_BANNED_NAME);
+ PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANNED_NAME);
stmt2->setUInt32(0, fields[0].GetUInt32());
PreparedQueryResult banresult = CharacterDatabase.Query(stmt2);
if (banresult)
@@ -3261,7 +3261,7 @@ bool ChatHandler::HandleBanListCharacterCommand(const char *args)
std::string char_name = fields[1].GetString();
- PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_GET_BANINFO_LIST);
+ PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO_LIST);
stmt2->setUInt32(0, fields[0].GetUInt32());
PreparedQueryResult banInfo = CharacterDatabase.Query(stmt2);
if (banInfo)
@@ -3692,6 +3692,9 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/)
PSendSysMessage(LANG_MOVEGENS_LIST, (unit->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), unit->GetGUIDLow());
MotionMaster* mm = unit->GetMotionMaster();
+ float x,y,z;
+ mm->GetDestination(x,y,z);
+
for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i)
{
MovementGenerator* mg = mm->GetMotionSlot(i);
@@ -3707,48 +3710,55 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/)
case WAYPOINT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_WAYPOINT); break;
case ANIMAL_RANDOM_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_ANIMAL_RANDOM); break;
case CONFUSED_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_CONFUSED); break;
- case TARGETED_MOTION_TYPE:
+ case CHASE_MOTION_TYPE:
{
+ Unit* target = NULL;
if (unit->GetTypeId() == TYPEID_PLAYER)
- {
- TargetedMovementGenerator<Player> const* mgen = static_cast<TargetedMovementGenerator<Player> const*>(mg);
- Unit* target = mgen->GetTarget();
- if (target)
- PSendSysMessage(LANG_MOVEGENS_TARGETED_PLAYER, target->GetName(), target->GetGUIDLow());
- else
- SendSysMessage(LANG_MOVEGENS_TARGETED_NULL);
- }
+ target = static_cast<ChaseMovementGenerator<Player> const*>(mg)->GetTarget();
else
- {
- TargetedMovementGenerator<Creature> const* mgen = static_cast<TargetedMovementGenerator<Creature> const*>(mg);
- Unit* target = mgen->GetTarget();
- if (target)
- PSendSysMessage(LANG_MOVEGENS_TARGETED_CREATURE, target->GetName(), target->GetGUIDLow());
- else
- SendSysMessage(LANG_MOVEGENS_TARGETED_NULL);
- }
+ target = static_cast<ChaseMovementGenerator<Creature> const*>(mg)->GetTarget();
+
+ if (!target)
+ SendSysMessage(LANG_MOVEGENS_CHASE_NULL);
+ else if (target->GetTypeId() == TYPEID_PLAYER)
+ PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName(), target->GetGUIDLow());
+ else
+ PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName(), target->GetGUIDLow());
break;
}
+ case FOLLOW_MOTION_TYPE:
+ {
+ Unit* target = NULL;
+ if (unit->GetTypeId() == TYPEID_PLAYER)
+ target = static_cast<FollowMovementGenerator<Player> const*>(mg)->GetTarget();
+ else
+ target = static_cast<FollowMovementGenerator<Creature> const*>(mg)->GetTarget();
+
+ if (!target)
+ SendSysMessage(LANG_MOVEGENS_FOLLOW_NULL);
+ else if (target->GetTypeId() == TYPEID_PLAYER)
+ PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName(), target->GetGUIDLow());
+ else
+ PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName(), target->GetGUIDLow());
+ break;
+ }
case HOME_MOTION_TYPE:
+ {
if (unit->GetTypeId() == TYPEID_UNIT)
- {
- float x, y, z;
- mg->GetDestination(x, y, z);
PSendSysMessage(LANG_MOVEGENS_HOME_CREATURE, x, y, z);
- }
else
SendSysMessage(LANG_MOVEGENS_HOME_PLAYER);
break;
+ }
case FLIGHT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_FLIGHT); break;
case POINT_MOTION_TYPE:
{
- float x, y, z;
- mg->GetDestination(x, y, z);
PSendSysMessage(LANG_MOVEGENS_POINT, x, y, z);
break;
}
case FLEEING_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_FEAR); break;
case DISTRACT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_DISTRACT); break;
+ case EFFECT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_EFFECT); break;
default:
PSendSysMessage(LANG_MOVEGENS_UNKNOWN, mg->GetMovementGeneratorType());
break;
@@ -4040,19 +4050,14 @@ bool ChatHandler::HandleComeToMeCommand(const char *args)
if (!newFlagStr)
return false;
- uint32 newFlags = (uint32)strtoul(newFlagStr, NULL, 0);
-
Creature* caster = getSelectedCreature();
if (!caster)
{
- m_session->GetPlayer()->SetUnitMovementFlags(newFlags);
SendSysMessage(LANG_SELECT_CREATURE);
SetSentErrorMessage(true);
return false;
}
- caster->SetUnitMovementFlags(newFlags);
-
Player* player = m_session->GetPlayer();
caster->GetMotionMaster()->MovePoint(0, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
@@ -4467,7 +4472,7 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args)
{
if (chn)
chn->SetOwnership(true);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_CHANNEL_OWNERSHIP);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
stmt->setUInt8 (0, 1);
stmt->setString(1, channel);
CharacterDatabase.Execute(stmt);
@@ -4477,7 +4482,7 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args)
{
if (chn)
chn->SetOwnership(false);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_CHANNEL_OWNERSHIP);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
stmt->setUInt8 (0, 0);
stmt->setString(1, channel);
CharacterDatabase.Execute(stmt);
diff --git a/src/server/game/Chat/Commands/TicketCommands.cpp b/src/server/game/Chat/Commands/TicketCommands.cpp
index d38da9eb97c..138466f9623 100755
--- a/src/server/game/Chat/Commands/TicketCommands.cpp
+++ b/src/server/game/Chat/Commands/TicketCommands.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/Combat/HostileRefManager.cpp b/src/server/game/Combat/HostileRefManager.cpp
index 95ecac414cc..05b4fa171c7 100755
--- a/src/server/game/Combat/HostileRefManager.cpp
+++ b/src/server/game/Combat/HostileRefManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 36fe6f7a6b7..8a49d230161 100755
--- a/src/server/game/Combat/HostileRefManager.h
+++ b/src/server/game/Combat/HostileRefManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 6303181a44d..d82e43ba83b 100755
--- a/src/server/game/Combat/ThreatManager.cpp
+++ b/src/server/game/Combat/ThreatManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -180,7 +180,7 @@ void HostileReference::updateOnlineStatus()
// target is not in flight
if (isValid()
&& (getTarget()->GetTypeId() != TYPEID_PLAYER || !getTarget()->ToPlayer()->isGameMaster())
- && !getTarget()->HasUnitState(UNIT_STAT_IN_FLIGHT)
+ && !getTarget()->HasUnitState(UNIT_STATE_IN_FLIGHT)
&& getTarget()->IsInMap(getSourceUnit())
)
{
diff --git a/src/server/game/Combat/ThreatManager.h b/src/server/game/Combat/ThreatManager.h
index 261f9cd93ab..ce1f6de2ab0 100755
--- a/src/server/game/Combat/ThreatManager.h
+++ b/src/server/game/Combat/ThreatManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 d55fd4773f6..39c79b8273a 100755
--- a/src/server/game/Combat/UnitEvents.h
+++ b/src/server/game/Combat/UnitEvents.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 cf349044042..8562c66c29f 100755
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,7 +63,7 @@ bool Condition::Meets(Player* player, Unit* invoker)
case CONDITION_REPUTATION_RANK:
{
if (FactionEntry const* faction = sFactionStore.LookupEntry(mConditionValue1))
- condMeets = uint32(player->GetReputationMgr().GetRank(faction)) == mConditionValue2;
+ condMeets = (mConditionValue2 & (1 << player->GetReputationMgr().GetRank(faction)));
break;
}
case CONDITION_ACHIEVEMENT:
@@ -73,10 +73,10 @@ bool Condition::Meets(Player* player, Unit* invoker)
condMeets = player->GetTeam() == mConditionValue1;
break;
case CONDITION_CLASS:
- condMeets = player->getClass() == mConditionValue1;
+ condMeets = player->getClassMask() & mConditionValue1;
break;
case CONDITION_RACE:
- condMeets = player->getRace() == mConditionValue1;
+ condMeets = player->getRaceMask() & mConditionValue1;
break;
case CONDITION_SKILL:
condMeets = player->HasSkill(mConditionValue1) && player->GetBaseSkillValue(mConditionValue1) >= mConditionValue2;
@@ -243,33 +243,33 @@ ConditionMgr::~ConditionMgr()
ConditionList ConditionMgr::GetConditionReferences(uint32 refId)
{
ConditionList conditions;
- ConditionReferenceMap::const_iterator ref = m_ConditionReferenceMap.find(refId);
- if (ref != m_ConditionReferenceMap.end())
+ ConditionReferenceContainer::const_iterator ref = ConditionReferenceStore.find(refId);
+ if (ref != ConditionReferenceStore.end())
conditions = (*ref).second;
return conditions;
}
bool ConditionMgr::IsPlayerMeetToConditionList(Player* player, ConditionList const& conditions, Unit* invoker /*= NULL*/)
{
- std::map<uint32, bool> ElseGroupMap;
+ std::map<uint32, bool> ElseGroupStore;
for (ConditionList::const_iterator i = conditions.begin(); i != conditions.end(); ++i)
{
sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u", (*i)->mConditionType, (*i)->mConditionValue1);
if ((*i)->isLoaded())
{
- std::map<uint32, bool>::const_iterator itr = ElseGroupMap.find((*i)->mElseGroup);
- if (itr == ElseGroupMap.end())
- ElseGroupMap[(*i)->mElseGroup] = true;
+ std::map<uint32, bool>::const_iterator itr = ElseGroupStore.find((*i)->mElseGroup);
+ if (itr == ElseGroupStore.end())
+ ElseGroupStore[(*i)->mElseGroup] = true;
else if (!(*itr).second)
continue;
if ((*i)->mReferenceId)//handle reference
{
- ConditionReferenceMap::const_iterator ref = m_ConditionReferenceMap.find((*i)->mReferenceId);
- if (ref != m_ConditionReferenceMap.end())
+ ConditionReferenceContainer::const_iterator ref = ConditionReferenceStore.find((*i)->mReferenceId);
+ if (ref != ConditionReferenceStore.end())
{
if (!IsPlayerMeetToConditionList(player, (*ref).second, invoker))
- ElseGroupMap[(*i)->mElseGroup] = false;
+ ElseGroupStore[(*i)->mElseGroup] = false;
}
else
{
@@ -281,11 +281,11 @@ bool ConditionMgr::IsPlayerMeetToConditionList(Player* player, ConditionList con
else //handle normal condition
{
if (!(*i)->Meets(player, invoker))
- ElseGroupMap[(*i)->mElseGroup] = false;
+ ElseGroupStore[(*i)->mElseGroup] = false;
}
}
}
- for (std::map<uint32, bool>::const_iterator i = ElseGroupMap.begin(); i != ElseGroupMap.end(); ++i)
+ for (std::map<uint32, bool>::const_iterator i = ElseGroupStore.begin(); i != ElseGroupStore.end(); ++i)
if (i->second)
return true;
@@ -309,19 +309,19 @@ bool ConditionMgr::IsPlayerMeetToConditions(Player* player, ConditionList const&
return result;
}
-ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType sType, uint32 uEntry)
+ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType sourceType, uint32 entry)
{
ConditionList spellCond;
- if (sType > CONDITION_SOURCE_TYPE_NONE && sType < CONDITION_SOURCE_TYPE_MAX)
+ if (sourceType > CONDITION_SOURCE_TYPE_NONE && sourceType < CONDITION_SOURCE_TYPE_MAX)
{
- ConditionMap::const_iterator itr = m_ConditionMap.find(sType);
- if (itr != m_ConditionMap.end())
+ ConditionContainer::const_iterator itr = ConditionStore.find(sourceType);
+ if (itr != ConditionStore.end())
{
- ConditionTypeMap::const_iterator i = (*itr).second.find(uEntry);
+ ConditionTypeContainer::const_iterator i = (*itr).second.find(entry);
if (i != (*itr).second.end())
{
spellCond = (*i).second;
- sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForNotGroupedEntry: found conditions for type %u and entry %u", uint32(sType), uEntry);
+ sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForNotGroupedEntry: found conditions for type %u and entry %u", uint32(sourceType), entry);
}
}
}
@@ -331,10 +331,10 @@ ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType
ConditionList ConditionMgr::GetConditionsForVehicleSpell(uint32 creatureID, uint32 spellID)
{
ConditionList cond;
- VehicleSpellConditionMap::const_iterator itr = m_VehicleSpellConditions.find(creatureID);
- if (itr != m_VehicleSpellConditions.end())
+ VehicleSpellConditionContainer::const_iterator itr = VehicleSpellConditionStore.find(creatureID);
+ if (itr != VehicleSpellConditionStore.end())
{
- ConditionTypeMap::const_iterator i = (*itr).second.find(spellID);
+ ConditionTypeContainer::const_iterator i = (*itr).second.find(spellID);
if (i != (*itr).second.end())
{
cond = (*i).second;
@@ -344,6 +344,22 @@ ConditionList ConditionMgr::GetConditionsForVehicleSpell(uint32 creatureID, uint
return cond;
}
+ConditionList ConditionMgr::GetConditionsForSmartEvent(int32 entryOrGuid, uint32 eventId, uint32 sourceType)
+{
+ ConditionList cond;
+ SmartEventConditionContainer::const_iterator itr = SmartEventConditionStore.find(std::make_pair(entryOrGuid, sourceType));
+ if (itr != SmartEventConditionStore.end())
+ {
+ ConditionTypeContainer::const_iterator i = (*itr).second.find(eventId + 1);
+ if (i != (*itr).second.end())
+ {
+ cond = (*i).second;
+ sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForSmartEvent: found conditions for Smart Event entry or guid %d event_id %u", entryOrGuid, eventId);
+ }
+ }
+ return cond;
+}
+
void ConditionMgr::LoadConditions(bool isReload)
{
uint32 oldMSTime = getMSTime();
@@ -374,7 +390,7 @@ void ConditionMgr::LoadConditions(bool isReload)
sObjectMgr->LoadGossipMenuItems();
}
- QueryResult result = WorldDatabase.Query("SELECT SourceTypeOrReferenceId, SourceGroup, SourceEntry, ElseGroup, ConditionTypeOrReference, "
+ QueryResult result = WorldDatabase.Query("SELECT SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, "
" ConditionValue1, ConditionValue2, ConditionValue3, ErrorTextId, ScriptName FROM conditions");
if (!result)
@@ -394,14 +410,15 @@ void ConditionMgr::LoadConditions(bool isReload)
Condition* cond = new Condition();
int32 iSourceTypeOrReferenceId = fields[0].GetInt32();
cond->mSourceGroup = fields[1].GetUInt32();
- cond->mSourceEntry = fields[2].GetUInt32();
- cond->mElseGroup = fields[3].GetUInt32();
- int32 iConditionTypeOrReference = fields[4].GetInt32();
- cond->mConditionValue1 = fields[5].GetUInt32();
- cond->mConditionValue2 = fields[6].GetUInt32();
- cond->mConditionValue3 = fields[7].GetUInt32();
- cond->ErrorTextd = fields[8].GetUInt32();
- cond->mScriptId = sObjectMgr->GetScriptId(fields[9].GetCString());
+ cond->mSourceEntry = fields[2].GetInt32();
+ cond->mSourceId = fields[3].GetUInt32();
+ cond->mElseGroup = fields[4].GetUInt32();
+ int32 iConditionTypeOrReference = fields[5].GetInt32();
+ cond->mConditionValue1 = fields[6].GetUInt32();
+ cond->mConditionValue2 = fields[7].GetUInt32();
+ cond->mConditionValue3 = fields[8].GetUInt32();
+ cond->ErrorTextd = fields[9].GetUInt32();
+ cond->mScriptId = sObjectMgr->GetScriptId(fields[10].GetCString());
if (iConditionTypeOrReference >= 0)
cond->mConditionType = ConditionType(iConditionTypeOrReference);
@@ -440,12 +457,12 @@ void ConditionMgr::LoadConditions(bool isReload)
if (iSourceTypeOrReferenceId < 0)//it is a reference template
{
uint32 uRefId = abs(iSourceTypeOrReferenceId);
- if (m_ConditionReferenceMap.find(uRefId) == m_ConditionReferenceMap.end())//make sure we have a list for our conditions, based on reference id
+ if (ConditionReferenceStore.find(uRefId) == ConditionReferenceStore.end())//make sure we have a list for our conditions, based on reference id
{
ConditionList mCondList;
- m_ConditionReferenceMap[uRefId] = mCondList;
+ ConditionReferenceStore[uRefId] = mCondList;
}
- m_ConditionReferenceMap[uRefId].push_back(cond);//add to reference storage
+ ConditionReferenceStore[uRefId].push_back(cond);//add to reference storage
count++;
continue;
}//end of reference templates
@@ -468,83 +485,102 @@ void ConditionMgr::LoadConditions(bool isReload)
}
else if (cond->mSourceGroup)
{
- bool bIsDone = false;
+ bool valid = false;
//handle grouped conditions
switch (cond->mSourceType)
{
case CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE:
- bIsDone = addToLootTemplate(cond, LootTemplates_Creature.GetLootForConditionFill(cond->mSourceGroup));
+ valid = addToLootTemplate(cond, LootTemplates_Creature.GetLootForConditionFill(cond->mSourceGroup));
break;
case CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE:
- bIsDone = addToLootTemplate(cond, LootTemplates_Disenchant.GetLootForConditionFill(cond->mSourceGroup));
+ valid = addToLootTemplate(cond, LootTemplates_Disenchant.GetLootForConditionFill(cond->mSourceGroup));
break;
case CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE:
- bIsDone = addToLootTemplate(cond, LootTemplates_Fishing.GetLootForConditionFill(cond->mSourceGroup));
+ valid = addToLootTemplate(cond, LootTemplates_Fishing.GetLootForConditionFill(cond->mSourceGroup));
break;
case CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE:
- bIsDone = addToLootTemplate(cond, LootTemplates_Gameobject.GetLootForConditionFill(cond->mSourceGroup));
+ valid = addToLootTemplate(cond, LootTemplates_Gameobject.GetLootForConditionFill(cond->mSourceGroup));
break;
case CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE:
- bIsDone = addToLootTemplate(cond, LootTemplates_Item.GetLootForConditionFill(cond->mSourceGroup));
+ valid = addToLootTemplate(cond, LootTemplates_Item.GetLootForConditionFill(cond->mSourceGroup));
break;
case CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE:
- bIsDone = addToLootTemplate(cond, LootTemplates_Mail.GetLootForConditionFill(cond->mSourceGroup));
+ valid = addToLootTemplate(cond, LootTemplates_Mail.GetLootForConditionFill(cond->mSourceGroup));
break;
case CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE:
- bIsDone = addToLootTemplate(cond, LootTemplates_Milling.GetLootForConditionFill(cond->mSourceGroup));
+ valid = addToLootTemplate(cond, LootTemplates_Milling.GetLootForConditionFill(cond->mSourceGroup));
break;
case CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE:
- bIsDone = addToLootTemplate(cond, LootTemplates_Pickpocketing.GetLootForConditionFill(cond->mSourceGroup));
+ valid = addToLootTemplate(cond, LootTemplates_Pickpocketing.GetLootForConditionFill(cond->mSourceGroup));
break;
case CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE:
- bIsDone = addToLootTemplate(cond, LootTemplates_Prospecting.GetLootForConditionFill(cond->mSourceGroup));
+ valid = addToLootTemplate(cond, LootTemplates_Prospecting.GetLootForConditionFill(cond->mSourceGroup));
break;
case CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE:
- bIsDone = addToLootTemplate(cond, LootTemplates_Reference.GetLootForConditionFill(cond->mSourceGroup));
+ valid = addToLootTemplate(cond, LootTemplates_Reference.GetLootForConditionFill(cond->mSourceGroup));
break;
case CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE:
- bIsDone = addToLootTemplate(cond, LootTemplates_Skinning.GetLootForConditionFill(cond->mSourceGroup));
+ valid = addToLootTemplate(cond, LootTemplates_Skinning.GetLootForConditionFill(cond->mSourceGroup));
break;
case CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE:
- bIsDone = addToLootTemplate(cond, LootTemplates_Spell.GetLootForConditionFill(cond->mSourceGroup));
+ valid = addToLootTemplate(cond, LootTemplates_Spell.GetLootForConditionFill(cond->mSourceGroup));
break;
case CONDITION_SOURCE_TYPE_GOSSIP_MENU:
- bIsDone = addToGossipMenus(cond);
+ valid = addToGossipMenus(cond);
break;
case CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION:
- bIsDone = addToGossipMenuItems(cond);
+ valid = addToGossipMenuItems(cond);
break;
case CONDITION_SOURCE_TYPE_VEHICLE_SPELL:
{
//if no list for vehicle create one
- if (m_VehicleSpellConditions.find(cond->mSourceGroup) == m_VehicleSpellConditions.end())
+ if (VehicleSpellConditionStore.find(cond->mSourceGroup) == VehicleSpellConditionStore.end())
{
- ConditionTypeMap cmap;
- m_VehicleSpellConditions[cond->mSourceGroup] = cmap;
+ ConditionTypeContainer cmap;
+ VehicleSpellConditionStore[cond->mSourceGroup] = cmap;
}
//if no list for vehicle's spell create one
- if (m_VehicleSpellConditions[cond->mSourceGroup].find(cond->mSourceEntry) == m_VehicleSpellConditions[cond->mSourceGroup].end())
+ if (VehicleSpellConditionStore[cond->mSourceGroup].find(cond->mSourceEntry) == VehicleSpellConditionStore[cond->mSourceGroup].end())
{
ConditionList clist;
- m_VehicleSpellConditions[cond->mSourceGroup][cond->mSourceEntry] = clist;
+ VehicleSpellConditionStore[cond->mSourceGroup][cond->mSourceEntry] = clist;
}
- m_VehicleSpellConditions[cond->mSourceGroup][cond->mSourceEntry].push_back(cond);
- bIsDone = true;
+ VehicleSpellConditionStore[cond->mSourceGroup][cond->mSourceEntry].push_back(cond);
+ valid = true;
++count;
continue; // do not add to m_AllocatedMemory to avoid double deleting
}
+ case CONDITION_SOURCE_TYPE_SMART_EVENT:
+ {
+ // If the entry does not exist, create a new list
+ std::pair<int32, uint32> key = std::make_pair(cond->mSourceEntry, cond->mSourceId);
+ if (SmartEventConditionStore.find(key) == SmartEventConditionStore.end())
+ {
+ ConditionTypeContainer cmap;
+ SmartEventConditionStore[key] = cmap;
+ }
+ if (SmartEventConditionStore[key].find(cond->mSourceGroup) == SmartEventConditionStore[key].end())
+ {
+ ConditionList clist;
+ SmartEventConditionStore[key][cond->mSourceGroup] = clist;
+ }
+ SmartEventConditionStore[key][cond->mSourceGroup].push_back(cond);
+ valid = true;
+ ++count;
+ continue;
+ }
default:
break;
}
- if (!bIsDone)
+ if (!valid)
{
sLog->outErrorDb("Not handled grouped condition, SourceGroup %u", cond->mSourceGroup);
delete cond;
}
else
{
- m_AllocatedMemory.push_back(cond);
+ AllocatedMemoryStore.push_back(cond);
++count;
}
continue;
@@ -552,21 +588,21 @@ void ConditionMgr::LoadConditions(bool isReload)
//handle not grouped conditions
//make sure we have a storage list for our SourceType
- if (m_ConditionMap.find(cond->mSourceType) == m_ConditionMap.end())
+ if (ConditionStore.find(cond->mSourceType) == ConditionStore.end())
{
- ConditionTypeMap mTypeMap;
- m_ConditionMap[cond->mSourceType] = mTypeMap;//add new empty list for SourceType
+ ConditionTypeContainer mTypeMap;
+ ConditionStore[cond->mSourceType] = mTypeMap;//add new empty list for SourceType
}
//make sure we have a condition list for our SourceType's entry
- if (m_ConditionMap[cond->mSourceType].find(cond->mSourceEntry) == m_ConditionMap[cond->mSourceType].end())
+ if (ConditionStore[cond->mSourceType].find(cond->mSourceEntry) == ConditionStore[cond->mSourceType].end())
{
ConditionList mCondList;
- m_ConditionMap[cond->mSourceType][cond->mSourceEntry] = mCondList;
+ ConditionStore[cond->mSourceType][cond->mSourceEntry] = mCondList;
}
//add new Condition to storage based on Type/Entry
- m_ConditionMap[cond->mSourceType][cond->mSourceEntry].push_back(cond);
+ ConditionStore[cond->mSourceType][cond->mSourceEntry].push_back(cond);
++count;
}
while (result->NextRow());
@@ -949,28 +985,19 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
if (!conditions.empty())
break;
- for (int j = 0; j < MAX_SPELL_EFFECTS; ++j)
+ if (pSpellInfo->NeedsExplicitUnitTarget())
{
- if (pSpellInfo->Effects[j].TargetA.GetTarget() == TARGET_UNIT_TARGET_ENEMY ||
- pSpellInfo->Effects[j].TargetB.GetTarget() == TARGET_UNIT_TARGET_ENEMY ||
- pSpellInfo->Effects[j].TargetA.GetTarget() == TARGET_UNIT_TARGET_ANY ||
- pSpellInfo->Effects[j].TargetB.GetTarget() == TARGET_UNIT_TARGET_ANY)
- {
- bIsItemSpellValid = true;
- break;
- }
- }
-
- if (bIsItemSpellValid)
+ bIsItemSpellValid = true;
break;
+ }
}
}
}
if (!bIsItemSpellValid)
{
- sLog->outErrorDb("Conditions: CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET for item %u, which either doesn't have item spelltrigger or its spells don't have implicit target "
- "TARGET_UNIT_TARGET_ENEMY(6), TARGET_UNIT_TARGET_ANY(25), or the spells are already listed in CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET conditions.", cond->mSourceEntry);
+ sLog->outErrorDb("Conditions: CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET for item %u, which either doesn't have item spelltrigger or its spells don't allow caster to select a unit target"
+ ", or the spells are already listed in CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET conditions.", cond->mSourceEntry);
break;
}
break;
@@ -1004,6 +1031,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
break;
case CONDITION_SOURCE_TYPE_GOSSIP_MENU:
case CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION:
+ case CONDITION_SOURCE_TYPE_SMART_EVENT:
case CONDITION_SOURCE_TYPE_NONE:
default:
break;
@@ -1180,9 +1208,9 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
}
case CONDITION_CLASS:
{
- if (cond->mConditionValue1 >= MAX_CLASSES)
+ if (!(cond->mConditionValue1 & CLASSMASK_ALL_PLAYABLE))
{
- sLog->outErrorDb("Class condition has non existing class (%u), skipped", cond->mConditionValue1);
+ sLog->outErrorDb("Class condition has non existing classmask (%u), skipped", cond->mConditionValue1 & ~CLASSMASK_ALL_PLAYABLE);
return false;
}
@@ -1192,9 +1220,9 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
}
case CONDITION_RACE:
{
- if (cond->mConditionValue1 >= MAX_RACES)
+ if (!(cond->mConditionValue1 & RACEMASK_ALL_PLAYABLE))
{
- sLog->outErrorDb("Race condition has non existing race (%u), skipped", cond->mConditionValue1);
+ sLog->outErrorDb("Race condition has non existing racemask (%u), skipped", cond->mConditionValue1 & ~RACEMASK_ALL_PLAYABLE);
return false;
}
@@ -1375,18 +1403,31 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
void ConditionMgr::Clean()
{
- for (ConditionReferenceMap::iterator itr = m_ConditionReferenceMap.begin(); itr != m_ConditionReferenceMap.end(); ++itr)
+ for (ConditionReferenceContainer::iterator itr = ConditionReferenceStore.begin(); itr != ConditionReferenceStore.end(); ++itr)
{
for (ConditionList::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it)
delete *it;
itr->second.clear();
}
- m_ConditionReferenceMap.clear();
+ ConditionReferenceStore.clear();
+
+ for (ConditionContainer::iterator itr = ConditionStore.begin(); itr != ConditionStore.end(); ++itr)
+ {
+ for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
+ {
+ for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
+ delete *i;
+ it->second.clear();
+ }
+ itr->second.clear();
+ }
+
+ ConditionStore.clear();
- for (ConditionMap::iterator itr = m_ConditionMap.begin(); itr != m_ConditionMap.end(); ++itr)
+ for (VehicleSpellConditionContainer::iterator itr = VehicleSpellConditionStore.begin(); itr != VehicleSpellConditionStore.end(); ++itr)
{
- for (ConditionTypeMap::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
+ for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
{
for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
delete *i;
@@ -1395,11 +1436,11 @@ void ConditionMgr::Clean()
itr->second.clear();
}
- m_ConditionMap.clear();
+ VehicleSpellConditionStore.clear();
- for (VehicleSpellConditionMap::iterator itr = m_VehicleSpellConditions.begin(); itr != m_VehicleSpellConditions.end(); ++itr)
+ for (SmartEventConditionContainer::iterator itr = SmartEventConditionStore.begin(); itr != SmartEventConditionStore.end(); ++itr)
{
- for (ConditionTypeMap::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
+ for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
{
for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
delete *i;
@@ -1408,11 +1449,11 @@ void ConditionMgr::Clean()
itr->second.clear();
}
- m_VehicleSpellConditions.clear();
+ SmartEventConditionStore.clear();
// this is a BIG hack, feel free to fix it if you can figure out the ConditionMgr ;)
- for (std::list<Condition*>::const_iterator itr = m_AllocatedMemory.begin(); itr != m_AllocatedMemory.end(); ++itr)
+ for (std::list<Condition*>::const_iterator itr = AllocatedMemoryStore.begin(); itr != AllocatedMemoryStore.end(); ++itr)
delete *itr;
- m_AllocatedMemory.clear();
+ AllocatedMemoryStore.clear();
}
diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h
index 2aec58db48c..1641642dd86 100755
--- a/src/server/game/Conditions/ConditionMgr.h
+++ b/src/server/game/Conditions/ConditionMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -96,14 +96,16 @@ enum ConditionSourceType
CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19, //DONE
CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20, //DONE
CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21, //DONE
- CONDITION_SOURCE_TYPE_MAX = 22//MAX
+ CONDITION_SOURCE_TYPE_SMART_EVENT = 22, //DONE
+ CONDITION_SOURCE_TYPE_MAX = 23 //MAX
};
struct Condition
{
ConditionSourceType mSourceType; //SourceTypeOrReferenceId
uint32 mSourceGroup;
- uint32 mSourceEntry;
+ int32 mSourceEntry;
+ uint32 mSourceId; // So far, only used in CONDITION_SOURCE_TYPE_SMART_EVENT
uint32 mElseGroup;
ConditionType mConditionType; //ConditionTypeOrReference
uint32 mConditionValue1;
@@ -133,11 +135,12 @@ struct Condition
};
typedef std::list<Condition*> ConditionList;
-typedef std::map<uint32, ConditionList> ConditionTypeMap;
-typedef std::map<ConditionSourceType, ConditionTypeMap> ConditionMap;
-typedef std::map<uint32, ConditionTypeMap> VehicleSpellConditionMap;
+typedef std::map<uint32, ConditionList> ConditionTypeContainer;
+typedef std::map<ConditionSourceType, ConditionTypeContainer> ConditionContainer;
+typedef std::map<uint32, ConditionTypeContainer> VehicleSpellConditionContainer;
+typedef std::map<std::pair<int32, uint32 /*SAI source_type*/>, ConditionTypeContainer> SmartEventConditionContainer;
-typedef std::map<uint32, ConditionList> ConditionReferenceMap;//only used for references
+typedef std::map<uint32, ConditionList> ConditionReferenceContainer;//only used for references
class ConditionMgr
{
@@ -153,7 +156,8 @@ class ConditionMgr
ConditionList GetConditionReferences(uint32 refId);
bool IsPlayerMeetToConditions(Player* player, ConditionList const& conditions, Unit* invoker = NULL);
- ConditionList GetConditionsForNotGroupedEntry(ConditionSourceType sType, uint32 uEntry);
+ ConditionList GetConditionsForNotGroupedEntry(ConditionSourceType sourceType, uint32 entry);
+ ConditionList GetConditionsForSmartEvent(int32 entryOrGuid, uint32 eventId, uint32 sourceType);
ConditionList GetConditionsForVehicleSpell(uint32 creatureID, uint32 spellID);
private:
@@ -179,15 +183,17 @@ class ConditionMgr
sourceType == CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE ||
sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU ||
sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION ||
- sourceType == CONDITION_SOURCE_TYPE_VEHICLE_SPELL);
+ sourceType == CONDITION_SOURCE_TYPE_VEHICLE_SPELL ||
+ sourceType == CONDITION_SOURCE_TYPE_SMART_EVENT);
}
void Clean(); // free up resources
- std::list<Condition*> m_AllocatedMemory; // some garbage collection :)
+ std::list<Condition*> AllocatedMemoryStore; // some garbage collection :)
- ConditionMap m_ConditionMap;
- ConditionReferenceMap m_ConditionReferenceMap;
- VehicleSpellConditionMap m_VehicleSpellConditions;
+ ConditionContainer ConditionStore;
+ ConditionReferenceContainer ConditionReferenceStore;
+ VehicleSpellConditionContainer VehicleSpellConditionStore;
+ SmartEventConditionContainer SmartEventConditionStore;
};
#define sConditionMgr ACE_Singleton<ConditionMgr, ACE_Null_Mutex>::instance()
diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp
index 07febf889d0..d7a769d3f5c 100755
--- a/src/server/game/Conditions/DisableMgr.cpp
+++ b/src/server/game/Conditions/DisableMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 2931c5ea4ad..0f9310ace3b 100755
--- a/src/server/game/Conditions/DisableMgr.h
+++ b/src/server/game/Conditions/DisableMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 78324f8fae2..80949effa0c 100755
--- a/src/server/game/DataStores/DBCEnums.h
+++ b/src/server/game/DataStores/DBCEnums.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index 6815d73d1b3..b6c18103f1e 100755
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -584,10 +584,9 @@ void LoadDBCStores(const std::string& dataPath)
if (node->map_id < 2 || i == 82 || i == 83 || i == 93 || i == 94)
sOldContinentsNodesMask[field] |= submask;
- // fix DK node at Ebon Hold
- if (i == 315) {
+ // fix DK node at Ebon Hold and Shadow Vault flight master
+ if (i == 315 || i == 333)
((TaxiNodesEntry*)node)->MountCreatureID[1] = 32981;
- }
}
}
diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h
index 7edfaad03f1..58c85adc11b 100755
--- a/src/server/game/DataStores/DBCStores.h
+++ b/src/server/game/DataStores/DBCStores.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 5a4dea3a020..15408ad03a9 100755
--- a/src/server/game/DataStores/DBCStructure.h
+++ b/src/server/game/DataStores/DBCStructure.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 ac0b60d7f80..c55fb79d461 100755
--- a/src/server/game/DataStores/DBCfmt.h
+++ b/src/server/game/DataStores/DBCfmt.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.h b/src/server/game/DungeonFinding/LFG.h
index be564ef410f..28498749af8 100755
--- a/src/server/game/DungeonFinding/LFG.h
+++ b/src/server/game/DungeonFinding/LFG.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 e81b8bd1774..607389c5dbf 100644
--- a/src/server/game/DungeonFinding/LFGGroupData.cpp
+++ b/src/server/game/DungeonFinding/LFGGroupData.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 2a494c73052..74570817698 100644
--- a/src/server/game/DungeonFinding/LFGGroupData.h
+++ b/src/server/game/DungeonFinding/LFGGroupData.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 21ff3c6e4e8..cccb780e412 100755
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -72,6 +72,54 @@ LFGMgr::~LFGMgr()
delete it->second;
}
+void LFGMgr::_LoadFromDB(Field* fields, uint64 guid)
+{
+ if (!fields)
+ return;
+
+ if (!IS_GROUP(guid))
+ return;
+
+ uint32 dungeon = fields[16].GetUInt32();
+
+ uint8 state = fields[17].GetUInt8();
+
+ if (!dungeon || !state)
+ return;
+
+ SetDungeon(guid, dungeon);
+
+ switch (state)
+ {
+ case LFG_STATE_DUNGEON:
+ case LFG_STATE_FINISHED_DUNGEON:
+ SetState(guid, (LfgState)state);
+ break;
+ default:
+ break;
+ }
+}
+
+void LFGMgr::_SaveToDB(uint64 guid, uint32 db_guid)
+{
+ if (!IS_GROUP(guid))
+ return;
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA);
+
+ stmt->setUInt32(0, db_guid);
+
+ CharacterDatabase.Execute(stmt);
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_LFG_DATA);
+ stmt->setUInt32(0, db_guid);
+
+ stmt->setUInt32(1, GetDungeon(guid));
+ stmt->setUInt32(2, GetState(guid));
+
+ CharacterDatabase.Execute(stmt);
+}
+
/// Load rewards for completing dungeons
void LFGMgr::LoadRewards()
{
@@ -245,7 +293,8 @@ void LFGMgr::Update(uint32 diff)
UpdateProposal(m_lfgProposalId, guid, true);
}
else
- currentQueue.push_back(frontguid); // Lfg group not found, add this group to the queue.
+ if (std::find(currentQueue.begin(), currentQueue.end(), frontguid) == currentQueue.end()) //already in queue?
+ currentQueue.push_back(frontguid); // Lfg group not found, add this group to the queue.
firstNew.clear();
}
}
@@ -382,7 +431,10 @@ void LFGMgr::InitializeLockedDungeons(Player* player)
else if (DisableMgr::IsDisabledFor(DISABLE_TYPE_MAP, dungeon->map, player))
locktype = LFG_LOCKSTATUS_RAID_LOCKED;
else if (dungeon->difficulty > DUNGEON_DIFFICULTY_NORMAL && player->GetBoundInstance(dungeon->map, Difficulty(dungeon->difficulty)))
- locktype = LFG_LOCKSTATUS_RAID_LOCKED;
+ {
+ if (!player->GetGroup() || !player->GetGroup()->isLFGGroup() || GetDungeon(player->GetGroup()->GetGUID(), true) != dungeon->ID || GetState(player->GetGroup()->GetGUID()) != LFG_STATE_DUNGEON)
+ locktype = LFG_LOCKSTATUS_RAID_LOCKED;
+ }
else if (dungeon->minlevel > level)
locktype = LFG_LOCKSTATUS_TOO_LOW_LEVEL;
else if (dungeon->maxlevel < level)
@@ -431,7 +483,7 @@ void LFGMgr::InitializeLockedDungeons(Player* player)
void LFGMgr::Join(Player* player, uint8 roles, const LfgDungeonSet& selectedDungeons, const std::string& comment)
{
if (!player || !player->GetSession() || selectedDungeons.empty())
- return;
+ return;
Group* grp = player->GetGroup();
uint64 guid = player->GetGUID();
@@ -808,7 +860,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal)
{
uint64 guid = (*it);
LfgQueueInfoMap::iterator itQueue = m_QueueInfoMap.find(guid);
- if (itQueue == m_QueueInfoMap.end())
+ if (itQueue == m_QueueInfoMap.end() || GetState(guid) != LFG_STATE_QUEUED)
{
sLog->outError("LFGMgr::CheckCompatibility: [" UI64FMTD "] is not queued but listed as queued!", (*it));
RemoveFromQueue(guid);
@@ -923,6 +975,42 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal)
if (numPlayers != MAXGROUPSIZE)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) Compatibles but not match. Players(%u)", strGuids.c_str(), numPlayers);
+ uint8 Tanks_Needed = LFG_TANKS_NEEDED;
+ uint8 Healers_Needed = LFG_HEALERS_NEEDED;
+ uint8 Dps_Needed = LFG_DPS_NEEDED;
+ for (LfgQueueInfoMap::const_iterator itQueue = pqInfoMap.begin(); itQueue != pqInfoMap.end(); ++itQueue)
+ {
+ LfgQueueInfo* queue = itQueue->second;
+ for (LfgRolesMap::const_iterator itPlayer = queue->roles.begin(); itPlayer != queue->roles.end(); ++itPlayer)
+ {
+ uint8 roles = itPlayer->second;
+ if ((roles & ROLE_TANK) && Tanks_Needed > 0)
+ --Tanks_Needed;
+ else if ((roles & ROLE_HEALER) && Healers_Needed > 0)
+ --Healers_Needed;
+ else if ((roles & ROLE_DAMAGE) && Dps_Needed > 0)
+ --Dps_Needed;
+ }
+ }
+ for (PlayerSet::const_iterator itPlayers = players.begin(); itPlayers != players.end(); ++itPlayers)
+ {
+ for (LfgQueueInfoMap::const_iterator itQueue = pqInfoMap.begin(); itQueue != pqInfoMap.end(); ++itQueue)
+ {
+ LfgQueueInfo* queue = itQueue->second;
+ if (!queue)
+ continue;
+
+ for (LfgRolesMap::const_iterator itPlayer = queue->roles.begin(); itPlayer != queue->roles.end(); ++itPlayer)
+ {
+ if (*itPlayers == ObjectAccessor::FindPlayer(itPlayer->first))
+ {
+ queue->tanks = Tanks_Needed;
+ queue->healers = Healers_Needed;
+ queue->dps = Dps_Needed;
+ }
+ }
+ }
+ }
return true;
}
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) MATCH! Group formed", strGuids.c_str());
@@ -1078,6 +1166,11 @@ void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /*
}
m_QueueInfoMap[gguid] = pqInfo;
+ if(GetState(gguid) != LFG_STATE_NONE)
+ {
+ LfgGuidList& currentQueue = m_currentQueue[team];
+ currentQueue.push_front(gguid);
+ }
AddToQueue(gguid, team);
}
@@ -1384,6 +1477,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
break;
}
}
+ m_teleport.push_back(pguid);
grp->SetLfgRoles(pguid, pProposal->players[pguid]->role);
SetState(pguid, LFG_STATE_DUNGEON);
}
@@ -1395,6 +1489,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
uint64 gguid = grp->GetGUID();
SetDungeon(gguid, dungeon->Entry());
SetState(gguid, LFG_STATE_DUNGEON);
+ _SaveToDB(gguid, grp->GetDbStoreId());
// Remove players/groups from Queue
for (LfgGuidList::const_iterator it = pProposal->queues.begin(); it != pProposal->queues.end(); ++it)
@@ -1509,7 +1604,9 @@ void LFGMgr::RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType t
for (LfgGuidList::const_iterator it = pProposal->queues.begin(); it != pProposal->queues.end(); ++it)
{
uint64 guid = *it;
- AddToQueue(guid, team);
+ LfgGuidList& currentQueue = m_currentQueue[team];
+ currentQueue.push_front(guid); //Add GUID for high priority
+ AddToQueue(guid, team); //We have to add each GUID in newQueue to check for a new groups
}
delete pProposal;
@@ -1665,7 +1762,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
error = LFG_TELEPORTERROR_INVALID_LOCATION;
else if (!player->isAlive())
error = LFG_TELEPORTERROR_PLAYER_DEAD;
- else if (player->IsFalling() || player->HasUnitState(UNIT_STAT_JUMPING))
+ else if (player->IsFalling() || player->HasUnitState(UNIT_STATE_JUMPING))
error = LFG_TELEPORTERROR_FALLING;
else
{
@@ -1921,6 +2018,16 @@ const std::string& LFGMgr::GetComment(uint64 guid)
return m_Players[guid].GetComment();
}
+bool LFGMgr::IsTeleported(uint64 pguid)
+{
+ if (std::find(m_teleport.begin(), m_teleport.end(), pguid) != m_teleport.end())
+ {
+ m_teleport.remove(pguid);
+ return true;
+ }
+ return false;
+}
+
const LfgDungeonSet& LFGMgr::GetSelectedDungeons(uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid);
diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h
index 95cb2e81869..d10902b9553 100755
--- a/src/server/game/DungeonFinding/LFGMgr.h
+++ b/src/server/game/DungeonFinding/LFGMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -287,6 +287,9 @@ class LFGMgr
void InitializeLockedDungeons(Player* player);
+ void _LoadFromDB(Field* fields, uint64 guid);
+ void _SaveToDB(uint64 guid, uint32 db_guid);
+
void SetComment(uint64 guid, const std::string& comment);
const LfgLockMap& GetLockedDungeons(uint64 guid);
LfgState GetState(uint64 guid);
@@ -298,7 +301,9 @@ class LFGMgr
void RemoveGroupData(uint64 guid);
uint8 GetKicksLeft(uint64 gguid);
uint8 GetVotesNeeded(uint64 gguid);
+ bool IsTeleported(uint64 pguid);
void SetRoles(uint64 guid, uint8 roles);
+ void SetSelectedDungeons(uint64 guid, const LfgDungeonSet& dungeons);
private:
@@ -306,10 +311,8 @@ class LFGMgr
const std::string& GetComment(uint64 gguid);
void RestoreState(uint64 guid);
void SetDungeon(uint64 guid, uint32 dungeon);
- void SetSelectedDungeons(uint64 guid, const LfgDungeonSet& dungeons);
void SetLockedDungeons(uint64 guid, const LfgLockMap& lock);
void DecreaseKicksLeft(uint64 guid);
- void NoExiste(uint8 lala);
// Queue
void AddToQueue(uint64 guid, uint8 queueId);
@@ -352,6 +355,7 @@ class LFGMgr
LfgGuidListMap m_currentQueue; ///< Ordered list. Used to find groups
LfgGuidListMap m_newToQueue; ///< New groups to add to queue
LfgCompatibleMap m_CompatibleMap; ///< Compatible dungeons
+ LfgGuidList m_teleport; ///< Players being teleported
// Rolecheck - Proposal - Vote Kicks
LfgRoleCheckMap m_RoleChecks; ///< Current Role checks
LfgProposalMap m_Proposals; ///< Current Proposals
diff --git a/src/server/game/DungeonFinding/LFGPlayerData.cpp b/src/server/game/DungeonFinding/LFGPlayerData.cpp
index e9400f85d3b..4a6e86ab966 100644
--- a/src/server/game/DungeonFinding/LFGPlayerData.cpp
+++ b/src/server/game/DungeonFinding/LFGPlayerData.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 b576980ab79..e8bae1c5a0f 100644
--- a/src/server/game/DungeonFinding/LFGPlayerData.h
+++ b/src/server/game/DungeonFinding/LFGPlayerData.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 42119a02ef8..2966e799c58 100644
--- a/src/server/game/DungeonFinding/LFGScripts.cpp
+++ b/src/server/game/DungeonFinding/LFGScripts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 9a2d358188f..f17f7b16af1 100644
--- a/src/server/game/DungeonFinding/LFGScripts.h
+++ b/src/server/game/DungeonFinding/LFGScripts.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 cd05cba7475..da5975aafbe 100755
--- a/src/server/game/Entities/Corpse/Corpse.cpp
+++ b/src/server/game/Entities/Corpse/Corpse.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -103,7 +103,7 @@ void Corpse::SaveToDB()
SQLTransaction trans = CharacterDatabase.BeginTransaction();
DeleteFromDB(trans);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_CORPSE);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CORPSE);
stmt->setUInt32(0, GetGUIDLow()); // corpseGuid
stmt->setUInt32(1, GUID_LOPART(GetOwnerGUID())); // guid
stmt->setFloat (2, GetPositionX()); // posX
diff --git a/src/server/game/Entities/Corpse/Corpse.h b/src/server/game/Entities/Corpse/Corpse.h
index a704e2243eb..1aaf56eaf27 100755
--- a/src/server/game/Entities/Corpse/Corpse.h
+++ b/src/server/game/Entities/Corpse/Corpse.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index f97d01a42a4..eb29e681016 100755
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,8 @@
#include "Vehicle.h"
#include "SpellAuraEffects.h"
#include "Group.h"
+#include "MoveSplineInit.h"
+#include "MoveSpline.h"
// apply implementation of the singletons
TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const
@@ -143,7 +145,7 @@ m_PlayerDamageReq(0), m_lootMoney(0), m_lootRecipient(0), m_lootRecipientGroup(0
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_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_formation(NULL)
+m_creatureInfo(NULL), m_creatureData(NULL), m_formation(NULL), m_path_id(0)
{
m_regenTimer = CREATURE_REGEN_INTERVAL;
m_valuesCount = UNIT_END;
@@ -332,6 +334,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data
SetSpeed(MOVE_FLIGHT, 1.0f); // using 1.0 rate
SetFloatValue(OBJECT_FIELD_SCALE_X, cinfo->scale);
+ SetLevitate(canFly());
// checked at loading
m_defaultMovementType = MovementGeneratorType(cinfo->MovementType);
@@ -435,6 +438,17 @@ void Creature::Update(uint32 diff)
m_vehicleKit->Reset();
}
+ if (IsInWater())
+ {
+ if (canSwim())
+ AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
+ }
+ else
+ {
+ if (canWalk())
+ RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
+ }
+
switch (m_deathState)
{
case JUST_ALIVED:
@@ -472,9 +486,7 @@ void Creature::Update(uint32 diff)
}
case CORPSE:
{
- m_Events.Update(diff);
- _UpdateSpells(diff);
-
+ Unit::Update(diff);
// deathstate changed on spells update, prevent problems
if (m_deathState != CORPSE)
break;
@@ -565,9 +577,6 @@ void Creature::Update(uint32 diff)
m_regenTimer = CREATURE_REGEN_INTERVAL;
break;
}
- case DEAD_FALLING:
- GetMotionMaster()->UpdateMotion(diff);
- break;
default:
break;
}
@@ -676,7 +685,7 @@ void Creature::DoFleeToGetAssistance()
if (!creature)
//SetFeared(true, getVictim()->GetGUID(), 0, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY));
//TODO: use 31365
- SetControlled(true, UNIT_STAT_FLEEING);
+ SetControlled(true, UNIT_STATE_FLEEING);
else
GetMotionMaster()->MoveSeekAssistance(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ());
}
@@ -715,7 +724,7 @@ void Creature::Motion_Initialize()
i_motionMaster.Initialize();
}
else if (m_formation->isFormed())
- i_motionMaster.MoveIdle(MOTION_SLOT_IDLE); //wait the order of leader
+ i_motionMaster.MoveIdle(); //wait the order of leader
else
i_motionMaster.Initialize();
}
@@ -945,7 +954,8 @@ void Creature::AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint3
m_startMove = getMSTime();
m_moveTime = time;*/
- SendMonsterMove(x, y, z, time);
+ float speed = GetDistance(x, y, z) / ((float)time * 0.001f);
+ MonsterMoveWithSpeed(x, y, z, speed);
}
Player* Creature::GetLootRecipient() const
@@ -1403,7 +1413,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const
if (isCivilian())
return false;
- if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE))
+ if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC))
return false;
// Do not attack non-combat pets
@@ -1507,11 +1517,8 @@ void Creature::setDeathState(DeathState s)
if (m_formation && m_formation->getLeader() == this)
m_formation->FormationReset(true);
- if (ZoneScript* zoneScript = GetZoneScript())
- zoneScript->OnCreatureDeath(this);
-
- if ((canFly() || IsFlying()) && FallGround())
- return;
+ if ((canFly() || IsFlying()))
+ i_motionMaster.MoveFall();
Unit::setDeathState(CORPSE);
}
@@ -1523,13 +1530,13 @@ void Creature::setDeathState(DeathState s)
SetLootRecipient(NULL);
ResetPlayerDamageReq();
CreatureTemplate const* cinfo = GetCreatureInfo();
- AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ SetWalk(true);
if (GetCreatureInfo()->InhabitType & INHABIT_AIR)
AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING);
if (GetCreatureInfo()->InhabitType & INHABIT_WATER)
AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
- ClearUnitState(uint32(UNIT_STAT_ALL_STATE));
+ ClearUnitState(uint32(UNIT_STATE_ALL_STATE));
SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));
LoadCreaturesAddon(true);
Motion_Initialize();
@@ -1539,24 +1546,6 @@ void Creature::setDeathState(DeathState s)
}
}
-bool Creature::FallGround()
-{
- // Let's abort after we called this function one time
- if (getDeathState() == DEAD_FALLING)
- return false;
-
- float x, y, z;
- GetPosition(x, y, z);
- // use larger distance for vmap height search than in most other cases
- float ground_Z = GetMap()->GetHeight(x, y, z, true, MAX_FALL_DISTANCE);
- if (fabs(ground_Z - z) < 0.1f)
- return false;
-
- GetMotionMaster()->MoveFall(ground_Z, EVENT_FALL_GROUND);
- Unit::setDeathState(DEAD_FALLING);
- return true;
-}
-
void Creature::Respawn(bool force)
{
DestroyForNearbyPlayers();
@@ -1576,7 +1565,7 @@ void Creature::Respawn(bool force)
if (m_DBTableGuid)
sObjectMgr->RemoveCreatureRespawnTime(m_DBTableGuid, GetInstanceId());
- sLog->outStaticDebug("Respawning...");
+ sLog->outStaticDebug("Respawning creature %s (GuidLow: %u, Full GUID: " UI64FMTD " Entry: %u)", GetName(), GetGUIDLow(), GetGUID(), GetEntry());
m_respawnTime = 0;
lootForPickPocketed = false;
lootForBody = false;
@@ -1644,7 +1633,20 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo)
if (!spellInfo)
return false;
- if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))
+ // Spells that don't have effectMechanics.
+ if (!spellInfo->HasAnyEffectMechanic() && GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))
+ return true;
+
+ // This check must be done instead of 'if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))' for not break
+ // the check of mechanic immunity on DB (tested) because GetCreatureInfo()->MechanicImmuneMask and m_spellImmune[IMMUNITY_MECHANIC] don't have same data.
+ bool immunedToAllEffects = true;
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ if (!IsImmunedToSpellEffect(spellInfo, i))
+ {
+ immunedToAllEffects = false;
+ break;
+ }
+ if (immunedToAllEffects)
return true;
return Unit::IsImmunedToSpell(spellInfo);
@@ -1903,7 +1905,7 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /
if (isCivilian())
return false;
- if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PASSIVE))
+ if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_NPC))
return false;
// skip fighting creature
@@ -1945,7 +1947,7 @@ bool Creature::_IsTargetAcceptable(const Unit* target) const
|| (m_vehicle && (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target))))
return false;
- if (target->HasUnitState(UNIT_STAT_DIED))
+ if (target->HasUnitState(UNIT_STATE_DIED))
{
// guards can detect fake death
if (isGuard() && target->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH))
@@ -2405,3 +2407,25 @@ bool Creature::IsDungeonBoss() const
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(GetEntry());
return cinfo && (cinfo->flags_extra & CREATURE_FLAG_EXTRA_DUNGEON_BOSS);
}
+
+void Creature::SetWalk(bool enable)
+{
+ if (enable)
+ AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ else
+ RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ WorldPacket data(enable ? SMSG_SPLINE_MOVE_SET_WALK_MODE : SMSG_SPLINE_MOVE_SET_RUN_MODE, 9);
+ data.append(GetPackGUID());
+ SendMessageToSet(&data, true);
+}
+
+void Creature::SetLevitate(bool enable)
+{
+ if (enable)
+ AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ else
+ RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ WorldPacket data(enable ? SMSG_SPLINE_MOVE_GRAVITY_DISABLE : SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9);
+ data.append(GetPackGUID());
+ SendMessageToSet(&data, true);
+}
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index d84221f0e63..e622c48761c 100755
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -512,7 +512,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
uint8 getLevelForTarget(WorldObject const* target) const; // overwrite Unit::getLevelForTarget for boss level support
- bool IsInEvadeMode() const { return HasUnitState(UNIT_STAT_EVADE); }
+ bool IsInEvadeMode() const { return HasUnitState(UNIT_STATE_EVADE); }
bool AIM_Initialize(CreatureAI* ai = NULL);
void Motion_Initialize();
@@ -520,6 +520,9 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
void AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint32 MovementFlags, uint8 type);
CreatureAI* AI() const { return (CreatureAI*)i_AI; }
+ void SetWalk(bool enable);
+ void SetLevitate(bool enable);
+
uint32 GetShieldBlockValue() const //dunno mob block value
{
return (getLevel()/2 + uint32(GetStat(STAT_STRENGTH)/20));
@@ -573,7 +576,6 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
const char* GetNameForLocaleIdx(LocaleConstant locale_idx) const;
void setDeathState(DeathState s); // override virtual Unit::setDeathState
- bool FallGround();
bool LoadFromDB(uint32 guid, Map* map) { return LoadCreatureFromDB(guid, map, false); }
bool LoadCreatureFromDB(uint32 guid, Map* map, bool addToMap = true);
diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp
index d32eff862bb..f440fd497fc 100755
--- a/src/server/game/Entities/Creature/CreatureGroups.cpp
+++ b/src/server/game/Entities/Creature/CreatureGroups.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -203,7 +203,7 @@ void CreatureGroup::FormationReset(bool dismiss)
if (dismiss)
itr->first->GetMotionMaster()->Initialize();
else
- itr->first->GetMotionMaster()->MoveIdle(MOTION_SLOT_IDLE);
+ itr->first->GetMotionMaster()->MoveIdle();
sLog->outDebug(LOG_FILTER_UNITS, "Set %s movement for member GUID: %u", dismiss ? "default" : "idle", itr->first->GetGUIDLow());
}
}
@@ -212,10 +212,12 @@ void CreatureGroup::FormationReset(bool dismiss)
void CreatureGroup::LeaderMoveTo(float x, float y, float z)
{
+ //! To do: This should probably get its own movement generator or use WaypointMovementGenerator.
+ //! If the leader's path is known, member's path can be plotted as well using formation offsets.
if (!m_leader)
return;
- float pathangle = atan2(m_leader->GetPositionY() - y, m_leader->GetPositionX() - x);
+ float pathangle = atan2(m_leader->GetPositionY() - y, m_leader->GetPositionX() - x);
for (CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{
diff --git a/src/server/game/Entities/Creature/CreatureGroups.h b/src/server/game/Entities/Creature/CreatureGroups.h
index 3ef7e157b66..80e552f7e93 100755
--- a/src/server/game/Entities/Creature/CreatureGroups.h
+++ b/src/server/game/Entities/Creature/CreatureGroups.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 398deb04723..a39bd8eddf7 100755
--- a/src/server/game/Entities/Creature/GossipDef.cpp
+++ b/src/server/game/Entities/Creature/GossipDef.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.h b/src/server/game/Entities/Creature/GossipDef.h
index 517395578cf..15766bbcd59 100755
--- a/src/server/game/Entities/Creature/GossipDef.h
+++ b/src/server/game/Entities/Creature/GossipDef.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp
index 1b06f0f0b6a..2af6b4c04fd 100755
--- a/src/server/game/Entities/Creature/TemporarySummon.cpp
+++ b/src/server/game/Entities/Creature/TemporarySummon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 69ae8349155..fa1e134b1ac 100755
--- a/src/server/game/Entities/Creature/TemporarySummon.h
+++ b/src/server/game/Entities/Creature/TemporarySummon.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp
index 4e0d2d7d0b9..fa975e0cd39 100755
--- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp
+++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 bd8c15cdba4..7e68f6acd38 100755
--- a/src/server/game/Entities/DynamicObject/DynamicObject.h
+++ b/src/server/game/Entities/DynamicObject/DynamicObject.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index d2a3bfc884c..e26c6710b78 100755
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -988,7 +988,7 @@ void GameObject::ResetDoorOrButton()
m_cooldownTime = 0;
}
-void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = false */)
+void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = false */, Unit* user /*=NULL*/)
{
if (m_lootState != GO_READY)
return;
@@ -997,7 +997,7 @@ void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = f
time_to_restore = GetGOInfo()->GetAutoCloseTime();
SwitchDoorOrButton(true, alternative);
- SetLootState(GO_ACTIVATED);
+ SetLootState(GO_ACTIVATED, user);
m_cooldownTime = time(NULL) + time_to_restore;
}
@@ -1067,7 +1067,7 @@ void GameObject::Use(Unit* user)
case GAMEOBJECT_TYPE_DOOR: //0
case GAMEOBJECT_TYPE_BUTTON: //1
//doors/buttons never really despawn, only reset to default state/flags
- UseDoorOrButton();
+ UseDoorOrButton(0, false, user);
// activate script
GetMap()->ScriptsStart(sGameObjectScripts, GetDBTableGUIDLow(), spellCaster, this);
@@ -1220,7 +1220,7 @@ void GameObject::Use(Unit* user)
TriggeringLinkedGameObject(trapEntry, user);
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
- SetLootState(GO_ACTIVATED);
+ SetLootState(GO_ACTIVATED, user);
// this appear to be ok, however others exist in addition to this that should have custom (ex: 190510, 188692, 187389)
if (info->goober.customAnim)
@@ -1878,3 +1878,9 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
}
}
}
+
+void GameObject::SetLootState(LootState s, Unit* unit)
+{
+ m_lootState = s;
+ AI()->OnStateChanged(s, unit);
+}
diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h
index c47587177c8..f677d481c33 100755
--- a/src/server/game/Entities/GameObject/GameObject.h
+++ b/src/server/game/Entities/GameObject/GameObject.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -713,7 +713,8 @@ class GameObject : public WorldObject, public GridObject<GameObject>
void Use(Unit* user);
LootState getLootState() const { return m_lootState; }
- void SetLootState(LootState s) { m_lootState = s; }
+ // Note: unit is only used when s = GO_ACTIVATED
+ void SetLootState(LootState s, Unit* unit = NULL);
uint16 GetLootMode() { return m_LootMode; }
bool HasLootMode(uint16 lootMode) { return m_LootMode & lootMode; }
@@ -747,7 +748,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
bool hasQuest(uint32 quest_id) const;
bool hasInvolvedQuest(uint32 quest_id) const;
bool ActivateToQuest(Player* target) const;
- void UseDoorOrButton(uint32 time_to_restore = 0, bool alternative = false);
+ void UseDoorOrButton(uint32 time_to_restore = 0, bool alternative = false, Unit* user = NULL);
// 0 = use `gameobject`.`spawntimesecs`
void ResetDoorOrButton();
diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp
index c6c00820463..4eede93bd37 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 463425076d4..5a533d9cf57 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 07275166130..12c26904169 100755
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -320,7 +320,7 @@ void Item::SaveToDB(SQLTransaction& trans)
case ITEM_CHANGED:
{
uint8 index = 0;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(uState == ITEM_NEW ? CHAR_ADD_ITEM_INSTANCE : CHAR_UPDATE_ITEM_INSTANCE);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(uState == ITEM_NEW ? CHAR_REP_ITEM_INSTANCE : CHAR_UPD_ITEM_INSTANCE);
stmt->setUInt32( index, GetEntry());
stmt->setUInt32(++index, GUID_LOPART(GetOwnerGUID()));
stmt->setUInt32(++index, GUID_LOPART(GetUInt64Value(ITEM_FIELD_CREATOR)));
@@ -354,7 +354,7 @@ void Item::SaveToDB(SQLTransaction& trans)
if ((uState == ITEM_CHANGED) && HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))
{
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_GIFT_OWNER);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GIFT_OWNER);
stmt->setUInt32(0, GUID_LOPART(GetOwnerGUID()));
stmt->setUInt32(1, guid);
trans->Append(stmt);
@@ -460,7 +460,7 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, Field* fields, uint32 entr
if (need_save) // normal item changed state set not work at loading
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_ITEM_INSTANCE_ON_LOAD);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_INSTANCE_ON_LOAD);
stmt->setUInt32(0, GetUInt32Value(ITEM_FIELD_DURATION));
stmt->setUInt32(1, GetUInt32Value(ITEM_FIELD_FLAGS));
stmt->setUInt32(2, GetUInt32Value(ITEM_FIELD_DURABILITY));
@@ -931,24 +931,20 @@ void Item::ClearEnchantment(EnchantmentSlot slot)
bool Item::GemsFitSockets() const
{
- bool fits = true;
for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
{
uint8 SocketColor = GetTemplate()->Socket[enchant_slot-SOCK_ENCHANTMENT_SLOT].Color;
- uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot));
- if (!enchant_id)
- {
- if (SocketColor) fits &= false;
+ if (!SocketColor) // no socket slot
continue;
- }
+
+ uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot));
+ if (!enchant_id) // no gems on this socket
+ return false;
SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
- if (!enchantEntry)
- {
- if (SocketColor) fits &= false;
- continue;
- }
+ if (!enchantEntry) // invalid gem id on this socket
+ return false;
uint8 GemColor = 0;
@@ -964,9 +960,10 @@ bool Item::GemsFitSockets() const
}
}
- fits &= (GemColor & SocketColor) ? true : false;
+ if (!(GemColor & SocketColor)) // bad gem color on this socket
+ return false;
}
- return fits;
+ return true;
}
uint8 Item::GetGemCountWithID(uint32 GemID) const
diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h
index 4a72e7fea2b..0960a3e5563 100755
--- a/src/server/game/Entities/Item/Item.h
+++ b/src/server/game/Entities/Item/Item.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 4ed475e0545..b8eaf043b1f 100755
--- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
+++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 8fb852c5135..fe4dca40d24 100755
--- a/src/server/game/Entities/Item/ItemEnchantmentMgr.h
+++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 03212c129fd..2eae7234229 100755
--- a/src/server/game/Entities/Item/ItemPrototype.h
+++ b/src/server/game/Entities/Item/ItemPrototype.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 68057d7148a..c9b25b66cdc 100755
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -45,6 +45,7 @@
#include "TemporarySummon.h"
#include "Totem.h"
#include "OutdoorPvPMgr.h"
+#include "MovementPacketBuilder.h"
uint32 GuidHigh2TypeId(uint32 guid_hi)
{
@@ -312,78 +313,17 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const
*data << ((Unit*)this)->GetSpeed(MOVE_WALK);
*data << ((Unit*)this)->GetSpeed(MOVE_RUN);
- *data << ((Unit*)this)->GetSpeed(MOVE_SWIM_BACK);
- *data << ((Unit*)this)->GetSpeed(MOVE_SWIM);
*data << ((Unit*)this)->GetSpeed(MOVE_RUN_BACK);
+ *data << ((Unit*)this)->GetSpeed(MOVE_SWIM);
+ *data << ((Unit*)this)->GetSpeed(MOVE_SWIM_BACK);
*data << ((Unit*)this)->GetSpeed(MOVE_FLIGHT);
*data << ((Unit*)this)->GetSpeed(MOVE_FLIGHT_BACK);
*data << ((Unit*)this)->GetSpeed(MOVE_TURN_RATE);
*data << ((Unit*)this)->GetSpeed(MOVE_PITCH_RATE);
- const Player* player = ToPlayer();
-
// 0x08000000
- if (player && player->isInFlight())
- {
- uint32 flags3 = SPLINEFLAG_GLIDE;
-
- *data << uint32(flags3); // splines flag?
-
- if (flags3 & 0x20000) // may be orientation
- {
- *data << (float)0;
- }
- else
- {
- if (flags3 & 0x8000) // probably x, y, z coords there
- {
- *data << (float)0;
- *data << (float)0;
- *data << (float)0;
- }
-
- if (flags3 & 0x10000) // probably guid there
- {
- *data << uint64(0);
- }
- }
-
- FlightPathMovementGenerator *fmg =
- (FlightPathMovementGenerator*)(player->GetMotionMaster()->top());
- TaxiPathNodeList const& path = fmg->GetPath();
-
- float x, y, z;
- player->GetPosition(x, y, z);
-
- uint32 inflighttime = uint32(path.GetPassedLength(fmg->GetCurrentNode(), x, y, z) * 32);
- uint32 traveltime = uint32(path.GetTotalLength() * 32);
-
- *data << uint32(inflighttime); // passed move time?
- *data << uint32(traveltime); // full move time?
- *data << uint32(0); // ticks count?
-
- *data << float(0); // added in 3.1
- *data << float(0); // added in 3.1
- *data << float(0); // added in 3.1
-
- *data << uint32(0); // added in 3.1
-
- uint32 poscount = uint32(path.size());
- *data << uint32(poscount); // points count
-
- for (uint32 i = 0; i < poscount; ++i)
- {
- *data << float(path[i].x);
- *data << float(path[i].y);
- *data << float(path[i].z);
- }
-
- *data << uint8(0); // added in 3.0.8
-
- *data << float(path[poscount-1].x);
- *data << float(path[poscount-1].y);
- *data << float(path[poscount-1].z);
- }
+ if (((Unit*)this)->m_movementInfo.GetMovementFlags() & MOVEMENTFLAG_SPLINE_ENABLED)
+ Movement::PacketBuilder::WriteCreate(*((Unit*)this)->movespline, *data);
}
else
{
@@ -487,7 +427,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const
// 0x200
if (flags & UPDATEFLAG_ROTATION)
{
- *data << uint64(((GameObject*)this)->GetRotation());
+ *data << int64(((GameObject*)this)->GetRotation());
}
}
@@ -1595,6 +1535,70 @@ void WorldObject::UpdateGroundPositionZ(float x, float y, float &z) const
z = new_z+ 0.05f; // just to be sure that we are not a few pixel under the surface
}
+void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
+{
+ switch (GetTypeId())
+ {
+ case TYPEID_UNIT:
+ {
+ // non fly unit don't must be in air
+ // non swim unit must be at ground (mostly speedup, because it don't must be in water and water level check less fast
+ if (!ToCreature()->canFly())
+ {
+ bool canSwim = ToCreature()->canSwim();
+ float ground_z = z;
+ float max_z = canSwim
+ ? GetBaseMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK))
+ : ((ground_z = GetBaseMap()->GetHeight(x, y, z, true)));
+ if (max_z > INVALID_HEIGHT)
+ {
+ if (z > max_z)
+ z = max_z;
+ else if (z < ground_z)
+ z = ground_z;
+ }
+ }
+ else
+ {
+ float ground_z = GetBaseMap()->GetHeight(x, y, z, true);
+ if (z < ground_z)
+ z = ground_z;
+ }
+ break;
+ }
+ case TYPEID_PLAYER:
+ {
+ // for server controlled moves playr work same as creature (but it can always swim)
+ if (!ToPlayer()->canFly())
+ {
+ float ground_z = z;
+ float max_z = GetBaseMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK));
+ if (max_z > INVALID_HEIGHT)
+ {
+ if (z > max_z)
+ z = max_z;
+ else if (z < ground_z)
+ z = ground_z;
+ }
+ }
+ else
+ {
+ float ground_z = GetBaseMap()->GetHeight(x, y, z, true);
+ if (z < ground_z)
+ z = ground_z;
+ }
+ break;
+ }
+ default:
+ {
+ float ground_z = GetBaseMap()->GetHeight(x, y, z, true);
+ if(ground_z > INVALID_HEIGHT)
+ z = ground_z;
+ break;
+ }
+ }
+}
+
bool Position::IsPositionValid() const
{
return Trinity::IsValidMapCoord(m_positionX, m_positionY, m_positionZ, m_orientation);
@@ -1668,7 +1672,14 @@ bool WorldObject::canSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
}
}
- if (!corpseCheck && !IsWithinDist(obj, GetSightRange(obj), false))
+ WorldObject const* viewpoint = this;
+ if (Player const* player = this->ToPlayer())
+ viewpoint = player->GetViewpoint();
+
+ if (!viewpoint)
+ viewpoint = this;
+
+ if (!corpseCheck && !viewpoint->IsWithinDist(obj, GetSightRange(obj), false))
return false;
}
@@ -2030,7 +2041,8 @@ void Unit::BuildHeartBeatMsg(WorldPacket* data) const
void WorldObject::SendMessageToSet(WorldPacket* data, bool self)
{
- SendMessageToSetInRange(data, GetVisibilityRange(), self);
+ if (IsInWorld())
+ SendMessageToSetInRange(data, GetVisibilityRange(), self);
}
void WorldObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*self*/)
@@ -2450,7 +2462,7 @@ namespace Trinity
float x, y, z;
- if (!c->isAlive() || c->HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) ||
+ if (!c->isAlive() || c->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED) ||
!c->GetMotionMaster()->GetDestination(x, y, z))
{
x = c->GetPositionX();
@@ -2518,7 +2530,7 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float
{
GetNearPoint2D(x, y, distance2d+searcher_size, absAngle);
z = GetPositionZ();
- UpdateGroundPositionZ(x, y, z);
+ UpdateAllowedPositionZ(x, y, z);
/*
// if detection disabled, return first point
diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h
index 786b23f6340..4cc298e4349 100755
--- a/src/server/game/Entities/Object/Object.h
+++ b/src/server/game/Entities/Object/Object.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -497,7 +497,9 @@ struct MovementInfo
}
uint32 GetMovementFlags() { return flags; }
+ void SetMovementFlags(uint32 flag) { flags = flag; }
void AddMovementFlag(uint32 flag) { flags |= flag; }
+ void RemoveMovementFlag(uint32 flag) { flags &= ~flag; }
bool HasMovementFlag(uint32 flag) const { return flags & flag; }
uint16 GetExtraMovementFlags() { return flags2; }
@@ -615,6 +617,7 @@ class WorldObject : public Object, public WorldLocation
return (m_valuesCount > UNIT_FIELD_COMBATREACH) ? m_floatValues[UNIT_FIELD_COMBATREACH] : DEFAULT_WORLD_OBJECT_SIZE;
}
void UpdateGroundPositionZ(float x, float y, float &z) const;
+ void UpdateAllowedPositionZ(float x, float y, float &z) const;
void GetRandomPoint(const Position &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const;
void GetRandomPoint(const Position &srcPos, float distance, Position &pos) const
diff --git a/src/server/game/Entities/Object/ObjectDefines.h b/src/server/game/Entities/Object/ObjectDefines.h
index 4108063bfb3..c227d081d8b 100755
--- a/src/server/game/Entities/Object/ObjectDefines.h
+++ b/src/server/game/Entities/Object/ObjectDefines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 fd32e531ed7..ec654954b80 100755
--- a/src/server/game/Entities/Object/ObjectPosSelector.cpp
+++ b/src/server/game/Entities/Object/ObjectPosSelector.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 df879c4dd19..b30694672df 100755
--- a/src/server/game/Entities/Object/ObjectPosSelector.h
+++ b/src/server/game/Entities/Object/ObjectPosSelector.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 547c415bc73..8f480ab3235 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 2d102f63e59..e4caaec3117 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/UpdateFields.h b/src/server/game/Entities/Object/Updates/UpdateFields.h
index 321d11fac8a..825bda98ae6 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 abe3c299062..d4ecd42819c 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 eb590e7b82f..bf6dc3b67d9 100755
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -1151,6 +1151,9 @@ void Pet::_LoadAuras(uint32 timediff)
int32 baseDamage[3];
Field* fields = result->Fetch();
uint64 caster_guid = fields[0].GetUInt64();
+ // NULL guid stored - pet is the caster of the spell - see Pet::_SaveAuras
+ if (!caster_guid)
+ caster_guid = GetGUID();
uint32 spellid = fields[1].GetUInt32();
uint8 effmask = fields[2].GetUInt8();
uint8 recalculatemask = fields[3].GetUInt8();
@@ -1239,9 +1242,12 @@ void Pet::_SaveAuras(SQLTransaction& trans)
}
}
+ // don't save guid of caster in case we are caster of the spell - guid for pet is generated every pet load, so it won't match saved guid anyways
+ uint64 casterGUID = (itr->second->GetCasterGUID() == GetGUID()) ? NULL : itr->second->GetCasterGUID();
+
trans->PAppend("INSERT INTO pet_aura (guid, caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) "
"VALUES ('%u', '" UI64FMTD "', '%u', '%u', '%u', '%u', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%u')",
- m_charmInfo->GetPetNumber(), itr->second->GetCasterGUID(), itr->second->GetId(), effMask, recalculateMask,
+ m_charmInfo->GetPetNumber(), casterGUID, itr->second->GetId(), effMask, recalculateMask,
itr->second->GetStackAmount(), damage[0], damage[1], damage[2], baseDamage[0], baseDamage[1], baseDamage[2],
itr->second->GetMaxDuration(), itr->second->GetDuration(), itr->second->GetCharges());
}
diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h
index ac86c061b31..1b1a6c0f62d 100755
--- a/src/server/game/Entities/Pet/Pet.h
+++ b/src/server/game/Entities/Pet/Pet.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 53257622e68..38af97f61cb 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -296,15 +296,24 @@ Item* TradeData::GetItem(TradeSlots slot) const
return m_items[slot] ? m_player->GetItemByGuid(m_items[slot]) : NULL;
}
-bool TradeData::HasItem(uint64 item_guid) const
+bool TradeData::HasItem(uint64 itemGuid) const
{
for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i)
- if (m_items[i] == item_guid)
+ if (m_items[i] == itemGuid)
return true;
return false;
}
+TradeSlots TradeData::GetTradeSlotForItem(uint64 itemGuid) const
+{
+ for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i)
+ if (m_items[i] == itemGuid)
+ return TradeSlots(i);
+
+ return TRADE_SLOT_INVALID;
+}
+
Item* TradeData::GetSpellCastItem() const
{
return m_spellCastItem ? m_player->GetItemByGuid(m_spellCastItem) : NULL;
@@ -1580,7 +1589,7 @@ void Player::Update(uint32 p_time)
GetAchievementMgr().UpdateTimedAchievements(p_time);
- if (HasUnitState(UNIT_STAT_MELEE_ATTACKING) && !HasUnitState(UNIT_STAT_CASTING))
+ if (HasUnitState(UNIT_STATE_MELEE_ATTACKING) && !HasUnitState(UNIT_STATE_CASTING))
{
if (Unit* pVictim = getVictim())
{
@@ -2101,6 +2110,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
// reset movement flags at teleport, because player will continue move with these flags after teleport
SetUnitMovementFlags(0);
+ DisableSpline();
if (m_transport)
{
@@ -3241,7 +3251,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
// cleanup unit flags (will be re-applied if need at aura load).
RemoveFlag(UNIT_FIELD_FLAGS,
UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_ATTACKABLE_1 |
- UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE | UNIT_FLAG_LOOTING |
+ UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_LOOTING |
UNIT_FLAG_PET_IN_COMBAT | UNIT_FLAG_SILENCED | UNIT_FLAG_PACIFIED |
UNIT_FLAG_STUNNED | UNIT_FLAG_IN_COMBAT | UNIT_FLAG_DISARMED |
UNIT_FLAG_CONFUSED | UNIT_FLAG_FLEEING | UNIT_FLAG_NOT_SELECTABLE |
@@ -4823,7 +4833,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
if (has_items)
{
// Data needs to be at first place for Item::LoadFromDB
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_MAILITEMS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAILITEMS);
stmt->setUInt32(0, mail_id);
PreparedQueryResult resultItems = CharacterDatabase.Query(stmt);
if (resultItems)
@@ -4942,7 +4952,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
// The character gets unlinked from the account, the name gets freed up and appears as deleted ingame
case CHAR_DELETE_UNLINK:
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_DELETE_INFO);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_DELETE_INFO);
stmt->setUInt32(0, guid);
@@ -5148,43 +5158,10 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
}
}
-/**
- * FallMode = 0 implies that the player is dying, or already dead, and the proper death state will be set.
- * = 1 simply causes the player to plummet towards the ground, and not suffer any damage.
- * = 2 causes the player to plummet towards the ground, and causes falling damage, regardless
- * of any auras that might of prevented fall damage.
- */
-bool Player::FallGround(uint8 FallMode)
-{
- // Let's abort after we called this function one time
- if (getDeathState() == DEAD_FALLING && FallMode == 0)
- return false;
-
- float x, y, z;
- GetPosition(x, y, z);
- float ground_Z = GetMap()->GetHeight(x, y, z);
- float z_diff = 0.0f;
- if ((z_diff = fabs(ground_Z - z)) < 0.1f)
- return false;
-
- GetMotionMaster()->MoveFall(ground_Z, EVENT_FALL_GROUND);
-
- // Below formula for falling damage is from Player::HandleFall
- if (FallMode == 2 && z_diff >= 14.57f)
- {
- uint32 damage = std::min(GetMaxHealth(), (uint32)((0.018f * z_diff - 0.2426f) * GetMaxHealth() * sWorld->getRate(RATE_DAMAGE_FALL)));
- if (damage)
- EnvironmentalDamage(DAMAGE_FALL, damage);
- }
- else if (FallMode == 0)
- Unit::setDeathState(DEAD_FALLING);
- return true;
-}
-
void Player::KillPlayer()
{
if (IsFlying() && !GetTransport())
- FallGround();
+ i_motionMaster.MoveFall();
SetMovement(MOVE_ROOT);
@@ -7346,7 +7323,7 @@ uint32 Player::GetZoneIdFromDB(uint64 guid)
if (zone > 0)
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_ZONE);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ZONE);
stmt->setUInt16(0, uint16(zone));
stmt->setUInt32(1, guidLow);
@@ -7403,6 +7380,22 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange...
}
+ // group update
+ if (GetGroup())
+ {
+ SetGroupUpdateFlag(GROUP_UPDATE_FULL);
+ Group* grp = GetGroup();
+ if (GetSession() && grp->isLFGGroup() && sLFGMgr->IsTeleported(GetGUID()))
+ {
+ for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
+ {
+ Player* tempplr = itr->getSource();
+ if (tempplr)
+ GetSession()->SendNameQueryOpcode(tempplr->GetGUID());
+ }
+ }
+ }
+
m_zoneUpdateId = newZone;
m_zoneUpdateTimer = ZONE_UPDATE_INTERVAL;
@@ -7490,10 +7483,6 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
// recent client version not send leave/join channel packets for built-in local channels
UpdateLocalChannels(newZone);
- // group update
- if (GetGroup())
- SetGroupUpdateFlag(GROUP_UPDATE_FULL);
-
UpdateZoneDependentAuras(newZone);
}
@@ -8728,7 +8717,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
}
}
- go->SetLootState(GO_ACTIVATED);
+ go->SetLootState(GO_ACTIVATED, this);
}
if (go->getLootState() == GO_ACTIVATED)
@@ -11396,7 +11385,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
{
// May be here should be more stronger checks; STUNNED checked
// ROOT, CONFUSED, DISTRACTED, FLEEING this needs to be checked.
- if (HasUnitState(UNIT_STAT_STUNNED))
+ if (HasUnitState(UNIT_STATE_STUNNED))
return EQUIP_ERR_YOU_ARE_STUNNED;
// do not allow equipping gear except weapons, offhands, projectiles, relics in
@@ -11826,6 +11815,93 @@ InventoryResult Player::CanUseItem(ItemTemplate const* proto) const
return EQUIP_ERR_ITEM_NOT_FOUND;
}
+InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObject const* lootedObject) const
+{
+ LfgDungeonSet const& dungeons = sLFGMgr->GetSelectedDungeons(GetGUID());
+ if (dungeons.empty())
+ return EQUIP_ERR_OK; // not using LFG
+
+ if (!GetGroup() || !GetGroup()->isLFGGroup())
+ return EQUIP_ERR_OK; // not in LFG group
+
+ // check if looted object is inside the lfg dungeon
+ bool lootedObjectInDungeon = false;
+ Map const* map = lootedObject->GetMap();
+ if (uint32 dungeonId = sLFGMgr->GetDungeon(GetGroup()->GetGUID(), true))
+ if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId))
+ if (dungeon->map == map->GetId() && dungeon->difficulty == map->GetDifficulty())
+ lootedObjectInDungeon = true;
+
+ if (!lootedObjectInDungeon)
+ return EQUIP_ERR_OK;
+
+ if (!proto)
+ return EQUIP_ERR_ITEM_NOT_FOUND;
+ // Used by group, function NeedBeforeGreed, to know if a prototype can be used by a player
+
+ const static uint32 item_weapon_skills[MAX_ITEM_SUBCLASS_WEAPON] =
+ {
+ SKILL_AXES, SKILL_2H_AXES, SKILL_BOWS, SKILL_GUNS, SKILL_MACES,
+ SKILL_2H_MACES, SKILL_POLEARMS, SKILL_SWORDS, SKILL_2H_SWORDS, 0,
+ SKILL_STAVES, 0, 0, SKILL_FIST_WEAPONS, 0,
+ SKILL_DAGGERS, SKILL_THROWN, SKILL_ASSASSINATION, SKILL_CROSSBOWS, SKILL_WANDS,
+ SKILL_FISHING
+ }; //Copy from function Item::GetSkill()
+
+ if ((proto->AllowableClass & getClassMask()) == 0 || (proto->AllowableRace & getRaceMask()) == 0)
+ return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM;
+
+ if (proto->RequiredSpell != 0 && !HasSpell(proto->RequiredSpell))
+ return EQUIP_ERR_NO_REQUIRED_PROFICIENCY;
+
+ if (proto->RequiredSkill != 0)
+ {
+ if (!GetSkillValue(proto->RequiredSkill))
+ return EQUIP_ERR_NO_REQUIRED_PROFICIENCY;
+ else if (GetSkillValue(proto->RequiredSkill) < proto->RequiredSkillRank)
+ return EQUIP_ERR_CANT_EQUIP_SKILL;
+ }
+
+ uint8 _class = getClass();
+
+ if (proto->Class == ITEM_CLASS_WEAPON && GetSkillValue(item_weapon_skills[proto->SubClass]) == 0)
+ return EQUIP_ERR_NO_REQUIRED_PROFICIENCY;
+
+ if (proto->Class == ITEM_CLASS_ARMOR && proto->SubClass > ITEM_SUBCLASS_ARMOR_MISC && proto->SubClass < ITEM_SUBCLASS_ARMOR_BUCKLER && proto->InventoryType != INVTYPE_CLOAK)
+ {
+ if (_class == CLASS_WARRIOR || _class == CLASS_PALADIN || _class == CLASS_DEATH_KNIGHT)
+ {
+ if (getLevel() < 40)
+ {
+ if (proto->SubClass != ITEM_SUBCLASS_ARMOR_MAIL)
+ return EQUIP_ERR_CANT_DO_RIGHT_NOW;
+ }
+ else if (proto->SubClass != ITEM_SUBCLASS_ARMOR_PLATE)
+ return EQUIP_ERR_CANT_DO_RIGHT_NOW;
+ }
+ else if (_class == CLASS_HUNTER || _class == CLASS_SHAMAN)
+ {
+ if (getLevel() < 40)
+ {
+ if (proto->SubClass != ITEM_SUBCLASS_ARMOR_LEATHER)
+ return EQUIP_ERR_CANT_DO_RIGHT_NOW;
+ }
+ else if (proto->SubClass != ITEM_SUBCLASS_ARMOR_MAIL)
+ return EQUIP_ERR_CANT_DO_RIGHT_NOW;
+ }
+
+ if (_class == CLASS_ROGUE || _class == CLASS_DRUID)
+ if (proto->SubClass != ITEM_SUBCLASS_ARMOR_LEATHER)
+ return EQUIP_ERR_CANT_DO_RIGHT_NOW;
+
+ if (_class == CLASS_MAGE || _class == CLASS_PRIEST || _class == CLASS_WARLOCK)
+ if (proto->SubClass != ITEM_SUBCLASS_ARMOR_CLOTH)
+ return EQUIP_ERR_CANT_DO_RIGHT_NOW;
+ }
+
+ return EQUIP_ERR_OK;
+}
+
InventoryResult Player::CanUseAmmo(uint32 item) const
{
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseAmmo item = %u", item);
@@ -11909,6 +11985,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update
{
ItemAddedQuestCheck(item, count);
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, count);
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, item, 1);
if (randomPropertyId)
pItem->SetItemRandomProperties(randomPropertyId);
pItem = StoreItem(dest, pItem, update);
@@ -11931,7 +12008,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update
for (++itr; itr != allowedLooters.end(); ++itr)
ss << ' ' << *itr;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_ITEM_BOP_TRADE);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_BOP_TRADE);
stmt->setUInt32(0, pItem->GetGUIDLow());
stmt->setString(1, ss.str());
CharacterDatabase.Execute(stmt);
@@ -11962,7 +12039,6 @@ Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update)
lastItem = _StoreItem(pos, pItem, count, true, update);
}
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, entry);
return lastItem;
}
@@ -12733,6 +12809,14 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
return;
}
+ //! If trading
+ if (TradeData* tradeData = GetTradeData())
+ {
+ //! If current item is in trade window (only possible with packet spoofing - silent return)
+ if (tradeData->GetTradeSlotForItem(pSrcItem->GetGUID()) != TRADE_SLOT_INVALID)
+ return;
+ }
+
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count);
Item* pNewItem = pSrcItem->CloneItem(count, this);
if (!pNewItem)
@@ -12761,7 +12845,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
pSrcItem->SetState(ITEM_CHANGED, this);
StoreItem(dest, pNewItem, true);
}
- else if (IsBankPos (dst))
+ else if (IsBankPos(dst))
{
// change item amount before check (for unique max count check)
pSrcItem->SetCount(pSrcItem->GetCount() - count);
@@ -12781,7 +12865,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
pSrcItem->SetState(ITEM_CHANGED, this);
BankItem(dest, pNewItem, true);
}
- else if (IsEquipmentPos (dst))
+ else if (IsEquipmentPos(dst))
{
// change item amount before check (for unique max count check), provide space for splitted items
pSrcItem->SetCount(pSrcItem->GetCount() - count);
@@ -13997,6 +14081,10 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
PrepareQuestMenu(source->GetGUID());
}
+ if (source->GetTypeId() == TYPEID_GAMEOBJECT)
+ if (source->ToGameObject()->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
+ PrepareQuestMenu(source->GetGUID());
+
for (GossipMenuItemsMap::const_iterator itr = menuItemBounds.first; itr != menuItemBounds.second; ++itr)
{
bool canTalk = true;
@@ -14082,11 +14170,6 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
switch (itr->second.OptionType)
{
- case GOSSIP_OPTION_QUESTGIVER:
- if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
- PrepareQuestMenu(source->GetGUID());
- canTalk = false;
- break;
case GOSSIP_OPTION_GOSSIP:
if (go->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER && go->GetGoType() != GAMEOBJECT_TYPE_GOOBER)
canTalk = false;
@@ -14240,7 +14323,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
break;
case GOSSIP_OPTION_UNLEARNTALENTS:
PlayerTalkClass->SendCloseGossip();
- source->ToCreature()->CastSpell(this, 46331, true); // Trainer: Untrain Talents
+ SendTalentWipeConfirm(guid);
break;
case GOSSIP_OPTION_UNLEARNPETTALENTS:
PlayerTalkClass->SendCloseGossip();
@@ -14529,7 +14612,7 @@ bool Player::CanSeeStartQuest(Quest const* quest)
SatisfyQuestExclusiveGroup(quest, false) && SatisfyQuestReputation(quest, false) &&
SatisfyQuestPreviousQuest(quest, false) && SatisfyQuestNextChain(quest, false) &&
SatisfyQuestPrevChain(quest, false) && SatisfyQuestDay(quest, false) && SatisfyQuestWeek(quest, false) &&
- !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this))
+ SatisfyQuestSeasonal(quest, false) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this))
{
return getLevel() + sWorld->getIntConfig(CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF) >= quest->GetMinLevel();
}
@@ -14545,7 +14628,7 @@ bool Player::CanTakeQuest(Quest const* quest, bool msg)
&& SatisfyQuestPreviousQuest(quest, msg) && SatisfyQuestTimed(quest, msg)
&& SatisfyQuestNextChain(quest, msg) && SatisfyQuestPrevChain(quest, msg)
&& SatisfyQuestDay(quest, msg) && SatisfyQuestWeek(quest, msg)
- && !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this)
+ && SatisfyQuestSeasonal(quest,msg) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this)
&& SatisfyQuestConditions(quest, msg);
}
@@ -14669,7 +14752,7 @@ bool Player::CanRewardQuest(Quest const* quest, bool msg)
return false;
// daily quest can't be rewarded (25 daily quest already completed)
- if (!SatisfyQuestDay(quest, true) || !SatisfyQuestWeek(quest, true))
+ if (!SatisfyQuestDay(quest, true) || !SatisfyQuestWeek(quest, true) || !SatisfyQuestSeasonal(quest,true))
return false;
// rewarded and not repeatable quest (only cheating case, then ignore without message)
@@ -14741,7 +14824,9 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg)
void Player::AddQuest(Quest const* quest, Object* questGiver)
{
uint16 log_slot = FindQuestSlot(0);
- ASSERT(log_slot < MAX_QUEST_LOG_SIZE);
+
+ if (log_slot >= MAX_QUEST_LOG_SIZE) // Player does not have any free slot in the quest log
+ return;
uint32 quest_id = quest->GetQuestId();
@@ -14978,6 +15063,8 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
}
else if (quest->IsWeekly())
SetWeeklyQuestStatus(quest_id);
+ else if (quest->IsSeasonal())
+ SetSeasonalQuestStatus(quest_id);
RemoveActiveQuest(quest_id);
m_RewardedQuests.insert(quest_id);
@@ -15333,7 +15420,7 @@ bool Player::SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg)
// not allow have daily quest if daily quest from exclusive group already recently completed
Quest const* Nquest = sObjectMgr->GetQuestTemplate(exclude_Id);
- if (!SatisfyQuestDay(Nquest, false) || !SatisfyQuestWeek(Nquest, false))
+ if (!SatisfyQuestDay(Nquest, false) || !SatisfyQuestWeek(Nquest, false) || !SatisfyQuestSeasonal(Nquest,false))
{
if (msg)
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
@@ -15342,7 +15429,7 @@ bool Player::SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg)
}
// alternative quest already started or completed - but don't check rewarded states if both are repeatable
- if (GetQuestStatus(exclude_Id) != QUEST_STATUS_NONE || (!(qInfo->IsRepeatable() && Nquest->IsRepeatable()) && m_RewardedQuests.find(exclude_Id) != m_RewardedQuests.end()))
+ if (GetQuestStatus(exclude_Id) != QUEST_STATUS_NONE || (!(qInfo->IsRepeatable() && Nquest->IsRepeatable()) && (m_RewardedQuests.find(exclude_Id) != m_RewardedQuests.end())))
{
if (msg)
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
@@ -15443,6 +15530,19 @@ bool Player::SatisfyQuestWeek(Quest const* qInfo, bool /*msg*/)
return m_weeklyquests.find(qInfo->GetQuestId()) == m_weeklyquests.end();
}
+bool Player::SatisfyQuestSeasonal(Quest const* qInfo, bool /*msg*/)
+{
+ if (!qInfo->IsSeasonal() || m_seasonalquests.empty())
+ return true;
+
+ uint16 eventId = sGameEventMgr->GetEventIdForQuest(qInfo);
+ if (m_seasonalquests.find(eventId) == m_seasonalquests.end())
+ return false;
+
+ // if not found in cooldown list
+ return m_seasonalquests[eventId].find(qInfo->GetQuestId()) == m_seasonalquests[eventId].end();
+}
+
bool Player::GiveQuestSourceItem(Quest const* quest)
{
uint32 srcitem = quest->GetSrcItemId();
@@ -16434,7 +16534,7 @@ void Player::SetHomebind(WorldLocation const& /*loc*/, uint32 /*area_id*/)
m_homebindZ = GetPositionZ();
// update sql homebind
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_PLAYER_HOMEBIND);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PLAYER_HOMEBIND);
stmt->setUInt16(0, m_homebindMapId);
stmt->setUInt16(1, m_homebindAreaId);
stmt->setFloat (2, m_homebindX);
@@ -16507,7 +16607,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
if (ObjectMgr::CheckPlayerName(m_name) != CHAR_NAME_SUCCESS ||
(AccountMgr::IsPlayerAccount(GetSession()->GetSecurity()) && sObjectMgr->IsReservedName(m_name)))
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_AT_LOGIN_FLAG);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_RENAME));
stmt->setUInt32(1, guid);
@@ -16642,6 +16742,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
_LoadInstanceTimeRestrictions(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES));
_LoadBGData(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADBGDATA));
+ GetSession()->SetPlayer(this);
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
if (!mapEntry || !IsPositionValid())
{
@@ -16659,10 +16760,10 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
if (player_at_bg && currentBg->GetStatus() != STATUS_WAIT_LEAVE)
{
- BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(currentBg->GetTypeID(true), currentBg->GetArenaType());
+ BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(currentBg->GetTypeID(), currentBg->GetArenaType());
AddBattlegroundQueueId(bgQueueTypeId);
- m_bgData.bgTypeID = currentBg->GetTypeID(true);
+ m_bgData.bgTypeID = currentBg->GetTypeID();
//join player to battleground group
currentBg->EventPlayerLoggedIn(this);
@@ -16834,7 +16935,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
}
// 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))
+ if (instanceId && !sInstanceSaveMgr->GetInstanceSave(instanceId) && !map->IsBattlegroundOrArena())
{
AreaTrigger const* at = sObjectMgr->GetMapEntranceTrigger(mapId);
if (at)
@@ -16980,7 +17081,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
_LoadQuestStatus(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADQUESTSTATUS));
_LoadQuestStatusRewarded(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADQUESTSTATUSREW));
_LoadDailyQuestStatus(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADDAILYQUESTSTATUS));
- _LoadWeeklyQuestStatus(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADWEKLYQUESTSTATUS));
+ _LoadWeeklyQuestStatus(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADWEEKLYQUESTSTATUS));
+ _LoadSeasonalQuestStatus(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADSEASONALQUESTSTATUS));
_LoadRandomBGStatus(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADRANDOMBG));
// after spell and quest load
@@ -17441,7 +17543,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
}
else
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_ITEM_REFUNDS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEM_REFUNDS);
stmt->setUInt32(0, item->GetGUIDLow());
stmt->setUInt32(1, GetGUIDLow());
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
@@ -17461,7 +17563,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
}
else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_ITEM_BOP_TRADE);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEM_BOP_TRADE);
stmt->setUInt32(0, item->GetGUIDLow());
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
{
@@ -17524,7 +17626,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
void Player::_LoadMailedItems(Mail* mail)
{
// data needs to be at first place for Item::LoadFromDB
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_MAILITEMS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAILITEMS);
stmt->setUInt32(0, mail->messageID);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
@@ -17560,7 +17662,13 @@ void Player::_LoadMailedItems(Mail* mail)
if (!item->LoadFromDB(itemGuid, MAKE_NEW_GUID(fields[13].GetUInt32(), 0, HIGHGUID_PLAYER), fields, itemTemplate))
{
sLog->outError("Player::_LoadMailedItems - Item in mail (%u) doesn't exist !!!! - item guid: %u, deleted from mail", mail->messageID, itemGuid);
- CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid = '%u'", itemGuid);
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM);
+
+ stmt->setUInt32(0, itemGuid);
+
+ CharacterDatabase.Execute(stmt);
+
item->FSetState(ITEM_REMOVED);
SQLTransaction temp = SQLTransaction(NULL);
@@ -17826,7 +17934,8 @@ void Player::_LoadWeeklyQuestStatus(PreparedQueryResult result)
{
do
{
- uint32 quest_id = (*result)[0].GetUInt32();
+ Field* fields = result->Fetch();
+ uint32 quest_id = fields[0].GetUInt32();
Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id);
if (!quest)
continue;
@@ -17840,6 +17949,30 @@ void Player::_LoadWeeklyQuestStatus(PreparedQueryResult result)
m_WeeklyQuestChanged = false;
}
+void Player::_LoadSeasonalQuestStatus(PreparedQueryResult result)
+{
+ m_seasonalquests.clear();
+
+ if (result)
+ {
+ do
+ {
+ Field* fields = result->Fetch();
+ uint32 quest_id = fields[0].GetUInt32();
+ uint32 event_id = fields[1].GetUInt32();
+ Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id);
+ if (!quest)
+ continue;
+
+ m_seasonalquests[event_id].insert(quest_id);
+ sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Seasonal quest {%u} cooldown for player (GUID: %u)", quest_id, GetGUIDLow());
+ }
+ while (result->NextRow());
+ }
+
+ m_SeasonalQuestChanged = false;
+}
+
void Player::_LoadSpells(PreparedQueryResult result)
{
//QueryResult* result = CharacterDatabase.PQuery("SELECT spell, active, disabled FROM character_spell WHERE guid = '%u'", GetGUIDLow());
@@ -17895,33 +18028,43 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
// so the value read from the DB may be wrong here but only if the InstanceSave is loaded
// and in that case it is not used
+ bool deleteInstance = false;
+
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
if (!mapEntry || !mapEntry->IsDungeon())
{
sLog->outError("_LoadBoundInstances: player %s(%d) has bind to not existed or not dungeon map %d", GetName(), GetGUIDLow(), mapId);
- CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%d' AND instance = '%d'", GetGUIDLow(), instanceId);
- continue;
+ deleteInstance = true;
}
-
- if (difficulty >= MAX_DIFFICULTY)
+ else if (difficulty >= MAX_DIFFICULTY)
{
sLog->outError("_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u", GetName(), GetGUIDLow(), difficulty, mapId);
- CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%d' AND instance = '%d'", GetGUIDLow(), instanceId);
- continue;
+ deleteInstance = true;
}
-
- MapDifficulty const* mapDiff = GetMapDifficultyData(mapId, Difficulty(difficulty));
- if (!mapDiff)
+ else
{
- sLog->outError("_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u", GetName(), GetGUIDLow(), difficulty, mapId);
- CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%d' AND instance = '%d'", GetGUIDLow(), instanceId);
- continue;
+ MapDifficulty const* mapDiff = GetMapDifficultyData(mapId, Difficulty(difficulty));
+ if (!mapDiff)
+ {
+ sLog->outError("_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u", GetName(), GetGUIDLow(), difficulty, mapId);
+ deleteInstance = true;
+ }
+ else if (!perm && group)
+ {
+ sLog->outError("_LoadBoundInstances: player %s(%d) is in group %d but has a non-permanent character bind to map %d, %d, %d", GetName(), GetGUIDLow(), GUID_LOPART(group->GetGUID()), mapId, instanceId, difficulty);
+ deleteInstance = true;
+ }
}
- if (!perm && group)
+ if (deleteInstance)
{
- sLog->outError("_LoadBoundInstances: player %s(%d) is in group %d but has a non-permanent character bind to map %d, %d, %d", GetName(), GetGUIDLow(), GUID_LOPART(group->GetGUID()), mapId, instanceId, difficulty);
- CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%d' AND instance = '%d'", GetGUIDLow(), instanceId);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE);
+
+ stmt->setUInt32(0, GetGUIDLow());
+ stmt->setUInt32(1, instanceId);
+
+ CharacterDatabase.Execute(stmt);
+
continue;
}
@@ -17970,7 +18113,15 @@ void Player::UnbindInstance(BoundInstancesMap::iterator &itr, Difficulty difficu
if (itr != m_boundInstances[difficulty].end())
{
if (!unload)
- CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%u' AND instance = '%u'", GetGUIDLow(), itr->second.save->GetInstanceId());
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE);
+
+ stmt->setUInt32(0, GetGUIDLow());
+ stmt->setUInt32(1, itr->second.save->GetInstanceId());
+
+ CharacterDatabase.Execute(stmt);
+ }
+
itr->second.save->RemovePlayer(this); // save can become invalid
m_boundInstances[difficulty].erase(itr++);
}
@@ -17986,11 +18137,28 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, b
// update the save when the group kills a boss
if (permanent != bind.perm || save != bind.save)
if (!load)
- CharacterDatabase.PExecute("UPDATE character_instance SET instance = '%u', permanent = '%u' WHERE guid = '%u' AND instance = '%u'", save->GetInstanceId(), permanent, GetGUIDLow(), bind.save->GetInstanceId());
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_INSTANCE);
+
+ stmt->setUInt32(0, save->GetInstanceId());
+ stmt->setBool(1, permanent);
+ stmt->setUInt32(2, GetGUIDLow());
+ stmt->setUInt32(3, bind.save->GetInstanceId());
+
+ CharacterDatabase.Execute(stmt);
+ }
}
else
if (!load)
- CharacterDatabase.PExecute("INSERT INTO character_instance (guid, instance, permanent) VALUES ('%u', '%u', '%u')", GetGUIDLow(), save->GetInstanceId(), permanent);
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_INSTANCE);
+
+ stmt->setUInt32(0, GetGUIDLow());
+ stmt->setUInt32(1, save->GetInstanceId());
+ stmt->setBool(2, permanent);
+
+ CharacterDatabase.Execute(stmt);
+ }
if (bind.save != save)
{
@@ -18262,7 +18430,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
m_homebindY = info->positionY;
m_homebindZ = info->positionZ;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_PLAYER_HOMEBIND);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PLAYER_HOMEBIND);
stmt->setUInt32(0, GetGUIDLow());
stmt->setUInt16(1, m_homebindMapId);
stmt->setUInt16(2, m_homebindAreaId);
@@ -18307,7 +18475,7 @@ void Player::SaveToDB(bool create /*=false*/)
{
//! Insert query
//! TO DO: Filter out more redundant fields that can take their default value at player create
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_CHARACTER);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER);
stmt->setUInt32(index++, GetGUIDLow());
stmt->setUInt32(index++, GetSession()->GetAccountId());
stmt->setString(index++, GetName());
@@ -18531,6 +18699,7 @@ void Player::SaveToDB(bool create /*=false*/)
_SaveQuestStatus(trans);
_SaveDailyQuestStatus(trans);
_SaveWeeklyQuestStatus(trans);
+ _SaveSeasonalQuestStatus(trans);
_SaveTalents(trans);
_SaveSpells(trans);
_SaveSpellCooldowns(trans);
@@ -18632,7 +18801,7 @@ void Player::_SaveAuras(SQLTransaction& trans)
}
uint8 index = 0;
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_AURA);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_AURA);
stmt->setUInt32(index++, GetGUIDLow());
stmt->setUInt64(index++, itr->second->GetCasterGUID());
stmt->setUInt64(index++, itr->second->GetCastItemGUID());
@@ -18869,18 +19038,28 @@ void Player::_SaveDailyQuestStatus(SQLTransaction& trans)
// save last daily quest time for all quests: we need only mostly reset time for reset check anyway
// we don't need transactions here.
- trans->PAppend("DELETE FROM character_queststatus_daily WHERE guid = '%u'", GetGUIDLow());
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_STATUS_DAILY_CHAR);
+ stmt->setUInt32(0, GetGUIDLow());
+ trans->Append(stmt);
for (uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx)
if (GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx))
- trans->PAppend("INSERT INTO character_queststatus_daily (guid, quest, time) VALUES ('%u', '%u', '" UI64FMTD "')",
- GetGUIDLow(), GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx), uint64(m_lastDailyQuestTime));
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_DAILYQUESTSTATUS);
+ stmt->setUInt32(0, GetGUIDLow());
+ stmt->setUInt32(1, GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx));
+ stmt->setUInt64(2, uint64(m_lastDailyQuestTime));
+ trans->Append(stmt);
+ }
if (!m_DFQuests.empty())
{
for (DFQuestsDoneList::iterator itr = m_DFQuests.begin(); itr != m_DFQuests.end(); ++itr)
{
- trans->PAppend("INSERT INTO character_queststatus_daily (guid, quest, time) VALUES ('%u', '%u', '" UI64FMTD "')",
- GetGUIDLow(), (*itr), uint64(m_lastDailyQuestTime));
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_DAILYQUESTSTATUS);
+ stmt->setUInt32(0, GetGUIDLow());
+ stmt->setUInt32(1, (*itr));
+ stmt->setUInt64(2, uint64(m_lastDailyQuestTime));
+ trans->Append(stmt);
}
}
}
@@ -18891,18 +19070,51 @@ void Player::_SaveWeeklyQuestStatus(SQLTransaction& trans)
return;
// we don't need transactions here.
- trans->PAppend("DELETE FROM character_queststatus_weekly WHERE guid = '%u'", GetGUIDLow());
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_STATUS_WEEKLY_CHAR);
+ stmt->setUInt32(0, GetGUIDLow());
+ trans->Append(stmt);
for (QuestSet::const_iterator iter = m_weeklyquests.begin(); iter != m_weeklyquests.end(); ++iter)
{
uint32 quest_id = *iter;
- trans->PAppend("INSERT INTO character_queststatus_weekly (guid, quest) VALUES ('%u', '%u')", GetGUIDLow(), quest_id);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_WEEKLYQUESTSTATUS);
+ stmt->setUInt32(0, GetGUIDLow());
+ stmt->setUInt32(1, quest_id);
+ trans->Append(stmt);
}
m_WeeklyQuestChanged = false;
}
+void Player::_SaveSeasonalQuestStatus(SQLTransaction& trans)
+{
+ if (!m_SeasonalQuestChanged || m_seasonalquests.empty())
+ return;
+
+ // we don't need transactions here.
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_STATUS_SEASONAL_CHAR);
+ stmt->setUInt32(0, GetGUIDLow());
+ trans->Append(stmt);
+
+ for (SeasonalEventQuestMap::const_iterator iter = m_seasonalquests.begin(); iter != m_seasonalquests.end(); ++iter)
+ {
+ uint16 event_id = iter->first;
+ for (SeasonalQuestSet::const_iterator itr = iter->second.begin(); itr != iter->second.end(); ++itr)
+ {
+ uint32 quest_id = (*itr);
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_SEASONALQUESTSTATUS);
+ stmt->setUInt32(0, GetGUIDLow());
+ stmt->setUInt32(1, quest_id);
+ stmt->setUInt32(2, event_id);
+ trans->Append(stmt);
+ }
+ }
+
+ m_SeasonalQuestChanged = false;
+}
+
void Player::_SaveSkills(SQLTransaction& trans)
{
// we don't need transactions here.
@@ -19073,13 +19285,17 @@ void Player::SendAttackSwingNotInRange()
void Player::SavePositionInDB(uint32 mapid, float x, float y, float z, float o, uint32 zone, uint64 guid)
{
- std::ostringstream ss;
- ss << "UPDATE characters SET position_x='" << x << "', position_y='" << y
- << "', position_z='" << z << "', orientation='" << o << "', map='" << mapid
- << "', zone='" << zone << "', trans_x='0', trans_y='0', trans_z='0', "
- << "transguid='0', taxi_path='' WHERE guid='" << GUID_LOPART(guid) << '\'';
- sLog->outDebug(LOG_FILTER_UNITS, "%s", ss.str().c_str());
- CharacterDatabase.Execute(ss.str().c_str());
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_POSITION);
+
+ stmt->setFloat(0, x);
+ stmt->setFloat(1, y);
+ stmt->setFloat(2, z);
+ stmt->setFloat(3, o);
+ stmt->setUInt16(4, uint16(mapid));
+ stmt->setUInt16(5, uint16(zone));
+ stmt->setUInt32(6, GUID_LOPART(guid));
+
+ CharacterDatabase.Execute(stmt);
}
void Player::SetUInt32ValueInArray(Tokens& tokens, uint16 index, uint32 value)
@@ -19102,11 +19318,18 @@ void Player::Customize(uint64 guid, uint8 gender, uint8 skin, uint8 face, uint8
Field* fields = result->Fetch();
- uint32 player_bytes2 = fields[0].GetUInt32();
- player_bytes2 &= ~0xFF;
- player_bytes2 |= facialHair;
+ uint32 playerBytes2 = fields[0].GetUInt32();
+ playerBytes2 &= ~0xFF;
+ playerBytes2 |= facialHair;
- CharacterDatabase.PExecute("UPDATE characters SET gender = '%u', playerBytes = '%u', playerBytes2 = '%u' WHERE guid = '%u'", gender, skin | (face << 8) | (hairStyle << 16) | (hairColor << 24), player_bytes2, GUID_LOPART(guid));
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GENDER_PLAYERBYTES);
+
+ stmt->setUInt8(0, gender);
+ stmt->setUInt32(1, skin | (face << 8) | (hairStyle << 16) | (hairColor << 24));
+ stmt->setUInt32(2, playerBytes2);
+ stmt->setUInt32(3, GUID_LOPART(guid));
+
+ CharacterDatabase.Execute(stmt);
}
void Player::SendAttackSwingDeadTarget()
@@ -19953,9 +20176,22 @@ void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type)
} while (result->NextRow());
if (type == 10)
- CharacterDatabase.PExecute("DELETE FROM petition_sign WHERE playerguid = '%u'", GUID_LOPART(guid));
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_PETITION_SIGNATURES);
+
+ stmt->setUInt32(0, GUID_LOPART(guid));
+
+ CharacterDatabase.Execute(stmt);
+ }
else
- CharacterDatabase.PExecute("DELETE FROM petition_sign WHERE playerguid = '%u' AND type = '%u'", GUID_LOPART(guid), type);
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_SIGNATURE);
+
+ stmt->setUInt32(0, GUID_LOPART(guid));
+ stmt->setUInt8(1, uint8(type));
+
+ CharacterDatabase.Execute(stmt);
+ }
}
SQLTransaction trans = CharacterDatabase.BeginTransaction();
@@ -19974,7 +20210,7 @@ void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type)
void Player::LeaveAllArenaTeams(uint64 guid)
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_ARENA_TEAMS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PLAYER_ARENA_TEAMS);
stmt->setUInt32(0, GUID_LOPART(guid));
PreparedQueryResult result = CharacterDatabase.Query(stmt);
@@ -20029,7 +20265,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
return false;
// not let cheating with start flight in time of logout process || while in combat || has type state: stunned || has type state: root
- if (GetSession()->isLogingOut() || isInCombat() || HasUnitState(UNIT_STAT_STUNNED) || HasUnitState(UNIT_STAT_ROOT))
+ if (GetSession()->isLogingOut() || isInCombat() || HasUnitState(UNIT_STATE_STUNNED) || HasUnitState(UNIT_STATE_ROOT))
{
WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4);
data << uint32(ERR_TAXIPLAYERBUSY);
@@ -21324,9 +21560,7 @@ void Player::SendInitialVisiblePackets(Unit* target)
SendAurasForTarget(target);
if (target->isAlive())
{
- if (target->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE)
- target->SendMonsterMoveWithSpeedToCurrentDestination(this);
- if (target->HasUnitState(UNIT_STAT_MELEE_ATTACKING) && target->getVictim())
+ if (target->HasUnitState(UNIT_STATE_MELEE_ATTACKING) && target->getVictim())
target->SendMeleeAttackStart(target->getVictim());
}
}
@@ -21583,6 +21817,8 @@ void Player::SendInitialPacketsBeforeAddToMap()
// SMSG_PET_GUIDS
// SMSG_UPDATE_WORLD_STATE
// SMSG_POWER_UPDATE
+
+ SetMover(this);
}
void Player::SendInitialPacketsAfterAddToMap()
@@ -21971,6 +22207,16 @@ void Player::SetWeeklyQuestStatus(uint32 quest_id)
m_WeeklyQuestChanged = true;
}
+void Player::SetSeasonalQuestStatus(uint32 quest_id)
+{
+ Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id);
+ if (!quest)
+ return;
+
+ m_seasonalquests[sGameEventMgr->GetEventIdForQuest(quest)].insert(quest_id);
+ m_SeasonalQuestChanged = true;
+}
+
void Player::ResetDailyQuestStatus()
{
for (uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx)
@@ -21993,6 +22239,16 @@ void Player::ResetWeeklyQuestStatus()
m_WeeklyQuestChanged = false;
}
+void Player::ResetSeasonalQuestStatus(uint16 event_id)
+{
+ if (m_seasonalquests.empty() || m_seasonalquests[event_id].empty())
+ return;
+
+ m_seasonalquests.erase(event_id);
+ // DB data deleted in caller
+ m_SeasonalQuestChanged = false;
+}
+
Battleground* Player::GetBattleground() const
{
if (GetBattlegroundId() == 0)
@@ -23136,6 +23392,9 @@ void Player::RemoveRunesByAuraEffect(AuraEffect const* aura)
void Player::RestoreBaseRune(uint8 index)
{
AuraEffect const* aura = m_runes->runes[index].ConvertAura;
+ // If rune was converted by a non-pasive aura that still active we should keep it converted
+ if (aura && !(aura->GetSpellInfo()->Attributes & SPELL_ATTR0_PASSIVE))
+ return;
ConvertRune(index, GetBaseRune(index));
SetRuneConvertAura(index, NULL);
// Don't drop passive talents providing rune convertion
@@ -23383,7 +23642,14 @@ void Player::_LoadSkills(PreparedQueryResult result)
if (value == 0)
{
sLog->outError("Character %u has skill %u with value 0. Will be deleted.", GetGUIDLow(), skill);
- CharacterDatabase.PExecute("DELETE FROM character_skills WHERE guid = '%u' AND skill = '%u' ", GetGUIDLow(), skill);
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_SKILL);
+
+ stmt->setUInt32(0, GetGUIDLow());
+ stmt->setUInt16(1, skill);
+
+ CharacterDatabase.Execute(stmt);
+
continue;
}
@@ -24172,7 +24438,7 @@ void Player::_SaveEquipmentSets(SQLTransaction& trans)
++itr;
break; // nothing do
case EQUIPMENT_SET_CHANGED:
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_EQUIP_SET);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_EQUIP_SET);
stmt->setString(j++, eqset.Name.c_str());
stmt->setString(j++, eqset.IconName.c_str());
for (uint8 i=0; i<EQUIPMENT_SLOT_END; ++i)
@@ -24185,7 +24451,7 @@ void Player::_SaveEquipmentSets(SQLTransaction& trans)
++itr;
break;
case EQUIPMENT_SET_NEW:
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_EQUIP_SET);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_EQUIP_SET);
stmt->setUInt32(j++, GetGUIDLow());
stmt->setUInt64(j++, eqset.Guid);
stmt->setUInt32(j++, index);
@@ -24213,7 +24479,7 @@ void Player::_SaveBGData(SQLTransaction& trans)
stmt->setUInt32(0, GetGUIDLow());
trans->Append(stmt);
/* guid, bgInstanceID, bgTeam, x, y, z, o, map, taxi[0], taxi[1], mountSpell */
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_PLAYER_BGDATA);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PLAYER_BGDATA);
stmt->setUInt32(0, GetGUIDLow());
stmt->setUInt32(1, m_bgData.bgInstanceID);
stmt->setUInt16(2, m_bgData.bgTeam);
@@ -24243,12 +24509,19 @@ void Player::DeleteEquipmentSet(uint64 setGuid)
}
}
-void Player::RemoveAtLoginFlag(AtLoginFlags f, bool in_db_also /*= false*/)
+void Player::RemoveAtLoginFlag(AtLoginFlags flags, bool persist /*= false*/)
{
- m_atLoginFlags &= ~f;
+ m_atLoginFlags &= ~flags;
+
+ if (persist)
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_REM_AT_LOGIN_FLAG);
- if (in_db_also)
- CharacterDatabase.PExecute("UPDATE characters set at_login = at_login & ~ %u WHERE guid ='%u'", uint32(f), GetGUIDLow());
+ stmt->setUInt16(0, uint16(flags));
+ stmt->setUInt32(1, GetGUIDLow());
+
+ CharacterDatabase.Execute(stmt);
+ }
}
void Player::SendClearCooldown(uint32 spell_id, Unit* target)
@@ -24508,7 +24781,7 @@ void Player::ActivateSpec(uint8 spec)
InitTalentForLevel();
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_ACTIONS_SPEC);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ACTIONS_SPEC);
stmt->setUInt32(0, GetGUIDLow());
stmt->setUInt8(1, m_activeSpec);
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
@@ -24760,7 +25033,13 @@ void Player::SetRandomWinner(bool isWinner)
{
m_IsBGRandomWinner = isWinner;
if (m_IsBGRandomWinner)
- CharacterDatabase.PExecute("INSERT INTO character_battleground_random (guid) VALUES ('%u')", GetGUIDLow());
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BATTLEGROUND_RANDOM);
+
+ stmt->setUInt32(0, GetGUIDLow());
+
+ CharacterDatabase.Execute(stmt);
+ }
}
void Player::_LoadRandomBGStatus(PreparedQueryResult result)
@@ -24814,7 +25093,7 @@ void Player::_SaveInstanceTimeRestrictions(SQLTransaction& trans)
for (InstanceTimeMap::const_iterator itr = _instanceResetTimes.begin(); itr != _instanceResetTimes.end(); ++itr)
{
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_ACCOUNT_INSTANCE_LOCK_TIMES);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ACCOUNT_INSTANCE_LOCK_TIMES);
stmt->setUInt32(0, GetSession()->GetAccountId());
stmt->setUInt32(1, itr->first);
stmt->setUInt64(2, itr->second);
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index a9bba9cbdc4..489b4eacec5 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -274,13 +274,14 @@ struct PvPInfo
struct DuelInfo
{
- DuelInfo() : initiator(NULL), opponent(NULL), startTimer(0), startTime(0), outOfBound(0) {}
+ DuelInfo() : initiator(NULL), opponent(NULL), startTimer(0), startTime(0), outOfBound(0), isMounted(false) {}
Player* initiator;
Player* opponent;
time_t startTimer;
time_t startTime;
time_t outOfBound;
+ bool isMounted;
};
struct Areas
@@ -686,7 +687,8 @@ enum TradeSlots
{
TRADE_SLOT_COUNT = 7,
TRADE_SLOT_TRADED_COUNT = 6,
- TRADE_SLOT_NONTRADED = 6
+ TRADE_SLOT_NONTRADED = 6,
+ TRADE_SLOT_INVALID = -1,
};
enum TransferAbortReason
@@ -815,11 +817,12 @@ enum PlayerLoginQueryIndex
PLAYER_LOGIN_QUERY_LOADTALENTS = 23,
PLAYER_LOGIN_QUERY_LOADACCOUNTDATA = 24,
PLAYER_LOGIN_QUERY_LOADSKILLS = 25,
- PLAYER_LOGIN_QUERY_LOADWEKLYQUESTSTATUS = 26,
+ PLAYER_LOGIN_QUERY_LOADWEEKLYQUESTSTATUS = 26,
PLAYER_LOGIN_QUERY_LOADRANDOMBG = 27,
PLAYER_LOGIN_QUERY_LOADBANNED = 28,
PLAYER_LOGIN_QUERY_LOADQUESTSTATUSREW = 29,
PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES = 30,
+ PLAYER_LOGIN_QUERY_LOADSEASONALQUESTSTATUS = 31,
MAX_PLAYER_LOGIN_QUERY,
};
@@ -1000,7 +1003,8 @@ class TradeData
TradeData* GetTraderData() const;
Item* GetItem(TradeSlots slot) const;
- bool HasItem(uint64 item_guid) const;
+ bool HasItem(uint64 itemGuid) const;
+ TradeSlots GetTradeSlotForItem(uint64 itemGuid) const;
void SetItem(TradeSlots slot, Item* item);
uint32 GetSpell() const { return m_spell; }
@@ -1276,6 +1280,7 @@ class Player : public Unit, public GridObject<Player>
bool HasItemTotemCategory(uint32 TotemCategory) const;
InventoryResult CanUseItem(ItemTemplate const* pItem) const;
InventoryResult CanUseAmmo(uint32 item) const;
+ InventoryResult CanRollForItemInLFG(ItemTemplate const* item, WorldObject const* lootedObject) const;
Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId = 0);
Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId, AllowedLooterSet &allowedLooters);
Item* StoreItem(ItemPosCountVec const& pos, Item* pItem, bool update);
@@ -1422,6 +1427,7 @@ class Player : public Unit, public GridObject<Player>
bool SatisfyQuestPrevChain(Quest const* qInfo, bool msg);
bool SatisfyQuestDay(Quest const* qInfo, bool msg);
bool SatisfyQuestWeek(Quest const* qInfo, bool msg);
+ bool SatisfyQuestSeasonal(Quest const* qInfo, bool msg);
bool GiveQuestSourceItem(Quest const* quest);
bool TakeQuestSourceItem(uint32 questId, bool msg);
bool GetQuestRewardStatus(uint32 quest_id) const;
@@ -1432,8 +1438,10 @@ class Player : public Unit, public GridObject<Player>
void SetDailyQuestStatus(uint32 quest_id);
void SetWeeklyQuestStatus(uint32 quest_id);
+ void SetSeasonalQuestStatus(uint32 quest_id);
void ResetDailyQuestStatus();
void ResetWeeklyQuestStatus();
+ void ResetSeasonalQuestStatus(uint16 event_id);
uint16 FindQuestSlot(uint32 quest_id) const;
uint32 GetQuestSlotQuestId(uint16 slot) const { return GetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_ID_OFFSET); }
@@ -1798,7 +1806,7 @@ class Player : public Unit, public GridObject<Player>
void SetContestedPvPTimer(uint32 newTime) {m_contestedPvPTimer = newTime;}
void ResetContestedPvP()
{
- ClearUnitState(UNIT_STAT_ATTACK_PLAYER);
+ ClearUnitState(UNIT_STATE_ATTACK_PLAYER);
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP);
m_contestedPvPTimer = 0;
}
@@ -1960,7 +1968,6 @@ class Player : public Unit, public GridObject<Player>
Corpse* GetCorpse() const;
void SpawnCorpseBones();
void CreateCorpse();
- bool FallGround(uint8 FallMode = 0);
void KillPlayer();
uint32 GetResurrectionSpellId();
void ResurrectPlayer(float restore_percent, bool applySickness = false);
@@ -2352,7 +2359,7 @@ class Player : public Unit, public GridObject<Player>
bool HasAtLoginFlag(AtLoginFlags f) const { return m_atLoginFlags & f; }
void SetAtLoginFlag(AtLoginFlags f) { m_atLoginFlags |= f; }
- void RemoveAtLoginFlag(AtLoginFlags f, bool in_db_also = false);
+ void RemoveAtLoginFlag(AtLoginFlags flags, bool persist = false);
bool isUsingLfg();
@@ -2558,8 +2565,11 @@ class Player : public Unit, public GridObject<Player>
//We allow only one timed quest active at the same time. Below can then be simple value instead of set.
typedef std::set<uint32> QuestSet;
+ typedef std::set<uint32> SeasonalQuestSet;
+ typedef UNORDERED_MAP<uint32,SeasonalQuestSet> SeasonalEventQuestMap;
QuestSet m_timedquests;
QuestSet m_weeklyquests;
+ SeasonalEventQuestMap m_seasonalquests;
uint64 m_divider;
uint32 m_ingametime;
@@ -2580,6 +2590,7 @@ class Player : public Unit, public GridObject<Player>
void _LoadQuestStatusRewarded(PreparedQueryResult result);
void _LoadDailyQuestStatus(PreparedQueryResult result);
void _LoadWeeklyQuestStatus(PreparedQueryResult result);
+ void _LoadSeasonalQuestStatus(PreparedQueryResult result);
void _LoadRandomBGStatus(PreparedQueryResult result);
void _LoadGroup(PreparedQueryResult result);
void _LoadSkills(PreparedQueryResult result);
@@ -2605,6 +2616,7 @@ class Player : public Unit, public GridObject<Player>
void _SaveQuestStatus(SQLTransaction& trans);
void _SaveDailyQuestStatus(SQLTransaction& trans);
void _SaveWeeklyQuestStatus(SQLTransaction& trans);
+ void _SaveSeasonalQuestStatus(SQLTransaction& trans);
void _SaveSkills(SQLTransaction& trans);
void _SaveSpells(SQLTransaction& trans);
void _SaveEquipmentSets(SQLTransaction& trans);
@@ -2716,6 +2728,7 @@ class Player : public Unit, public GridObject<Player>
bool m_DailyQuestChanged;
bool m_WeeklyQuestChanged;
+ bool m_SeasonalQuestChanged;
time_t m_lastDailyQuestTime;
uint32 m_drunkTimer;
diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp
index dbb18496515..cb327b83d17 100755
--- a/src/server/game/Entities/Player/SocialMgr.cpp
+++ b/src/server/game/Entities/Player/SocialMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,7 @@ uint32 PlayerSocial::GetNumberOfSocialsWithFlag(SocialFlag flag)
return counter;
}
-bool PlayerSocial::AddToSocialList(uint32 friend_guid, bool ignore)
+bool PlayerSocial::AddToSocialList(uint32 friendGuid, bool ignore)
{
// check client limits
if (ignore)
@@ -65,25 +65,39 @@ bool PlayerSocial::AddToSocialList(uint32 friend_guid, bool ignore)
if (ignore)
flag = SOCIAL_FLAG_IGNORED;
- PlayerSocialMap::const_iterator itr = m_playerSocialMap.find(friend_guid);
+ PlayerSocialMap::const_iterator itr = m_playerSocialMap.find(friendGuid);
if (itr != m_playerSocialMap.end())
{
- CharacterDatabase.PExecute("UPDATE character_social SET flags = (flags | %u) WHERE guid = '%u' AND friend = '%u'", flag, GetPlayerGUID(), friend_guid);
- m_playerSocialMap[friend_guid].Flags |= flag;
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_CHARACTER_SOCIAL_FLAGS);
+
+ stmt->setUInt8(0, uint8(flag));
+ stmt->setUInt32(1, GetPlayerGUID());
+ stmt->setUInt32(2, friendGuid);
+
+ CharacterDatabase.Execute(stmt);
+
+ m_playerSocialMap[friendGuid].Flags |= flag;
}
else
{
- CharacterDatabase.PExecute("INSERT INTO character_social (guid, friend, flags) VALUES ('%u', '%u', '%u')", GetPlayerGUID(), friend_guid, flag);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_SOCIAL);
+
+ stmt->setUInt32(0, GetPlayerGUID());
+ stmt->setUInt32(1, friendGuid);
+ stmt->setUInt8(2, uint8(flag));
+
+ CharacterDatabase.Execute(stmt);
+
FriendInfo fi;
fi.Flags |= flag;
- m_playerSocialMap[friend_guid] = fi;
+ m_playerSocialMap[friendGuid] = fi;
}
return true;
}
-void PlayerSocial::RemoveFromSocialList(uint32 friend_guid, bool ignore)
+void PlayerSocial::RemoveFromSocialList(uint32 friendGuid, bool ignore)
{
- PlayerSocialMap::iterator itr = m_playerSocialMap.find(friend_guid);
+ PlayerSocialMap::iterator itr = m_playerSocialMap.find(friendGuid);
if (itr == m_playerSocialMap.end()) // not exist
return;
@@ -94,24 +108,44 @@ void PlayerSocial::RemoveFromSocialList(uint32 friend_guid, bool ignore)
itr->second.Flags &= ~flag;
if (itr->second.Flags == 0)
{
- CharacterDatabase.PExecute("DELETE FROM character_social WHERE guid = '%u' AND friend = '%u'", GetPlayerGUID(), friend_guid);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_SOCIAL);
+
+ stmt->setUInt32(0, GetPlayerGUID());
+ stmt->setUInt32(1, friendGuid);
+
+ CharacterDatabase.Execute(stmt);
+
m_playerSocialMap.erase(itr);
}
else
- CharacterDatabase.PExecute("UPDATE character_social SET flags = (flags & ~%u) WHERE guid = '%u' AND friend = '%u'", flag, GetPlayerGUID(), friend_guid);
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_REM_CHARACTER_SOCIAL_FLAGS);
+
+ stmt->setUInt8(0, uint8(flag));
+ stmt->setUInt32(1, GetPlayerGUID());
+ stmt->setUInt32(2, friendGuid);
+
+ CharacterDatabase.Execute(stmt);
+ }
}
-void PlayerSocial::SetFriendNote(uint32 friend_guid, std::string note)
+void PlayerSocial::SetFriendNote(uint32 friendGuid, std::string note)
{
- PlayerSocialMap::const_iterator itr = m_playerSocialMap.find(friend_guid);
+ PlayerSocialMap::const_iterator itr = m_playerSocialMap.find(friendGuid);
if (itr == m_playerSocialMap.end()) // not exist
return;
utf8truncate(note, 48); // DB and client size limitation
- CharacterDatabase.EscapeString(note);
- CharacterDatabase.PExecute("UPDATE character_social SET note = '%s' WHERE guid = '%u' AND friend = '%u'", note.c_str(), GetPlayerGUID(), friend_guid);
- m_playerSocialMap[friend_guid].Note = note;
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_SOCIAL_NOTE);
+
+ stmt->setString(0, note);
+ stmt->setUInt32(1, GetPlayerGUID());
+ stmt->setUInt32(2, friendGuid);
+
+ CharacterDatabase.Execute(stmt);
+
+ m_playerSocialMap[friendGuid].Note = note;
}
void PlayerSocial::SendSocialList(Player* player)
diff --git a/src/server/game/Entities/Player/SocialMgr.h b/src/server/game/Entities/Player/SocialMgr.h
index 78965c13948..540b425588e 100755
--- a/src/server/game/Entities/Player/SocialMgr.h
+++ b/src/server/game/Entities/Player/SocialMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -122,7 +122,7 @@ class PlayerSocial
// adding/removing
bool AddToSocialList(uint32 friend_guid, bool ignore);
void RemoveFromSocialList(uint32 friend_guid, bool ignore);
- void SetFriendNote(uint32 friend_guid, std::string note);
+ void SetFriendNote(uint32 friendGuid, std::string note);
// Packet send's
void SendSocialList(Player* player);
// Misc
diff --git a/src/server/game/Entities/Totem/Totem.cpp b/src/server/game/Entities/Totem/Totem.cpp
index fc368b1f109..80c5de35e59 100755
--- a/src/server/game/Entities/Totem/Totem.cpp
+++ b/src/server/game/Entities/Totem/Totem.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 93fc2145901..8b00da34d73 100755
--- a/src/server/game/Entities/Totem/Totem.h
+++ b/src/server/game/Entities/Totem/Totem.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp
index d533f6fe5b9..67d1636c7e2 100755
--- a/src/server/game/Entities/Transport/Transport.cpp
+++ b/src/server/game/Entities/Transport/Transport.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Transport/Transport.h b/src/server/game/Entities/Transport/Transport.h
index 8fcecffe239..518dcf6359d 100755
--- a/src/server/game/Entities/Transport/Transport.h
+++ b/src/server/game/Entities/Transport/Transport.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
index 3ab2f786086..c0bd5cb95a6 100755
--- a/src/server/game/Entities/Unit/StatSystem.cpp
+++ b/src/server/game/Entities/Unit/StatSystem.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index fec9a13192c..5b18713740f 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -45,16 +45,16 @@
#include "InstanceSaveMgr.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
-#include "Path.h"
#include "CreatureGroups.h"
#include "PetAI.h"
#include "PassiveAI.h"
-#include "Traveller.h"
#include "TemporarySummon.h"
#include "Vehicle.h"
#include "Transport.h"
#include "InstanceScript.h"
#include "SpellInfo.h"
+#include "MoveSplineInit.h"
+#include "MoveSpline.h"
#include <math.h>
@@ -62,9 +62,9 @@ float baseMoveSpeed[MAX_MOVE_TYPE] =
{
2.5f, // MOVE_WALK
7.0f, // MOVE_RUN
- 2.5f, // MOVE_RUN_BACK
+ 4.5f, // MOVE_RUN_BACK
4.722222f, // MOVE_SWIM
- 4.5f, // MOVE_SWIM_BACK
+ 2.5f, // MOVE_SWIM_BACK
3.141594f, // MOVE_TURN_RATE
7.0f, // MOVE_FLIGHT
4.5f, // MOVE_FLIGHT_BACK
@@ -73,9 +73,9 @@ float baseMoveSpeed[MAX_MOVE_TYPE] =
float playerBaseMoveSpeed[MAX_MOVE_TYPE] = {
2.5f, // MOVE_WALK
7.0f, // MOVE_RUN
- 2.5f, // MOVE_RUN_BACK
+ 4.5f, // MOVE_RUN_BACK
4.722222f, // MOVE_SWIM
- 4.5f, // MOVE_SWIM_BACK
+ 2.5f, // MOVE_SWIM_BACK
3.141594f, // MOVE_TURN_RATE
7.0f, // MOVE_FLIGHT
4.5f, // MOVE_FLIGHT_BACK
@@ -148,7 +148,7 @@ Unit::Unit(bool isWorldObject): WorldObject(isWorldObject),
m_movedPlayer(NULL), m_lastSanctuaryTime(0), IsAIEnabled(false), NeedChangeAI(false),
m_ControlledByPlayer(false), i_AI(NULL), i_disabledAI(NULL), m_procDeep(0),
m_removedAurasCount(0), i_motionMaster(this), m_ThreatManager(this), m_vehicle(NULL),
-m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE), m_HostileRefManager(this)
+m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE), m_HostileRefManager(this), movespline(new Movement::MoveSpline())
{
#ifdef _MSC_VER
#pragma warning(default:4355)
@@ -280,6 +280,7 @@ Unit::~Unit()
delete m_charmInfo;
delete m_vehicleKit;
+ delete movespline;
ASSERT(!m_duringRemoveFromWorld);
ASSERT(!m_attacking);
@@ -315,7 +316,7 @@ void Unit::Update(uint32 p_time)
// update combat timer only for players and pets (only pets with PetAI)
if (isInCombat() && (GetTypeId() == TYPEID_PLAYER || (ToCreature()->isPet() && IsControlledByPlayer())))
{
- // Check UNIT_STAT_MELEE_ATTACKING or UNIT_STAT_CHASE (without UNIT_STAT_FOLLOW in this case) so pets can reach far away
+ // Check UNIT_STATE_MELEE_ATTACKING or UNIT_STATE_CHASE (without UNIT_STATE_FOLLOW in this case) so pets can reach far away
// targets without stopping half way there and running off.
// These flags are reset after target dies or another command is given.
if (m_HostileRefManager.isEmpty())
@@ -346,6 +347,7 @@ void Unit::Update(uint32 p_time)
ModifyAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, HealthAbovePct(75));
}
+ UpdateSplineMovement(p_time);
i_motionMaster.UpdateMotion(p_time);
}
@@ -357,151 +359,46 @@ bool Unit::haveOffhandWeapon() const
return m_canDualWield;
}
-void Unit::SendMonsterMoveWithSpeedToCurrentDestination(Player* player)
+void Unit::MonsterMoveWithSpeed(float x, float y, float z, float speed)
{
- float x, y, z;
- if (GetMotionMaster()->GetDestination(x, y, z))
- SendMonsterMoveWithSpeed(x, y, z, 0, player);
-}
-
-void Unit::SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime, Player* player)
-{
- if (!transitTime)
- {
- if (GetTypeId() == TYPEID_PLAYER)
- {
- Traveller<Player> traveller(*(Player*)this);
- transitTime = traveller.GetTotalTrevelTimeTo(x, y, z);
- }
- else
- {
- Traveller<Creature> traveller(*ToCreature());
- transitTime = traveller.GetTotalTrevelTimeTo(x, y, z);
- }
- }
- //float orientation = (float)atan2((double)dy, (double)dx);
- SendMonsterMove(x, y, z, transitTime, player);
+ Movement::MoveSplineInit init(*this);
+ init.MoveTo(x,y,z);
+ init.SetVelocity(speed);
+ init.Launch();
}
-void Unit::SetFacing(float ori, WorldObject* obj)
+void Unit::UpdateSplineMovement(uint32 t_diff)
{
- SetOrientation(obj ? GetAngle(obj) : ori);
-
- WorldPacket data(SMSG_MONSTER_MOVE, (1+12+4+1+(obj ? 8 : 4)+4+4+4+12+GetPackGUID().size()));
- data.append(GetPackGUID());
- data << uint8(0); // unk
- data << GetPositionX() << GetPositionY() << GetPositionZ();
- data << getMSTime();
- if (obj)
- {
- data << uint8(SPLINETYPE_FACING_TARGET);
- data << uint64(obj->GetGUID());
- }
- else
- {
- data << uint8(SPLINETYPE_FACING_ANGLE);
- data << ori;
- }
- data << uint32(SPLINEFLAG_NONE);
- data << uint32(0); // move time 0
- data << uint32(1); // one point
- data << GetPositionX() << GetPositionY() << GetPositionZ();
- SendMessageToSet(&data, true);
-}
-
-void Unit::SendMonsterStop(bool on_death)
-{
- WorldPacket data(SMSG_MONSTER_MOVE, (17 + GetPackGUID().size()));
- data.append(GetPackGUID());
- data << uint8(0); // new in 3.1
- data << GetPositionX() << GetPositionY() << GetPositionZ();
- data << getMSTime();
-
- if (on_death == true)
- {
- data << uint8(0);
- data << uint32((GetUnitMovementFlags() & MOVEMENTFLAG_LEVITATING) ? SPLINEFLAG_FLYING : SPLINEFLAG_WALKING);
- data << uint32(0); // Time in between points
- data << uint32(1); // 1 single waypoint
- data << GetPositionX() << GetPositionY() << GetPositionZ();
- }
- else
- data << uint8(1);
-
- SendMessageToSet(&data, true);
-
- ClearUnitState(UNIT_STAT_MOVE);
-}
-
-void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 Time, Player* player)
-{
- WorldPacket data(SMSG_MONSTER_MOVE, 1+12+4+1+4+4+4+12+GetPackGUID().size());
- data.append(GetPackGUID());
-
- data << uint8(0); // new in 3.1
- data << GetPositionX() << GetPositionY() << GetPositionZ();
- data << getMSTime();
-
- data << uint8(0);
- data << uint32((GetUnitMovementFlags() & MOVEMENTFLAG_LEVITATING) ? SPLINEFLAG_FLYING : SPLINEFLAG_WALKING);
- data << Time; // Time in between points
- data << uint32(1); // 1 single waypoint
- data << NewPosX << NewPosY << NewPosZ; // the single waypoint Point B
-
- if (player)
- player->GetSession()->SendPacket(&data);
- else
- SendMessageToSet(&data, true);
-
- AddUnitState(UNIT_STAT_MOVE);
-}
+ enum{
+ POSITION_UPDATE_DELAY = 400,
+ };
-void Unit::SendMonsterMove(MonsterMoveData const& moveData, Player* player)
-{
- WorldPacket data(SMSG_MONSTER_MOVE, GetPackGUID().size() + 1 + 12 + 4 + 1 + 4 + 8 + 4 + 4 + 12);
- data.append(GetPackGUID());
+ if (movespline->Finalized())
+ return;
- data << uint8(0); // new in 3.1
- data << GetPositionX() << GetPositionY() << GetPositionZ();
- data << getMSTime();
+ movespline->updateState(t_diff);
+ bool arrived = movespline->Finalized();
- data << uint8(0);
- data << moveData.SplineFlag;
+ if (arrived)
+ DisableSpline();
- if (moveData.SplineFlag & SPLINEFLAG_ANIMATIONTIER)
+ m_movesplineTimer.Update(t_diff);
+ if (m_movesplineTimer.Passed() || arrived)
{
- data << uint8(moveData.AnimationState);
- data << uint32(0);
- }
-
- data << moveData.Time;
+ m_movesplineTimer.Reset(POSITION_UPDATE_DELAY);
+ Movement::Location loc = movespline->ComputePosition();
- if (moveData.SplineFlag & SPLINEFLAG_TRAJECTORY)
- {
- data << moveData.SpeedZ;
- data << uint32(0); // walk time after jump
+ if (GetTypeId() == TYPEID_PLAYER)
+ ((Player*)this)->UpdatePosition(loc.x,loc.y,loc.z,loc.orientation);
+ else
+ GetMap()->CreatureRelocation((Creature*)this,loc.x,loc.y,loc.z,loc.orientation);
}
-
- data << uint32(1); // waypoint count
- data << moveData.DestLocation.GetPositionX();
- data << moveData.DestLocation.GetPositionY();
- data << moveData.DestLocation.GetPositionZ();
-
- if (player)
- player->GetSession()->SendPacket(&data);
- else
- SendMessageToSet(&data, true);
}
-void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 MoveFlags, uint32 time, float speedZ, Player* player)
+void Unit::DisableSpline()
{
- MonsterMoveData data;
- data.DestLocation.Relocate(NewPosX, NewPosY, NewPosZ);
- data.SplineFlag = MoveFlags;
- data.Time = time;
- data.SpeedZ = speedZ;
-
- SendMonsterMove(data, player);
+ m_movementInfo.RemoveMovementFlag(MovementFlags(MOVEMENTFLAG_SPLINE_ENABLED|MOVEMENTFLAG_FORWARD));
+ movespline->_Interrupt();
}
void Unit::SendMonsterMoveExitVehicle(Position const* newPos)
@@ -619,9 +516,32 @@ bool Unit::HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint
return false;
}
+bool Unit::HasBreakableByDamageAuraType(AuraType type, uint32 excludeAura) const
+{
+ AuraEffectList const& auras = GetAuraEffectsByType(type);
+ for (AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
+ if ((!excludeAura || excludeAura != (*itr)->GetSpellInfo()->Id) && //Avoid self interrupt of channeled Crowd Control spells like Seduction
+ ((*itr)->GetSpellInfo()->Attributes & SPELL_ATTR0_BREAKABLE_BY_DAMAGE || (*itr)->GetSpellInfo()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_TAKE_DAMAGE))
+ return true;
+ return false;
+}
+
+bool Unit::HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel) const
+{
+ uint32 excludeAura = 0;
+ if (Spell* currentChanneledSpell = excludeCasterChannel ? excludeCasterChannel->GetCurrentSpell(CURRENT_CHANNELED_SPELL) : NULL)
+ excludeAura = currentChanneledSpell->GetSpellInfo()->Id; //Avoid self interrupt of channeled Crowd Control spells like Seduction
+
+ return ( HasBreakableByDamageAuraType(SPELL_AURA_MOD_CONFUSE, excludeAura)
+ || HasBreakableByDamageAuraType(SPELL_AURA_MOD_FEAR, excludeAura)
+ || HasBreakableByDamageAuraType(SPELL_AURA_MOD_STUN, excludeAura)
+ || HasBreakableByDamageAuraType(SPELL_AURA_MOD_ROOT, excludeAura)
+ || HasBreakableByDamageAuraType(SPELL_AURA_TRANSFORM, excludeAura));
+}
+
void Unit::DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb)
{
- if (!victim || !victim->isAlive() || victim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
+ if (!victim || !victim->isAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
{
if (absorb)
*absorb += damage;
@@ -731,6 +651,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
// duel ends when player has 1 or less hp
bool duel_hasEnded = false;
+ bool duel_wasMounted = false;
if (victim->GetTypeId() == TYPEID_PLAYER && victim->ToPlayer()->duel && damage >= (health-1))
{
// prevent kill only if killed in duel and killed by opponent or opponent controlled creature
@@ -739,6 +660,20 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
duel_hasEnded = true;
}
+ else if (victim->IsVehicle() && damage >= (health-1) && victim->GetCharmer() && victim->GetCharmer()->GetTypeId() == TYPEID_PLAYER)
+ {
+ Player* victimRider = victim->GetCharmer()->ToPlayer();
+
+ if (victimRider && victimRider->duel && victimRider->duel->isMounted)
+ {
+ // prevent kill only if killed in duel and killed by opponent or opponent controlled creature
+ if (victimRider->duel->opponent == this || victimRider->duel->opponent->GetGUID() == GetCharmerGUID())
+ damage = health - 1;
+
+ duel_wasMounted = true;
+ duel_hasEnded = true;
+ }
+ }
if (GetTypeId() == TYPEID_PLAYER && this != victim)
{
@@ -848,12 +783,25 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
// last damage from duel opponent
if (duel_hasEnded)
{
- ASSERT(victim->GetTypeId() == TYPEID_PLAYER);
- Player* he = victim->ToPlayer();
+ Player* he;
+
+ if (duel_wasMounted)
+ {
+ ASSERT(victim->GetCharmer()->GetTypeId() == TYPEID_PLAYER);
+ he = victim->GetCharmer()->ToPlayer();
+ }
+ else
+ {
+ ASSERT(victim->GetTypeId() == TYPEID_PLAYER);
+ he = victim->ToPlayer();
+ }
ASSERT(he->duel);
- he->SetHealth(1);
+ if (duel_wasMounted) // In this case victim==mount
+ victim->SetHealth(1);
+ else
+ he->SetHealth(1);
he->duel->opponent->CombatStopWithPets(true);
he->CombatStopWithPets(true);
@@ -1121,13 +1069,13 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss)
if (!victim)
return;
- if (!victim->isAlive() || victim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
+ if (!victim->isAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
return;
SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(damageInfo->SpellID);
if (spellProto == NULL)
{
- sLog->outDebug(LOG_FILTER_UNITS, "Unit::DealSpellDamage have wrong damageInfo->SpellID: %u", damageInfo->SpellID);
+ sLog->outDebug(LOG_FILTER_UNITS, "Unit::DealSpellDamage has wrong damageInfo->SpellID: %u", damageInfo->SpellID);
return;
}
@@ -1338,14 +1286,14 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
{
Unit* victim = damageInfo->target;
- if (!victim->isAlive() || victim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
+ if (!victim->isAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
return;
// Hmmmm dont like this emotes client must by self do all animations
if (damageInfo->HitInfo & HITINFO_CRITICALHIT)
- victim->HandleEmoteCommand(EMOTE_ONESHOT_WOUNDCRITICAL);
+ victim->HandleEmoteCommand(EMOTE_ONESHOT_WOUND_CRITICAL);
if (damageInfo->blocked_amount && damageInfo->TargetState != VICTIMSTATE_BLOCKS)
- victim->HandleEmoteCommand(EMOTE_ONESHOT_PARRYSHIELD);
+ victim->HandleEmoteCommand(EMOTE_ONESHOT_PARRY_SHIELD);
if (damageInfo->TargetState == VICTIMSTATE_PARRY)
{
@@ -1914,7 +1862,7 @@ void Unit::CalcHealAbsorb(Unit* victim, const SpellInfo* healSpell, uint32 &heal
void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool extra)
{
- if (HasUnitState(UNIT_STAT_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))
+ if (HasUnitState(UNIT_STATE_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))
return;
if (!victim->isAlive())
@@ -2217,12 +2165,12 @@ void Unit::SendMeleeAttackStart(Unit* victim)
void Unit::SendMeleeAttackStop(Unit* victim)
{
- WorldPacket data(SMSG_ATTACKSTOP, (8+8+4)); // we guess size
+ WorldPacket data(SMSG_ATTACKSTOP, (8+8+4));
data.append(GetPackGUID());
data.append(victim ? victim->GetPackGUID() : 0); // can be 0x00...
data << uint32(0); // can be 0x1
SendMessageToSet(&data, true);
- sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTART");
+ sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTOP");
if (victim)
sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUIDLow());
@@ -2397,7 +2345,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell)
case MELEE_HIT_BLOCK: canBlock = false; break;
case MELEE_HIT_PARRY: canParry = false; break;
default:
- sLog->outStaticDebug("Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT have unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue());
+ sLog->outStaticDebug("Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue());
break;
}
}
@@ -2487,7 +2435,7 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spell)
// Chance hit from victim SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE auras
modHitChance += victim->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE, schoolMask);
// Reduce spell hit chance for Area of effect spells from victim SPELL_AURA_MOD_AOE_AVOIDANCE aura
- if (spell->IsAOE())
+ if (spell->IsTargetingArea())
modHitChance -= victim->GetTotalAuraModifier(SPELL_AURA_MOD_AOE_AVOIDANCE);
// Decrease hit chance from victim rating bonus
@@ -2632,7 +2580,7 @@ uint32 Unit::GetDefenseSkillValue(Unit const* target) const
float Unit::GetUnitDodgeChance() const
{
- if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_CONTROLLED))
+ if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED))
return 0.0f;
if (GetTypeId() == TYPEID_PLAYER)
@@ -2652,7 +2600,7 @@ float Unit::GetUnitDodgeChance() const
float Unit::GetUnitParryChance() const
{
- if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_CONTROLLED))
+ if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED))
return 0.0f;
float chance = 0.0f;
@@ -2698,7 +2646,7 @@ float Unit::GetUnitMissChance(WeaponAttackType attType) const
float Unit::GetUnitBlockChance() const
{
- if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_CONTROLLED))
+ if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED))
return 0.0f;
if (Player const* player = ToPlayer())
@@ -2950,7 +2898,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell)
InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
m_AutoRepeatFirstCast = true;
}
- AddUnitState(UNIT_STAT_CASTING);
+ AddUnitState(UNIT_STATE_CASTING);
} break;
case CURRENT_CHANNELED_SPELL:
@@ -2963,7 +2911,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell)
if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL] &&
m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75)
InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
- AddUnitState(UNIT_STAT_CASTING);
+ AddUnitState(UNIT_STATE_CASTING);
} break;
case CURRENT_AUTOREPEAT_SPELL:
@@ -3106,17 +3054,6 @@ bool Unit::isInBackInMap(Unit const* target, float distance, float arc) const
return IsWithinDistInMap(target, distance) && !HasInArc(2 * M_PI - arc, target);
}
-void Unit::SetFacingToObject(WorldObject* pObject)
-{
- // update orientation at server
- SetOrientation(GetAngle(pObject));
-
- // and client
- WorldPacket data;
- BuildHeartBeatMsg(&data);
- SendMessageToSet(&data, false);
-}
-
bool Unit::isInAccessiblePlaceFor(Creature const* c) const
{
if (IsInWater())
@@ -3420,19 +3357,19 @@ void Unit::_RemoveNoStackAurasDueToAura(Aura* aura)
return;
bool remove = false;
- for (AuraMap::iterator i = m_ownedAuras.begin(); i != m_ownedAuras.end(); ++i)
+ for (AuraApplicationMap::iterator i = m_appliedAuras.begin(); i != m_appliedAuras.end(); ++i)
{
if (remove)
{
remove = false;
- i = m_ownedAuras.begin();
+ i = m_appliedAuras.begin();
}
- if (aura->CanStackWith(i->second))
+ if (aura->CanStackWith(i->second->GetBase()))
continue;
- RemoveOwnedAura(i, AURA_REMOVE_BY_DEFAULT);
- if (i == m_ownedAuras.end())
+ RemoveAura(i, AURA_REMOVE_BY_DEFAULT);
+ if (i == m_appliedAuras.end())
break;
remove = true;
}
@@ -3606,17 +3543,25 @@ void Unit::RemoveAuraFromStack(uint32 spellId, uint64 casterGUID, AuraRemoveMode
}
}
-void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit* dispeller, uint8 chargesRemoved/*= 1*/)
+void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, uint64 casterGUID, Unit* dispeller, uint8 chargesRemoved/*= 1*/)
{
for (AuraMap::iterator iter = m_ownedAuras.lower_bound(spellId); iter != m_ownedAuras.upper_bound(spellId);)
{
Aura* aura = iter->second;
if (aura->GetCasterGUID() == casterGUID)
{
+ DispelInfo dispelInfo(dispeller, dispellerSpellId, chargesRemoved);
+
+ // Call OnDispel hook on AuraScript
+ aura->CallScriptDispel(&dispelInfo);
+
if (aura->GetSpellInfo()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES)
- aura->ModCharges(-chargesRemoved, AURA_REMOVE_BY_ENEMY_SPELL);
+ aura->ModCharges(-dispelInfo.GetRemovedCharges(), AURA_REMOVE_BY_ENEMY_SPELL);
else
- aura->ModStackAmount(-chargesRemoved, AURA_REMOVE_BY_ENEMY_SPELL);
+ aura->ModStackAmount(-dispelInfo.GetRemovedCharges(), AURA_REMOVE_BY_ENEMY_SPELL);
+
+ // Call AfterDispel hook on AuraScript
+ aura->CallScriptAfterDispel(&dispelInfo);
switch (aura->GetSpellInfo()->SpellFamilyName)
{
@@ -3646,7 +3591,7 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit
{
// final heal
int32 healAmount = aurEff->GetAmount();
- int32 stack = chargesRemoved;
+ int32 stack = dispelInfo.GetRemovedCharges();
CastCustomSpell(this, 33778, &healAmount, &stack, NULL, true, NULL, NULL, aura->GetCasterGUID());
// mana
@@ -4643,7 +4588,7 @@ void Unit::AddGameObject(GameObject* gameObj)
SpellInfo const* createBySpell = sSpellMgr->GetSpellInfo(gameObj->GetSpellId());
// Need disable spell use for owner
if (createBySpell && createBySpell->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)
- // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existed cases)
+ // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existing cases)
ToPlayer()->AddSpellAndCategoryCooldowns(createBySpell, 0, NULL, true);
}
}
@@ -4673,7 +4618,7 @@ void Unit::RemoveGameObject(GameObject* gameObj, bool del)
SpellInfo const* createBySpell = sSpellMgr->GetSpellInfo(spellid);
// Need activate spell use for owner
if (createBySpell && createBySpell->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)
- // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existed cases)
+ // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existing cases)
ToPlayer()->SendCooldownEvent(createBySpell);
}
}
@@ -4948,8 +4893,8 @@ bool Unit::HandleHasteAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case 13877:
case 33735:
{
- target = SelectNearbyTarget();
- if (!target || target == victim)
+ target = SelectNearbyTarget(victim);
+ if (!target)
return false;
basepoints0 = damage;
triggered_spell_id = 22482;
@@ -4968,7 +4913,7 @@ bool Unit::HandleHasteAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
if (!triggerEntry)
{
- sLog->outError("Unit::HandleHasteAuraProc: Spell %u have not existed triggered spell %u", hasteSpell->Id, triggered_spell_id);
+ sLog->outError("Unit::HandleHasteAuraProc: Spell %u has non-existing triggered spell %u", hasteSpell->Id, triggered_spell_id);
return false;
}
@@ -5026,7 +4971,7 @@ bool Unit::HandleSpellCritChanceAuraProc(Unit* victim, uint32 /*damage*/, AuraEf
if (!triggerEntry)
{
- sLog->outError("Unit::HandleHasteAuraProc: Spell %u have not existed triggered spell %u", triggeredByAuraSpell->Id, triggered_spell_id);
+ sLog->outError("Unit::HandleHasteAuraProc: Spell %u has non-existing triggered spell %u", triggeredByAuraSpell->Id, triggered_spell_id);
return false;
}
@@ -5096,7 +5041,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case 18765:
case 35429:
{
- target = SelectNearbyTarget();
+ target = SelectNearbyTarget(victim);
if (!target)
return false;
@@ -5622,7 +5567,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case SPELLFAMILY_MAGE:
{
// Magic Absorption
- if (dummySpell->SpellIconID == 459) // only this spell have SpellIconID == 459 and dummy aura
+ if (dummySpell->SpellIconID == 459) // only this spell has SpellIconID == 459 and dummy aura
{
if (getPowerType() != POWER_MANA)
return false;
@@ -5816,7 +5761,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
// Sweeping Strikes
case 12328:
{
- target = SelectNearbyTarget();
+ target = SelectNearbyTarget(victim);
if (!target)
return false;
@@ -5892,12 +5837,12 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
if (!victim || !victim->isAlive() || !procSpell)
return false;
- target = SelectNearbyTarget();
- if (!target || target == victim)
+ target = SelectNearbyTarget(victim);
+ if (!target)
return false;
- CastSpell(target, 58567, true);
- return true;
+ triggered_spell_id = 58567;
+ break;
}
break;
}
@@ -7003,26 +6948,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
{
switch (dummySpell->Id)
{
- // Earthen Power (Rank 1, 2)
- case 51523:
- case 51524:
- {
- // Totem itself must be a caster of this spell
- Unit* caster = NULL;
- for (ControlList::iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr) {
- if ((*itr)->GetEntry() != 2630)
- continue;
-
- caster = *itr;
- break;
- }
-
- if (!caster)
- return false;
-
- caster->CastSpell(caster, 59566, true, castItem, triggeredByAura, originalCaster);
- return true;
- }
// Tidal Force
case 55198:
{
@@ -7069,7 +6994,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
triggered_spell_id = 28850;
break;
}
- // Windfury Weapon (Passive) 1-5 Ranks
+ // Windfury Weapon (Passive) 1-8 Ranks
case 33757:
{
Player* player = ToPlayer();
@@ -7084,8 +7009,10 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
return false;
WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot()));
- if ((attType != BASE_ATTACK && attType != OFF_ATTACK) || !isAttackReady(attType))
- return false;
+ if ((attType != BASE_ATTACK && attType != OFF_ATTACK)
+ || attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK
+ || attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK)
+ return false;
// Now compute real proc chance...
uint32 chance = 20;
@@ -7124,15 +7051,20 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
SpellInfo const* windfurySpellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!windfurySpellInfo)
{
- sLog->outError("Unit::HandleDummyAuraProc: non existed spell id: %u (Windfury)", spellId);
+ sLog->outError("Unit::HandleDummyAuraProc: non-existing spell id: %u (Windfury)", spellId);
return false;
}
int32 extra_attack_power = CalculateSpellDamage(victim, windfurySpellInfo, 1);
// Value gained from additional AP
- basepoints0 = int32(extra_attack_power / 14.0f * GetAttackTime(BASE_ATTACK) / 1000);
- triggered_spell_id = 25504;
+ basepoints0 = int32(extra_attack_power / 14.0f * GetAttackTime(attType) / 1000);
+
+ if (procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK)
+ triggered_spell_id = 25504;
+
+ if (procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK)
+ triggered_spell_id = 33750;
// apply cooldown before cast to prevent processing itself
if (cooldown)
@@ -7195,6 +7127,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
return false;
basepoints0 = CalculatePctN(int32(damage), triggerAmount);
triggered_spell_id = 58879;
+ // Cast on spirit wolf
+ CastCustomSpell(this, triggered_spell_id, &basepoints0, NULL, NULL, true, NULL, triggeredByAura);
break;
}
// Shaman T8 Elemental 4P Bonus
@@ -7370,6 +7304,13 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
if (GetTypeId() != TYPEID_PLAYER || !victim || !victim->isAlive() || !castItem || !castItem->IsEquipped())
return false;
+ Player* player = ToPlayer();
+ WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot()));
+ if ((attType != BASE_ATTACK && attType != OFF_ATTACK)
+ || attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK
+ || attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK)
+ return false;
+
float fire_onhit = float(CalculatePctF(dummySpell->Effects[EFFECT_0]. CalcValue(), 1.0f));
float add_spellpower = (float)(SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FIRE)
@@ -7379,7 +7320,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
ApplyPctF(add_spellpower, 3.84f);
// Enchant on Off-Hand and ready?
- if (castItem->GetSlot() == EQUIPMENT_SLOT_OFFHAND && isAttackReady(OFF_ATTACK))
+ if (castItem->GetSlot() == EQUIPMENT_SLOT_OFFHAND && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK)
{
float BaseWeaponSpeed = GetAttackTime(OFF_ATTACK) / 1000.0f;
@@ -7389,7 +7330,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
}
// Enchant on Main-Hand and ready?
- else if (castItem->GetSlot() == EQUIPMENT_SLOT_MAINHAND && isAttackReady(BASE_ATTACK))
+ else if (castItem->GetSlot() == EQUIPMENT_SLOT_MAINHAND && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK)
{
float BaseWeaponSpeed = GetAttackTime(BASE_ATTACK) / 1000.0f;
@@ -7431,7 +7372,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
return false;
}
// Lightning Overload
- if (dummySpell->SpellIconID == 2018) // only this spell have SpellFamily Shaman SpellIconID == 2018 and dummy aura
+ if (dummySpell->SpellIconID == 2018) // only this spell has SpellFamily Shaman SpellIconID == 2018 and dummy aura
{
if (!procSpell || GetTypeId() != TYPEID_PLAYER || !victim)
return false;
@@ -7483,7 +7424,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
if (!roll_chance_f(chance))
return false;
- // Remove cooldown (Chain Lightning - have Category Recovery time)
+ // Remove cooldown (Chain Lightning - has Category Recovery time)
ToPlayer()->RemoveSpellCooldown(spellId);
}
@@ -7794,7 +7735,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(triggered_spell_id);
if (!triggerEntry)
{
- sLog->outError("Unit::HandleDummyAuraProc: Spell %u have not existed triggered spell %u", dummySpell->Id, triggered_spell_id);
+ sLog->outError("Unit::HandleDummyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
return false;
}
@@ -7852,7 +7793,7 @@ bool Unit::HandleObsModEnergyAuraProc(Unit* victim, uint32 /*damage*/, AuraEffec
// Try handle unknown trigger spells
if (!triggerEntry)
{
- sLog->outError("Unit::HandleObsModEnergyAuraProc: Spell %u have not existed triggered spell %u", dummySpell->Id, triggered_spell_id);
+ sLog->outError("Unit::HandleObsModEnergyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
return false;
}
@@ -7905,7 +7846,7 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit* victim, uint32 /*damage*/, Aura
if (!triggerEntry)
{
- sLog->outError("Unit::HandleModDamagePctTakenAuraProc: Spell %u have not existed triggered spell %u", dummySpell->Id, triggered_spell_id);
+ sLog->outError("Unit::HandleModDamagePctTakenAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
return false;
}
@@ -8651,8 +8592,8 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(trigger_spell_id);
if (triggerEntry == NULL)
{
- // Not cast unknown spell
- // sLog->outError("Unit::HandleProcTriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex());
+ // Don't cast unknown spell
+ // sLog->outError("Unit::HandleProcTriggerSpell: Spell %u has 0 in EffectTriggered[%d]. Unhandled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex());
return false;
}
@@ -8739,7 +8680,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
if (!victim || !victim->isAlive())
return false;
- // Not give if target already have full health
+ // Doesn't proc if target already has full health
if (victim->IsFullHealth())
return false;
// If your Greater Heal brings the target to full health, you gain $37595s1 mana.
@@ -8944,18 +8885,17 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
// Maelstrom Weapon
case 53817:
{
- // Item - Shaman T10 Enhancement 4P Bonus
- if (AuraEffect const* aurEff = GetAuraEffect(70832, 0))
- if (Aura const* maelstrom = GetAura(53817))
- if ((maelstrom->GetStackAmount() == maelstrom->GetSpellInfo()->StackAmount) && roll_chance_i(aurEff->GetAmount()))
- CastSpell(this, 70831, true, castItem, triggeredByAura);
-
- // have rank dependent proc chance, ignore too often cases
+ // has rank dependant proc chance, ignore too often cases
// PPM = 2.5 * (rank of talent),
uint32 rank = auraSpellInfo->GetRank();
// 5 rank -> 100% 4 rank -> 80% and etc from full rate
if (!roll_chance_i(20*rank))
return false;
+ // Item - Shaman T10 Enhancement 4P Bonus
+ if (AuraEffect const* aurEff = GetAuraEffect(70832, 0))
+ if (Aura const* maelstrom = GetAura(53817))
+ if ((maelstrom->GetStackAmount() == maelstrom->GetSpellInfo()->StackAmount - 1) && roll_chance_i(aurEff->GetAmount()))
+ CastSpell(this, 70831, true, castItem, triggeredByAura);
break;
}
// Astral Shift
@@ -9304,7 +9244,7 @@ ReputationRank Unit::GetReactionTo(Unit const* target) const
&& selfPlayerOwner->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP))
return REP_HOSTILE;
- // if faction have reputation then hostile state dependent only from at_war state
+ // if faction has reputation, hostile state depends only from AtWar state
if (selfPlayerOwner->GetReputationMgr().IsAtWar(targetFactionEntry))
return REP_HOSTILE;
return REP_FRIENDLY;
@@ -9438,16 +9378,16 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
// switch to melee attack from ranged/magic
if (meleeAttack)
{
- if (!HasUnitState(UNIT_STAT_MELEE_ATTACKING))
+ if (!HasUnitState(UNIT_STATE_MELEE_ATTACKING))
{
- AddUnitState(UNIT_STAT_MELEE_ATTACKING);
+ AddUnitState(UNIT_STATE_MELEE_ATTACKING);
SendMeleeAttackStart(victim);
return true;
}
}
- else if (HasUnitState(UNIT_STAT_MELEE_ATTACKING))
+ else if (HasUnitState(UNIT_STATE_MELEE_ATTACKING))
{
- ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
+ ClearUnitState(UNIT_STATE_MELEE_ATTACKING);
SendMeleeAttackStop(victim);
return true;
}
@@ -9457,7 +9397,7 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
// switch target
InterruptSpell(CURRENT_MELEE_SPELL);
if (!meleeAttack)
- ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
+ ClearUnitState(UNIT_STATE_MELEE_ATTACKING);
}
if (m_attacking)
@@ -9470,7 +9410,7 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
SetTarget(victim->GetGUID());
if (meleeAttack)
- AddUnitState(UNIT_STAT_MELEE_ATTACKING);
+ AddUnitState(UNIT_STATE_MELEE_ATTACKING);
// set position before any AI calls/assistance
//if (GetTypeId() == TYPEID_UNIT)
@@ -9511,7 +9451,7 @@ bool Unit::AttackStop()
// Clear our target
SetTarget(0);
- ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
+ ClearUnitState(UNIT_STATE_MELEE_ATTACKING);
InterruptSpell(CURRENT_MELEE_SPELL);
@@ -9554,7 +9494,7 @@ void Unit::CombatStopWithPets(bool includingCast)
bool Unit::isAttackingPlayer() const
{
- if (HasUnitState(UNIT_STAT_ATTACK_PLAYER))
+ if (HasUnitState(UNIT_STATE_ATTACK_PLAYER))
return true;
for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
@@ -10450,7 +10390,7 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32
{
if (victim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this))
{
- // effect 0 have expected value but in negative state
+ // effect 0 has expected value but in negative state
int32 bonus = -(*i)->GetBase()->GetEffect(0)->GetAmount();
AddPctN(DoneTotalMod, bonus);
}
@@ -11481,7 +11421,8 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo)
return true;
}
- if (spellInfo->Mechanic)
+ // Spells that don't have effectMechanics.
+ if (!spellInfo->HasAnyEffectMechanic() && spellInfo->Mechanic)
{
SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
@@ -11489,14 +11430,19 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo)
return true;
}
- for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ bool immuneToAllEffects = true;
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
// State/effect immunities applied by aura expect full spell immunity
// Ignore effects with mechanic, they are supposed to be checked separately
- if (!spellInfo->Effects[i].Mechanic)
- if (IsImmunedToSpellEffect(spellInfo, i))
- return true;
+ if (spellInfo->Effects[i].Mechanic || !IsImmunedToSpellEffect(spellInfo, i))
+ {
+ immuneToAllEffects = false;
+ break;
+ }
}
+ if (immuneToAllEffects) //Return immune only if the target is immune to all spell effects.
+ return true;
if (spellInfo->Id != 42292 && spellInfo->Id !=59752)
{
@@ -11708,7 +11654,7 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT
{
if (victim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this))
{
- // effect 0 have expected value but in negative state
+ // effect 0 has expected value but in negative state
int32 bonus = -(*i)->GetBase()->GetEffect(0)->GetAmount();
AddPctN(DoneTotalMod, bonus);
}
@@ -11984,7 +11930,7 @@ void Unit::Dismount()
{
if (Pet* pPet = player->GetPet())
{
- if (pPet->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && !pPet->HasUnitState(UNIT_STAT_STUNNED))
+ if (pPet->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && !pPet->HasUnitState(UNIT_STATE_STUNNED))
pPet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
}
else
@@ -12053,7 +11999,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
if (PvP)
m_CombatTimer = 5000;
- if (isInCombat() || HasUnitState(UNIT_STAT_EVADE))
+ if (isInCombat() || HasUnitState(UNIT_STATE_EVADE))
return;
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
@@ -12071,7 +12017,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
if (IsAIEnabled)
{
creature->AI()->EnterCombat(enemy);
- RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); // always remove Out of Combat Non Attackable flag if we enter combat and AI is enabled
+ RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // unit has engaged in combat, remove immunity so players can fight back
}
if (creature->GetFormation())
creature->GetFormation()->MemberAttackStart(creature, enemy);
@@ -12103,10 +12049,10 @@ void Unit::ClearInCombat()
// Player's state will be cleared in Player::UpdateContestedPvP
if (Creature* creature = ToCreature())
{
- if (creature->GetCreatureInfo() && creature->GetCreatureInfo()->unit_flags & UNIT_FLAG_OOC_NOT_ATTACKABLE)
- SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); // re-apply Out of Combat Non Attackable flag if we leave combat, can be overriden in scripts in EnterEvadeMode()
+ if (creature->GetCreatureInfo() && creature->GetCreatureInfo()->unit_flags & UNIT_FLAG_IMMUNE_TO_PC)
+ SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // set immunity state to the one from db on evade
- ClearUnitState(UNIT_STAT_ATTACK_PLAYER);
+ ClearUnitState(UNIT_STATE_ATTACK_PLAYER);
if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED))
SetUInt32Value(UNIT_DYNAMIC_FLAGS, creature->GetCreatureInfo()->dynamicflags);
@@ -12132,13 +12078,13 @@ bool Unit::isTargetableForAttack(bool checkFakeDeath) const
return false;
if (HasFlag(UNIT_FIELD_FLAGS,
- UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE))
+ UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC))
return false;
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->isGameMaster())
return false;
- return !HasUnitState(UNIT_STAT_UNATTACKABLE) && (!checkFakeDeath || !HasUnitState(UNIT_STAT_DIED));
+ return !HasUnitState(UNIT_STATE_UNATTACKABLE) && (!checkFakeDeath || !HasUnitState(UNIT_STATE_DIED));
}
bool Unit::IsValidAttackTarget(Unit const* target) const
@@ -12156,7 +12102,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co
return false;
// can't attack unattackable units or GMs
- if (target->HasUnitState(UNIT_STAT_UNATTACKABLE)
+ if (target->HasUnitState(UNIT_STATE_UNATTACKABLE)
|| (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->isGameMaster()))
return false;
@@ -12166,7 +12112,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co
return false;
// can't attack invisible (ignore stealth for aoe spells)
- if ((!bySpell || !(bySpell->AttributesEx6 & SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && !canSeeOrDetect(target, bySpell && bySpell->IsAOE()))
+ if ((!bySpell || !(bySpell->AttributesEx6 & SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && !canSeeOrDetect(target, bySpell && bySpell->IsAffectingArea()))
return false;
// can't attack dead
@@ -12185,10 +12131,11 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co
}
// check flags
if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_TAXI_FLIGHT | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_UNK_16)
- || (!HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE))
- || (!target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE))
- || (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
- || (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE)))
+ || (!HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC))
+ || (!target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC))
+ || (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))
+ // check if this is a world trigger cast - GOs are using world triggers to cast their spells, so we need to ignore their immunity flag here, this is a temp workaround, needs removal when go cast is implemented properly
+ || (GetEntry() != WORLD_TRIGGER && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)))
return false;
// CvC case - can attack each other only when one of them is hostile
@@ -12250,7 +12197,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co
return true;
// can't assist unattackable units or GMs
- if (target->HasUnitState(UNIT_STAT_UNATTACKABLE)
+ if (target->HasUnitState(UNIT_STATE_UNATTACKABLE)
|| (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->isGameMaster()))
return false;
@@ -12260,7 +12207,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co
return false;
// can't assist invisible
- if ((!bySpell || !(bySpell->AttributesEx6 & SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && !canSeeOrDetect(target, bySpell && bySpell->IsAOE()))
+ if ((!bySpell || !(bySpell->AttributesEx6 & SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && !canSeeOrDetect(target, bySpell && bySpell->IsAffectingArea()))
return false;
// can't assist dead
@@ -12276,12 +12223,12 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co
{
if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE))
{
- if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
+ if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))
return false;
}
else
{
- if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE))
+ if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC))
return false;
}
}
@@ -12745,11 +12692,15 @@ void Unit::setDeathState(DeathState s)
ClearDiminishings();
GetMotionMaster()->Clear(false);
GetMotionMaster()->MoveIdle();
- SendMonsterStop(true);
+ StopMoving();
// without this when removing IncreaseMaxHealth aura player may stuck with 1 hp
// do not why since in IncreaseMaxHealth currenthealth is checked
SetHealth(0);
SetPower(getPowerType(), 0);
+
+ // players in instance don't have ZoneScript, but they have InstanceScript
+ if (ZoneScript* zoneScript = GetZoneScript() ? GetZoneScript() : (ZoneScript*)GetInstanceScript())
+ zoneScript->OnUnitDeath(this);
}
else if (s == JUST_ALIVED)
RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground)
@@ -12973,7 +12924,7 @@ Unit* Creature::SelectVictim()
// last case when creature must not go to evade mode:
// it in combat but attacker not make any damage and not enter to aggro radius to have record in threat list
// for example at owner command to pet attack some far away creature
- // Note: creature not have targeted movement generator but have attacker in this case
+ // Note: creature does not have targeted movement generator but has attacker in this case
for (AttackerSet::const_iterator itr = m_attackers.begin(); itr != m_attackers.end(); ++itr)
{
if ((*itr) && !canCreatureAttack(*itr) && (*itr)->GetTypeId() != TYPEID_PLAYER
@@ -13359,7 +13310,7 @@ bool Unit::HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, f
{
if (unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END)
{
- sLog->outError("ERROR in HandleStatModifier(): non existed UnitMods or wrong UnitModifierType!");
+ sLog->outError("ERROR in HandleStatModifier(): non-existing UnitMods or wrong UnitModifierType!");
return false;
}
@@ -13424,7 +13375,7 @@ float Unit::GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) co
{
if (unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END)
{
- sLog->outError("trial to access non existed modifier value from UnitMods!");
+ sLog->outError("attempt to access non-existing modifier value from UnitMods!");
return 0.0f;
}
@@ -13454,7 +13405,7 @@ float Unit::GetTotalAuraModValue(UnitMods unitMod) const
{
if (unitMod >= UNIT_MOD_END)
{
- sLog->outError("trial to access non existed UnitMods in GetTotalAuraModValue()!");
+ sLog->outError("attempt to access non-existing UnitMods in GetTotalAuraModValue()!");
return 0.0f;
}
@@ -13562,7 +13513,7 @@ void Unit::SetHealth(uint32 val)
{
if (getDeathState() == JUST_DIED)
val = 0;
- else if (GetTypeId() == TYPEID_PLAYER && (getDeathState() == DEAD || getDeathState() == DEAD_FALLING))
+ else if (GetTypeId() == TYPEID_PLAYER && getDeathState() == DEAD)
val = 1;
else
{
@@ -13683,7 +13634,7 @@ void Unit::SetMaxPower(Powers power, uint32 val)
uint32 Unit::GetCreatePowers(Powers power) const
{
- // POWER_FOCUS and POWER_HAPPINESS only have hunter pet
+ // Only hunter pets have POWER_FOCUS and POWER_HAPPINESS
switch (power)
{
case POWER_MANA: return GetCreateMana();
@@ -14111,12 +14062,12 @@ bool InitTriggerAuraData()
isTriggerAura[SPELL_AURA_DUMMY] = true;
isTriggerAura[SPELL_AURA_MOD_CONFUSE] = true;
isTriggerAura[SPELL_AURA_MOD_THREAT] = true;
- isTriggerAura[SPELL_AURA_MOD_STUN] = true; // Aura not have charges but need remove him on trigger
+ isTriggerAura[SPELL_AURA_MOD_STUN] = true; // Aura does not have charges but needs to be removed on trigger
isTriggerAura[SPELL_AURA_MOD_DAMAGE_DONE] = true;
isTriggerAura[SPELL_AURA_MOD_DAMAGE_TAKEN] = true;
isTriggerAura[SPELL_AURA_MOD_RESISTANCE] = true;
isTriggerAura[SPELL_AURA_MOD_STEALTH] = true;
- isTriggerAura[SPELL_AURA_MOD_FEAR] = true; // Aura not have charges but need remove him on trigger
+ isTriggerAura[SPELL_AURA_MOD_FEAR] = true; // Aura does not have charges but needs to be removed on trigger
isTriggerAura[SPELL_AURA_MOD_ROOT] = true;
isTriggerAura[SPELL_AURA_TRANSFORM] = true;
isTriggerAura[SPELL_AURA_REFLECT_SPELLS] = true;
@@ -14677,17 +14628,15 @@ void Unit::SendPetAIReaction(uint64 guid)
void Unit::StopMoving()
{
- ClearUnitState(UNIT_STAT_MOVING);
+ ClearUnitState(UNIT_STATE_MOVING);
- // send explicit stop packet
- // rely on vmaps here because for example stormwind is in air
- //float z = sMapMgr->GetBaseMap(GetMapId())->GetHeight(GetPositionX(), GetPositionY(), GetPositionZ(), true);
- //if (fabs(GetPositionZ() - z) < 2.0f)
- // Relocate(GetPositionX(), GetPositionY(), z);
- //Relocate(GetPositionX(), GetPositionY(), GetPositionZ());
+ // not need send any packets if not in world
+ if (!IsInWorld())
+ return;
- if (!(GetUnitMovementFlags() & MOVEMENTFLAG_ONTRANSPORT))
- SendMonsterStop();
+ Movement::MoveSplineInit init(*this);
+ init.SetFacing(GetOrientation());
+ init.Launch();
}
void Unit::SendMovementFlagUpdate()
@@ -14854,7 +14803,7 @@ void Unit::UpdateReactives(uint32 p_time)
}
}
-Unit* Unit::SelectNearbyTarget(float dist) const
+Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const
{
std::list<Unit*> targets;
Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist);
@@ -14864,6 +14813,9 @@ Unit* Unit::SelectNearbyTarget(float dist) const
// remove current target
if (getVictim())
targets.remove(getVictim());
+
+ if (exclude)
+ targets.remove(exclude);
// remove not LoS targets
for (std::list<Unit*>::iterator tIter = targets.begin(); tIter != targets.end();)
@@ -14953,7 +14905,7 @@ uint32 Unit::GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectTyp
break;
}
- if (spellProto->Effects[i].IsArea())
+ if (spellProto->Effects[i].IsTargetingArea())
AreaEffect = true;
}
@@ -15061,16 +15013,16 @@ void Unit::SetContestedPvP(Player* attackedPlayer)
return;
player->SetContestedPvPTimer(30000);
- if (!player->HasUnitState(UNIT_STAT_ATTACK_PLAYER))
+ if (!player->HasUnitState(UNIT_STATE_ATTACK_PLAYER))
{
- player->AddUnitState(UNIT_STAT_ATTACK_PLAYER);
+ player->AddUnitState(UNIT_STATE_ATTACK_PLAYER);
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP);
// call MoveInLineOfSight for nearby contested guards
UpdateObjectVisibility();
}
- if (!HasUnitState(UNIT_STAT_ATTACK_PLAYER))
+ if (!HasUnitState(UNIT_STATE_ATTACK_PLAYER))
{
- AddUnitState(UNIT_STAT_ATTACK_PLAYER);
+ AddUnitState(UNIT_STATE_ATTACK_PLAYER);
// call MoveInLineOfSight for nearby contested guards
UpdateObjectVisibility();
}
@@ -15325,7 +15277,7 @@ bool Unit::HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura)
damageSpellId = 43594;
break;
default:
- sLog->outError("Unit::HandleAuraRaidProcFromCharge, received not handled spell: %u", spellProto->Id);
+ sLog->outError("Unit::HandleAuraRaidProcFromCharge, received unhandled spell: %u", spellProto->Id);
return false;
}
@@ -15638,28 +15590,28 @@ void Unit::SetControlled(bool apply, UnitState state)
AddUnitState(state);
switch (state)
{
- case UNIT_STAT_STUNNED:
+ case UNIT_STATE_STUNNED:
SetStunned(true);
CastStop();
break;
- case UNIT_STAT_ROOT:
- if (!HasUnitState(UNIT_STAT_STUNNED))
+ case UNIT_STATE_ROOT:
+ if (!HasUnitState(UNIT_STATE_STUNNED))
SetRooted(true);
break;
- case UNIT_STAT_CONFUSED:
- if (!HasUnitState(UNIT_STAT_STUNNED))
+ case UNIT_STATE_CONFUSED:
+ if (!HasUnitState(UNIT_STATE_STUNNED))
{
- ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
+ ClearUnitState(UNIT_STATE_MELEE_ATTACKING);
SendMeleeAttackStop();
// SendAutoRepeatCancel ?
SetConfused(true);
CastStop();
}
break;
- case UNIT_STAT_FLEEING:
- if (!HasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED))
+ case UNIT_STATE_FLEEING:
+ if (!HasUnitState(UNIT_STATE_STUNNED | UNIT_STATE_CONFUSED))
{
- ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
+ ClearUnitState(UNIT_STATE_MELEE_ATTACKING);
SendMeleeAttackStop();
// SendAutoRepeatCancel ?
SetFeared(true);
@@ -15674,29 +15626,29 @@ void Unit::SetControlled(bool apply, UnitState state)
{
switch (state)
{
- case UNIT_STAT_STUNNED: if (HasAuraType(SPELL_AURA_MOD_STUN)) return;
+ case UNIT_STATE_STUNNED: if (HasAuraType(SPELL_AURA_MOD_STUN)) return;
else SetStunned(false); break;
- case UNIT_STAT_ROOT: if (HasAuraType(SPELL_AURA_MOD_ROOT) || GetVehicle()) return;
+ case UNIT_STATE_ROOT: if (HasAuraType(SPELL_AURA_MOD_ROOT) || GetVehicle()) return;
else SetRooted(false); break;
- case UNIT_STAT_CONFUSED:if (HasAuraType(SPELL_AURA_MOD_CONFUSE)) return;
+ case UNIT_STATE_CONFUSED:if (HasAuraType(SPELL_AURA_MOD_CONFUSE)) return;
else SetConfused(false); break;
- case UNIT_STAT_FLEEING: if (HasAuraType(SPELL_AURA_MOD_FEAR)) return;
+ case UNIT_STATE_FLEEING: if (HasAuraType(SPELL_AURA_MOD_FEAR)) return;
else SetFeared(false); break;
default: return;
}
ClearUnitState(state);
- if (HasUnitState(UNIT_STAT_STUNNED))
+ if (HasUnitState(UNIT_STATE_STUNNED))
SetStunned(true);
else
{
- if (HasUnitState(UNIT_STAT_ROOT))
+ if (HasUnitState(UNIT_STATE_ROOT))
SetRooted(true);
- if (HasUnitState(UNIT_STAT_CONFUSED))
+ if (HasUnitState(UNIT_STATE_CONFUSED))
SetConfused(true);
- else if (HasUnitState(UNIT_STAT_FLEEING))
+ else if (HasUnitState(UNIT_STATE_FLEEING))
SetFeared(true);
}
}
@@ -15738,7 +15690,7 @@ void Unit::SetStunned(bool apply)
if (!owner || (owner->GetTypeId() == TYPEID_PLAYER && !owner->ToPlayer()->IsMounted()))
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
- if (!HasUnitState(UNIT_STAT_ROOT)) // prevent allow move if have also root effect
+ if (!HasUnitState(UNIT_STATE_ROOT)) // prevent moving if it also has root effect
{
WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 8+4);
data.append(GetPackGUID());
@@ -15780,7 +15732,7 @@ void Unit::SetRooted(bool apply)
}
else
{
- if (!HasUnitState(UNIT_STAT_STUNNED)) // prevent allow move if have also stun effect
+ if (!HasUnitState(UNIT_STATE_STUNNED)) // prevent moving if it also has stun effect
{
if (GetTypeId() == TYPEID_PLAYER)
{
@@ -15872,7 +15824,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
return false;
}
- //if (HasUnitState(UNIT_STAT_UNATTACKABLE))
+ //if (HasUnitState(UNIT_STATE_UNATTACKABLE))
// return false;
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetTransport())
@@ -15960,14 +15912,16 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
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();
break;
case CHARM_TYPE_POSSESS:
- AddUnitState(UNIT_STAT_POSSESSED);
+ 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();
break;
@@ -16014,7 +15968,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
}
CharmType type;
- if (HasUnitState(UNIT_STAT_POSSESSED))
+ if (HasUnitState(UNIT_STATE_POSSESSED))
type = CHARM_TYPE_POSSESS;
else if (charmer && charmer->IsOnVehicle(this))
type = CHARM_TYPE_VEHICLE;
@@ -16032,7 +15986,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
if (type == CHARM_TYPE_POSSESS)
{
- ClearUnitState(UNIT_STAT_POSSESSED);
+ ClearUnitState(UNIT_STATE_POSSESSED);
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
}
@@ -16258,7 +16212,7 @@ void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius)
if (owner->isAlive() && (owner == this || IsWithinDistInMap(owner, radius)))
nearMembers.push_back(owner);
if (Guardian* pet = owner->GetGuardianPet())
- if (pet->isAlive() && (pet == this && IsWithinDistInMap(pet, radius)))
+ if (pet->isAlive() && (pet == this || IsWithinDistInMap(pet, radius)))
nearMembers.push_back(pet);
}
}
@@ -16295,7 +16249,7 @@ void Unit::GetPartyMemberInDist(std::list<Unit*> &TagUnitMap, float radius)
if (owner->isAlive() && (owner == this || IsWithinDistInMap(owner, radius)))
TagUnitMap.push_back(owner);
if (Guardian* pet = owner->GetGuardianPet())
- if (pet->isAlive() && (pet == this && IsWithinDistInMap(pet, radius)))
+ if (pet->isAlive() && (pet == this || IsWithinDistInMap(pet, radius)))
TagUnitMap.push_back(pet);
}
}
@@ -17063,11 +17017,15 @@ void Unit::_ExitVehicle(Position const* exitPosition)
m_vehicle->RemovePassenger(this);
+ // If player is on mouted duel and exits the mount should immediatly lose the duel
+ if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->duel && ToPlayer()->duel->isMounted)
+ ToPlayer()->DuelComplete(DUEL_FLED);
+
// This should be done before dismiss, because there may be some aura removal
Vehicle* vehicle = m_vehicle;
m_vehicle = NULL;
- SetControlled(false, UNIT_STAT_ROOT); // SMSG_MOVE_FORCE_UNROOT, ~MOVEMENTFLAG_ROOT
+ SetControlled(false, UNIT_STATE_ROOT); // SMSG_MOVE_FORCE_UNROOT, ~MOVEMENTFLAG_ROOT
Position pos;
if (!exitPosition) // Exit position not specified
@@ -17075,7 +17033,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
else
pos = *exitPosition;
- AddUnitState(UNIT_STAT_MOVE);
+ AddUnitState(UNIT_STATE_MOVE);
if (GetTypeId() == TYPEID_PLAYER)
ToPlayer()->SetFallInformation(0, GetPositionZ());
@@ -17092,9 +17050,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
if (Player* player = ToPlayer())
player->ResummonPetTemporaryUnSummonedIfAny();
- WorldPacket data2;
- BuildHeartBeatMsg(&data2);
- SendMessageToSet(&data2, false);
+ SendMovementFlagUpdate();
if (vehicle->GetBase()->HasUnitTypeMask(UNIT_MASK_MINION))
if (((Minion*)vehicle->GetBase())->GetOwner() == this)
@@ -17113,25 +17069,6 @@ void Unit::_ExitVehicle(Position const* exitPosition)
void Unit::BuildMovementPacket(ByteBuffer *data) const
{
- switch (GetTypeId())
- {
- case TYPEID_UNIT:
- if (canFly())
- const_cast<Unit*>(this)->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- break;
- case TYPEID_PLAYER:
- // remove unknown, unused etc flags for now
- const_cast<Unit*>(this)->RemoveUnitMovementFlag(MOVEMENTFLAG_SPLINE_ENABLED);
- if (isInFlight())
- {
- WPAssert(const_cast<Unit*>(this)->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE);
- const_cast<Unit*>(this)->AddUnitMovementFlag(MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_SPLINE_ENABLED);
- }
- break;
- default:
- break;
- }
-
*data << uint32(GetUnitMovementFlags()); // movement flags
*data << uint16(m_movementInfo.flags2); // 2.3.0
*data << uint32(getMSTime()); // time
@@ -17195,13 +17132,13 @@ void Unit::SetFlying(bool apply)
void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool casting /*= false*/)
{
+ DisableSpline();
if (GetTypeId() == TYPEID_PLAYER)
ToPlayer()->TeleportTo(GetMapId(), x, y, z, orientation, TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (casting ? TELE_TO_SPELL : 0));
else
{
- // FIXME: this interrupts spell visual
- DestroyForNearbyPlayers();
UpdatePosition(x, y, z, orientation, true);
+ SendMovementFlagUpdate();
}
}
@@ -17483,3 +17420,26 @@ bool CharmInfo::IsReturning()
{
return m_isReturning;
}
+
+void Unit::SetInFront(Unit const* target)
+{
+ if (!HasUnitState(UNIT_STATE_CANNOT_TURN))
+ SetOrientation(GetAngle(target));
+}
+
+void Unit::SetFacingTo(float ori)
+{
+ Movement::MoveSplineInit init(*this);
+ init.SetFacing(ori);
+ init.Launch();
+}
+
+void Unit::SetFacingToObject(WorldObject* pObject)
+{
+ // never face when already moving
+ if (!IsStopped())
+ return;
+
+ // TODO: figure out under what conditions creature will move towards object instead of facing it where it currently is.
+ SetFacingTo(GetAngle(pObject));
+}
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index b18223ae3ce..423f83844d3 100755
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -465,42 +465,50 @@ enum DeathState
CORPSE = 2,
DEAD = 3,
JUST_ALIVED = 4,
- DEAD_FALLING= 5
};
enum UnitState
{
- UNIT_STAT_DIED = 0x00000001, // player has fake death aura
- UNIT_STAT_MELEE_ATTACKING = 0x00000002, // player is melee attacking someone
- //UNIT_STAT_MELEE_ATTACK_BY = 0x00000004, // player is melee attack by someone
- UNIT_STAT_STUNNED = 0x00000008,
- UNIT_STAT_ROAMING = 0x00000010,
- UNIT_STAT_CHASE = 0x00000020,
- //UNIT_STAT_SEARCHING = 0x00000040,
- UNIT_STAT_FLEEING = 0x00000080,
- UNIT_STAT_IN_FLIGHT = 0x00000100, // player is in flight mode
- UNIT_STAT_FOLLOW = 0x00000200,
- UNIT_STAT_ROOT = 0x00000400,
- UNIT_STAT_CONFUSED = 0x00000800,
- UNIT_STAT_DISTRACTED = 0x00001000,
- UNIT_STAT_ISOLATED = 0x00002000, // area auras do not affect other players
- UNIT_STAT_ATTACK_PLAYER = 0x00004000,
- UNIT_STAT_CASTING = 0x00008000,
- UNIT_STAT_POSSESSED = 0x00010000,
- UNIT_STAT_CHARGING = 0x00020000,
- UNIT_STAT_JUMPING = 0x00040000,
- UNIT_STAT_ONVEHICLE = 0x00080000,
- UNIT_STAT_MOVE = 0x00100000,
- UNIT_STAT_ROTATING = 0x00200000,
- UNIT_STAT_EVADE = 0x00400000,
- UNIT_STAT_UNATTACKABLE = (UNIT_STAT_IN_FLIGHT | UNIT_STAT_ONVEHICLE),
- UNIT_STAT_MOVING = (UNIT_STAT_ROAMING | UNIT_STAT_CHASE),
- UNIT_STAT_CONTROLLED = (UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING),
- UNIT_STAT_LOST_CONTROL = (UNIT_STAT_CONTROLLED | UNIT_STAT_JUMPING | UNIT_STAT_CHARGING),
- UNIT_STAT_SIGHTLESS = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_EVADE),
- UNIT_STAT_CANNOT_AUTOATTACK = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_CASTING),
- UNIT_STAT_CANNOT_TURN = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_ROTATING),
- UNIT_STAT_ALL_STATE = 0xffffffff //(UNIT_STAT_STOPPED | UNIT_STAT_MOVING | UNIT_STAT_IN_COMBAT | UNIT_STAT_IN_FLIGHT)
+ UNIT_STATE_DIED = 0x00000001, // player has fake death aura
+ UNIT_STATE_MELEE_ATTACKING = 0x00000002, // player is melee attacking someone
+ //UNIT_STATE_MELEE_ATTACK_BY = 0x00000004, // player is melee attack by someone
+ UNIT_STATE_STUNNED = 0x00000008,
+ UNIT_STATE_ROAMING = 0x00000010,
+ UNIT_STATE_CHASE = 0x00000020,
+ //UNIT_STATE_SEARCHING = 0x00000040,
+ UNIT_STATE_FLEEING = 0x00000080,
+ UNIT_STATE_IN_FLIGHT = 0x00000100, // player is in flight mode
+ UNIT_STATE_FOLLOW = 0x00000200,
+ UNIT_STATE_ROOT = 0x00000400,
+ UNIT_STATE_CONFUSED = 0x00000800,
+ UNIT_STATE_DISTRACTED = 0x00001000,
+ UNIT_STATE_ISOLATED = 0x00002000, // area auras do not affect other players
+ UNIT_STATE_ATTACK_PLAYER = 0x00004000,
+ UNIT_STATE_CASTING = 0x00008000,
+ UNIT_STATE_POSSESSED = 0x00010000,
+ UNIT_STATE_CHARGING = 0x00020000,
+ UNIT_STATE_JUMPING = 0x00040000,
+ UNIT_STATE_ONVEHICLE = 0x00080000,
+ UNIT_STATE_MOVE = 0x00100000,
+ UNIT_STATE_ROTATING = 0x00200000,
+ UNIT_STATE_EVADE = 0x00400000,
+ UNIT_STATE_ROAMING_MOVE = 0x00800000,
+ UNIT_STATE_CONFUSED_MOVE = 0x01000000,
+ UNIT_STATE_FLEEING_MOVE = 0x02000000,
+ UNIT_STATE_CHASE_MOVE = 0x04000000,
+ UNIT_STATE_FOLLOW_MOVE = 0x08000000,
+ UNIT_STATE_UNATTACKABLE = (UNIT_STATE_IN_FLIGHT | UNIT_STATE_ONVEHICLE),
+ //UNIT_STATE_MOVING = (UNIT_STATE_ROAMING | UNIT_STATE_CHASE),
+ // for real move using movegen check and stop (except unstoppable flight)
+ UNIT_STATE_MOVING = UNIT_STATE_ROAMING_MOVE | UNIT_STATE_CONFUSED_MOVE | UNIT_STATE_FLEEING_MOVE| UNIT_STATE_CHASE_MOVE | UNIT_STATE_FOLLOW_MOVE ,
+ UNIT_STATE_CONTROLLED = (UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING),
+ UNIT_STATE_LOST_CONTROL = (UNIT_STATE_CONTROLLED | UNIT_STATE_JUMPING | UNIT_STATE_CHARGING),
+ UNIT_STATE_SIGHTLESS = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_EVADE),
+ UNIT_STATE_CANNOT_AUTOATTACK = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_CASTING),
+ UNIT_STATE_CANNOT_TURN = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_ROTATING),
+ // stay by different reasons
+ UNIT_STATE_NOT_MOVE = UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DIED | UNIT_STATE_DISTRACTED,
+ UNIT_STATE_ALL_STATE = 0xffffffff //(UNIT_STATE_STOPPED | UNIT_STATE_MOVING | UNIT_STATE_IN_COMBAT | UNIT_STATE_IN_FLIGHT)
};
enum UnitMoveType
@@ -581,8 +589,8 @@ enum UnitFlags
UNIT_FLAG_PREPARATION = 0x00000020, // don't take reagents for spells with SPELL_ATTR5_NO_REAGENT_WHILE_PREP
UNIT_FLAG_UNK_6 = 0x00000040,
UNIT_FLAG_NOT_ATTACKABLE_1 = 0x00000080, // ?? (UNIT_FLAG_PVP_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE
- UNIT_FLAG_OOC_NOT_ATTACKABLE = 0x00000100, // 2.0.8 - (OOC Out Of Combat) Can not be attacked when not in combat. Removed if unit for some reason enter combat.
- UNIT_FLAG_PASSIVE = 0x00000200, // makes you unable to attack everything. Almost identical to our "civilian"-term. Will ignore it's surroundings and not engage in combat unless "called upon" or engaged by another unit.
+ UNIT_FLAG_IMMUNE_TO_PC = 0x00000100, // disables combat/assistance with PlayerCharacters (PC) - see Unit::_IsValidAttackTarget, Unit::_IsValidAssistTarget
+ UNIT_FLAG_IMMUNE_TO_NPC = 0x00000200, // disables combat/assistance with NonPlayerCharacters (NPC) - see Unit::_IsValidAttackTarget, Unit::_IsValidAssistTarget
UNIT_FLAG_LOOTING = 0x00000400, // loot animation
UNIT_FLAG_PET_IN_COMBAT = 0x00000800, // in combat?, 2.0.8
UNIT_FLAG_PVP = 0x00001000, // changed in 3.0.3
@@ -719,59 +727,18 @@ enum MovementFlags2
MOVEMENTFLAG2_UNK15 = 0x00004000,
MOVEMENTFLAG2_UNK16 = 0x00008000,
};
+
enum SplineFlags
{
- SPLINEFLAG_NONE = 0x00000000,
- SPLINEFLAG_FORWARD = 0x00000001,
- SPLINEFLAG_BACKWARD = 0x00000002,
- SPLINEFLAG_STRAFE_LEFT = 0x00000004,
- SPLINEFLAG_STRAFE_RIGHT = 0x00000008,
- SPLINEFLAG_LEFT = 0x00000010,
- SPLINEFLAG_RIGHT = 0x00000020,
- SPLINEFLAG_PITCH_UP = 0x00000040,
- SPLINEFLAG_PITCH_DOWN = 0x00000080,
- SPLINEFLAG_DONE = 0x00000100,
- SPLINEFLAG_FALLING = 0x00000200,
- SPLINEFLAG_NO_SPLINE = 0x00000400,
- SPLINEFLAG_TRAJECTORY = 0x00000800,
- SPLINEFLAG_WALKING = 0x00001000,
- SPLINEFLAG_FLYING = 0x00002000,
- SPLINEFLAG_KNOCKBACK = 0x00004000,
- SPLINEFLAG_FINAL_POINT = 0x00008000,
- SPLINEFLAG_FINAL_TARGET = 0x00010000,
- SPLINEFLAG_FINAL_FACING = 0x00020000,
- SPLINEFLAG_CATMULL_ROM = 0x00040000,
- SPLINEFLAG_UNKNOWN20 = 0x00080000,
- SPLINEFLAG_UNKNOWN21 = 0x00100000,
- SPLINEFLAG_ANIMATIONTIER = 0x00200000,
- SPLINEFLAG_UNKNOWN23 = 0x00400000,
- SPLINEFLAG_TRANSPORT = 0x00800000,
- SPLINEFLAG_EXIT_VEHICLE = 0x01000000,
- SPLINEFLAG_UNKNOWN26 = 0x02000000,
- SPLINEFLAG_UNKNOWN27 = 0x04000000,
- SPLINEFLAG_UNKNOWN28 = 0x08000000,
- SPLINEFLAG_UNKNOWN29 = 0x10000000,
- SPLINEFLAG_ANIMATION = 0x20000000,
- SPLINEFLAG_UNKNOWN31 = 0x40000000,
- SPLINEFLAG_UNKNOWN32 = 0x80000000,
-
- SPLINEFLAG_GLIDE = SPLINEFLAG_WALKING | SPLINEFLAG_FLYING,
-};
-
-enum SplineMode
-{
- SPLINEMODE_LINEAR = 0,
- SPLINEMODE_CATMULL_ROM = 1,
- SPLINEMODE_BEZIER3 = 2
+ SPLINEFLAG_WALKMODE = 0x00001000,
+ SPLINEFLAG_FLYING = 0x00002000,
+ SPLINEFLAG_TRANSPORT = 0x00800000,
+ SPLINEFLAG_EXIT_VEHICLE = 0x01000000,
};
enum SplineType
{
- SPLINETYPE_NORMAL = 0,
- SPLINETYPE_STOP = 1,
- SPLINETYPE_FACING_SPOT = 2,
- SPLINETYPE_FACING_TARGET = 3,
- SPLINETYPE_FACING_ANGLE = 4
+ SPLINETYPE_FACING_ANGLE = 4,
};
enum UnitTypeMask
@@ -789,6 +756,10 @@ enum UnitTypeMask
UNIT_MASK_ACCESSORY = 0x00000200,
};
+namespace Movement{
+ class MoveSpline;
+}
+
enum DiminishingLevels
{
DIMINISHING_LEVEL_1 = 0,
@@ -817,6 +788,25 @@ enum MeleeHitOutcome
MELEE_HIT_GLANCING, MELEE_HIT_CRIT, MELEE_HIT_CRUSHING, MELEE_HIT_NORMAL
};
+class DispelInfo
+{
+private:
+ Unit* const m_dispeller;
+ uint32 const m_dispellerSpellId;
+ uint8 m_chargesRemoved;
+public:
+ explicit DispelInfo(Unit* _dispeller, uint32 _dispellerSpellId, uint8 _chargesRemoved) :
+ m_dispeller(_dispeller), m_dispellerSpellId(_dispellerSpellId), m_chargesRemoved(_chargesRemoved) {}
+
+ Unit* GetDispeller() { return m_dispeller; }
+ uint32 GetDispellerSpellId() { return m_dispellerSpellId; }
+ uint8 GetRemovedCharges() { return m_chargesRemoved; }
+ void SetRemovedCharges(uint8 amount)
+ {
+ m_chargesRemoved = amount;
+ }
+};
+
struct CleanDamage
{
CleanDamage(uint32 mitigated, uint32 absorbed, WeaponAttackType _attackType, MeleeHitOutcome _hitOutCome) :
@@ -1309,7 +1299,7 @@ class Unit : public WorldObject
void CombatStop(bool includingCast = false);
void CombatStopWithPets(bool includingCast = false);
void StopAttackFaction(uint32 faction_id);
- Unit* SelectNearbyTarget(float dist = NOMINAL_MELEE_RANGE) const;
+ Unit* SelectNearbyTarget(Unit* exclude = NULL, float dist = NOMINAL_MELEE_RANGE) const;
void SendMeleeAttackStop(Unit* victim = NULL);
void SendMeleeAttackStart(Unit* pVictim);
@@ -1318,8 +1308,8 @@ class Unit : public WorldObject
void ClearUnitState(uint32 f) { m_state &= ~f; }
bool CanFreeMove() const
{
- return !HasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING | UNIT_STAT_IN_FLIGHT |
- UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) && GetOwnerGUID() == 0;
+ return !HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_FLEEING | UNIT_STATE_IN_FLIGHT |
+ UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED) && GetOwnerGUID() == 0;
}
uint32 HasUnitTypeMask(uint32 mask) const { return mask & m_unitTypeMask; }
@@ -1554,7 +1544,7 @@ class Unit : public WorldObject
}
bool isSpiritService() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER | UNIT_NPC_FLAG_SPIRITGUIDE); }
- bool isInFlight() const { return HasUnitState(UNIT_STAT_IN_FLIGHT); }
+ bool isInFlight() const { return HasUnitState(UNIT_STATE_IN_FLIGHT); }
bool isInCombat() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); }
void CombatStart(Unit* target, bool initialAggro = true);
@@ -1565,6 +1555,8 @@ class Unit : public WorldObject
bool HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint32 familyFlags) const;
bool virtual HasSpell(uint32 /*spellID*/) const { return false; }
+ bool HasBreakableByDamageAuraType(AuraType type, uint32 excludeAura = 0) const;
+ bool HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel = NULL) const;
bool HasStealthAura() const { return HasAuraType(SPELL_AURA_MOD_STEALTH); }
bool HasInvisibilityAura() const { return HasAuraType(SPELL_AURA_MOD_INVISIBILITY); }
@@ -1628,20 +1620,18 @@ class Unit : public WorldObject
void JumpTo(float speedXY, float speedZ, bool forward = true);
void JumpTo(WorldObject* obj, float speedZ);
- void SetFacing(float ori, WorldObject* obj = NULL);
- void SendMonsterStop(bool on_death = false);
- void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 Time, Player* player = NULL);
- void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 MoveFlags, uint32 time, float speedZ, Player* player = NULL);
- void SendMonsterMove(MonsterMoveData const& moveData, Player* receiver = NULL);
+ void MonsterMoveWithSpeed(float x, float y, float z, float speed);
+ //void SetFacing(float ori, WorldObject* obj = NULL);
void SendMonsterMoveExitVehicle(Position const* newPos);
//void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL);
void SendMonsterMoveTransport(Unit* vehicleOwner);
- void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0, Player* player = NULL);
- void SendMonsterMoveWithSpeedToCurrentDestination(Player* player = NULL);
void SendMovementFlagUpdate();
+ bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_LEVITATING);}
+ bool IsWalking() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING);}
- template<typename PathElem, typename PathNode>
- void SendMonsterMoveByPath(Path<PathElem, PathNode> const& path, uint32 start, uint32 end);
+ void SetInFront(Unit const* target);
+ void SetFacingTo(float ori);
+ void SetFacingToObject(WorldObject* pObject);
void SendChangeCurrentVictimOpcode(HostileReference* pHostileReference);
void SendClearThreatListOpcode();
@@ -1713,8 +1703,8 @@ class Unit : public WorldObject
void RemoveAllControlled();
bool isCharmed() const { return GetCharmerGUID() != 0; }
- bool isPossessed() const { return HasUnitState(UNIT_STAT_POSSESSED); }
- bool isPossessedByPlayer() const { return HasUnitState(UNIT_STAT_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); }
+ bool isPossessed() const { return HasUnitState(UNIT_STATE_POSSESSED); }
+ bool isPossessedByPlayer() const { return HasUnitState(UNIT_STATE_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); }
bool isPossessing() const
{
if (Unit* u = GetCharm())
@@ -1775,7 +1765,7 @@ class Unit : public WorldObject
void RemoveAurasDueToSpell(uint32 spellId, uint64 casterGUID = 0, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveAuraFromStack(uint32 spellId, uint64 casterGUID = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
- void RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit* dispeller, uint8 chargesRemoved = 1);
+ void RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, uint64 casterGUID, Unit* dispeller, uint8 chargesRemoved = 1);
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit* stealer);
void RemoveAurasDueToItemSpell(Item* castItem, uint32 spellId);
void RemoveAurasByType(AuraType auraType, uint64 casterGUID = 0, Aura* except = NULL, bool negative = true, bool positive = true);
@@ -1951,13 +1941,7 @@ class Unit : public WorldObject
void SetBaseWeaponDamage(WeaponAttackType attType, WeaponDamageRange damageRange, float value) { m_weaponDamage[attType][damageRange] = value; }
bool isInFrontInMap(Unit const* target, float distance, float arc = M_PI) const;
- void SetInFront(Unit const* target)
- {
- if (!HasUnitState(UNIT_STAT_CANNOT_TURN))
- SetOrientation(GetAngle(target));
- }
bool isInBackInMap(Unit const* target, float distance, float arc = M_PI) const;
- void SetFacingToObject(WorldObject* pObject);
// Visibility system
bool IsVisible() const { return (m_serverSideVisibility.GetValue(SERVERSIDE_VISIBILITY_GM) > SEC_PLAYER) ? false : true; }
@@ -2085,7 +2069,7 @@ class Unit : public WorldObject
MotionMaster* GetMotionMaster() { return &i_motionMaster; }
const MotionMaster* GetMotionMaster() const { return &i_motionMaster; }
- bool IsStopped() const { return !(HasUnitState(UNIT_STAT_MOVING)); }
+ bool IsStopped() const { return !(HasUnitState(UNIT_STATE_MOVING)); }
void StopMoving();
void AddUnitMovementFlag(uint32 f) { m_movementInfo.flags |= f; }
@@ -2232,6 +2216,9 @@ class Unit : public WorldObject
SetUInt64Value(UNIT_FIELD_TARGET, 0);
}
+ // Movement info
+ Movement::MoveSpline * movespline;
+
protected:
explicit Unit (bool isWorldObject);
@@ -2303,6 +2290,8 @@ class Unit : public WorldObject
bool IsAlwaysVisibleFor(WorldObject const* seer) const;
bool IsAlwaysDetectableFor(WorldObject const* seer) const;
+
+ void DisableSpline();
private:
bool IsTriggeredAtSpellProcEvent(Unit* pVictim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const* & spellProcEvent);
bool HandleDummyAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
@@ -2316,6 +2305,8 @@ class Unit : public WorldObject
bool HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura);
bool HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura);
+ void UpdateSplineMovement(uint32 t_diff);
+
// player or player's pet
float GetCombatRatingReduction(CombatRating cr) const;
uint32 GetCombatRatingDamageReduction(CombatRating cr, float rate, float cap, uint32 damage) const;
@@ -2330,6 +2321,7 @@ class Unit : public WorldObject
uint32 m_state; // Even derived shouldn't modify
uint32 m_CombatTimer;
uint32 m_lastManaUse; // msecs
+ TimeTrackerSmall m_movesplineTimer;
Diminishing m_Diminishing;
// Manage all Units that are threatened by us
@@ -2382,31 +2374,4 @@ namespace Trinity
const bool m_ascending;
};
}
-
-template<typename Elem, typename Node>
-inline void Unit::SendMonsterMoveByPath(Path<Elem, Node> const& path, uint32 start, uint32 end)
-{
- uint32 traveltime = uint32(path.GetTotalLength(start, end) * 32);
- uint32 pathSize = end - start;
- WorldPacket data(SMSG_MONSTER_MOVE, (GetPackGUID().size()+1+4+4+4+4+1+4+4+4+pathSize*4*3));
- data.append(GetPackGUID());
- data << uint8(0);
- data << GetPositionX();
- data << GetPositionY();
- data << GetPositionZ();
- data << uint32(getMSTime());
- data << uint8(0);
- data << uint32(((GetUnitMovementFlags() & MOVEMENTFLAG_LEVITATING) || isInFlight()) ? (SPLINEFLAG_FLYING|SPLINEFLAG_WALKING) : SPLINEFLAG_WALKING);
- data << uint32(traveltime);
- data << uint32(pathSize);
-
- for (uint32 i = start; i < end; ++i)
- {
- data << float(path[i].x);
- data << float(path[i].y);
- data << float(path[i].z);
- }
-
- SendMessageToSet(&data, true);
-}
#endif
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp
index d3c3268e9ce..fc6c6cb063e 100755
--- a/src/server/game/Entities/Vehicle/Vehicle.cpp
+++ b/src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -176,7 +176,7 @@ void Vehicle::ApplyAllImmunities()
case 160: // Strand of the Ancients
case 244: // Wintergrasp
case 510: // Isle of Conquest
- _me->SetControlled(true, UNIT_STAT_ROOT);
+ _me->SetControlled(true, UNIT_STATE_ROOT);
// why we need to apply this? we can simple add immunities to slow mechanic in DB
_me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_DECREASE_SPEED, true);
break;
@@ -342,7 +342,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
}
if (seat->second.SeatInfo->m_flags && !(seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_UNK1))
- unit->AddUnitState(UNIT_STAT_ONVEHICLE);
+ unit->AddUnitState(UNIT_STATE_ONVEHICLE);
unit->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
VehicleSeatEntry const* veSeat = seat->second.SeatInfo;
@@ -364,7 +364,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
if (_me->IsInWorld())
{
unit->SendClearTarget(); // SMSG_BREAK_TARGET
- unit->SetControlled(true, UNIT_STAT_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_SPLINE_MOVE_ROOT here (for creatures)
+ unit->SetControlled(true, UNIT_STATE_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_SPLINE_MOVE_ROOT here (for creatures)
// also adds MOVEMENTFLAG_ROOT
unit->SendMonsterMoveTransport(_me); // SMSG_MONSTER_MOVE_TRANSPORT
@@ -407,7 +407,7 @@ void Vehicle::RemovePassenger(Unit* unit)
++_usableSeatNum;
}
- unit->ClearUnitState(UNIT_STAT_ONVEHICLE);
+ unit->ClearUnitState(UNIT_STATE_ONVEHICLE);
if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->first == 0 && seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL)
_me->RemoveCharmedBy(unit);
diff --git a/src/server/game/Entities/Vehicle/Vehicle.h b/src/server/game/Entities/Vehicle/Vehicle.h
index 51ad500572b..213be5a21fe 100755
--- a/src/server/game/Entities/Vehicle/Vehicle.h
+++ b/src/server/game/Entities/Vehicle/Vehicle.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 4d46ce956de..2b1d27243a8 100644
--- a/src/server/game/Entities/Vehicle/VehicleDefines.h
+++ b/src/server/game/Entities/Vehicle/VehicleDefines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 5cb130b93e4..6f5dc0e511e 100755
--- a/src/server/game/Events/GameEventMgr.cpp
+++ b/src/server/game/Events/GameEventMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -759,6 +759,50 @@ void GameEventMgr::LoadFromDB()
}
}
+ sLog->outString("Loading Game Event Seasonal Quest Relations...");
+ {
+ uint32 oldMSTime = getMSTime();
+
+ // 0 1
+ QueryResult result = WorldDatabase.Query("SELECT questId, eventEntry FROM game_event_seasonal_questrelation");
+
+ if (!result)
+ {
+ sLog->outString(">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty.");
+ sLog->outString();
+ }
+ else
+ {
+ uint32 count = 0;
+ do
+ {
+ Field* fields = result->Fetch();
+
+ uint32 questId = fields[0].GetUInt32();
+ uint16 eventEntry = fields[1].GetUInt16();
+
+ if (!sObjectMgr->GetQuestTemplate(questId))
+ {
+ sLog->outErrorDb("`game_event_seasonal_questrelation` quest id (%u) does not exist in `quest_template`", questId);
+ continue;
+ }
+
+ if (eventEntry >= mGameEvent.size())
+ {
+ sLog->outErrorDb("`game_event_seasonal_questrelation` event id (%u) is out of range compared to max event in `game_event`", eventEntry);
+ continue;
+ }
+
+ _questToEventLinks[questId] = eventEntry;
+ ++count;
+ }
+ while (result->NextRow());
+
+ sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outString();
+ }
+ }
+
sLog->outString("Loading Game Event Vendor Additions Data...");
{
uint32 oldMSTime = getMSTime();
@@ -1079,6 +1123,8 @@ void GameEventMgr::UnApplyEvent(uint16 event_id)
UpdateEventNPCVendor(event_id, false);
// update bg holiday
UpdateBattlegroundSettings();
+ // check for seasonal quest reset.
+ sWorld->ResetEventSeasonalQuests(event_id);
}
void GameEventMgr::ApplyNewEvent(uint16 event_id)
@@ -1544,7 +1590,7 @@ void GameEventMgr::HandleQuestComplete(uint32 quest_id)
stmt->setUInt32(1, condition);
trans->Append(stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GAME_EVENT_CONDITION_SAVE);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GAME_EVENT_CONDITION_SAVE);
stmt->setUInt8(0, uint8(event_id));
stmt->setUInt32(1, condition);
stmt->setFloat(2, citr->second.done);
@@ -1588,7 +1634,7 @@ void GameEventMgr::SaveWorldEventStateToDB(uint16 event_id)
stmt->setUInt8(0, uint8(event_id));
trans->Append(stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GAME_EVENT_SAVE);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GAME_EVENT_SAVE);
stmt->setUInt8(0, uint8(event_id));
stmt->setUInt8(1, mGameEvent[event_id].state);
stmt->setUInt32(2, mGameEvent[event_id].nextstart ? uint32(mGameEvent[event_id].nextstart) : 0);
@@ -1628,6 +1674,18 @@ void GameEventMgr::RunSmartAIScripts(uint16 event_id, bool activate)
}
}
+uint16 GameEventMgr::GetEventIdForQuest(Quest const* quest) const
+{
+ if (!quest)
+ return 0;
+
+ UNORDERED_MAP<uint32, uint16>::const_iterator itr = _questToEventLinks.find(quest->GetQuestId());
+ if (itr == _questToEventLinks.end())
+ return 0;
+
+ return itr->second;
+}
+
bool IsHolidayActive(HolidayIds id)
{
if (id == HOLIDAY_NONE)
@@ -1643,7 +1701,7 @@ bool IsHolidayActive(HolidayIds id)
return false;
}
- bool IsEventActive(uint16 event_id)
+bool IsEventActive(uint16 event_id)
{
GameEventMgr::ActiveEvents const& ae = sGameEventMgr->GetActiveEventList();
return ae.find(event_id) != ae.end();
diff --git a/src/server/game/Events/GameEventMgr.h b/src/server/game/Events/GameEventMgr.h
index bba92b4d24c..d9b5890bfe5 100755
--- a/src/server/game/Events/GameEventMgr.h
+++ b/src/server/game/Events/GameEventMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -89,6 +89,7 @@ struct NPCVendorEntry
class Player;
class Creature;
+class Quest;
class GameEventMgr
{
@@ -118,6 +119,7 @@ class GameEventMgr
void HandleWorldEventGossip(Player* player, Creature* c);
uint32 GetNPCFlag(Creature* cr);
uint32 GetNpcTextId(uint32 guid);
+ uint16 GetEventIdForQuest(Quest const* quest) const;
private:
void SendWorldStateUpdate(Player* player, uint16 event_id);
void AddActiveEvent(uint16 event_id) { m_ActiveEvents.insert(event_id); }
@@ -169,6 +171,7 @@ class GameEventMgr
QuestIdToEventConditionMap mQuestToEventConditions;
GameEventNPCFlagMap mGameEventNPCFlags;
ActiveEvents m_ActiveEvents;
+ UNORDERED_MAP<uint32, uint16> _questToEventLinks;
bool isSystemInit;
public:
GameEventGuidMap mGameEventCreatureGuids;
diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp
index 8b545548946..1a069a27825 100755
--- a/src/server/game/Globals/ObjectAccessor.cpp
+++ b/src/server/game/Globals/ObjectAccessor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 92c947eb86f..92a7a24571e 100755
--- a/src/server/game/Globals/ObjectAccessor.h
+++ b/src/server/game/Globals/ObjectAccessor.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 5353e048066..dc78489070e 100755
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -1400,7 +1400,7 @@ bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guidLow, uint32 linkedGuidLow)
uint64 linkedGuid = MAKE_NEW_GUID(linkedGuidLow, slave->id, HIGHGUID_UNIT);
mLinkedRespawnMap[guid] = linkedGuid;
- PreparedStatement *stmt = WorldDatabase.GetPreparedStatement(WORLD_REP_CRELINKED_RESPAWN);
+ PreparedStatement *stmt = WorldDatabase.GetPreparedStatement(WORLD_REP_CREATURE_LINKED_RESPAWN);
stmt->setUInt32(0, guidLow);
stmt->setUInt32(1, linkedGuidLow);
WorldDatabase.Execute(stmt);
@@ -1900,7 +1900,7 @@ void ObjectMgr::LoadCreatureRespawnTimes()
uint32 count = 0;
- PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_LOAD_CREATURE_RESPAWNS));
+ PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_CREATURE_RESPAWNS));
if (!result)
{
sLog->outString(">> Loaded 0 creature respawn time.");
@@ -1934,7 +1934,7 @@ void ObjectMgr::LoadGameobjectRespawnTimes()
uint32 count = 0;
- PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_LOAD_GO_RESPAWNS));
+ PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_GO_RESPAWNS));
if (!result)
{
sLog->outString(">> Loaded 0 gameobject respawn times. DB table `gameobject_respawn` is empty!");
@@ -3683,7 +3683,7 @@ void ObjectMgr::LoadQuests()
QueryResult result = WorldDatabase.Query("SELECT "
//0 1 2 3 4 5 6 7 8 9 10 11 12
"Id, Method, Level, MinLevel, MaxLevel, ZoneOrSort, Type, SuggestedPlayers, LimitTime, RequiredClasses, RequiredRaces, RequiredSkillId, RequiredSkillPoints, "
- // 13 14 15 16 17 18 19 20
+ // 13 14 15 16 17 18 19 20
"RequiredFactionId1, RequiredFactionId2, RequiredFactionValue1, RequiredFactionValue2, RequiredMinRepFaction, RequiredMaxRepFaction, RequiredMinRepValue, RequiredMaxRepValue, "
// 21 22 23 24 25 26 27 28 29 30 31
"PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestIdChain, RewardXPId, RewardOrRequiredMoney, RewardMoneyMaxLevel, RewardSpell, RewardSpellCast, RewardHonor, RewardHonorMultiplier, "
@@ -5304,7 +5304,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
stmt->setUInt64(0, basetime);
CharacterDatabase.Execute(stmt);
}
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_EXPIRED_MAIL);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_EXPIRED_MAIL);
stmt->setUInt64(0, basetime);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
@@ -5315,7 +5315,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
}
std::map<uint32 /*messageId*/, MailItemInfoVec> itemsCache;
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_EXPIRED_MAIL_ITEMS);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_EXPIRED_MAIL_ITEMS);
stmt->setUInt64(0, basetime);
if (PreparedQueryResult items = CharacterDatabase.Query(stmt))
{
@@ -5379,7 +5379,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
else
{
// Mail will be returned
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_MAIL_RETURNED);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_MAIL_RETURNED);
stmt->setUInt32(0, m->receiver);
stmt->setUInt32(1, m->sender);
stmt->setUInt64(2, basetime + 30 * DAY);
@@ -5390,12 +5390,12 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
for (MailItemInfoVec::iterator itr2 = m->items.begin(); itr2 != m->items.end(); ++itr2)
{
// Update receiver in mail items for its proper delivery, and in instance_item for avoid lost item at sender delete
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_MAIL_ITEM_RECEIVER);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_MAIL_ITEM_RECEIVER);
stmt->setUInt32(0, m->sender);
stmt->setUInt32(1, itr2->item_guid);
CharacterDatabase.Execute(stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_ITEM_OWNER);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_OWNER);
stmt->setUInt32(0, m->sender);
stmt->setUInt32(1, itr2->item_guid);
CharacterDatabase.Execute(stmt);
@@ -5873,7 +5873,7 @@ GraveYardData const* ObjectMgr::FindGraveYardData(uint32 id, uint32 zoneId)
return NULL;
}
-bool ObjectMgr::AddGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool inDB)
+bool ObjectMgr::AddGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool persist /*= true*/)
{
if (FindGraveYardData(id, zoneId))
return false;
@@ -5886,16 +5886,21 @@ bool ObjectMgr::AddGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool inD
mGraveYardMap.insert(GraveYardMap::value_type(zoneId, data));
// add link to DB
- if (inDB)
+ if (persist)
{
- WorldDatabase.PExecute("INSERT INTO game_graveyard_zone (id, ghost_zone, faction) "
- "VALUES ('%u', '%u', '%u')", id, zoneId, team);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_GRAVEYARD_ZONE);
+
+ stmt->setUInt32(0, id);
+ stmt->setUInt32(1, zoneId);
+ stmt->setUInt16(2, uint16(team));
+
+ WorldDatabase.Execute(stmt);
}
return true;
}
-void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool inDB)
+void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool persist /*= false*/)
{
GraveYardMap::iterator graveLow = mGraveYardMap.lower_bound(zoneId);
GraveYardMap::iterator graveUp = mGraveYardMap.upper_bound(zoneId);
@@ -5934,9 +5939,15 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool
mGraveYardMap.erase(itr);
// remove link from DB
- if (inDB)
+ if (persist)
{
- WorldDatabase.PExecute("DELETE FROM game_graveyard_zone WHERE id = '%u' AND ghost_zone = '%u' AND faction = '%u'", id, zoneId, team);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GRAVEYARD_ZONE);
+
+ stmt->setUInt32(0, id);
+ stmt->setUInt32(1, zoneId);
+ stmt->setUInt16(2, uint16(team));
+
+ WorldDatabase.Execute(stmt);
}
return;
@@ -6160,10 +6171,10 @@ void ObjectMgr::SetHighestGuids()
m_hiItemGuid = (*result)[0].GetUInt32()+1;
// Cleanup other tables from not existed guids ( >= m_hiItemGuid)
- CharacterDatabase.PExecute("DELETE FROM character_inventory WHERE item >= '%u'", m_hiItemGuid);
- CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid >= '%u'", m_hiItemGuid);
- CharacterDatabase.PExecute("DELETE FROM auctionhouse WHERE itemguid >= '%u'", m_hiItemGuid);
- CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE item_guid >= '%u'", m_hiItemGuid);
+ CharacterDatabase.PExecute("DELETE FROM character_inventory WHERE item >= '%u'", m_hiItemGuid); // One-time query
+ CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid >= '%u'", m_hiItemGuid); // One-time query
+ CharacterDatabase.PExecute("DELETE FROM auctionhouse WHERE itemguid >= '%u'", m_hiItemGuid); // One-time query
+ CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE item_guid >= '%u'", m_hiItemGuid); // One-time query
result = WorldDatabase.Query("SELECT MAX(guid) FROM gameobject");
if (result)
@@ -6708,7 +6719,7 @@ void ObjectMgr::LoadCorpses()
{
uint32 oldMSTime = getMSTime();
- PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_LOAD_CORPSES));
+ PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_CORPSES));
if (!result)
{
sLog->outString(">> Loaded 0 corpses. DB table `pet_name_generation` is empty.");
@@ -7251,7 +7262,7 @@ void ObjectMgr::SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t
m_CreatureRespawnTimesMtx.release();
}
- PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_CREATURE_RESPAWN);
+ PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN);
stmt->setUInt32(0, loguid);
stmt->setUInt64(1, uint64(t));
stmt->setUInt32(2, instance);
@@ -7299,7 +7310,7 @@ void ObjectMgr::SaveGORespawnTime(uint32 loguid, uint32 instance, time_t t)
m_GORespawnTimesMtx.release();
}
- PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GO_RESPAWN);
+ PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GO_RESPAWN);
stmt->setUInt32(0, loguid);
stmt->setUInt64(1, uint64(t));
stmt->setUInt32(2, instance);
@@ -8046,11 +8057,18 @@ bool ObjectMgr::AddGameTele(GameTele& tele)
m_GameTeleMap[new_id] = tele;
- std::string safeName(tele.name);
- WorldDatabase.EscapeString(safeName);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_GAME_TELE);
+
+ stmt->setUInt32(0, new_id);
+ stmt->setFloat(1, tele.position_x);
+ stmt->setFloat(2, tele.position_y);
+ stmt->setFloat(3, tele.position_z);
+ stmt->setFloat(4, tele.orientation);
+ stmt->setUInt16(5, uint16(tele.mapId));
+ stmt->setString(6, tele.name);
+
+ WorldDatabase.Execute(stmt);
- WorldDatabase.PExecute("INSERT INTO game_tele (id, position_x, position_y, position_z, orientation, map, name) VALUES (%u, %f, %f, %f, %f, %d, '%s')",
- new_id, tele.position_x, tele.position_y, tele.position_z, tele.orientation, tele.mapId, safeName.c_str());
return true;
}
@@ -8068,7 +8086,12 @@ bool ObjectMgr::DeleteGameTele(const std::string& name)
{
if (itr->second.wnameLow == wname)
{
- WorldDatabase.PExecute("DELETE FROM game_tele WHERE name = '%s'", itr->second.name.c_str());
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAME_TELE);
+
+ stmt->setString(0, itr->second.name);
+
+ WorldDatabase.Execute(stmt);
+
m_GameTeleMap.erase(itr);
return true;
}
@@ -8456,16 +8479,26 @@ void ObjectMgr::LoadGossipMenuItems()
sLog->outString();
}
-void ObjectMgr::AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedcost, bool savetodb)
+void ObjectMgr::AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, bool persist /*= true*/)
{
VendorItemData& vList = m_mCacheVendorItemMap[entry];
- vList.AddItem(item, maxcount, incrtime, extendedcost);
+ vList.AddItem(item, maxcount, incrtime, extendedCost);
- if (savetodb)
- WorldDatabase.PExecute("INSERT INTO npc_vendor (entry, item, maxcount, incrtime, extendedcost) VALUES('%u', '%u', '%u', '%u', '%u')", entry, item, maxcount, incrtime, extendedcost);
+ if (persist)
+ {
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_NPC_VENODR);
+
+ stmt->setUInt32(0, entry);
+ stmt->setUInt32(1, item);
+ stmt->setUInt8(2, maxcount);
+ stmt->setUInt32(3, incrtime);
+ stmt->setUInt32(4, extendedCost);
+
+ WorldDatabase.Execute(stmt);
+ }
}
-bool ObjectMgr::RemoveVendorItem(uint32 entry, uint32 item, bool savetodb)
+bool ObjectMgr::RemoveVendorItem(uint32 entry, uint32 item, bool persist /*= true*/)
{
CacheVendorItemMap::iterator iter = m_mCacheVendorItemMap.find(entry);
if (iter == m_mCacheVendorItemMap.end())
@@ -8474,7 +8507,16 @@ bool ObjectMgr::RemoveVendorItem(uint32 entry, uint32 item, bool savetodb)
if (!iter->second.RemoveItem(item))
return false;
- if (savetodb) WorldDatabase.PExecute("DELETE FROM npc_vendor WHERE entry='%u' AND item='%u'", entry, item);
+ if (persist)
+ {
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_NPC_VENDOR);
+
+ stmt->setUInt32(0, entry);
+ stmt->setUInt32(1, item);
+
+ WorldDatabase.Execute(stmt);
+ }
+
return true;
}
@@ -8641,7 +8683,7 @@ void ObjectMgr::CheckScripts(ScriptsType type, std::set<int32>& ids)
case SCRIPT_COMMAND_TALK:
{
if (!GetTrinityStringLocale (itrM->second.Talk.TextID))
- sLog->outErrorDb("Table `db_script_string` not has string id %u used db script (ID: %u)", itrM->second.Talk.TextID, itrMM->first);
+ sLog->outErrorDb("Table `%s` references invalid text id %u from `db_script_string`, script id: %u.", GetScriptsTableNameByType(type).c_str(), itrM->second.Talk.TextID, itrMM->first);
if (ids.find(itrM->second.Talk.TextID) != ids.end())
ids.erase(itrM->second.Talk.TextID);
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index 88c593a009d..126cca59ef0 100755
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -670,6 +670,7 @@ class ObjectMgr
return NULL;
return info;
}
+
void GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, PlayerLevelInfo* info) const;
uint64 GetPlayerGUIDByName(std::string name) const;
@@ -687,6 +688,7 @@ class ObjectMgr
QuestMap::const_iterator itr = mQuestTemplates.find(quest_id);
return itr != mQuestTemplates.end() ? itr->second : NULL;
}
+
QuestMap const& GetQuestTemplates() const { return mQuestTemplates; }
uint32 GetQuestForAreaTrigger(uint32 Trigger_ID) const
@@ -696,6 +698,7 @@ class ObjectMgr
return itr->second;
return 0;
}
+
bool IsTavernAreaTrigger(uint32 Trigger_ID) const
{
return mTavernAreaTriggerSet.find(Trigger_ID) != mTavernAreaTriggerSet.end();
@@ -710,8 +713,8 @@ class ObjectMgr
WorldSafeLocsEntry const* GetDefaultGraveYard(uint32 team);
WorldSafeLocsEntry const* GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team);
- bool AddGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = true);
- void RemoveGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = false);
+ bool AddGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool persist = true);
+ void RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool persist = false);
void LoadGraveyardZones();
GraveYardData const* FindGraveYardData(uint32 id, uint32 zone);
@@ -1138,8 +1141,8 @@ class ObjectMgr
return &iter->second;
}
- void AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 ExtendedCost, bool savetodb = true); // for event
- bool RemoveVendorItem(uint32 entry, uint32 item, bool savetodb = true); // for event
+ void AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, bool persist = true); // for event
+ bool RemoveVendorItem(uint32 entry, uint32 item, bool persist = true); // for event
bool IsVendorItemValid(uint32 vendor_entry, uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* player = NULL, std::set<uint32>* skip_vendors = NULL, uint32 ORnpcflag = 0) const;
void LoadScriptNames();
diff --git a/src/server/game/Grids/Cells/Cell.h b/src/server/game/Grids/Cells/Cell.h
index 13bb0afc494..67b862845b9 100755
--- a/src/server/game/Grids/Cells/Cell.h
+++ b/src/server/game/Grids/Cells/Cell.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 af697b9f21d..77830bc59d5 100644
--- a/src/server/game/Grids/Cells/CellImpl.h
+++ b/src/server/game/Grids/Cells/CellImpl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 7e66cf1080a..d9350e9e897 100755
--- a/src/server/game/Grids/Grid.h
+++ b/src/server/game/Grids/Grid.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 a9c0bf88769..8651680cb49 100644
--- a/src/server/game/Grids/GridDefines.h
+++ b/src/server/game/Grids/GridDefines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 43564c920e2..85393872eb9 100755
--- a/src/server/game/Grids/GridLoader.h
+++ b/src/server/game/Grids/GridLoader.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 cd972e237ca..66b6313c997 100755
--- a/src/server/game/Grids/GridRefManager.h
+++ b/src/server/game/Grids/GridRefManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 601542daa0d..107bddf04eb 100755
--- a/src/server/game/Grids/GridReference.h
+++ b/src/server/game/Grids/GridReference.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 4e63388c356..c2f66bc3e8a 100755
--- a/src/server/game/Grids/GridStates.cpp
+++ b/src/server/game/Grids/GridStates.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 78f70356608..08b66f6bb35 100755
--- a/src/server/game/Grids/GridStates.h
+++ b/src/server/game/Grids/GridStates.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 c87fd7e6129..b5701a7a590 100755
--- a/src/server/game/Grids/NGrid.h
+++ b/src/server/game/Grids/NGrid.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 99d402b4add..2446e9d4276 100755
--- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -113,7 +113,7 @@ inline void CreatureUnitRelocationWorker(Creature* c, Unit* u)
if (!u->isAlive() || !c->isAlive() || c == u || u->isInFlight())
return;
- if (c->HasReactState(REACT_AGGRESSIVE) && !c->HasUnitState(UNIT_STAT_SIGHTLESS))
+ if (c->HasReactState(REACT_AGGRESSIVE) && !c->HasUnitState(UNIT_STATE_SIGHTLESS))
if (c->IsAIEnabled && c->canSeeOrDetect(u, false, true))
c->AI()->MoveInLineOfSight_Safe(u);
}
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index 239c3710b5b..e3029a1be65 100755
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -746,7 +746,7 @@ namespace Trinity
bool operator()(Unit* u)
{
if (u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
- (u->isFeared() || u->isCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STAT_STUNNED) || u->HasUnitState(UNIT_STAT_CONFUSED)))
+ (u->isFeared() || u->isCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STATE_STUNNED) || u->HasUnitState(UNIT_STATE_CONFUSED)))
{
return true;
}
diff --git a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h
index 543a1d1e280..34fe7757c5f 100755
--- a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.cpp b/src/server/game/Grids/ObjectGridLoader.cpp
index cc5e3f5158a..519a53ad184 100755
--- a/src/server/game/Grids/ObjectGridLoader.cpp
+++ b/src/server/game/Grids/ObjectGridLoader.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 09a8fb2af9c..f768bd0826b 100755
--- a/src/server/game/Grids/ObjectGridLoader.h
+++ b/src/server/game/Grids/ObjectGridLoader.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 ffb5e0ca1aa..b31b632e963 100755
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -124,7 +124,7 @@ bool Group::Create(Player* leader)
sGroupMgr->RegisterGroupDbStoreId(m_dbStoreId, this);
// Store group in database
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GROUP);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GROUP);
uint8 index = 0;
@@ -190,6 +190,9 @@ void Group::LoadGroupFromDB(Field* fields)
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
else
m_raidDifficulty = Difficulty(r_diff);
+
+ if (m_groupType & GROUPTYPE_LFG)
+ sLFGMgr->_LoadFromDB(fields, GetGUID());
}
void Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles)
@@ -200,7 +203,9 @@ void Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup,
// skip non-existed member
if (!sObjectMgr->GetPlayerNameByGUID(member.guid, member.name))
{
- CharacterDatabase.PQuery("DELETE FROM group_member WHERE memberGuid=%u", guidLow);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER);
+ stmt->setUInt32(0, guidLow);
+ CharacterDatabase.Execute(stmt);
return;
}
@@ -211,6 +216,14 @@ void Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup,
m_memberSlots.push_back(member);
SubGroupCounterIncrease(subgroup);
+
+ if (isLFGGroup())
+ {
+ LfgDungeonSet Dungeons;
+ Dungeons.insert(sLFGMgr->GetDungeon(GetGUID()));
+ sLFGMgr->SetSelectedDungeons(member.guid, Dungeons);
+ sLFGMgr->SetState(member.guid, sLFGMgr->GetState(GetGUID()));
+ }
}
void Group::ConvertToLFG()
@@ -219,7 +232,7 @@ void Group::ConvertToLFG()
m_lootMethod = NEED_BEFORE_GREED;
if (!isBGGroup())
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_GROUP_TYPE);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
stmt->setUInt8(0, uint8(m_groupType));
stmt->setUInt32(1, m_dbStoreId);
@@ -238,7 +251,7 @@ void Group::ConvertToRaid()
if (!isBGGroup())
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_GROUP_TYPE);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
stmt->setUInt8(0, uint8(m_groupType));
stmt->setUInt32(1, m_dbStoreId);
@@ -378,7 +391,7 @@ bool Group::AddMember(Player* player)
// insert into the table if we're not a battleground group
if (!isBGGroup())
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GROUP_MEMBER);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GROUP_MEMBER);
stmt->setUInt32(0, m_dbStoreId);
stmt->setUInt32(1, GUID_LOPART(member.guid));
@@ -441,7 +454,7 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
return m_memberSlots.size();
// remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG allow 1 member group)
- if (GetMembersCount() > (isBGGroup() ? 1u : 2u))
+ if (GetMembersCount() > ((isBGGroup() || isLFGGroup()) ? 1u : 2u))
{
Player* player = ObjectAccessor::FindPlayer(guid);
if (player)
@@ -485,6 +498,8 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
CharacterDatabase.Execute(stmt);
+ DelinkMember(guid);
+
// Reevaluate group enchanter if the leaving player had enchanting skill or the player is offline
if ((player && player->GetSkillValue(SKILL_ENCHANTING)) || !player)
ResetMaxEnchantingLevel();
@@ -535,6 +550,20 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
SendUpdate();
+ if (isLFGGroup() && GetMembersCount() == 1)
+ {
+ Player* Leader = ObjectAccessor::FindPlayer(GetLeaderGUID());
+ LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(sLFGMgr->GetDungeon(GetGUID()));
+ if ((Leader && dungeon && Leader->isAlive() && Leader->GetMapId() != dungeon->map) || !dungeon)
+ {
+ Disband();
+ return false;
+ }
+ }
+
+ if (m_memberMgr.getSize() < ((isLFGGroup() || isBGGroup()) ? 1u : 2u))
+ Disband();
+
return true;
}
// If group size before player removal <= 2 then disband it
@@ -590,7 +619,7 @@ void Group::ChangeLeader(uint64 guid)
Player::ConvertInstancesToGroup(player, this, true);
// Update the group leader
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_GROUP_LEADER);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_LEADER);
stmt->setUInt32(0, player->GetGUIDLow());
stmt->setUInt32(1, m_dbStoreId);
@@ -674,6 +703,10 @@ void Group::Disband(bool hideDestroy /* = false */)
ResetInstances(INSTANCE_RESET_GROUP_DISBAND, false, NULL);
ResetInstances(INSTANCE_RESET_GROUP_DISBAND, true, NULL);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA);
+ stmt->setUInt32(0, m_dbStoreId);
+ CharacterDatabase.Execute(stmt);
+
sGroupMgr->FreeGroupDbStoreId(this);
}
@@ -709,6 +742,28 @@ void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll &r)
}
}
+void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, bool canNeed, Roll const& r)
+{
+ if (!p || !p->GetSession())
+ return;
+
+ WorldPacket data(SMSG_LOOT_START_ROLL, (8 + 4 + 4 + 4 + 4 + 4 + 4 + 1 ));
+ data << uint64(r.itemGUID); // guid of rolled item
+ data << uint32(mapId); // 3.3.3 mapid
+ data << uint32(r.totalPlayersRolling); // maybe the number of players rolling for it???
+ data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for
+ data << uint32(r.itemRandomSuffix); // randomSuffix
+ data << uint32(r.itemRandomPropId); // item random property ID
+ data << uint32(r.itemCount); // items in stack
+ data << uint32(countDown); // the countdown time to choose "need" or "greed"
+ uint8 voteMask = r.rollVoteMask;
+ if (!canNeed)
+ voteMask &= ~ROLL_FLAG_TYPE_NEED;
+ data << uint8(voteMask); // roll type mask
+
+ p->GetSession()->SendPacket(&data);
+}
+
void Group::SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r)
{
WorldPacket data(SMSG_LOOT_ROLL, (8+4+8+4+4+4+1+1+1));
@@ -887,11 +942,11 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
}
}
-void Group::NeedBeforeGreed(Loot* loot, WorldObject* pLootedObject)
+void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
{
ItemTemplate const* item;
uint8 itemSlot = 0;
- for (std::vector<LootItem>::iterator i=loot->items.begin(); i != loot->items.end(); ++i, ++itemSlot)
+ for (std::vector<LootItem>::iterator i = loot->items.begin(); i != loot->items.end(); ++i, ++itemSlot)
{
if (i->freeforall)
continue;
@@ -902,7 +957,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* pLootedObject)
if (item->Quality >= uint32(m_lootThreshold))
{
uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM);
- Roll* r=new Roll(newitemGUID, *i);
+ Roll* r = new Roll(newitemGUID, *i);
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
{
@@ -911,21 +966,17 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* pLootedObject)
continue;
bool allowedForPlayer = i->AllowedForPlayer(playerToRoll);
- if (playerToRoll->CanUseItem(item) == EQUIP_ERR_OK && allowedForPlayer)
+ if (allowedForPlayer && playerToRoll->IsWithinDistInMap(lootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false))
{
- if (playerToRoll->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false))
+ r->totalPlayersRolling++;
+ if (playerToRoll->GetPassOnGroupLoot())
{
- r->totalPlayersRolling++;
-
- if (playerToRoll->GetPassOnGroupLoot())
- {
- r->playerVote[playerToRoll->GetGUID()] = PASS;
- r->totalPass++;
- // can't broadcast the pass now. need to wait until all rolling players are known.
- }
- else
- r->playerVote[playerToRoll->GetGUID()] = NOT_EMITED_YET;
+ r->playerVote[playerToRoll->GetGUID()] = PASS;
+ r->totalPass++;
+ // can't broadcast the pass now. need to wait until all rolling players are known.
}
+ else
+ r->playerVote[playerToRoll->GetGUID()] = NOT_EMITED_YET;
}
}
@@ -941,29 +992,31 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* pLootedObject)
loot->items[itemSlot].is_blocked = true;
- // If there is any "auto pass", broadcast the pass now.
- if (r->totalPass)
+ //Broadcast Pass and Send Rollstart
+ for (Roll::PlayerVote::const_iterator itr = r->playerVote.begin(); itr != r->playerVote.end(); ++itr)
{
- for (Roll::PlayerVote::const_iterator itr=r->playerVote.begin(); itr != r->playerVote.end(); ++itr)
- {
- Player* p = ObjectAccessor::FindPlayer(itr->first);
- if (!p || !p->GetSession())
- continue;
+ Player* p = ObjectAccessor::FindPlayer(itr->first);
+ if (!p || !p->GetSession())
+ continue;
- if (itr->second == PASS)
- SendLootRoll(newitemGUID, p->GetGUID(), 128, ROLL_PASS, *r);
- }
+ if (itr->second == PASS)
+ SendLootRoll(newitemGUID, p->GetGUID(), 128, ROLL_PASS, *r);
+ else
+ SendLootStartRollToPlayer(60000, lootedObject->GetMapId(), p, p->CanRollForItemInLFG(item, lootedObject) == EQUIP_ERR_OK, *r);
}
- SendLootStartRoll(60000, pLootedObject->GetMapId(), *r);
-
RollId.push_back(r);
- if (Creature* creature = pLootedObject->ToCreature())
+ if (Creature* creature = lootedObject->ToCreature())
{
creature->m_groupLootTimer = 60000;
creature->lootingGroupLowGUID = GetLowGUID();
}
+ else if (GameObject* go = lootedObject->ToGameObject())
+ {
+ go->m_groupLootTimer = 60000;
+ go->lootingGroupLowGUID = GetLowGUID();
+ }
}
else
delete r;
@@ -1242,9 +1295,7 @@ void Group::SendTargetIconList(WorldSession* session)
void Group::SendUpdate()
{
for (member_witerator witr = m_memberSlots.begin(); witr != m_memberSlots.end(); ++witr)
- {
SendUpdateToPlayer(witr->guid, &(*witr));
- }
}
void Group::SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot)
@@ -1380,7 +1431,7 @@ bool Group::_setMembersGroup(uint64 guid, uint8 group)
if (!isBGGroup())
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_GROUP_MEMBER_SUBGROUP);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP);
stmt->setUInt8(0, group);
stmt->setUInt32(1, GUID_LOPART(guid));
@@ -1431,7 +1482,7 @@ void Group::ChangeMembersGroup(uint64 guid, uint8 group)
// Preserve new sub group in database for non-raid groups
if (!isBGGroup())
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_GROUP_MEMBER_SUBGROUP);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP);
stmt->setUInt8(0, group);
stmt->setUInt32(1, GUID_LOPART(guid));
@@ -1626,7 +1677,7 @@ void Group::SetDungeonDifficulty(Difficulty difficulty)
m_dungeonDifficulty = difficulty;
if (!isBGGroup())
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_GROUP_DIFFICULTY);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_DIFFICULTY);
stmt->setUInt8(0, uint8(m_dungeonDifficulty));
stmt->setUInt32(1, m_dbStoreId);
@@ -1650,7 +1701,7 @@ void Group::SetRaidDifficulty(Difficulty difficulty)
m_raidDifficulty = difficulty;
if (!isBGGroup())
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_GROUP_RAID_DIFFICULTY);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_RAID_DIFFICULTY);
stmt->setUInt8(0, uint8(m_raidDifficulty));
stmt->setUInt32(1, m_dbStoreId);
@@ -1805,7 +1856,7 @@ InstanceGroupBind* Group::BindToInstance(InstanceSave* save, bool permanent, boo
InstanceGroupBind& bind = m_boundInstances[save->GetDifficulty()][save->GetMapId()];
if (!load && (!bind.save || permanent != bind.perm || save != bind.save))
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GROUP_INSTANCE);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GROUP_INSTANCE);
stmt->setUInt32(0, m_dbStoreId);
stmt->setUInt32(1, save->GetInstanceId());
@@ -2073,7 +2124,7 @@ void Group::SetGroupMemberFlag(uint64 guid, bool apply, GroupMemberFlags flag)
ToggleGroupMemberFlag(slot, flag, apply);
// Preserve the new setting in the db
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_GROUP_MEMBER_FLAG);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_FLAG);
stmt->setUInt8(0, slot->flags);
stmt->setUInt32(0, GUID_LOPART(guid));
@@ -2118,8 +2169,19 @@ void Group::LinkMember(GroupReference* pRef)
m_memberMgr.insertFirst(pRef);
}
-void Group::DelinkMember(GroupReference* /*pRef*/) const
+void Group::DelinkMember(uint64 guid)
{
+ GroupReference* ref = m_memberMgr.getFirst();
+ while (ref)
+ {
+ GroupReference* nextRef = ref->next();
+ if (ref->getSource()->GetGUID() == guid)
+ {
+ ref->unlink();
+ break;
+ }
+ ref = nextRef;
+ }
}
Group::BoundInstancesMap& Group::GetBoundInstances(Difficulty difficulty)
diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h
index c51aa6dd7bf..03f946cd3b6 100755
--- a/src/server/game/Groups/Group.h
+++ b/src/server/game/Groups/Group.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,6 +273,7 @@ class Group
bool isRollLootActive() const;
void SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll &r);
+ void SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, bool canNeed, Roll const& r);
void SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);
void SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);
void SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r);
@@ -289,7 +290,7 @@ class Group
void ResetMaxEnchantingLevel();
void LinkMember(GroupReference* pRef);
- void DelinkMember(GroupReference* /*pRef*/) const;
+ void DelinkMember(uint64 guid);
InstanceGroupBind* BindToInstance(InstanceSave* save, bool permanent, bool load = false);
void UnbindInstance(uint32 mapid, uint8 difficulty, bool unload = false);
diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp
index 33c0734d0b3..ae400852c73 100644
--- a/src/server/game/Groups/GroupMgr.cpp
+++ b/src/server/game/Groups/GroupMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -119,10 +119,10 @@ void GroupMgr::LoadGroups()
// Delete all groups with less than 2 members
CharacterDatabase.DirectExecute("DELETE FROM groups WHERE guid NOT IN (SELECT guid FROM group_member GROUP BY guid HAVING COUNT(guid) > 1)");
- // 0 1 2 3 4 5 6 7 8 9
- QueryResult result = CharacterDatabase.PQuery("SELECT leaderGuid, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6"
- // 10 11 12 13 14 15
- ", icon7, icon8, groupType, difficulty, raiddifficulty, guid FROM groups ORDER BY guid ASC");
+ // 0 1 2 3 4 5 6 7 8 9
+ QueryResult result = CharacterDatabase.PQuery("SELECT g.leaderGuid, g.lootMethod, g.looterGuid, g.lootThreshold, g.icon1, g.icon2, g.icon3, g.icon4, g.icon5, g.icon6"
+ // 10 11 12 13 14 15 16 17
+ ", g.icon7, g.icon8, g.groupType, g.difficulty, g.raiddifficulty, g.guid, lfg.dungeon, lfg.state FROM groups g LEFT JOIN lfg_data lfg ON lfg.guid = g.guid ORDER BY g.guid ASC");
if (!result)
{
sLog->outString(">> Loaded 0 group definitions. DB table `groups` is empty!");
diff --git a/src/server/game/Groups/GroupMgr.h b/src/server/game/Groups/GroupMgr.h
index aa74112ad35..ba706687441 100644
--- a/src/server/game/Groups/GroupMgr.h
+++ b/src/server/game/Groups/GroupMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 01cc85d6d6e..9bcc05f8724 100755
--- a/src/server/game/Groups/GroupRefManager.h
+++ b/src/server/game/Groups/GroupRefManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 2c03020a4fc..68d85c5bce9 100755
--- a/src/server/game/Groups/GroupReference.cpp
+++ b/src/server/game/Groups/GroupReference.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,12 +28,12 @@ void GroupReference::targetObjectBuildLink()
void GroupReference::targetObjectDestroyLink()
{
// called from unlink()
- getTarget()->DelinkMember(this);
+ //getTarget()->DelinkMember(this);
}
void GroupReference::sourceObjectDestroyLink()
{
// called from invalidate()
- getTarget()->DelinkMember(this);
+ //getTarget()->DelinkMember(this);
}
diff --git a/src/server/game/Groups/GroupReference.h b/src/server/game/Groups/GroupReference.h
index 2f5ad755443..2048fd9cb0d 100755
--- a/src/server/game/Groups/GroupReference.h
+++ b/src/server/game/Groups/GroupReference.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 94fcbbdda25..5691dcab862 100755
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -128,7 +128,7 @@ void Guild::EventLogEntry::SaveToDB(SQLTransaction& trans) const
CharacterDatabase.ExecuteOrAppend(trans, stmt);
uint8 index = 0;
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GUILD_EVENTLOG);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_EVENTLOG);
stmt->setUInt32( index, m_guildId);
stmt->setUInt32(++index, m_guid);
stmt->setUInt8 (++index, uint8(m_eventType));
@@ -169,7 +169,7 @@ void Guild::BankEventLogEntry::SaveToDB(SQLTransaction& trans) const
CharacterDatabase.ExecuteOrAppend(trans, stmt);
index = 0;
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GUILD_BANK_EVENTLOG);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_EVENTLOG);
stmt->setUInt32( index, m_guildId);
stmt->setUInt32(++index, m_guid);
stmt->setUInt8 (++index, m_bankTabId);
@@ -212,7 +212,7 @@ void Guild::RankInfo::LoadFromDB(Field* fields)
void Guild::RankInfo::SaveToDB(SQLTransaction& trans) const
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GUILD_RANK);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_RANK);
stmt->setUInt32(0, m_guildId);
stmt->setUInt8 (1, m_rankId);
stmt->setString(2, m_name);
@@ -238,7 +238,7 @@ void Guild::RankInfo::SetName(const std::string& name)
m_name = name;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_RANK_NAME);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_RANK_NAME);
stmt->setString(0, m_name);
stmt->setUInt8 (1, m_rankId);
stmt->setUInt32(2, m_guildId);
@@ -255,7 +255,7 @@ void Guild::RankInfo::SetRights(uint32 rights)
m_rights = rights;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_RANK_RIGHTS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_RANK_RIGHTS);
stmt->setUInt32(0, m_rights);
stmt->setUInt8 (1, m_rankId);
stmt->setUInt32(2, m_guildId);
@@ -273,13 +273,13 @@ void Guild::RankInfo::SetBankMoneyPerDay(uint32 money)
m_bankMoneyPerDay = money;
PreparedStatement* stmt = NULL;
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_RANK_BANK_MONEY);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_RANK_BANK_MONEY);
stmt->setUInt32(0, money);
stmt->setUInt8 (1, m_rankId);
stmt->setUInt32(2, m_guildId);
CharacterDatabase.Execute(stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_RESET_GUILD_RANK_BANK_RESET_TIME);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_RANK_BANK_RESET_TIME);
stmt->setUInt32(0, m_guildId);
stmt->setUInt8 (1, m_rankId);
CharacterDatabase.Execute(stmt);
@@ -305,7 +305,7 @@ void Guild::RankInfo::SetBankTabSlotsAndRights(uint8 tabId, GuildBankRightsAndSl
stmt->setUInt8 (2, m_rankId);
CharacterDatabase.Execute(stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GUILD_BANK_RIGHT);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_RIGHT);
stmt->setUInt32(0, m_guildId);
stmt->setUInt8 (1, tabId);
stmt->setUInt8 (2, m_rankId);
@@ -313,7 +313,7 @@ void Guild::RankInfo::SetBankTabSlotsAndRights(uint8 tabId, GuildBankRightsAndSl
stmt->setUInt32(4, m_bankTabRightsAndSlots[tabId].slots);
CharacterDatabase.Execute(stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_RESET_GUILD_RANK_BANK_TIME0 + tabId);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_RANK_BANK_TIME0 + tabId);
stmt->setUInt32(0, m_guildId);
stmt->setUInt8 (1, m_rankId);
CharacterDatabase.Execute(stmt);
@@ -432,7 +432,7 @@ void Guild::BankTab::SetInfo(const std::string& name, const std::string& icon)
m_name = name;
m_icon = icon;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_BANK_TAB_INFO);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_BANK_TAB_INFO);
stmt->setString(0, m_name);
stmt->setString(1, m_icon);
stmt->setUInt32(2, m_guildId);
@@ -448,7 +448,7 @@ void Guild::BankTab::SetText(const std::string& text)
m_text = text;
utf8truncate(m_text, MAX_GUILD_BANK_TAB_TEXT_LEN); // DB and client size limitation
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_BANK_TAB_TEXT);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_BANK_TAB_TEXT);
stmt->setString(0, m_text);
stmt->setUInt32(1, m_guildId);
stmt->setUInt8 (2, m_tabId);
@@ -474,7 +474,7 @@ bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem)
if (pItem)
{
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GUILD_BANK_ITEM);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_ITEM);
stmt->setUInt32(0, m_guildId);
stmt->setUInt8 (1, m_tabId);
stmt->setUInt8 (2, slotId);
@@ -528,7 +528,7 @@ void Guild::Member::SetPublicNote(const std::string& publicNote)
m_publicNote = publicNote;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_MEMBER_PNOTE);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_PNOTE);
stmt->setString(0, publicNote);
stmt->setUInt32(1, GUID_LOPART(m_guid));
CharacterDatabase.Execute(stmt);
@@ -541,7 +541,7 @@ void Guild::Member::SetOfficerNote(const std::string& officerNote)
m_officerNote = officerNote;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_MEMBER_OFFNOTE);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_OFFNOTE);
stmt->setString(0, officerNote);
stmt->setUInt32(1, GUID_LOPART(m_guid));
CharacterDatabase.Execute(stmt);
@@ -555,7 +555,7 @@ void Guild::Member::ChangeRank(uint8 newRank)
if (Player* player = FindPlayer())
player->SetRank(newRank);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_MEMBER_RANK);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_RANK);
stmt->setUInt8 (0, newRank);
stmt->setUInt32(1, GUID_LOPART(m_guid));
CharacterDatabase.Execute(stmt);
@@ -563,7 +563,7 @@ void Guild::Member::ChangeRank(uint8 newRank)
void Guild::Member::SaveToDB(SQLTransaction& trans) const
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GUILD_MEMBER);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_MEMBER);
stmt->setUInt32(0, m_guildId);
stmt->setUInt32(1, GUID_LOPART(m_guid));
stmt->setUInt8 (2, m_rankId);
@@ -659,8 +659,8 @@ void Guild::Member::DecreaseBankRemainingValue(SQLTransaction& trans, uint8 tabI
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(
tabId == GUILD_BANK_MAX_TABS ?
- CHAR_SET_GUILD_MEMBER_BANK_REM_MONEY :
- CHAR_SET_GUILD_MEMBER_BANK_REM_SLOTS0 + tabId);
+ CHAR_UPD_GUILD_MEMBER_BANK_REM_MONEY :
+ CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS0 + tabId);
stmt->setUInt32(0, m_bankRemaining[tabId].value);
stmt->setUInt32(1, m_guildId);
stmt->setUInt32(2, GUID_LOPART(m_guid));
@@ -693,8 +693,8 @@ uint32 Guild::Member::GetBankRemainingValue(uint8 tabId, const Guild* guild) con
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(
tabId == GUILD_BANK_MAX_TABS ?
- CHAR_SET_GUILD_MEMBER_BANK_TIME_MONEY :
- CHAR_SET_GUILD_MEMBER_BANK_TIME_REM_SLOTS0 + tabId);
+ CHAR_UPD_GUILD_MEMBER_BANK_TIME_MONEY :
+ CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS0 + tabId);
stmt->setUInt32(0, m_bankRemaining[tabId].resetTime);
stmt->setUInt32(1, m_bankRemaining[tabId].value);
stmt->setUInt32(2, m_guildId);
@@ -737,7 +737,7 @@ void EmblemInfo::WritePacket(WorldPacket& data) const
void EmblemInfo::SaveToDB(uint32 guildId) const
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_EMBLEM_INFO);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_EMBLEM_INFO);
stmt->setUInt32(0, m_style);
stmt->setUInt32(1, m_color);
stmt->setUInt32(2, m_borderStyle);
@@ -1121,7 +1121,7 @@ bool Guild::Create(Player* pLeader, const std::string& name)
trans->Append(stmt);
uint8 index = 0;
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GUILD);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD);
stmt->setUInt32( index, m_id);
stmt->setString(++index, name);
stmt->setUInt32(++index, GUID_LOPART(m_leaderGuid));
@@ -1259,7 +1259,7 @@ void Guild::HandleSetMOTD(WorldSession* session, const std::string& motd)
sScriptMgr->OnGuildMOTDChanged(this, motd);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_MOTD);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MOTD);
stmt->setString(0, motd);
stmt->setUInt32(1, m_id);
CharacterDatabase.Execute(stmt);
@@ -1282,7 +1282,7 @@ void Guild::HandleSetInfo(WorldSession* session, const std::string& info)
sScriptMgr->OnGuildInfoChanged(this, info);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_INFO);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_INFO);
stmt->setString(0, info);
stmt->setUInt32(1, m_id);
CharacterDatabase.Execute(stmt);
@@ -2094,7 +2094,7 @@ bool Guild::AddMember(uint64 guid, uint8 rankId)
{
bool ok = false;
// Player must exist
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_CHAR_DATA_FOR_GUILD);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DATA_FOR_GUILD);
stmt->setUInt32(0, lowguid);
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
{
@@ -2266,7 +2266,7 @@ bool Guild::_CreateNewBankTab()
stmt->setUInt8 (1, tabId);
trans->Append(stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GUILD_BANK_TAB);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_TAB);
stmt->setUInt32(0, m_id);
stmt->setUInt8 (1, tabId);
trans->Append(stmt);
@@ -2309,7 +2309,7 @@ void Guild::_CreateRank(const std::string& name, uint32 rights)
for (uint8 i = 0; i < _GetPurchasedTabsSize(); ++i)
{
// Create bank rights with default values
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GUILD_BANK_RIGHT_DEFAULT);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_RIGHT_DEFAULT);
stmt->setUInt32(0, m_id);
stmt->setUInt8 (1, i);
stmt->setUInt8 (2, newRankId);
@@ -2366,7 +2366,7 @@ bool Guild::_ModifyBankMoney(SQLTransaction& trans, uint64 amount, bool add)
m_bankMoney -= amount;
}
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_BANK_MONEY);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_BANK_MONEY);
stmt->setUInt64(0, m_bankMoney);
stmt->setUInt32(1, m_id);
trans->Append(stmt);
@@ -2381,7 +2381,7 @@ void Guild::_SetLeaderGUID(Member* pLeader)
m_leaderGuid = pLeader->GetGUID();
pLeader->ChangeRank(GR_GUILDMASTER);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_LEADER);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_LEADER);
stmt->setUInt32(0, GUID_LOPART(m_leaderGuid));
stmt->setUInt32(1, m_id);
CharacterDatabase.Execute(stmt);
diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h
index 3ac2b0a490d..e18e62e51b7 100755
--- a/src/server/game/Guilds/Guild.h
+++ b/src/server/game/Guilds/Guild.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp
index 8eac07918de..67260daf638 100644
--- a/src/server/game/Guilds/GuildMgr.cpp
+++ b/src/server/game/Guilds/GuildMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 e53c46cb6be..9654fced227 100644
--- a/src/server/game/Guilds/GuildMgr.h
+++ b/src/server/game/Guilds/GuildMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/Handlers/AddonHandler.cpp b/src/server/game/Handlers/AddonHandler.cpp
index c7299eb0caa..ef537cb6198 100755
--- a/src/server/game/Server/Protocol/Handlers/AddonHandler.cpp
+++ b/src/server/game/Handlers/AddonHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Handlers/AddonHandler.h b/src/server/game/Handlers/AddonHandler.h
index fe8fc6d631c..36cb19e5698 100755
--- a/src/server/game/Server/Protocol/Handlers/AddonHandler.h
+++ b/src/server/game/Handlers/AddonHandler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Handlers/ArenaTeamHandler.cpp b/src/server/game/Handlers/ArenaTeamHandler.cpp
index 095f8396dd7..8fb820713ce 100755
--- a/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp
+++ b/src/server/game/Handlers/ArenaTeamHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp
index 1710a387307..8a98b038efd 100755
--- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp
+++ b/src/server/game/Handlers/AuctionHouseHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -46,7 +46,7 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
SendAuctionHello(guid, unit);
@@ -101,14 +101,14 @@ void WorldSession::SendAuctionBidderNotification(uint32 location, uint32 auction
//this void causes on client to display: "Your auction sold"
void WorldSession::SendAuctionOwnerNotification(AuctionEntry* auction)
{
- WorldPacket data(SMSG_AUCTION_OWNER_NOTIFICATION, (7*4));
- data << auction->Id;
- data << auction->bid;
- data << (uint32) 0; //unk
- data << (uint32) 0; //unk
- data << (uint32) 0; //unk
- data << auction->item_template;
- data << (uint32) 0; //unk
+ WorldPacket data(SMSG_AUCTION_OWNER_NOTIFICATION, (8*4));
+ data << uint32(auction->Id);
+ data << uint32(auction->bid);
+ data << uint32(0); //unk
+ data << uint64(0); //unk (bidder guid?)
+ data << uint32(auction->item_template);
+ data << uint32(0); //unk
+ data << float(0); //unk (time?)
SendPacket(&data);
}
@@ -161,7 +161,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
Item* it = player->GetItemByGuid(item);
@@ -274,7 +274,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
@@ -394,7 +394,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
@@ -482,7 +482,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
@@ -531,7 +531,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
@@ -586,7 +586,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
diff --git a/src/server/game/Server/Protocol/Handlers/AuthHandler.cpp b/src/server/game/Handlers/AuthHandler.cpp
index d85f3e24aff..9a3e756dda3 100755
--- a/src/server/game/Server/Protocol/Handlers/AuthHandler.cpp
+++ b/src/server/game/Handlers/AuthHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp
index 95327a71374..d1aa0021a75 100755
--- a/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp
+++ b/src/server/game/Handlers/BattleGroundHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp
index 4c6ec6571a4..be547c84b19 100755
--- a/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp
+++ b/src/server/game/Handlers/CalendarHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Handlers/ChannelHandler.cpp b/src/server/game/Handlers/ChannelHandler.cpp
index d08e7d9f930..9b749fa8005 100755
--- a/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp
+++ b/src/server/game/Handlers/ChannelHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index 2a4e1c50ac5..0094c20d927 100755..100644
--- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,7 @@
#include "ScriptMgr.h"
#include "Battleground.h"
#include "AccountMgr.h"
+#include "LFGMgr.h"
class LoginQueryHolder : public SQLQueryHolder
{
@@ -65,134 +66,138 @@ bool LoginQueryHolder::Initialize()
uint32 lowGuid = GUID_LOPART(m_guid);
PreparedStatement* stmt = NULL;
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADFROM, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_GROUP);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADGROUP, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_BOUNDINSTANCES);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_INSTANCE);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_AURAS);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AURAS);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADAURAS, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_SPELLS);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SPELL);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADSPELLS, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_QUESTSTATUS);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_QUESTSTATUS);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADQUESTSTATUS, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_DAILYQUESTSTATUS);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_DAILYQUESTSTATUS);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADDAILYQUESTSTATUS, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_WEKLYQUESTSTATUS);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_WEEKLYQUESTSTATUS);
stmt->setUInt32(0, lowGuid);
- res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADWEKLYQUESTSTATUS, stmt);
+ res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADWEEKLYQUESTSTATUS, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_REPUTATION);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SEASONALQUESTSTATUS);
+ stmt->setUInt32(0, lowGuid);
+ res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADSEASONALQUESTSTATUS, stmt);
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_REPUTATION);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADREPUTATION, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_INVENTORY);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_INVENTORY);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADINVENTORY, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_ACTIONS);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ACTIONS);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADACTIONS, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_MAILCOUNT);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_MAILCOUNT);
stmt->setUInt32(0, lowGuid);
stmt->setUInt64(1, uint64(time(NULL)));
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADMAILCOUNT, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_MAILDATE);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_MAILDATE);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADMAILDATE, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_SOCIALLIST);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SOCIALLIST);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADSOCIALLIST, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_HOMEBIND);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_HOMEBIND);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADHOMEBIND, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_SPELLCOOLDOWNS);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SPELLCOOLDOWNS);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADSPELLCOOLDOWNS, stmt);
if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED))
{
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_DECLINEDNAMES);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_DECLINEDNAMES);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADDECLINEDNAMES, stmt);
}
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_GUILD);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADGUILD, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_ARENAINFO);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ARENAINFO);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADARENAINFO, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_ACHIEVEMENTS);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ACHIEVEMENTS);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADACHIEVEMENTS, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_CRITERIAPROGRESS);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_CRITERIAPROGRESS);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADCRITERIAPROGRESS, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_EQUIPMENTSETS);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_EQUIPMENTSETS);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADEQUIPMENTSETS, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_BGDATA);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_BGDATA);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADBGDATA, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_GLYPHS);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_GLYPHS);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADGLYPHS, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_TALENTS);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_TALENTS);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADTALENTS, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_ACCOUNT_DATA);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PLAYER_ACCOUNT_DATA);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADACCOUNTDATA, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_SKILLS);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_SKILLS);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADSKILLS, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_RANDOMBG);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_RANDOMBG);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADRANDOMBG, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_BANNED);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_BANNED);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADBANNED, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_QUESTSTATUSREW);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_QUESTSTATUSREW);
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADQUESTSTATUSREW, stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_ACCOUNT_INSTANCELOCKTIMES);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_INSTANCELOCKTIMES);
stmt->setUInt32(0, m_accountId);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES, stmt);
-
+
return res;
}
@@ -234,9 +239,9 @@ void WorldSession::HandleCharEnumOpcode(WorldPacket & /*recv_data*/)
/// get all the data necessary for loading all characters (along with their pets) on the account
if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED))
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_ENUM_DECLINED_NAME);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ENUM_DECLINED_NAME);
else
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_ENUM);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ENUM);
stmt->setUInt8(0, PET_SAVE_AS_CURRENT);
stmt->setUInt32(1, GetAccountId());
@@ -383,7 +388,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
delete _charCreateCallback.GetParam(); // Delete existing if any, to make the callback chain reset to stage 0
_charCreateCallback.SetParam(new CharacterCreateInfo(name, race_, class_, gender, skin, face, hairStyle, hairColor, facialHair, outfitId, recv_data));
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_CHECK_NAME);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
stmt->setString(0, name);
_charCreateCallback.SetFutureResult(CharacterDatabase.AsyncQuery(stmt));
}
@@ -410,7 +415,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
ASSERT(_charCreateCallback.GetParam() == createInfo);
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_SUM_REALMCHARS);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_SUM_REALM_CHARACTERS);
stmt->setUInt32(0, GetAccountId());
_charCreateCallback.FreeResult();
@@ -443,7 +448,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
ASSERT(_charCreateCallback.GetParam() == createInfo);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_SUM_CHARS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SUM_CHARS);
stmt->setUInt32(0, GetAccountId());
_charCreateCallback.FreeResult();
@@ -476,7 +481,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
if (!allowTwoSideAccounts || skipCinematics == 1 || createInfo->Class == CLASS_DEATH_KNIGHT)
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_CHAR_CREATE_INFO);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_CREATE_INFO);
stmt->setUInt32(0, GetAccountId());
stmt->setUInt32(1, (skipCinematics == 1 || createInfo->Class == CLASS_DEATH_KNIGHT) ? 10 : 1);
_charCreateCallback.SetFutureResult(CharacterDatabase.AsyncQuery(stmt));
@@ -634,12 +639,12 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
SQLTransaction trans = LoginDatabase.BeginTransaction();
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALMCHARACTERS);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS);
stmt->setUInt32(0, GetAccountId());
stmt->setUInt32(1, realmID);
trans->Append(stmt);
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_ADD_REALMCHARACTERS);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_REALM_CHARACTERS);
stmt->setUInt32(0, createInfo->CharCount);
stmt->setUInt32(1, GetAccountId());
stmt->setUInt32(2, realmID);
@@ -772,6 +777,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
// "GetAccountId() == db stored account id" checked in LoadFromDB (prevent login not own character using cheating tools)
if (!pCurrChar->LoadFromDB(GUID_LOPART(playerGuid), holder))
{
+ SetPlayer(NULL);
KickPlayer(); // disconnect client, player no set to session and it will not deleted or saved at kick
delete pCurrChar; // delete it manually
delete holder; // delete all unprocessed queries
@@ -780,9 +786,6 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
}
pCurrChar->GetMotionMaster()->Initialize();
-
- SetPlayer(pCurrChar);
-
pCurrChar->SendDungeonDifficulty(false);
WorldPacket data(SMSG_LOGIN_VERIFY_WORLD, 20);
@@ -890,6 +893,17 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
}
}
+ if (Group* group = pCurrChar->GetGroup())
+ {
+ if (group->isLFGGroup())
+ {
+ LfgDungeonSet Dungeons;
+ Dungeons.insert(sLFGMgr->GetDungeon(group->GetGUID()));
+ sLFGMgr->SetSelectedDungeons(pCurrChar->GetGUID(), Dungeons);
+ sLFGMgr->SetState(pCurrChar->GetGUID(), sLFGMgr->GetState(group->GetGUID()));
+ }
+ }
+
if (!pCurrChar->GetMap()->AddPlayerToMap(pCurrChar) || !pCurrChar->CheckInstanceLoginValid())
{
AreaTrigger const* at = sObjectMgr->GetGoBackTrigger(pCurrChar->GetMapId());
@@ -904,8 +918,18 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
pCurrChar->SendInitialPacketsAfterAddToMap();
- CharacterDatabase.PExecute("UPDATE characters SET online = 1 WHERE guid = '%u'", pCurrChar->GetGUIDLow());
- LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = '%u'", GetAccountId());
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ONLINE);
+
+ stmt->setUInt32(0, pCurrChar->GetGUIDLow());
+
+ CharacterDatabase.Execute(stmt);
+
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_ONLINE);
+
+ stmt->setUInt32(0, GetAccountId());
+
+ LoginDatabase.Execute(stmt);
+
pCurrChar->SetInGameTime(getMSTime());
// announce group about member online (must be after add to player list to receive announce to self)
@@ -980,7 +1004,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
sLog->outChar("Account: %d (IP: %s) Login Character:[%s] (GUID: %u)",
GetAccountId(), IP_str.c_str(), pCurrChar->GetName(), pCurrChar->GetGUIDLow());
- if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STAT_STUNNED))
+ if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STATE_STUNNED))
pCurrChar->SetStandState(UNIT_STAND_STATE_STAND);
m_playerLoading = false;
@@ -1108,7 +1132,7 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data)
// and that there is no character with the desired new name
_charRenameCallback.SetParam(newName);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_FREE_NAME);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_FREE_NAME);
stmt->setUInt32(0, GUID_LOPART(guid));
stmt->setUInt32(1, GetAccountId());
@@ -1137,7 +1161,7 @@ void WorldSession::HandleChangePlayerNameOpcodeCallBack(PreparedQueryResult resu
uint64 guid = MAKE_NEW_GUID(guidLow, 0, HIGHGUID_PLAYER);
// Update name and at_login flag in the db
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_NAME);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_NAME);
stmt->setString(0, newName);
stmt->setUInt16(1, AT_LOGIN_RENAME);
@@ -1330,10 +1354,10 @@ void WorldSession::HandleRemoveGlyph(WorldPacket & recv_data)
void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
{
uint64 guid;
- std::string newname;
+ std::string newName;
recv_data >> guid;
- recv_data >> newname;
+ recv_data >> newName;
uint8 gender, skin, face, hairStyle, hairColor, facialHair;
recv_data >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face;
@@ -1359,7 +1383,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
}
// prevent character rename to invalid name
- if (!normalizePlayerName(newname))
+ if (!normalizePlayerName(newName))
{
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
data << uint8(CHAR_NAME_NO_NAME);
@@ -1367,7 +1391,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
return;
}
- uint8 res = ObjectMgr::CheckPlayerName(newname, true);
+ uint8 res = ObjectMgr::CheckPlayerName(newName, true);
if (res != CHAR_NAME_SUCCESS)
{
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
@@ -1377,7 +1401,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
}
// check name limitations
- if (AccountMgr::IsPlayerAccount(GetSecurity()) && sObjectMgr->IsReservedName(newname))
+ if (AccountMgr::IsPlayerAccount(GetSecurity()) && sObjectMgr->IsReservedName(newName))
{
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
data << uint8(CHAR_NAME_RESERVED);
@@ -1386,7 +1410,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
}
// character with this name already exist
- if (uint64 newguid = sObjectMgr->GetPlayerGUIDByName(newname))
+ if (uint64 newguid = sObjectMgr->GetPlayerGUIDByName(newName))
{
if (newguid != guid)
{
@@ -1397,22 +1421,34 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
}
}
- CharacterDatabase.EscapeString(newname);
if (QueryResult oldNameResult = CharacterDatabase.PQuery("SELECT name FROM characters WHERE guid ='%u'", GUID_LOPART(guid)))
{
std::string oldname = oldNameResult->Fetch()[0].GetString();
std::string IP_str = GetRemoteAddress();
- sLog->outChar("Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), IP_str.c_str(), oldname.c_str(), GUID_LOPART(guid), newname.c_str());
+ sLog->outChar("Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), IP_str.c_str(), oldname.c_str(), GUID_LOPART(guid), newName.c_str());
}
Player::Customize(guid, gender, skin, face, hairStyle, hairColor, facialHair);
- CharacterDatabase.PExecute("UPDATE characters set name = '%s', at_login = at_login & ~ %u WHERE guid ='%u'", newname.c_str(), uint32(AT_LOGIN_CUSTOMIZE), GUID_LOPART(guid));
- CharacterDatabase.PExecute("DELETE FROM character_declinedname WHERE guid ='%u'", GUID_LOPART(guid));
- sWorld->UpdateCharacterNameData(GUID_LOPART(guid), newname, gender);
- WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1+8+(newname.size()+1)+6);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_NAME_AT_LOGIN);
+
+ stmt->setString(0, newName);
+ stmt->setUInt16(1, uint16(AT_LOGIN_CUSTOMIZE));
+ stmt->setUInt32(2, GUID_LOPART(guid));
+
+ CharacterDatabase.Execute(stmt);
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_DECLINED_NAME);
+
+ stmt->setUInt32(0, GUID_LOPART(guid));
+
+ CharacterDatabase.Execute(stmt);
+
+ sWorld->UpdateCharacterNameData(GUID_LOPART(guid), newName, gender);
+
+ WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1+8+(newName.size()+1)+6);
data << uint8(RESPONSE_SUCCESS);
data << uint64(guid);
- data << newname;
+ data << newName;
data << uint8(gender);
data << uint8(skin);
data << uint8(face);
@@ -1774,7 +1810,9 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data)
if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD))
{
// Reset guild
- trans->PAppend("DELETE FROM `guild_member` WHERE `guid`= '%u'", lowGuid);
+ if (QueryResult result = CharacterDatabase.PQuery("SELECT guildid FROM `guild_member` WHERE guid ='%u'", lowGuid))
+ if (Guild* guild = sGuildMgr->GetGuildById((result->Fetch()[0]).GetUInt32()))
+ guild->DeleteMember(MAKE_NEW_GUID(lowGuid, 0, HIGHGUID_PLAYER));
}
if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND))
@@ -1792,7 +1830,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data)
stmt->setUInt32(0, lowGuid);
trans->Append(stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_PLAYER_HOMEBIND);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PLAYER_HOMEBIND);
stmt->setUInt32(0, lowGuid);
if (team == BG_TEAM_ALLIANCE)
{
diff --git a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp
index 852549b3f53..966eae598a6 100755
--- a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp
+++ b/src/server/game/Handlers/ChatHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -481,7 +481,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
void WorldSession::HandleEmoteOpcode(WorldPacket & recv_data)
{
- if (!GetPlayer()->isAlive() || GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (!GetPlayer()->isAlive() || GetPlayer()->HasUnitState(UNIT_STATE_DIED))
return;
uint32 emote;
@@ -558,7 +558,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data)
break;
default:
// Only allow text-emotes for "dead" entities (feign death included)
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
break;
GetPlayer()->HandleEmoteCommand(emote_anim);
break;
diff --git a/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp b/src/server/game/Handlers/CombatHandler.cpp
index e6c4499baab..6693cdfca27 100755
--- a/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp
+++ b/src/server/game/Handlers/CombatHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Handlers/DuelHandler.cpp b/src/server/game/Handlers/DuelHandler.cpp
index b1e6f3fdc3f..8afd9f3b978 100755
--- a/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp
+++ b/src/server/game/Handlers/DuelHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp
index 65865280459..9343a5356b6 100755
--- a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp
+++ b/src/server/game/Handlers/GroupHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp
index 7e964b4faf6..9115f8f0f1e 100755
--- a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp
+++ b/src/server/game/Handlers/GuildHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -303,7 +303,7 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
if (GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_TABARDDESIGNER))
{
// Remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if (Guild* guild = _GetPlayerGuild(this))
diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index 4d323996de7..802597e14eb 100755
--- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -503,7 +503,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
Item* pItem = _player->GetItemByGuid(itemguid);
@@ -614,7 +614,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
Item* pItem = _player->GetItemFromBuyBackSlot(slot);
@@ -732,11 +732,11 @@ void WorldSession::SendListInventory(uint64 vendorGuid)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// Stop the npc if moving
- if (vendor->HasUnitState(UNIT_STAT_MOVING))
+ if (vendor->HasUnitState(UNIT_STATE_MOVING))
vendor->StopMoving();
VendorItemData const* items = vendor->GetVendorItems();
diff --git a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp
index 3df59b9bba1..3c6bd28b5cb 100755
--- a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp
+++ b/src/server/game/Handlers/LFGHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,8 @@ void BuildPartyLockDungeonBlock(WorldPacket& data, const LfgLockPartyMap& lockMa
void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data)
{
if (!sWorld->getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE) ||
- (GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->GetLeaderGUID() != GetPlayer()->GetGUID()))
+ (GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->GetLeaderGUID() != GetPlayer()->GetGUID() &&
+ (GetPlayer()->GetGroup()->GetMembersCount() == MAXGROUPSIZE || !GetPlayer()->GetGroup()->isLFGGroup())))
{
recv_data.rfinish();
return;
diff --git a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp
index 05b4afc99e7..6508f08dc22 100755
--- a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp
+++ b/src/server/game/Handlers/LootHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -324,7 +324,7 @@ void WorldSession::DoLootRelease(uint64 lguid)
else
{
// not fully looted object
- go->SetLootState(GO_ACTIVATED);
+ go->SetLootState(GO_ACTIVATED, player);
// if the round robin player release, reset it.
if (player->GetGUID() == loot->roundRobinPlayer)
diff --git a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp
index 2dee8e3ae15..a8522bb2582 100755
--- a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp
+++ b/src/server/game/Handlers/MailHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp
index 6b972f94dd5..f109332e235 100755
--- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp
+++ b/src/server/game/Handlers/MiscHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -122,7 +122,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if ((unit && unit->GetCreatureInfo()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID))
@@ -160,7 +160,8 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data)
else
{
go->AI()->GossipSelect(_player, menuId, gossipListId);
- sScriptMgr->OnGossipSelect(_player, go, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId));
+ if (!sScriptMgr->OnGossipSelect(_player, go, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId)))
+ _player->OnGossipSelect(go, gossipListId, menuId);
}
}
}
@@ -169,6 +170,11 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_WHO Message");
+ time_t now = time(NULL);
+ if (now - timeLastWhoCommand < 5)
+ return;
+ else timeLastWhoCommand = now;
+
uint32 matchcount = 0;
uint32 level_min, level_max, racemask, classmask, zones_count, str_count;
@@ -533,7 +539,7 @@ void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s asked to add friend : '%s'", GetPlayer()->GetName(), friendName.c_str());
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_GUID_RACE_ACC_BY_NAME);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_RACE_ACC_BY_NAME);
stmt->setString(0, friendName);
@@ -624,7 +630,7 @@ void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s asked to Ignore: '%s'",
GetPlayer()->GetName(), ignoreName.c_str());
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_GUID_BY_NAME);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME);
stmt->setString(0, ignoreName);
@@ -709,7 +715,7 @@ void WorldSession::HandleBugOpcode(WorldPacket & recv_data)
sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", type.c_str());
sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", content.c_str());
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_BUG_REPORT);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BUG_REPORT);
stmt->setString(0, type);
stmt->setString(1, content);
diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp
index ae2612e4ced..7d1233c8f70 100755
--- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp
+++ b/src/server/game/Handlers/MovementHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -472,22 +472,8 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data)
if (GetPlayer()->IsInWorld())
{
- if (Unit* mover = ObjectAccessor::GetUnit(*GetPlayer(), guid))
- {
- GetPlayer()->SetMover(mover);
- if (mover != GetPlayer() && mover->canFly())
- {
- WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12);
- data.append(mover->GetPackGUID());
- data << uint32(0);
- SendPacket(&data);
- }
- }
- else
- {
+ if (_player->m_mover->GetGUID() != guid)
sLog->outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " (%s - Entry: %u) and should be " UI64FMTD, guid, GetLogNameForGuid(guid), GUID_ENPART(guid), _player->m_mover->GetGUID());
- GetPlayer()->SetMover(GetPlayer());
- }
}
}
diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp
index 4162289f0ce..1f286a0af05 100755
--- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp
+++ b/src/server/game/Handlers/NPCHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
SendTabardVendorActivate(guid);
@@ -89,7 +89,7 @@ void WorldSession::HandleBankerActivateOpcode(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
SendShowBank(guid);
@@ -128,7 +128,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// trainer list loaded at check;
@@ -250,7 +250,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if (!unit->isCanTrainingOf(_player, true))
@@ -314,7 +314,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data)
GetPlayer()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
// remove fake death
- //if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ //if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
// GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if (unit->isArmorer() || unit->isCivilian() || unit->isQuestGiver() || unit->isServiceProvider() || unit->isGuard())
@@ -369,7 +369,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if (!code.empty())
@@ -400,7 +400,7 @@ void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
SendSpiritResurrect();
@@ -455,7 +455,7 @@ void WorldSession::HandleBinderActivateOpcode(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
SendBindPoint(unit);
@@ -470,7 +470,7 @@ void WorldSession::SendBindPoint(Creature* npc)
uint32 bindspell = 3286;
// update sql homebind
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_PLAYER_HOMEBIND);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PLAYER_HOMEBIND);
stmt->setUInt16(0, _player->GetMapId());
stmt->setUInt16(1, _player->GetAreaId());
stmt->setFloat (2, _player->GetPositionX());
@@ -507,7 +507,7 @@ void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recv_data)
return;
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// remove mounts this fix bug where getting pet from stable while mounted deletes pet.
@@ -519,7 +519,7 @@ void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recv_data)
void WorldSession::SendStablePet(uint64 guid)
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_PET_SLOTS_DETAIL);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SLOTS_DETAIL);
stmt->setUInt32(0, _player->GetGUIDLow());
stmt->setUInt8(1, PET_SAVE_FIRST_STABLE_SLOT);
@@ -609,7 +609,7 @@ void WorldSession::HandleStablePet(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
Pet* pet = _player->GetPet();
@@ -621,7 +621,7 @@ void WorldSession::HandleStablePet(WorldPacket & recv_data)
return;
}
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_PET_SLOTS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SLOTS);
stmt->setUInt32(0, _player->GetGUIDLow());
stmt->setUInt8(1, PET_SAVE_FIRST_STABLE_SLOT);
@@ -679,10 +679,10 @@ void WorldSession::HandleUnstablePet(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_PET_ENTRY);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_ENTRY);
stmt->setUInt32(0, _player->GetGUIDLow());
stmt->setUInt32(1, petnumber);
@@ -759,7 +759,7 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if (GetPlayer()->m_stableSlots < MAX_PET_STABLES)
@@ -798,7 +798,7 @@ void WorldSession::HandleStableSwapPet(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
Pet* pet = _player->GetPet();
@@ -811,7 +811,7 @@ void WorldSession::HandleStableSwapPet(WorldPacket & recv_data)
// Find swapped pet slot in stable
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_PET_SLOT_BY_ID);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SLOT_BY_ID);
stmt->setUInt32(0, _player->GetGUIDLow());
stmt->setUInt32(1, petId);
@@ -886,7 +886,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// reputation discount
diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.h b/src/server/game/Handlers/NPCHandler.h
index 2b14e0edc21..af84b71a74f 100755
--- a/src/server/game/Server/Protocol/Handlers/NPCHandler.h
+++ b/src/server/game/Handlers/NPCHandler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp
index 5a8781d3925..16b6a4bb714 100755
--- a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp
+++ b/src/server/game/Handlers/PetHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -155,6 +155,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
case COMMAND_STAY: //flat=1792 //STAY
pet->AttackStop();
pet->InterruptNonMeleeSpells(false);
+ pet->GetMotionMaster()->Clear(false);
pet->GetMotionMaster()->MoveIdle();
charmInfo->SetCommandState(COMMAND_STAY);
@@ -201,7 +202,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
return;
}
- pet->ClearUnitState(UNIT_STAT_FOLLOW);
+ pet->ClearUnitState(UNIT_STATE_FOLLOW);
// This is true if pet has no target or has target but targets differs.
if (pet->getVictim() != TargetUnit || (pet->getVictim() == TargetUnit && !pet->GetCharmInfo()->IsCommandAttack()))
{
@@ -776,7 +777,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
targets.Read(recvPacket, caster);
HandleClientCastFlags(recvPacket, castFlags, targets);
- caster->ClearUnitState(UNIT_STAT_FOLLOW);
+ caster->ClearUnitState(UNIT_STATE_FOLLOW);
Spell* spell = new Spell(caster, spellInfo, TRIGGERED_NONE);
spell->m_cast_count = castCount; // probably pending spell cast
diff --git a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp
index fed84728efd..b4c07811598 100755
--- a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp
+++ b/src/server/game/Handlers/PetitionsHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -98,7 +98,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
uint32 charterid = 0;
@@ -539,7 +539,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
return;
}
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_PETITION_SIGNATURE);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PETITION_SIGNATURE);
stmt->setUInt32(0, GUID_LOPART(ownerGuid));
stmt->setUInt32(1, GUID_LOPART(petitionGuid));
@@ -715,7 +715,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
uint32 type;
std::string name;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PETITION);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION);
stmt->setUInt32(0, GUID_LOPART(petitionGuid));
PreparedQueryResult result = CharacterDatabase.Query(stmt);
@@ -780,7 +780,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
// Get petition signatures from db
uint8 signatures;
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PETITION_SIGNATURE);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURE);
stmt->setUInt32(0, GUID_LOPART(petitionGuid));
result = CharacterDatabase.Query(stmt);
diff --git a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp
index 042b1242a95..5702eefffec 100755
--- a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp
+++ b/src/server/game/Handlers/QueryHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp
index e0bcadc89e9..f9aa40cdcda 100755
--- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp
+++ b/src/server/game/Handlers/QuestHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// Stop the npc if moving
creature->StopMoving();
diff --git a/src/server/game/Server/Protocol/Handlers/ReferAFriendHandler.cpp b/src/server/game/Handlers/ReferAFriendHandler.cpp
index 58d425ddf98..58d425ddf98 100644
--- a/src/server/game/Server/Protocol/Handlers/ReferAFriendHandler.cpp
+++ b/src/server/game/Handlers/ReferAFriendHandler.cpp
diff --git a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp
index 7e1ed01f9d3..355effba0c6 100755
--- a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp
+++ b/src/server/game/Handlers/SkillHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -68,7 +68,7 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if (!(_player->resetTalents()))
diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp
index ffe205304e3..b8908d0f9f9 100755
--- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp
+++ b/src/server/game/Handlers/SpellHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp
index fe6d3f02ffa..8eb1eab06d9 100755
--- a/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp
+++ b/src/server/game/Handlers/TaxiHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,7 +27,6 @@
#include "UpdateMask.h"
#include "Path.h"
#include "WaypointMovementGenerator.h"
-#include "DestinationHolderImp.h"
void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPacket & recv_data)
{
@@ -80,7 +79,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data)
}
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// unknown taxi node case
@@ -119,7 +118,7 @@ void WorldSession::SendTaxiMenu(Creature* unit)
void WorldSession::SendDoFlight(uint32 mountDisplayId, uint32 path, uint32 pathNode)
{
// remove fake death
- if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
while (GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE)
diff --git a/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp b/src/server/game/Handlers/TicketHandler.cpp
index ad883394270..a270d42b000 100755
--- a/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp
+++ b/src/server/game/Handlers/TicketHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,7 +137,7 @@ void WorldSession::HandleGMSurveySubmit(WorldPacket& recv_data)
std::string comment; // comment ("Usage: GMSurveyAnswerSubmit(question, rank, comment)")
recv_data >> comment;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GM_SUBSURVEY);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GM_SUBSURVEY);
stmt->setUInt32(0, nextSurveyID);
stmt->setUInt32(1, subSurveyId);
stmt->setUInt32(2, rank);
@@ -148,7 +148,7 @@ void WorldSession::HandleGMSurveySubmit(WorldPacket& recv_data)
std::string comment; // just a guess
recv_data >> comment;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GM_SURVEY);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GM_SURVEY);
stmt->setUInt32(0, GUID_LOPART(GetPlayer()->GetGUID()));
stmt->setUInt32(1, nextSurveyID);
stmt->setUInt32(2, mainSurvey);
@@ -169,7 +169,7 @@ void WorldSession::HandleReportLag(WorldPacket& recv_data)
recv_data >> y;
recv_data >> z;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_LAG_REPORT);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_LAG_REPORT);
stmt->setUInt32(0, GUID_LOPART(GetPlayer()->GetGUID()));
stmt->setUInt8 (1, lagType);
stmt->setUInt16(2, mapId);
diff --git a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp
index 865158e7860..4c39992f344 100755
--- a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp
+++ b/src/server/game/Handlers/TradeHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -561,7 +561,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
return;
}
- if (GetPlayer()->HasUnitState(UNIT_STAT_STUNNED))
+ if (GetPlayer()->HasUnitState(UNIT_STATE_STUNNED))
{
SendTradeStatus(TRADE_STATUS_YOU_STUNNED);
return;
@@ -611,7 +611,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
return;
}
- if (pOther->HasUnitState(UNIT_STAT_STUNNED))
+ if (pOther->HasUnitState(UNIT_STATE_STUNNED))
{
SendTradeStatus(TRADE_STATUS_TARGET_STUNNED);
return;
diff --git a/src/server/game/Server/Protocol/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp
index 256f8b327ff..ce4f6ccb8fe 100644
--- a/src/server/game/Server/Protocol/Handlers/VehicleHandler.cpp
+++ b/src/server/game/Handlers/VehicleHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/Handlers/VoiceChatHandler.cpp b/src/server/game/Handlers/VoiceChatHandler.cpp
index be8307b29b1..34ad5ac3eae 100755
--- a/src/server/game/Server/Protocol/Handlers/VoiceChatHandler.cpp
+++ b/src/server/game/Handlers/VoiceChatHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 9d5ffb6542a..722b7089a17 100755
--- a/src/server/game/Instances/InstanceSaveMgr.cpp
+++ b/src/server/game/Instances/InstanceSaveMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -139,7 +139,7 @@ void InstanceSaveManager::RemoveInstanceSave(uint32 InstanceId)
// save the resettime for normal instances only when they get unloaded
if (time_t resettime = itr->second->GetResetTimeForDB())
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_INSTANCE_RESETTIME);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_INSTANCE_RESETTIME);
stmt->setUInt32(0, uint32(resettime));
stmt->setUInt32(1, InstanceId);
@@ -184,7 +184,7 @@ void InstanceSave::SaveToDB()
}
}
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_INSTANCE_SAVE);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_INSTANCE_SAVE);
stmt->setUInt32(0, m_instanceid);
stmt->setUInt16(1, GetMapId());
stmt->setUInt32(2, uint32(GetResetTimeForDB()));
@@ -256,7 +256,7 @@ void InstanceSaveManager::LoadInstances()
CharacterDatabase.DirectExecute("DELETE tmp.* FROM group_instance AS tmp LEFT JOIN instance ON tmp.instance = instance.id WHERE tmp.instance > 0 AND instance.id IS NULL");
// Clean invalid references to instance
- CharacterDatabase.DirectExecute(CharacterDatabase.GetPreparedStatement(CHAR_RESET_NONEXISTENT_INSTANCE_FOR_CORPSES));
+ CharacterDatabase.DirectExecute(CharacterDatabase.GetPreparedStatement(CHAR_UPD_NONEXISTENT_INSTANCE_FOR_CORPSES));
CharacterDatabase.DirectExecute("UPDATE characters AS tmp LEFT JOIN instance ON tmp.instance_id = instance.id SET tmp.instance_id = 0 WHERE tmp.instance_id > 0 AND instance.id IS NULL");
// Initialize instance id storage (Needs to be done after the trash has been clean out)
@@ -316,7 +316,7 @@ void InstanceSaveManager::LoadResetTimes()
while (result->NextRow());
// update reset time for normal instances with the max creature respawn time + X hours
- if (PreparedQueryResult result2 = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_GET_MAX_CREATURE_RESPAWNS)))
+ if (PreparedQueryResult result2 = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAX_CREATURE_RESPAWNS)))
{
do
{
@@ -532,8 +532,8 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
if (iMap && iMap->IsDungeon())
((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY);
- else
- sObjectMgr->DeleteRespawnTimeForInstance(instanceId); // even if map is not loaded
+
+ sObjectMgr->DeleteRespawnTimeForInstance(instanceId); // even if map is not loaded
// Free up the instance id and allow it to be reused
sMapMgr->FreeInstanceId(instanceId);
@@ -586,7 +586,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
ScheduleReset(true, time_t(next_reset-3600), InstResetEvent(1, mapid, difficulty, 0));
// Update it in the DB
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_GLOBAL_INSTANCE_RESETTIME);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME);
stmt->setUInt32(0, next_reset);
stmt->setUInt16(1, uint16(mapid));
diff --git a/src/server/game/Instances/InstanceSaveMgr.h b/src/server/game/Instances/InstanceSaveMgr.h
index b4e97f40f87..83c2170255d 100755
--- a/src/server/game/Instances/InstanceSaveMgr.h
+++ b/src/server/game/Instances/InstanceSaveMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.cpp b/src/server/game/Instances/InstanceScript.cpp
index b8987be9adb..90fb8ffb9f0 100755
--- a/src/server/game/Instances/InstanceScript.cpp
+++ b/src/server/game/Instances/InstanceScript.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,7 +32,7 @@ void InstanceScript::SaveToDB()
if (data.empty())
return;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_INSTANCE_DATA);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_INSTANCE_DATA);
stmt->setUInt32(0, GetCompletedEncounterMask());
stmt->setString(1, data);
stmt->setUInt32(2, instance->GetInstanceId());
@@ -302,21 +302,21 @@ void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
}
// Send Notify to all players in instance
-void InstanceScript::DoSendNotifyToInstance(const char *format, ...)
+void InstanceScript::DoSendNotifyToInstance(char const* format, ...)
{
- InstanceMap::PlayerList const &PlayerList = instance->GetPlayers();
+ InstanceMap::PlayerList const& players = instance->GetPlayers();
- if (!PlayerList.isEmpty())
+ if (!players.isEmpty())
{
va_list ap;
va_start(ap, format);
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- {
- if (Player* player = i->getSource())
- if (WorldSession* pSession = player->GetSession())
- pSession->SendNotification(format, ap);
- }
+ char buff[1024];
+ vsnprintf(buff, 1024, format, ap);
va_end(ap);
+ for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
+ if (Player* player = i->getSource())
+ if (WorldSession* session = player->GetSession())
+ session->SendNotification(buff);
}
}
diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h
index 1751b7b3106..69f11c203c1 100755
--- a/src/server/game/Instances/InstanceScript.h
+++ b/src/server/game/Instances/InstanceScript.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index dd17e8277d6..c9e8f68af52 100755
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h
index 10ae786a7d6..4a6becc7eff 100755
--- a/src/server/game/Loot/LootMgr.h
+++ b/src/server/game/Loot/LootMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.cpp b/src/server/game/Mails/Mail.cpp
index e5de3e35956..3c3888eb9f8 100755
--- a/src/server/game/Mails/Mail.cpp
+++ b/src/server/game/Mails/Mail.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -154,7 +154,7 @@ void MailDraft::SendReturnToSender(uint32 sender_acc, uint32 sender_guid, uint32
Item* item = mailItemIter->second;
item->SaveToDB(trans); // item not in inventory and can be save standalone
// owner in data will set at mail receive and item extracting
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_ITEM_OWNER);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_OWNER);
stmt->setUInt32(0, receiver_guid);
stmt->setUInt32(1, item->GetGUIDLow());
trans->Append(stmt);
@@ -200,7 +200,7 @@ void MailDraft::SendMailTo(SQLTransaction& trans, MailReceiver const& receiver,
// Add to DB
uint8 index = 0;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_MAIL);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_MAIL);
stmt->setUInt32( index, mailId);
stmt->setUInt8 (++index, uint8(sender.GetMailMessageType()));
stmt->setInt8 (++index, int8(sender.GetStationery()));
@@ -220,7 +220,7 @@ void MailDraft::SendMailTo(SQLTransaction& trans, MailReceiver const& receiver,
for (MailItemMap::const_iterator mailItemIter = m_items.begin(); mailItemIter != m_items.end(); ++mailItemIter)
{
Item* pItem = mailItemIter->second;
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_MAIL_ITEM);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_MAIL_ITEM);
stmt->setUInt32(0, mailId);
stmt->setUInt32(1, pItem->GetGUIDLow());
stmt->setUInt32(2, receiver.GetPlayerGUIDLow());
diff --git a/src/server/game/Mails/Mail.h b/src/server/game/Mails/Mail.h
index f37a7f1beb7..6615d59160a 100755
--- a/src/server/game/Mails/Mail.h
+++ b/src/server/game/Mails/Mail.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 34a7b60bcbd..df5ec540427 100755
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -1539,6 +1539,24 @@ inline GridMap* Map::GetGrid(float x, float y)
return GridMaps[gx][gy];
}
+float Map::GetWaterOrGroundLevel(float x, float y, float z, float* ground /*= NULL*/, bool swim /*= false*/) const
+{
+ if (const_cast<Map*>(this)->GetGrid(x, y))
+ {
+ // we need ground level (including grid height version) for proper return water level in point
+ float ground_z = GetHeight(x, y, z, true, 50.0f);
+ if (ground)
+ *ground = ground_z;
+
+ LiquidData liquid_status;
+
+ ZLiquidStatus res = getLiquidStatus(x, y, ground_z, MAP_ALL_LIQUIDS, &liquid_status);
+ return res ? ( swim ? liquid_status.level - 2.0f : liquid_status.level) : ground_z;
+ }
+
+ return VMAP_INVALID_HEIGHT_VALUE;
+}
+
float Map::GetHeight(float x, float y, float z, bool checkVMap /*= true*/, float maxSearchDist /*= DEFAULT_HEIGHT_SEARCH*/) const
{
// find raw .map surface under Z coordinates
diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h
index 542d9119830..f3b45bd8f37 100755
--- a/src/server/game/Maps/Map.h
+++ b/src/server/game/Maps/Map.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -424,6 +424,8 @@ class Map : public GridRefManager<NGridType>
InstanceMap* ToInstanceMap(){ if (IsDungeon()) return reinterpret_cast<InstanceMap*>(this); else return NULL; }
const InstanceMap* ToInstanceMap() const { if (IsDungeon()) return (const InstanceMap*)((InstanceMap*)this); else return NULL; }
+ float GetWaterOrGroundLevel(float x, float y, float z, float* ground = NULL, bool swim = false) const;
+
private:
void LoadMapAndVMap(int gx, int gy);
void LoadVMap(int gx, int gy);
diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp
index a56a193ba64..fbe609bee23 100755
--- a/src/server/game/Maps/MapInstanced.cpp
+++ b/src/server/game/Maps/MapInstanced.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -124,9 +124,17 @@ Map* MapInstanced::CreateInstanceForPlayer(const uint32 mapId, Player* player)
// the instance id is set in battlegroundid
NewInstanceId = player->GetBattlegroundId();
if (!NewInstanceId) return NULL;
- map = FindInstanceMap(NewInstanceId);
+ map = sMapMgr->FindMap(mapId, NewInstanceId);
if (!map)
- map = CreateBattleground(NewInstanceId, player->GetBattleground());
+ {
+ if (Battleground* bg = player->GetBattleground())
+ map = CreateBattleground(NewInstanceId, bg);
+ else
+ {
+ player->TeleportToBGEntryPoint();
+ return NULL;
+ }
+ }
}
else
{
diff --git a/src/server/game/Maps/MapInstanced.h b/src/server/game/Maps/MapInstanced.h
index 9b714cb7fb3..0b1a404630b 100755
--- a/src/server/game/Maps/MapInstanced.h
+++ b/src/server/game/Maps/MapInstanced.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 f31f1348b44..0fb28008c1e 100755
--- a/src/server/game/Maps/MapManager.cpp
+++ b/src/server/game/Maps/MapManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,7 +25,6 @@
#include "GridDefines.h"
#include "MapInstanced.h"
#include "InstanceScript.h"
-#include "DestinationHolderImp.h"
#include "Config.h"
#include "World.h"
#include "CellImpl.h"
diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h
index 3b168a57cd5..1049325237a 100755
--- a/src/server/game/Maps/MapManager.h
+++ b/src/server/game/Maps/MapManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/MapRefManager.h b/src/server/game/Maps/MapRefManager.h
index 48d960988f6..3976139a18d 100755
--- a/src/server/game/Maps/MapRefManager.h
+++ b/src/server/game/Maps/MapRefManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 1b939c329aa..86709fb28ab 100755
--- a/src/server/game/Maps/MapReference.h
+++ b/src/server/game/Maps/MapReference.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/ZoneScript.h b/src/server/game/Maps/ZoneScript.h
index 58ba9ae2c43..df6349a7664 100755
--- a/src/server/game/Maps/ZoneScript.h
+++ b/src/server/game/Maps/ZoneScript.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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 @@ class ZoneScript
virtual void OnGameObjectCreate(GameObject* /*go*/) {}
virtual void OnGameObjectRemove(GameObject* /*go*/) {}
- virtual void OnCreatureDeath(Creature* /*creature*/) {}
+ virtual void OnUnitDeath(Unit* /*unit*/) {}
//All-purpose data storage 64 bit
virtual uint64 GetData64(uint32 /*DataId*/) { return 0; }
diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h
index cbcad520e5f..4faacc1f7b7 100755
--- a/src/server/game/Miscellaneous/Formulas.h
+++ b/src/server/game/Miscellaneous/Formulas.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 a5935e1de9f..e751dbf92fe 100755
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -492,9 +492,9 @@ enum TrinityStrings
LANG_MOVEGENS_WAYPOINT = 529,
LANG_MOVEGENS_ANIMAL_RANDOM = 530,
LANG_MOVEGENS_CONFUSED = 531,
- LANG_MOVEGENS_TARGETED_PLAYER = 532,
- LANG_MOVEGENS_TARGETED_CREATURE = 533,
- LANG_MOVEGENS_TARGETED_NULL = 534,
+ LANG_MOVEGENS_CHASE_PLAYER = 532,
+ LANG_MOVEGENS_CHASE_CREATURE = 533,
+ LANG_MOVEGENS_CHASE_NULL = 534,
LANG_MOVEGENS_HOME_CREATURE = 535,
LANG_MOVEGENS_HOME_PLAYER = 536,
LANG_MOVEGENS_FLIGHT = 537,
@@ -807,7 +807,11 @@ enum TrinityStrings
LANG_CHAR_NOT_BANNED = 1136,
LANG_DEV_ON = 1137,
LANG_DEV_OFF = 1138,
- // Room for more level 3 1139-1199 not used
+ LANG_MOVEGENS_FOLLOW_PLAYER = 1139,
+ LANG_MOVEGENS_FOLLOW_CREATURE = 1140,
+ LANG_MOVEGENS_FOLLOW_NULL = 1141,
+ LANG_MOVEGENS_EFFECT = 1142,
+ // Room for more level 3 1143-1199 not used
// Debug commands
LANG_CINEMATIC_NOT_EXIST = 1200,
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index 952df731c19..f5f8133ebef 100755
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,6 +95,7 @@ enum Races
// Class value is index in ChrClasses.dbc
enum Classes
{
+ CLASS_NONE = 0,
CLASS_WARRIOR = 1,
CLASS_PALADIN = 2,
CLASS_HUNTER = 3,
@@ -1502,6 +1503,7 @@ enum GameObjectDestructibleState
GO_DESTRUCTIBLE_REBUILDING = 3,
};
+// EmotesText.dbc
enum TextEmotes
{
TEXT_EMOTE_AGREE = 1,
@@ -1665,7 +1667,7 @@ enum TextEmotes
TEXT_EMOTE_ATTACKMYTARGET = 307,
TEXT_EMOTE_OOM = 323,
TEXT_EMOTE_FOLLOW = 324,
- TEXT_EMOTE_HELP = 325,
+ TEXT_EMOTE_WAIT = 325,
TEXT_EMOTE_HEALME = 326,
TEXT_EMOTE_OPENFIRE = 327,
TEXT_EMOTE_FLIRT = 328,
@@ -1674,7 +1676,7 @@ enum TextEmotes
TEXT_EMOTE_WINK = 363,
TEXT_EMOTE_PAT = 364,
TEXT_EMOTE_SERIOUS = 365,
- TEXT_EMOTE_MOUNTSPECIAL = 366,
+ TEXT_EMOTE_MOUNT_SPECIAL = 366,
TEXT_EMOTE_GOODLUCK = 367,
TEXT_EMOTE_BLAME = 368,
TEXT_EMOTE_BLANK = 369,
@@ -1687,6 +1689,7 @@ enum TextEmotes
TEXT_EMOTE_ENEMY = 376,
TEXT_EMOTE_EYEBROW = 377,
TEXT_EMOTE_TOAST = 378,
+ TEXT_EMOTE_FAIL = 379,
TEXT_EMOTE_HIGHFIVE = 380,
TEXT_EMOTE_ABSENT = 381,
TEXT_EMOTE_ARM = 382,
@@ -1741,6 +1744,7 @@ enum TextEmotes
TEXT_EMOTE_SNEEZE = 436,
TEXT_EMOTE_SNORT = 437,
TEXT_EMOTE_SQUEAL = 438,
+ TEXT_EMOTE_STOPATTACK = 439,
TEXT_EMOTE_SUSPICIOUS = 440,
TEXT_EMOTE_THINK = 441,
TEXT_EMOTE_TRUCE = 442,
@@ -1756,402 +1760,695 @@ enum TextEmotes
TEXT_EMOTE_YW = 453,
};
+// Emotes.dbc
enum Emote
{
- EMOTE_ONESHOT_NONE = 0,
- EMOTE_ONESHOT_TALK = 1,
- EMOTE_ONESHOT_BOW = 2,
- EMOTE_ONESHOT_WAVE = 3,
- EMOTE_ONESHOT_CHEER = 4,
- EMOTE_ONESHOT_EXCLAMATION = 5,
- EMOTE_ONESHOT_QUESTION = 6,
- EMOTE_ONESHOT_EAT = 7,
- EMOTE_STATE_DANCE = 10,
- EMOTE_ONESHOT_LAUGH = 11,
- EMOTE_STATE_SLEEP = 12,
- EMOTE_STATE_SIT = 13,
- EMOTE_ONESHOT_RUDE = 14,
- EMOTE_ONESHOT_ROAR = 15,
- EMOTE_ONESHOT_KNEEL = 16,
- EMOTE_ONESHOT_KISS = 17,
- EMOTE_ONESHOT_CRY = 18,
- EMOTE_ONESHOT_CHICKEN = 19,
- EMOTE_ONESHOT_BEG = 20,
- EMOTE_ONESHOT_APPLAUD = 21,
- EMOTE_ONESHOT_SHOUT = 22,
- EMOTE_ONESHOT_FLEX = 23,
- EMOTE_ONESHOT_SHY = 24,
- EMOTE_ONESHOT_POINT = 25,
- EMOTE_STATE_STAND = 26,
- EMOTE_STATE_READYUNARMED = 27,
- EMOTE_STATE_WORK_SHEATHED = 28,
- EMOTE_STATE_POINT = 29,
- EMOTE_STATE_NONE = 30,
- EMOTE_ONESHOT_WOUND = 33,
- EMOTE_ONESHOT_WOUNDCRITICAL = 34,
- EMOTE_ONESHOT_ATTACKUNARMED = 35,
- EMOTE_ONESHOT_ATTACK1H = 36,
- EMOTE_ONESHOT_ATTACK2HTIGHT = 37,
- EMOTE_ONESHOT_ATTACK2HLOOSE = 38,
- EMOTE_ONESHOT_PARRYUNARMED = 39,
- EMOTE_ONESHOT_PARRYSHIELD = 43,
- EMOTE_ONESHOT_READYUNARMED = 44,
- EMOTE_ONESHOT_READY1H = 45,
- EMOTE_ONESHOT_READYBOW = 48,
- EMOTE_ONESHOT_SPELLPRECAST = 50,
- EMOTE_ONESHOT_SPELLCAST = 51,
- EMOTE_ONESHOT_BATTLEROAR = 53,
- EMOTE_ONESHOT_SPECIALATTACK1H = 54,
- EMOTE_ONESHOT_KICK = 60,
- EMOTE_ONESHOT_ATTACKTHROWN = 61,
- EMOTE_STATE_STUN = 64,
- EMOTE_STATE_DEAD = 65,
- EMOTE_ONESHOT_SALUTE = 66,
- EMOTE_STATE_KNEEL = 68,
- EMOTE_STATE_USESTANDING = 69,
- EMOTE_ONESHOT_WAVE_NOSHEATHE = 70,
- EMOTE_ONESHOT_CHEER_NOSHEATHE = 71,
- EMOTE_ONESHOT_EAT_NOSHEATHE = 92,
- EMOTE_STATE_STUN_NOSHEATHE = 93,
- EMOTE_ONESHOT_DANCE = 94,
- EMOTE_ONESHOT_SALUTE_NOSHEATH = 113,
- EMOTE_STATE_USESTANDING_NOSHEATHE = 133,
- EMOTE_ONESHOT_LAUGH_NOSHEATHE = 153,
- EMOTE_STATE_WORK = 173,
- EMOTE_STATE_SPELLPRECAST = 193,
- EMOTE_ONESHOT_READYRIFLE = 213,
- EMOTE_STATE_READYRIFLE = 214,
- EMOTE_STATE_WORK_MINING = 233,
- EMOTE_STATE_WORK_CHOPWOOD = 234,
- EMOTE_STATE_APPLAUD = 253,
- EMOTE_ONESHOT_LIFTOFF = 254,
- EMOTE_ONESHOT_YES = 273,
- EMOTE_ONESHOT_NO = 274,
- EMOTE_ONESHOT_TRAIN = 275,
- EMOTE_ONESHOT_LAND = 293,
- EMOTE_STATE_AT_EASE = 313,
- EMOTE_STATE_READY1H = 333,
- EMOTE_STATE_SPELLKNEELSTART = 353,
- EMOTE_STATE_SUBMERGED = 373,
- EMOTE_ONESHOT_SUBMERGE = 374,
- EMOTE_STATE_READY2H = 375,
- EMOTE_STATE_READYBOW = 376,
- EMOTE_ONESHOT_MOUNTSPECIAL = 377,
- EMOTE_STATE_TALK = 378,
- EMOTE_STATE_FISHING = 379,
- EMOTE_ONESHOT_FISHING = 380,
- EMOTE_ONESHOT_LOOT = 381,
- EMOTE_STATE_WHIRLWIND = 382,
- EMOTE_STATE_DROWNED = 383,
- EMOTE_STATE_HOLD_BOW = 384,
- EMOTE_STATE_HOLD_RIFLE = 385,
- EMOTE_STATE_HOLD_THROWN = 386,
- EMOTE_ONESHOT_DROWN = 387,
- EMOTE_ONESHOT_STOMP = 388,
- EMOTE_ONESHOT_ATTACKOFF = 389,
- EMOTE_ONESHOT_ATTACKOFFPIERCE = 390,
- EMOTE_STATE_ROAR = 391,
- EMOTE_STATE_LAUGH = 392,
- EMOTE_ONESHOT_CREATURE_SPECIAL = 393,
- EMOTE_ONESHOT_JUMPLANDRUN = 394,
- EMOTE_ONESHOT_JUMPEND = 395,
- EMOTE_ONESHOT_TALK_NOSHEATHE = 396,
- EMOTE_ONESHOT_POINT_NOSHEATHE = 397,
- EMOTE_STATE_CANNIBALIZE = 398,
- EMOTE_ONESHOT_JUMPSTART = 399,
- EMOTE_STATE_DANCESPECIAL = 400,
- EMOTE_ONESHOT_DANCESPECIAL = 401,
- EMOTE_ONESHOT_CUSTOMSPELL01 = 402,
- EMOTE_ONESHOT_CUSTOMSPELL02 = 403,
- EMOTE_ONESHOT_CUSTOMSPELL03 = 404,
- EMOTE_ONESHOT_CUSTOMSPELL04 = 405,
- EMOTE_ONESHOT_CUSTOMSPELL05 = 406,
- EMOTE_ONESHOT_CUSTOMSPELL06 = 407,
- EMOTE_ONESHOT_CUSTOMSPELL07 = 408,
- EMOTE_ONESHOT_CUSTOMSPELL08 = 409,
- EMOTE_ONESHOT_CUSTOMSPELL09 = 410,
- EMOTE_ONESHOT_CUSTOMSPELL10 = 411,
- EMOTE_STATE_EXCLAIM = 412,
- EMOTE_STATE_DANCE_CUSTOM = 413,
- EMOTE_STATE_SIT_CHAIR_MED = 415,
- EMOTE_STATE_CUSTOM_SPELL_01 = 416,
- EMOTE_STATE_CUSTOM_SPELL_02 = 417,
- EMOTE_STATE_EAT = 418,
- EMOTE_STATE_CUSTOM_SPELL_04 = 419,
- EMOTE_STATE_CUSTOM_SPELL_03 = 420,
- EMOTE_STATE_CUSTOM_SPELL_05 = 421,
- EMOTE_STATE_SPELLEFFECT_HOLD = 422,
- EMOTE_STATE_EAT_NO_SHEATHE = 423,
- EMOTE_STATE_MOUNT = 424,
- EMOTE_STATE_READY2HL = 425,
- EMOTE_STATE_SIT_CHAIR_HIGH = 426,
- EMOTE_STATE_FALL = 427,
- EMOTE_STATE_LOOT = 428,
- EMOTE_STATE_SUBMERGED_NEW = 429,
- EMOTE_ONESHOT_COWER = 430,
- EMOTE_STATE_COWER = 431,
- EMOTE_ONESHOT_USESTANDING = 432,
- EMOTE_STATE_STEALTH_STAND = 433,
- EMOTE_ONESHOT_OMNICAST_GHOUL = 434,
- EMOTE_ONESHOT_ATTACKBOW = 435,
- EMOTE_ONESHOT_ATTACKRIFLE = 436,
- EMOTE_STATE_SWIM_IDLE = 437,
- EMOTE_STATE_ATTACK_UNARMED = 438,
- EMOTE_ONESHOT_SPELLCAST_W_SOUND = 439,
- EMOTE_ONESHOT_DODGE = 440,
- EMOTE_ONESHOT_PARRY1H = 441,
- EMOTE_ONESHOT_PARRY2H = 442,
- EMOTE_ONESHOT_PARRY2HL = 443,
- EMOTE_STATE_FLYFALL = 444,
- EMOTE_ONESHOT_FLYDEATH = 445,
- EMOTE_STATE_FLY_FALL = 446,
- EMOTE_ONESHOT_FLY_SIT_GROUND_DOWN = 447,
- EMOTE_ONESHOT_FLY_SIT_GROUND_UP = 448,
- EMOTE_ONESHOT_EMERGE = 449,
- EMOTE_ONESHOT_DRAGONSPIT = 450,
- EMOTE_STATE_SPECIALUNARMED = 451,
- EMOTE_ONESHOT_FLYGRAB = 452,
- EMOTE_STATE_FLYGRABCLOSED = 453,
- EMOTE_ONESHOT_FLYGRABTHROWN = 454,
- EMOTE_STATE_FLY_SIT_GROUND = 455,
- EMOTE_STATE_WALKBACKWARDS = 456,
- EMOTE_ONESHOT_FLYTALK = 457,
- EMOTE_ONESHOT_FLYATTACK1H = 458,
- EMOTE_STATE_CUSTOMSPELL08 = 459,
- EMOTE_ONESHOT_FLY_DRAGONSPIT = 460,
- EMOTE_STATE_SIT_CHAIR_LOW = 461,
- EMOTE_ONE_SHOT_STUN = 462,
- EMOTE_ONESHOT_SPELLCAST_OMNI = 463,
- EMOTE_STATE_READYTHROWN = 464
-};
-
+ EMOTE_ONESHOT_NONE = 0,
+ EMOTE_ONESHOT_TALK = 1,
+ EMOTE_ONESHOT_BOW = 2,
+ EMOTE_ONESHOT_WAVE = 3,
+ EMOTE_ONESHOT_CHEER = 4,
+ EMOTE_ONESHOT_EXCLAMATION = 5,
+ EMOTE_ONESHOT_QUESTION = 6,
+ EMOTE_ONESHOT_EAT = 7,
+ EMOTE_STATE_DANCE = 10,
+ EMOTE_ONESHOT_LAUGH = 11,
+ EMOTE_STATE_SLEEP = 12,
+ EMOTE_STATE_SIT = 13,
+ EMOTE_ONESHOT_RUDE = 14,
+ EMOTE_ONESHOT_ROAR = 15,
+ EMOTE_ONESHOT_KNEEL = 16,
+ EMOTE_ONESHOT_KISS = 17,
+ EMOTE_ONESHOT_CRY = 18,
+ EMOTE_ONESHOT_CHICKEN = 19,
+ EMOTE_ONESHOT_BEG = 20,
+ EMOTE_ONESHOT_APPLAUD = 21,
+ EMOTE_ONESHOT_SHOUT = 22,
+ EMOTE_ONESHOT_FLEX = 23,
+ EMOTE_ONESHOT_SHY = 24,
+ EMOTE_ONESHOT_POINT = 25,
+ EMOTE_STATE_STAND = 26,
+ EMOTE_STATE_READY_UNARMED = 27,
+ EMOTE_STATE_WORK_SHEATHED = 28,
+ EMOTE_STATE_POINT = 29,
+ EMOTE_STATE_NONE = 30,
+ EMOTE_ONESHOT_WOUND = 33,
+ EMOTE_ONESHOT_WOUND_CRITICAL = 34,
+ EMOTE_ONESHOT_ATTACK_UNARMED = 35,
+ EMOTE_ONESHOT_ATTACK1H = 36,
+ EMOTE_ONESHOT_ATTACK2HTIGHT = 37,
+ EMOTE_ONESHOT_ATTACK2H_LOOSE = 38,
+ EMOTE_ONESHOT_PARRY_UNARMED = 39,
+ EMOTE_ONESHOT_PARRY_SHIELD = 43,
+ EMOTE_ONESHOT_READY_UNARMED = 44,
+ EMOTE_ONESHOT_READY1H = 45,
+ EMOTE_ONESHOT_READY_BOW = 48,
+ EMOTE_ONESHOT_SPELL_PRECAST = 50,
+ EMOTE_ONESHOT_SPELL_CAST = 51,
+ EMOTE_ONESHOT_BATTLE_ROAR = 53,
+ EMOTE_ONESHOT_SPECIALATTACK1H = 54,
+ EMOTE_ONESHOT_KICK = 60,
+ EMOTE_ONESHOT_ATTACK_THROWN = 61,
+ EMOTE_STATE_STUN = 64,
+ EMOTE_STATE_DEAD = 65,
+ EMOTE_ONESHOT_SALUTE = 66,
+ EMOTE_STATE_KNEEL = 68,
+ EMOTE_STATE_USE_STANDING = 69,
+ EMOTE_ONESHOT_WAVE_NO_SHEATHE = 70,
+ EMOTE_ONESHOT_CHEER_NO_SHEATHE = 71,
+ EMOTE_ONESHOT_EAT_NO_SHEATHE = 92,
+ EMOTE_STATE_STUN_NO_SHEATHE = 93,
+ EMOTE_ONESHOT_DANCE = 94,
+ EMOTE_ONESHOT_SALUTE_NO_SHEATH = 113,
+ EMOTE_STATE_USE_STANDING_NO_SHEATHE = 133,
+ EMOTE_ONESHOT_LAUGH_NO_SHEATHE = 153,
+ EMOTE_STATE_WORK = 173,
+ EMOTE_STATE_SPELL_PRECAST = 193,
+ EMOTE_ONESHOT_READY_RIFLE = 213,
+ EMOTE_STATE_READY_RIFLE = 214,
+ EMOTE_STATE_WORK_MINING = 233,
+ EMOTE_STATE_WORK_CHOPWOOD = 234,
+ EMOTE_STATE_APPLAUD = 253,
+ EMOTE_ONESHOT_LIFTOFF = 254,
+ EMOTE_ONESHOT_YES = 273,
+ EMOTE_ONESHOT_NO = 274,
+ EMOTE_ONESHOT_TRAIN = 275,
+ EMOTE_ONESHOT_LAND = 293,
+ EMOTE_STATE_AT_EASE = 313,
+ EMOTE_STATE_READY1H = 333,
+ EMOTE_STATE_SPELL_KNEEL_START = 353,
+ EMOTE_STATE_SUBMERGED = 373,
+ EMOTE_ONESHOT_SUBMERGE = 374,
+ EMOTE_STATE_READY2H = 375,
+ EMOTE_STATE_READY_BOW = 376,
+ EMOTE_ONESHOT_MOUNT_SPECIAL = 377,
+ EMOTE_STATE_TALK = 378,
+ EMOTE_STATE_FISHING = 379,
+ EMOTE_ONESHOT_FISHING = 380,
+ EMOTE_ONESHOT_LOOT = 381,
+ EMOTE_STATE_WHIRLWIND = 382,
+ EMOTE_STATE_DROWNED = 383,
+ EMOTE_STATE_HOLD_BOW = 384,
+ EMOTE_STATE_HOLD_RIFLE = 385,
+ EMOTE_STATE_HOLD_THROWN = 386,
+ EMOTE_ONESHOT_DROWN = 387,
+ EMOTE_ONESHOT_STOMP = 388,
+ EMOTE_ONESHOT_ATTACK_OFF = 389,
+ EMOTE_ONESHOT_ATTACK_OFF_PIERCE = 390,
+ EMOTE_STATE_ROAR = 391,
+ EMOTE_STATE_LAUGH = 392,
+ EMOTE_ONESHOT_CREATURE_SPECIAL = 393,
+ EMOTE_ONESHOT_JUMPLANDRUN = 394,
+ EMOTE_ONESHOT_JUMPEND = 395,
+ EMOTE_ONESHOT_TALK_NO_SHEATHE = 396,
+ EMOTE_ONESHOT_POINT_NO_SHEATHE = 397,
+ EMOTE_STATE_CANNIBALIZE = 398,
+ EMOTE_ONESHOT_JUMPSTART = 399,
+ EMOTE_STATE_DANCESPECIAL = 400,
+ EMOTE_ONESHOT_DANCESPECIAL = 401,
+ EMOTE_ONESHOT_CUSTOM_SPELL_01 = 402,
+ EMOTE_ONESHOT_CUSTOM_SPELL_02 = 403,
+ EMOTE_ONESHOT_CUSTOM_SPELL_03 = 404,
+ EMOTE_ONESHOT_CUSTOM_SPELL_04 = 405,
+ EMOTE_ONESHOT_CUSTOM_SPELL_05 = 406,
+ EMOTE_ONESHOT_CUSTOM_SPELL_06 = 407,
+ EMOTE_ONESHOT_CUSTOM_SPELL_07 = 408,
+ EMOTE_ONESHOT_CUSTOM_SPELL_08 = 409,
+ EMOTE_ONESHOT_CUSTOM_SPELL_09 = 410,
+ EMOTE_ONESHOT_CUSTOM_SPELL_10 = 411,
+ EMOTE_STATE_EXCLAIM = 412,
+ EMOTE_STATE_DANCE_CUSTOM = 413,
+ EMOTE_STATE_SIT_CHAIR_MED = 415,
+ EMOTE_STATE_CUSTOM_SPELL_01 = 416,
+ EMOTE_STATE_CUSTOM_SPELL_02 = 417,
+ EMOTE_STATE_EAT = 418,
+ EMOTE_STATE_CUSTOM_SPELL_04 = 419,
+ EMOTE_STATE_CUSTOM_SPELL_03 = 420,
+ EMOTE_STATE_CUSTOM_SPELL_05 = 421,
+ EMOTE_STATE_SPELLEFFECT_HOLD = 422,
+ EMOTE_STATE_EAT_NO_SHEATHE = 423,
+ EMOTE_STATE_MOUNT = 424,
+ EMOTE_STATE_READY2HL = 425,
+ EMOTE_STATE_SIT_CHAIR_HIGH = 426,
+ EMOTE_STATE_FALL = 427,
+ EMOTE_STATE_LOOT = 428,
+ EMOTE_STATE_SUBMERGED_NEW = 429,
+ EMOTE_ONESHOT_COWER = 430,
+ EMOTE_STATE_COWER = 431,
+ EMOTE_ONESHOT_USE_STANDING = 432,
+ EMOTE_STATE_STEALTH_STAND = 433,
+ EMOTE_ONESHOT_OMNICAST_GHOUL = 434,
+ EMOTE_ONESHOT_ATTACK_BOW = 435,
+ EMOTE_ONESHOT_ATTACK_RIFLE = 436,
+ EMOTE_STATE_SWIM_IDLE = 437,
+ EMOTE_STATE_ATTACK_UNARMED = 438,
+ EMOTE_ONESHOT_SPELL_CAST_W_SOUND = 439,
+ EMOTE_ONESHOT_DODGE = 440,
+ EMOTE_ONESHOT_PARRY1H = 441,
+ EMOTE_ONESHOT_PARRY2H = 442,
+ EMOTE_ONESHOT_PARRY2HL = 443,
+ EMOTE_STATE_FLYFALL = 444,
+ EMOTE_ONESHOT_FLYDEATH = 445,
+ EMOTE_STATE_FLY_FALL = 446,
+ EMOTE_ONESHOT_FLY_SIT_GROUND_DOWN = 447,
+ EMOTE_ONESHOT_FLY_SIT_GROUND_UP = 448,
+ EMOTE_ONESHOT_EMERGE = 449,
+ EMOTE_ONESHOT_DRAGON_SPIT = 450,
+ EMOTE_STATE_SPECIAL_UNARMED = 451,
+ EMOTE_ONESHOT_FLYGRAB = 452,
+ EMOTE_STATE_FLYGRABCLOSED = 453,
+ EMOTE_ONESHOT_FLYGRABTHROWN = 454,
+ EMOTE_STATE_FLY_SIT_GROUND = 455,
+ EMOTE_STATE_WALK_BACKWARDS = 456,
+ EMOTE_ONESHOT_FLYTALK = 457,
+ EMOTE_ONESHOT_FLYATTACK1H = 458,
+ EMOTE_STATE_CUSTOM_SPELL_08 = 459,
+ EMOTE_ONESHOT_FLY_DRAGON_SPIT = 460,
+ EMOTE_STATE_SIT_CHAIR_LOW = 461,
+ EMOTE_ONESHOT_STUN = 462,
+ EMOTE_ONESHOT_SPELL_CAST_OMNI = 463,
+ EMOTE_STATE_READY_THROWN = 465,
+ EMOTE_ONESHOT_WORK_CHOPWOOD = 466,
+ EMOTE_ONESHOT_WORK_MINING = 467,
+ EMOTE_STATE_SPELL_CHANNEL_OMNI = 468,
+ EMOTE_STATE_SPELL_CHANNEL_DIRECTED = 469,
+ EMOTE_STAND_STATE_NONE = 470,
+ EMOTE_STATE_READYJOUST = 471,
+ EMOTE_STATE_STRANGULATE = 473,
+ EMOTE_STATE_READY_SPELL_OMNI = 474,
+ EMOTE_STATE_HOLD_JOUST = 475,
+ EMOTE_ONESHOT_CRY_JAINA = 476
+};
+
+// AnimationData.dbc
enum Anim
{
- ANIM_STAND = 0x0,
- ANIM_DEATH = 0x1,
- ANIM_SPELL = 0x2,
- ANIM_STOP = 0x3,
- ANIM_WALK = 0x4,
- ANIM_RUN = 0x5,
- ANIM_DEAD = 0x6,
- ANIM_RISE = 0x7,
- ANIM_STANDWOUND = 0x8,
- ANIM_COMBATWOUND = 0x9,
- ANIM_COMBATCRITICAL = 0xA,
- ANIM_SHUFFLE_LEFT = 0xB,
- ANIM_SHUFFLE_RIGHT = 0xC,
- ANIM_WALK_BACKWARDS = 0xD,
- ANIM_STUN = 0xE,
- ANIM_HANDS_CLOSED = 0xF,
- ANIM_ATTACKUNARMED = 0x10,
- ANIM_ATTACK1H = 0x11,
- ANIM_ATTACK2HTIGHT = 0x12,
- ANIM_ATTACK2HLOOSE = 0x13,
- ANIM_PARRYUNARMED = 0x14,
- ANIM_PARRY1H = 0x15,
- ANIM_PARRY2HTIGHT = 0x16,
- ANIM_PARRY2HLOOSE = 0x17,
- ANIM_PARRYSHIELD = 0x18,
- ANIM_READYUNARMED = 0x19,
- ANIM_READY1H = 0x1A,
- ANIM_READY2HTIGHT = 0x1B,
- ANIM_READY2HLOOSE = 0x1C,
- ANIM_READYBOW = 0x1D,
- ANIM_DODGE = 0x1E,
- ANIM_SPELLPRECAST = 0x1F,
- ANIM_SPELLCAST = 0x20,
- ANIM_SPELLCASTAREA = 0x21,
- ANIM_NPCWELCOME = 0x22,
- ANIM_NPCGOODBYE = 0x23,
- ANIM_BLOCK = 0x24,
- ANIM_JUMPSTART = 0x25,
- ANIM_JUMP = 0x26,
- ANIM_JUMPEND = 0x27,
- ANIM_FALL = 0x28,
- ANIM_SWIMIDLE = 0x29,
- ANIM_SWIM = 0x2A,
- ANIM_SWIM_LEFT = 0x2B,
- ANIM_SWIM_RIGHT = 0x2C,
- ANIM_SWIM_BACKWARDS = 0x2D,
- ANIM_ATTACKBOW = 0x2E,
- ANIM_FIREBOW = 0x2F,
- ANIM_READYRIFLE = 0x30,
- ANIM_ATTACKRIFLE = 0x31,
- ANIM_LOOT = 0x32,
- ANIM_SPELL_PRECAST_DIRECTED = 0x33,
- ANIM_SPELL_PRECAST_OMNI = 0x34,
- ANIM_SPELL_CAST_DIRECTED = 0x35,
- ANIM_SPELL_CAST_OMNI = 0x36,
- ANIM_SPELL_BATTLEROAR = 0x37,
- ANIM_SPELL_READYABILITY = 0x38,
- ANIM_SPELL_SPECIAL1H = 0x39,
- ANIM_SPELL_SPECIAL2H = 0x3A,
- ANIM_SPELL_SHIELDBASH = 0x3B,
- ANIM_EMOTE_TALK = 0x3C,
- ANIM_EMOTE_EAT = 0x3D,
- ANIM_EMOTE_WORK = 0x3E,
- ANIM_EMOTE_USE_STANDING = 0x3F,
- ANIM_EMOTE_EXCLAMATION = 0x40,
- ANIM_EMOTE_QUESTION = 0x41,
- ANIM_EMOTE_BOW = 0x42,
- ANIM_EMOTE_WAVE = 0x43,
- ANIM_EMOTE_CHEER = 0x44,
- ANIM_EMOTE_DANCE = 0x45,
- ANIM_EMOTE_LAUGH = 0x46,
- ANIM_EMOTE_SLEEP = 0x47,
- ANIM_EMOTE_SIT_GROUND = 0x48,
- ANIM_EMOTE_RUDE = 0x49,
- ANIM_EMOTE_ROAR = 0x4A,
- ANIM_EMOTE_KNEEL = 0x4B,
- ANIM_EMOTE_KISS = 0x4C,
- ANIM_EMOTE_CRY = 0x4D,
- ANIM_EMOTE_CHICKEN = 0x4E,
- ANIM_EMOTE_BEG = 0x4F,
- ANIM_EMOTE_APPLAUD = 0x50,
- ANIM_EMOTE_SHOUT = 0x51,
- ANIM_EMOTE_FLEX = 0x52,
- ANIM_EMOTE_SHY = 0x53,
- ANIM_EMOTE_POINT = 0x54,
- ANIM_ATTACK1HPIERCE = 0x55,
- ANIM_ATTACK2HLOOSEPIERCE = 0x56,
- ANIM_ATTACKOFF = 0x57,
- ANIM_ATTACKOFFPIERCE = 0x58,
- ANIM_SHEATHE = 0x59,
- ANIM_HIPSHEATHE = 0x5A,
- ANIM_MOUNT = 0x5B,
- ANIM_RUN_LEANRIGHT = 0x5C,
- ANIM_RUN_LEANLEFT = 0x5D,
- ANIM_MOUNT_SPECIAL = 0x5E,
- ANIM_KICK = 0x5F,
- ANIM_SITDOWN = 0x60,
- ANIM_SITTING = 0x61,
- ANIM_SITUP = 0x62,
- ANIM_SLEEPDOWN = 0x63,
- ANIM_SLEEPING = 0x64,
- ANIM_SLEEPUP = 0x65,
- ANIM_SITCHAIRLOW = 0x66,
- ANIM_SITCHAIRMEDIUM = 0x67,
- ANIM_SITCHAIRHIGH = 0x68,
- ANIM_LOADBOW = 0x69,
- ANIM_LOADRIFLE = 0x6A,
- ANIM_ATTACKTHROWN = 0x6B,
- ANIM_READYTHROWN = 0x6C,
- ANIM_HOLDBOW = 0x6D,
- ANIM_HOLDRIFLE = 0x6E,
- ANIM_HOLDTHROWN = 0x6F,
- ANIM_LOADTHROWN = 0x70,
- ANIM_EMOTE_SALUTE = 0x71,
- ANIM_KNEELDOWN = 0x72,
- ANIM_KNEELING = 0x73,
- ANIM_KNEELUP = 0x74,
- ANIM_ATTACKUNARMEDOFF = 0x75,
- ANIM_SPECIALUNARMED = 0x76,
- ANIM_STEALTHWALK = 0x77,
- ANIM_STEALTHSTAND = 0x78,
- ANIM_KNOCKDOWN = 0x79,
- ANIM_EATING = 0x7A,
- ANIM_USESTANDINGLOOP = 0x7B,
- ANIM_CHANNELCASTDIRECTED = 0x7C,
- ANIM_CHANNELCASTOMNI = 0x7D,
- ANIM_WHIRLWIND = 0x7E,
- ANIM_BIRTH = 0x7F,
- ANIM_USESTANDINGSTART = 0x80,
- ANIM_USESTANDINGEND = 0x81,
- ANIM_HOWL = 0x82,
- ANIM_DROWN = 0x83,
- ANIM_DROWNED = 0x84,
- ANIM_FISHINGCAST = 0x85,
- ANIM_FISHINGLOOP = 0x86,
- ANIM_FLY = 0x87,
- ANIM_EMOTE_WORK_NO_SHEATHE = 0x88,
- ANIM_EMOTE_STUN_NO_SHEATHE = 0x89,
- ANIM_EMOTE_USE_STANDING_NO_SHEATHE= 0x8A,
- ANIM_SPELL_SLEEP_DOWN = 0x8B,
- ANIM_SPELL_KNEEL_START = 0x8C,
- ANIM_SPELL_KNEEL_LOOP = 0x8D,
- ANIM_SPELL_KNEEL_END = 0x8E,
- ANIM_SPRINT = 0x8F,
- ANIM_IN_FIGHT = 0x90,
-
- ANIM_GAMEOBJ_SPAWN = 145,
- ANIM_GAMEOBJ_CLOSE = 146,
- ANIM_GAMEOBJ_CLOSED = 147,
- ANIM_GAMEOBJ_OPEN = 148,
- ANIM_GAMEOBJ_OPENED = 149,
- ANIM_GAMEOBJ_DESTROY = 150,
- ANIM_GAMEOBJ_DESTROYED = 151,
- ANIM_GAMEOBJ_REBUILD = 152,
- ANIM_GAMEOBJ_CUSTOM0 = 153,
- ANIM_GAMEOBJ_CUSTOM1 = 154,
- ANIM_GAMEOBJ_CUSTOM2 = 155,
- ANIM_GAMEOBJ_CUSTOM3 = 156,
- ANIM_GAMEOBJ_DESPAWN = 157,
- ANIM_HOLD = 158,
- ANIM_DECAY = 159,
- ANIM_BOWPULL = 160,
- ANIM_BOWRELEASE = 161,
- ANIM_SHIPSTART = 162,
- ANIM_SHIPMOVEING = 163,
- ANIM_SHIPSTOP = 164,
- ANIM_GROUPARROW = 165,
- ANIM_ARROW = 166,
- ANIM_CORPSEARROW = 167,
- ANIM_GUIDEARROW = 168,
- ANIM_SWAY = 169,
- ANIM_DRUIDCATPOUNCE = 170,
- ANIM_DRUIDCATRIP = 171,
- ANIM_DRUIDCATRAKE = 172,
- ANIM_DRUIDCATRAVAGE = 173,
- ANIM_DRUIDCATCLAW = 174,
- ANIM_DRUIDCATCOWER = 175,
- ANIM_DRUIDBEARSWIPE = 176,
- ANIM_DRUIDBEARBITE = 177,
- ANIM_DRUIDBEARMAUL = 178,
- ANIM_DRUIDBEARBASH = 179,
- ANIM_DRAGONTAIL = 180,
- ANIM_DRAGONSTOMP = 181,
- ANIM_DRAGONSPIT = 182,
- ANIM_DRAGONSPITHOVER = 183,
- ANIM_DRAGONSPITFLY = 184,
- ANIM_EMOTEYES = 185,
- ANIM_EMOTENO = 186,
- ANIM_JUMPLANDRUN = 187,
- ANIM_LOOTHOLD = 188,
- ANIM_LOOTUP = 189,
- ANIM_STANDHIGH = 190,
- ANIM_IMPACT = 191,
- ANIM_LIFTOFF = 192,
- ANIM_HOVER = 193,
- ANIM_SUCCUBUSENTICE = 194,
- ANIM_EMOTETRAIN = 195,
- ANIM_EMOTEDEAD = 196,
- ANIM_EMOTEDANCEONCE = 197,
- ANIM_DEFLECT = 198,
- ANIM_EMOTEEATNOSHEATHE = 199,
- ANIM_LAND = 200,
- ANIM_SUBMERGE = 201,
- ANIM_SUBMERGED = 202,
- ANIM_CANNIBALIZE = 203,
- ANIM_ARROWBIRTH = 204,
- ANIM_GROURARROWBIRTH = 205,
- ANIM_CORPSEARROWBIRTH = 206,
- ANIM_GUIDEARROWBIRTH = 207,
- ANIM_EMOTETALKNOSHEATHE = 208,
- ANIM_EMOTEPOINTNOSHEATHE = 209,
- ANIM_EMOTESALUTENOSHEATHE = 210,
- ANIM_EMOTEDANCESPECIAL = 211,
- ANIM_MUTILATE = 212,
- ANIM_CUSTOMSPELL01 = 213,
- ANIM_CUSTOMSPELL02 = 214,
- ANIM_CUSTOMSPELL03 = 215,
- ANIM_CUSTOMSPELL04 = 216,
- ANIM_CUSTOMSPELL05 = 217,
- ANIM_CUSTOMSPELL06 = 218,
- ANIM_CUSTOMSPELL07 = 219,
- ANIM_CUSTOMSPELL08 = 220,
- ANIM_CUSTOMSPELL09 = 221,
- ANIM_CUSTOMSPELL10 = 222,
- ANIM_StealthRun = 223
+ ANIM_STAND = 0,
+ ANIM_DEATH = 1,
+ ANIM_SPELL = 2,
+ ANIM_STOP = 3,
+ ANIM_WALK = 4,
+ ANIM_RUN = 5,
+ ANIM_DEAD = 6,
+ ANIM_RISE = 7,
+ ANIM_STAND_WOUND = 8,
+ ANIM_COMBAT_WOUND = 9,
+ ANIM_COMBAT_CRITICAL = 10,
+ ANIM_SHUFFLE_LEFT = 11,
+ ANIM_SHUFFLE_RIGHT = 12,
+ ANIM_WALK_BACKWARDS = 13,
+ ANIM_STUN = 14,
+ ANIM_HANDS_CLOSED = 15,
+ ANIM_ATTACK_UNARMED = 16,
+ ANIM_ATTACK1H = 17,
+ ANIM_ATTACK2H = 18,
+ ANIM_ATTACK2HL = 19,
+ ANIM_PARRY_UNARMED = 20,
+ ANIM_PARRY1H = 21,
+ ANIM_PARRY2H = 22,
+ ANIM_PARRY2HL = 23,
+ ANIM_SHIELD_BLOCK = 24,
+ ANIM_READY_UNARMED = 25,
+ ANIM_READY1H = 26,
+ ANIM_READY2H = 27,
+ ANIM_READY2HL = 28,
+ ANIM_READY_BOW = 29,
+ ANIM_DODGE = 30,
+ ANIM_SPELL_PRECAST = 31,
+ ANIM_SPELL_CAST = 32,
+ ANIM_SPELL_CAST_AREA = 33,
+ ANIM_NPC_WELCOME = 34,
+ ANIM_NPC_GOODBYE = 35,
+ ANIM_BLOCK = 36,
+ ANIM_JUMP_START = 37,
+ ANIM_JUMP = 38,
+ ANIM_JUMP_END = 39,
+ ANIM_FALL = 40,
+ ANIM_SWIM_IDLE = 41,
+ ANIM_SWIM = 42,
+ ANIM_SWIM_LEFT = 43,
+ ANIM_SWIM_RIGHT = 44,
+ ANIM_SWIM_BACKWARDS = 45,
+ ANIM_ATTACK_BOW = 46,
+ ANIM_FIRE_BOW = 47,
+ ANIM_READY_RIFLE = 48,
+ ANIM_ATTACK_RIFLE = 49,
+ ANIM_LOOT = 50,
+ ANIM_READY_SPELL_DIRECTED = 51,
+ ANIM_READY_SPELL_OMNI = 52,
+ ANIM_SPELL_CAST_DIRECTED = 53,
+ ANIM_SPELL_CAST_OMNI = 54,
+ ANIM_BATTLE_ROAR = 55,
+ ANIM_READY_ABILITY = 56,
+ ANIM_SPECIAL1H = 57,
+ ANIM_SPECIAL2H = 58,
+ ANIM_SHIELD_BASH = 59,
+ ANIM_EMOTE_TALK = 60,
+ ANIM_EMOTE_EAT = 61,
+ ANIM_EMOTE_WORK = 62,
+ ANIM_EMOTE_USE_STANDING = 63,
+ ANIM_EMOTE_TALK_EXCLAMATION = 64,
+ ANIM_EMOTE_TALK_QUESTION = 65,
+ ANIM_EMOTE_BOW = 66,
+ ANIM_EMOTE_WAVE = 67,
+ ANIM_EMOTE_CHEER = 68,
+ ANIM_EMOTE_DANCE = 69,
+ ANIM_EMOTE_LAUGH = 70,
+ ANIM_EMOTE_SLEEP = 71,
+ ANIM_EMOTE_SIT_GROUND = 72,
+ ANIM_EMOTE_RUDE = 73,
+ ANIM_EMOTE_ROAR = 74,
+ ANIM_EMOTE_KNEEL = 75,
+ ANIM_EMOTE_KISS = 76,
+ ANIM_EMOTE_CRY = 77,
+ ANIM_EMOTE_CHICKEN = 78,
+ ANIM_EMOTE_BEG = 79,
+ ANIM_EMOTE_APPLAUD = 80,
+ ANIM_EMOTE_SHOUT = 81,
+ ANIM_EMOTE_FLEX = 82,
+ ANIM_EMOTE_SHY = 83,
+ ANIM_EMOTE_POINT = 84,
+ ANIM_ATTACK1H_PIERCE = 85,
+ ANIM_ATTACK2H_LOOSE_PIERCE = 86,
+ ANIM_ATTACK_OFF = 87,
+ ANIM_ATTACK_OFF_PIERCE = 88,
+ ANIM_SHEATHE = 89,
+ ANIM_HIP_SHEATHE = 90,
+ ANIM_MOUNT = 91,
+ ANIM_RUN_RIGHT = 92,
+ ANIM_RUN_LEFT = 93,
+ ANIM_MOUNT_SPECIAL = 94,
+ ANIM_KICK = 95,
+ ANIM_SIT_GROUND_DOWN = 96,
+ ANIM_SIT_GROUND = 97,
+ ANIM_SIT_GROUND_UP = 98,
+ ANIM_SLEEP_DOWN = 99,
+ ANIM_SLEEP = 100,
+ ANIM_SLEEP_UP = 101,
+ ANIM_SIT_CHAIR_LOW = 102,
+ ANIM_SIT_CHAIR_MED = 103,
+ ANIM_SIT_CHAIR_HIGH = 104,
+ ANIM_LOAD_BOW = 105,
+ ANIM_LOAD_RIFLE = 106,
+ ANIM_ATTACK_THROWN = 107,
+ ANIM_READY_THROWN = 108,
+ ANIM_HOLD_BOW = 109,
+ ANIM_HOLD_RIFLE = 110,
+ ANIM_HOLD_THROWN = 111,
+ ANIM_LOAD_THROWN = 112,
+ ANIM_EMOTE_SALUTE = 113,
+ ANIM_KNEEL_START = 114,
+ ANIM_KNEEL_LOOP = 115,
+ ANIM_KNEEL_END = 116,
+ ANIM_ATTACK_UNARMED_OFF = 117,
+ ANIM_SPECIAL_UNARMED = 118,
+ ANIM_STEALTH_WALK = 119,
+ ANIM_STEALTH_STAND = 120,
+ ANIM_KNOCKDOWN = 121,
+ ANIM_EATING_LOOP = 122,
+ ANIM_USE_STANDING_LOOP = 123,
+ ANIM_CHANNEL_CAST_DIRECTED = 124,
+ ANIM_CHANNEL_CAST_OMNI = 125,
+ ANIM_WHIRLWIND = 126,
+ ANIM_BIRTH = 127,
+ ANIM_USE_STANDING_START = 128,
+ ANIM_USE_STANDING_END = 129,
+ ANIM_CREATURE_SPECIAL = 130,
+ ANIM_DROWN = 131,
+ ANIM_DROWNED = 132,
+ ANIM_FISHING_CAST = 133,
+ ANIM_FISHING_LOOP = 134,
+ ANIM_FLY = 135,
+ ANIM_EMOTE_WORK_NO_SHEATHE = 136,
+ ANIM_EMOTE_STUN_NO_SHEATHE = 137,
+ ANIM_EMOTE_USE_STANDING_NO_SHEATHE = 138,
+ ANIM_SPELL_SLEEP_DOWN = 139,
+ ANIM_SPELL_KNEEL_START = 140,
+ ANIM_SPELL_KNEEL_LOOP = 141,
+ ANIM_SPELL_KNEEL_END = 142,
+ ANIM_SPRINT = 143,
+ ANIM_IN_FIGHT = 144,
+ ANIM_SPAWN = 145,
+ ANIM_CLOSE = 146,
+ ANIM_CLOSED = 147,
+ ANIM_OPEN = 148,
+ ANIM_OPENED = 149,
+ ANIM_DESTROY = 150,
+ ANIM_DESTROYED = 151,
+ ANIM_REBUILD = 152,
+ ANIM_CUSTOM_0 = 153,
+ ANIM_CUSTOM_1 = 154,
+ ANIM_CUSTOM_2 = 155,
+ ANIM_CUSTOM_3 = 156,
+ ANIM_DESPAWN = 157,
+ ANIM_HOLD = 158,
+ ANIM_DECAY = 159,
+ ANIM_BOW_PULL = 160,
+ ANIM_BOW_RELEASE = 161,
+ ANIM_SHIP_START = 162,
+ ANIM_SHIP_MOVING = 163,
+ ANIM_SHIP_STOP = 164,
+ ANIM_GROUP_ARROW = 165,
+ ANIM_ARROW = 166,
+ ANIM_CORPSE_ARROW = 167,
+ ANIM_GUIDE_ARROW = 168,
+ ANIM_SWAY = 169,
+ ANIM_DRUID_CAT_POUNCE = 170,
+ ANIM_DRUID_CAT_RIP = 171,
+ ANIM_DRUID_CAT_RAKE = 172,
+ ANIM_DRUID_CAT_RAVAGE = 173,
+ ANIM_DRUID_CAT_CLAW = 174,
+ ANIM_DRUID_CAT_COWER = 175,
+ ANIM_DRUID_BEAR_SWIPE = 176,
+ ANIM_DRUID_BEAR_BITE = 177,
+ ANIM_DRUID_BEAR_MAUL = 178,
+ ANIM_DRUID_BEAR_BASH = 179,
+ ANIM_DRAGON_TAIL = 180,
+ ANIM_DRAGON_STOMP = 181,
+ ANIM_DRAGON_SPIT = 182,
+ ANIM_DRAGON_SPIT_HOVER = 183,
+ ANIM_DRAGON_SPIT_FLY = 184,
+ ANIM_EMOTE_YES = 185,
+ ANIM_EMOTE_NO = 186,
+ ANIM_JUMP_LAND_RUN = 187,
+ ANIM_LOOT_HOLD = 188,
+ ANIM_LOOT_UP = 189,
+ ANIM_STAND_HIGH = 190,
+ ANIM_IMPACT = 191,
+ ANIM_LIFTOFF = 192,
+ ANIM_HOVER = 193,
+ ANIM_SUCCUBUS_ENTICE = 194,
+ ANIM_EMOTE_TRAIN = 195,
+ ANIM_EMOTE_DEAD = 196,
+ ANIM_EMOTE_DANCE_ONCE = 197,
+ ANIM_DEFLECT = 198,
+ ANIM_EMOTE_EAT_NO_SHEATHE = 199,
+ ANIM_LAND = 200,
+ ANIM_SUBMERGE = 201,
+ ANIM_SUBMERGED = 202,
+ ANIM_CANNIBALIZE = 203,
+ ANIM_ARROW_BIRTH = 204,
+ ANIM_GROUP_ARROW_BIRTH = 205,
+ ANIM_CORPSE_ARROW_BIRTH = 206,
+ ANIM_GUIDE_ARROW_BIRTH = 207,
+ ANIM_EMOTE_TALK_NO_SHEATHE = 208,
+ ANIM_EMOTE_POINT_NO_SHEATHE = 209,
+ ANIM_EMOTE_SALUTE_NO_SHEATHE = 210,
+ ANIM_EMOTE_DANCE_SPECIAL = 211,
+ ANIM_MUTILATE = 212,
+ ANIM_CUSTOM_SPELL_01 = 213,
+ ANIM_CUSTOM_SPELL_02 = 214,
+ ANIM_CUSTOM_SPELL_03 = 215,
+ ANIM_CUSTOM_SPELL_04 = 216,
+ ANIM_CUSTOM_SPELL_05 = 217,
+ ANIM_CUSTOM_SPELL_06 = 218,
+ ANIM_CUSTOM_SPELL_07 = 219,
+ ANIM_CUSTOM_SPELL_08 = 220,
+ ANIM_CUSTOM_SPELL_09 = 221,
+ ANIM_CUSTOM_SPELL_10 = 222,
+ ANIM_STEALTH_RUN = 223,
+ ANIM_EMERGE = 224,
+ ANIM_COWER = 225,
+ ANIM_GRAB = 226,
+ ANIM_GRAB_CLOSED = 227,
+ ANIM_GRAB_THROWN = 228,
+ ANIM_FLY_STAND = 229,
+ ANIM_FLY_DEATH = 230,
+ ANIM_FLY_SPELL = 231,
+ ANIM_FLY_STOP = 232,
+ ANIM_FLY_WALK = 233,
+ ANIM_FLY_RUN = 234,
+ ANIM_FLY_DEAD = 235,
+ ANIM_FLY_RISE = 236,
+ ANIM_FLY_STAND_WOUND = 237,
+ ANIM_FLY_COMBAT_WOUND = 238,
+ ANIM_FLY_COMBAT_CRITICAL = 239,
+ ANIM_FLY_SHUFFLE_LEFT = 240,
+ ANIM_FLY_SHUFFLE_RIGHT = 241,
+ ANIM_FLY_WALK_BACKWARDS = 242,
+ ANIM_FLY_STUN = 243,
+ ANIM_FLY_HANDS_CLOSED = 244,
+ ANIM_FLY_ATTACK_UNARMED = 245,
+ ANIM_FLY_ATTACK1H = 246,
+ ANIM_FLY_ATTACK2H = 247,
+ ANIM_FLY_ATTACK2HL = 248,
+ ANIM_FLY_PARRY_UNARMED = 249,
+ ANIM_FLY_PARRY1H = 250,
+ ANIM_FLY_PARRY2H = 251,
+ ANIM_FLY_PARRY2HL = 252,
+ ANIM_FLY_SHIELD_BLOCK = 253,
+ ANIM_FLY_READY_UNARMED = 254,
+ ANIM_FLY_READY1H = 255,
+ ANIM_FLY_READY2H = 256,
+ ANIM_FLY_READY2HL = 257,
+ ANIM_FLY_READY_BOW = 258,
+ ANIM_FLY_DODGE = 259,
+ ANIM_FLY_SPELL_PRECAST = 260,
+ ANIM_FLY_SPELL_CAST = 261,
+ ANIM_FLY_SPELL_CAST_AREA = 262,
+ ANIM_FLY_NPC_WELCOME = 263,
+ ANIM_FLY_NPC_GOODBYE = 264,
+ ANIM_FLY_BLOCK = 265,
+ ANIM_FLY_JUMP_START = 266,
+ ANIM_FLY_JUMP = 267,
+ ANIM_FLY_JUMP_END = 268,
+ ANIM_FLY_FALL = 269,
+ ANIM_FLY_SWIM_IDLE = 270,
+ ANIM_FLY_SWIM = 271,
+ ANIM_FLY_SWIM_LEFT = 272,
+ ANIM_FLY_SWIM_RIGHT = 273,
+ ANIM_FLY_SWIM_BACKWARDS = 274,
+ ANIM_FLY_ATTACK_BOW = 275,
+ ANIM_FLY_FIRE_BOW = 276,
+ ANIM_FLY_READY_RIFLE = 277,
+ ANIM_FLY_ATTACK_RIFLE = 278,
+ ANIM_FLY_LOOT = 279,
+ ANIM_FLY_READY_SPELL_DIRECTED = 280,
+ ANIM_FLY_READY_SPELL_OMNI = 281,
+ ANIM_FLY_SPELL_CAST_DIRECTED = 282,
+ ANIM_FLY_SPELL_CAST_OMNI = 283,
+ ANIM_FLY_SPELL_BATTLE_ROAR = 284,
+ ANIM_FLY_READY_ABILITY = 285,
+ ANIM_FLY_SPECIAL1H = 286,
+ ANIM_FLY_SPECIAL2H = 287,
+ ANIM_FLY_SHIELD_BASH = 288,
+ ANIM_FLY_EMOTE_TALK = 289,
+ ANIM_FLY_EMOTE_EAT = 290,
+ ANIM_FLY_EMOTE_WORK = 291,
+ ANIM_FLY_USE_STANDING = 292,
+ ANIM_FLY_EMOTE_TALK_EXCLAMATION = 293,
+ ANIM_FLY_EMOTE_TALK_QUESTION = 294,
+ ANIM_FLY_EMOTE_BOW = 295,
+ ANIM_FLY_EMOTE_WAVE = 296,
+ ANIM_FLY_EMOTE_CHEER = 297,
+ ANIM_FLY_EMOTE_DANCE = 298,
+ ANIM_FLY_EMOTE_LAUGH = 299,
+ ANIM_FLY_EMOTE_SLEEP = 300,
+ ANIM_FLY_EMOTE_SIT_GROUND = 301,
+ ANIM_FLY_EMOTE_RUDE = 302,
+ ANIM_FLY_EMOTE_ROAR = 303,
+ ANIM_FLY_EMOTE_KNEEL = 304,
+ ANIM_FLY_EMOTE_KISS = 305,
+ ANIM_FLY_EMOTE_CRY = 306,
+ ANIM_FLY_EMOTE_CHICKEN = 307,
+ ANIM_FLY_EMOTE_BEG = 308,
+ ANIM_FLY_EMOTE_APPLAUD = 309,
+ ANIM_FLY_EMOTE_SHOUT = 310,
+ ANIM_FLY_EMOTE_FLEX = 311,
+ ANIM_FLY_EMOTE_SHY = 312,
+ ANIM_FLY_EMOTE_POINT = 313,
+ ANIM_FLY_ATTACK1H_PIERCE = 314,
+ ANIM_FLY_ATTACK2H_LOOSE_PIERCE = 315,
+ ANIM_FLY_ATTACK_OFF = 316,
+ ANIM_FLY_ATTACK_OFF_PIERCE = 317,
+ ANIM_FLY_SHEATH = 318,
+ ANIM_FLY_HIP_SHEATH = 319,
+ ANIM_FLY_MOUNT = 320,
+ ANIM_FLY_RUN_RIGHT = 321,
+ ANIM_FLY_RUN_LEFT = 322,
+ ANIM_FLY_MOUNT_SPECIAL = 323,
+ ANIM_FLY_KICK = 324,
+ ANIM_FLY_SIT_GROUND_DOWN = 325,
+ ANIM_FLY_SIT_GROUND = 326,
+ ANIM_FLY_SIT_GROUND_UP = 327,
+ ANIM_FLY_SLEEP_DOWN = 328,
+ ANIM_FLY_SLEEP = 329,
+ ANIM_FLY_SLEEP_UP = 330,
+ ANIM_FLY_SIT_CHAIR_LOW = 331,
+ ANIM_FLY_SIT_CHAIR_MED = 332,
+ ANIM_FLY_SIT_CHAIR_HIGH = 333,
+ ANIM_FLY_LOAD_BOW = 334,
+ ANIM_FLY_LOAD_RIFLE = 335,
+ ANIM_FLY_ATTACK_THROWN = 336,
+ ANIM_FLY_READY_THROWN = 337,
+ ANIM_FLY_HOLD_BOW = 338,
+ ANIM_FLY_HOLD_RIFLE = 339,
+ ANIM_FLY_HOLD_THROWN = 340,
+ ANIM_FLY_LOAD_THROWN = 341,
+ ANIM_FLY_EMOTE_SALUTE = 342,
+ ANIM_FLY_KNEEL_START = 343,
+ ANIM_FLY_KNEEL_LOOP = 344,
+ ANIM_FLY_KNEEL_END = 345,
+ ANIM_FLY_ATTACK_UNARMED_OFF = 346,
+ ANIM_FLY_SPECIAL_UNARMED = 347,
+ ANIM_FLY_STEALTH_WALK = 348,
+ ANIM_FLY_STEALTH_STAND = 349,
+ ANIM_FLY_KNOCKDOWN = 350,
+ ANIM_FLY_EATING_LOOP = 351,
+ ANIM_FLY_USE_STANDING_LOOP = 352,
+ ANIM_FLY_CHANNEL_CAST_DIRECTED = 353,
+ ANIM_FLY_CHANNEL_CAST_OMNI = 354,
+ ANIM_FLY_WHIRLWIND = 355,
+ ANIM_FLY_BIRTH = 356,
+ ANIM_FLY_USE_STANDING_START = 357,
+ ANIM_FLY_USE_STANDING_END = 358,
+ ANIM_FLY_CREATURE_SPECIAL = 359,
+ ANIM_FLY_DROWN = 360,
+ ANIM_FLY_DROWNED = 361,
+ ANIM_FLY_FISHING_CAST = 362,
+ ANIM_FLY_FISHING_LOOP = 363,
+ ANIM_FLY_FLY = 364,
+ ANIM_FLY_EMOTE_WORK_NO_SHEATHE = 365,
+ ANIM_FLY_EMOTE_STUN_NO_SHEATHE = 366,
+ ANIM_FLY_EMOTE_USE_STANDING_NO_SHEATHE = 367,
+ ANIM_FLY_SPELL_SLEEP_DOWN = 368,
+ ANIM_FLY_SPELL_KNEEL_START = 369,
+ ANIM_FLY_SPELL_KNEEL_LOOP = 370,
+ ANIM_FLY_SPELL_KNEEL_END = 371,
+ ANIM_FLY_SPRINT = 372,
+ ANIM_FLY_IN_FLIGHT = 373,
+ ANIM_FLY_SPAWN = 374,
+ ANIM_FLY_CLOSE = 375,
+ ANIM_FLY_CLOSED = 376,
+ ANIM_FLY_OPEN = 377,
+ ANIM_FLY_OPENED = 378,
+ ANIM_FLY_DESTROY = 379,
+ ANIM_FLY_DESTROYED = 380,
+ ANIM_FLY_REBUILD = 381,
+ ANIM_FLY_CUSTOM_0 = 382,
+ ANIM_FLY_CUSTOM_1 = 383,
+ ANIM_FLY_CUSTOM_2 = 384,
+ ANIM_FLY_CUSTOM_3 = 385,
+ ANIM_FLY_DESPAWN = 386,
+ ANIM_FLY_HOLD = 387,
+ ANIM_FLY_DECAY = 388,
+ ANIM_FLY_BOW_PULL = 389,
+ ANIM_FLY_BOW_RELEASE = 390,
+ ANIM_FLY_SHIP_START = 391,
+ ANIM_FLY_SHIP_MOVING = 392,
+ ANIM_FLY_SHIP_STOP = 393,
+ ANIM_FLY_GROUP_ARROW = 394,
+ ANIM_FLY_ARROW = 395,
+ ANIM_FLY_CORPSE_ARROW = 396,
+ ANIM_FLY_GUIDE_ARROW = 397,
+ ANIM_FLY_SWAY = 398,
+ ANIM_FLY_DRUID_CAT_POUNCE = 399,
+ ANIM_FLY_DRUID_CAT_RIP = 400,
+ ANIM_FLY_DRUID_CAT_RAKE = 401,
+ ANIM_FLY_DRUID_CAT_RAVAGE = 402,
+ ANIM_FLY_DRUID_CAT_CLAW = 403,
+ ANIM_FLY_DRUID_CAT_COWER = 404,
+ ANIM_FLY_DRUID_BEAR_SWIPE = 405,
+ ANIM_FLY_DRUID_BEAR_BITE = 406,
+ ANIM_FLY_DRUID_BEAR_MAUL = 407,
+ ANIM_FLY_DRUID_BEAR_BASH = 408,
+ ANIM_FLY_DRAGON_TAIL = 409,
+ ANIM_FLY_DRAGON_STOMP = 410,
+ ANIM_FLY_DRAGON_SPIT = 411,
+ ANIM_FLY_DRAGON_SPIT_HOVER = 412,
+ ANIM_FLY_DRAGON_SPIT_FLY = 413,
+ ANIM_FLY_EMOTE_YES = 414,
+ ANIM_FLY_EMOTE_NO = 415,
+ ANIM_FLY_JUMP_LAND_RUN = 416,
+ ANIM_FLY_LOOT_HOLD = 417,
+ ANIM_FLY_LOOT_UP = 418,
+ ANIM_FLY_STAND_HIGH = 419,
+ ANIM_FLY_IMPACT = 420,
+ ANIM_FLY_LIFTOFF = 421,
+ ANIM_FLY_HOVER = 422,
+ ANIM_FLY_SUCCUBUS_ENTICE = 423,
+ ANIM_FLY_EMOTE_TRAIN = 424,
+ ANIM_FLY_EMOTE_DEAD = 425,
+ ANIM_FLY_EMOTE_DANCE_ONCE = 426,
+ ANIM_FLY_DEFLECT = 427,
+ ANIM_FLY_EMOTE_EAT_NO_SHEATHE = 428,
+ ANIM_FLY_LAND = 429,
+ ANIM_FLY_SUBMERGE = 430,
+ ANIM_FLY_SUBMERGED = 431,
+ ANIM_FLY_CANNIBALIZE = 432,
+ ANIM_FLY_ARROW_BIRTH = 433,
+ ANIM_FLY_GROUP_ARROW_BIRTH = 434,
+ ANIM_FLY_CORPSE_ARROW_BIRTH = 435,
+ ANIM_FLY_GUIDE_ARROW_BIRTH = 436,
+ ANIM_FLY_EMOTE_TALK_NO_SHEATHE = 437,
+ ANIM_FLY_EMOTE_POINT_NO_SHEATHE = 438,
+ ANIM_FLY_EMOTE_SALUTE_NO_SHEATHE = 439,
+ ANIM_FLY_EMOTE_DANCE_SPECIAL = 440,
+ ANIM_FLY_MUTILATE = 441,
+ ANIM_FLY_CUSTOM_SPELL_01 = 442,
+ ANIM_FLY_CUSTOM_SPELL_02 = 443,
+ ANIM_FLY_CUSTOM_SPELL_03 = 444,
+ ANIM_FLY_CUSTOM_SPELL_04 = 445,
+ ANIM_FLY_CUSTOM_SPELL_05 = 446,
+ ANIM_FLY_CUSTOM_SPELL_06 = 447,
+ ANIM_FLY_CUSTOM_SPELL_07 = 448,
+ ANIM_FLY_CUSTOM_SPELL_08 = 449,
+ ANIM_FLY_CUSTOM_SPELL_09 = 450,
+ ANIM_FLY_CUSTOM_SPELL_10 = 451,
+ ANIM_FLY_STEALTH_RUN = 452,
+ ANIM_FLY_EMERGE = 453,
+ ANIM_FLY_COWER = 454,
+ ANIM_FLY_GRAB = 455,
+ ANIM_FLY_GRAB_CLOSED = 456,
+ ANIM_FLY_GRAB_THROWN = 457,
+ ANIM_TO_FLY = 458,
+ ANIM_TO_HOVER = 459,
+ ANIM_TO_GROUND = 460,
+ ANIM_FLY_TO_FLY = 461,
+ ANIM_FLY_TO_HOVER = 462,
+ ANIM_FLY_TO_GROUND = 463,
+ ANIM_SETTLE = 464,
+ ANIM_FLY_SETTLE = 465,
+ ANIM_DEATH_START = 466,
+ ANIM_DEATH_LOOP = 467,
+ ANIM_DEATH_END = 468,
+ ANIM_FLY_DEATH_START = 469,
+ ANIM_FLY_DEATH_LOOP = 470,
+ ANIM_FLY_DEATH_END = 471,
+ ANIM_DEATH_END_HOLD = 472,
+ ANIM_FLY_DEATH_END_HOLD = 473,
+ ANIM_STRANGULATE = 474,
+ ANIM_FLY_STRANGULATE = 475,
+ ANIM_READY_JOUST = 476,
+ ANIM_LOAD_JOUST = 477,
+ ANIM_HOLD_JOUST = 478,
+ ANIM_FLY_READY_JOUST = 479,
+ ANIM_FLY_LOAD_JOUST = 480,
+ ANIM_FLY_HOLD_JOUST = 481,
+ ANIM_ATTACK_JOUST = 482,
+ ANIM_FLY_ATTACK_JOUST = 483,
+ ANIM_RECLINED_MOUNT = 484,
+ ANIM_FLY_RECLINED_MOUNT = 485,
+ ANIM_TO_ALTERED = 486,
+ ANIM_FROM_ALTERED = 487,
+ ANIM_FLY_TO_ALTERED = 488,
+ ANIM_FLY_FROM_ALTERED = 489,
+ ANIM_IN_STOCKS = 490,
+ ANIM_FLY_IN_STOCKS = 491,
+ ANIM_VEHICLE_GRAB = 492,
+ ANIM_VEHICLE_THROW = 493,
+ ANIM_FLY_VEHICLE_GRAB = 494,
+ ANIM_FLY_VEHICLE_THROW = 495,
+ ANIM_TO_ALTERED_POST_SWAP = 496,
+ ANIM_FROM_ALTERED_POST_SWAP = 497,
+ ANIM_FLY_TO_ALTERED_POST_SWAP = 498,
+ ANIM_FLY_FROM_ALTERED_POST_SWAP = 499,
+ ANIM_RECLINED_MOUNT_PASSENGER = 500,
+ ANIM_FLY_RECLINED_MOUNT_PASSENGER = 501,
+ ANIM_CARRY2H = 502,
+ ANIM_CARRIED2H = 503,
+ ANIM_FLY_CARRY2H = 504,
+ ANIM_FLY_CARRIED2H = 505
};
enum LockKeyType
@@ -2326,7 +2623,7 @@ enum HolidayIds
HOLIDAY_HARVEST_FESTIVAL = 321,
HOLIDAY_HALLOWS_END = 324,
HOLIDAY_LUNAR_FESTIVAL = 327,
- HOLIDAY_LOVE_IS_IN_THE_AIR = 335,
+ // HOLIDAY_LOVE_IS_IN_THE_AIR = 335, unused/duplicated
HOLIDAY_FIRE_FESTIVAL = 341,
HOLIDAY_CALL_TO_ARMS_EY = 353,
HOLIDAY_BREWFEST = 372,
@@ -2339,6 +2636,7 @@ enum HolidayIds
HOLIDAY_WOTLK_LAUNCH = 406,
HOLIDAY_DAY_OF_DEAD = 409,
HOLIDAY_CALL_TO_ARMS_IC = 420,
+ HOLIDAY_LOVE_IS_IN_THE_AIR = 423,
HOLIDAY_KALU_AK_FISHING_DERBY = 424
};
@@ -2398,7 +2696,10 @@ enum QuestSort
QUEST_SORT_BREWFEST = 370,
QUEST_SORT_INSCRIPTION = 371,
QUEST_SORT_DEATH_KNIGHT = 372,
- QUEST_SORT_JEWELCRAFTING = 373
+ QUEST_SORT_JEWELCRAFTING = 373,
+ QUEST_SORT_NOBLEGARDEN = 374,
+ QUEST_SORT_PILGRIMS_BOUNTY = 375,
+ QUEST_SORT_LOVE_IS_IN_THE_AIR = 376,
};
inline uint8 ClassByQuestSort(int32 QuestSort)
@@ -2460,8 +2761,8 @@ enum SkillType
SKILL_SURVIVAL2 = 142,
SKILL_RIDING_HORSE = 148,
SKILL_RIDING_WOLF = 149,
- SKILL_RIDING_RAM = 152,
SKILL_RIDING_TIGER = 150,
+ SKILL_RIDING_RAM = 152,
SKILL_SWIMING = 155,
SKILL_2H_MACES = 160,
SKILL_UNARMED = 162,
diff --git a/src/server/game/Movement/DestinationHolder.cpp b/src/server/game/Movement/DestinationHolder.cpp
deleted file mode 100755
index 6247111e1b6..00000000000
--- a/src/server/game/Movement/DestinationHolder.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program 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 "DestinationHolder.h"
-
diff --git a/src/server/game/Movement/DestinationHolder.h b/src/server/game/Movement/DestinationHolder.h
deleted file mode 100755
index 2b36fe471b8..00000000000
--- a/src/server/game/Movement/DestinationHolder.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program 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/>.
- */
-
-#ifndef TRINITY_DESTINATION_HOLDER_H
-#define TRINITY_DESTINATION_HOLDER_H
-
-#include "Define.h"
-#include "Timer.h"
-
-class WorldObject;
-class Map;
-
-#define TRAVELLER_UPDATE_INTERVAL 300
-
-template<typename TRAVELLER>
-class DestinationHolder
-{
- TimeTrackerSmall i_tracker;
- uint32 i_totalTravelTime;
- uint32 i_timeElapsed;
- bool i_destSet;
- float i_fromX, i_fromY, i_fromZ;
- float i_destX, i_destY, i_destZ;
-
- public:
- DestinationHolder() : i_tracker(TRAVELLER_UPDATE_INTERVAL), i_totalTravelTime(0), i_timeElapsed(0),
- i_destSet(false), i_fromX(0), i_fromY(0), i_fromZ(0), i_destX(0), i_destY(0), i_destZ(0) {}
-
- uint32 SetDestination(TRAVELLER &traveller, float dest_x, float dest_y, float dest_z, bool sendMove = true);
- void GetDestination(float &x, float &y, float &z) const { x = i_destX; y = i_destY; z = i_destZ; }
- bool UpdateExpired(void) const { return i_tracker.Passed(); }
- void ResetUpdate(uint32 t = TRAVELLER_UPDATE_INTERVAL) { i_tracker.Reset(t); }
- uint32 GetTotalTravelTime(void) const { return i_totalTravelTime; }
- void IncreaseTravelTime(uint32 increment) { i_totalTravelTime += increment; }
- void ResetTravelTime() { i_totalTravelTime = 0; }
- bool HasDestination(void) const { return i_destSet; }
- float GetDestinationDiff(float x, float y, float z) const;
- bool HasArrived(void) const { return (i_totalTravelTime == 0 || i_timeElapsed >= i_totalTravelTime); }
- bool UpdateTraveller(TRAVELLER &traveller, uint32 diff, bool micro_movement=false);
- uint32 StartTravel(TRAVELLER &traveller, bool sendMove = true);
- void GetLocationNow(const Map* map, float &x, float &y, float &z, bool is3D = false) const;
- void GetLocationNowNoMicroMovement(float &x, float &y, float &z) const; // For use without micro movement
- float GetDistance3dFromDestSq(const WorldObject &obj) const;
-
- private:
- void _findOffSetPoint(float x1, float y1, float x2, float y2, float offset, float &x, float &y);
-
-};
-#endif
-
diff --git a/src/server/game/Movement/DestinationHolderImp.h b/src/server/game/Movement/DestinationHolderImp.h
deleted file mode 100755
index 84e7fbf4f08..00000000000
--- a/src/server/game/Movement/DestinationHolderImp.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program 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/>.
- */
-
-#ifndef TRINITY_DESTINATIONHOLDERIMP_H
-#define TRINITY_DESTINATIONHOLDERIMP_H
-
-#include "MapManager.h"
-#include "DestinationHolder.h"
-
-#include <cmath>
-
-template<typename TRAVELLER>
-void
-DestinationHolder<TRAVELLER>::_findOffSetPoint(float x1, float y1, float x2, float y2, float offset, float &x, float &y)
-{
- /* given the point (x1, y1) and (x2, y2).. need to find the point (x, y) on the same line
- * such that the distance from (x, y) to (x2, y2) is offset.
- * Let the distance of p1 to p2 = d.. then the ratio of offset/d = (x2-x)/(x2-x1)
- * hence x = x2 - (offset/d)*(x2-x1)
- * like wise offset/d = (y2-y)/(y2-y1);
- */
- if (offset == 0)
- {
- x = x2;
- y = y2;
- }
- else
- {
- double x_diff = double(x2 - x1);
- double y_diff = double(y2 - y1);
- double distance_d = (double)((x_diff*x_diff) + (y_diff * y_diff));
- if (distance_d == 0)
- {
- x = x2;
- y = y2;
- }
- else
- {
- distance_d = ::sqrt(distance_d); // starting distance
- double distance_ratio = (double)(distance_d - offset)/(double)distance_d;
- // line above has revised formula which is more correct, I think
- x = (float)(x1 + (distance_ratio*x_diff));
- y = (float)(y1 + (distance_ratio*y_diff));
- }
- }
-}
-
-template<typename TRAVELLER>
-uint32
-DestinationHolder<TRAVELLER>::SetDestination(TRAVELLER &traveller, float dest_x, float dest_y, float dest_z, bool sendMove)
-{
- i_destSet = true;
- i_destX = dest_x;
- i_destY = dest_y;
- i_destZ = dest_z;
-
- return StartTravel(traveller, sendMove);
-}
-
-template<typename TRAVELLER>
-uint32
-DestinationHolder<TRAVELLER>::StartTravel(TRAVELLER &traveller, bool sendMove)
-{
- if (!i_destSet) return 0;
-
- i_fromX = traveller.GetPositionX();
- i_fromY = traveller.GetPositionY();
- i_fromZ = traveller.GetPositionZ();
-
- i_totalTravelTime = traveller.GetTotalTrevelTimeTo(i_destX, i_destY, i_destZ);
- i_timeElapsed = 0;
- if (sendMove)
- traveller.MoveTo(i_destX, i_destY, i_destZ, i_totalTravelTime);
- return i_totalTravelTime;
-}
-
-template<typename TRAVELLER>
-bool
-DestinationHolder<TRAVELLER>::UpdateTraveller(TRAVELLER &traveller, uint32 diff, bool micro_movement)
-{
- i_timeElapsed += diff;
-
- // Update every TRAVELLER_UPDATE_INTERVAL
- i_tracker.Update(diff);
- if (!i_tracker.Passed())
- return false;
- else
- ResetUpdate();
-
- if (!i_destSet) return true;
-
- float x, y, z;
- if (!micro_movement)
- GetLocationNowNoMicroMovement(x, y, z);
- else
- {
- if (!traveller.GetTraveller().HasUnitState(UNIT_STAT_MOVING | UNIT_STAT_IN_FLIGHT))
- return true;
-
- if (traveller.GetTraveller().HasUnitState(UNIT_STAT_IN_FLIGHT))
- GetLocationNow(traveller.GetTraveller().GetBaseMap(), x, y, z, true); // Should reposition Object with right Coord, so I can bypass some Grid Relocation
- else
- GetLocationNow(traveller.GetTraveller().GetBaseMap(), x, y, z, false);
-
- // Change movement computation to micro movement based on last tick coords, this makes system work
- // even on multiple floors zones without hugh vmaps usage ;)
-
- // Take care of underrun of uint32
- if (i_totalTravelTime >= i_timeElapsed)
- i_totalTravelTime -= i_timeElapsed; // Consider only the remaining part
- else
- i_totalTravelTime = 0;
-
- i_timeElapsed = 0;
- i_fromX = x; // and change origine
- i_fromY = y; // then I take into account only micro movement
- i_fromZ = z;
- }
-
- if (traveller.GetTraveller().GetPositionX() != x || traveller.GetTraveller().GetPositionY() != y || traveller.GetTraveller().GetPositionZ() != z)
- {
- float ori = traveller.GetTraveller().GetAngle(x, y);
- traveller.Relocation(x, y, z, ori);
- }
-
- return true;
-}
-
-template<typename TRAVELLER>
-void
-DestinationHolder<TRAVELLER>::GetLocationNow(const Map* map, float &x, float &y, float &z, bool is3D) const
-{
- if (HasArrived())
- {
- x = i_destX;
- y = i_destY;
- z = i_destZ;
- }
- else if (HasDestination())
- {
- double percent_passed = (double)i_timeElapsed / (double)i_totalTravelTime;
- const float distanceX = (float)((i_destX - i_fromX) * percent_passed);
- const float distanceY = (float)((i_destY - i_fromY) * percent_passed);
- const float distanceZ = (float)((i_destZ - i_fromZ) * percent_passed);
- x = i_fromX + distanceX;
- y = i_fromY + distanceY;
- float z2 = i_fromZ + distanceZ;
- // All that is not finished but previous code neither... Traveller need be able to swim.
- if (is3D)
- z = z2;
- else
- {
- //That part is good for mob Walking on the floor. But the floor is not always what we thought.
- z = map->GetHeight(x, y, i_fromZ, false); // Disable cave check
- const float groundDist = sqrt(distanceX*distanceX + distanceY*distanceY);
- const float zDist = fabs(i_fromZ - z) + 0.000001f;
- const float slope = groundDist / zDist;
- if (slope < 1.0f) // This prevents the ground returned by GetHeight to be used when in cave
- z = z2; // a climb or jump of more than 45 is denied
- }
- }
-}
-
-template<typename TRAVELLER>
-float
-DestinationHolder<TRAVELLER>::GetDistance3dFromDestSq(const WorldObject &obj) const
-{
- float x, y, z;
- obj.GetPosition(x, y, z);
- return (i_destX-x)*(i_destX-x)+(i_destY-y)*(i_destY-y)+(i_destZ-z)*(i_destZ-z);
-}
-
-template<typename TRAVELLER>
-float
-DestinationHolder<TRAVELLER>::GetDestinationDiff(float x, float y, float z) const
-{
- return sqrt(((x-i_destX)*(x-i_destX)) + ((y-i_destY)*(y-i_destY)) + ((z-i_destZ)*(z-i_destZ)));
-}
-
-template<typename TRAVELLER>
-void
-DestinationHolder<TRAVELLER>::GetLocationNowNoMicroMovement(float &x, float &y, float &z) const
-{
- if (HasArrived())
- {
- x = i_destX;
- y = i_destY;
- z = i_destZ;
- }
- else
- {
- double percent_passed = (double)i_timeElapsed / (double)i_totalTravelTime;
- x = (float)(i_fromX + ((i_destX - i_fromX) * percent_passed));
- y = (float)(i_fromY + ((i_destY - i_fromY) * percent_passed));
- z = (float)(i_fromZ + ((i_destZ - i_fromZ) * percent_passed));
- }
-}
-
-#endif
-
diff --git a/src/server/game/Movement/FollowerRefManager.h b/src/server/game/Movement/FollowerRefManager.h
index db2a0d1c5a8..5066804d60f 100755
--- a/src/server/game/Movement/FollowerRefManager.h
+++ b/src/server/game/Movement/FollowerRefManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 9ef1734c78c..997d066a9f2 100755
--- a/src/server/game/Movement/FollowerReference.cpp
+++ b/src/server/game/Movement/FollowerReference.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 e5b6075ec38..6a1a3719cb8 100755
--- a/src/server/game/Movement/FollowerReference.h
+++ b/src/server/game/Movement/FollowerReference.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 ec928e74a34..4945ae2a014 100755
--- a/src/server/game/Movement/MotionMaster.cpp
+++ b/src/server/game/Movement/MotionMaster.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -19,7 +19,6 @@
#include "MotionMaster.h"
#include "CreatureAISelector.h"
#include "Creature.h"
-#include "Traveller.h"
#include "ConfusedMovementGenerator.h"
#include "FleeingMovementGenerator.h"
@@ -29,7 +28,8 @@
#include "TargetedMovementGenerator.h"
#include "WaypointMovementGenerator.h"
#include "RandomMovementGenerator.h"
-
+#include "MoveSpline.h"
+#include "MoveSplineInit.h"
#include <cassert>
inline bool isStatic(MovementGenerator *mv)
@@ -80,7 +80,7 @@ void MotionMaster::UpdateMotion(uint32 diff)
if (!i_owner)
return;
- if (i_owner->HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) // what about UNIT_STAT_DISTRACTED? Why is this not included?
+ if (i_owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) // what about UNIT_STATE_DISTRACTED? Why is this not included?
return;
ASSERT(!empty());
@@ -175,12 +175,11 @@ void MotionMaster::DelayedExpire()
--i_top;
}
-void MotionMaster::MoveIdle(MovementSlot slot)
+void MotionMaster::MoveIdle()
{
- //if (empty() || !isStatic(top()))
- // push(&si_idleMovement);
- if (!isStatic(Impl[slot]))
- Mutate(&si_idleMovement, slot);
+ //! Should be preceded by MovementExpired or Clear if there's an overlying movementgenerator active
+ if (empty() || !isStatic(top()))
+ Mutate(&si_idleMovement, MOTION_SLOT_IDLE);
}
void MotionMaster::MoveRandom(float spawndist)
@@ -194,16 +193,23 @@ void MotionMaster::MoveRandom(float spawndist)
void MotionMaster::MoveTargetedHome()
{
- //if (i_owner->HasUnitState(UNIT_STAT_FLEEING))
- // return;
-
Clear(false);
- if (i_owner->GetTypeId() == TYPEID_UNIT)
+ if (i_owner->GetTypeId()==TYPEID_UNIT && !((Creature*)i_owner)->GetCharmerOrOwnerGUID())
{
sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted home", i_owner->GetEntry(), i_owner->GetGUIDLow());
Mutate(new HomeMovementGenerator<Creature>(), MOTION_SLOT_ACTIVE);
}
+ else if (i_owner->GetTypeId()==TYPEID_UNIT && ((Creature*)i_owner)->GetCharmerOrOwnerGUID())
+ {
+ sLog->outStaticDebug("Pet or controlled creature (Entry: %u GUID: %u) targeting home", i_owner->GetEntry(), i_owner->GetGUIDLow() );
+ Unit *target = ((Creature*)i_owner)->GetCharmerOrOwner();
+ if (target)
+ {
+ sLog->outStaticDebug("Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow() );
+ Mutate(new FollowMovementGenerator<Creature>(*target,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE), MOTION_SLOT_ACTIVE);
+ }
+ }
else
{
sLog->outError("Player (GUID: %u) attempt targeted home", i_owner->GetGUIDLow());
@@ -231,14 +237,14 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle)
if (!target || target == i_owner || i_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE))
return;
- i_owner->ClearUnitState(UNIT_STAT_FOLLOW);
+ //i_owner->ClearUnitState(UNIT_STATE_FOLLOW);
if (i_owner->GetTypeId() == TYPEID_PLAYER)
{
sLog->outStaticDebug("Player (GUID: %u) chase to %s (GUID: %u)",
i_owner->GetGUIDLow(),
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
- Mutate(new TargetedMovementGenerator<Player>(*target, dist, angle), MOTION_SLOT_ACTIVE);
+ Mutate(new ChaseMovementGenerator<Player>(*target,dist,angle), MOTION_SLOT_ACTIVE);
}
else
{
@@ -246,7 +252,7 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle)
i_owner->GetEntry(), i_owner->GetGUIDLow(),
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
- Mutate(new TargetedMovementGenerator<Creature>(*target, dist, angle), MOTION_SLOT_ACTIVE);
+ Mutate(new ChaseMovementGenerator<Creature>(*target,dist,angle), MOTION_SLOT_ACTIVE);
}
}
@@ -256,13 +262,13 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo
if (!target || target == i_owner || i_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE))
return;
- i_owner->AddUnitState(UNIT_STAT_FOLLOW);
+ //i_owner->AddUnitState(UNIT_STATE_FOLLOW);
if (i_owner->GetTypeId() == TYPEID_PLAYER)
{
sLog->outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", i_owner->GetGUIDLow(),
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
- Mutate(new TargetedMovementGenerator<Player>(*target, dist, angle), slot);
+ Mutate(new FollowMovementGenerator<Player>(*target,dist,angle), slot);
}
else
{
@@ -270,7 +276,7 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo
i_owner->GetEntry(), i_owner->GetGUIDLow(),
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
- Mutate(new TargetedMovementGenerator<Creature>(*target, dist, angle), slot);
+ Mutate(new FollowMovementGenerator<Creature>(*target,dist,angle), slot);
}
}
@@ -291,54 +297,32 @@ void MotionMaster::MovePoint(uint32 id, float x, float y, float z)
void MotionMaster::MoveLand(uint32 id, Position const& pos, float speed)
{
- if (i_owner->GetTypeId() != TYPEID_UNIT)
- return;
-
- uint32 moveFlag = SPLINEFLAG_FLYING | SPLINEFLAG_ANIMATIONTIER;
- uint32 moveTime = uint32(i_owner->GetExactDist(&pos) / speed) * IN_MILLISECONDS;
-
- // CHARGING state makes the unit use m_TempSpeed and JUMPING prevents sending movement packet in PointMovementGenerator
- i_owner->AddUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
- i_owner->m_TempSpeed = speed;
-
float x, y, z;
pos.GetPosition(x, y, z);
- sLog->outStaticDebug("Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", i_owner->GetEntry(), id, x, y, z);
- Mutate(new PointMovementGenerator<Creature>(id, x, y, z), MOTION_SLOT_ACTIVE);
- MonsterMoveData data;
- data.DestLocation.Relocate(pos);
- data.SplineFlag = moveFlag;
- data.Time = moveTime;
- data.AnimationState = ANIMATION_ON_GROUND;
+ sLog->outStaticDebug("Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", i_owner->GetEntry(), id, x, y, z);
- i_owner->SendMonsterMove(data);
+ Movement::MoveSplineInit init(*i_owner);
+ init.MoveTo(x,y,z);
+ init.SetVelocity(speed);
+ init.SetAnimation(Movement::ToGround);
+ init.Launch();
+ Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE);
}
void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, float speed)
{
- if (i_owner->GetTypeId() != TYPEID_UNIT)
- return;
-
- uint32 moveFlag = SPLINEFLAG_FLYING | SPLINEFLAG_ANIMATIONTIER;
- uint32 moveTime = uint32(i_owner->GetExactDist(&pos) / speed) * IN_MILLISECONDS;
-
- // CHARGING state makes the unit use m_TempSpeed and JUMPING prevents sending movement packet in PointMovementGenerator
- i_owner->AddUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
- i_owner->m_TempSpeed = speed;
-
float x, y, z;
pos.GetPosition(x, y, z);
- sLog->outStaticDebug("Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", i_owner->GetEntry(), id, x, y, z);
- Mutate(new PointMovementGenerator<Creature>(id, x, y, z), MOTION_SLOT_ACTIVE);
- MonsterMoveData data;
- data.DestLocation.Relocate(pos);
- data.SplineFlag = moveFlag;
- data.Time = moveTime;
- data.AnimationState = ANIMATION_FLYING;
+ sLog->outStaticDebug("Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", i_owner->GetEntry(), id, x, y, z);
- i_owner->SendMonsterMove(data);
+ Movement::MoveSplineInit init(*i_owner);
+ init.MoveTo(x,y,z);
+ init.SetVelocity(speed);
+ init.SetAnimation(Movement::ToFly);
+ init.Launch();
+ Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE);
}
void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ)
@@ -348,7 +332,9 @@ void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, floa
return;
float x, y, z;
- float dist = speedXY * speedZ * 0.1f;
+ float moveTimeHalf = speedZ / Movement::gravity;
+ float dist = 2 * moveTimeHalf * speedXY;
+
i_owner->GetNearPoint(i_owner, x, y, z, i_owner->GetObjectSize(), dist, i_owner->GetAngle(srcX, srcY) + M_PI);
MoveJump(x, y, z, speedXY, speedZ);
}
@@ -360,35 +346,51 @@ void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ)
return;
float x, y, z;
- float dist = speedXY * speedZ * 0.1f;
+
+ float moveTimeHalf = speedZ / Movement::gravity;
+ float dist = 2 * moveTimeHalf * speedXY;
i_owner->GetClosePoint(x, y, z, i_owner->GetObjectSize(), dist, angle);
MoveJump(x, y, z, speedXY, speedZ);
}
-void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float speedZ)
+void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float speedZ, uint32 id)
{
- uint32 moveFlag = SPLINEFLAG_TRAJECTORY | SPLINEFLAG_WALKING;
- uint32 time = uint32(speedZ * 100);
+ sLog->outStaticDebug("Unit (GUID: %u) jump to point (X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), x, y, z);
- // Instantly interrupt non melee spells being casted
- if (i_owner->IsNonMeleeSpellCasted(true))
- i_owner->InterruptNonMeleeSpells(true);
+ float moveTimeHalf = speedZ / Movement::gravity;
+ float max_height = -Movement::computeFallElevation(moveTimeHalf,false,-speedZ);
- i_owner->AddUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
- i_owner->m_TempSpeed = speedXY;
+ Movement::MoveSplineInit init(*i_owner);
+ init.MoveTo(x,y,z);
+ init.SetParabolic(max_height,0);
+ init.SetVelocity(speedXY);
+ init.Launch();
if (i_owner->GetTypeId() == TYPEID_PLAYER)
- {
- sLog->outStaticDebug("Player (GUID: %u) jump to point (X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), x, y, z);
- Mutate(new PointMovementGenerator<Player>(0, x, y, z), MOTION_SLOT_CONTROLLED);
- }
+ Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED);
else
+ Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE);
+}
+
+void MotionMaster::MoveFall(uint32 id/*=0*/)
+{
+ // use larger distance for vmap height search than in most other cases
+ float tz = i_owner->GetMap()->GetHeight(i_owner->GetPositionX(), i_owner->GetPositionY(), i_owner->GetPositionZ(), true, MAX_FALL_DISTANCE);
+ if (tz <= INVALID_HEIGHT)
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) jump to point (X: %f Y: %f Z: %f)",
- i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z);
- Mutate(new PointMovementGenerator<Creature>(0, x, y, z), MOTION_SLOT_CONTROLLED);
+ sLog->outStaticDebug("MotionMaster::MoveFall: unable retrive a proper height at map %u (x: %f, y: %f, z: %f).",
+ i_owner->GetMap()->GetId(), i_owner->GetPositionX(), i_owner->GetPositionX(), i_owner->GetPositionZ());
+ return;
}
- i_owner->SendMonsterMove(x, y, z, moveFlag, time, speedZ);
+ // Abort too if the ground is very near
+ if (fabs(i_owner->GetPositionZ() - tz) < 0.1f)
+ return;
+
+ Movement::MoveSplineInit init(*i_owner);
+ init.MoveTo(i_owner->GetPositionX(),i_owner->GetPositionY(),tz);
+ init.SetFall();
+ init.Launch();
+ Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED);
}
void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id)
@@ -396,29 +398,19 @@ void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id)
if (Impl[MOTION_SLOT_CONTROLLED] && Impl[MOTION_SLOT_CONTROLLED]->GetMovementGeneratorType() != DISTRACT_MOTION_TYPE)
return;
- i_owner->AddUnitState(UNIT_STAT_CHARGING);
- i_owner->m_TempSpeed = speed;
if (i_owner->GetTypeId() == TYPEID_PLAYER)
{
sLog->outStaticDebug("Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), x, y, z);
- Mutate(new PointMovementGenerator<Player>(id, x, y, z), MOTION_SLOT_CONTROLLED);
+ Mutate(new PointMovementGenerator<Player>(id, x, y, z, speed), MOTION_SLOT_CONTROLLED);
}
else
{
sLog->outStaticDebug("Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)",
i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z);
- Mutate(new PointMovementGenerator<Creature>(id, x, y, z), MOTION_SLOT_CONTROLLED);
+ Mutate(new PointMovementGenerator<Creature>(id, x, y, z, speed), MOTION_SLOT_CONTROLLED);
}
}
-void MotionMaster::MoveFall(float z, uint32 id)
-{
- i_owner->SetFlying(false);
- i_owner->SendMovementFlagUpdate();
- //AddUnitMovementFlag(MOVEMENTFLAG_FALLING);
- MoveCharge(i_owner->GetPositionX(), i_owner->GetPositionY(), z, SPEED_CHARGE, id);
-}
-
void MotionMaster::MoveSeekAssistance(float x, float y, float z)
{
if (i_owner->GetTypeId() == TYPEID_PLAYER)
@@ -562,7 +554,7 @@ void MotionMaster::MovePath(uint32 path_id, bool repeatable)
//i_owner->GetTypeId() == TYPEID_PLAYER ?
//Mutate(new WaypointMovementGenerator<Player>(path_id, repeatable)):
- Mutate(new WaypointMovementGenerator<Creature>(path_id, repeatable), MOTION_SLOT_IDLE);
+ Mutate(new WaypointMovementGenerator<Creature>(path_id, repeatable), MOTION_SLOT_IDLE);
sLog->outStaticDebug("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)",
i_owner->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature",
@@ -633,8 +625,12 @@ void MotionMaster::DelayedDelete(_Ty curr)
bool MotionMaster::GetDestination(float &x, float &y, float &z)
{
- if (empty())
+ if (i_owner->movespline->Finalized())
return false;
- return top()->GetDestination(x, y, z);
+ const G3D::Vector3& dest = i_owner->movespline->FinalDestination();
+ x = dest.x;
+ y = dest.y;
+ z = dest.z;
+ return true;
}
diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h
index b6fd3a848ac..a5bd0861b04 100755
--- a/src/server/game/Movement/MotionMaster.h
+++ b/src/server/game/Movement/MotionMaster.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@ enum MovementGeneratorType
MAX_DB_MOTION_TYPE = 3, // *** this and below motion types can't be set in DB.
ANIMAL_RANDOM_MOTION_TYPE = MAX_DB_MOTION_TYPE, // AnimalRandomMovementGenerator.h
CONFUSED_MOTION_TYPE = 4, // ConfusedMovementGenerator.h
- TARGETED_MOTION_TYPE = 5, // TargetedMovementGenerator.h
+ CHASE_MOTION_TYPE = 5, // TargetedMovementGenerator.h
HOME_MOTION_TYPE = 6, // HomeMovementGenerator.h
FLIGHT_MOTION_TYPE = 7, // WaypointMovementGenerator.h
POINT_MOTION_TYPE = 8, // PointMovementGenerator.h
@@ -48,8 +48,10 @@ enum MovementGeneratorType
ASSISTANCE_MOTION_TYPE= 11, // PointMovementGenerator.h (first part of flee for assistance)
ASSISTANCE_DISTRACT_MOTION_TYPE = 12, // IdleMovementGenerator.h (second part of flee for assistance)
TIMED_FLEEING_MOTION_TYPE = 13, // FleeingMovementGenerator.h (alt.second part of flee for assistance)
- ROTATE_MOTION_TYPE = 14,
- NULL_MOTION_TYPE = 15,
+ FOLLOW_MOTION_TYPE = 14,
+ ROTATE_MOTION_TYPE = 15,
+ EFFECT_MOTION_TYPE = 16,
+ NULL_MOTION_TYPE = 17,
};
enum MovementSlot
@@ -86,7 +88,6 @@ class MotionMaster //: private std::stack<MovementGenerator *>
typedef std::vector<_Ty> ExpireList;
int i_top;
- bool empty() const { return (i_top < 0); }
void pop() { Impl[i_top] = NULL; --i_top; }
void push(_Ty _Val) { ++i_top; Impl[i_top] = _Val; }
@@ -107,6 +108,7 @@ class MotionMaster //: private std::stack<MovementGenerator *>
void Initialize();
void InitDefault();
+ bool empty() const { return (i_top < 0); }
int size() const { return i_top + 1; }
_Ty top() const { return Impl[i_top]; }
_Ty GetMotionSlot(int slot) const { return Impl[slot]; }
@@ -142,7 +144,7 @@ class MotionMaster //: private std::stack<MovementGenerator *>
DirectExpire(reset);
}
- void MoveIdle(MovementSlot slot = MOTION_SLOT_ACTIVE);
+ void MoveIdle();
void MoveTargetedHome();
void MoveRandom(float spawndist = 0.0f);
void MoveFollow(Unit* target, float dist, float angle, MovementSlot slot = MOTION_SLOT_ACTIVE);
@@ -158,10 +160,11 @@ class MotionMaster //: private std::stack<MovementGenerator *>
void MoveTakeoff(uint32 id, Position const& pos, float speed);
void MoveCharge(float x, float y, float z, float speed = SPEED_CHARGE, uint32 id = EVENT_CHARGE);
- void MoveFall(float z, uint32 id = 0);
void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ);
void MoveJumpTo(float angle, float speedXY, float speedZ);
- void MoveJump(float x, float y, float z, float speedXY, float speedZ);
+ void MoveJump(float x, float y, float z, float speedXY, float speedZ, uint32 id = 0);
+ void MoveFall(uint32 id = 0);
+
void MoveSeekAssistance(float x, float y, float z);
void MoveSeekAssistanceDistract(uint32 timer);
void MoveTaxiFlight(uint32 path, uint32 pathnode);
diff --git a/src/server/game/Movement/MovementGenerator.cpp b/src/server/game/Movement/MovementGenerator.cpp
index eee874f05ac..73921ea86ff 100755
--- a/src/server/game/Movement/MovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,4 +21,3 @@
MovementGenerator::~MovementGenerator()
{
}
-
diff --git a/src/server/game/Movement/MovementGenerator.h b/src/server/game/Movement/MovementGenerator.h
index 32f5da1db0c..dd9ba32f337 100755
--- a/src/server/game/Movement/MovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,8 +43,6 @@ class MovementGenerator
virtual MovementGeneratorType GetMovementGeneratorType() = 0;
virtual void unitSpeedChanged() { }
-
- virtual bool GetDestination(float& /*x*/, float& /*y*/, float& /*z*/) const { return false; }
};
template<class T, class D>
diff --git a/src/server/game/Movement/MovementGeneratorImpl.h b/src/server/game/Movement/MovementGeneratorImpl.h
index 6e6bf4b6e62..725b309e3f1 100755
--- a/src/server/game/Movement/MovementGeneratorImpl.h
+++ b/src/server/game/Movement/MovementGeneratorImpl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 7c3b26c2646..32b960028c2 100755
--- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -18,10 +18,11 @@
#include "Creature.h"
#include "MapManager.h"
-#include "Opcodes.h"
#include "ConfusedMovementGenerator.h"
-#include "DestinationHolderImp.h"
#include "VMapFactory.h"
+#include "MoveSplineInit.h"
+#include "MoveSpline.h"
+#include "Player.h"
#ifdef MAP_BASED_RAND_GEN
#define rand_norm() unit.rand_norm()
@@ -31,8 +32,8 @@
template<class T>
void ConfusedMovementGenerator<T>::Initialize(T &unit)
{
- float const wanderDistance = 4;
- float x, y, z;
+ const float wander_distance=4;
+ float x,y,z;
x = unit.GetPositionX();
y = unit.GetPositionY();
z = unit.GetPositionZ();
@@ -44,52 +45,33 @@ void ConfusedMovementGenerator<T>::Initialize(T &unit)
bool is_water_ok, is_land_ok;
_InitSpecific(unit, is_water_ok, is_land_ok);
- for (uint8 idx = 0; idx <= MAX_CONF_WAYPOINTS; ++idx)
+ for (uint8 idx = 0; idx < MAX_CONF_WAYPOINTS + 1; ++idx)
{
- float wanderX = x + wanderDistance * (float)rand_norm() - wanderDistance/2;
- float wanderY = y + wanderDistance * (float)rand_norm() - wanderDistance/2;
- Trinity::NormalizeMapCoord(wanderX);
- Trinity::NormalizeMapCoord(wanderY);
+ const float wanderX=wander_distance*(float)rand_norm() - wander_distance/2;
+ const float wanderY=wander_distance*(float)rand_norm() - wander_distance/2;
- float new_z = map->GetHeight(wanderX, wanderY, z, true);
- if (new_z > INVALID_HEIGHT && unit.IsWithinLOS(wanderX, wanderY, new_z))
- {
- // Don't move in water if we're not already in
- // Don't move on land if we're not already on it either
- bool is_water_now = map->IsInWater(x, y, z);
- bool is_water_next = map->IsInWater(wanderX, wanderY, new_z);
- if ((is_water_now && !is_water_next && !is_land_ok) || (!is_water_now && is_water_next && !is_water_ok))
- {
- i_waypoints[idx][0] = idx > 0 ? i_waypoints[idx-1][0] : x; // Back to previous location
- i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx-1][1] : y;
- i_waypoints[idx][2] = idx > 0 ? i_waypoints[idx-1][2] : z;
- continue;
- }
-
- // Taken from FleeingMovementGenerator
- if (!(new_z - z) || wanderDistance / fabs(new_z - z) > 1.0f)
- {
- i_waypoints[idx][0] = wanderX;
- i_waypoints[idx][1] = wanderY;
- i_waypoints[idx][2] = new_z;
- continue;
- }
- }
- else // Back to previous location
+ i_waypoints[idx][0] = x + wanderX;
+ i_waypoints[idx][1] = y + wanderY;
+
+ // prevent invalid coordinates generation
+ Trinity::NormalizeMapCoord(i_waypoints[idx][0]);
+ Trinity::NormalizeMapCoord(i_waypoints[idx][1]);
+
+ bool is_water = map->IsInWater(i_waypoints[idx][0],i_waypoints[idx][1],z);
+ // if generated wrong path just ignore
+ if ((is_water && !is_water_ok) || (!is_water && !is_land_ok))
{
i_waypoints[idx][0] = idx > 0 ? i_waypoints[idx-1][0] : x;
i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx-1][1] : y;
- i_waypoints[idx][2] = idx > 0 ? i_waypoints[idx-1][2] : z;
- continue;
}
+
+ unit.UpdateAllowedPositionZ(i_waypoints[idx][0], i_waypoints[idx][1], z);
+ i_waypoints[idx][2] = z;
}
- unit.SetTarget(0);
- unit.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
- unit.CastStop();
unit.StopMoving();
- unit.AddUnitMovementFlag(MOVEMENTFLAG_WALKING); // Should actually be splineflag
- unit.AddUnitState(UNIT_STAT_CONFUSED);
+ unit.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
+ unit.AddUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE);
}
template<>
@@ -111,69 +93,70 @@ void ConfusedMovementGenerator<T>::Reset(T &unit)
{
i_nextMove = 1;
i_nextMoveTime.Reset(0);
- i_destinationHolder.ResetUpdate();
unit.StopMoving();
+ unit.AddUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE);
}
template<class T>
-bool ConfusedMovementGenerator<T>::Update(T &unit, const uint32 diff)
+bool ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff)
{
- if (!&unit)
- return true;
-
- if (unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
+ if (unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
return true;
if (i_nextMoveTime.Passed())
{
// currently moving, update location
- Traveller<T> traveller(unit);
- if (i_destinationHolder.UpdateTraveller(traveller, diff))
+ unit.AddUnitState(UNIT_STATE_CONFUSED_MOVE);
+
+ if (unit.movespline->Finalized())
{
- if (i_destinationHolder.HasArrived())
- {
- // arrived, stop and wait a bit
- unit.ClearUnitState(UNIT_STAT_MOVE);
-
- i_nextMove = urand(1, MAX_CONF_WAYPOINTS);
- i_nextMoveTime.Reset(urand(100, 1000));
- }
+ i_nextMove = urand(1,MAX_CONF_WAYPOINTS);
+ i_nextMoveTime.Reset(urand(0, 1500-1)); // TODO: check the minimum reset time, should be probably higher
}
}
else
{
// waiting for next move
i_nextMoveTime.Update(diff);
- if (i_nextMoveTime.Passed())
+ if(i_nextMoveTime.Passed() )
{
// start moving
- ASSERT(i_nextMove <= MAX_CONF_WAYPOINTS);
- const float x = i_waypoints[i_nextMove][0];
- const float y = i_waypoints[i_nextMove][1];
- const float z = i_waypoints[i_nextMove][2];
- Traveller<T> traveller(unit);
- i_destinationHolder.SetDestination(traveller, x, y, z);
+ unit.AddUnitState(UNIT_STATE_CONFUSED_MOVE);
+
+ ASSERT( i_nextMove <= MAX_CONF_WAYPOINTS );
+ float x = i_waypoints[i_nextMove][0];
+ float y = i_waypoints[i_nextMove][1];
+ float z = i_waypoints[i_nextMove][2];
+ Movement::MoveSplineInit init(unit);
+ init.MoveTo(x, y, z);
+ init.SetWalk(true);
+ init.Launch();
}
}
+
return true;
}
-template<class T>
-void ConfusedMovementGenerator<T>::Finalize(T &unit)
+template<>
+void ConfusedMovementGenerator<Player>::Finalize(Player &unit)
{
unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
- unit.ClearUnitState(UNIT_STAT_CONFUSED);
+ unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE);
+}
- if (unit.GetTypeId() == TYPEID_UNIT && unit.getVictim())
+template<>
+void ConfusedMovementGenerator<Creature>::Finalize(Creature &unit)
+{
+ unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
+ unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE);
+ if (unit.getVictim())
unit.SetTarget(unit.getVictim()->GetGUID());
}
template void ConfusedMovementGenerator<Player>::Initialize(Player &player);
template void ConfusedMovementGenerator<Creature>::Initialize(Creature &creature);
-template void ConfusedMovementGenerator<Player>::Finalize(Player &player);
-template void ConfusedMovementGenerator<Creature>::Finalize(Creature &creature);
template void ConfusedMovementGenerator<Player>::Reset(Player &player);
template void ConfusedMovementGenerator<Creature>::Reset(Creature &creature);
-template bool ConfusedMovementGenerator<Player>::Update(Player &player, const uint32 diff);
-template bool ConfusedMovementGenerator<Creature>::Update(Creature &creature, const uint32 diff);
+template bool ConfusedMovementGenerator<Player>::Update(Player &player, const uint32 &diff);
+template bool ConfusedMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff);
diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h
index 51faab16c27..b9f96bb785d 100755
--- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -20,8 +20,7 @@
#define TRINITY_CONFUSEDGENERATOR_H
#include "MovementGenerator.h"
-#include "DestinationHolder.h"
-#include "Traveller.h"
+#include "Timer.h"
#define MAX_CONF_WAYPOINTS 24
@@ -35,21 +34,13 @@ class ConfusedMovementGenerator
void Initialize(T &);
void Finalize(T &);
void Reset(T &);
- bool Update(T &, const uint32);
-
- bool GetDestination(float &x, float &y, float &z) const
- {
- if (i_destinationHolder.HasArrived()) return false;
- i_destinationHolder.GetDestination(x, y, z);
- return true;
- }
+ bool Update(T &, const uint32 &);
MovementGeneratorType GetMovementGeneratorType() { return CONFUSED_MOTION_TYPE; }
private:
void _InitSpecific(T &, bool &, bool &);
TimeTracker i_nextMoveTime;
float i_waypoints[MAX_CONF_WAYPOINTS+1][3];
- DestinationHolder< Traveller<T> > i_destinationHolder;
uint32 i_nextMove;
};
#endif
diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
index 5f84d6bc7b0..ed5b73dd378 100755
--- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -20,8 +20,9 @@
#include "CreatureAI.h"
#include "MapManager.h"
#include "FleeingMovementGenerator.h"
-#include "DestinationHolderImp.h"
#include "ObjectAccessor.h"
+#include "MoveSplineInit.h"
+#include "MoveSpline.h"
#define MIN_QUIET_DISTANCE 28.0f
#define MAX_QUIET_DISTANCE 43.0f
@@ -33,7 +34,7 @@ FleeingMovementGenerator<T>::_setTargetLocation(T &owner)
if (!&owner)
return;
- if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
+ if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
return;
if (!_setMoveData(owner))
@@ -43,25 +44,12 @@ FleeingMovementGenerator<T>::_setTargetLocation(T &owner)
if (!_getPoint(owner, x, y, z))
return;
- owner.AddUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
- Traveller<T> traveller(owner);
- i_destinationHolder.SetDestination(traveller, x, y, z);
-}
-
-template<>
-bool FleeingMovementGenerator<Creature>::GetDestination(float &x, float &y, float &z) const
-{
- if (i_destinationHolder.HasArrived())
- return false;
+ owner.AddUnitState(UNIT_STATE_FLEEING_MOVE);
- i_destinationHolder.GetDestination(x, y, z);
- return true;
-}
-
-template<>
-bool FleeingMovementGenerator<Player>::GetDestination(float & /*x*/, float & /*y*/, float & /*z*/) const
-{
- return false;
+ Movement::MoveSplineInit init(owner);
+ init.MoveTo(x,y,z);
+ init.SetWalk(false);
+ init.Launch();
}
template<class T>
@@ -75,10 +63,10 @@ FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float &z)
y = owner.GetPositionY();
z = owner.GetPositionZ();
- float temp_x, temp_y, angle = 0;
+ float temp_x, temp_y, angle;
const Map* _map = owner.GetBaseMap();
//primitive path-finding
- for (uint8 i = 0; i < 18; ++i)
+ for(uint8 i = 0; i < 18; ++i)
{
if (i_only_forward && i > 2)
break;
@@ -143,11 +131,11 @@ FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float &z)
distance /= 4;
break;
case 15:
- angle = i_cur_angle + static_cast<float>(M_PI*3/4);
+ angle = i_cur_angle + static_cast<float>(3*M_PI/4);
distance /= 2;
break;
case 16:
- angle = i_cur_angle - static_cast<float>(M_PI*3/4);
+ angle = i_cur_angle - static_cast<float>(3*M_PI/4);
distance /= 2;
break;
case 17:
@@ -161,9 +149,9 @@ FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float &z)
Trinity::NormalizeMapCoord(temp_y);
if (owner.IsWithinLOS(temp_x, temp_y, z))
{
- bool is_water_now = _map->IsInWater(x, y, z);
+ bool is_water_now = _map->IsInWater(x,y,z);
- if (is_water_now && _map->IsInWater(temp_x, temp_y, z))
+ if (is_water_now && _map->IsInWater(temp_x,temp_y,z))
{
x = temp_x;
y = temp_y;
@@ -181,8 +169,8 @@ FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float &z)
if (!(new_z - z) || distance / fabs(new_z - z) > 1.0f)
{
- float new_z_left = _map->GetHeight(temp_x + (float)(cos(angle+M_PI/2)), temp_y + (float)(sin(angle+M_PI/2)), z, true);
- float new_z_right = _map->GetHeight(temp_x + (float)(cos(angle-M_PI/2)), temp_y + (float)(sin(angle-M_PI/2)), z, true);
+ float new_z_left = _map->GetHeight(temp_x + 1.0f*cos(angle+static_cast<float>(M_PI/2)),temp_y + 1.0f*sin(angle+static_cast<float>(M_PI/2)),z,true);
+ float new_z_right = _map->GetHeight(temp_x + 1.0f*cos(angle-static_cast<float>(M_PI/2)),temp_y + 1.0f*sin(angle-static_cast<float>(M_PI/2)),z,true);
if (fabs(new_z_left - new_z) < 1.2f && fabs(new_z_right - new_z) < 1.2f)
{
x = temp_x;
@@ -194,7 +182,7 @@ FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float &z)
}
}
i_to_distance_from_caster = 0.0f;
- i_nextCheckTime.Reset(urand(500, 1000));
+ i_nextCheckTime.Reset( urand(500,1000) );
return false;
}
@@ -213,12 +201,12 @@ FleeingMovementGenerator<T>::_setMoveData(T &owner)
(i_last_distance_from_caster < i_to_distance_from_caster && cur_dist_xyz > i_to_distance_from_caster) ||
// if we reach bigger distance
(cur_dist_xyz > MAX_QUIET_DISTANCE) || // if we are too far
- (i_last_distance_from_caster > MIN_QUIET_DISTANCE && cur_dist_xyz < MIN_QUIET_DISTANCE))
+ (i_last_distance_from_caster > MIN_QUIET_DISTANCE && cur_dist_xyz < MIN_QUIET_DISTANCE) )
// if we leave 'quiet zone'
{
// we are very far or too close, stopping
i_to_distance_from_caster = 0.0f;
- i_nextCheckTime.Reset(urand(500, 1000));
+ i_nextCheckTime.Reset( urand(500,1000) );
return false;
}
else
@@ -232,9 +220,7 @@ FleeingMovementGenerator<T>::_setMoveData(T &owner)
float cur_dist;
float angle_to_caster;
- Unit* fright = ObjectAccessor::GetUnit(owner, i_frightGUID);
-
- if (fright)
+ if (Unit* fright = ObjectAccessor::GetUnit(owner, i_frightGUID))
{
cur_dist = fright->GetDistance(&owner);
if (cur_dist < cur_dist_xyz)
@@ -284,7 +270,7 @@ FleeingMovementGenerator<T>::_setMoveData(T &owner)
i_to_distance_from_caster = MIN_QUIET_DISTANCE + 2.5f + (float)rand_norm()*(MAX_QUIET_DISTANCE - MIN_QUIET_DISTANCE - 2.5f);
}
- int8 sign = rand_norm() > 0.5f ? 1 : -1;
+ int8 sign = (float)rand_norm() > 0.5f ? 1 : -1;
i_cur_angle = sign*angle + angle_to_caster;
// current distance
@@ -300,14 +286,12 @@ FleeingMovementGenerator<T>::Initialize(T &owner)
if (!&owner)
return;
- _Init(owner);
- owner.CastStop();
- owner.AddUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
owner.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
- owner.SetTarget(0);
- owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ owner.AddUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
- if (Unit* fright = ObjectAccessor::GetUnit(owner, i_frightGUID))
+ _Init(owner);
+
+ if (Unit *fright = ObjectAccessor::GetUnit(owner, i_frightGUID))
{
i_caster_x = fright->GetPositionX();
i_caster_y = fright->GetPositionY();
@@ -334,6 +318,7 @@ FleeingMovementGenerator<Creature>::_Init(Creature &owner)
if (!&owner)
return;
+ //owner.SetTargetGuid(ObjectGuid());
is_water_ok = owner.canSwim();
is_land_ok = owner.canWalk();
}
@@ -346,51 +331,44 @@ FleeingMovementGenerator<Player>::_Init(Player &)
is_land_ok = true;
}
-template<class T>
-void
-FleeingMovementGenerator<T>::Finalize(T &owner)
+template<>
+void FleeingMovementGenerator<Player>::Finalize(Player &owner)
+{
+ owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
+ owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
+}
+
+template<>
+void FleeingMovementGenerator<Creature>::Finalize(Creature &owner)
{
owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
- owner.ClearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
- if (owner.GetTypeId() == TYPEID_UNIT && owner.getVictim())
+ owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
+ if (owner.getVictim())
owner.SetTarget(owner.getVictim()->GetGUID());
}
template<class T>
-void
-FleeingMovementGenerator<T>::Reset(T &owner)
+void FleeingMovementGenerator<T>::Reset(T &owner)
{
Initialize(owner);
}
template<class T>
bool
-FleeingMovementGenerator<T>::Update(T &owner, const uint32 time_diff)
+FleeingMovementGenerator<T>::Update(T &owner, const uint32 &time_diff)
{
if (!&owner || !owner.isAlive())
return false;
- if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
+ if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
+ {
+ owner.ClearUnitState(UNIT_STATE_FLEEING_MOVE);
return true;
-
- Traveller<T> traveller(owner);
+ }
i_nextCheckTime.Update(time_diff);
-
- if ((owner.IsStopped() && !i_destinationHolder.HasArrived()) || !i_destinationHolder.HasDestination())
- {
+ if (i_nextCheckTime.Passed() && owner.movespline->Finalized())
_setTargetLocation(owner);
- return true;
- }
- if (i_destinationHolder.UpdateTraveller(traveller, time_diff))
- {
- i_destinationHolder.ResetUpdate(50);
- if (i_nextCheckTime.Passed() && i_destinationHolder.HasArrived())
- {
- _setTargetLocation(owner);
- return true;
- }
- }
return true;
}
@@ -402,17 +380,15 @@ template bool FleeingMovementGenerator<Player>::_getPoint(Player &, float &, flo
template bool FleeingMovementGenerator<Creature>::_getPoint(Creature &, float &, float &, float &);
template void FleeingMovementGenerator<Player>::_setTargetLocation(Player &);
template void FleeingMovementGenerator<Creature>::_setTargetLocation(Creature &);
-template void FleeingMovementGenerator<Player>::Finalize(Player &);
-template void FleeingMovementGenerator<Creature>::Finalize(Creature &);
template void FleeingMovementGenerator<Player>::Reset(Player &);
template void FleeingMovementGenerator<Creature>::Reset(Creature &);
-template bool FleeingMovementGenerator<Player>::Update(Player &, const uint32);
-template bool FleeingMovementGenerator<Creature>::Update(Creature &, const uint32);
+template bool FleeingMovementGenerator<Player>::Update(Player &, const uint32 &);
+template bool FleeingMovementGenerator<Creature>::Update(Creature &, const uint32 &);
void TimedFleeingMovementGenerator::Finalize(Unit &owner)
{
owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
- owner.ClearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
+ owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
if (Unit* victim = owner.getVictim())
{
if (owner.isAlive())
@@ -428,14 +404,21 @@ bool TimedFleeingMovementGenerator::Update(Unit & owner, const uint32 time_diff)
if (!owner.isAlive())
return false;
- if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
+ if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
+ {
+ owner.ClearUnitState(UNIT_STATE_FLEEING_MOVE);
return true;
+ }
+
+ i_totalFleeTime.Update(time_diff);
+ if (i_totalFleeTime.Passed())
+ return false;
i_totalFleeTime.Update(time_diff);
if (i_totalFleeTime.Passed())
return false;
- // This calls grant-parent Update method hiden by FleeingMovementGenerator::Update(Creature &, const uint32) version
+ // This calls grant-parent Update method hiden by FleeingMovementGenerator::Update(Creature &, const uint32 &) version
// This is done instead of casting Unit& to Creature& and call parent method, then we can use Unit directly
return MovementGeneratorMedium< Creature, FleeingMovementGenerator<Creature> >::Update(owner, time_diff);
}
diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h
index 8ef1478cff2..750db52bb5a 100755
--- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -20,8 +20,6 @@
#define TRINITY_FLEEINGMOVEMENTGENERATOR_H
#include "MovementGenerator.h"
-#include "DestinationHolder.h"
-#include "Traveller.h"
template<class T>
class FleeingMovementGenerator
@@ -33,8 +31,7 @@ class FleeingMovementGenerator
void Initialize(T &);
void Finalize(T &);
void Reset(T &);
- bool Update(T &, const uint32);
- bool GetDestination(float &x, float &y, float &z) const;
+ bool Update(T &, const uint32 &);
MovementGeneratorType GetMovementGeneratorType() { return FLEEING_MOTION_TYPE; }
@@ -56,8 +53,6 @@ class FleeingMovementGenerator
float i_cur_angle;
uint64 i_frightGUID;
TimeTracker i_nextCheckTime;
-
- DestinationHolder< Traveller<T> > i_destinationHolder;
};
class TimedFleeingMovementGenerator
diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
index 9f9172e393d..dc47898352e 100755
--- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -19,22 +19,16 @@
#include "HomeMovementGenerator.h"
#include "Creature.h"
#include "CreatureAI.h"
-#include "Traveller.h"
-#include "DestinationHolderImp.h"
#include "WorldPacket.h"
+#include "MoveSplineInit.h"
+#include "MoveSpline.h"
void HomeMovementGenerator<Creature>::Initialize(Creature & owner)
{
- owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
- owner.AddUnitState(UNIT_STAT_EVADE);
+ owner.AddUnitState(UNIT_STATE_EVADE);
_setTargetLocation(owner);
}
-void HomeMovementGenerator<Creature>::Finalize(Creature & owner)
-{
- owner.ClearUnitState(UNIT_STAT_EVADE);
-}
-
void HomeMovementGenerator<Creature>::Reset(Creature &)
{
}
@@ -44,45 +38,38 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
if (!&owner)
return;
- if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
+ if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
return;
- float x, y, z;
- owner.GetHomePosition(x, y, z, ori);
+ Movement::MoveSplineInit init(owner);
+ float x, y, z, o;
+ // at apply we can select more nice return points base at current movegen
+ //if (owner.GetMotionMaster()->empty() || !owner.GetMotionMaster()->top()->GetResetPosition(owner,x,y,z))
+ //{
+ owner.GetHomePosition(x, y, z, o);
+ init.SetFacing(o);
+ //}
+ init.MoveTo(x,y,z);
+ init.SetWalk(false);
+ init.Launch();
- CreatureTraveller traveller(owner);
-
- uint32 travel_time = i_destinationHolder.SetDestination(traveller, x, y, z);
- modifyTravelTime(travel_time);
- owner.ClearUnitState(uint32(UNIT_STAT_ALL_STATE & ~UNIT_STAT_EVADE));
+ arrived = false;
+ owner.ClearUnitState(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE);
}
bool HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32 time_diff)
{
- CreatureTraveller traveller(owner);
- i_destinationHolder.UpdateTraveller(traveller, time_diff);
+ arrived = owner.movespline->Finalized();
+ return !arrived;
+}
- if (time_diff > i_travel_timer)
+void HomeMovementGenerator<Creature>::Finalize(Creature& owner)
+{
+ if (arrived)
{
- owner.AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
-
- // restore orientation of not moving creature at returning to home
- if (owner.GetDefaultMovementType() == IDLE_MOTION_TYPE)
- {
- //sLog->outDebug("Entering HomeMovement::GetDestination(z, y, z)");
- owner.SetOrientation(ori);
- WorldPacket packet;
- owner.BuildHeartBeatMsg(&packet);
- owner.SendMessageToSet(&packet, false);
- }
-
- owner.ClearUnitState(UNIT_STAT_EVADE);
+ owner.ClearUnitState(UNIT_STATE_EVADE);
+ owner.SetWalk(true);
owner.LoadCreaturesAddon(true);
owner.AI()->JustReachedHome();
- return false;
}
-
- i_travel_timer -= time_diff;
-
- return true;
}
diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h
index 43f52639c4b..c724edc91ff 100755
--- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -20,8 +20,6 @@
#define TRINITY_HOMEMOVEMENTGENERATOR_H
#include "MovementGenerator.h"
-#include "DestinationHolder.h"
-#include "Traveller.h"
class Creature;
@@ -34,24 +32,18 @@ class HomeMovementGenerator<Creature>
{
public:
- HomeMovementGenerator() {}
+ HomeMovementGenerator() : arrived(false) {}
~HomeMovementGenerator() {}
void Initialize(Creature &);
void Finalize(Creature &);
void Reset(Creature &);
bool Update(Creature &, const uint32);
- void modifyTravelTime(uint32 travel_time) { i_travel_timer = travel_time; }
MovementGeneratorType GetMovementGeneratorType() { return HOME_MOTION_TYPE; }
- bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x, y, z); return true; }
-
private:
void _setTargetLocation(Creature &);
- DestinationHolder< Traveller<Creature> > i_destinationHolder;
-
- float ori;
- uint32 i_travel_timer;
+ bool arrived;
};
#endif
diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp
index 91ac4627679..36561e00b93 100755
--- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,19 +32,19 @@ void IdleMovementGenerator::Initialize(Unit &owner)
void
IdleMovementGenerator::Reset(Unit& owner)
{
- if (owner.HasUnitState(UNIT_STAT_MOVE))
+ if (owner.HasUnitState(UNIT_STATE_MOVE))
owner.StopMoving();
}
void RotateMovementGenerator::Initialize(Unit& owner)
{
- if (owner.HasUnitState(UNIT_STAT_MOVE))
+ if (owner.HasUnitState(UNIT_STATE_MOVE))
owner.StopMoving();
if (owner.getVictim())
owner.SetInFront(owner.getVictim());
- owner.AddUnitState(UNIT_STAT_ROTATING);
+ owner.AddUnitState(UNIT_STATE_ROTATING);
owner.AttackStop();
}
@@ -75,7 +75,7 @@ bool RotateMovementGenerator::Update(Unit& owner, const uint32 diff)
void RotateMovementGenerator::Finalize(Unit &unit)
{
- unit.ClearUnitState(UNIT_STAT_ROTATING);
+ unit.ClearUnitState(UNIT_STATE_ROTATING);
if (unit.GetTypeId() == TYPEID_UNIT)
unit.ToCreature()->AI()->MovementInform(ROTATE_MOTION_TYPE, 0);
}
@@ -83,13 +83,13 @@ void RotateMovementGenerator::Finalize(Unit &unit)
void
DistractMovementGenerator::Initialize(Unit& owner)
{
- owner.AddUnitState(UNIT_STAT_DISTRACTED);
+ owner.AddUnitState(UNIT_STATE_DISTRACTED);
}
void
DistractMovementGenerator::Finalize(Unit& owner)
{
- owner.ClearUnitState(UNIT_STAT_DISTRACTED);
+ owner.ClearUnitState(UNIT_STATE_DISTRACTED);
}
bool
@@ -105,7 +105,7 @@ DistractMovementGenerator::Update(Unit& /*owner*/, const uint32 time_diff)
void
AssistanceDistractMovementGenerator::Finalize(Unit &unit)
{
- unit.ClearUnitState(UNIT_STAT_DISTRACTED);
+ unit.ClearUnitState(UNIT_STATE_DISTRACTED);
unit.ToCreature()->SetReactState(REACT_AGGRESSIVE);
}
diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h
index 9d8cafd2c4e..8180a86c49b 100755
--- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 6d5c803bea8..02f9ebce847 100755
--- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -20,84 +20,84 @@
#include "Errors.h"
#include "Creature.h"
#include "CreatureAI.h"
-#include "DestinationHolderImp.h"
#include "World.h"
+#include "MoveSplineInit.h"
+#include "MoveSpline.h"
+#include "Player.h"
//----- Point Movement Generator
template<class T>
void PointMovementGenerator<T>::Initialize(T &unit)
{
- unit.StopMoving();
- Traveller<T> traveller(unit);
- // OLD: knockback effect has UNIT_STAT_JUMPING set, so if here we disable sentmonstermove there will be creature position sync problem between client and server
- // NEW: reactivated this check - UNIT_STAT_JUMPING is only used in MoveJump, which sends its own packet
- i_destinationHolder.SetDestination(traveller, i_x, i_y, i_z, /*true*/ !unit.HasUnitState(UNIT_STAT_JUMPING));
+ if (!unit.IsStopped())
+ unit.StopMoving();
+
+ unit.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
+ Movement::MoveSplineInit init(unit);
+ init.MoveTo(i_x, i_y, i_z);
+ if (speed > 0.0f)
+ init.SetVelocity(speed);
+ init.Launch();
}
template<class T>
-bool PointMovementGenerator<T>::Update(T &unit, const uint32 diff)
+bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
{
if (!&unit)
return false;
- if (unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
+ if(unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
{
- if (unit.HasUnitState(UNIT_STAT_CHARGING))
- return false;
- else
- return true;
+ unit.ClearUnitState(UNIT_STATE_ROAMING_MOVE);
+ return true;
}
- Traveller<T> traveller(unit);
-
- i_destinationHolder.UpdateTraveller(traveller, diff);
-
- if (i_destinationHolder.HasArrived())
- {
- unit.ClearUnitState(UNIT_STAT_MOVE);
- arrived = true;
- return false;
- }
- else if (!unit.HasUnitState(UNIT_STAT_MOVE) && !unit.HasUnitState(UNIT_STAT_JUMPING))
- {
- i_destinationHolder.StartTravel(traveller);
- }
-
- return true;
+ unit.AddUnitState(UNIT_STATE_ROAMING_MOVE);
+ return !unit.movespline->Finalized();
}
template<class T>
void PointMovementGenerator<T>:: Finalize(T &unit)
{
- if (unit.HasUnitState(UNIT_STAT_CHARGING))
- unit.ClearUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
- if (arrived) // without this crash!
+ unit.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
+
+ if (unit.movespline->Finalized())
MovementInform(unit);
}
template<class T>
+void PointMovementGenerator<T>::Reset(T &unit)
+{
+ if (!unit.IsStopped())
+ unit.StopMoving();
+
+ unit.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
+}
+
+template<class T>
void PointMovementGenerator<T>::MovementInform(T & /*unit*/)
{
}
template <> void PointMovementGenerator<Creature>::MovementInform(Creature &unit)
{
- if (id == EVENT_FALL_GROUND)
- {
- unit.setDeathState(JUST_DIED);
- unit.SetFlying(true);
- }
- unit.AI()->MovementInform(POINT_MOTION_TYPE, id);
+ //if (id == EVENT_FALL_GROUND)
+ //{
+ // unit.setDeathState(JUST_DIED);
+ // unit.SetFlying(true);
+ //}
+ if (unit.AI())
+ unit.AI()->MovementInform(POINT_MOTION_TYPE, id);
}
template void PointMovementGenerator<Player>::Initialize(Player&);
-template bool PointMovementGenerator<Player>::Update(Player &, const uint32 diff);
-template void PointMovementGenerator<Player>::MovementInform(Player&);
-template void PointMovementGenerator<Player>::Finalize(Player&);
-
template void PointMovementGenerator<Creature>::Initialize(Creature&);
-template bool PointMovementGenerator<Creature>::Update(Creature&, const uint32 diff);
+template void PointMovementGenerator<Player>::Finalize(Player&);
template void PointMovementGenerator<Creature>::Finalize(Creature&);
+template void PointMovementGenerator<Player>::Reset(Player&);
+template void PointMovementGenerator<Creature>::Reset(Creature&);
+template bool PointMovementGenerator<Player>::Update(Player &, const uint32 &);
+template bool PointMovementGenerator<Creature>::Update(Creature&, const uint32 &);
void AssistanceMovementGenerator::Finalize(Unit &unit)
{
@@ -107,3 +107,24 @@ void AssistanceMovementGenerator::Finalize(Unit &unit)
unit.GetMotionMaster()->MoveSeekAssistanceDistract(sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY));
}
+bool EffectMovementGenerator::Update(Unit &unit, const uint32)
+{
+ return !unit.movespline->Finalized();
+}
+
+void EffectMovementGenerator::Finalize(Unit &unit)
+{
+ if (unit.GetTypeId() != TYPEID_UNIT)
+ return;
+
+ if (((Creature&)unit).AI() && unit.movespline->Finalized())
+ ((Creature&)unit).AI()->MovementInform(EFFECT_MOTION_TYPE, m_Id);
+ // Need restore previous movement since we have no proper states system
+ //if (unit.isAlive() && !unit.HasUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_FLEEING))
+ //{
+ // if (Unit * victim = unit.getVictim())
+ // unit.GetMotionMaster()->MoveChase(victim);
+ // else
+ // unit.GetMotionMaster()->Initialize();
+ //}
+}
diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
index 3d936de1ae7..e47f3d93450 100755
--- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -20,8 +20,6 @@
#define TRINITY_POINTMOVEMENTGENERATOR_H
#include "MovementGenerator.h"
-#include "DestinationHolder.h"
-#include "Traveller.h"
#include "FollowerReference.h"
template<class T>
@@ -29,13 +27,13 @@ class PointMovementGenerator
: public MovementGeneratorMedium< T, PointMovementGenerator<T> >
{
public:
- PointMovementGenerator(uint32 _id, float _x, float _y, float _z) : id(_id),
- i_x(_x), i_y(_y), i_z(_z), i_nextMoveTime(0), arrived(false) {}
+ PointMovementGenerator(uint32 _id, float _x, float _y, float _z, float _speed = 0.0f) : id(_id),
+ i_x(_x), i_y(_y), i_z(_z), speed(_speed) {}
void Initialize(T &);
- void Finalize(T &unit);
- void Reset(T &unit){unit.StopMoving();}
- bool Update(T &, const uint32 diff);
+ void Finalize(T &);
+ void Reset(T &);
+ bool Update(T &, const uint32 &);
void MovementInform(T &);
@@ -45,9 +43,7 @@ class PointMovementGenerator
private:
uint32 id;
float i_x, i_y, i_z;
- TimeTracker i_nextMoveTime;
- DestinationHolder< Traveller<T> > i_destinationHolder;
- bool arrived;
+ float speed;
};
class AssistanceMovementGenerator
@@ -61,5 +57,19 @@ class AssistanceMovementGenerator
void Finalize(Unit &);
};
+// Does almost nothing - just doesn't allows previous movegen interrupt current effect.
+class EffectMovementGenerator : public MovementGenerator
+{
+ public:
+ explicit EffectMovementGenerator(uint32 Id) : m_Id(Id) {}
+ void Initialize(Unit &) {}
+ void Finalize(Unit &unit);
+ void Reset(Unit &) {}
+ bool Update(Unit &u, const uint32);
+ MovementGeneratorType GetMovementGeneratorType() { return EFFECT_MOTION_TYPE; }
+ private:
+ uint32 m_Id;
+};
+
#endif
diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
index 09af2303397..22adc7be92f 100755
--- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -19,123 +19,103 @@
#include "Creature.h"
#include "MapManager.h"
#include "RandomMovementGenerator.h"
-#include "Traveller.h"
#include "ObjectAccessor.h"
-#include "DestinationHolderImp.h"
#include "Map.h"
#include "Util.h"
#include "CreatureGroups.h"
+#include "MoveSplineInit.h"
+#include "MoveSpline.h"
#define RUNNING_CHANCE_RANDOMMV 20 //will be "1 / RUNNING_CHANCE_RANDOMMV"
-template<>
-bool
-RandomMovementGenerator<Creature>::GetDestination(float &x, float &y, float &z) const
-{
- if (i_destinationHolder.HasArrived())
- return false;
-
- i_destinationHolder.GetDestination(x, y, z);
- return true;
-}
-
#ifdef MAP_BASED_RAND_GEN
#define rand_norm() creature.rand_norm()
#endif
template<>
-void
-RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
+void RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
{
- float X, Y, Z, nx, ny, nz, ori, dist;
-
- creature.GetHomePosition(X, Y, Z, ori);
-
+ float respX, respY, respZ, respO, currZ, destX, destY, destZ, travelDistZ;
+ creature.GetHomePosition(respX, respY, respZ, respO);
+ currZ = creature.GetPositionZ();
Map const* map = creature.GetBaseMap();
// For 2D/3D system selection
- //bool is_land_ok = creature.canWalk();
- //bool is_water_ok = creature.canSwim();
- bool is_air_ok = creature.canFly();
+ //bool is_land_ok = creature.CanWalk(); // not used?
+ //bool is_water_ok = creature.CanSwim(); // not used?
+ bool is_air_ok = creature.canFly();
- for (uint32 i = 0; ; ++i)
- {
- const float angle = (float)rand_norm()*static_cast<float>(M_PI*2);
- const float range = (float)rand_norm()*wander_distance;
- const float distanceX = range * cos(angle);
- const float distanceY = range * sin(angle);
+ const float angle = float(rand_norm()) * static_cast<float>(M_PI*2.0f);
+ const float range = float(rand_norm()) * wander_distance;
+ const float distanceX = range * cos(angle);
+ const float distanceY = range * sin(angle);
- nx = X + distanceX;
- ny = Y + distanceY;
+ destX = respX + distanceX;
+ destY = respY + distanceY;
- // prevent invalid coordinates generation
- Trinity::NormalizeMapCoord(nx);
- Trinity::NormalizeMapCoord(ny);
+ // prevent invalid coordinates generation
+ Trinity::NormalizeMapCoord(destX);
+ Trinity::NormalizeMapCoord(destY);
- dist = (nx - X)*(nx - X) + (ny - Y)*(ny - Y);
+ travelDistZ = distanceX*distanceX + distanceY*distanceY;
- if (i == 5)
- {
- nz = Z;
- break;
- }
+ if (is_air_ok) // 3D system above ground and above water (flying mode)
+ {
+ // Limit height change
+ const float distanceZ = float(rand_norm()) * sqrtf(travelDistZ)/2.0f;
+ destZ = respZ + distanceZ;
+ float levelZ = map->GetWaterOrGroundLevel(destX, destY, destZ-2.0f);
+
+ // Problem here, we must fly above the ground and water, not under. Let's try on next tick
+ if (levelZ >= destZ)
+ return;
+ }
+ //else if (is_water_ok) // 3D system under water and above ground (swimming mode)
+ else // 2D only
+ {
+ // 10.0 is the max that vmap high can check (MAX_CAN_FALL_DISTANCE)
+ travelDistZ = travelDistZ >= 100.0f ? 10.0f : sqrtf(travelDistZ);
- if (is_air_ok) // 3D system above ground and above water (flying mode)
- {
- const float distanceZ = (float)(rand_norm()) * sqrtf(dist)/2; // Limit height change
- nz = Z + distanceZ;
- float tz = map->GetHeight(nx, ny, nz-2.0f, false); // Map check only, vmap needed here but need to alter vmaps checks for height.
- float wz = map->GetWaterLevel(nx, ny);
- if (tz >= nz || wz >= nz)
- continue; // Problem here, we must fly above the ground and water, not under. Let's try on next tick
- }
- //else if (is_water_ok) // 3D system under water and above ground (swimming mode)
- else // 2D only
+ // The fastest way to get an accurate result 90% of the time.
+ // Better result can be obtained like 99% accuracy with a ray light, but the cost is too high and the code is too long.
+ destZ = map->GetHeight(destX, destY, respZ+travelDistZ-2.0f, false);
+
+ if (fabs(destZ - respZ) > travelDistZ) // Map check
{
- dist = dist >= 100.0f ? 10.0f : sqrtf(dist); // 10.0 is the max that vmap high can check (MAX_CAN_FALL_DISTANCE)
+ // Vmap Horizontal or above
+ destZ = map->GetHeight(destX, destY, respZ - 2.0f, true);
- // The fastest way to get an accurate result 90% of the time.
- // Better result can be obtained like 99% accuracy with a ray light, but the cost is too high and the code is too long.
- nz = map->GetHeight(nx, ny, Z+dist-2.0f, false); // Map check
- if (fabs(nz-Z)>dist)
+ if (fabs(destZ - respZ) > travelDistZ)
{
- nz = map->GetHeight(nx, ny, Z-2.0f, true); // Vmap Horizontal or above
- if (fabs(nz-Z)>dist)
- {
- nz = map->GetHeight(nx, ny, Z+dist-2.0f, true); // Vmap Higher
- if (fabs(nz-Z)>dist)
- continue; // let's forget this bad coords where a z cannot be find and retry at next tick
- }
+ // Vmap Higher
+ destZ = map->GetHeight(destX, destY, respZ+travelDistZ-2.0f, true);
+
+ // let's forget this bad coords where a z cannot be find and retry at next tick
+ if (fabs(destZ - respZ) > travelDistZ)
+ return;
}
}
- break;
}
- Traveller<Creature> traveller(creature);
- creature.SetOrientation(creature.GetAngle(nx, ny));
- i_destinationHolder.SetDestination(traveller, nx, ny, nz);
- creature.AddUnitState(UNIT_STAT_ROAMING);
if (is_air_ok)
- {
- i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
- }
- //else if (is_water_ok) // Swimming mode to be done with more than this check
+ i_nextMoveTime.Reset(0);
else
- {
- i_nextMoveTime.Reset(urand(500+i_destinationHolder.GetTotalTravelTime(), 5000+i_destinationHolder.GetTotalTravelTime()));
- creature.AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
- }
+ i_nextMoveTime.Reset(urand(500, 10000));
+
+ creature.AddUnitState(UNIT_STATE_ROAMING_MOVE);
+
+ Movement::MoveSplineInit init(creature);
+ init.MoveTo(destX, destY, destZ);
+ init.SetWalk(true);
+ init.Launch();
//Call for creature group update
if (creature.GetFormation() && creature.GetFormation()->getLeader() == &creature)
- {
- creature.GetFormation()->LeaderMoveTo(nx, ny, nz);
- }
+ creature.GetFormation()->LeaderMoveTo(destX, destY, destZ);
}
template<>
-void
-RandomMovementGenerator<Creature>::Initialize(Creature &creature)
+void RandomMovementGenerator<Creature>::Initialize(Creature &creature)
{
if (!creature.isAlive())
return;
@@ -143,8 +123,7 @@ RandomMovementGenerator<Creature>::Initialize(Creature &creature)
if (!wander_distance)
wander_distance = creature.GetRespawnRadius();
- if (irand(0, RUNNING_CHANCE_RANDOMMV) > 0)
- creature.AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
_setRandomLocation(creature);
}
@@ -156,44 +135,41 @@ RandomMovementGenerator<Creature>::Reset(Creature &creature)
}
template<>
-void
-RandomMovementGenerator<Creature>::Finalize(Creature & /*creature*/){}
+void RandomMovementGenerator<Creature>::Finalize(Creature &creature)
+{
+ creature.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
+ creature.SetWalk(false);
+}
template<>
bool
RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 diff)
{
- if (creature.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
+ if (creature.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
{
- i_nextMoveTime.Update(i_nextMoveTime.GetExpiry()); // Expire the timer
- creature.ClearUnitState(UNIT_STAT_ROAMING);
+ i_nextMoveTime.Reset(0); // Expire the timer
+ creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE);
return true;
}
- i_nextMoveTime.Update(diff);
-
- if (i_destinationHolder.HasArrived() && !creature.IsStopped() && !creature.canFly())
- creature.ClearUnitState(UNIT_STAT_ROAMING | UNIT_STAT_MOVE);
-
- if (!i_destinationHolder.HasArrived() && creature.IsStopped())
- creature.AddUnitState(UNIT_STAT_ROAMING);
-
- CreatureTraveller traveller(creature);
-
- if (i_destinationHolder.UpdateTraveller(traveller, diff, true))
+ if (creature.movespline->Finalized())
{
+ i_nextMoveTime.Update(diff);
if (i_nextMoveTime.Passed())
- {
- if (irand(0, RUNNING_CHANCE_RANDOMMV) > 0)
- creature.AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
_setRandomLocation(creature);
- }
- else if (creature.isPet() && creature.GetOwner() && !creature.IsWithinDist(creature.GetOwner(), PET_FOLLOW_DIST+2.5f))
- {
- creature.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
- _setRandomLocation(creature);
- }
}
return true;
}
+template<>
+bool RandomMovementGenerator<Creature>::GetResetPosition(Creature &creature, float& x, float& y, float& z)
+{
+ float radius;
+ creature.GetRespawnPosition(x, y, z, NULL, &radius);
+
+ // use current if in range
+ if (creature.IsWithinDist2d(x,y,radius))
+ creature.GetPosition(x,y,z);
+
+ return true;
+}
diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
index cca986ffea7..67161b6fc29 100755
--- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -20,15 +20,12 @@
#define TRINITY_RANDOMMOTIONGENERATOR_H
#include "MovementGenerator.h"
-#include "DestinationHolder.h"
-#include "Traveller.h"
template<class T>
class RandomMovementGenerator
: public MovementGeneratorMedium< T, RandomMovementGenerator<T> >
{
public:
- // Wander dist is related on db spawn dist. So what if we wanna set eandom movement on summoned creature?!
RandomMovementGenerator(float spawn_dist = 0.0f) : i_nextMoveTime(0), wander_distance(spawn_dist) {}
void _setRandomLocation(T &);
@@ -36,18 +33,13 @@ class RandomMovementGenerator
void Finalize(T &);
void Reset(T &);
bool Update(T &, const uint32);
- bool GetDestination(float &x, float &y, float &z) const;
- void UpdateMapPosition(uint32 mapid, float &x, float &y, float &z)
- {
- i_destinationHolder.GetLocationNow(mapid, x, y, z);
- }
+ bool GetResetPosition(T&, float& x, float& y, float& z);
MovementGeneratorType GetMovementGeneratorType() { return RANDOM_MOTION_TYPE; }
private:
TimeTrackerSmall i_nextMoveTime;
- DestinationHolder< Traveller<T> > i_destinationHolder;
- float wander_distance;
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 af316c82856..964b4402438 100755
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,106 +21,43 @@
#include "Errors.h"
#include "Creature.h"
#include "CreatureAI.h"
-#include "DestinationHolderImp.h"
#include "World.h"
-
-#define SMALL_ALPHA 0.05f
+#include "MoveSplineInit.h"
+#include "MoveSpline.h"
+#include "Player.h"
#include <cmath>
-/*
-struct StackCleaner
-{
- Creature &i_creature;
- StackCleaner(Creature &creature) : i_creature(creature) {}
- void Done(void) { i_creature.StopMoving(); }
- ~StackCleaner()
- {
- i_creature->Clear();
- }
-};
-*/
-template<class T>
-TargetedMovementGenerator<T>::TargetedMovementGenerator(Unit &target, float offset, float angle)
-: TargetedMovementGeneratorBase(target)
-, i_offset(offset), i_angle(angle), i_recalculateTravel(false)
-{
- target.GetPosition(i_targetX, i_targetY, i_targetZ);
-}
-
-template<class T>
-bool
-TargetedMovementGenerator<T>::_setTargetLocation(T &owner)
+template<class T, typename D>
+void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner)
{
if (!i_target.isValid() || !i_target->IsInWorld())
- return false;
+ return;
- if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
- return false;
+ if (owner.HasUnitState(UNIT_STATE_NOT_MOVE))
+ return;
float x, y, z;
- Traveller<T> traveller(owner);
- if (i_destinationHolder.HasDestination())
+
+ if (i_offset && i_target->IsWithinDistInMap(&owner,2*i_offset))
{
- if (i_destinationHolder.HasArrived())
- {
- // prevent redundant micro-movement
- if (!i_offset)
- {
- if (i_target->IsWithinMeleeRange(&owner))
- return false;
- }
- else if (!i_angle && !owner.HasUnitState(UNIT_STAT_FOLLOW))
- {
- if (i_target->IsWithinDistInMap(&owner, i_offset))
- return false;
- }
- else
- {
- if (i_target->IsWithinDistInMap(&owner, i_offset + 1.0f))
- return false;
- }
- }
- else
- {
- bool stop = false;
- if (!i_offset)
- {
- if (i_target->IsWithinMeleeRange(&owner, 0))
- stop = true;
- }
- else if (!i_angle && !owner.HasUnitState(UNIT_STAT_FOLLOW))
- {
- if (i_target->IsWithinDist(&owner, i_offset * 0.8f))
- stop = true;
- }
-
- if (stop)
- {
- owner.GetPosition(x, y, z);
- i_destinationHolder.SetDestination(traveller, x, y, z);
- i_destinationHolder.StartTravel(traveller, false);
- owner.StopMoving();
- return false;
- }
- }
+ if (!owner.movespline->Finalized())
+ return;
- if (i_target->GetExactDistSq(i_targetX, i_targetY, i_targetZ) < 0.01f)
- return false;
+ owner.GetPosition(x, y, z);
}
-
- if (!i_offset)
+ else if (!i_offset)
{
+ if (i_target->IsWithinMeleeRange(&owner))
+ return;
+
// to nearest random contact position
i_target->GetRandomContactPoint(&owner, x, y, z, 0, MELEE_RANGE - 0.5f);
}
- else if (!i_angle && !owner.HasUnitState(UNIT_STAT_FOLLOW))
- {
- // caster chase
- i_target->GetContactPoint(&owner, x, y, z, i_offset * urand(80, 95) * 0.01f);
- }
else
{
+ if (i_target->IsWithinDistInMap(&owner, i_offset + 1.0f))
+ return;
// to at i_offset distance from target and i_angle from target facing
i_target->GetClosePoint(x, y, z, owner.GetObjectSize(), i_offset, i_angle);
}
@@ -137,55 +74,65 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner)
ralf
//We don't update Mob Movement, if the difference between New destination and last destination is < BothObjectSize
- float bothObjectSize = i_target->GetObjectSize() + owner.GetObjectSize() + CONTACT_DISTANCE;
- if (i_destinationHolder.HasDestination() && i_destinationHolder.GetDestinationDiff(x, y, z) < bothObjectSize)
+ float bothObjectSize = i_target->GetObjectBoundingRadius() + owner.GetObjectBoundingRadius() + CONTACT_DISTANCE;
+ if( i_destinationHolder.HasDestination() && i_destinationHolder.GetDestinationDiff(x,y,z) < bothObjectSize )
return;
*/
- i_destinationHolder.SetDestination(traveller, x, y, z);
- owner.AddUnitState(UNIT_STAT_CHASE);
- i_destinationHolder.StartTravel(traveller);
- return true;
+
+
+ D::_addUnitStateMove(owner);
+ i_targetReached = false;
+ i_recalculateTravel = false;
+
+ Movement::MoveSplineInit init(owner);
+ init.MoveTo(x,y,z);
+ init.SetWalk(((D*)this)->EnableWalking());
+ init.Launch();
}
-template<class T>
-void
-TargetedMovementGenerator<T>::Initialize(T &owner)
+template<>
+void TargetedMovementGeneratorMedium<Player,ChaseMovementGenerator<Player> >::UpdateFinalDistance(float /*fDistance*/)
{
- if (owner.isInCombat())
- owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ // nothing to do for Player
+}
- _setTargetLocation(owner);
+template<>
+void TargetedMovementGeneratorMedium<Player,FollowMovementGenerator<Player> >::UpdateFinalDistance(float /*fDistance*/)
+{
+ // nothing to do for Player
}
-template<class T>
-void
-TargetedMovementGenerator<T>::Finalize(T &owner)
+template<>
+void TargetedMovementGeneratorMedium<Creature,ChaseMovementGenerator<Creature> >::UpdateFinalDistance(float fDistance)
{
- owner.ClearUnitState(UNIT_STAT_CHASE);
+ i_offset = fDistance;
+ i_recalculateTravel = true;
}
-template<class T>
-void
-TargetedMovementGenerator<T>::Reset(T &owner)
+template<>
+void TargetedMovementGeneratorMedium<Creature,FollowMovementGenerator<Creature> >::UpdateFinalDistance(float fDistance)
{
- Initialize(owner);
+ i_offset = fDistance;
+ i_recalculateTravel = true;
}
-template<class T>
-bool
-TargetedMovementGenerator<T>::Update(T &owner, const uint32 time_diff)
+template<class T, typename D>
+bool TargetedMovementGeneratorMedium<T,D>::Update(T &owner, const uint32 & time_diff)
{
if (!i_target.isValid() || !i_target->IsInWorld())
return false;
- if (!&owner || !owner.isAlive())
+ if (!owner.isAlive())
return true;
- if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_DISTRACTED))
+ if (owner.HasUnitState(UNIT_STATE_NOT_MOVE))
+ {
+ D::_clearUnitStateMove(owner);
return true;
+ }
// prevent movement while casting spells with cast time or channel time
- if (owner.HasUnitState(UNIT_STAT_CASTING))
+ if (owner.IsNonMeleeSpellCasted(false, false, true))
{
if (!owner.IsStopped())
owner.StopMoving();
@@ -193,85 +140,184 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 time_diff)
}
// prevent crash after creature killed pet
- if (!owner.HasUnitState(UNIT_STAT_FOLLOW) && owner.getVictim() != i_target.getTarget())
+ if (static_cast<D*>(this)->_lostTarget(owner))
+ {
+ D::_clearUnitStateMove(owner);
return true;
+ }
- Traveller<T> traveller(owner);
-
- if (!i_destinationHolder.HasDestination())
- _setTargetLocation(owner);
- else if (owner.IsStopped() && !i_destinationHolder.HasArrived())
+ i_recheckDistance.Update(time_diff);
+ if (i_recheckDistance.Passed())
{
- owner.AddUnitState(UNIT_STAT_CHASE);
- i_destinationHolder.StartTravel(traveller);
- return true;
+ i_recheckDistance.Reset(50);
+ //More distance let have better performance, less distance let have more sensitive reaction at target move.
+ float allowed_dist = i_target->GetObjectSize() + owner.GetObjectSize() + MELEE_RANGE - 0.5f;
+ float dist = (owner.movespline->FinalDestination() - G3D::Vector3(i_target->GetPositionX(),i_target->GetPositionY(),i_target->GetPositionZ())).squaredLength();
+ if (dist >= allowed_dist * allowed_dist)
+ _setTargetLocation(owner);
}
- if (i_destinationHolder.UpdateTraveller(traveller, time_diff))
+ if (owner.movespline->Finalized())
{
- // put targeted movement generators on a higher priority
- //if (owner.GetObjectSize())
- //i_destinationHolder.ResetUpdate(50);
+ static_cast<D*>(this)->MovementInform(owner);
+ if (i_angle == 0.f && !owner.HasInArc(0.01f, i_target.getTarget()))
+ owner.SetInFront(i_target.getTarget());
- // target moved
- if (i_targetX != i_target->GetPositionX() || i_targetY != i_target->GetPositionY()
- || i_targetZ != i_target->GetPositionZ())
+ if (!i_targetReached)
{
- if (_setTargetLocation(owner) || !owner.HasUnitState(UNIT_STAT_FOLLOW))
- owner.SetInFront(i_target.getTarget());
- i_target->GetPosition(i_targetX, i_targetY, i_targetZ);
+ i_targetReached = true;
+ static_cast<D*>(this)->_reachTarget(owner);
}
+ }
+ else
+ {
+ if (i_recalculateTravel)
+ _setTargetLocation(owner);
+ }
+ return true;
+}
- if ((owner.IsStopped() && !i_destinationHolder.HasArrived()) || i_recalculateTravel)
- {
- i_recalculateTravel = false;
- //Angle update will take place into owner.StopMoving()
- owner.SetInFront(i_target.getTarget());
+//-----------------------------------------------//
+template<class T>
+void ChaseMovementGenerator<T>::_reachTarget(T &owner)
+{
+ if (owner.IsWithinMeleeRange(this->i_target.getTarget()))
+ owner.Attack(this->i_target.getTarget(),true);
+}
- owner.StopMoving();
- if (owner.IsWithinMeleeRange(i_target.getTarget()) && !owner.HasUnitState(UNIT_STAT_FOLLOW))
- owner.Attack(i_target.getTarget(), true);
- }
- }
+template<>
+void ChaseMovementGenerator<Player>::Initialize(Player &owner)
+{
+ owner.AddUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE);
+ _setTargetLocation(owner);
+}
- // Implemented for PetAI to handle resetting flags when pet owner reached
- if (i_destinationHolder.HasArrived())
- MovementInform(owner);
+template<>
+void ChaseMovementGenerator<Creature>::Initialize(Creature &owner)
+{
+ owner.SetWalk(false);
+ owner.AddUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE);
+ _setTargetLocation(owner);
+}
- return true;
+template<class T>
+void ChaseMovementGenerator<T>::Finalize(T &owner)
+{
+ owner.ClearUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE);
}
template<class T>
-Unit*
-TargetedMovementGenerator<T>::GetTarget() const
+void ChaseMovementGenerator<T>::Reset(T &owner)
{
- return i_target.getTarget();
+ Initialize(owner);
}
template<class T>
-void TargetedMovementGenerator<T>::MovementInform(T & /*unit*/)
+void ChaseMovementGenerator<T>::MovementInform(T & /*unit*/)
{
}
-template <> void TargetedMovementGenerator<Creature>::MovementInform(Creature &unit)
+template<>
+void ChaseMovementGenerator<Creature>::MovementInform(Creature &unit)
{
// Pass back the GUIDLow of the target. If it is pet's owner then PetAI will handle
- unit.AI()->MovementInform(TARGETED_MOTION_TYPE, i_target.getTarget()->GetGUIDLow());
+ if (unit.AI())
+ unit.AI()->MovementInform(CHASE_MOTION_TYPE, i_target.getTarget()->GetGUIDLow());
+}
+
+//-----------------------------------------------//
+template<>
+bool FollowMovementGenerator<Creature>::EnableWalking() const
+{
+ return i_target.isValid() && i_target->IsWalking();
+}
+
+template<>
+bool FollowMovementGenerator<Player>::EnableWalking() const
+{
+ return false;
+}
+
+template<>
+void FollowMovementGenerator<Player>::_updateSpeed(Player &/*u*/)
+{
+ // nothing to do for Player
+}
+
+template<>
+void FollowMovementGenerator<Creature>::_updateSpeed(Creature &u)
+{
+ // pet only sync speed with owner
+ if (!((Creature&)u).isPet() || !i_target.isValid() || i_target->GetGUID() != u.GetOwnerGUID())
+ return;
+
+ u.UpdateSpeed(MOVE_RUN,true);
+ u.UpdateSpeed(MOVE_WALK,true);
+ u.UpdateSpeed(MOVE_SWIM,true);
+}
+
+template<>
+void FollowMovementGenerator<Player>::Initialize(Player &owner)
+{
+ owner.AddUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE);
+ _updateSpeed(owner);
+ _setTargetLocation(owner);
+}
+
+template<>
+void FollowMovementGenerator<Creature>::Initialize(Creature &owner)
+{
+ owner.AddUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE);
+ _updateSpeed(owner);
+ _setTargetLocation(owner);
+}
+
+template<class T>
+void FollowMovementGenerator<T>::Finalize(T &owner)
+{
+ owner.ClearUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE);
+ _updateSpeed(owner);
}
-template void TargetedMovementGenerator<Player>::MovementInform(Player&); // Not implemented for players
-template TargetedMovementGenerator<Player>::TargetedMovementGenerator(Unit &target, float offset, float angle);
-template TargetedMovementGenerator<Creature>::TargetedMovementGenerator(Unit &target, float offset, float angle);
-template bool TargetedMovementGenerator<Player>::_setTargetLocation(Player &);
-template bool TargetedMovementGenerator<Creature>::_setTargetLocation(Creature &);
-template void TargetedMovementGenerator<Player>::Initialize(Player &);
-template void TargetedMovementGenerator<Creature>::Initialize(Creature &);
-template void TargetedMovementGenerator<Player>::Finalize(Player &);
-template void TargetedMovementGenerator<Creature>::Finalize(Creature &);
-template void TargetedMovementGenerator<Player>::Reset(Player &);
-template void TargetedMovementGenerator<Creature>::Reset(Creature &);
-template bool TargetedMovementGenerator<Player>::Update(Player &, const uint32);
-template bool TargetedMovementGenerator<Creature>::Update(Creature &, const uint32);
-template Unit* TargetedMovementGenerator<Player>::GetTarget() const;
-template Unit* TargetedMovementGenerator<Creature>::GetTarget() const;
+template<class T>
+void FollowMovementGenerator<T>::Reset(T &owner)
+{
+ Initialize(owner);
+}
+
+template<class T>
+void FollowMovementGenerator<T>::MovementInform(T & /*unit*/)
+{
+}
+
+template<>
+void FollowMovementGenerator<Creature>::MovementInform(Creature &unit)
+{
+ // Pass back the GUIDLow of the target. If it is pet's owner then PetAI will handle
+ if (unit.AI())
+ unit.AI()->MovementInform(FOLLOW_MOTION_TYPE, i_target.getTarget()->GetGUIDLow());
+}
+//-----------------------------------------------//
+template void TargetedMovementGeneratorMedium<Player,ChaseMovementGenerator<Player> >::_setTargetLocation(Player &);
+template void TargetedMovementGeneratorMedium<Player,FollowMovementGenerator<Player> >::_setTargetLocation(Player &);
+template void TargetedMovementGeneratorMedium<Creature,ChaseMovementGenerator<Creature> >::_setTargetLocation(Creature &);
+template void TargetedMovementGeneratorMedium<Creature,FollowMovementGenerator<Creature> >::_setTargetLocation(Creature &);
+template bool TargetedMovementGeneratorMedium<Player,ChaseMovementGenerator<Player> >::Update(Player &, const uint32 &);
+template bool TargetedMovementGeneratorMedium<Player,FollowMovementGenerator<Player> >::Update(Player &, const uint32 &);
+template bool TargetedMovementGeneratorMedium<Creature,ChaseMovementGenerator<Creature> >::Update(Creature &, const uint32 &);
+template bool TargetedMovementGeneratorMedium<Creature,FollowMovementGenerator<Creature> >::Update(Creature &, const uint32 &);
+
+template void ChaseMovementGenerator<Player>::_reachTarget(Player &);
+template void ChaseMovementGenerator<Creature>::_reachTarget(Creature &);
+template void ChaseMovementGenerator<Player>::Finalize(Player &);
+template void ChaseMovementGenerator<Creature>::Finalize(Creature &);
+template void ChaseMovementGenerator<Player>::Reset(Player &);
+template void ChaseMovementGenerator<Creature>::Reset(Creature &);
+template void ChaseMovementGenerator<Player>::MovementInform(Player &unit);
+
+template void FollowMovementGenerator<Player>::Finalize(Player &);
+template void FollowMovementGenerator<Creature>::Finalize(Creature &);
+template void FollowMovementGenerator<Player>::Reset(Player &);
+template void FollowMovementGenerator<Creature>::Reset(Creature &);
+template void FollowMovementGenerator<Player>::MovementInform(Player &unit);
diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
index 0c9623192f0..bf2eecc89f6 100755
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -20,9 +20,9 @@
#define TRINITY_TARGETEDMOVEMENTGENERATOR_H
#include "MovementGenerator.h"
-#include "DestinationHolder.h"
-#include "Traveller.h"
#include "FollowerReference.h"
+#include "Timer.h"
+#include "Unit.h"
class TargetedMovementGeneratorBase
{
@@ -33,41 +33,84 @@ class TargetedMovementGeneratorBase
FollowerReference i_target;
};
+template<class T, typename D>
+class TargetedMovementGeneratorMedium
+: public MovementGeneratorMedium< T, D >, public TargetedMovementGeneratorBase
+{
+ protected:
+ TargetedMovementGeneratorMedium(Unit &target, float offset, float angle) :
+ TargetedMovementGeneratorBase(target), i_offset(offset), i_angle(angle),
+ i_recalculateTravel(false), i_targetReached(false), i_recheckDistance(0)
+ {
+ }
+ ~TargetedMovementGeneratorMedium() {}
+
+ public:
+ bool Update(T &, const uint32 &);
+ Unit* GetTarget() const { return i_target.getTarget(); }
+
+ void unitSpeedChanged() { i_recalculateTravel=true; }
+ void UpdateFinalDistance(float fDistance);
+
+ protected:
+ void _setTargetLocation(T &);
+
+ TimeTrackerSmall i_recheckDistance;
+ float i_offset;
+ float i_angle;
+ bool i_recalculateTravel : 1;
+ bool i_targetReached : 1;
+};
+
template<class T>
-class TargetedMovementGenerator
-: public MovementGeneratorMedium< T, TargetedMovementGenerator<T> >, public TargetedMovementGeneratorBase
+class ChaseMovementGenerator : public TargetedMovementGeneratorMedium<T, ChaseMovementGenerator<T> >
{
public:
- TargetedMovementGenerator(Unit &target, float offset = 0, float angle = 0);
- ~TargetedMovementGenerator() {}
+ ChaseMovementGenerator(Unit &target)
+ : TargetedMovementGeneratorMedium<T, ChaseMovementGenerator<T> >(target) {}
+ ChaseMovementGenerator(Unit &target, float offset, float angle)
+ : TargetedMovementGeneratorMedium<T, ChaseMovementGenerator<T> >(target, offset, angle) {}
+ ~ChaseMovementGenerator() {}
+
+ MovementGeneratorType GetMovementGeneratorType() { return CHASE_MOTION_TYPE; }
void Initialize(T &);
void Finalize(T &);
void Reset(T &);
- bool Update(T &, const uint32);
- MovementGeneratorType GetMovementGeneratorType() { return TARGETED_MOTION_TYPE; }
-
void MovementInform(T &);
- Unit* GetTarget() const;
+ static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STATE_CHASE_MOVE); }
+ static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STATE_CHASE_MOVE); }
+ bool EnableWalking() const { return false;}
+ bool _lostTarget(T &u) const { return u.getVictim() != this->GetTarget(); }
+ void _reachTarget(T &);
+};
- bool GetDestination(float &x, float &y, float &z) const
- {
- if (i_destinationHolder.HasArrived() || !i_destinationHolder.HasDestination()) return false;
- i_destinationHolder.GetDestination(x, y, z);
- return true;
- }
+template<class T>
+class FollowMovementGenerator : public TargetedMovementGeneratorMedium<T, FollowMovementGenerator<T> >
+{
+ public:
+ FollowMovementGenerator(Unit &target)
+ : TargetedMovementGeneratorMedium<T, FollowMovementGenerator<T> >(target){}
+ FollowMovementGenerator(Unit &target, float offset, float angle)
+ : TargetedMovementGeneratorMedium<T, FollowMovementGenerator<T> >(target, offset, angle) {}
+ ~FollowMovementGenerator() {}
- void unitSpeedChanged() { i_recalculateTravel=true; }
- private:
+ MovementGeneratorType GetMovementGeneratorType() { return FOLLOW_MOTION_TYPE; }
- bool _setTargetLocation(T &);
+ void Initialize(T &);
+ void Finalize(T &);
+ void Reset(T &);
+ void MovementInform(T &);
- float i_offset;
- float i_angle;
- DestinationHolder< Traveller<T> > i_destinationHolder;
- bool i_recalculateTravel;
- float i_targetX, i_targetY, i_targetZ;
+ static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STATE_FOLLOW_MOVE); }
+ static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STATE_FOLLOW_MOVE); }
+ bool EnableWalking() const;
+ bool _lostTarget(T &) const { return false; }
+ void _reachTarget(T &) {}
+ private:
+ void _updateSpeed(T &u);
};
+
#endif
diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
index 396b0c489f2..55cf3c28d46 100755
--- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -17,222 +17,166 @@
*/
//Basic headers
#include "WaypointMovementGenerator.h"
-#include "DestinationHolderImp.h"
//Extended headers
#include "ObjectMgr.h"
#include "World.h"
-#include "MapManager.h" // for flightmaster grid preloading
+//Flightmaster grid preloading
+#include "MapManager.h"
//Creature-specific headers
#include "Creature.h"
#include "CreatureAI.h"
#include "CreatureGroups.h"
//Player-specific
#include "Player.h"
+#include "MoveSplineInit.h"
+#include "MoveSpline.h"
-template<class T>
-void
-WaypointMovementGenerator<T>::Initialize(T & /*u*/){}
-
-template<>
-void
-WaypointMovementGenerator<Creature>::Finalize(Creature & /*u*/){}
+void WaypointMovementGenerator<Creature>::LoadPath(Creature &creature)
+{
+ if (!path_id)
+ path_id = creature.GetWaypointPath();
-template<>
-void
-WaypointMovementGenerator<Player>::Finalize(Player & /*u*/){}
+ i_path = sWaypointMgr->GetPath(path_id);
-template<class T>
-void
-WaypointMovementGenerator<T>::MovementInform(T & /*unit*/){}
+ if (!i_path)
+ {
+ // No movement found for entry
+ sLog->outErrorDb("WaypointMovementGenerator::LoadPath: creature %s (Entry: %u GUID: %u) doesn't have waypoint path id: %u", creature.GetName(), creature.GetEntry(), creature.GetGUIDLow(), path_id);
+ return;
+ }
-template<>
-void WaypointMovementGenerator<Creature>::MovementInform(Creature &unit)
-{
- unit.AI()->MovementInform(WAYPOINT_MOTION_TYPE, i_currentNode);
+ StartMoveNow(creature);
}
-template<>
-bool WaypointMovementGenerator<Creature>::GetDestination(float &x, float &y, float &z) const
+void WaypointMovementGenerator<Creature>::Initialize(Creature &creature)
{
- if (i_destinationHolder.HasArrived())
- return false;
-
- i_destinationHolder.GetDestination(x, y, z);
- return true;
+ LoadPath(creature);
+ creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
}
-template<>
-bool WaypointMovementGenerator<Player>::GetDestination(float & /*x*/, float & /*y*/, float & /*z*/) const
+void WaypointMovementGenerator<Creature>::Finalize(Creature &creature)
{
- return false;
+ creature.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
+ creature.SetWalk(false);
}
-template<>
-void WaypointMovementGenerator<Creature>::Reset(Creature & /*unit*/)
+void WaypointMovementGenerator<Creature>::Reset(Creature &creature)
{
- StopedByPlayer = true;
- i_nextMoveTime.Reset(0);
+ creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
+ StartMoveNow(creature);
}
-template<>
-void WaypointMovementGenerator<Player>::Reset(Player & /*unit*/){}
-
-template<>
-void WaypointMovementGenerator<Creature>::InitTraveller(Creature &unit, const WaypointData &node)
+void WaypointMovementGenerator<Creature>::OnArrived(Creature& creature)
{
- node.run ? unit.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING):
- unit.AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ if (!i_path || i_path->empty())
+ return;
+ if (m_isArrivalDone)
+ return;
- unit.SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
- unit.SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE);
+ m_isArrivalDone = true;
- // TODO: make this part of waypoint node, so that creature can walk when desired?
- if (unit.canFly())
- unit.SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
+ if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance)
+ {
+ sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for %u.", i_path->at(i_currentNode)->event_id, i_currentNode, creature.GetGUID());
+ creature.GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, &creature, NULL/*, false*/);
+ }
- unit.AddUnitState(UNIT_STAT_ROAMING);
+ // Inform script
+ MovementInform(creature);
+ creature.UpdateWaypointID(i_currentNode);
+ Stop(i_path->at(i_currentNode)->delay);
}
-template<>
-void
-WaypointMovementGenerator<Creature>::Initialize(Creature &u)
+bool WaypointMovementGenerator<Creature>::StartMove(Creature &creature)
{
- u.StopMoving();
- //i_currentNode = -1; // uint32, become 0 in the first update
- //i_nextMoveTime.Reset(0);
- StopedByPlayer = false;
- if (!path_id)
- path_id = u.GetWaypointPath();
- waypoints = sWaypointMgr->GetPath(path_id);
- i_currentNode = 0;
- if (waypoints && waypoints->size())
+ if (!i_path || i_path->empty())
+ return false;
+ if (Stopped())
+ return true;
+
+ if (m_isArrivalDone)
{
- node = waypoints->front();
- Traveller<Creature> traveller(u);
- InitTraveller(u, *node);
- i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
- i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
-
- //Call for creature group update
- if (u.GetFormation() && u.GetFormation()->getLeader() == &u)
- u.GetFormation()->LeaderMoveTo(node->x, node->y, node->z);
+ if ((i_currentNode == i_path->size() - 1) && !repeating) // If that's our last waypoint
+ {
+ creature.SetHomePosition(i_path->at(i_currentNode)->x, i_path->at(i_currentNode)->y, i_path->at(i_currentNode)->z, creature.GetOrientation());
+ creature.GetMotionMaster()->Initialize();
+ return false;
+ }
+
+ i_currentNode = (i_currentNode+1) % i_path->size();
}
- else
- node = NULL;
-}
-template<>
-void WaypointMovementGenerator<Player>::InitTraveller(Player & /*unit*/, const WaypointData & /*node*/){}
+ const WaypointData *node = i_path->at(i_currentNode);
-template<class T>
-bool
-WaypointMovementGenerator<T>::Update(T & /*unit*/, const uint32 /*diff*/)
-{
- return false;
-}
+ m_isArrivalDone = false;
-template<>
-bool
-WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 diff)
-{
- if (!&unit)
- return true;
+ creature.AddUnitState(UNIT_STATE_ROAMING_MOVE);
+
+ Movement::MoveSplineInit init(creature);
+ init.MoveTo(node->x, node->y, node->z);
- if (!path_id)
- return false;
+ if (node->orientation != 100 && node->delay != 0)
+ init.SetFacing(node->orientation);
+
+ init.SetWalk(!node->run);
+ init.Launch();
+ //Call for creature group update
+ if (creature.GetFormation() && creature.GetFormation()->getLeader() == &creature)
+ creature.GetFormation()->LeaderMoveTo(node->x, node->y, node->z);
+
+ return true;
+}
+
+bool WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff)
+{
// Waypoint movement can be switched on/off
// This is quite handy for escort quests and other stuff
- if (unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
+ if (creature.HasUnitState(UNIT_STATE_NOT_MOVE))
+ {
+ creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE);
return true;
-
- // Clear the generator if the path doesn't exist
- if (!waypoints || !waypoints->size())
+ }
+ // prevent a crash at empty waypoint path.
+ if (!i_path || i_path->empty())
return false;
- Traveller<Creature> traveller(unit);
-
- i_nextMoveTime.Update(diff);
- i_destinationHolder.UpdateTraveller(traveller, diff, true);
-
- if (i_nextMoveTime.GetExpiry() < TIMEDIFF_NEXT_WP)
+ if (Stopped())
{
- if (unit.IsStopped())
- {
- if (StopedByPlayer)
- {
- ASSERT(node);
- InitTraveller(unit, *node);
- i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
- i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
- StopedByPlayer = false;
- return true;
- }
-
- if (i_currentNode == waypoints->size() - 1) // If that's our last waypoint
- {
- if (repeating) // If the movement is repeating
- i_currentNode = 0; // Start moving all over again
- else
- {
- unit.SetHomePosition(node->x, node->y, node->z, unit.GetOrientation());
- unit.GetMotionMaster()->Initialize();
- return false; // Clear the waypoint movement
- }
- }
- else
- ++i_currentNode;
-
- node = waypoints->at(i_currentNode);
- InitTraveller(unit, *node);
- i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
- i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
-
- //Call for creature group update
- if (unit.GetFormation() && unit.GetFormation()->getLeader() == &unit)
- unit.GetFormation()->LeaderMoveTo(node->x, node->y, node->z);
- }
- else
- {
- //Determine waittime
- if (node->delay)
- i_nextMoveTime.Reset(node->delay);
-
- //note: disable "start" for mtmap
- if (node->event_id && urand(0, 99) < node->event_chance)
- unit.GetMap()->ScriptsStart(sWaypointScripts, node->event_id, &unit, NULL/*, false*/);
-
- i_destinationHolder.ResetTravelTime();
- MovementInform(unit);
- unit.UpdateWaypointID(i_currentNode);
- unit.ClearUnitState(UNIT_STAT_ROAMING);
- if (node->orientation)
- {
- unit.Relocate(node->x, node->y, node->z, node->orientation);
- unit.SetFacing(node->orientation, NULL);
- }
- else
- unit.Relocate(node->x, node->y, node->z);
- }
+ if (CanMove(diff))
+ return StartMove(creature);
}
- else
+ else
{
- if (unit.IsStopped() && !i_destinationHolder.HasArrived())
+ if (creature.IsStopped())
+ Stop(STOP_TIME_FOR_PLAYER);
+ else if (creature.movespline->Finalized())
{
- if (!StopedByPlayer)
- {
- i_destinationHolder.IncreaseTravelTime(STOP_TIME_FOR_PLAYER);
- i_nextMoveTime.Reset(STOP_TIME_FOR_PLAYER);
- StopedByPlayer = true;
- }
- }
+ OnArrived(creature);
+ return StartMove(creature);
+ }
}
+ return true;
+ }
+
+void WaypointMovementGenerator<Creature>::MovementInform(Creature &creature)
+{
+ if (creature.AI())
+ creature.AI()->MovementInform(WAYPOINT_MOTION_TYPE, i_currentNode);
+}
+
+bool WaypointMovementGenerator<Creature>::GetResetPosition(Creature&, float& x, float& y, float& z)
+{
+ // prevent a crash at empty waypoint path.
+ if (!i_path || i_path->empty())
+ return false;
+
+ const WaypointData* node = i_path->at(i_currentNode);
+ x = node->x; y = node->y; z = node->z;
return true;
}
-template void WaypointMovementGenerator<Player>::Initialize(Player &);
-template bool WaypointMovementGenerator<Player>::Update(Player &, const uint32);
-template void WaypointMovementGenerator<Player>::MovementInform(Player &);
//----------------------------------------------------//
@@ -253,71 +197,72 @@ uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const
void FlightPathMovementGenerator::Initialize(Player &player)
{
- player.getHostileRefManager().setOnlineOfflineState(false);
- player.AddUnitState(UNIT_STAT_IN_FLIGHT);
- player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
- Traveller<Player> traveller(player);
- // do not send movement, it was sent already
- i_destinationHolder.SetDestination(traveller, (*i_path)[i_currentNode].x, (*i_path)[i_currentNode].y, (*i_path)[i_currentNode].z, false);
- // For preloading end grid
+ Reset(player);
InitEndGridInfo();
- player.SendMonsterMoveByPath(GetPath(), GetCurrentNode(), GetPathAtMapEnd());
}
void FlightPathMovementGenerator::Finalize(Player & player)
{
- player.ClearUnitState(UNIT_STAT_IN_FLIGHT);
+ // remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack)
+ player.ClearUnitState(UNIT_STATE_IN_FLIGHT);
- float x = 0;
- float y = 0;
- float z = 0;
- i_destinationHolder.GetLocationNow(player.GetBaseMap(), x, y, z);
- player.UpdatePosition(x, y, z, player.GetOrientation());
+ player.Dismount();
+ player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
+ if(player.m_taxi.empty())
+ {
+ player.getHostileRefManager().setOnlineOfflineState(true);
+ if(player.pvpInfo.inHostileArea)
+ player.CastSpell(&player, 2479, true);
+
+ // update z position to ground and orientation for landing point
+ // this prevent cheating with landing point at lags
+ // when client side flight end early in comparison server side
+ player.StopMoving();
+ }
+}
+
+#define PLAYER_FLIGHT_SPEED 32.0f
+
+void FlightPathMovementGenerator::Reset(Player & player)
+{
+ player.getHostileRefManager().setOnlineOfflineState(false);
+ player.AddUnitState(UNIT_STATE_IN_FLIGHT);
+ player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
+
+ Movement::MoveSplineInit init(player);
+ uint32 end = GetPathAtMapEnd();
+ for (uint32 i = GetCurrentNode(); i != end; ++i)
+ {
+ G3D::Vector3 vertice((*i_path)[i].x,(*i_path)[i].y,(*i_path)[i].z);
+ init.Path().push_back(vertice);
+ }
+ init.SetFirstPointId(GetCurrentNode());
+ init.SetFly();
+ init.SetVelocity(PLAYER_FLIGHT_SPEED);
+ init.Launch();
}
bool FlightPathMovementGenerator::Update(Player &player, const uint32 diff)
{
- if (MovementInProgress())
+ uint32 pointId = (uint32)player.movespline->currentPathIdx();
+ if (pointId > i_currentNode)
{
- Traveller<Player> traveller(player);
- if (i_destinationHolder.UpdateTraveller(traveller, diff))
+ bool departureEvent = true;
+ do
{
- i_destinationHolder.ResetUpdate(FLIGHT_TRAVEL_UPDATE);
- if (i_destinationHolder.HasArrived())
- {
- DoEventIfAny(player, (*i_path)[i_currentNode], false);
-
- uint32 curMap = (*i_path)[i_currentNode].mapid;
- ++i_currentNode;
- if (MovementInProgress())
- {
- DoEventIfAny(player, (*i_path)[i_currentNode], true);
-
- sLog->outStaticDebug("loading node %u for player %s", i_currentNode, player.GetName());
- if ((*i_path)[i_currentNode].mapid == curMap)
- {
- // do not send movement, it was sent already
- i_destinationHolder.SetDestination(traveller, (*i_path)[i_currentNode].x, (*i_path)[i_currentNode].y, (*i_path)[i_currentNode].z, false);
- }
-
- // check if it's time to preload the flightmaster grid at path end
- if (i_currentNode == m_preloadTargetNode)
- PreloadEndGrid();
-
- return true;
- }
- //else HasArrived()
- }
- else
- return true;
+ DoEventIfAny(player, (*i_path)[i_currentNode], departureEvent);
+ if (pointId == i_currentNode)
+ break;
+ if (i_currentNode == _preloadTargetNode)
+ PreloadEndGrid();
+ i_currentNode += (uint32)departureEvent;
+ departureEvent = !departureEvent;
}
- else
- return true;
+ while (true);
}
- // we have arrived at the end of the path
- return false;
+ return i_currentNode < (i_path->size()-1);
}
void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport()
@@ -336,42 +281,48 @@ void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport()
}
}
+void FlightPathMovementGenerator::DoEventIfAny(Player& player, TaxiPathNodeEntry const& node, bool departure)
+{
+ if (uint32 eventid = departure ? node.departureEventID : node.arrivalEventID)
+ {
+ sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Taxi %s event %u of node %u of path %u for player %s", departure ? "departure" : "arrival", eventid, node.index, node.path, player.GetName());
+ player.GetMap()->ScriptsStart(sEventScripts, eventid, &player, &player);
+ }
+}
+
+bool FlightPathMovementGenerator::GetResetPosition(Player&, float& x, float& y, float& z)
+{
+ const TaxiPathNodeEntry& node = (*i_path)[i_currentNode];
+ x = node.x; y = node.y; z = node.z;
+ return true;
+}
+
void FlightPathMovementGenerator::InitEndGridInfo()
{
- // Storage to preload flightmaster grid at end of flight. For multi-stop flights, this will
- // be reinitialized for each flightmaster at the end of each spline (or stop) in the flight.
-
- uint32 nodeCount = (*i_path).size(); // Get the number of nodes in the path.
- m_endMapId = (*i_path)[nodeCount -1].mapid; // Get the map ID from the last node
- m_preloadTargetNode = nodeCount - 3; // 2 nodes before the final node, we pre-load the grid
- m_endGridX = (*i_path)[nodeCount -1].x; // Get the X position from the last node
- m_endGridY = (*i_path)[nodeCount -1].y; // Get the Y position from the last node
+ /*! Storage to preload flightmaster grid at end of flight. For multi-stop flights, this will
+ be reinitialized for each flightmaster at the end of each spline (or stop) in the flight. */
+ uint32 nodeCount = (*i_path).size(); //! Number of nodes in path.
+ _endMapId = (*i_path)[nodeCount - 1].mapid; //! MapId of last node
+ _preloadTargetNode = nodeCount - 3;
+ _endGridX = (*i_path)[nodeCount - 1].x;
+ _endGridY = (*i_path)[nodeCount - 1].y;
}
void FlightPathMovementGenerator::PreloadEndGrid()
{
// used to preload the final grid where the flightmaster is
- Map* endMap = sMapMgr->FindBaseNonInstanceMap(m_endMapId);
+ Map* endMap = sMapMgr->FindBaseNonInstanceMap(_endMapId);
// Load the grid
if (endMap)
{
- sLog->outDetail("Preloading flightmaster at grid (%f, %f) for map %u", m_endGridX, m_endGridY, m_endMapId);
- endMap->LoadGrid(m_endGridX, m_endGridY);
+ sLog->outDetail("Preloading rid (%f, %f) for map %u at node index %u/%u", _endGridX, _endGridY, _endMapId, _preloadTargetNode, (uint32)(i_path->size()-1));
+ endMap->LoadGrid(_endGridX, _endGridY);
}
else
sLog->outDetail("Unable to determine map to preload flightmaster grid");
}
-void FlightPathMovementGenerator::DoEventIfAny(Player& player, TaxiPathNodeEntry const& node, bool departure)
-{
- if (uint32 eventid = departure ? node.departureEventID : node.arrivalEventID)
- {
- sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Taxi %s event %u of node %u of path %u for player %s", departure ? "departure" : "arrival", eventid, node.index, node.path, player.GetName());
- player.GetMap()->ScriptsStart(sEventScripts, eventid, &player, &player);
- }
-}
-
//
// Unique1's ASTAR Pathfinding Code... For future use & reference...
diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
index ea277eaafc6..aa6d327db3b 100755
--- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,10 +26,8 @@
*/
#include "MovementGenerator.h"
-#include "DestinationHolder.h"
#include "WaypointManager.h"
#include "Path.h"
-#include "Traveller.h"
#include "Player.h"
@@ -44,49 +42,68 @@ template<class T, class P>
class PathMovementBase
{
public:
- PathMovementBase() : i_currentNode(0) {}
+ PathMovementBase() : i_currentNode(0), i_path(NULL) {}
virtual ~PathMovementBase() {};
- bool MovementInProgress(void) const { return i_currentNode < i_path->size(); }
-
+ // template pattern, not defined .. override required
void LoadPath(T &);
- void ReloadPath(T &);
uint32 GetCurrentNode() const { return i_currentNode; }
- bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x, y, z); return true; }
- bool GetPosition(float& x, float& y, float& z) const { i_destinationHolder.GetLocationNowNoMicroMovement(x, y, z); return true; }
-
protected:
- uint32 i_currentNode;
- DestinationHolder< Traveller<T> > i_destinationHolder;
P i_path;
+ uint32 i_currentNode;
};
template<class T>
+class WaypointMovementGenerator;
-class WaypointMovementGenerator
- : public MovementGeneratorMedium< T, WaypointMovementGenerator<T> >, public PathMovementBase<T, WaypointPath const*>
+template<>
+class WaypointMovementGenerator<Creature>
+: public MovementGeneratorMedium< Creature, WaypointMovementGenerator<Creature> >,
+public PathMovementBase<Creature, WaypointPath const*>
{
public:
- WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) :
- node(NULL), path_id(_path_id), i_nextMoveTime(0), repeating(_repeating), StopedByPlayer(false) {}
-
- void Initialize(T &);
- void Finalize(T &);
- void MovementInform(T &);
- void InitTraveller(T &, const WaypointData &);
- void GeneratePathId(T &);
- void Reset(T &unit);
- bool Update(T &, const uint32);
- bool GetDestination(float &x, float &y, float &z) const;
+ WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) : i_nextMoveTime(0), path_id(_path_id), m_isArrivalDone(false), repeating(_repeating) {}
+ ~WaypointMovementGenerator() { i_path = NULL; }
+ void Initialize(Creature &);
+ void Finalize(Creature &);
+ void Reset(Creature &);
+ bool Update(Creature &, const uint32 &diff);
+
+ void MovementInform(Creature &);
+
MovementGeneratorType GetMovementGeneratorType() { return WAYPOINT_MOTION_TYPE; }
+ // now path movement implmementation
+ void LoadPath(Creature &c);
+
+ bool GetResetPosition(Creature&, float& x, float& y, float& z);
+
private:
- WaypointData* node;
- uint32 path_id;
+
+ void Stop(int32 time) { i_nextMoveTime.Reset(time);}
+
+ bool Stopped() { return !i_nextMoveTime.Passed();}
+
+ bool CanMove(int32 diff)
+ {
+ i_nextMoveTime.Update(diff);
+ return i_nextMoveTime.Passed();
+ }
+
+ void OnArrived(Creature&);
+ bool StartMove(Creature&);
+
+ void StartMoveNow(Creature& creature)
+ {
+ i_nextMoveTime.Reset(0);
+ StartMove(creature);
+ }
+
TimeTrackerSmall i_nextMoveTime;
- WaypointPath const* waypoints;
- bool repeating, StopedByPlayer;
+ bool m_isArrivalDone;
+ uint32 path_id;
+ bool repeating;
};
/** FlightPathMovementGenerator generates movement of the player for the paths
@@ -103,7 +120,7 @@ public PathMovementBase<Player, TaxiPathNodeList const*>
i_currentNode = startNode;
}
void Initialize(Player &);
- void Reset(Player & /*u*/){};
+ void Reset(Player &);
void Finalize(Player &);
bool Update(Player &, const uint32);
MovementGeneratorType GetMovementGeneratorType() { return FLIGHT_MOTION_TYPE; }
@@ -115,17 +132,16 @@ public PathMovementBase<Player, TaxiPathNodeList const*>
void SkipCurrentNode() { ++i_currentNode; }
void DoEventIfAny(Player& player, TaxiPathNodeEntry const& node, bool departure);
- bool GetDestination(float& x, float& y, float& z) const { return PathMovementBase<Player, TaxiPathNodeList const*>::GetDestination(x, y, z); }
+ bool GetResetPosition(Player&, float& x, float& y, float& z);
- void PreloadEndGrid();
void InitEndGridInfo();
+ void PreloadEndGrid();
+
private:
- // storage for preloading the flightmaster grid at end
- // before reaching final waypoint
- uint32 m_endMapId;
- uint32 m_preloadTargetNode;
- float m_endGridX;
- float m_endGridY;
+ float _endGridX; //! X coord of last node location
+ float _endGridY; //! Y coord of last node location
+ uint32 _endMapId; //! map Id of last node location
+ uint32 _preloadTargetNode; //! node index where preloading starts
};
#endif
diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp
new file mode 100644
index 00000000000..4eaa6b57b36
--- /dev/null
+++ b/src/server/game/Movement/Spline/MoveSpline.cpp
@@ -0,0 +1,316 @@
+/*
+ * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "MoveSpline.h"
+#include <sstream>
+#include "Log.h"
+
+namespace Movement{
+
+extern float computeFallTime(float path_length, bool isSafeFall);
+extern float computeFallElevation(float time_passed, bool isSafeFall, float start_velocy);
+extern float computeFallElevation(float time_passed);
+
+Location MoveSpline::ComputePosition() const
+{
+ ASSERT(Initialized());
+
+ float u = 1.f;
+ int32 seg_time = spline.length(point_Idx,point_Idx+1);
+ if (seg_time > 0)
+ u = (time_passed - spline.length(point_Idx)) / (float)seg_time;
+ Location c;
+ c.orientation = initialOrientation;
+ spline.evaluate_percent(point_Idx, u, c);
+
+ if (splineflags.animation)
+ ;// MoveSplineFlag::Animation disables falling or parabolic movement
+ else if (splineflags.parabolic)
+ computeParabolicElevation(c.z);
+ else if (splineflags.falling)
+ computeFallElevation(c.z);
+
+ if (splineflags.done && splineflags.isFacing())
+ {
+ if (splineflags.final_angle)
+ c.orientation = facing.angle;
+ else if (splineflags.final_point)
+ c.orientation = atan2(facing.f.y-c.y, facing.f.x-c.x);
+ //nothing to do for MoveSplineFlag::Final_Target flag
+ }
+ else
+ {
+ if (!splineflags.hasFlag(MoveSplineFlag::OrientationFixed|MoveSplineFlag::Falling))
+ {
+ Vector3 hermite;
+ spline.evaluate_derivative(point_Idx,u,hermite);
+ c.orientation = atan2(hermite.y, hermite.x);
+ }
+
+ if (splineflags.orientationInversed)
+ c.orientation = -c.orientation;
+ }
+ return c;
+}
+
+void MoveSpline::computeParabolicElevation(float& el) const
+{
+ if (time_passed > effect_start_time)
+ {
+ float t_passedf = MSToSec(time_passed - effect_start_time);
+ float t_durationf = MSToSec(Duration() - effect_start_time); //client use not modified duration here
+
+ // -a*x*x + bx + c:
+ //(dur * v3->z_acceleration * dt)/2 - (v3->z_acceleration * dt * dt)/2 + Z;
+ el += (t_durationf - t_passedf) * 0.5f * vertical_acceleration * t_passedf;
+ }
+}
+
+void MoveSpline::computeFallElevation(float& el) const
+{
+ float z_now = spline.getPoint(spline.first()).z - Movement::computeFallElevation(MSToSec(time_passed));
+ float final_z = FinalDestination().z;
+ if (z_now < final_z)
+ el = final_z;
+ else
+ el = z_now;
+}
+
+inline uint32 computeDuration(float length, float velocity)
+{
+ return SecToMS(length / velocity);
+}
+
+struct FallInitializer
+{
+ FallInitializer(float _start_elevation) : start_elevation(_start_elevation) {}
+ float start_elevation;
+ inline int32 operator()(Spline<int32>& s, int32 i)
+ {
+ return Movement::computeFallTime(start_elevation - s.getPoint(i+1).z,false) * 1000.f;
+ }
+};
+
+enum{
+ minimal_duration = 1,
+};
+
+struct CommonInitializer
+{
+ CommonInitializer(float _velocity) : velocityInv(1000.f/_velocity), time(minimal_duration) {}
+ float velocityInv;
+ int32 time;
+ inline int32 operator()(Spline<int32>& s, int32 i)
+ {
+ time += (s.SegLength(i) * velocityInv);
+ return time;
+ }
+};
+
+void MoveSpline::init_spline(const MoveSplineInitArgs& args)
+{
+ const SplineBase::EvaluationMode modes[2] = {SplineBase::ModeLinear,SplineBase::ModeCatmullrom};
+ if (args.flags.cyclic)
+ {
+ uint32 cyclic_point = 0;
+ // MoveSplineFlag::Enter_Cycle support dropped
+ //if (splineflags & SPLINEFLAG_ENTER_CYCLE)
+ //cyclic_point = 1; // shouldn't be modified, came from client
+ spline.init_cyclic_spline(&args.path[0], args.path.size(), modes[args.flags.isSmooth()], cyclic_point);
+ }
+ else
+ {
+ spline.init_spline(&args.path[0], args.path.size(), modes[args.flags.isSmooth()]);
+ }
+
+ // init spline timestamps
+ if (splineflags.falling)
+ {
+ FallInitializer init(spline.getPoint(spline.first()).z);
+ spline.initLengths(init);
+ }
+ else
+ {
+ CommonInitializer init(args.velocity);
+ spline.initLengths(init);
+ }
+
+ // TODO: what to do in such cases? problem is in input data (all points are at same coords)
+ if (spline.length() < minimal_duration)
+ {
+ sLog->outError("MoveSpline::init_spline: zero length spline, wrong input data?");
+ spline.set_length(spline.last(), spline.isCyclic() ? 1000 : 1);
+ }
+ point_Idx = spline.first();
+}
+
+void MoveSpline::Initialize(const MoveSplineInitArgs& args)
+{
+ splineflags = args.flags;
+ facing = args.facing;
+ m_Id = args.splineId;
+ point_Idx_offset = args.path_Idx_offset;
+ initialOrientation = args.initialOrientation;
+
+ time_passed = 0;
+ vertical_acceleration = 0.f;
+ effect_start_time = 0;
+
+ init_spline(args);
+
+ // init parabolic / animation
+ // spline initialized, duration known and i able to compute parabolic acceleration
+ if (args.flags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation))
+ {
+ effect_start_time = Duration() * args.time_perc;
+ if (args.flags.parabolic && effect_start_time < Duration())
+ {
+ float f_duration = MSToSec(Duration() - effect_start_time);
+ vertical_acceleration = args.parabolic_amplitude * 8.f / (f_duration * f_duration);
+ }
+ }
+}
+
+MoveSpline::MoveSpline() : m_Id(0), time_passed(0),
+ vertical_acceleration(0.f), effect_start_time(0), point_Idx(0), point_Idx_offset(0), initialOrientation(0.f)
+{
+ splineflags.done = true;
+}
+
+/// ============================================================================================
+
+bool MoveSplineInitArgs::Validate() const
+{
+#define CHECK(exp) \
+ if (!(exp))\
+ {\
+ sLog->outError("MoveSplineInitArgs::Validate: expression '%s' failed", #exp);\
+ return false;\
+ }
+ CHECK(path.size() > 1);
+ CHECK(velocity > 0.f);
+ CHECK(time_perc >= 0.f && time_perc <= 1.f);
+ //CHECK(_checkPathBounds());
+ return true;
+#undef CHECK
+}
+
+// MONSTER_MOVE packet format limitation for not CatmullRom movement:
+// each vertex offset packed into 11 bytes
+bool MoveSplineInitArgs::_checkPathBounds() const
+{
+ if (!(flags & MoveSplineFlag::Mask_CatmullRom) && path.size() > 2)
+ {
+ enum{
+ MAX_OFFSET = (1 << 11) / 2,
+ };
+ Vector3 middle = (path.front()+path.back()) / 2;
+ Vector3 offset;
+ for (uint32 i = 1; i < path.size()-1; ++i)
+ {
+ offset = path[i] - middle;
+ if (fabs(offset.x) >= MAX_OFFSET || fabs(offset.y) >= MAX_OFFSET || fabs(offset.z) >= MAX_OFFSET)
+ {
+ sLog->outError("MoveSplineInitArgs::_checkPathBounds check failed");
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+/// ============================================================================================
+
+MoveSpline::UpdateResult MoveSpline::_updateState(int32& ms_time_diff)
+{
+ if (Finalized())
+ {
+ ms_time_diff = 0;
+ return Result_Arrived;
+ }
+
+ UpdateResult result = Result_None;
+
+ int32 minimal_diff = std::min(ms_time_diff, segment_time_elapsed());
+ ASSERT(minimal_diff >= 0);
+ time_passed += minimal_diff;
+ ms_time_diff -= minimal_diff;
+
+ if (time_passed >= next_timestamp())
+ {
+ ++point_Idx;
+ if (point_Idx < spline.last())
+ {
+ result = Result_NextSegment;
+ }
+ else
+ {
+ if (spline.isCyclic())
+ {
+ point_Idx = spline.first();
+ time_passed = time_passed % Duration();
+ result = Result_NextSegment;
+ }
+ else
+ {
+ _Finalize();
+ ms_time_diff = 0;
+ result = Result_Arrived;
+ }
+ }
+ }
+
+ return result;
+}
+
+std::string MoveSpline::ToString() const
+{
+ std::stringstream str;
+ str << "MoveSpline" << std::endl;
+ str << "spline Id: " << GetId() << std::endl;
+ str << "flags: " << splineflags.ToString() << std::endl;
+ if (splineflags.final_angle)
+ str << "facing angle: " << facing.angle;
+ else if (splineflags.final_target)
+ str << "facing target: " << facing.target;
+ else if(splineflags.final_point)
+ str << "facing point: " << facing.f.x << " " << facing.f.y << " " << facing.f.z;
+ str << std::endl;
+ str << "time passed: " << time_passed << std::endl;
+ str << "total time: " << Duration() << std::endl;
+ str << "spline point Id: " << point_Idx << std::endl;
+ str << "path point Id: " << currentPathIdx() << std::endl;
+ str << spline.ToString();
+ return str.str();
+}
+
+void MoveSpline::_Finalize()
+{
+ splineflags.done = true;
+ point_Idx = spline.last() - 1;
+ time_passed = Duration();
+}
+
+int32 MoveSpline::currentPathIdx() const
+{
+ int32 point = point_Idx_offset + point_Idx - spline.first() + (int)Finalized();
+ if (isCyclic())
+ point = point % (spline.last()-spline.first());
+ return point;
+}
+}
diff --git a/src/server/game/Movement/Spline/MoveSpline.h b/src/server/game/Movement/Spline/MoveSpline.h
new file mode 100644
index 00000000000..4b8dbcc8ee3
--- /dev/null
+++ b/src/server/game/Movement/Spline/MoveSpline.h
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef TRINITYSERVER_MOVEPLINE_H
+#define TRINITYSERVER_MOVEPLINE_H
+
+#include "Spline.h"
+#include "MoveSplineInitArgs.h"
+
+namespace Movement
+{
+ struct Location : public Vector3
+ {
+ Location() : orientation(0) {}
+ Location(float x, float y, float z, float o) : Vector3(x,y,z), orientation(o) {}
+ Location(const Vector3& v) : Vector3(v), orientation(0) {}
+ Location(const Vector3& v, float o) : Vector3(v), orientation(o) {}
+
+ float orientation;
+ };
+
+ // MoveSpline represents smooth catmullrom or linear curve and point that moves belong it
+ // curve can be cyclic - in this case movement will be cyclic
+ // point can have vertical acceleration motion componemt(used in fall, parabolic movement)
+ class MoveSpline
+ {
+ public:
+ typedef Spline<int32> MySpline;
+ enum UpdateResult{
+ Result_None = 0x01,
+ Result_Arrived = 0x02,
+ Result_NextCycle = 0x04,
+ Result_NextSegment = 0x08,
+ };
+ #pragma region fields
+ friend class PacketBuilder;
+ protected:
+ MySpline spline;
+
+ FacingInfo facing;
+
+ uint32 m_Id;
+
+ MoveSplineFlag splineflags;
+
+ int32 time_passed;
+ // currently duration mods are unused, but its _currently_
+ //float duration_mod;
+ //float duration_mod_next;
+ float vertical_acceleration;
+ float initialOrientation;
+ int32 effect_start_time;
+ int32 point_Idx;
+ int32 point_Idx_offset;
+
+ void init_spline(const MoveSplineInitArgs& args);
+ protected:
+
+ const MySpline::ControlArray& getPath() const { return spline.getPoints();}
+ void computeParabolicElevation(float& el) const;
+ void computeFallElevation(float& el) const;
+
+ UpdateResult _updateState(int32& ms_time_diff);
+ int32 next_timestamp() const { return spline.length(point_Idx+1);}
+ int32 segment_time_elapsed() const { return next_timestamp()-time_passed;}
+ int32 Duration() const { return spline.length();}
+ int32 timeElapsed() const { return Duration() - time_passed;}
+ int32 timePassed() const { return time_passed;}
+
+ public:
+ const MySpline& _Spline() const { return spline;}
+ int32 _currentSplineIdx() const { return point_Idx;}
+ void _Finalize();
+ void _Interrupt() { splineflags.done = true;}
+
+ #pragma endregion
+ public:
+
+ void Initialize(const MoveSplineInitArgs&);
+ bool Initialized() const { return !spline.empty();}
+
+ explicit MoveSpline();
+
+ template<class UpdateHandler>
+ void updateState(int32 difftime, UpdateHandler& handler)
+ {
+ ASSERT(Initialized());
+ do
+ handler(_updateState(difftime));
+ while(difftime > 0);
+ }
+
+ void updateState(int32 difftime)
+ {
+ ASSERT(Initialized());
+ do _updateState(difftime);
+ while(difftime > 0);
+ }
+
+ Location ComputePosition() const;
+
+ uint32 GetId() const { return m_Id;}
+ bool Finalized() const { return splineflags.done; }
+ bool isCyclic() const { return splineflags.cyclic;}
+ const Vector3 FinalDestination() const { return Initialized() ? spline.getPoint(spline.last()) : Vector3();}
+ const Vector3 CurrentDestination() const { return Initialized() ? spline.getPoint(point_Idx+1) : Vector3();}
+ int32 currentPathIdx() const;
+
+ std::string ToString() const;
+ };
+}
+#endif // TRINITYSERVER_MOVEPLINE_H
diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h
new file mode 100644
index 00000000000..de91f63c30a
--- /dev/null
+++ b/src/server/game/Movement/Spline/MoveSplineFlag.h
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef TRINITYSERVER_MOVESPLINEFLAG_H
+#define TRINITYSERVER_MOVESPLINEFLAG_H
+#include "MovementTypedefs.h"
+
+#include <string>
+
+namespace Movement
+{
+#if defined( __GNUC__ )
+#pragma pack(1)
+#else
+#pragma pack(push,1)
+#endif
+
+ class MoveSplineFlag
+ {
+ public:
+ enum eFlags{
+ None = 0x00000000,
+ // x00-xFF(first byte) used as animation Ids storage in pair with Animation flag
+ Done = 0x00000100,
+ Falling = 0x00000200, // Affects elevation computation, can't be combined with Parabolic flag
+ No_Spline = 0x00000400,
+ Parabolic = 0x00000800, // Affects elevation computation, can't be combined with Falling flag
+ Walkmode = 0x00001000,
+ Flying = 0x00002000, // Smooth movement(Catmullrom interpolation mode), flying animation
+ OrientationFixed = 0x00004000, // Model orientation fixed
+ Final_Point = 0x00008000,
+ Final_Target = 0x00010000,
+ Final_Angle = 0x00020000,
+ Catmullrom = 0x00040000, // Used Catmullrom interpolation mode
+ Cyclic = 0x00080000, // Movement by cycled spline
+ Enter_Cycle = 0x00100000, // Everytimes appears with cyclic flag in monster move packet, erases first spline vertex after first cycle done
+ Animation = 0x00200000, // Plays animation after some time passed
+ Frozen = 0x00400000, // Will never arrive
+ Unknown5 = 0x00800000,
+ Unknown6 = 0x01000000,
+ Unknown7 = 0x02000000,
+ Unknown8 = 0x04000000,
+ OrientationInversed = 0x08000000,
+ Unknown10 = 0x10000000,
+ Unknown11 = 0x20000000,
+ Unknown12 = 0x40000000,
+ Unknown13 = 0x80000000,
+
+ // Masks
+ Mask_Final_Facing = Final_Point | Final_Target | Final_Angle,
+ // animation ids stored here, see AnimType enum, used with Animation flag
+ Mask_Animations = 0xFF,
+ // flags that shouldn't be appended into SMSG_MONSTER_MOVE\SMSG_MONSTER_MOVE_TRANSPORT packet, should be more probably
+ Mask_No_Monster_Move = Mask_Final_Facing | Mask_Animations | Done,
+ // CatmullRom interpolation mode used
+ Mask_CatmullRom = Flying | Catmullrom,
+ // Unused, not suported flags
+ Mask_Unused = No_Spline|Enter_Cycle|Frozen|Unknown5|Unknown6|Unknown7|Unknown8|Unknown10|Unknown11|Unknown12|Unknown13,
+ };
+
+ inline uint32& raw() { return (uint32&)*this;}
+ inline const uint32& raw() const { return (const uint32&)*this;}
+
+ MoveSplineFlag() { raw() = 0; }
+ MoveSplineFlag(uint32 f) { raw() = f; }
+ MoveSplineFlag(const MoveSplineFlag& f) { raw() = f.raw(); }
+
+ // Constant interface
+
+ bool isSmooth() const { return raw() & Mask_CatmullRom;}
+ bool isLinear() const { return !isSmooth();}
+ bool isFacing() const { return raw() & Mask_Final_Facing;}
+
+ uint8 getAnimationId() const { return animId;}
+ bool hasAllFlags(uint32 f) const { return (raw() & f) == f;}
+ bool hasFlag(uint32 f) const { return (raw() & f) != 0;}
+ uint32 operator & (uint32 f) const { return (raw() & f);}
+ uint32 operator | (uint32 f) const { return (raw() | f);}
+ std::string ToString() const;
+
+ // Not constant interface
+
+ void operator &= (uint32 f) { raw() &= f;}
+ void operator |= (uint32 f) { raw() |= f;}
+
+ void EnableAnimation(uint8 anim) { raw() = raw() & ~(Mask_Animations|Falling|Parabolic) | Animation|anim;}
+ void EnableParabolic() { raw() = raw() & ~(Mask_Animations|Falling|Animation) | Parabolic;}
+ void EnableFalling() { raw() = raw() & ~(Mask_Animations|Parabolic|Animation) | Falling;}
+ void EnableFlying() { raw() = raw() & ~Catmullrom | Flying; }
+ void EnableCatmullRom() { raw() = raw() & ~Flying | Catmullrom; }
+ void EnableFacingPoint() { raw() = raw() & ~Mask_Final_Facing | Final_Point;}
+ void EnableFacingAngle() { raw() = raw() & ~Mask_Final_Facing | Final_Angle;}
+ void EnableFacingTarget() { raw() = raw() & ~Mask_Final_Facing | Final_Target;}
+
+ uint8 animId : 8;
+ bool done : 1;
+ bool falling : 1;
+ bool no_spline : 1;
+ bool parabolic : 1;
+ bool walkmode : 1;
+ bool flying : 1;
+ bool orientationFixed : 1;
+ bool final_point : 1;
+ bool final_target : 1;
+ bool final_angle : 1;
+ bool catmullrom : 1;
+ bool cyclic : 1;
+ bool enter_cycle : 1;
+ bool animation : 1;
+ bool frozen : 1;
+ bool unknown5 : 1;
+ bool unknown6 : 1;
+ bool unknown7 : 1;
+ bool unknown8 : 1;
+ bool orientationInversed : 1;
+ bool unknown10 : 1;
+ bool unknown11 : 1;
+ bool unknown12 : 1;
+ bool unknown13 : 1;
+ };
+#if defined( __GNUC__ )
+#pragma pack()
+#else
+#pragma pack(pop)
+#endif
+}
+
+#endif // TRINITYSERVER_MOVESPLINEFLAG_H
diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp
new file mode 100644
index 00000000000..b5ae923dc32
--- /dev/null
+++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "MoveSplineInit.h"
+#include "MoveSpline.h"
+#include "MovementPacketBuilder.h"
+#include "Unit.h"
+
+namespace Movement
+{
+ UnitMoveType SelectSpeedType(uint32 moveFlags)
+ {
+ if (moveFlags & MOVEMENTFLAG_FLYING)
+ {
+ if ( moveFlags & MOVEMENTFLAG_BACKWARD /*&& speed_obj.flight >= speed_obj.flight_back*/ )
+ return MOVE_FLIGHT_BACK;
+ else
+ return MOVE_FLIGHT;
+ }
+ else if (moveFlags & MOVEMENTFLAG_SWIMMING)
+ {
+ if (moveFlags & MOVEMENTFLAG_BACKWARD /*&& speed_obj.swim >= speed_obj.swim_back*/)
+ return MOVE_SWIM_BACK;
+ else
+ return MOVE_SWIM;
+ }
+ else if (moveFlags & MOVEMENTFLAG_WALKING)
+ {
+ //if ( speed_obj.run > speed_obj.walk )
+ return MOVE_WALK;
+ }
+ else if (moveFlags & MOVEMENTFLAG_BACKWARD /*&& speed_obj.run >= speed_obj.run_back*/)
+ return MOVE_RUN_BACK;
+
+ return MOVE_RUN;
+ }
+
+ void MoveSplineInit::Launch()
+ {
+ MoveSpline& move_spline = *unit.movespline;
+
+ Location real_position(unit.GetPositionX(),unit.GetPositionY(),unit.GetPositionZ(),unit.GetOrientation());
+ // there is a big chane that current position is unknown if current state is not finalized, need compute it
+ // this also allows calculate spline position and update map position in much greater intervals
+ if (!move_spline.Finalized())
+ real_position = move_spline.ComputePosition();
+
+ if (args.path.empty())
+ {
+ // should i do the things that user should do?
+ MoveTo(real_position);
+ }
+
+ // corrent first vertex
+ args.path[0] = real_position;
+ args.initialOrientation = real_position.orientation;
+
+ uint32 moveFlags = unit.m_movementInfo.GetMovementFlags();
+ if (args.flags.walkmode)
+ moveFlags |= MOVEMENTFLAG_WALKING;
+ else
+ moveFlags &= ~MOVEMENTFLAG_WALKING;
+
+ moveFlags |= (MOVEMENTFLAG_SPLINE_ENABLED|MOVEMENTFLAG_FORWARD);
+
+ if (args.velocity == 0.f)
+ args.velocity = unit.GetSpeed(SelectSpeedType(moveFlags));
+
+ if (!args.Validate())
+ return;
+
+ if (moveFlags & MOVEMENTFLAG_ROOT)
+ moveFlags &= ~MOVEMENTFLAG_MASK_MOVING;
+
+ unit.m_movementInfo.SetMovementFlags((MovementFlags)moveFlags);
+ move_spline.Initialize(args);
+
+ WorldPacket data(SMSG_MONSTER_MOVE, 64);
+ data.append(unit.GetPackGUID());
+ PacketBuilder::WriteMonsterMove(move_spline, data);
+ unit.SendMessageToSet(&data,true);
+ }
+
+ MoveSplineInit::MoveSplineInit(Unit& m) : unit(m)
+ {
+ // mix existing state into new
+ args.flags.walkmode = unit.m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING);
+ args.flags.flying = unit.m_movementInfo.HasMovementFlag((MovementFlags)(MOVEMENTFLAG_FLYING|MOVEMENTFLAG_LEVITATING));
+ }
+
+ void MoveSplineInit::SetFacing(const Unit * target)
+ {
+ args.flags.EnableFacingTarget();
+ //args.facing.target = target->GetObjectGuid().GetRawValue();
+ args.facing.target = target->GetUInt64Value(OBJECT_FIELD_GUID);
+ }
+
+ void MoveSplineInit::SetFacing(float angle)
+ {
+ args.facing.angle = G3D::wrap(angle, 0.f, (float)G3D::twoPi());
+ args.flags.EnableFacingAngle();
+ }
+}
diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h
new file mode 100644
index 00000000000..7ef6cd7a120
--- /dev/null
+++ b/src/server/game/Movement/Spline/MoveSplineInit.h
@@ -0,0 +1,170 @@
+/*
+ * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef TRINITYSERVER_MOVESPLINEINIT_H
+#define TRINITYSERVER_MOVESPLINEINIT_H
+
+#include "MoveSplineInitArgs.h"
+
+class Unit;
+
+namespace Movement
+{
+ enum AnimType
+ {
+ ToGround = 0, // 460 = ToGround, index of AnimationData.dbc
+ FlyToFly = 1, // 461 = FlyToFly?
+ ToFly = 2, // 458 = ToFly
+ FlyToGround = 3, // 463 = FlyToGround
+ };
+
+ /* Initializes and launches spline movement
+ */
+ class MoveSplineInit
+ {
+ public:
+
+ explicit MoveSplineInit(Unit& m);
+
+ /* Final pass of initialization that launches spline movement.
+ */
+ void Launch();
+
+ /* Adds movement by parabolic trajectory
+ * @param amplitude - the maximum height of parabola, value could be negative and positive
+ * @param start_time - delay between movement starting time and beginning to move by parabolic trajectory
+ * can't be combined with final animation
+ */
+ void SetParabolic(float amplitude, float start_time);
+ /* Plays animation after movement done
+ * can't be combined with parabolic movement
+ */
+ void SetAnimation(AnimType anim);
+
+ /* Adds final facing animation
+ * sets unit's facing to specified point/angle after all path done
+ * you can have only one final facing: previous will be overriden
+ */
+ void SetFacing(float angle);
+ void SetFacing(Vector3 const& point);
+ void SetFacing(const Unit * target);
+
+ /* Initializes movement by path
+ * @param path - array of points, shouldn't be empty
+ * @param pointId - Id of fisrt point of the path. Example: when third path point will be done it will notify that pointId + 3 done
+ */
+ void MovebyPath(const PointsArray& path, int32 pointId = 0);
+
+ /* Initializes simple A to B mition, A is current unit's position, B is destination
+ */
+ void MoveTo(const Vector3& destination);
+ void MoveTo(float x, float y, float z);
+
+ /* Sets Id of fisrt point of the path. When N-th path point will be done ILisener will notify that pointId + N done
+ * Needed for waypoint movement where path splitten into parts
+ */
+ void SetFirstPointId(int32 pointId) { args.path_Idx_offset = pointId; }
+
+ /* Enables CatmullRom spline interpolation mode(makes path smooth)
+ * if not enabled linear spline mode will be choosen. Disabled by default
+ */
+ void SetSmooth();
+ /* Enables CatmullRom spline interpolation mode, enables flying animation. Disabled by default
+ */
+ void SetFly();
+ /* Enables walk mode. Disabled by default
+ */
+ void SetWalk(bool enable);
+ /* Makes movement cyclic. Disabled by default
+ */
+ void SetCyclic();
+ /* Enables falling mode. Disabled by default
+ */
+ void SetFall();
+ /* Inverses unit model orientation. Disabled by default
+ */
+ void SetOrientationInversed();
+ /* Fixes unit's model rotation. Disabled by default
+ */
+ void SetOrientationFixed(bool enable);
+
+ /* Sets the velocity (in case you want to have custom movement velocity)
+ * if no set, speed will be selected based on unit's speeds and current movement mode
+ * Has no effect if falling mode enabled
+ * velocity shouldn't be negative
+ */
+ void SetVelocity(float velocity);
+
+ PointsArray& Path() { return args.path; }
+
+ protected:
+
+ MoveSplineInitArgs args;
+ Unit& unit;
+ };
+
+ inline void MoveSplineInit::SetFly() { args.flags.EnableFlying();}
+ inline void MoveSplineInit::SetWalk(bool enable) { args.flags.walkmode = enable;}
+ inline void MoveSplineInit::SetSmooth() { args.flags.EnableCatmullRom();}
+ inline void MoveSplineInit::SetCyclic() { args.flags.cyclic = true;}
+ inline void MoveSplineInit::SetFall() { args.flags.EnableFalling();}
+ inline void MoveSplineInit::SetVelocity(float vel){ args.velocity = vel;}
+ inline void MoveSplineInit::SetOrientationInversed() { args.flags.orientationInversed = true;}
+ inline void MoveSplineInit::SetOrientationFixed(bool enable) { args.flags.orientationFixed = enable;}
+
+ inline void MoveSplineInit::MovebyPath(const PointsArray& controls, int32 path_offset)
+ {
+ args.path_Idx_offset = path_offset;
+ args.path.assign(controls.begin(),controls.end());
+ }
+
+ inline void MoveSplineInit::MoveTo(float x, float y, float z)
+ {
+ Vector3 v(x,y,z);
+ MoveTo(v);
+ }
+
+ inline void MoveSplineInit::MoveTo(const Vector3& dest)
+ {
+ args.path_Idx_offset = 0;
+ args.path.resize(2);
+ args.path[1] = dest;
+ }
+
+ inline void MoveSplineInit::SetParabolic(float amplitude, float time_shift)
+ {
+ args.time_perc = time_shift;
+ args.parabolic_amplitude = amplitude;
+ args.flags.EnableParabolic();
+ }
+
+ inline void MoveSplineInit::SetAnimation(AnimType anim)
+ {
+ args.time_perc = 0.f;
+ args.flags.EnableAnimation((uint8)anim);
+ }
+
+ inline void MoveSplineInit::SetFacing(Vector3 const& spot)
+ {
+ args.facing.f.x = spot.x;
+ args.facing.f.y = spot.y;
+ args.facing.f.z = spot.z;
+ args.flags.EnableFacingPoint();
+ }
+}
+#endif // TRINITYSERVER_MOVESPLINEINIT_H
diff --git a/src/server/game/Movement/Spline/MoveSplineInitArgs.h b/src/server/game/Movement/Spline/MoveSplineInitArgs.h
new file mode 100644
index 00000000000..26fbbdd0fcc
--- /dev/null
+++ b/src/server/game/Movement/Spline/MoveSplineInitArgs.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef TRINITYSERVER_MOVESPLINEINIT_ARGS_H
+#define TRINITYSERVER_MOVESPLINEINIT_ARGS_H
+
+#include "MoveSplineFlag.h"
+#include <G3D/Vector3.h>
+
+namespace Movement
+{
+ typedef std::vector<Vector3> PointsArray;
+
+ union FacingInfo
+ {
+ struct{
+ float x,y,z;
+ }f;
+ uint64 target;
+ float angle;
+
+ FacingInfo(float o) : angle(o) {}
+ FacingInfo(uint64 t) : target(t) {}
+ FacingInfo() {}
+ };
+
+ struct MoveSplineInitArgs
+ {
+ MoveSplineInitArgs(size_t path_capacity = 16) : path_Idx_offset(0),
+ velocity(0.f), parabolic_amplitude(0.f), time_perc(0.f), splineId(0), initialOrientation(0.f)
+ {
+ path.reserve(path_capacity);
+ }
+
+ PointsArray path;
+ FacingInfo facing;
+ MoveSplineFlag flags;
+ int32 path_Idx_offset;
+ float velocity;
+ float parabolic_amplitude;
+ float time_perc;
+ uint32 splineId;
+ float initialOrientation;
+
+ /** Returns true to show that the arguments were configured correctly and MoveSpline initialization will succeed. */
+ bool Validate() const;
+ private:
+ bool _checkPathBounds() const;
+ };
+}
+
+#endif // TRINITYSERVER_MOVESPLINEINIT_ARGS_H
diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp
new file mode 100644
index 00000000000..73fdbf4c2f6
--- /dev/null
+++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp
@@ -0,0 +1,188 @@
+/*
+ * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "MovementPacketBuilder.h"
+#include "MoveSpline.h"
+#include "WorldPacket.h"
+
+namespace Movement
+{
+ inline void operator << (ByteBuffer& b, const Vector3& v)
+ {
+ b << v.x << v.y << v.z;
+ }
+
+ inline void operator >> (ByteBuffer& b, Vector3& v)
+ {
+ b >> v.x >> v.y >> v.z;
+ }
+
+ enum MonsterMoveType
+ {
+ MonsterMoveNormal = 0,
+ MonsterMoveStop = 1,
+ MonsterMoveFacingSpot = 2,
+ MonsterMoveFacingTarget = 3,
+ MonsterMoveFacingAngle = 4
+ };
+
+ void PacketBuilder::WriteCommonMonsterMovePart(const MoveSpline& move_spline, WorldPacket& data)
+ {
+ MoveSplineFlag splineflags = move_spline.splineflags;
+ /*if (mov.IsBoarded())
+ {
+ data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT);
+ data << mov.GetTransport()->Owner.GetPackGUID();
+ data << int8(mov.m_unused.transport_seat);
+ }*/
+
+ data << uint8(0);
+ data << move_spline.spline.getPoint(move_spline.spline.first());
+ data << move_spline.GetId();
+
+ switch(splineflags & MoveSplineFlag::Mask_Final_Facing)
+ {
+ default:
+ data << uint8(MonsterMoveNormal);
+ break;
+ case MoveSplineFlag::Final_Target:
+ data << uint8(MonsterMoveFacingTarget);
+ data << move_spline.facing.target;
+ break;
+ case MoveSplineFlag::Final_Angle:
+ data << uint8(MonsterMoveFacingAngle);
+ data << move_spline.facing.angle;
+ break;
+ case MoveSplineFlag::Final_Point:
+ data << uint8(MonsterMoveFacingSpot);
+ data << move_spline.facing.f.x << move_spline.facing.f.y << move_spline.facing.f.z;
+ break;
+ }
+
+ // add fake Enter_Cycle flag - needed for client-side cyclic movement (client will erase first spline vertex after first cycle done)
+ splineflags.enter_cycle = move_spline.isCyclic();
+ data << uint32(splineflags & ~MoveSplineFlag::Mask_No_Monster_Move);
+
+ if (splineflags.animation)
+ {
+ data << splineflags.getAnimationId();
+ data << move_spline.effect_start_time;
+ }
+
+ data << move_spline.Duration();
+
+ if (splineflags.parabolic)
+ {
+ data << move_spline.vertical_acceleration;
+ data << move_spline.effect_start_time;
+ }
+ }
+
+ void WriteLinearPath(const Spline<int32>& spline, ByteBuffer& data)
+ {
+ uint32 last_idx = spline.getPointCount() - 3;
+ const Vector3 * real_path = &spline.getPoint(1);
+
+ data << last_idx;
+ data << real_path[last_idx]; // destination
+ if (last_idx > 1)
+ {
+ Vector3 middle = (real_path[0] + real_path[last_idx]) / 2.f;
+ Vector3 offset;
+ // first and last points already appended
+ for(uint32 i = 1; i < last_idx; ++i)
+ {
+ offset = middle - real_path[i];
+ data.appendPackXYZ(offset.x, offset.y, offset.z);
+ }
+ }
+ }
+
+ void WriteCatmullRomPath(const Spline<int32>& spline, ByteBuffer& data)
+ {
+ uint32 count = spline.getPointCount() - 3;
+ data << count;
+ data.append<Vector3>(&spline.getPoint(2), count);
+ }
+
+ void WriteCatmullRomCyclicPath(const Spline<int32>& spline, ByteBuffer& data)
+ {
+ uint32 count = spline.getPointCount() - 3;
+ data << uint32(count + 1);
+ data << spline.getPoint(1); // fake point, client will erase it from the spline after first cycle done
+ data.append<Vector3>(&spline.getPoint(1), count);
+ }
+
+ void PacketBuilder::WriteMonsterMove(const MoveSpline& move_spline, WorldPacket& data)
+ {
+ WriteCommonMonsterMovePart(move_spline, data);
+
+ const Spline<int32>& spline = move_spline.spline;
+ MoveSplineFlag splineflags = move_spline.splineflags;
+ if (splineflags & MoveSplineFlag::Mask_CatmullRom)
+ {
+ if (splineflags.cyclic)
+ WriteCatmullRomCyclicPath(spline, data);
+ else
+ WriteCatmullRomPath(spline, data);
+ }
+ else
+ WriteLinearPath(spline, data);
+ }
+
+ void PacketBuilder::WriteCreate(const MoveSpline& move_spline, ByteBuffer& data)
+ {
+ //WriteClientStatus(mov,data);
+ //data.append<float>(&mov.m_float_values[SpeedWalk], SpeedMaxCount);
+ //if (mov.SplineEnabled())
+ {
+ MoveSplineFlag splineFlags = move_spline.splineflags;
+
+ data << splineFlags.raw();
+
+ if (splineFlags.final_angle)
+ {
+ data << move_spline.facing.angle;
+ }
+ else if (splineFlags.final_target)
+ {
+ data << move_spline.facing.target;
+ }
+ else if(splineFlags.final_point)
+ {
+ data << move_spline.facing.f.x << move_spline.facing.f.y << move_spline.facing.f.z;
+ }
+
+ data << move_spline.timePassed();
+ data << move_spline.Duration();
+ data << move_spline.GetId();
+
+ data << float(1.f); // splineInfo.duration_mod; added in 3.1
+ data << float(1.f); // splineInfo.duration_mod_next; added in 3.1
+
+ data << move_spline.vertical_acceleration; // added in 3.1
+ data << move_spline.effect_start_time; // added in 3.1
+
+ uint32 nodes = move_spline.getPath().size();
+ data << nodes;
+ data.append<Vector3>(&move_spline.getPath()[0], nodes);
+ data << uint8(move_spline.spline.mode()); // added in 3.1
+ data << (move_spline.isCyclic() ? Vector3::zero() : move_spline.FinalDestination());
+ }
+ }
+}
diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.h b/src/server/game/Movement/Spline/MovementPacketBuilder.h
new file mode 100644
index 00000000000..92a414e9b3b
--- /dev/null
+++ b/src/server/game/Movement/Spline/MovementPacketBuilder.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef TRINITYSERVER_PACKET_BUILDER_H
+#define TRINITYSERVER_PACKET_BUILDER_H
+
+class ByteBuffer;
+class WorldPacket;
+
+namespace Movement
+{
+ class MoveSpline;
+ class PacketBuilder
+ {
+ static void WriteCommonMonsterMovePart(const MoveSpline& mov, WorldPacket& data);
+ public:
+
+ static void WriteMonsterMove(const MoveSpline& mov, WorldPacket& data);
+ static void WriteCreate(const MoveSpline& mov, ByteBuffer& data);
+ };
+}
+#endif // TRINITYSERVER_PACKET_BUILDER_H
diff --git a/src/server/game/Movement/Spline/MovementTypedefs.h b/src/server/game/Movement/Spline/MovementTypedefs.h
new file mode 100644
index 00000000000..01c8a5b7e7b
--- /dev/null
+++ b/src/server/game/Movement/Spline/MovementTypedefs.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef TRINITYSERVER_TYPEDEFS_H
+#define TRINITYSERVER_TYPEDEFS_H
+
+#include "Common.h"
+
+namespace G3D
+{
+ class Vector2;
+ class Vector3;
+ class Vector4;
+}
+
+namespace Movement
+{
+ using G3D::Vector2;
+ using G3D::Vector3;
+ using G3D::Vector4;
+
+ inline uint32 SecToMS(float sec)
+ {
+ return static_cast<uint32>(sec * 1000.f);
+ }
+
+ inline float MSToSec(uint32 ms)
+ {
+ return ms / 1000.f;
+ }
+
+#ifndef static_assert
+ #define CONCAT(x, y) CONCAT1 (x, y)
+ #define CONCAT1(x, y) x##y
+ #define static_assert(expr, msg) typedef char CONCAT(static_assert_failed_at_line_, __LINE__) [(expr) ? 1 : -1]
+#endif
+
+ template<class T, T limit>
+ class counter
+ {
+ public:
+ counter() { init();}
+
+ void Increase()
+ {
+ if (m_counter == limit)
+ init();
+ else
+ ++m_counter;
+ }
+
+ T NewId() { Increase(); return m_counter;}
+ T getCurrent() const { return m_counter;}
+
+ private:
+ void init() { m_counter = 0; }
+ T m_counter;
+ };
+
+ typedef counter<uint32, 0xFFFFFFFF> UInt32Counter;
+
+ extern double gravity;
+ extern float computeFallElevation(float t_passed, bool isSafeFall, float start_velocity);
+}
+
+#endif // TRINITYSERVER_TYPEDEFS_H
diff --git a/src/server/game/Movement/Spline/MovementUtil.cpp b/src/server/game/Movement/Spline/MovementUtil.cpp
new file mode 100644
index 00000000000..f0ed01c4676
--- /dev/null
+++ b/src/server/game/Movement/Spline/MovementUtil.cpp
@@ -0,0 +1,208 @@
+/*
+ * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "MoveSplineFlag.h"
+#include <math.h>
+#include <string>
+
+namespace Movement
+{
+ double gravity = 19.29110527038574;
+
+ /// Velocity bounds that makes fall speed limited
+ float terminalVelocity = 60.148003f;
+ float terminalSavefallVelocity = 7.f;
+
+ const float terminal_length = float(terminalVelocity * terminalVelocity) / (2.f * gravity);
+ const float terminal_savefall_length = (terminalSavefallVelocity * terminalSavefallVelocity) / (2.f * gravity);
+ const float terminalFallTime = float(terminalVelocity/gravity); // the time that needed to reach terminalVelocity
+
+ float computeFallTime(float path_length, bool isSafeFall)
+ {
+ if (path_length < 0.f)
+ return 0.f;
+
+ float time;
+ if ( isSafeFall )
+ {
+ if (path_length >= terminal_savefall_length)
+ time = (path_length - terminal_savefall_length)/terminalSavefallVelocity + terminalSavefallVelocity/gravity;
+ else
+ time = sqrtf(2.f * path_length/gravity);
+ }
+ else
+ {
+ if (path_length >= terminal_length)
+ time = (path_length - terminal_length)/terminalVelocity + terminalFallTime;
+ else
+ time = sqrtf(2.f * path_length/gravity);
+ }
+
+ return time;
+ }
+
+ float computeFallElevation(float t_passed, bool isSafeFall, float start_velocity)
+ {
+ float termVel;
+ float result;
+
+ if ( isSafeFall )
+ termVel = terminalSavefallVelocity;
+ else
+ termVel = terminalVelocity;
+
+ if ( start_velocity > termVel )
+ start_velocity = termVel;
+
+ float terminal_time = terminalFallTime - start_velocity / gravity; // the time that needed to reach terminalVelocity
+
+ if ( t_passed > terminal_time )
+ {
+ result = terminalVelocity*(t_passed - terminal_time) +
+ start_velocity*terminal_time + gravity*terminal_time*terminal_time*0.5f;
+ }
+ else
+ result = t_passed * (start_velocity + t_passed * gravity * 0.5f);
+
+ return result;
+ }
+
+ float computeFallElevation(float t_passed)
+ {
+ float result;
+
+ if (t_passed > terminalFallTime)
+ {
+ //result = terminalVelocity * (t_passed - terminal_time) + gravity*terminal_time*terminal_time*0.5f;
+ // simplified view:
+ result = terminalVelocity * (t_passed - terminalFallTime) + terminal_length;
+ }
+ else
+ result = t_passed * t_passed * gravity * 0.5f;
+
+ return result;
+ }
+
+ #define STR(x) #x
+
+ const char * g_MovementFlag_names[]=
+ {
+ STR(Forward ),// 0x00000001,
+ STR(Backward ),// 0x00000002,
+ STR(Strafe_Left ),// 0x00000004,
+ STR(Strafe_Right ),// 0x00000008,
+ STR(Turn_Left ),// 0x00000010,
+ STR(Turn_Right ),// 0x00000020,
+ STR(Pitch_Up ),// 0x00000040,
+ STR(Pitch_Down ),// 0x00000080,
+
+ STR(Walk ),// 0x00000100, // Walking
+ STR(Ontransport ),// 0x00000200,
+ STR(Levitation ),// 0x00000400,
+ STR(Root ),// 0x00000800,
+ STR(Falling ),// 0x00001000,
+ STR(Fallingfar ),// 0x00002000,
+ STR(Pendingstop ),// 0x00004000,
+ STR(PendingSTRafestop ),// 0x00008000,
+ STR(Pendingforward ),// 0x00010000,
+ STR(Pendingbackward ),// 0x00020000,
+ STR(PendingSTRafeleft ),// 0x00040000,
+ STR(PendingSTRaferight ),// 0x00080000,
+ STR(Pendingroot ),// 0x00100000,
+ STR(Swimming ),// 0x00200000, // Appears With Fly Flag Also
+ STR(Ascending ),// 0x00400000, // Swim Up Also
+ STR(Descending ),// 0x00800000, // Swim Down Also
+ STR(Can_Fly ),// 0x01000000, // Can Fly In 3.3?
+ STR(Flying ),// 0x02000000, // Actual Flying Mode
+ STR(Spline_Elevation ),// 0x04000000, // Used For Flight Paths
+ STR(Spline_Enabled ),// 0x08000000, // Used For Flight Paths
+ STR(Waterwalking ),// 0x10000000, // Prevent Unit From Falling Through Water
+ STR(Safe_Fall ),// 0x20000000, // Active Rogue Safe Fall Spell (Passive)
+ STR(Hover ),// 0x40000000
+ STR(Unknown13 ),// 0x80000000
+ STR(Unk1 ),
+ STR(Unk2 ),
+ STR(Unk3 ),
+ STR(Fullspeedturning ),
+ STR(Fullspeedpitching ),
+ STR(Allow_Pitching ),
+ STR(Unk4 ),
+ STR(Unk5 ),
+ STR(Unk6 ),
+ STR(Unk7 ),
+ STR(Interp_Move ),
+ STR(Interp_Turning ),
+ STR(Interp_Pitching ),
+ STR(Unk8 ),
+ STR(Unk9 ),
+ STR(Unk10 ),
+ };
+
+ const char * g_SplineFlag_names[32]=
+ {
+ STR(AnimBit1 ),// 0x00000001,
+ STR(AnimBit2 ),// 0x00000002,
+ STR(AnimBit3 ),// 0x00000004,
+ STR(AnimBit4 ),// 0x00000008,
+ STR(AnimBit5 ),// 0x00000010,
+ STR(AnimBit6 ),// 0x00000020,
+ STR(AnimBit7 ),// 0x00000040,
+ STR(AnimBit8 ),// 0x00000080,
+ STR(Done ),// 0x00000100,
+ STR(Falling ),// 0x00000200, // Not Compartible With Trajectory Movement
+ STR(No_Spline ),// 0x00000400,
+ STR(Trajectory ),// 0x00000800, // Not Compartible With Fall Movement
+ STR(Walkmode ),// 0x00001000,
+ STR(Flying ),// 0x00002000, // Smooth Movement(Catmullrom Interpolation Mode), Flying Animation
+ STR(Knockback ),// 0x00004000, // Model Orientation Fixed
+ STR(Final_Point ),// 0x00008000,
+ STR(Final_Target ),// 0x00010000,
+ STR(Final_Angle ),// 0x00020000,
+ STR(Catmullrom ),// 0x00040000, // Used Catmullrom Interpolation Mode
+ STR(Cyclic ),// 0x00080000, // Movement By Cycled Spline
+ STR(Enter_Cycle ),// 0x00100000, // Everytime Appears With Cyclic Flag In Monster Move Packet
+ STR(Animation ),// 0x00200000, // Animationid (0...3), Uint32 Time, Not Compartible With Trajectory And Fall Movement
+ STR(Unknown4 ),// 0x00400000, // Disables Movement By Path
+ STR(Unknown5 ),// 0x00800000,
+ STR(Unknown6 ),// 0x01000000,
+ STR(Unknown7 ),// 0x02000000,
+ STR(Unknown8 ),// 0x04000000,
+ STR(OrientationInversed ),// 0x08000000, // Appears With Runmode Flag, Nodes ),// 1, Handles Orientation
+ STR(Unknown10 ),// 0x10000000,
+ STR(Unknown11 ),// 0x20000000,
+ STR(Unknown12 ),// 0x40000000,
+ STR(Unknown13 ),// 0x80000000,
+ };
+
+ template<class Flags, int N>
+ void print_flags(Flags t, const char* (&names)[N], std::string& str)
+ {
+ for (int i = 0; i < N; ++i)
+ {
+ if ((t & (Flags)(1 << i)) && names[i] != NULL)
+ str.append(" ").append(names[i]);
+ }
+ }
+
+ std::string MoveSplineFlag::ToString() const
+ {
+ std::string str;
+ print_flags(raw(),g_SplineFlag_names,str);
+ return str;
+ }
+}
diff --git a/src/server/game/Movement/Spline/Spline.cpp b/src/server/game/Movement/Spline/Spline.cpp
new file mode 100644
index 00000000000..14c1bd0c117
--- /dev/null
+++ b/src/server/game/Movement/Spline/Spline.cpp
@@ -0,0 +1,307 @@
+/*
+ * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "Spline.h"
+#include <sstream>
+#include <G3D/Matrix4.h>
+
+namespace Movement{
+
+SplineBase::EvaluationMethtod SplineBase::evaluators[SplineBase::ModesEnd] =
+{
+ &SplineBase::EvaluateLinear,
+ &SplineBase::EvaluateCatmullRom,
+ &SplineBase::EvaluateBezier3,
+ (EvaluationMethtod)&SplineBase::UninitializedSpline,
+};
+
+SplineBase::EvaluationMethtod SplineBase::derivative_evaluators[SplineBase::ModesEnd] =
+{
+ &SplineBase::EvaluateDerivativeLinear,
+ &SplineBase::EvaluateDerivativeCatmullRom,
+ &SplineBase::EvaluateDerivativeBezier3,
+ (EvaluationMethtod)&SplineBase::UninitializedSpline,
+};
+
+SplineBase::SegLenghtMethtod SplineBase::seglengths[SplineBase::ModesEnd] =
+{
+ &SplineBase::SegLengthLinear,
+ &SplineBase::SegLengthCatmullRom,
+ &SplineBase::SegLengthBezier3,
+ (SegLenghtMethtod)&SplineBase::UninitializedSpline,
+};
+
+SplineBase::InitMethtod SplineBase::initializers[SplineBase::ModesEnd] =
+{
+ //&SplineBase::InitLinear,
+ &SplineBase::InitCatmullRom, // we should use catmullrom initializer even for linear mode! (client's internal structure limitation)
+ &SplineBase::InitCatmullRom,
+ &SplineBase::InitBezier3,
+ (InitMethtod)&SplineBase::UninitializedSpline,
+};
+
+///////////
+#pragma region evaluation methtods
+
+using G3D::Matrix4;
+static const Matrix4 s_catmullRomCoeffs(
+ -0.5f, 1.5f,-1.5f, 0.5f,
+ 1.f, -2.5f, 2.f, -0.5f,
+ -0.5f, 0.f, 0.5f, 0.f,
+ 0.f, 1.f, 0.f, 0.f);
+
+static const Matrix4 s_Bezier3Coeffs(
+ -1.f, 3.f, -3.f, 1.f,
+ 3.f, -6.f, 3.f, 0.f,
+ -3.f, 3.f, 0.f, 0.f,
+ 1.f, 0.f, 0.f, 0.f);
+
+/* classic view:
+inline void C_Evaluate(const Vector3 *vertice, float t, const float (&matrix)[4][4], Vector3 &position)
+{
+ Vector3 tvec(t*t*t, t*t, t);
+ int i = 0;
+ double c;
+ double x = 0, y = 0, z = 0;
+ while ( i < 4 )
+ {
+ c = matrix[0][i]*tvec.x + matrix[1][i]*tvec.y + matrix[2][i]*tvec.z + matrix[3][i];
+
+ x += c * vertice->x;
+ y += c * vertice->y;
+ z += c * vertice->z;
+
+ ++i;
+ ++vertice;
+ }
+
+ position.x = x;
+ position.y = y;
+ position.z = z;
+}*/
+
+inline void C_Evaluate(const Vector3 *vertice, float t, const Matrix4& matr, Vector3 &result)
+{
+ Vector4 tvec(t*t*t, t*t, t, 1.f);
+ Vector4 weights(tvec * matr);
+
+ result = vertice[0] * weights[0] + vertice[1] * weights[1]
+ + vertice[2] * weights[2] + vertice[3] * weights[3];
+}
+
+inline void C_Evaluate_Derivative(const Vector3 *vertice, float t, const Matrix4& matr, Vector3 &result)
+{
+ Vector4 tvec(3.f*t*t, 2.f*t, 1.f, 0.f);
+ Vector4 weights(tvec * matr);
+
+ result = vertice[0] * weights[0] + vertice[1] * weights[1]
+ + vertice[2] * weights[2] + vertice[3] * weights[3];
+}
+
+void SplineBase::EvaluateLinear(index_type index, float u, Vector3& result) const
+{
+ ASSERT(index >= index_lo && index < index_hi);
+ result = points[index] + (points[index+1] - points[index]) * u;
+}
+
+void SplineBase::EvaluateCatmullRom( index_type index, float t, Vector3& result) const
+{
+ ASSERT(index >= index_lo && index < index_hi);
+ C_Evaluate(&points[index - 1], t, s_catmullRomCoeffs, result);
+}
+
+void SplineBase::EvaluateBezier3(index_type index, float t, Vector3& result) const
+{
+ index *= 3u;
+ ASSERT(index >= index_lo && index < index_hi);
+ C_Evaluate(&points[index], t, s_Bezier3Coeffs, result);
+}
+
+void SplineBase::EvaluateDerivativeLinear(index_type index, float, Vector3& result) const
+{
+ ASSERT(index >= index_lo && index < index_hi);
+ result = points[index+1] - points[index];
+}
+
+void SplineBase::EvaluateDerivativeCatmullRom(index_type index, float t, Vector3& result) const
+{
+ ASSERT(index >= index_lo && index < index_hi);
+ C_Evaluate_Derivative(&points[index - 1], t, s_catmullRomCoeffs, result);
+}
+
+void SplineBase::EvaluateDerivativeBezier3(index_type index, float t, Vector3& result) const
+{
+ index *= 3u;
+ ASSERT(index >= index_lo && index < index_hi);
+ C_Evaluate_Derivative(&points[index], t, s_Bezier3Coeffs, result);
+}
+
+float SplineBase::SegLengthLinear(index_type index) const
+{
+ ASSERT(index >= index_lo && index < index_hi);
+ return (points[index] - points[index+1]).length();
+}
+
+float SplineBase::SegLengthCatmullRom( index_type index ) const
+{
+ ASSERT(index >= index_lo && index < index_hi);
+
+ Vector3 curPos, nextPos;
+ const Vector3 * p = &points[index - 1];
+ curPos = nextPos = p[1];
+
+ index_type i = 1;
+ double length = 0;
+ while (i <= STEPS_PER_SEGMENT)
+ {
+ C_Evaluate(p, float(i) / float(STEPS_PER_SEGMENT), s_catmullRomCoeffs, nextPos);
+ length += (nextPos - curPos).length();
+ curPos = nextPos;
+ ++i;
+ }
+ return length;
+}
+
+float SplineBase::SegLengthBezier3(index_type index) const
+{
+ index *= 3u;
+ ASSERT(index >= index_lo && index < index_hi);
+
+ Vector3 curPos, nextPos;
+ const Vector3 * p = &points[index];
+
+ C_Evaluate(p, 0.f, s_Bezier3Coeffs, nextPos);
+ curPos = nextPos;
+
+ index_type i = 1;
+ double length = 0;
+ while (i <= STEPS_PER_SEGMENT)
+ {
+ C_Evaluate(p, float(i) / float(STEPS_PER_SEGMENT), s_Bezier3Coeffs, nextPos);
+ length += (nextPos - curPos).length();
+ curPos = nextPos;
+ ++i;
+ }
+ return length;
+}
+#pragma endregion
+
+void SplineBase::init_spline(const Vector3 * controls, index_type count, EvaluationMode m)
+{
+ m_mode = m;
+ cyclic = false;
+
+ (this->*initializers[m_mode])(controls, count, cyclic, 0);
+}
+
+void SplineBase::init_cyclic_spline(const Vector3 * controls, index_type count, EvaluationMode m, index_type cyclic_point)
+{
+ m_mode = m;
+ cyclic = true;
+
+ (this->*initializers[m_mode])(controls, count, cyclic, cyclic_point);
+}
+
+void SplineBase::InitLinear(const Vector3* controls, index_type count, bool cyclic, index_type cyclic_point)
+{
+ ASSERT(count >= 2);
+ const int real_size = count + 1;
+
+ points.resize(real_size);
+
+ memcpy(&points[0],controls, sizeof(Vector3) * count);
+
+ // first and last two indexes are space for special 'virtual points'
+ // these points are required for proper C_Evaluate and C_Evaluate_Derivative methtod work
+ if (cyclic)
+ points[count] = controls[cyclic_point];
+ else
+ points[count] = controls[count-1];
+
+ index_lo = 0;
+ index_hi = cyclic ? count : (count - 1);
+}
+
+void SplineBase::InitCatmullRom(const Vector3* controls, index_type count, bool cyclic, index_type cyclic_point)
+{
+ const int real_size = count + (cyclic ? (1+2) : (1+1));
+
+ points.resize(real_size);
+
+ int lo_index = 1;
+ int high_index = lo_index + count - 1;
+
+ memcpy(&points[lo_index],controls, sizeof(Vector3) * count);
+
+ // first and last two indexes are space for special 'virtual points'
+ // these points are required for proper C_Evaluate and C_Evaluate_Derivative methtod work
+ if (cyclic)
+ {
+ if (cyclic_point == 0)
+ points[0] = controls[count-1];
+ else
+ points[0] = controls[0].lerp(controls[1], -1);
+
+ points[high_index+1] = controls[cyclic_point];
+ points[high_index+2] = controls[cyclic_point+1];
+ }
+ else
+ {
+ points[0] = controls[0].lerp(controls[1], -1);
+ points[high_index+1] = controls[count-1];
+ }
+
+ index_lo = lo_index;
+ index_hi = high_index + (cyclic ? 1 : 0);
+}
+
+void SplineBase::InitBezier3(const Vector3* controls, index_type count, bool /*cyclic*/, index_type /*cyclic_point*/)
+{
+ index_type c = count / 3u * 3u;
+ index_type t = c / 3u;
+
+ points.resize(c);
+ memcpy(&points[0],controls, sizeof(Vector3) * c);
+
+ index_lo = 0;
+ index_hi = t-1;
+ //mov_assert(points.size() % 3 == 0);
+}
+
+void SplineBase::clear()
+{
+ index_lo = 0;
+ index_hi = 0;
+ points.clear();
+}
+
+std::string SplineBase::ToString() const
+{
+ std::stringstream str;
+ const char * mode_str[ModesEnd] = {"Linear", "CatmullRom", "Bezier3", "Uninitialized"};
+
+ index_type count = this->points.size();
+ str << "mode: " << mode_str[mode()] << std::endl;
+ str << "points count: " << count << std::endl;
+ for (index_type i = 0; i < count; ++i)
+ str << "point " << i << " : " << points[i].toString() << std::endl;
+
+ return str.str();
+}
+
+}
diff --git a/src/server/game/Movement/Spline/Spline.h b/src/server/game/Movement/Spline/Spline.h
new file mode 100644
index 00000000000..28876b220d4
--- /dev/null
+++ b/src/server/game/Movement/Spline/Spline.h
@@ -0,0 +1,212 @@
+/*
+ * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef TRINITYSERVER_SPLINE_H
+#define TRINITYSERVER_SPLINE_H
+
+#include "MovementTypedefs.h"
+#include <G3D/Vector3.h>
+
+namespace Movement {
+
+class SplineBase
+{
+public:
+ typedef int index_type;
+ typedef std::vector<Vector3> ControlArray;
+
+ enum EvaluationMode
+ {
+ ModeLinear,
+ ModeCatmullrom,
+ ModeBezier3_Unused,
+ UninitializedMode,
+ ModesEnd
+ };
+
+ #pragma region fields
+protected:
+ ControlArray points;
+
+ index_type index_lo;
+ index_type index_hi;
+
+ uint8 m_mode;
+ bool cyclic;
+
+ enum{
+ // could be modified, affects segment length evaluation precision
+ // lesser value saves more performance in cost of lover precision
+ // minimal value is 1
+ // client's value is 20, blizzs use 2-3 steps to compute length
+ STEPS_PER_SEGMENT = 3,
+ };
+ static_assert(STEPS_PER_SEGMENT > 0, "shouldn't be lesser than 1");
+
+protected:
+ void EvaluateLinear(index_type, float, Vector3&) const;
+ void EvaluateCatmullRom(index_type, float, Vector3&) const;
+ void EvaluateBezier3(index_type, float, Vector3&) const;
+ typedef void (SplineBase::*EvaluationMethtod)(index_type,float,Vector3&) const;
+ static EvaluationMethtod evaluators[ModesEnd];
+
+ void EvaluateDerivativeLinear(index_type, float, Vector3&) const;
+ void EvaluateDerivativeCatmullRom(index_type, float, Vector3&) const;
+ void EvaluateDerivativeBezier3(index_type, float, Vector3&) const;
+ static EvaluationMethtod derivative_evaluators[ModesEnd];
+
+ float SegLengthLinear(index_type) const;
+ float SegLengthCatmullRom(index_type) const;
+ float SegLengthBezier3(index_type) const;
+ typedef float (SplineBase::*SegLenghtMethtod)(index_type) const;
+ static SegLenghtMethtod seglengths[ModesEnd];
+
+ void InitLinear(const Vector3*, index_type, bool, index_type);
+ void InitCatmullRom(const Vector3*, index_type, bool, index_type);
+ void InitBezier3(const Vector3*, index_type, bool, index_type);
+ typedef void (SplineBase::*InitMethtod)(const Vector3*, index_type, bool, index_type);
+ static InitMethtod initializers[ModesEnd];
+
+ void UninitializedSpline() const { ASSERT(false);}
+
+ #pragma endregion
+public:
+
+ explicit SplineBase() : m_mode(UninitializedMode), index_lo(0), index_hi(0), cyclic(false) {}
+
+ /** Caclulates the position for given segment Idx, and percent of segment length t
+ @param t - percent of segment length, assumes that t in range [0, 1]
+ @param Idx - spline segment index, should be in range [first, last)
+ */
+ void evaluate_percent(index_type Idx, float u, Vector3& c) const {(this->*evaluators[m_mode])(Idx,u,c);}
+
+ /** Caclulates derivation in index Idx, and percent of segment length t
+ @param Idx - spline segment index, should be in range [first, last)
+ @param t - percent of spline segment length, assumes that t in range [0, 1]
+ */
+ void evaluate_derivative(index_type Idx, float u, Vector3& hermite) const {(this->*derivative_evaluators[m_mode])(Idx,u,hermite);}
+
+ /** Bounds for spline indexes. All indexes should be in range [first, last). */
+ index_type first() const { return index_lo;}
+ index_type last() const { return index_hi;}
+
+ bool empty() const { return index_lo == index_hi;}
+ EvaluationMode mode() const { return (EvaluationMode)m_mode;}
+ bool isCyclic() const { return cyclic;}
+
+ const ControlArray& getPoints() const { return points;}
+ index_type getPointCount() const { return points.size();}
+ const Vector3& getPoint(index_type i) const { return points[i];}
+
+ /** Initializes spline. Don't call other methods while spline not initialized. */
+ void init_spline(const Vector3 * controls, index_type count, EvaluationMode m);
+ void init_cyclic_spline(const Vector3 * controls, index_type count, EvaluationMode m, index_type cyclic_point);
+
+ /** 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)
+ {
+ initializer(m_mode,cyclic,points,index_lo,index_hi);
+ }
+
+ void clear();
+
+ /** Calculates distance between [i; i+1] points, assumes that index i is in bounds. */
+ float SegLength(index_type i) const { return (this->*seglengths[m_mode])(i);}
+
+ std::string ToString() const;
+};
+
+template<typename length_type>
+class Spline : public SplineBase
+{
+public:
+ typedef length_type LengthType;
+ typedef std::vector<length_type> LengthArray;
+ #pragma region fields
+protected:
+
+ LengthArray lengths;
+
+ index_type computeIndexInBounds(length_type length) const;
+ #pragma endregion
+public:
+
+ explicit Spline(){}
+
+ /** Calculates the position for given t
+ @param t - percent of spline's length, assumes that t in range [0, 1]. */
+ void evaluate_percent(float t, Vector3 & c) const;
+
+ /** Calculates derivation for given t
+ @param t - percent of spline's length, assumes that t in range [0, 1]. */
+ void evaluate_derivative(float t, Vector3& hermite) const;
+
+ /** Calculates the position for given segment Idx, and percent of segment length t
+ @param t = partial_segment_length / whole_segment_length
+ @param Idx - spline segment index, should be in range [first, last). */
+ void evaluate_percent(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_percent(Idx,u,c);}
+
+ /** Caclulates derivation for index Idx, and percent of segment length t
+ @param Idx - spline segment index, should be in range [first, last)
+ @param t - percent of spline segment length, assumes that t in range [0, 1]. */
+ void evaluate_derivative(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_derivative(Idx,u,c);}
+
+ // Assumes that t in range [0, 1]
+ index_type computeIndexInBounds(float t) const;
+ void computeIndex(float t, index_type& out_idx, float& out_u) const;
+
+ /** Initializes spline. Don't call other methods while spline not initialized. */
+ void init_spline(const Vector3 * controls, index_type count, EvaluationMode m) { SplineBase::init_spline(controls,count,m);}
+ void init_cyclic_spline(const Vector3 * controls, index_type count, EvaluationMode m, index_type cyclic_point) { SplineBase::init_cyclic_spline(controls,count,m,cyclic_point);}
+
+ /** Initializes lengths with SplineBase::SegLength method. */
+ void initLengths();
+
+ /** Initializes lengths in some custom way
+ Note that value returned by cacher must be greater or equal to previous value. */
+ template<class T> inline void initLengths(T& cacher)
+ {
+ index_type i = index_lo;
+ lengths.resize(index_hi+1);
+ length_type prev_length = 0, new_length = 0;
+ while(i < index_hi)
+ {
+ new_length = cacher(*this, i);
+ lengths[++i] = new_length;
+
+ ASSERT(prev_length <= new_length);
+ prev_length = new_length;
+ }
+ }
+
+ /** Returns length of the whole spline. */
+ length_type length() const { return lengths[index_hi];}
+ /** Returns length between given nodes. */
+ length_type length(index_type first, index_type last) const { return lengths[last]-lengths[first];}
+ length_type length(index_type Idx) const { return lengths[Idx];}
+
+ void set_length(index_type i, length_type length) { lengths[i] = length;}
+ void clear();
+};
+
+}
+
+#include "SplineImpl.h"
+
+#endif // TRINITYSERVER_SPLINE_H
diff --git a/src/server/game/Movement/Spline/SplineImpl.h b/src/server/game/Movement/Spline/SplineImpl.h
new file mode 100644
index 00000000000..eded2d8c903
--- /dev/null
+++ b/src/server/game/Movement/Spline/SplineImpl.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+namespace Movement
+{
+template<typename length_type> void Spline<length_type>::evaluate_percent( float t, Vector3 & c ) const
+{
+ index_type Index;
+ float u;
+ computeIndex(t, Index, u);
+ evaluate_percent(Index, u, c);
+}
+
+template<typename length_type> void Spline<length_type>::evaluate_derivative(float t, Vector3& hermite) const
+{
+ index_type Index;
+ float u;
+ computeIndex(t, Index, u);
+ evaluate_derivative(Index, u, hermite);
+}
+
+template<typename length_type> SplineBase::index_type Spline<length_type>::computeIndexInBounds(length_type length_) const
+{
+// Temporary disabled: causes infinite loop with t = 1.f
+/*
+ index_type hi = index_hi;
+ index_type lo = index_lo;
+
+ index_type i = lo + (float)(hi - lo) * t;
+
+ while ((lengths[i] > length) || (lengths[i + 1] <= length))
+ {
+ if (lengths[i] > length)
+ hi = i - 1; // too big
+ else if (lengths[i + 1] <= length)
+ lo = i + 1; // too small
+
+ i = (hi + lo) / 2;
+ }*/
+
+ index_type i = index_lo;
+ index_type N = index_hi;
+ while (i+1 < N && lengths[i+1] < length_)
+ ++i;
+
+ return i;
+}
+
+template<typename length_type> void Spline<length_type>::computeIndex(float t, index_type& index, float& u) const
+{
+ ASSERT(t >= 0.f && t <= 1.f);
+ length_type length_ = t * length();
+ index = computeIndexInBounds(length_);
+ ASSERT(index < index_hi);
+ u = (length_ - length(index)) / (float)length(index, index+1);
+}
+
+template<typename length_type> SplineBase::index_type Spline<length_type>::computeIndexInBounds( float t ) const
+{
+ ASSERT(t >= 0.f && t <= 1.f);
+ return computeIndexInBounds(t * length());
+}
+
+template<typename length_type> void Spline<length_type>::initLengths()
+{
+ index_type i = index_lo;
+ length_type length = 0;
+ lengths.resize(index_hi+1);
+ while(i < index_hi )
+ {
+ length += SegLength(i);
+ lengths[++i] = length;
+ }
+}
+
+template<typename length_type> void Spline<length_type>::clear()
+{
+ SplineBase::clear();
+ lengths.clear();
+}
+
+}
diff --git a/src/server/game/Movement/Traveller.h b/src/server/game/Movement/Traveller.h
deleted file mode 100755
index 9cd6a6cda17..00000000000
--- a/src/server/game/Movement/Traveller.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program 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/>.
- */
-
-#ifndef TRINITY_TRAVELLER_H
-#define TRINITY_TRAVELLER_H
-
-#include "Creature.h"
-#include "Player.h"
-#include <cassert>
-
-/** Traveller is a wrapper for units (creatures or players) that
- * travel from point A to point B using the destination holder.
- */
-#define PLAYER_FLIGHT_SPEED 32.0f
-
-template<class T>
-struct Traveller
-{
- T &i_traveller;
- Traveller(T &t) : i_traveller(t) {}
- Traveller(const Traveller &obj) : i_traveller(obj) {}
- Traveller& operator=(const Traveller &obj)
- {
- this.i_traveller = obj.i_traveller;
- return *this;
- }
-
- operator T&(void) { return i_traveller; }
- operator const T&(void) { return i_traveller; }
- float GetPositionX() const { return i_traveller.GetPositionX(); }
- float GetPositionY() const { return i_traveller.GetPositionY(); }
- float GetPositionZ() const { return i_traveller.GetPositionZ(); }
- T& GetTraveller(void) { return i_traveller; }
-
- float Speed(void) { ASSERT(false); return 0.0f; }
- float GetMoveDestinationTo(float x, float y, float z);
- uint32 GetTotalTrevelTimeTo(float x, float y, float z);
-
- void Relocation(float x, float y, float z, float orientation) {}
- void Relocation(float x, float y, float z) { Relocation(x, y, z, i_traveller.GetOrientation()); }
- void MoveTo(float x, float y, float z, uint32 t) {}
-};
-
-template<class T>
-inline uint32 Traveller<T>::GetTotalTrevelTimeTo(float x, float y, float z)
-{
- float dist = GetMoveDestinationTo(x, y, z);
- float speed = Speed();
- if (speed < 0.0f)
- return 0xfffffffe; // almost infinity-unit should stop
- else
- speed *= 0.001f; // speed is in seconds so convert from second to millisecond
- return static_cast<uint32>(dist/speed);
-}
-
-// specialization for creatures
-template<>
-inline float Traveller<Creature>::Speed()
-{
- if (i_traveller.HasUnitState(UNIT_STAT_CHARGING))
- return i_traveller.m_TempSpeed;
- else if (i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
- return i_traveller.GetSpeed(MOVE_WALK);
- else if (i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_FLYING))
- return i_traveller.GetSpeed(MOVE_FLIGHT);
- else
- return i_traveller.GetSpeed(MOVE_RUN);
-}
-
-template<>
-inline void Traveller<Creature>::Relocation(float x, float y, float z, float orientation)
-{
- i_traveller.UpdatePosition(x, y, z, orientation);
-}
-
-template<>
-inline float Traveller<Creature>::GetMoveDestinationTo(float x, float y, float z)
-{
- float dx = x - GetPositionX();
- float dy = y - GetPositionY();
- float dz = z - GetPositionZ();
-
- //if (i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_FLYING))
- return sqrt((dx*dx) + (dy*dy) + (dz*dz));
- //else //Walking on the ground
- // return sqrt((dx*dx) + (dy*dy));
-}
-
-template<>
-inline void Traveller<Creature>::MoveTo(float x, float y, float z, uint32 t)
-{
- //i_traveller.AI_SendMoveToPacket(x, y, z, t, i_traveller.GetUnitMovementFlags(), 0);
- i_traveller.SendMonsterMove(x, y, z, t);
-}
-
-// specialization for players
-template<>
-inline float Traveller<Player>::Speed()
-{
- if (i_traveller.HasUnitState(UNIT_STAT_CHARGING))
- return i_traveller.m_TempSpeed;
- else if (i_traveller.isInFlight())
- return PLAYER_FLIGHT_SPEED;
- else
- return i_traveller.GetSpeed(i_traveller.m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING) ? MOVE_WALK : MOVE_RUN);
-}
-
-template<>
-inline float Traveller<Player>::GetMoveDestinationTo(float x, float y, float z)
-{
- float dx = x - GetPositionX();
- float dy = y - GetPositionY();
- float dz = z - GetPositionZ();
-
- //if (i_traveller.isInFlight())
- return sqrt((dx*dx) + (dy*dy) + (dz*dz));
- //else //Walking on the ground
- // return sqrt((dx*dx) + (dy*dy));
-}
-
-template<>
-inline void Traveller<Player>::Relocation(float x, float y, float z, float orientation)
-{
- i_traveller.UpdatePosition(x, y, z, orientation);
-}
-
-template<>
-inline void Traveller<Player>::MoveTo(float x, float y, float z, uint32 t)
-{
- //Only send MOVEMENTFLAG_WALKING, client has strange issues with other move flags
- i_traveller.SendMonsterMove(x, y, z, t);
-}
-
-typedef Traveller<Creature> CreatureTraveller;
-typedef Traveller<Player> PlayerTraveller;
-#endif
-
diff --git a/src/server/game/Movement/Waypoints/Path.h b/src/server/game/Movement/Waypoints/Path.h
index f9a55513d10..b6ddaa9d726 100755
--- a/src/server/game/Movement/Waypoints/Path.h
+++ b/src/server/game/Movement/Waypoints/Path.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 2859fb9227b..b957674151b 100755
--- a/src/server/game/Movement/Waypoints/WaypointManager.cpp
+++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 be4a0c8f9bf..73d611e0419 100755
--- a/src/server/game/Movement/Waypoints/WaypointManager.h
+++ b/src/server/game/Movement/Waypoints/WaypointManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 d641971faa0..9f6ec547342 100755
--- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp
+++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/OutdoorPvP.h b/src/server/game/OutdoorPvP/OutdoorPvP.h
index c57eddc7f86..6ea13d353c5 100755
--- a/src/server/game/OutdoorPvP/OutdoorPvP.h
+++ b/src/server/game/OutdoorPvP/OutdoorPvP.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 4a0da1d3b55..88e6db971f0 100755
--- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
+++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 32639cb692e..3a66a87ecba 100755
--- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h
+++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 96bb4a211eb..05ce7a0a50d 100755
--- a/src/server/game/Pools/PoolMgr.cpp
+++ b/src/server/game/Pools/PoolMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -807,7 +807,7 @@ void PoolMgr::LoadFromDB()
{
uint32 oldMSTime = getMSTime();
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_LOAD_QUEST_POOLS);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_QUEST_POOLS);
PreparedQueryResult result = WorldDatabase.Query(stmt);
if (!result)
@@ -964,7 +964,7 @@ void PoolMgr::SaveQuestsToDB()
{
if (IsSpawnedObject<Quest>(itr->first))
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_QUEST_POOL_SAVE);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_QUEST_POOL_SAVE);
stmt->setUInt32(0, itr->second);
stmt->setUInt32(1, itr->first);
trans->Append(stmt);
diff --git a/src/server/game/Pools/PoolMgr.h b/src/server/game/Pools/PoolMgr.h
index 055763480e3..be839bf1566 100755
--- a/src/server/game/Pools/PoolMgr.h
+++ b/src/server/game/Pools/PoolMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 feb1c071b6d..0467eaa3253 100755
--- a/src/server/game/Quests/QuestDef.cpp
+++ b/src/server/game/Quests/QuestDef.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,7 +77,7 @@ Quest::Quest(Field* questRecord)
for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
RewardChoiceItemCount[i] = questRecord[57+i].GetUInt32();
-
+
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
RewardFactionId[i] = questRecord[63+i].GetUInt32();
@@ -86,7 +86,7 @@ Quest::Quest(Field* questRecord)
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
RewardFactionValueIdOverride[i] = questRecord[73+i].GetInt32();
-
+
PointMapId = questRecord[78].GetUInt32();
PointX = questRecord[79].GetFloat();
PointY = questRecord[80].GetFloat();
@@ -202,7 +202,7 @@ uint32 Quest::XPValue(Player* player) const
return 0;
}
-int32 Quest::GetRewOrReqMoney() const
+int32 Quest::GetRewOrReqMoney() const
{
if (RewardOrRequiredMoney <= 0)
return RewardOrRequiredMoney;
diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h
index 989c63d2a64..973735b84da 100755
--- a/src/server/game/Quests/QuestDef.h
+++ b/src/server/game/Quests/QuestDef.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -251,6 +251,7 @@ class Quest
uint32 GetFlags() const { return Flags; }
bool IsDaily() const { return Flags & QUEST_FLAGS_DAILY; }
bool IsWeekly() const { return Flags & QUEST_FLAGS_WEEKLY; }
+ bool IsSeasonal() const { return (ZoneOrSort == -QUEST_SORT_SEASONAL || ZoneOrSort == -QUEST_SORT_SPECIAL || ZoneOrSort == -QUEST_SORT_LUNAR_FESTIVAL || ZoneOrSort == -QUEST_SORT_MIDSUMMER || ZoneOrSort == -QUEST_SORT_BREWFEST || ZoneOrSort == -QUEST_SORT_LOVE_IS_IN_THE_AIR || ZoneOrSort == -QUEST_SORT_NOBLEGARDEN); }
bool IsDailyOrWeekly() const { return Flags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); }
bool IsAutoAccept() const { return Flags & QUEST_FLAGS_AUTO_ACCEPT; }
bool IsRaidQuest() const { return Type == QUEST_TYPE_RAID || Type == QUEST_TYPE_RAID_10 || Type == QUEST_TYPE_RAID_25; }
diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp
index c4c8dec5500..d988959f890 100755
--- a/src/server/game/Reputation/ReputationMgr.cpp
+++ b/src/server/game/Reputation/ReputationMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 59ec826f0c5..b73574d288f 100755
--- a/src/server/game/Reputation/ReputationMgr.h
+++ b/src/server/game/Reputation/ReputationMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 4236ef49212..7757e1a1a35 100755
--- a/src/server/game/Scripting/MapScripts.cpp
+++ b/src/server/game/Scripting/MapScripts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -475,8 +475,14 @@ void Map::ScriptsProcess()
// Source or target must be Creature.
if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
{
- cSource->SendMonsterMoveWithSpeed(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ, step.script->MoveTo.TravelTime);
- cSource->GetMap()->CreatureRelocation(cSource, step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ, 0);
+ Unit * unit = (Unit*)cSource;
+ if (step.script->MoveTo.TravelTime != 0)
+ {
+ float speed = unit->GetDistance(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ) / ((float)step.script->MoveTo.TravelTime * 0.001f);
+ unit->MonsterMoveWithSpeed(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ, speed);
+ }
+ else
+ unit->NearTeleportTo(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ, unit->GetOrientation());
}
break;
diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp
index 26d703458ac..cdec6bb3ffa 100755
--- a/src/server/game/Scripting/ScriptLoader.cpp
+++ b/src/server/game/Scripting/ScriptLoader.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,6 +39,7 @@ void AddSC_warrior_spell_scripts();
void AddSC_quest_spell_scripts();
void AddSC_item_spell_scripts();
void AddSC_example_spell_scripts();
+void AddSC_holiday_spell_scripts();
void AddSC_SmartSCripts();
@@ -570,6 +571,7 @@ void AddSC_the_eye();
void AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar
void AddSC_boss_nethermancer_sepethrea();
void AddSC_boss_pathaleon_the_calculator();
+void AddSC_boss_mechano_lord_capacitus();
void AddSC_instance_mechanar();
void AddSC_blades_edge_mountains();
@@ -641,6 +643,7 @@ void AddSpellScripts()
AddSC_quest_spell_scripts();
AddSC_item_spell_scripts();
AddSC_example_spell_scripts();
+ AddSC_holiday_spell_scripts();
}
void AddCommandScripts()
@@ -1030,6 +1033,7 @@ void AddOutlandScripts()
AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar
AddSC_boss_nethermancer_sepethrea();
AddSC_boss_pathaleon_the_calculator();
+ AddSC_boss_mechano_lord_capacitus();
AddSC_instance_mechanar();
AddSC_blades_edge_mountains();
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index 925b352e616..d5e8f71e1fd 100755
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index b3ba7f0a89c..60052bea0ea 100755
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp
index d0f9a0380b0..56d3109a6a0 100755
--- a/src/server/game/Scripting/ScriptSystem.cpp
+++ b/src/server/game/Scripting/ScriptSystem.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 311a94d4217..3ea2d6b690d 100755
--- a/src/server/game/Server/Protocol/Opcodes.cpp
+++ b/src/server/game/Server/Protocol/Opcodes.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.h b/src/server/game/Server/Protocol/Opcodes.h
index ef51d1be918..81a37ece4f9 100755
--- a/src/server/game/Server/Protocol/Opcodes.h
+++ b/src/server/game/Server/Protocol/Opcodes.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/WorldLog.cpp b/src/server/game/Server/Protocol/WorldLog.cpp
index 334c189af81..5b1a3af996f 100755
--- a/src/server/game/Server/Protocol/WorldLog.cpp
+++ b/src/server/game/Server/Protocol/WorldLog.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/WorldLog.h b/src/server/game/Server/Protocol/WorldLog.h
index a951cba4ab5..fb344f195de 100755
--- a/src/server/game/Server/Protocol/WorldLog.h
+++ b/src/server/game/Server/Protocol/WorldLog.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp
index 3288224e1f2..6bd09f2b3a7 100755
--- a/src/server/game/Server/WorldSession.cpp
+++ b/src/server/game/Server/WorldSession.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -94,14 +94,14 @@ m_playerRecentlyLogout(false), m_playerSave(false),
m_sessionDbcLocale(sWorld->GetAvailableDbcLocale(locale)),
m_sessionDbLocaleIndex(locale),
m_latency(0), m_TutorialsChanged(false), recruiterId(recruiter),
-isRecruiter(isARecruiter)
+isRecruiter(isARecruiter), timeLastWhoCommand(0)
{
if (sock)
{
m_Address = sock->GetRemoteAddress();
sock->AddReference();
ResetTimeOutTime();
- LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = %u;", GetAccountId());
+ LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = %u;", GetAccountId()); // One-time query
}
InitializeQueryCallbackParameters();
@@ -127,7 +127,7 @@ WorldSession::~WorldSession()
while (_recvQueue.next(packet))
delete packet;
- LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId());
+ LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); // One-time query
}
void WorldSession::SizeError(WorldPacket const &packet, uint32 size) const
@@ -632,7 +632,7 @@ void WorldSession::SendAuthWaitQue(uint32 position)
void WorldSession::LoadGlobalAccountData()
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_ACCOUNT_DATA);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_DATA);
stmt->setUInt32(0, GetAccountId());
LoadAccountData(CharacterDatabase.Query(stmt), GLOBAL_CACHE_MASK);
}
@@ -675,7 +675,7 @@ void WorldSession::SetAccountData(AccountDataType type, time_t tm, std::string d
if ((1 << type) & GLOBAL_CACHE_MASK)
{
id = GetAccountId();
- index = CHAR_SET_ACCOUNT_DATA;
+ index = CHAR_REP_ACCOUNT_DATA;
}
else
{
@@ -684,7 +684,7 @@ void WorldSession::SetAccountData(AccountDataType type, time_t tm, std::string d
return;
id = m_GUIDLow;
- index = CHAR_SET_PLAYER_ACCOUNT_DATA;
+ index = CHAR_REP_PLAYER_ACCOUNT_DATA;
}
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(index);
@@ -714,7 +714,7 @@ void WorldSession::LoadTutorialsData()
{
memset(m_Tutorials, 0, sizeof(uint32) * MAX_ACCOUNT_TUTORIAL_VALUES);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_TUTORIALS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_TUTORIALS);
stmt->setUInt32(0, GetAccountId());
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
@@ -736,11 +736,11 @@ void WorldSession::SaveTutorialsData(SQLTransaction &trans)
if (!m_TutorialsChanged)
return;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_HAS_TUTORIALS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_HAS_TUTORIALS);
stmt->setUInt32(0, GetAccountId());
bool hasTutorials = !CharacterDatabase.Query(stmt).null();
// Modify data in DB
- stmt = CharacterDatabase.GetPreparedStatement(hasTutorials ? CHAR_SET_TUTORIALS : CHAR_ADD_TUTORIALS);
+ stmt = CharacterDatabase.GetPreparedStatement(hasTutorials ? CHAR_UPD_TUTORIALS : CHAR_INS_TUTORIALS);
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
stmt->setUInt32(i, m_Tutorials[i]);
stmt->setUInt32(MAX_ACCOUNT_TUTORIAL_VALUES, GetAccountId());
diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h
index ebed71c7da3..951f205c1e2 100755
--- a/src/server/game/Server/WorldSession.h
+++ b/src/server/game/Server/WorldSession.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -949,6 +949,7 @@ class WorldSession
uint32 recruiterId;
bool isRecruiter;
ACE_Based::LockedQueue<WorldPacket*, ACE_Thread_Mutex> _recvQueue;
+ time_t timeLastWhoCommand;
};
#endif
/// @}
diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp
index 58f62396ac9..ac6f11660e4 100755
--- a/src/server/game/Server/WorldSocket.cpp
+++ b/src/server/game/Server/WorldSocket.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -890,7 +890,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
{
mutetime = time(NULL) + llabs(mutetime);
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPDATE_MUTE_TIME);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
stmt->setInt64(0, mutetime);
stmt->setUInt32(1, id);
@@ -992,7 +992,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
// Update the last_ip in the database
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPDATE_LAST_IP);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LAST_IP);
stmt->setString(0, address);
stmt->setString(1, account);
diff --git a/src/server/game/Server/WorldSocket.h b/src/server/game/Server/WorldSocket.h
index aa7424085f8..3396803ff62 100755
--- a/src/server/game/Server/WorldSocket.h
+++ b/src/server/game/Server/WorldSocket.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 1d3155b9e06..a16c5c2189f 100644
--- a/src/server/game/Server/WorldSocketAcceptor.h
+++ b/src/server/game/Server/WorldSocketAcceptor.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 5fb66524976..00a8b263847 100755
--- a/src/server/game/Server/WorldSocketMgr.cpp
+++ b/src/server/game/Server/WorldSocketMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 25f92042f4e..fd7e28485cf 100755
--- a/src/server/game/Server/WorldSocketMgr.h
+++ b/src/server/game/Server/WorldSocketMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 1899d75b4cf..466d3ac83a2 100755
--- a/src/server/game/Skills/SkillDiscovery.cpp
+++ b/src/server/game/Skills/SkillDiscovery.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 ae4f3494534..110adb91cf2 100755
--- a/src/server/game/Skills/SkillDiscovery.h
+++ b/src/server/game/Skills/SkillDiscovery.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 600655c4a60..b5b6b5d7b96 100755
--- a/src/server/game/Skills/SkillExtraItems.cpp
+++ b/src/server/game/Skills/SkillExtraItems.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 2b453508c8c..c4e20b9fbef 100755
--- a/src/server/game/Skills/SkillExtraItems.h
+++ b/src/server/game/Skills/SkillExtraItems.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 7c0be84bf50..ddb230d6773 100755
--- a/src/server/game/Spells/Auras/SpellAuraDefines.h
+++ b/src/server/game/Spells/Auras/SpellAuraDefines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 12c40c15db4..1972b625a9f 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -2417,7 +2417,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo
target->VisitNearbyObject(target->GetMap()->GetVisibilityRange(), searcher);
for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter)
{
- if (!(*iter)->HasUnitState(UNIT_STAT_CASTING))
+ if (!(*iter)->HasUnitState(UNIT_STATE_CASTING))
continue;
for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++)
@@ -2448,7 +2448,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo
// blizz like 2.0.x
target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
- target->AddUnitState(UNIT_STAT_DIED);
+ target->AddUnitState(UNIT_STATE_DIED);
}
else
{
@@ -2465,7 +2465,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo
// blizz like 2.0.x
target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
- target->ClearUnitState(UNIT_STAT_DIED);
+ target->ClearUnitState(UNIT_STATE_DIED);
}
}
@@ -3031,7 +3031,7 @@ void AuraEffect::HandleModConfuse(AuraApplication const* aurApp, uint8 mode, boo
Unit* target = aurApp->GetTarget();
- target->SetControlled(apply, UNIT_STAT_CONFUSED);
+ target->SetControlled(apply, UNIT_STATE_CONFUSED);
}
void AuraEffect::HandleModFear(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -3041,7 +3041,7 @@ void AuraEffect::HandleModFear(AuraApplication const* aurApp, uint8 mode, bool a
Unit* target = aurApp->GetTarget();
- target->SetControlled(apply, UNIT_STAT_FLEEING);
+ target->SetControlled(apply, UNIT_STATE_FLEEING);
}
void AuraEffect::HandleAuraModStun(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -3051,7 +3051,7 @@ void AuraEffect::HandleAuraModStun(AuraApplication const* aurApp, uint8 mode, bo
Unit* target = aurApp->GetTarget();
- target->SetControlled(apply, UNIT_STAT_STUNNED);
+ target->SetControlled(apply, UNIT_STATE_STUNNED);
}
void AuraEffect::HandleAuraModRoot(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -3061,7 +3061,7 @@ void AuraEffect::HandleAuraModRoot(AuraApplication const* aurApp, uint8 mode, bo
Unit* target = aurApp->GetTarget();
- target->SetControlled(apply, UNIT_STAT_ROOT);
+ target->SetControlled(apply, UNIT_STATE_ROOT);
}
void AuraEffect::HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -3072,7 +3072,7 @@ void AuraEffect::HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode,
Unit* target = aurApp->GetTarget();
if (target->HasAuraType(SPELL_AURA_MOD_FEAR))
- target->SetControlled(!(apply), UNIT_STAT_FLEEING);
+ target->SetControlled(!(apply), UNIT_STATE_FLEEING);
}
/***************************/
@@ -3465,7 +3465,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint
if (GetSpellInfo()->Mechanic == MECHANIC_BANISH)
{
if (apply)
- target->AddUnitState(UNIT_STAT_ISOLATED);
+ target->AddUnitState(UNIT_STATE_ISOLATED);
else
{
bool banishFound = false;
@@ -3477,7 +3477,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint
break;
}
if (!banishFound)
- target->ClearUnitState(UNIT_STAT_ISOLATED);
+ target->ClearUnitState(UNIT_STATE_ISOLATED);
}
}
@@ -4751,11 +4751,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
break;
case 46361: // Reinforced Net
if (caster)
- {
- float currentGroundLevel = target->GetBaseMap()->GetHeight(target->GetPositionX(), target->GetPositionY(), MAX_HEIGHT);
- if (target->GetPositionZ() > currentGroundLevel)
- target->GetMotionMaster()->MoveFall(currentGroundLevel);
- }
+ target->GetMotionMaster()->MoveFall();
break;
case 46699: // Requires No Ammo
if (target->GetTypeId() == TYPEID_PLAYER)
@@ -4807,7 +4803,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (Aura* newAura = target->AddAura(71564, target))
newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount);
break;
- case 59628: // Tricks of the Trade
+ case 59628: // Tricks of the Trade
if (caster && caster->GetMisdirectionTarget())
target->SetReducedThreatPercent(100, caster->GetMisdirectionTarget()->GetGUID());
break;
@@ -4970,7 +4966,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
target->SetReducedThreatPercent(0,0);
else
target->SetReducedThreatPercent(0,caster->GetMisdirectionTarget()->GetGUID());
- break;
+ break;
}
default:
break;
@@ -6160,7 +6156,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
if (!caster || !target->isAlive())
return;
- if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
+ if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
{
SendTickImmune(target, caster);
return;
@@ -6301,7 +6297,7 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
if (!caster || !caster->isAlive() || !target->isAlive())
return;
- if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
+ if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
{
SendTickImmune(target, caster);
return;
@@ -6367,7 +6363,7 @@ void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster)
if (!caster || !caster->isAlive() || !target->isAlive())
return;
- if (target->HasUnitState(UNIT_STAT_ISOLATED))
+ if (target->HasUnitState(UNIT_STATE_ISOLATED))
{
SendTickImmune(target, caster);
return;
@@ -6395,7 +6391,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
if (!caster || !target->isAlive())
return;
- if (target->HasUnitState(UNIT_STAT_ISOLATED))
+ if (target->HasUnitState(UNIT_STATE_ISOLATED))
{
SendTickImmune(target, caster);
return;
@@ -6511,7 +6507,7 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
if (!caster || !caster->isAlive() || !target->isAlive() || target->getPowerType() != powerType)
return;
- if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
+ if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
{
SendTickImmune(target, caster);
return;
@@ -6611,7 +6607,7 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const
if (!target->isAlive() || !target->GetMaxPower(powerType))
return;
- if (target->HasUnitState(UNIT_STAT_ISOLATED))
+ if (target->HasUnitState(UNIT_STATE_ISOLATED))
{
SendTickImmune(target, caster);
return;
@@ -6642,7 +6638,7 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons
if (!target->isAlive() || !target->GetMaxPower(powerType))
return;
- if (target->HasUnitState(UNIT_STAT_ISOLATED))
+ if (target->HasUnitState(UNIT_STATE_ISOLATED))
{
SendTickImmune(target, caster);
return;
@@ -6674,7 +6670,7 @@ void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) con
if (!caster || !target->isAlive() || target->getPowerType() != powerType)
return;
- if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
+ if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
{
SendTickImmune(target, caster);
return;
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index 7f754253719..31dd3ad7471 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 91ecc328fd8..d49ac829ef9 100755
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -520,7 +520,13 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
bool addUnit = true;
// check target immunities
- if (itr->first->IsImmunedToSpell(GetSpellInfo())
+ for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
+ {
+ if (itr->first->IsImmunedToSpellEffect(GetSpellInfo(), effIndex))
+ itr->second &= ~(1 << effIndex);
+ }
+ if (!itr->second
+ || itr->first->IsImmunedToSpell(GetSpellInfo())
|| !CanBeAppliedOn(itr->first))
addUnit = false;
@@ -1567,6 +1573,16 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
break;
}
break;
+ case SPELLFAMILY_DRUID:
+ // Enrage
+ if ((GetSpellInfo()->SpellFamilyFlags[0] & 0x80000) && GetSpellInfo()->SpellIconID == 961)
+ {
+ if (target->HasAura(70726)) // Item - Druid T10 Feral 4P Bonus
+ if (apply)
+ target->CastSpell(target, 70725, true);
+ break;
+ }
+ break;
case SPELLFAMILY_ROGUE:
// Stealth
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00400000)
@@ -1845,7 +1861,7 @@ bool Aura::CanStackWith(Aura const* existingAura) const
case SPELL_AURA_OBS_MOD_HEALTH:
case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE:
// periodic auras which target areas are not allowed to stack this way (replenishment for example)
- if (m_spellInfo->Effects[i].IsArea() || existingSpellInfo->Effects[i].IsArea())
+ if (m_spellInfo->Effects[i].IsTargetingArea() || existingSpellInfo->Effects[i].IsTargetingArea())
break;
return true;
default:
@@ -1953,6 +1969,13 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI
if (!sSpellMgr->CanSpellTriggerProcOnEvent(*procEntry, eventInfo))
return false;
+ // TODO:
+ // - do checks using conditions table for eventInfo->GetActor() and eventInfo->GetActionTarget()
+ // - add DoCheckProc() AuraScript hook
+ // to allow additional requirements for procs
+ // this is needed because this is the last moment in which you can prevent aura charge drop on proc
+ // and possibly a way to prevent default checks (if there're going to be any)
+
// Check if current equipment meets aura requirements
// do that only for passive spells
// TODO: this needs to be unified for all kinds of auras
@@ -2013,11 +2036,14 @@ float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& event
void Aura::TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo)
{
- // TODO: script hooks here (allowing prevention of selected effects)
+ // TODO: OnProc hook here
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (aurApp->HasEffect(i))
+ // TODO: OnEffectProc hook here (allowing prevention of selected effects)
GetEffect(i)->HandleProc(aurApp, eventInfo);
- // TODO: script hooks here
+ // TODO: AfterEffectProc hook here
+
+ // TODO: AfterProc hook here
// Remove aura if we've used last charge to proc
if (IsUsingCharges() && !GetCharges())
@@ -2035,7 +2061,6 @@ void Aura::_DeleteRemovedApplications()
void Aura::LoadScripts()
{
- sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura::LoadScripts");
sScriptMgr->CreateAuraScripts(m_spellInfo->Id, m_loadedScripts);
for (std::list<AuraScript*>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;)
{
@@ -2046,6 +2071,7 @@ void Aura::LoadScripts()
m_loadedScripts.erase(bitr);
continue;
}
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura::LoadScripts: Script `%s` for aura `%u` is loaded now", (*itr)->_GetScriptName()->c_str(), m_spellInfo->Id);
(*itr)->Register();
++itr;
}
@@ -2065,6 +2091,30 @@ bool Aura::CallScriptCheckAreaTargetHandlers(Unit* target)
return true;
}
+void Aura::CallScriptDispel(DispelInfo* dispelInfo)
+{
+ for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
+ {
+ (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_DISPEL);
+ std::list<AuraScript::AuraDispelHandler>::iterator hookItrEnd = (*scritr)->OnDispel.end(), hookItr = (*scritr)->OnDispel.begin();
+ for (; hookItr != hookItrEnd ; ++hookItr)
+ (*hookItr).Call(*scritr, dispelInfo);
+ (*scritr)->_FinishScriptCall();
+ }
+}
+
+void Aura::CallScriptAfterDispel(DispelInfo* dispelInfo)
+{
+ for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
+ {
+ (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_AFTER_DISPEL);
+ std::list<AuraScript::AuraDispelHandler>::iterator hookItrEnd = (*scritr)->AfterDispel.end(), hookItr = (*scritr)->AfterDispel.begin();
+ for (; hookItr != hookItrEnd ; ++hookItr)
+ (*hookItr).Call(*scritr, dispelInfo);
+ (*scritr)->_FinishScriptCall();
+ }
+}
+
bool Aura::CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode)
{
bool preventDefault = false;
@@ -2322,7 +2372,7 @@ void UnitAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster)
{
float radius = GetSpellInfo()->Effects[effIndex].CalcRadius(caster);
- if (!GetUnitOwner()->HasUnitState(UNIT_STAT_ISOLATED))
+ if (!GetUnitOwner()->HasUnitState(UNIT_STATE_ISOLATED))
{
switch (GetSpellInfo()->Effects[effIndex].Effect)
{
diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h
index bcf40fe69d7..4d87abccda3 100755
--- a/src/server/game/Spells/Auras/SpellAuras.h
+++ b/src/server/game/Spells/Auras/SpellAuras.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -186,6 +186,9 @@ class Aura
bool CanStackWith(Aura const* existingAura) const;
// Proc system
+ // this subsystem is not yet in use - the core of it is functional, but still some research has to be done
+ // and some dependant problems fixed before it can replace old proc system (for example cooldown handling)
+ // currently proc system functionality is implemented in Unit::ProcDamageAndSpell
bool IsProcOnCooldown() const;
void AddProcCooldown(uint32 msec);
bool IsUsingCharges() const { return m_isUsingCharges; }
@@ -198,6 +201,8 @@ class Aura
// AuraScript
void LoadScripts();
bool CallScriptCheckAreaTargetHandlers(Unit* target);
+ void CallScriptDispel(DispelInfo* dispelInfo);
+ void CallScriptAfterDispel(DispelInfo* dispelInfo);
bool CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
bool CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
void CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index de49b2cf579..b1aeb41a126 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -1401,13 +1401,17 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
}
}
-SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, const uint32 effectMask, bool scaleAura)
+SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleAura)
{
if (!unit || !effectMask)
return SPELL_MISS_EVADE;
- // Recheck immune (only for delayed spells)
- if (m_spellInfo->Speed && (unit->IsImmunedToDamage(m_spellInfo) || unit->IsImmunedToSpell(m_spellInfo)))
+ // For delayed spells immunity may be applied between missile launch and hit - check immunity for that case
+ // disable effects to which unit is immune
+ for (uint32 effectNumber = 0; effectNumber < MAX_SPELL_EFFECTS; ++effectNumber)
+ if (effectMask & (1 << effectNumber) && unit->IsImmunedToSpellEffect(m_spellInfo, effectNumber))
+ effectMask &= ~(1 << effectNumber);
+ if (!effectMask || (m_spellInfo->Speed && (unit->IsImmunedToDamage(m_spellInfo) || unit->IsImmunedToSpell(m_spellInfo))))
return SPELL_MISS_IMMUNE;
PrepareScriptHitHandlers();
@@ -1447,7 +1451,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, const uint32 effectMask, bool
return SPELL_MISS_EVADE;
// assisting case, healing and resurrection
- if (unit->HasUnitState(UNIT_STAT_ATTACK_PLAYER))
+ if (unit->HasUnitState(UNIT_STATE_ATTACK_PLAYER))
{
m_caster->SetContestedPvP();
if (m_caster->GetTypeId() == TYPEID_PLAYER)
@@ -2855,20 +2859,6 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
InitExplicitTargets(*targets);
- if (Player* plrCaster = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself())
- {
- //check for special spell conditions
- ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL, m_spellInfo->Id);
- if (!conditions.empty())
- if (!sConditionMgr->IsPlayerMeetToConditions(plrCaster, conditions))
- {
- //SendCastResult(SPELL_FAILED_DONT_REPORT);
- SendCastResult(plrCaster, m_spellInfo, m_cast_count, SPELL_FAILED_DONT_REPORT);
- finish(false);
- return;
- }
- }
-
// Fill aura scaling information
if (m_caster->IsControlledByPlayer() && !m_spellInfo->IsPassive() && m_spellInfo->SpellLevel && !m_spellInfo->IsChanneled() && !(_triggeredCastFlags & TRIGGERED_IGNORE_AURA_SCALING))
{
@@ -3091,6 +3081,8 @@ void Spell::cast(bool skipCheck)
m_caster->ToPlayer()->SetSpellModTakingSpell(this, true);
}
+ CallScriptBeforeCastHandlers();
+
// skip check if done already (for instant cast spells for example)
if (!skipCheck)
{
@@ -3160,6 +3152,8 @@ void Spell::cast(bool skipCheck)
PrepareTriggersExecutedOnHit();
+ CallScriptOnCastHandlers();
+
// traded items have trade slot instead of guid in m_itemTargetGUID
// set to real guid to be sent later to the client
m_targets.UpdateTradeSlotItem();
@@ -3210,8 +3204,8 @@ void Spell::cast(bool skipCheck)
m_spellState = SPELL_STATE_DELAYED;
SetDelayStart(0);
- if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
- m_caster->ClearUnitState(UNIT_STAT_CASTING);
+ if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
+ m_caster->ClearUnitState(UNIT_STATE_CASTING);
}
else
{
@@ -3219,6 +3213,8 @@ void Spell::cast(bool skipCheck)
handle_immediate();
}
+ CallScriptAfterCastHandlers();
+
if (const std::vector<int32> *spell_triggered = sSpellMgr->GetSpellLinked(m_spellInfo->Id))
{
for (std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i)
@@ -3575,8 +3571,8 @@ void Spell::finish(bool ok)
if (m_spellInfo->IsChanneled())
m_caster->UpdateInterruptMask();
- if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
- m_caster->ClearUnitState(UNIT_STAT_CASTING);
+ if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
+ m_caster->ClearUnitState(UNIT_STATE_CASTING);
// Unsummon summon as possessed creatures on spell cancel
if (m_spellInfo->IsChanneled() && m_caster->GetTypeId() == TYPEID_PLAYER)
@@ -3823,6 +3819,9 @@ void Spell::SendSpellGo()
castFlags |= CAST_FLAG_UNKNOWN_19; // same as in SMSG_SPELL_START
}
+ if (m_targets.HasTraj())
+ castFlags |= CAST_FLAG_ADJUST_MISSILE;
+
WorldPacket data(SMSG_SPELL_GO, 50); // guess size
if (m_CastItem)
@@ -3865,11 +3864,10 @@ void Spell::SendSpellGo()
}
}
}
-
- if (castFlags & CAST_FLAG_UNKNOWN_18)
+ if (castFlags & CAST_FLAG_ADJUST_MISSILE)
{
- data << float(0);
- data << uint32(0);
+ data << m_targets.GetElevation();
+ data << uint32(m_delayMoment);
}
if (castFlags & CAST_FLAG_AMMO)
@@ -4718,6 +4716,14 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_DONT_REPORT;
}
+ // check spell caster's conditions from database
+ if (Player* plrCaster = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself())
+ {
+ ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL, m_spellInfo->Id);
+ if (!conditions.empty() && !sConditionMgr->IsPlayerMeetToConditions(plrCaster, conditions))
+ return SPELL_FAILED_DONT_REPORT;
+ }
+
// Don't check explicit target for passive spells (workaround) (check should be skipped only for learn case)
// those spells may have incorrect target entries or not filled at all (for example 15332)
// such spells when learned are not targeting anyone using targeting system, they should apply directly to caster instead
@@ -4992,7 +4998,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (strict && m_caster->IsScriptOverriden(m_spellInfo, 6953))
m_caster->RemoveMovementImpairingAuras();
}
- if (m_caster->HasUnitState(UNIT_STAT_ROOT))
+ if (m_caster->HasUnitState(UNIT_STATE_ROOT))
return SPELL_FAILED_ROOTED;
break;
}
@@ -5220,7 +5226,7 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
Unit* target = m_targets.GetUnitTarget();
- if (m_caster == target && m_caster->HasUnitState(UNIT_STAT_ROOT))
+ if (m_caster == target && m_caster->HasUnitState(UNIT_STATE_ROOT))
{
if (m_caster->GetTypeId() == TYPEID_PLAYER)
return SPELL_FAILED_ROOTED;
@@ -5393,6 +5399,9 @@ SpellCastResult Spell::CheckCast(bool strict)
}
case SPELL_AURA_PERIODIC_MANA_LEECH:
{
+ if (m_spellInfo->Effects[i].IsTargetingArea())
+ break;
+
if (!m_targets.GetUnitTarget())
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
@@ -5444,7 +5453,7 @@ SpellCastResult Spell::CheckCast(bool strict)
SpellCastResult Spell::CheckPetCast(Unit* target)
{
- if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !(_triggeredCastFlags & TRIGGERED_IGNORE_CAST_IN_PROGRESS)) //prevent spellcast interruption by another spellcast
+ if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !(_triggeredCastFlags & TRIGGERED_IGNORE_CAST_IN_PROGRESS)) //prevent spellcast interruption by another spellcast
return SPELL_FAILED_SPELL_IN_PROGRESS;
// dead owner (pets still alive when owners ressed?)
@@ -6619,7 +6628,7 @@ void Spell::HandleLaunchPhase()
continue;
// do not consume ammo anymore for Hunter's volley spell
- if (IsTriggered() && m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && m_spellInfo->IsAOE())
+ if (IsTriggered() && m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && m_spellInfo->IsTargetingArea())
usesAmmo = false;
if (usesAmmo)
@@ -6670,7 +6679,7 @@ void Spell::DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier)
if (m_damage > 0)
{
- if (m_spellInfo->Effects[i].IsArea())
+ if (m_spellInfo->Effects[i].IsTargetingArea())
{
m_damage = int32(float(m_damage) * unit->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask));
if (m_caster->GetTypeId() == TYPEID_UNIT)
@@ -6969,7 +6978,6 @@ void Spell::CheckEffectExecuteData()
void Spell::LoadScripts()
{
- sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::LoadScripts");
sScriptMgr->CreateSpellScripts(m_spellInfo->Id, m_loadedScripts);
for (std::list<SpellScript*>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;)
{
@@ -6980,15 +6988,49 @@ void Spell::LoadScripts()
m_loadedScripts.erase(bitr);
continue;
}
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::LoadScripts: Script `%s` for spell `%u` is loaded now", (*itr)->_GetScriptName()->c_str(), m_spellInfo->Id);
(*itr)->Register();
++itr;
}
}
-void Spell::PrepareScriptHitHandlers()
+void Spell::CallScriptBeforeCastHandlers()
{
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
- (*scritr)->_InitHit();
+ {
+ (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_BEFORE_CAST);
+ std::list<SpellScript::CastHandler>::iterator hookItrEnd = (*scritr)->BeforeCast.end(), hookItr = (*scritr)->BeforeCast.begin();
+ for (; hookItr != hookItrEnd ; ++hookItr)
+ (*hookItr).Call(*scritr);
+
+ (*scritr)->_FinishScriptCall();
+ }
+}
+
+void Spell::CallScriptOnCastHandlers()
+{
+ for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
+ {
+ (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_ON_CAST);
+ std::list<SpellScript::CastHandler>::iterator hookItrEnd = (*scritr)->OnCast.end(), hookItr = (*scritr)->OnCast.begin();
+ for (; hookItr != hookItrEnd ; ++hookItr)
+ (*hookItr).Call(*scritr);
+
+ (*scritr)->_FinishScriptCall();
+ }
+}
+
+void Spell::CallScriptAfterCastHandlers()
+{
+ for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
+ {
+ (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_AFTER_CAST);
+ std::list<SpellScript::CastHandler>::iterator hookItrEnd = (*scritr)->AfterCast.end(), hookItr = (*scritr)->AfterCast.begin();
+ for (; hookItr != hookItrEnd ; ++hookItr)
+ (*hookItr).Call(*scritr);
+
+ (*scritr)->_FinishScriptCall();
+ }
}
SpellCastResult Spell::CallScriptCheckCastHandlers()
@@ -7010,6 +7052,12 @@ SpellCastResult Spell::CallScriptCheckCastHandlers()
return retVal;
}
+void Spell::PrepareScriptHitHandlers()
+{
+ for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
+ (*scritr)->_InitHit();
+}
+
bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMode mode)
{
// execute script effect handler hooks and check if effects was prevented
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index f57b3114a70..2bbc04d6a3b 100755
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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,7 @@ enum SpellCastFlags
CAST_FLAG_UNKNOWN_15 = 0x00004000,
CAST_FLAG_UNKNOWN_16 = 0x00008000,
CAST_FLAG_UNKNOWN_17 = 0x00010000,
- CAST_FLAG_UNKNOWN_18 = 0x00020000,
+ CAST_FLAG_ADJUST_MISSILE = 0x00020000,
CAST_FLAG_UNKNOWN_19 = 0x00040000,
CAST_FLAG_UNKNOWN_20 = 0x00080000,
CAST_FLAG_UNKNOWN_21 = 0x00100000,
@@ -624,6 +624,9 @@ class Spell
// Scripting system
void LoadScripts();
+ void CallScriptBeforeCastHandlers();
+ void CallScriptOnCastHandlers();
+ void CallScriptAfterCastHandlers();
SpellCastResult CallScriptCheckCastHandlers();
void PrepareScriptHitHandlers();
bool CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMode mode);
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 95917070b5d..0dd8eb64654 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -333,38 +333,6 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
switch (m_spellInfo->Id) // better way to check unknown
{
- // Positive/Negative Charge
- case 28062:
- case 28085:
- case 39090:
- case 39093:
- if (!m_triggeredByAuraSpell)
- break;
- if (unitTarget == m_caster)
- {
- uint8 count = 0;
- for (std::list<TargetInfo>::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
- if (ihit->targetGUID != m_caster->GetGUID())
- if (Player* target = ObjectAccessor::GetPlayer(*m_caster, ihit->targetGUID))
- if (target->HasAura(m_triggeredByAuraSpell->Id))
- ++count;
- if (count)
- {
- uint32 spellId = 0;
- switch (m_spellInfo->Id)
- {
- case 28062: spellId = 29659; break;
- case 28085: spellId = 29660; break;
- case 39090: spellId = 39089; break;
- case 39093: spellId = 39092; break;
- }
- m_caster->SetAuraStack(spellId, m_caster, count);
- }
- }
-
- if (unitTarget->HasAura(m_triggeredByAuraSpell->Id))
- damage = 0;
- break;
// Consumption
case 28865:
damage = (((InstanceMap*)m_caster->GetMap())->GetDifficulty() == REGULAR_DIFFICULTY ? 2750 : 4250);
@@ -1145,9 +1113,13 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
return;
m_caster->CastCustomSpell(unitTarget, 52752, &damage, NULL, NULL, true);
return;
- case 54171: //Divine Storm
+ case 54171: // Divine Storm
{
- m_caster->CastCustomSpell(unitTarget, 54172, &damage, 0, 0, true);
+ if (m_UniqueTargetInfo.size())
+ {
+ int32 heal = damage / m_UniqueTargetInfo.size();
+ m_caster->CastCustomSpell(unitTarget, 54172, &heal, NULL, NULL, true);
+ }
return;
}
case 58418: // Portal to Orgrimmar
@@ -1366,7 +1338,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
}
//Any effect which causes you to lose control of your character will supress the starfall effect.
- if (m_caster->HasUnitState(UNIT_STAT_CONTROLLED))
+ if (m_caster->HasUnitState(UNIT_STATE_CONTROLLED))
return;
m_caster->CastSpell(unitTarget, damage, true);
@@ -1374,16 +1346,6 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
}
break;
case SPELLFAMILY_PALADIN:
- // Divine Storm
- if (m_spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_PALADIN_DIVINESTORM && effIndex == 1)
- {
- int32 dmg = CalculatePctN(m_damage, damage);
- if (!unitTarget)
- unitTarget = m_caster;
- m_caster->CastCustomSpell(unitTarget, 54171, &dmg, 0, 0, true);
- return;
- }
-
switch (m_spellInfo->Id)
{
case 31789: // Righteous Defense (step 1)
@@ -2788,14 +2750,13 @@ void Spell::SendLoot(uint64 guid, LootType loottype)
{
case GAMEOBJECT_TYPE_DOOR:
case GAMEOBJECT_TYPE_BUTTON:
- gameObjTarget->UseDoorOrButton();
+ gameObjTarget->UseDoorOrButton(0, false, player);
player->GetMap()->ScriptsStart(sGameObjectScripts, gameObjTarget->GetDBTableGUIDLow(), player, gameObjTarget);
return;
case GAMEOBJECT_TYPE_QUESTGIVER:
- // start or end quest
- player->PrepareQuestMenu(guid);
- player->SendPreparedQuest(guid);
+ player->PrepareGossipMenu(gameObjTarget, gameObjTarget->GetGOInfo()->questgiver.gossipID);
+ player->SendPreparedGossip(gameObjTarget);
return;
case GAMEOBJECT_TYPE_SPELL_FOCUS:
@@ -3132,7 +3093,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
summon->SelectLevel(summon->GetCreatureInfo()); // some summoned creaters have different from 1 DB data for level/hp
summon->SetUInt32Value(UNIT_NPC_FLAGS, summon->GetCreatureInfo()->npcflag);
- summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE);
+ summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
summon->AI()->EnterEvadeMode();
break;
@@ -3356,7 +3317,7 @@ void Spell::EffectDispel(SpellEffIndex effIndex)
// Send dispelled spell info
dataSuccess << uint32(itr->first->GetId()); // Spell Id
dataSuccess << uint8(0); // 0 - dispelled !=0 cleansed
- unitTarget->RemoveAurasDueToSpellByDispel(itr->first->GetId(), itr->first->GetCasterGUID(), m_caster, itr->second);
+ unitTarget->RemoveAurasDueToSpellByDispel(itr->first->GetId(), m_spellInfo->Id, itr->first->GetCasterGUID(), m_caster, itr->second);
}
m_caster->SendMessageToSet(&dataSuccess, true);
@@ -3399,25 +3360,14 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/)
return;
// target must be OK to do this
- if (unitTarget->HasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING))
+ if (unitTarget->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING))
return;
- float angle = unitTarget->GetAngle(m_targets.GetDst());
+ unitTarget->SetFacingTo(unitTarget->GetAngle(m_targets.GetDst()));
+ unitTarget->ClearUnitState(UNIT_STATE_MOVING);
- if (unitTarget->GetTypeId() == TYPEID_PLAYER)
- {
- // For players just turn them
- unitTarget->ToPlayer()->UpdatePosition(unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), angle, false);
- unitTarget->ToPlayer()->SendTeleportAckPacket();
- }
- else
- {
- // Set creature Distracted, Stop it, And turn it
- unitTarget->SetOrientation(angle);
- unitTarget->StopMoving();
+ if (unitTarget->GetTypeId() == TYPEID_UNIT)
unitTarget->GetMotionMaster()->MoveDistract(damage * IN_MILLISECONDS);
- unitTarget->SendMovementFlagUpdate();
- }
}
void Spell::EffectPickPocket(SpellEffIndex /*effIndex*/)
@@ -5657,6 +5607,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
duel->opponent = target;
duel->startTime = 0;
duel->startTimer = 0;
+ duel->isMounted = (GetSpellInfo()->Id == 62875); // Mounted Duel
caster->duel = duel;
DuelInfo* duel2 = new DuelInfo;
@@ -5664,6 +5615,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
duel2->opponent = caster;
duel2->startTime = 0;
duel2->startTimer = 0;
+ duel2->isMounted = (GetSpellInfo()->Id == 62875); // Mounted Duel
target->duel = duel2;
caster->SetUInt64Value(PLAYER_DUEL_ARBITER, pGameObj->GetGUID());
@@ -5878,7 +5830,10 @@ void Spell::EffectInebriate(SpellEffIndex /*effIndex*/)
uint16 currentDrunk = player->GetDrunkValue();
uint16 drunkMod = damage * 256;
if (currentDrunk + drunkMod > 0xFFFF)
+ {
currentDrunk = 0xFFFF;
+ player->CastSpell(player, 67468, false);
+ }
else
currentDrunk += drunkMod;
player->SetDrunkValue(currentDrunk, m_CastItem ? m_CastItem->GetEntry() : 0);
@@ -6471,7 +6426,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
pet->setDeathState(ALIVE);
- pet->ClearUnitState(uint32(UNIT_STAT_ALL_STATE));
+ pet->ClearUnitState(uint32(UNIT_STATE_ALL_STATE));
pet->SetHealth(pet->CountPctFromMaxHealth(damage));
//pet->AIM_Initialize();
@@ -7000,10 +6955,35 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex)
{
if (player->GetRuneCooldown(j) && player->GetCurrentRune(j) == RuneType(m_spellInfo->Effects[effIndex].MiscValue))
{
+ if (m_spellInfo->Id == 45529)
+ if (player->GetBaseRune(j) != RuneType(m_spellInfo->Effects[effIndex].MiscValueB))
+ continue;
player->SetRuneCooldown(j, 0);
--count;
}
}
+
+ // Blood Tap
+ if (m_spellInfo->Id == 45529 && count > 0)
+ {
+ for (uint32 l = 0; l < MAX_RUNES && count > 0; ++l)
+ {
+ // Check if both runes are on cd as that is the only time when this needs to come into effect
+ if ((player->GetRuneCooldown(l) && player->GetCurrentRune(l) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)) && (player->GetRuneCooldown(l+1) && player->GetCurrentRune(l+1) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)))
+ {
+ // Should always update the rune with the lowest cd
+ if (player->GetRuneCooldown(l) >= player->GetRuneCooldown(l+1))
+ l++;
+ player->SetRuneCooldown(l, 0);
+ --count;
+ // is needed to push through to the client that the rune is active
+ player->ResyncRunes(MAX_RUNES);
+ }
+ else
+ break;
+ }
+ }
+
// Empower rune weapon
if (m_spellInfo->Id == 47568)
{
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 463b46972fa..ad465767ab0 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -503,7 +503,7 @@ bool SpellEffectInfo::IsAura(AuraType aura) const
return IsAura() && ApplyAuraName == aura;
}
-bool SpellEffectInfo::IsArea() const
+bool SpellEffectInfo::IsTargetingArea() const
{
return TargetA.IsArea() || TargetB.IsArea();
}
@@ -1061,10 +1061,19 @@ bool SpellInfo::IsAbilityOfSkillType(uint32 skillType) const
return false;
}
-bool SpellInfo::IsAOE() const
+bool SpellInfo::IsAffectingArea() const
{
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
- if (Effects[i].IsEffect() && Effects[i].IsArea())
+ if (Effects[i].IsEffect() && (Effects[i].IsTargetingArea() || Effects[i].IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA) || Effects[i].IsAreaAuraEffect()))
+ return true;
+ return false;
+}
+
+// checks if spell targets are selected from area, doesn't include spell effects in check (like area wide auras for example)
+bool SpellInfo::IsTargetingArea() const
+{
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ if (Effects[i].IsEffect() && Effects[i].IsTargetingArea())
return true;
return false;
}
@@ -1604,7 +1613,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, Unit const* target, b
}
// not allow casting on flying player
- if (target->HasUnitState(UNIT_STAT_IN_FLIGHT))
+ if (target->HasUnitState(UNIT_STATE_IN_FLIGHT))
return SPELL_FAILED_BAD_TARGETS;
if (TargetAuraState && !target->HasAuraState(AuraStateType(TargetAuraState), this, caster))
@@ -1755,6 +1764,14 @@ Mechanics SpellInfo::GetEffectMechanic(uint8 effIndex) const
return MECHANIC_NONE;
}
+bool SpellInfo::HasAnyEffectMechanic() const
+{
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ if (Effects[i].Mechanic)
+ return true;
+ return false;
+}
+
uint32 SpellInfo::GetDispelMask() const
{
return GetDispelMask(DispelType(Dispel));
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index 7faf0de890d..65be5981c64 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -279,7 +279,7 @@ public:
bool IsEffect(SpellEffects effectName) const;
bool IsAura() const;
bool IsAura(AuraType aura) const;
- bool IsArea() const;
+ bool IsTargetingArea() const;
bool IsAreaAuraEffect() const;
bool IsFarUnitTargetEffect() const;
bool IsFarDestTargetEffect() const;
@@ -403,7 +403,8 @@ public:
bool IsAbilityLearnedWithProfession() const;
bool IsAbilityOfSkillType(uint32 skillType) const;
- bool IsAOE() const;
+ bool IsAffectingArea() const;
+ bool IsTargetingArea() const;
bool NeedsExplicitUnitTarget() const;
bool NeedsToBeTriggeredByCaster() const;
@@ -446,6 +447,7 @@ public:
uint32 GetEffectMechanicMask(uint8 effIndex) const;
uint32 GetSpellMechanicMaskByEffectMask(uint32 effectMask) const;
Mechanics GetEffectMechanic(uint8 effIndex) const;
+ bool HasAnyEffectMechanic() const;
uint32 GetDispelMask() const;
static uint32 GetDispelMask(DispelType type);
uint32 GetExplicitTargetMask() const;
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 8976f90690c..99961664aa8 100755
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -2889,6 +2889,23 @@ void SpellMgr::LoadSpellCustomAttr()
case 69293: // Wing Buffet
case 74439: // Machine Gun
case 63278: // Mark of the Faceless (General Vezax)
+ case 62544: // Thrust (Argent Tournament)
+ case 64588: // Thrust (Argent Tournament)
+ case 66479: // Thrust (Argent Tournament)
+ case 68505: // Thrust (Argent Tournament)
+ case 62709: // Counterattack! (Argent Tournament)
+ case 62626: // Break-Shield (Argent Tournament, Player)
+ case 64590: // Break-Shield (Argent Tournament, Player)
+ case 64342: // Break-Shield (Argent Tournament, NPC)
+ case 64686: // Break-Shield (Argent Tournament, NPC)
+ case 65147: // Break-Shield (Argent Tournament, NPC)
+ case 68504: // Break-Shield (Argent Tournament, NPC)
+ case 62874: // Charge (Argent Tournament, Player)
+ case 68498: // Charge (Argent Tournament, Player)
+ case 64591: // Charge (Argent Tournament, Player)
+ case 63003: // Charge (Argent Tournament, NPC)
+ case 63010: // Charge (Argent Tournament, NPC)
+ case 68321: // Charge (Argent Tournament, NPC)
case 72255: // Mark of the Fallen Champion (Deathbringer Saurfang)
case 72444: // Mark of the Fallen Champion (Deathbringer Saurfang)
case 72445: // Mark of the Fallen Champion (Deathbringer Saurfang)
@@ -2960,8 +2977,10 @@ void SpellMgr::LoadDbcDataCorrections()
switch (spellInfo->Id)
{
- case 42835: // Spout
- spellInfo->Effect[0] = 0; // remove damage effect, only anim is needed
+ case 40244: case 40245: // Simon Game Visual
+ case 40246: case 40247: // Simon Game Visual
+ case 42835: // Spout, remove damage effect, only anim is needed
+ spellInfo->Effect[0] = 0;
break;
case 30657: // Quake
spellInfo->EffectTriggerSpell[0] = 30571;
@@ -2970,6 +2989,7 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ENEMY;
spellInfo->EffectImplicitTargetB[0] = 0;
break;
+ case 63665: // Charge (Argent Tournament emote on riders)
case 31447: // Mark of Kaz'rogal (needs target selection script)
case 31298: // Sleep (needs target selection script)
case 51904: // Summon Ghouls On Scarlet Crusade (this should use conditions table, script for this spell needs to be fixed)
@@ -3039,6 +3059,7 @@ void SpellMgr::LoadDbcDataCorrections()
case 42611: // Shoot
case 61588: // Blazing Harpoon
case 52479: // Gift of the Harvester
+ case 48246: // Ball of Flame
spellInfo->MaxAffectedTargets = 1;
break;
case 41376: // Spite
@@ -3381,6 +3402,7 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->AreaGroupId = 0; // originally, these require area 4522, which is... outside of Icecrown Citadel
break;
case 70602: // Corruption
+ case 48278: // Paralyze
spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS;
break;
case 70715: // Column of Frost (visual marker)
@@ -3495,6 +3517,11 @@ void SpellMgr::LoadDbcDataCorrections()
case 72405: // Broken Frostmourne
spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; // 200yd
break;
+ case 40055: // Introspection
+ case 40165: // Introspection
+ case 40166: // Introspection
+ case 40167: // Introspection
+ spellInfo->Attributes |= SPELL_ATTR0_NEGATIVE_1;
default:
break;
}
diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h
index 552519d9940..14137b6a91b 100755
--- a/src/server/game/Spells/SpellMgr.h
+++ b/src/server/game/Spells/SpellMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 53ec7822623..8a58ce3c52a 100755
--- a/src/server/game/Spells/SpellScript.cpp
+++ b/src/server/game/Spells/SpellScript.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,6 +52,11 @@ void _SpellScript::_Init(std::string const* scriptname, uint32 spellId)
m_scriptSpellId = spellId;
}
+std::string const* _SpellScript::_GetScriptName() const
+{
+ return m_scriptName;
+}
+
_SpellScript::EffectHook::EffectHook(uint8 _effIndex)
{
// effect index must be in range <0;2>, allow use of special effindexes
@@ -147,6 +152,16 @@ std::string _SpellScript::EffectAuraNameCheck::ToString()
}
}
+SpellScript::CastHandler::CastHandler(SpellCastFnType _pCastHandlerScript)
+{
+ pCastHandlerScript = _pCastHandlerScript;
+}
+
+void SpellScript::CastHandler::Call(SpellScript* spellScript)
+{
+ (spellScript->*pCastHandlerScript)();
+}
+
SpellScript::CheckCastHandler::CheckCastHandler(SpellCheckCastFnType checkCastHandlerScript)
{
_checkCastHandlerScript = checkCastHandlerScript;
@@ -527,6 +542,14 @@ bool AuraScript::_Validate(SpellInfo const* entry)
if (!entry->HasAreaAuraEffect())
sLog->outError("TSCR: Spell `%u` of script `%s` does not have area aura effect - handler bound to hook `DoCheckAreaTarget` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
+ for (std::list<AuraDispelHandler>::iterator itr = OnDispel.begin(); itr != OnDispel.end(); ++itr)
+ if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect())
+ sLog->outError("TSCR: Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `OnDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
+
+ for (std::list<AuraDispelHandler>::iterator itr = AfterDispel.begin(); itr != AfterDispel.end(); ++itr)
+ if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect())
+ sLog->outError("TSCR: Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `AfterDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
+
for (std::list<EffectApplyHandler>::iterator itr = OnEffectApply.begin(); itr != OnEffectApply.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
@@ -592,6 +615,16 @@ bool AuraScript::CheckAreaTargetHandler::Call(AuraScript* auraScript, Unit* _tar
return (auraScript->*pHandlerScript)(_target);
}
+AuraScript::AuraDispelHandler::AuraDispelHandler(AuraDispelFnType _pHandlerScript)
+{
+ pHandlerScript = _pHandlerScript;
+}
+
+void AuraScript::AuraDispelHandler::Call(AuraScript* auraScript, DispelInfo* _dispelInfo)
+{
+ (auraScript->*pHandlerScript)(_dispelInfo);
+}
+
AuraScript::EffectBase::EffectBase(uint8 _effIndex, uint16 _effName)
: _SpellScript::EffectAuraNameCheck(_effName), _SpellScript::EffectHook(_effIndex)
{
diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h
index dab77f6533d..945a62674d9 100755
--- a/src/server/game/Spells/SpellScript.h
+++ b/src/server/game/Spells/SpellScript.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,6 +64,7 @@ class _SpellScript
virtual void _Register();
virtual void _Unload();
virtual void _Init(std::string const* scriptname, uint32 spellId);
+ std::string const* _GetScriptName() const;
protected:
class EffectHook
@@ -131,6 +132,9 @@ enum SpellScriptHookType
SPELL_SCRIPT_HOOK_AFTER_HIT,
SPELL_SCRIPT_HOOK_UNIT_TARGET_SELECT,
SPELL_SCRIPT_HOOK_CHECK_CAST,
+ SPELL_SCRIPT_HOOK_BEFORE_CAST,
+ SPELL_SCRIPT_HOOK_ON_CAST,
+ SPELL_SCRIPT_HOOK_AFTER_CAST,
};
#define HOOK_SPELL_HIT_START SPELL_SCRIPT_HOOK_EFFECT_HIT
@@ -148,10 +152,20 @@ class SpellScript : public _SpellScript
typedef SpellCastResult(CLASSNAME::*SpellCheckCastFnType)(); \
typedef void(CLASSNAME::*SpellEffectFnType)(SpellEffIndex); \
typedef void(CLASSNAME::*SpellHitFnType)(); \
+ typedef void(CLASSNAME::*SpellCastFnType)(); \
typedef void(CLASSNAME::*SpellUnitTargetFnType)(std::list<Unit*>&); \
SPELLSCRIPT_FUNCTION_TYPE_DEFINES(SpellScript)
+ class CastHandler
+ {
+ public:
+ CastHandler(SpellCastFnType _pCastHandlerScript);
+ void Call(SpellScript* spellScript);
+ private:
+ SpellCastFnType pCastHandlerScript;
+ };
+
class CheckCastHandler
{
public:
@@ -194,6 +208,7 @@ class SpellScript : public _SpellScript
};
#define SPELLSCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME) \
+ class CastHandlerFunction : public SpellScript::CastHandler { public: CastHandlerFunction(SpellCastFnType _pCastHandlerScript) : SpellScript::CastHandler((SpellScript::SpellCastFnType)_pCastHandlerScript) {} }; \
class CheckCastHandlerFunction : public SpellScript::CheckCastHandler { public: CheckCastHandlerFunction(SpellCheckCastFnType _checkCastHandlerScript) : SpellScript::CheckCastHandler((SpellScript::SpellCheckCastFnType)_checkCastHandlerScript) {} }; \
class EffectHandlerFunction : public SpellScript::EffectHandler { public: EffectHandlerFunction(SpellEffectFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : SpellScript::EffectHandler((SpellScript::SpellEffectFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \
class HitHandlerFunction : public SpellScript::HitHandler { public: HitHandlerFunction(SpellHitFnType _pHitHandlerScript) : SpellScript::HitHandler((SpellScript::SpellHitFnType)_pHitHandlerScript) {} }; \
@@ -221,6 +236,13 @@ class SpellScript : public _SpellScript
// SpellScript interface
// hooks to which you can attach your functions
//
+ // example: BeforeCast += SpellCastFn(class::function);
+ HookList<CastHandler> BeforeCast;
+ // example: OnCast += SpellCastFn(class::function);
+ HookList<CastHandler> OnCast;
+ // example: AfterCast += SpellCastFn(class::function);
+ HookList<CastHandler> AfterCast;
+ #define SpellCastFn(F) CastHandlerFunction(&F)
// example: OnCheckCast += SpellCheckCastFn();
// where function is SpellCastResult function()
@@ -250,14 +272,18 @@ class SpellScript : public _SpellScript
#define SpellUnitTargetFn(F, I, N) UnitTargetHandlerFunction(&F, I, N)
// hooks are executed in following order, at specified event of spell:
- // 1. OnUnitTargetSelect - executed just before adding selected targets to final target list
- // 2. OnEffectLaunch - executed just before specified effect handler call - when spell missile is launched
- // 3. OnEffectLaunchTarget - executed just before specified effect handler call - when spell missile is launched - called for each target from spell target map
- // 4. OnEffectHit - executed just before specified effect handler call - when spell missile hits dest
- // 5. BeforeHit - executed just before spell hits a target - called for each target from spell target map
- // 6. OnEffectHitTarget - executed just before specified effect handler call - called for each target from spell target map
- // 7. OnHit - executed just before spell deals damage and procs auras - when spell hits target - called for each target from spell target map
- // 8. AfterHit - executed just after spell finishes all it's jobs for target - called for each target from spell target map
+ // 1. BeforeCast - executed when spell preparation is finished (when cast bar becomes full) before cast is handled
+ // 2. OnCheckCast - allows to override result of CheckCast function
+ // 3. OnUnitTargetSelect - executed just before adding selected targets to final target list
+ // 4. OnCast - executed just before spell is launched (creates missile) or executed
+ // 5. AfterCast - executed after spell missile is launched and immediate spell actions are done
+ // 6. OnEffectLaunch - executed just before specified effect handler call - when spell missile is launched
+ // 7. OnEffectLaunchTarget - executed just before specified effect handler call - when spell missile is launched - called for each target from spell target map
+ // 8. OnEffectHit - executed just before specified effect handler call - when spell missile hits dest
+ // 9. BeforeHit - executed just before spell hits a target - called for each target from spell target map
+ // 10. OnEffectHitTarget - executed just before specified effect handler call - called for each target from spell target map
+ // 11. OnHit - executed just before spell deals damage and procs auras - when spell hits target - called for each target from spell target map
+ // 12. AfterHit - executed just after spell finishes all it's jobs for target - called for each target from spell target map
//
// methods allowing interaction with Spell object
@@ -359,6 +385,8 @@ enum AuraScriptHookType
AURA_SCRIPT_HOOK_EFFECT_MANASHIELD,
AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD,
AURA_SCRIPT_HOOK_CHECK_AREA_TARGET,
+ AURA_SCRIPT_HOOK_DISPEL,
+ AURA_SCRIPT_HOOK_AFTER_DISPEL,
/*AURA_SCRIPT_HOOK_APPLY,
AURA_SCRIPT_HOOK_REMOVE, */
};
@@ -374,6 +402,7 @@ class AuraScript : public _SpellScript
#define AURASCRIPT_FUNCTION_TYPE_DEFINES(CLASSNAME) \
typedef bool(CLASSNAME::*AuraCheckAreaTargetFnType)(Unit* target); \
+ typedef void(CLASSNAME::*AuraDispelFnType)(DispelInfo* dispelInfo); \
typedef void(CLASSNAME::*AuraEffectApplicationModeFnType)(AuraEffect const*, AuraEffectHandleModes); \
typedef void(CLASSNAME::*AuraEffectPeriodicFnType)(AuraEffect const*); \
typedef void(CLASSNAME::*AuraEffectUpdatePeriodicFnType)(AuraEffect*); \
@@ -392,6 +421,14 @@ class AuraScript : public _SpellScript
private:
AuraCheckAreaTargetFnType pHandlerScript;
};
+ class AuraDispelHandler
+ {
+ public:
+ AuraDispelHandler(AuraDispelFnType pHandlerScript);
+ void Call(AuraScript* auraScript, DispelInfo* dispelInfo);
+ private:
+ AuraDispelFnType pHandlerScript;
+ };
class EffectBase : public _SpellScript::EffectAuraNameCheck, public _SpellScript::EffectHook
{
public:
@@ -467,6 +504,7 @@ class AuraScript : public _SpellScript
#define AURASCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME) \
class CheckAreaTargetFunction : public AuraScript::CheckAreaTargetHandler { public: CheckAreaTargetFunction(AuraCheckAreaTargetFnType _pHandlerScript) : AuraScript::CheckAreaTargetHandler((AuraScript::AuraCheckAreaTargetFnType)_pHandlerScript) {} }; \
+ class AuraDispelFunction : public AuraScript::AuraDispelHandler { public: AuraDispelFunction(AuraDispelFnType _pHandlerScript) : AuraScript::AuraDispelHandler((AuraScript::AuraDispelFnType)_pHandlerScript) {} }; \
class EffectPeriodicHandlerFunction : public AuraScript::EffectPeriodicHandler { public: EffectPeriodicHandlerFunction(AuraEffectPeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectPeriodicHandler((AuraScript::AuraEffectPeriodicFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \
class EffectUpdatePeriodicHandlerFunction : public AuraScript::EffectUpdatePeriodicHandler { public: EffectUpdatePeriodicHandlerFunction(AuraEffectUpdatePeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectUpdatePeriodicHandler((AuraScript::AuraEffectUpdatePeriodicFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \
class EffectCalcAmountHandlerFunction : public AuraScript::EffectCalcAmountHandler { public: EffectCalcAmountHandlerFunction(AuraEffectCalcAmountFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectCalcAmountHandler((AuraScript::AuraEffectCalcAmountFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \
@@ -514,6 +552,17 @@ class AuraScript : public _SpellScript
// where function is: bool function (Unit* target);
HookList<CheckAreaTargetHandler> DoCheckAreaTarget;
#define AuraCheckAreaTargetFn(F) CheckAreaTargetFunction(&F)
+
+ // executed when aura is dispelled by a unit
+ // example: OnDispel += AuraDispelFn(class::function);
+ // where function is: void function (DispelInfo* dispelInfo);
+ HookList<AuraDispelHandler> OnDispel;
+ // executed after aura is dispelled by a unit
+ // example: AfterDispel += AuraDispelFn(class::function);
+ // where function is: void function (DispelInfo* dispelInfo);
+ HookList<AuraDispelHandler> AfterDispel;
+ #define AuraDispelFn(F) AuraDispelFunction(&F)
+
// executed when aura effect is applied with specified mode to target
// should be used when when effect handler preventing/replacing is needed, do not use this hook for triggering spellcasts/removing auras etc - may be unsafe
// example: OnEffectApply += AuraEffectApplyFn(class::function, EffectIndexSpecifier, EffectAuraNameSpecifier, AuraEffectHandleModes);
diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp
index 2915bab4b77..e5a12693aa7 100755
--- a/src/server/game/Texts/CreatureTextMgr.cpp
+++ b/src/server/game/Texts/CreatureTextMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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 @@ void CreatureTextMgr::LoadCreatureTexts()
mTextMap.clear(); // for reload case
mTextRepeatMap.clear(); //reset all currently used temp texts
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_LOAD_CRETEXT);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_TEXT);
PreparedQueryResult result = WorldDatabase.Query(stmt);
if (!result)
diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h
index 5d4e6357079..0c80e2d568f 100755
--- a/src/server/game/Texts/CreatureTextMgr.h
+++ b/src/server/game/Texts/CreatureTextMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp
index c657248c595..96f4438544f 100755
--- a/src/server/game/Tickets/TicketMgr.cpp
+++ b/src/server/game/Tickets/TicketMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -79,7 +79,7 @@ bool GmTicket::LoadFromDB(Field* fields)
void GmTicket::SaveToDB(SQLTransaction& trans) const
{
uint8 index = 0;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GM_TICKET);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_TICKET);
stmt->setUInt32( index, _id);
stmt->setUInt32(++index, GUID_LOPART(_playerGuid));
stmt->setString(++index, _playerName);
@@ -226,7 +226,7 @@ void TicketMgr::LoadTickets()
_lastTicketId = 0;
_openTicketCount = 0;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_GM_TICKETS);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GM_TICKETS);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
{
diff --git a/src/server/game/Tickets/TicketMgr.h b/src/server/game/Tickets/TicketMgr.h
index 04fb7101ff7..cb0a1bab22b 100755
--- a/src/server/game/Tickets/TicketMgr.h
+++ b/src/server/game/Tickets/TicketMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 e5865cc4f90..b734d90b040 100644
--- a/src/server/game/Tools/CharacterDatabaseCleaner.cpp
+++ b/src/server/game/Tools/CharacterDatabaseCleaner.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 1ec52497ce0..d6f541dcfbb 100644
--- a/src/server/game/Tools/CharacterDatabaseCleaner.h
+++ b/src/server/game/Tools/CharacterDatabaseCleaner.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 0c3fd957165..b076447dd90 100644
--- a/src/server/game/Tools/PlayerDump.cpp
+++ b/src/server/game/Tools/PlayerDump.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 a6e379a934e..b5655328507 100755
--- a/src/server/game/Tools/PlayerDump.h
+++ b/src/server/game/Tools/PlayerDump.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.cpp b/src/server/game/Weather/Weather.cpp
index 590e6912cc5..2a48ede4c81 100755
--- a/src/server/game/Weather/Weather.cpp
+++ b/src/server/game/Weather/Weather.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 4b2d927f690..0c17cfd1efe 100755
--- a/src/server/game/Weather/Weather.h
+++ b/src/server/game/Weather/Weather.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 938ff46a953..731aba8d197 100755
--- a/src/server/game/Weather/WeatherMgr.cpp
+++ b/src/server/game/Weather/WeatherMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 4cc64f73533..768cd2dca17 100755
--- a/src/server/game/Weather/WeatherMgr.h
+++ b/src/server/game/Weather/WeatherMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 ea3f86c81b3..426a93fda57 100755
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -1246,8 +1246,10 @@ void World::SetInitialWorldSettings()
server_type = REALM_TYPE_PVP;
else
server_type = getIntConfig(CONFIG_GAME_TYPE);
+
uint32 realm_zone = getIntConfig(CONFIG_REALM_ZONE);
- LoginDatabase.PExecute("UPDATE realmlist SET icon = %u, timezone = %u WHERE id = '%d'", server_type, realm_zone, realmID);
+
+ LoginDatabase.PExecute("UPDATE realmlist SET icon = %u, timezone = %u WHERE id = '%d'", server_type, realm_zone, realmID); // One-time query
///- Remove the bones (they should not exist in DB though) and old corpses after a restart
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_OLD_CORPSES);
@@ -1650,7 +1652,7 @@ void World::SetInitialWorldSettings()
local.tm_year+1900, local.tm_mon+1, local.tm_mday, local.tm_hour, local.tm_min, local.tm_sec);
LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime, revision) VALUES('%u', " UI64FMTD ", '%s', 0, '%s')",
- realmID, uint64(m_startTime), isoDate, _FULLVERSION);
+ realmID, uint64(m_startTime), isoDate, _FULLVERSION); // One-time query
m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILLISECONDS);
m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*IN_MILLISECONDS);
@@ -1928,7 +1930,15 @@ void World::Update(uint32 diff)
uint32 maxOnlinePlayers = GetMaxPlayerCount();
m_timers[WUPDATE_UPTIME].Reset();
- LoginDatabase.PExecute("UPDATE uptime SET uptime = %u, maxplayers = %u WHERE realmid = %u AND starttime = " UI64FMTD, tmpDiff, maxOnlinePlayers, realmID, uint64(m_startTime));
+
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_UPTIME_PLAYERS);
+
+ stmt->setUInt64(0, uint64(tmpDiff));
+ stmt->setUInt16(1, uint16(maxOnlinePlayers));
+ stmt->setUInt32(2, realmID);
+ stmt->setUInt64(3, uint64(m_startTime));
+
+ LoginDatabase.Execute(stmt);
}
/// <li> Clean logs table
@@ -1937,14 +1947,21 @@ void World::Update(uint32 diff)
if (m_timers[WUPDATE_CLEANDB].Passed())
{
m_timers[WUPDATE_CLEANDB].Reset();
- LoginDatabase.PExecute("DELETE FROM logs WHERE (time + %u) < "UI64FMTD";",
- sWorld->getIntConfig(CONFIG_LOGDB_CLEARTIME), uint64(time(0)));
+
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_OLD_LOGS);
+
+ stmt->setUInt32(0, sWorld->getIntConfig(CONFIG_LOGDB_CLEARTIME));
+ stmt->setUInt32(1, uint32(time(0)));
+
+ LoginDatabase.Execute(stmt);
}
}
/// <li> Handle all other objects
///- Update objects when the timer has passed (maps, transport, creatures, ...)
+ RecordTimeDiff(NULL);
sMapMgr->Update(diff);
+ RecordTimeDiff("UpdateMapMgr");
if (sWorld->getBoolConfig(CONFIG_AUTOBROADCAST))
{
@@ -2226,10 +2243,10 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, std::string dura
{
case BAN_IP:
// No SQL injection with prepared statements
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_ACCOUNT_BY_IP);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_IP);
stmt->setString(0, nameOrIP);
resultAccounts = LoginDatabase.Query(stmt);
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SET_IP_BANNED);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_IP_BANNED);
stmt->setString(0, nameOrIP);
stmt->setUInt32(1, duration_secs);
stmt->setString(2, author);
@@ -2238,13 +2255,13 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, std::string dura
break;
case BAN_ACCOUNT:
// No SQL injection with prepared statements
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_ACCIDBYNAME);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME);
stmt->setString(0, nameOrIP);
resultAccounts = LoginDatabase.Query(stmt);
break;
case BAN_CHARACTER:
// No SQL injection with prepared statements
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_ACCOUNT_BY_NAME);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_BY_NAME);
stmt->setString(0, nameOrIP);
resultAccounts = CharacterDatabase.Query(stmt);
break;
@@ -2270,11 +2287,11 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, std::string dura
if (mode != BAN_IP)
{
// make sure there is only one active ban
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SET_ACCOUNT_NOT_BANNED);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_NOT_BANNED);
stmt->setUInt32(0, account);
trans->Append(stmt);
// No SQL injection with prepared statements
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SET_ACCOUNT_BANNED);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_BANNED);
stmt->setUInt32(0, account);
stmt->setUInt32(1, duration_secs);
stmt->setString(2, author);
@@ -2298,7 +2315,7 @@ bool World::RemoveBanAccount(BanMode mode, std::string nameOrIP)
PreparedStatement* stmt = NULL;
if (mode == BAN_IP)
{
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SET_IP_NOT_BANNED);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_IP_NOT_BANNED);
stmt->setString(0, nameOrIP);
LoginDatabase.Execute(stmt);
}
@@ -2314,7 +2331,7 @@ bool World::RemoveBanAccount(BanMode mode, std::string nameOrIP)
return false;
//NO SQL injection as account is uint32
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SET_ACCOUNT_NOT_BANNED);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_NOT_BANNED);
stmt->setUInt32(0, account);
LoginDatabase.Execute(stmt);
}
@@ -2332,7 +2349,7 @@ BanReturn World::BanCharacter(std::string name, std::string duration, std::strin
/// Pick a player to ban if not online
if (!pBanned)
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_GUID_BY_NAME);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME);
stmt->setString(0, name);
PreparedQueryResult resultCharacter = CharacterDatabase.Query(stmt);
@@ -2345,11 +2362,11 @@ BanReturn World::BanCharacter(std::string name, std::string duration, std::strin
guid = pBanned->GetGUIDLow();
// make sure there is only one active ban
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_NOT_BANNED);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_BAN);
stmt->setUInt32(0, guid);
CharacterDatabase.Execute(stmt);
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_BAN);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_BAN);
stmt->setUInt32(0, guid);
stmt->setUInt32(1, duration_secs);
stmt->setString(2, author);
@@ -2371,7 +2388,7 @@ bool World::RemoveBanCharacter(std::string name)
/// Pick a player to ban if not online
if (!pBanned)
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_GUID_BY_NAME);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME);
stmt->setString(0, name);
PreparedQueryResult resultCharacter = CharacterDatabase.Query(stmt);
@@ -2386,7 +2403,7 @@ bool World::RemoveBanCharacter(std::string name)
if (!guid)
return false;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_NOT_BANNED);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_BAN);
stmt->setUInt32(0, guid);
CharacterDatabase.Execute(stmt);
return true;
@@ -2589,7 +2606,7 @@ void World::SendAutoBroadcast()
void World::UpdateRealmCharCount(uint32 accountId)
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_CHARACTER_COUNT);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_COUNT);
stmt->setUInt32(0, accountId);
PreparedQueryResultFuture result = CharacterDatabase.AsyncQuery(stmt);
m_realmCharCallbacks.insert(result);
@@ -2603,12 +2620,12 @@ void World::_UpdateRealmCharCount(PreparedQueryResult resultCharCount)
uint32 accountId = fields[0].GetUInt32();
uint32 charCount = fields[1].GetUInt32();
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALMCHARACTERS);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS);
stmt->setUInt32(0, accountId);
stmt->setUInt32(1, realmID);
LoginDatabase.Execute(stmt);
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_ADD_REALMCHARACTERS);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_REALM_CHARACTERS);
stmt->setUInt32(0, charCount);
stmt->setUInt32(1, accountId);
stmt->setUInt32(2, realmID);
@@ -2731,6 +2748,17 @@ void World::ResetWeeklyQuests()
sPoolMgr->ChangeWeeklyQuests();
}
+void World::ResetEventSeasonalQuests(uint16 event_id)
+{
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_STATUS_SEASONAL);
+ stmt->setUInt16(0,event_id);
+ CharacterDatabase.Execute(stmt);
+
+ for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
+ if (itr->second->GetPlayer())
+ itr->second->GetPlayer()->ResetSeasonalQuestStatus(event_id);
+}
+
void World::ResetRandomBG()
{
sLog->outDetail("Random BG status reset for all characters.");
@@ -2821,9 +2849,23 @@ void World::setWorldState(uint32 index, uint64 value)
{
WorldStatesMap::const_iterator it = m_worldstates.find(index);
if (it != m_worldstates.end())
- CharacterDatabase.PExecute("UPDATE worldstates SET value="UI64FMTD" where entry=%u", value, index);
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_WORLDSTATE);
+
+ stmt->setUInt32(0, uint32(value));
+ stmt->setUInt32(1, index);
+
+ CharacterDatabase.Execute(stmt);
+ }
else
- CharacterDatabase.PExecute("INSERT INTO worldstates (entry, value) VALUES (%u, "UI64FMTD")", index, value);
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_WORLDSTATE);
+
+ stmt->setUInt32(0, index);
+ stmt->setUInt32(1, uint32(value));
+
+ CharacterDatabase.Execute(stmt);
+ }
m_worldstates[index] = value;
}
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index 9354c14f51c..bedd8a87b20 100755
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -746,6 +746,7 @@ class World
uint32 GetCleaningFlags() const { return m_CleaningFlags; }
void SetCleaningFlags(uint32 flags) { m_CleaningFlags = flags; }
+ void ResetEventSeasonalQuests(uint16 event_id);
protected:
void _UpdateGameTime();
// callback for UpdateRealmCharacters
diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt
index de660b8f106..56e63af5bbf 100644
--- a/src/server/scripts/CMakeLists.txt
+++ b/src/server/scripts/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2012 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
@@ -61,12 +61,10 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/shared/Database
${CMAKE_SOURCE_DIR}/src/server/shared/DataStores
${CMAKE_SOURCE_DIR}/src/server/shared/Debugging
- ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/CountedReference
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic
${CMAKE_SOURCE_DIR}/src/server/shared/Logging
${CMAKE_SOURCE_DIR}/src/server/shared/Packets
- ${CMAKE_SOURCE_DIR}/src/server/shared/Policies
${CMAKE_SOURCE_DIR}/src/server/shared/Threading
${CMAKE_SOURCE_DIR}/src/server/shared/Utilities
${CMAKE_SOURCE_DIR}/src/server/collision
@@ -112,6 +110,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/game/Grids/Notifiers
${CMAKE_SOURCE_DIR}/src/server/game/Groups
${CMAKE_SOURCE_DIR}/src/server/game/Guilds
+ ${CMAKE_SOURCE_DIR}/src/server/game/Handlers
${CMAKE_SOURCE_DIR}/src/server/game/Instances
${CMAKE_SOURCE_DIR}/src/server/game/LookingForGroup
${CMAKE_SOURCE_DIR}/src/server/game/Loot
@@ -130,7 +129,6 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/game/Scripting
${CMAKE_SOURCE_DIR}/src/server/game/Server
${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol
- ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol/Handlers
${CMAKE_SOURCE_DIR}/src/server/game/Skills
${CMAKE_SOURCE_DIR}/src/server/game/Spells
${CMAKE_SOURCE_DIR}/src/server/game/Spells/Auras
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index bcef7ac9ba9..7372c92c4dd 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,7 +81,7 @@ public:
return false;
}
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPDATE_EXPANSION);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPANSION);
stmt->setUInt8(0, uint8(expansion));
stmt->setUInt32(1, accountId);
@@ -109,6 +109,8 @@ public:
{
case AOR_OK:
handler->PSendSysMessage(LANG_ACCOUNT_CREATED, accountName);
+ if (handler->GetSession())
+ sLog->outChar("Account: %d (IP: %s) Character:[%s] (GUID: %u) Change Password.", handler->GetSession()->GetAccountId(),handler->GetSession()->GetRemoteAddress().c_str(), handler->GetSession()->GetPlayer()->GetName(), handler->GetSession()->GetPlayer()->GetGUIDLow());
break;
case AOR_NAME_TOO_LONG:
handler->SendSysMessage(LANG_ACCOUNT_TOO_LONG);
@@ -250,7 +252,7 @@ public:
if (!param.empty())
{
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPDATE_ACCOUNT_LOCK);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK);
if (param == "on")
{
@@ -388,8 +390,13 @@ public:
if (expansion < 0 || uint8(expansion) > sWorld->getIntConfig(CONFIG_EXPANSION))
return false;
- // No SQL injection
- LoginDatabase.PExecute("UPDATE account SET expansion = '%d' WHERE id = '%u'", expansion, accountId);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPANSION);
+
+ stmt->setUInt8(0, expansion);
+ stmt->setUInt32(1, accountId);
+
+ LoginDatabase.Execute(stmt);
+
handler->PSendSysMessage(LANG_ACCOUNT_SETADDON, accountName.c_str(), accountId, expansion);
return true;
}
@@ -480,13 +487,34 @@ public:
}
// If gmRealmID is -1, delete all values for the account id, else, insert values for the specific realmID
+ PreparedStatement* stmt;
+
if (gmRealmID == -1)
- LoginDatabase.PExecute("DELETE FROM account_access WHERE id = '%u'", targetAccountId);
+ {
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS);
+
+ stmt->setUInt32(0, targetAccountId);
+ }
else
- LoginDatabase.PExecute("DELETE FROM account_access WHERE id = '%u' AND (RealmID = '%d' OR RealmID = '-1')", targetAccountId, realmID);
+ {
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM);
+
+ stmt->setUInt32(0, targetAccountId);
+ stmt->setUInt32(1, realmID);
+ }
+ LoginDatabase.Execute(stmt);
if (gm != 0)
- LoginDatabase.PExecute("INSERT INTO account_access VALUES ('%u', '%d', '%d')", targetAccountId, gm, gmRealmID);
+ {
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_ACCESS);
+
+ stmt->setUInt32(0, targetAccountId);
+ stmt->setUInt8(1, uint8(gm));
+ stmt->setInt32(2, gmRealmID);
+
+ LoginDatabase.Execute(stmt);
+ }
+
handler->PSendSysMessage(LANG_YOU_CHANGE_SECURITY, targetAccountName.c_str(), gm);
return true;
diff --git a/src/server/scripts/Commands/cs_achievement.cpp b/src/server/scripts/Commands/cs_achievement.cpp
index 61ce13f0ecb..f136cba46ab 100644
--- a/src/server/scripts/Commands/cs_achievement.cpp
+++ b/src/server/scripts/Commands/cs_achievement.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 9e1d5717f1f..311c6586a0f 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 3bd745df4f4..4f6acd7b629 100644
--- a/src/server/scripts/Commands/cs_event.cpp
+++ b/src/server/scripts/Commands/cs_event.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 ab077af0863..9b9d1cfd146 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -26,6 +26,7 @@ EndScriptData */
#include "ObjectMgr.h"
#include "Chat.h"
#include "AccountMgr.h"
+#include "World.h"
class gm_commandscript : public CommandScript
{
@@ -155,7 +156,7 @@ public:
static bool HandleGMListFullCommand(ChatHandler* handler, char const* /*args*/)
{
///- Get the accounts with GM Level >0
- QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= %u", SEC_MODERATOR);
+ QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= %u AND (aa.realmid = -1 OR aa.realmid = %u)", SEC_MODERATOR, realmID);
if (result)
{
handler->SendSysMessage(LANG_GMLIST);
diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp
index 5ed2d6a3dd8..3de0d89bac5 100644
--- a/src/server/scripts/Commands/cs_go.cpp
+++ b/src/server/scripts/Commands/cs_go.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index eb1ccc543f3..74b8272201b 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -97,7 +97,7 @@ public:
// Activate
object->SetLootState(GO_READY);
- object->UseDoorOrButton(10000);
+ object->UseDoorOrButton(10000, false, handler->GetSession()->GetPlayer());
handler->PSendSysMessage("Object activated!");
diff --git a/src/server/scripts/Commands/cs_gps.cpp b/src/server/scripts/Commands/cs_gps.cpp
index bafaae465ef..8f15f8c9ce3 100644
--- a/src/server/scripts/Commands/cs_gps.cpp
+++ b/src/server/scripts/Commands/cs_gps.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 f6c6d89c0b7..4edc5f6fea0 100644
--- a/src/server/scripts/Commands/cs_honor.cpp
+++ b/src/server/scripts/Commands/cs_honor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 d03291d6d5d..fcabaaa7e5b 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 7c08fe4d297..5f0434e5c55 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 c32abb9537b..358eaacd4f7 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 a5aa2a516f3..57932ef56c6 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,7 +130,7 @@ public:
{
uint32 tguid = chr->GetTransport()->AddNPCPassenger(0, id, chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO());
if (tguid > 0)
- WorldDatabase.PQuery("INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (%u, %u, %f, %f, %f, %f, %u)", tguid, id, chr->GetTransport()->GetEntry(), chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO());
+ WorldDatabase.PExecute("INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (%u, %u, %f, %f, %f, %f, %u)", tguid, id, chr->GetTransport()->GetEntry(), chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO());
return true;
}
@@ -219,10 +219,10 @@ public:
if (!*args)
return false;
- char* guid_str = strtok((char*)args, " ");
- char* wait_str = strtok((char*)NULL, " ");
+ char* guidStr = strtok((char*)args, " ");
+ char* waitStr = strtok((char*)NULL, " ");
- uint32 lowguid = atoi((char*)guid_str);
+ uint32 lowGuid = atoi((char*)guidStr);
Creature* creature = NULL;
@@ -234,10 +234,10 @@ public:
// attempt check creature existence by DB data
if (!creature)
{
- CreatureData const* data = sObjectMgr->GetCreatureData(lowguid);
+ CreatureData const* data = sObjectMgr->GetCreatureData(lowGuid);
if (!data)
{
- handler->PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid);
+ handler->PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowGuid);
handler->SetSentErrorMessage(true);
return false;
}
@@ -245,20 +245,22 @@ public:
else
{
// obtain real GUID for DB operations
- lowguid = creature->GetDBTableGUIDLow();
+ lowGuid = creature->GetDBTableGUIDLow();
}
- int wait = wait_str ? atoi(wait_str) : 0;
+ int wait = waitStr ? atoi(waitStr) : 0;
if (wait < 0)
wait = 0;
- //Player* player = handler->GetSession()->GetPlayer();
+ // Update movement type
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE);
- //WaypointMgr.AddLastNode(lowguid, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), wait, 0);
+ stmt->setUInt8(0, uint8(WAYPOINT_MOTION_TYPE));
+ stmt->setUInt32(1, lowGuid);
+
+ WorldDatabase.Execute(stmt);
- // update movement type
- WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE, lowguid);
if (creature && creature->GetWaypointPath())
{
creature->SetDefaultMovementType(WAYPOINT_MOTION_TYPE);
@@ -457,17 +459,23 @@ public:
creature->setFaction(factionId);
- // faction is set in creature_template - not inside creature
+ // Faction is set in creature_template - not inside creature
- // update in memory
+ // Update in memory..
if (CreatureTemplate const* cinfo = creature->GetCreatureInfo())
{
const_cast<CreatureTemplate*>(cinfo)->faction_A = factionId;
const_cast<CreatureTemplate*>(cinfo)->faction_H = factionId;
}
- // and DB
- WorldDatabase.PExecute("UPDATE creature_template SET faction_A = '%u', faction_H = '%u' WHERE entry = '%u'", factionId, factionId, creature->GetEntry());
+ // ..and DB
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_FACTION);
+
+ stmt->setUInt16(0, uint16(factionId));
+ stmt->setUInt16(1, uint16(factionId));
+ stmt->setUInt32(2, creature->GetEntry());
+
+ WorldDatabase.Execute(stmt);
return true;
}
@@ -491,7 +499,12 @@ public:
creature->SetUInt32Value(UNIT_NPC_FLAGS, npcFlags);
- WorldDatabase.PExecute("UPDATE creature_template SET npcflag = '%u' WHERE entry = '%u'", npcFlags, creature->GetEntry());
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_NPCFLAG);
+
+ stmt->setUInt32(0, npcFlags);
+ stmt->setUInt32(1, creature->GetEntry());
+
+ WorldDatabase.Execute(stmt);
handler->SendSysMessage(LANG_VALUE_SAVED_REJOIN);
@@ -637,7 +650,16 @@ public:
}
}
- WorldDatabase.PExecute("UPDATE creature SET position_x = '%f', position_y = '%f', position_z = '%f', orientation = '%f' WHERE guid = '%u'", x, y, z, o, lowguid);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_POSITION);
+
+ stmt->setFloat(0, x);
+ stmt->setFloat(1, y);
+ stmt->setFloat(2, z);
+ stmt->setFloat(3, o);
+ stmt->setUInt32(4, lowguid);
+
+ WorldDatabase.Execute(stmt);
+
handler->PSendSysMessage(LANG_COMMAND_CREATUREMOVED);
return true;
}
@@ -657,7 +679,7 @@ public:
if (target->GetTransport())
if (target->GetGUIDTransport())
- WorldDatabase.PQuery("UPDATE creature_transport SET emote=%u WHERE transport_entry=%u AND guid=%u", emote, target->GetTransport()->GetEntry(), target->GetGUIDTransport());
+ WorldDatabase.PExecute("UPDATE creature_transport SET emote=%u WHERE transport_entry=%u AND guid=%u", emote, target->GetTransport()->GetEntry(), target->GetGUIDTransport());
target->SetUInt32Value(UNIT_NPC_EMOTESTATE, emote);
@@ -884,10 +906,10 @@ public:
mtype = RANDOM_MOTION_TYPE;
Creature* creature = handler->getSelectedCreature();
- uint32 u_guidlow = 0;
+ uint32 guidLow = 0;
if (creature)
- u_guidlow = creature->GetDBTableGUIDLow();
+ guidLow = creature->GetDBTableGUIDLow();
else
return false;
@@ -900,7 +922,14 @@ public:
creature->Respawn();
}
- WorldDatabase.PExecute("UPDATE creature SET spawndist=%f, MovementType=%i WHERE guid=%u", option, mtype, u_guidlow);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_DISTANCE);
+
+ stmt->setFloat(0, option);
+ stmt->setUInt8(1, uint8(mtype));
+ stmt->setUInt32(2, guidLow);
+
+ WorldDatabase.Execute(stmt);
+
handler->PSendSysMessage(LANG_COMMAND_SPAWNDIST, option);
return true;
}
@@ -916,9 +945,9 @@ public:
if (!stime)
return false;
- int i_stime = atoi((char*)stime);
+ int spawnTime = atoi((char*)stime);
- if (i_stime < 0)
+ if (spawnTime < 0)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
@@ -926,16 +955,22 @@ public:
}
Creature* creature = handler->getSelectedCreature();
- uint32 u_guidlow = 0;
+ uint32 guidLow = 0;
if (creature)
- u_guidlow = creature->GetDBTableGUIDLow();
+ guidLow = creature->GetDBTableGUIDLow();
else
return false;
- WorldDatabase.PExecute("UPDATE creature SET spawntimesecs=%i WHERE guid=%u", i_stime, u_guidlow);
- creature->SetRespawnDelay((uint32)i_stime);
- handler->PSendSysMessage(LANG_COMMAND_SPAWNTIME, i_stime);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_TIME_SECS);
+
+ stmt->setUInt32(0, uint32(spawnTime));
+ stmt->setUInt32(1, guidLow);
+
+ WorldDatabase.Execute(stmt);
+
+ creature->SetRespawnDelay((uint32)spawnTime);
+ handler->PSendSysMessage(LANG_COMMAND_SPAWNTIME, spawnTime);
return true;
}
@@ -1001,15 +1036,14 @@ public:
}
if (/*creature->GetMotionMaster()->empty() ||*/
- creature->GetMotionMaster()->GetCurrentMovementGeneratorType () != TARGETED_MOTION_TYPE)
+ creature->GetMotionMaster()->GetCurrentMovementGeneratorType () != FOLLOW_MOTION_TYPE)
{
handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName());
handler->SetSentErrorMessage(true);
return false;
}
- TargetedMovementGenerator<Creature> const* mgen
- = static_cast<TargetedMovementGenerator<Creature> const*>((creature->GetMotionMaster()->top()));
+ FollowMovementGenerator<Creature> const* mgen = static_cast<FollowMovementGenerator<Creature> const*>((creature->GetMotionMaster()->top()));
if (mgen->GetTarget() != player)
{
@@ -1198,8 +1232,15 @@ public:
CreatureGroupMap[lowguid] = group_member;
creature->SearchFormation();
- WorldDatabase.PExecute("INSERT INTO creature_formations (leaderGUID, memberGUID, dist, angle, groupAI) VALUES ('%u', '%u', '%f', '%f', '%u')",
- leaderGUID, lowguid, group_member->follow_dist, group_member->follow_angle, group_member->groupAI);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE_FORMATION);
+
+ stmt->setUInt32(0, leaderGUID);
+ stmt->setUInt32(1, lowguid);
+ stmt->setFloat(2, group_member->follow_dist);
+ stmt->setFloat(3, group_member->follow_angle);
+ stmt->setUInt32(4, uint32(group_member->groupAI));
+
+ WorldDatabase.Execute(stmt);
handler->PSendSysMessage("Creature %u added to formation with leader %u", lowguid, leaderGUID);
diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp
index 3d437e473f7..2472a29e595 100644
--- a/src/server/scripts/Commands/cs_quest.cpp
+++ b/src/server/scripts/Commands/cs_quest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 7784d495f80..17c819f2f22 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,6 +36,7 @@ EndScriptData */
#include "SkillDiscovery.h"
#include "SkillExtraItems.h"
#include "Chat.h"
+#include "WaypointManager.h"
class reload_commandscript : public CommandScript
{
@@ -144,13 +145,14 @@ public:
{ "spell_linked_spell", SEC_ADMINISTRATOR, true, &HandleReloadSpellLinkedSpellCommand, "", NULL },
{ "spell_pet_auras", SEC_ADMINISTRATOR, true, &HandleReloadSpellPetAurasCommand, "", NULL },
{ "spell_proc_event", SEC_ADMINISTRATOR, true, &HandleReloadSpellProcEventCommand, "", NULL },
- { "spell_proc", SEC_ADMINISTRATOR, true, &HandleReloadSpellProcsCommand, "", NULL },
+ { "spell_proc", SEC_ADMINISTRATOR, true, &HandleReloadSpellProcsCommand, "", NULL },
{ "spell_scripts", SEC_ADMINISTRATOR, true, &HandleReloadSpellScriptsCommand, "", NULL },
{ "spell_target_position", SEC_ADMINISTRATOR, true, &HandleReloadSpellTargetPositionCommand, "", NULL },
{ "spell_threats", SEC_ADMINISTRATOR, true, &HandleReloadSpellThreatsCommand, "", NULL },
{ "spell_group_stack_rules", SEC_ADMINISTRATOR, true, &HandleReloadSpellGroupStackRulesCommand, "", NULL },
{ "trinity_string", SEC_ADMINISTRATOR, true, &HandleReloadTrinityStringCommand, "", NULL },
{ "waypoint_scripts", SEC_ADMINISTRATOR, true, &HandleReloadWpScriptsCommand, "", NULL },
+ { "waypoint_data", SEC_ADMINISTRATOR, true, &HandleReloadWpCommand, "", NULL },
{ "vehicle_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleAccessoryCommand, "", NULL },
{ "vehicle_template_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleTemplateAccessoryCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
@@ -264,6 +266,7 @@ public:
handler->SendGlobalGMSysMessage("DB tables `*_scripts` reloaded.");
HandleReloadDbScriptStringCommand(handler, "a");
HandleReloadWpScriptsCommand(handler, "a");
+ HandleReloadWpCommand(handler, "a");
return true;
}
@@ -401,113 +404,116 @@ public:
if (!*args)
return false;
- uint32 entry = (uint32) atoi((char*)args);
- QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = %u", entry);
- if (!result)
- {
- handler->PSendSysMessage(LANG_COMMAND_CREATURETEMPLATE_NOTFOUND, entry);
- handler->SetSentErrorMessage(true);
- return false;
- }
-
- CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(entry);
- if (!cInfo)
- {
- handler->PSendSysMessage(LANG_COMMAND_CREATURESTORAGE_NOTFOUND, entry);
- handler->SetSentErrorMessage(true);
- return false;
- }
+ Tokens entries(std::string(args), ' ');
- sLog->outString("Reloading creature template entry %u", entry);
-
- Field* fields = result->Fetch();
-
- const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[0] = fields[0].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[1] = fields[1].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[2] = fields[2].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->KillCredit[0] = fields[3].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->KillCredit[1] = fields[4].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->Modelid1 = fields[5].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->Modelid2 = fields[6].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->Modelid3 = fields[7].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->Modelid4 = fields[8].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->Name = fields[9].GetString();
- const_cast<CreatureTemplate*>(cInfo)->SubName = fields[10].GetString();
- const_cast<CreatureTemplate*>(cInfo)->IconName = fields[11].GetString();
- const_cast<CreatureTemplate*>(cInfo)->GossipMenuId = fields[12].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->minlevel = fields[13].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->maxlevel = fields[14].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->expansion = fields[15].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->faction_A = fields[16].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->faction_H = fields[17].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->npcflag = fields[18].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->speed_walk = fields[19].GetFloat();
- const_cast<CreatureTemplate*>(cInfo)->speed_run = fields[20].GetFloat();
- const_cast<CreatureTemplate*>(cInfo)->scale = fields[21].GetFloat();
- const_cast<CreatureTemplate*>(cInfo)->rank = fields[22].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->mindmg = fields[23].GetFloat();
- const_cast<CreatureTemplate*>(cInfo)->maxdmg = fields[24].GetFloat();
- const_cast<CreatureTemplate*>(cInfo)->dmgschool = fields[25].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->attackpower = fields[26].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->dmg_multiplier = fields[27].GetFloat();
- const_cast<CreatureTemplate*>(cInfo)->baseattacktime = fields[28].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->rangeattacktime = fields[29].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->unit_class = fields[30].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->unit_flags = fields[31].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->dynamicflags = fields[32].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->family = fields[33].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->trainer_type = fields[34].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->trainer_spell = fields[35].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->trainer_class = fields[36].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->trainer_race = fields[37].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->minrangedmg = fields[38].GetFloat();
- const_cast<CreatureTemplate*>(cInfo)->maxrangedmg = fields[39].GetFloat();
- const_cast<CreatureTemplate*>(cInfo)->rangedattackpower = fields[40].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->type = fields[41].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->type_flags = fields[42].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->lootid = fields[43].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->pickpocketLootId = fields[44].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->SkinLootId = fields[45].GetUInt32();
-
- for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
+ for (Tokens::const_iterator itr = entries.begin(); itr != entries.end(); ++itr)
{
- const_cast<CreatureTemplate*>(cInfo)->resistance[i] = fields[46 + i -1].GetUInt32();
+ uint32 entry = uint32(atoi(*itr));
+ QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = %u", entry);
+ if (!result)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_CREATURETEMPLATE_NOTFOUND, entry);
+ continue;
+ }
+
+ CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(entry);
+ if (!cInfo)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_CREATURESTORAGE_NOTFOUND, entry);
+ continue;
+ }
+
+ sLog->outString("Reloading creature template entry %u", entry);
+
+ Field* fields = result->Fetch();
+
+ const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[0] = fields[0].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[1] = fields[1].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[2] = fields[2].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->KillCredit[0] = fields[3].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->KillCredit[1] = fields[4].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->Modelid1 = fields[5].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->Modelid2 = fields[6].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->Modelid3 = fields[7].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->Modelid4 = fields[8].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->Name = fields[9].GetString();
+ const_cast<CreatureTemplate*>(cInfo)->SubName = fields[10].GetString();
+ const_cast<CreatureTemplate*>(cInfo)->IconName = fields[11].GetString();
+ const_cast<CreatureTemplate*>(cInfo)->GossipMenuId = fields[12].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->minlevel = fields[13].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->maxlevel = fields[14].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->expansion = fields[15].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->faction_A = fields[16].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->faction_H = fields[17].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->npcflag = fields[18].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->speed_walk = fields[19].GetFloat();
+ const_cast<CreatureTemplate*>(cInfo)->speed_run = fields[20].GetFloat();
+ const_cast<CreatureTemplate*>(cInfo)->scale = fields[21].GetFloat();
+ const_cast<CreatureTemplate*>(cInfo)->rank = fields[22].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->mindmg = fields[23].GetFloat();
+ const_cast<CreatureTemplate*>(cInfo)->maxdmg = fields[24].GetFloat();
+ const_cast<CreatureTemplate*>(cInfo)->dmgschool = fields[25].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->attackpower = fields[26].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->dmg_multiplier = fields[27].GetFloat();
+ const_cast<CreatureTemplate*>(cInfo)->baseattacktime = fields[28].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->rangeattacktime = fields[29].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->unit_class = fields[30].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->unit_flags = fields[31].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->dynamicflags = fields[32].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->family = fields[33].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->trainer_type = fields[34].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->trainer_spell = fields[35].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->trainer_class = fields[36].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->trainer_race = fields[37].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->minrangedmg = fields[38].GetFloat();
+ const_cast<CreatureTemplate*>(cInfo)->maxrangedmg = fields[39].GetFloat();
+ const_cast<CreatureTemplate*>(cInfo)->rangedattackpower = fields[40].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->type = fields[41].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->type_flags = fields[42].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->lootid = fields[43].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->pickpocketLootId = fields[44].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->SkinLootId = fields[45].GetUInt32();
+
+ for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
+ {
+ const_cast<CreatureTemplate*>(cInfo)->resistance[i] = fields[46 + i -1].GetUInt32();
+ }
+
+ const_cast<CreatureTemplate*>(cInfo)->spells[0] = fields[52].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->spells[1] = fields[53].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->spells[2] = fields[54].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->spells[3] = fields[55].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->spells[4] = fields[56].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->spells[5] = fields[57].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->spells[6] = fields[58].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->spells[7] = fields[59].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->PetSpellDataId = fields[60].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->VehicleId = fields[61].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->mingold = fields[62].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->maxgold = fields[63].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->AIName = fields[64].GetString();
+ const_cast<CreatureTemplate*>(cInfo)->MovementType = fields[65].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->InhabitType = fields[66].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->ModHealth = fields[67].GetFloat();
+ const_cast<CreatureTemplate*>(cInfo)->ModMana = fields[68].GetFloat();
+ const_cast<CreatureTemplate*>(cInfo)->ModArmor = fields[69].GetFloat();
+ const_cast<CreatureTemplate*>(cInfo)->RacialLeader = fields[70].GetBool();
+ const_cast<CreatureTemplate*>(cInfo)->questItems[0] = fields[71].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->questItems[1] = fields[72].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->questItems[2] = fields[73].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->questItems[3] = fields[74].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->questItems[4] = fields[75].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->questItems[5] = fields[76].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->movementId = fields[77].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->RegenHealth = fields[78].GetBool();
+ const_cast<CreatureTemplate*>(cInfo)->equipmentId = fields[79].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->MechanicImmuneMask = fields[80].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->flags_extra = fields[81].GetUInt32();
+ const_cast<CreatureTemplate*>(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[82].GetCString());
+
+ sObjectMgr->CheckCreatureTemplate(cInfo);
}
- const_cast<CreatureTemplate*>(cInfo)->spells[0] = fields[52].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->spells[1] = fields[53].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->spells[2] = fields[54].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->spells[3] = fields[55].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->spells[4] = fields[56].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->spells[5] = fields[57].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->spells[6] = fields[58].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->spells[7] = fields[59].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->PetSpellDataId = fields[60].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->VehicleId = fields[61].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->mingold = fields[62].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->maxgold = fields[63].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->AIName = fields[64].GetString();
- const_cast<CreatureTemplate*>(cInfo)->MovementType = fields[65].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->InhabitType = fields[66].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->ModHealth = fields[67].GetFloat();
- const_cast<CreatureTemplate*>(cInfo)->ModMana = fields[68].GetFloat();
- const_cast<CreatureTemplate*>(cInfo)->ModArmor = fields[69].GetFloat();
- const_cast<CreatureTemplate*>(cInfo)->RacialLeader = fields[70].GetBool();
- const_cast<CreatureTemplate*>(cInfo)->questItems[0] = fields[71].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->questItems[1] = fields[72].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->questItems[2] = fields[73].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->questItems[3] = fields[74].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->questItems[4] = fields[75].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->questItems[5] = fields[76].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->movementId = fields[77].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->RegenHealth = fields[78].GetBool();
- const_cast<CreatureTemplate*>(cInfo)->equipmentId = fields[79].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->MechanicImmuneMask = fields[80].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->flags_extra = fields[81].GetUInt32();
- const_cast<CreatureTemplate*>(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[82].GetCString());
-
- sObjectMgr->CheckCreatureTemplate(cInfo);
-
handler->SendGlobalGMSysMessage("Creature template reloaded.");
return true;
}
@@ -986,6 +992,19 @@ public:
return true;
}
+ static bool HandleReloadWpCommand(ChatHandler* handler, const char* args)
+ {
+ if (*args != 'a')
+ sLog->outString("Re-Loading Waypoints data from 'waypoints_data'");
+
+ sWaypointMgr->Load();
+
+ if (*args != 'a')
+ handler->SendGlobalGMSysMessage("DB Table 'waypoint_data' reloaded.");
+
+ return true;
+ }
+
static bool HandleReloadEventAITextsCommand(ChatHandler* handler, const char* /*args*/)
{
diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp
index ef4ddf17476..5054bd83f32 100644
--- a/src/server/scripts/Commands/cs_tele.cpp
+++ b/src/server/scripts/Commands/cs_tele.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 2fb22e0090d..f35f6baca98 100644
--- a/src/server/scripts/Commands/cs_titles.cpp
+++ b/src/server/scripts/Commands/cs_titles.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 d34ee801e50..8f5e862555c 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,8 +117,15 @@ public:
Player* player = handler->GetSession()->GetPlayer();
//Map* map = player->GetMap();
- WorldDatabase.PExecute("INSERT INTO waypoint_data (id, point, position_x, position_y, position_z) VALUES ('%u', '%u', '%f', '%f', '%f')",
- pathid, point+1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_WAYPOINT_DATA);
+
+ stmt->setUInt32(0, pathid);
+ stmt->setUInt32(1, point + 1);
+ stmt->setFloat(2, player->GetPositionX());
+ stmt->setFloat(3, player->GetPositionY());
+ stmt->setFloat(4, player->GetPositionZ());
+
+ WorldDatabase.Execute(stmt);
handler->PSendSysMessage("%s%s%u%s%u%s|r", "|cff00ff00", "PathID: |r|cff00ffff", pathid, "|r|cff00ff00: Waypoint |r|cff00ffff", point+1, "|r|cff00ff00 created. ");
return true;
@@ -136,7 +143,7 @@ public:
path_number = strtok((char*)args, " ");
uint32 pathid = 0;
- uint32 guidlow = 0;
+ uint32 guidLow = 0;
Creature* target = handler->getSelectedCreature();
// Did player provide a path_id?
@@ -165,15 +172,34 @@ public:
return true;
}
- guidlow = target->GetDBTableGUIDLow();
- QueryResult result = WorldDatabase.PQuery("SELECT guid FROM creature_addon WHERE guid = '%u'", guidlow);
+ guidLow = target->GetDBTableGUIDLow();
+ QueryResult result = WorldDatabase.PQuery("SELECT guid FROM creature_addon WHERE guid = '%u'", guidLow);
+
+ PreparedStatement* stmt;
if (result)
- WorldDatabase.PExecute("UPDATE creature_addon SET path_id = '%u' WHERE guid = '%u'", pathid, guidlow);
+ {
+ stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_ADDON_PATH);
+
+ stmt->setUInt32(0, pathid);
+ stmt->setUInt32(1, guidLow);
+ }
else
- WorldDatabase.PExecute("INSERT INTO creature_addon(guid, path_id) VALUES ('%u', '%u')", guidlow, pathid);
+ {
+ stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE_ADDON);
+
+ stmt->setUInt32(0, guidLow);
+ stmt->setUInt32(1, pathid);
+ }
+
+ WorldDatabase.Execute(stmt);
+
+ stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE);
+
+ stmt->setUInt8(0, uint8(WAYPOINT_MOTION_TYPE));
+ stmt->setUInt32(1, guidLow);
- WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE, guidlow);
+ WorldDatabase.Execute(stmt);
target->LoadPath(pathid);
target->SetDefaultMovementType(WAYPOINT_MOTION_TYPE);
@@ -208,15 +234,27 @@ public:
return true;
}
- uint32 guidlow = target->GetDBTableGUIDLow();
+ uint32 guildLow = target->GetDBTableGUIDLow();
if (target->GetCreatureAddon())
{
if (target->GetCreatureAddon()->path_id != 0)
{
- WorldDatabase.PExecute("DELETE FROM creature_addon WHERE guid = %u", guidlow);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE_ADDON);
+
+ stmt->setUInt32(0, guildLow);
+
+ WorldDatabase.Execute(stmt);
+
target->UpdateWaypointID(0);
- WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", IDLE_MOTION_TYPE, guidlow);
+
+ stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE);
+
+ stmt->setUInt8(0, uint8(IDLE_MOTION_TYPE));
+ stmt->setUInt32(1, guildLow);
+
+ WorldDatabase.Execute(stmt);
+
target->LoadPath(0);
target->SetDefaultMovementType(IDLE_MOTION_TYPE);
target->GetMotionMaster()->MoveTargetedHome();
@@ -254,7 +292,12 @@ public:
if (!result)
{
- WorldDatabase.PExecute("INSERT INTO waypoint_scripts(guid)VALUES(%u)", id);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_WAYPOINT_SCRIPT);
+
+ stmt->setUInt32(0, id);
+
+ WorldDatabase.Execute(stmt);
+
handler->PSendSysMessage("%s%s%u|r", "|cff00ff00", "Wp Event: New waypoint event added: ", id);
}
else
@@ -264,7 +307,13 @@ public:
{
QueryResult result = WorldDatabase.Query("SELECT MAX(guid) FROM waypoint_scripts");
id = result->Fetch()->GetUInt32();
- WorldDatabase.PExecute("INSERT INTO waypoint_scripts(guid)VALUES(%u)", id+1);
+
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_WAYPOINT_SCRIPT);
+
+ stmt->setUInt32(0, id + 1);
+
+ WorldDatabase.Execute(stmt);
+
handler->PSendSysMessage("%s%s%u|r", "|cff00ff00", "Wp Event: New waypoint event added: |r|cff00ffff", id+1);
}
@@ -322,7 +371,12 @@ public:
if (result)
{
- WorldDatabase.PExecute("DELETE FROM waypoint_scripts WHERE guid = %u", id);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_WAYPOINT_SCRIPT);
+
+ stmt->setUInt32(0, id);
+
+ WorldDatabase.Execute(stmt);
+
handler->PSendSysMessage("%s%s%u|r", "|cff00ff00", "Wp Event: Waypoint script removed: ", id);
}
else
@@ -379,8 +433,15 @@ public:
{
uint32 newid = atoi(arg_3);
handler->PSendSysMessage("%s%s|r|cff00ffff%u|r|cff00ff00%s|r|cff00ffff%u|r", "|cff00ff00", "Wp Event: Wypoint scipt guid: ", newid, " id changed: ", id);
- WorldDatabase.PExecute("UPDATE waypoint_scripts SET id='%u' WHERE guid='%u'",
- newid, id); return true;
+
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_SCRIPT_ID);
+
+ stmt->setUInt32(0, newid);
+ stmt->setUInt32(1, id);
+
+ WorldDatabase.Execute(stmt);
+
+ return true;
}
else
{
@@ -394,36 +455,56 @@ public:
if (arg_str_2 == "posx")
{
- WorldDatabase.PExecute("UPDATE waypoint_scripts SET x='%f' WHERE guid='%u'",
- (float)(atof(arg_3)), id);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_SCRIPT_X);
+
+ stmt->setFloat(0, float(atof(arg_3)));
+ stmt->setUInt32(1, id);
+
+ WorldDatabase.Execute(stmt);
+
handler->PSendSysMessage("|cff00ff00Waypoint script:|r|cff00ffff %u|r|cff00ff00 position_x updated.|r", id);
return true;
}
else if (arg_str_2 == "posy")
{
- WorldDatabase.PExecute("UPDATE waypoint_scripts SET y='%f' WHERE guid='%u'",
- (float)(atof(arg_3)), id);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_SCRIPT_Y);
+
+ stmt->setFloat(0, float(atof(arg_3)));
+ stmt->setUInt32(1, id);
+
+ WorldDatabase.Execute(stmt);
+
handler->PSendSysMessage("|cff00ff00Waypoint script: %u position_y updated.|r", id);
return true;
}
else if (arg_str_2 == "posz")
{
- WorldDatabase.PExecute("UPDATE waypoint_scripts SET z='%f' WHERE guid='%u'",
- (float)(atof(arg_3)), id);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_SCRIPT_Z);
+
+ stmt->setFloat(0, float(atof(arg_3)));
+ stmt->setUInt32(1, id);
+
+ WorldDatabase.Execute(stmt);
+
handler->PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 position_z updated.|r", id);
return true;
}
else if (arg_str_2 == "orientation")
{
- WorldDatabase.PExecute("UPDATE waypoint_scripts SET o='%f' WHERE guid='%u'",
- (float)(atof(arg_3)), id);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_SCRIPT_O);
+
+ stmt->setFloat(0, float(atof(arg_3)));
+ stmt->setUInt32(1, id);
+
+ WorldDatabase.Execute(stmt);
+
handler->PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 orientation updated.|r", id);
return true;
}
else if (arg_str_2 == "dataint")
{
- WorldDatabase.PExecute("UPDATE waypoint_scripts SET %s='%u' WHERE guid='%u'",
- arg_2, atoi(arg_3), id);
+ WorldDatabase.PExecute("UPDATE waypoint_scripts SET %s='%u' WHERE guid='%u'", arg_2, atoi(arg_3), id); // Query can't be a prepared statement
+
handler->PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 dataint updated.|r", id);
return true;
}
@@ -431,8 +512,7 @@ public:
{
std::string arg_str_3 = arg_3;
WorldDatabase.EscapeString(arg_str_3);
- WorldDatabase.PExecute("UPDATE waypoint_scripts SET %s='%s' WHERE guid='%u'",
- arg_2, arg_str_3.c_str(), id);
+ WorldDatabase.PExecute("UPDATE waypoint_scripts SET %s='%s' WHERE guid='%u'", arg_2, arg_str_3.c_str(), id); // Query can't be a prepared statement
}
}
handler->PSendSysMessage("%s%s|r|cff00ffff%u:|r|cff00ff00 %s %s|r", "|cff00ff00", "Waypoint script:", id, arg_2, "updated.");
@@ -540,10 +620,19 @@ public:
wpCreature->AddObjectToRemoveList();
}
- WorldDatabase.PExecute("DELETE FROM waypoint_data WHERE id='%u' AND point='%u'",
- pathid, point);
- WorldDatabase.PExecute("UPDATE waypoint_data SET point=point-1 WHERE id='%u' AND point>'%u'",
- pathid, point);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_WAYPOINT_DATA);
+
+ stmt->setUInt32(0, pathid);
+ stmt->setUInt32(1, point);
+
+ WorldDatabase.Execute(stmt);
+
+ stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_POINT);
+
+ stmt->setUInt32(0, pathid);
+ stmt->setUInt32(1, point);
+
+ WorldDatabase.Execute(stmt);
handler->PSendSysMessage(LANG_WAYPOINT_REMOVED);
return true;
@@ -588,8 +677,15 @@ public:
//sMapMgr->GetMap(npcCreature->GetMapId())->Add(wpCreature2);
}
- WorldDatabase.PExecute("UPDATE waypoint_data SET position_x = '%f', position_y = '%f', position_z = '%f' where id = '%u' AND point='%u'",
- chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), pathid, point);
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_POSITION);
+
+ stmt->setFloat(0, chr->GetPositionX());
+ stmt->setFloat(1, chr->GetPositionY());
+ stmt->setFloat(2, chr->GetPositionZ());
+ stmt->setUInt32(3, pathid);
+ stmt->setUInt32(4, point);
+
+ WorldDatabase.Execute(stmt);
handler->PSendSysMessage(LANG_WAYPOINT_CHANGED);
}
@@ -601,16 +697,14 @@ public:
if (text == 0)
{
// show_str check for present in list of correct values, no sql injection possible
- WorldDatabase.PExecute("UPDATE waypoint_data SET %s=NULL WHERE id='%u' AND point='%u'",
- show_str, pathid, point);
+ WorldDatabase.PExecute("UPDATE waypoint_data SET %s=NULL WHERE id='%u' AND point='%u'", show_str, pathid, point); // Query can't be a prepared statement
}
else
{
// show_str check for present in list of correct values, no sql injection possible
std::string text2 = text;
WorldDatabase.EscapeString(text2);
- WorldDatabase.PExecute("UPDATE waypoint_data SET %s='%s' WHERE id='%u' AND point='%u'",
- show_str, text2.c_str(), pathid, point);
+ WorldDatabase.PExecute("UPDATE waypoint_data SET %s='%s' WHERE id='%u' AND point='%u'", show_str, text2.c_str(), pathid, point); // Query can't be a prepared statement
}
handler->PSendSysMessage(LANG_WAYPOINT_CHANGED_NO, show_str);
@@ -735,7 +829,12 @@ public:
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, wpguid);
hasError = true;
- WorldDatabase.PExecute("DELETE FROM creature WHERE guid = '%u'", wpguid);
+
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
+
+ stmt->setUInt32(0, wpguid);
+
+ WorldDatabase.Execute(stmt);
}
else
{
@@ -777,8 +876,14 @@ public:
return false;
}
- // set "wpguid" column to the visual waypoint
- WorldDatabase.PExecute("UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point);
+ // Set "wpguid" column to the visual waypoint
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_WPGUID);
+
+ stmt->setInt32(0, int32(wpCreature->GetGUIDLow()));
+ stmt->setUInt32(1, pathid);
+ stmt->setUInt32(2, point);
+
+ WorldDatabase.Execute(stmt);
wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
@@ -920,7 +1025,12 @@ public:
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, guid);
hasError = true;
- WorldDatabase.PExecute("DELETE FROM creature WHERE guid = '%u'", guid);
+
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
+
+ stmt->setUInt32(0, guid);
+
+ WorldDatabase.Execute(stmt);
}
else
{
@@ -931,7 +1041,9 @@ public:
}
while (result->NextRow());
// set "wpguid" column to "empty" - no visual waypoint spawned
- WorldDatabase.PExecute("UPDATE waypoint_data SET wpguid = '0'");
+ PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_ALL_WAYPOINT_DATA_WPGUID);
+
+ WorldDatabase.Execute(stmt);
//WorldDatabase.PExecute("UPDATE creature_movement SET wpguid = '0' WHERE wpguid <> '0'");
if (hasError)
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp
index 89a58e93853..75dd99eef97 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 d66c138ebf2..1292cdaee17 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,8 +27,9 @@ enum Spells
enum Yells
{
- YELL_AGGRO = -1810023,
- YELL_EVADE = -1810024
+ YELL_AGGRO = 0,
+ YELL_EVADE = 1,
+ YELL_SALVATION = 2,
};
enum Creatures
@@ -122,7 +123,7 @@ public:
void EnterCombat(Unit* /*who*/)
{
- DoScriptText(YELL_AGGRO, me);
+ Talk(YELL_AGGRO);
}
void JustRespawned()
@@ -185,7 +186,7 @@ public:
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
- DoScriptText(YELL_EVADE, me);
+ Talk(YELL_EVADE);
}
resetTimer = 5 * IN_MILLISECONDS;
} else resetTimer -= diff;
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp
index c72014b96d7..8b2a95be977 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,14 +31,10 @@ enum Spells
enum Yells
{
- YELL_AGGRO = -1810000,
- YELL_EVADE = -1810001,
- YELL_RESPAWN = -1810002,
- YELL_RANDOM1 = -1810003,
- YELL_RANDOM2 = -1810004,
- YELL_RANDOM3 = -1810005,
- YELL_RANDOM4 = -1810006,
- YELL_RANDOM5 = -1810007
+ YELL_AGGRO = 0,
+ YELL_EVADE = 1,
+ YELL_RESPAWN = 2,
+ YELL_RANDOM = 3
};
class boss_drekthar : public CreatureScript
@@ -69,13 +65,13 @@ public:
void EnterCombat(Unit* /*who*/)
{
- DoScriptText(YELL_AGGRO, me);
+ Talk(YELL_AGGRO);
}
void JustRespawned()
{
Reset();
- DoScriptText(YELL_RESPAWN, me);
+ Talk(YELL_RESPAWN);
}
void UpdateAI(const uint32 diff)
@@ -109,7 +105,7 @@ public:
if (YellTimer <= diff)
{
- DoScriptText(RAND(YELL_RANDOM1, YELL_RANDOM2, YELL_RANDOM3, YELL_RANDOM4, YELL_RANDOM5), me);
+ Talk(YELL_RANDOM);
YellTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS); //20 to 30 seconds
} else YellTimer -= diff;
@@ -119,7 +115,7 @@ public:
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
- DoScriptText(YELL_EVADE, me);
+ Talk(YELL_EVADE);
}
ResetTimer = 5 * IN_MILLISECONDS;
} else ResetTimer -= diff;
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp
index 2b338833f4b..da53cffc99d 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,8 @@ enum Spells
enum Yells
{
- YELL_AGGRO = -1810021,
- YELL_EVADE = -1810022
+ YELL_AGGRO = 0,
+ YELL_EVADE = 1
};
class boss_galvangar : public CreatureScript
@@ -60,7 +60,7 @@ public:
void EnterCombat(Unit* /*who*/)
{
- DoScriptText(YELL_AGGRO, me);
+ Talk(YELL_AGGRO);
}
void JustRespawned()
@@ -109,7 +109,7 @@ public:
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
- DoScriptText(YELL_EVADE, me);
+ Talk(YELL_EVADE);
}
ResetTimer = 5 * IN_MILLISECONDS;
} else ResetTimer -= diff;
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp
index c933757c14a..54fcb9d99c2 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,17 +19,12 @@
enum Yells
{
- YELL_AGGRO = -1810008,
- YELL_EVADE = -1810009,
- YELL_RESPAWN1 = -1810010,
- YELL_RESPAWN2 = -1810011,
- YELL_RANDOM1 = -1810012,
- YELL_RANDOM2 = -1810013,
- YELL_RANDOM3 = -1810014,
- YELL_RANDOM4 = -1810015,
- YELL_RANDOM5 = -1810016,
- YELL_RANDOM6 = -1810017,
- YELL_RANDOM7 = -1810018
+ YELL_AGGRO = 0,
+ YELL_EVADE = 1,
+ YELL_RESPAWN1 = -1810010, // no creature_text
+ YELL_RESPAWN2 = -1810011, // no creature_text
+ YELL_RANDOM = 2,
+ YELL_SPELL = 3,
};
enum Spells
@@ -65,7 +60,7 @@ public:
void EnterCombat(Unit* /*who*/)
{
- DoScriptText(YELL_AGGRO, me);
+ Talk(YELL_AGGRO);
}
void JustRespawned()
@@ -99,7 +94,7 @@ public:
if (YellTimer <= diff)
{
- DoScriptText(RAND(YELL_RANDOM1, YELL_RANDOM2, YELL_RANDOM3, YELL_RANDOM4, YELL_RANDOM5, YELL_RANDOM6, YELL_RANDOM7), me);
+ Talk(YELL_RANDOM);
YellTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS); //20 to 30 seconds
} else YellTimer -= diff;
@@ -109,7 +104,7 @@ public:
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
- DoScriptText(YELL_EVADE, me);
+ Talk(YELL_EVADE);
}
ResetTimer = 5 * IN_MILLISECONDS;
} else ResetTimer -= diff;
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp
index 36a91ab3d51..17cf775603f 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -1238,10 +1238,10 @@ public:
me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
break;
case 2:
- me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED);
break;
case 3:
- me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED);
break;
case 4:
me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h
index 2282acaa233..b18d8720c3b 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackrockDepths/boss_ambassador_flamelash.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp
index 86bd0a0b393..2e8dc029d44 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackrockDepths/boss_anubshiah.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp
index 3d37d1885da..b4a4c416693 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp
index deda95ff454..e894fd35bd1 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackrockDepths/boss_general_angerforge.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp
index d402e70d671..69808386423 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackrockDepths/boss_gorosh_the_dervish.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp
index 1055e20bddd..883c601709e 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackrockDepths/boss_grizzle.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp
index df850a276b7..7686ece3c2e 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackrockDepths/boss_high_interrogator_gerstahn.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp
index 28e8b47f680..26e2bc80eb2 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackrockDepths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp
index 0f767f7bc23..141b8307b7b 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackrockDepths/boss_moira_bronzebeard.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp
index 6c10a4a7cce..72a60daea2d 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp
index b7b453caf60..3c8d5fc4fa8 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -117,7 +117,7 @@ public:
player->CLOSE_GOSSIP_MENU();
//start event here
creature->setFaction(FACTION_HOSTILE);
- creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
creature->AI()->AttackStart(player);
InstanceScript* instance = creature->GetInstanceScript();
if (instance)
@@ -165,7 +165,7 @@ public:
me->setFaction(FACTION_FRIEND);
// was set before event start, so set again
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
if (instance)
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp
index ae81c3bed64..2ef3ef48ecb 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -375,7 +375,7 @@ public:
if (Creature* boss = instance->GetCreature(TombBossGUIDs[TombEventCounter]))
{
boss->setFaction(FACTION_HOSTILE);
- boss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ boss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
if (Unit* target = boss->SelectNearestTarget(500))
boss->AI()->AttackStart(target);
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h
index b330e80a294..e51c6b9130d 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/BlackrockSpire/boss_drakkisath.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp
index eec118b2972..ff17e989cd9 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp
index 88b1bbc49e2..0d8cabcf89c 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -105,7 +105,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp
index 59c1ea1c9a4..a944ee6daf8 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,7 +82,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp
index 4c91f79624a..bc9de52d91d 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp
index a2314518f28..973ffe7e53b 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -77,7 +77,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp
index 28680ef5049..b7492998d56 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp
index b4d44d85dec..d76d0d7f47c 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,7 +74,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp
index bb8f45082dc..4fb7e513f5d 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp
index 762de86a82b..ce19a03571a 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -73,7 +73,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp
index fcd41f97ad0..f93466cbece 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,7 +74,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp
index f2b3f3ff87b..88a09d57138 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -73,7 +73,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp
index 40ead810600..2dc05799e51 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,7 +82,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp
index cff1c831eee..ff97984fa09 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp
index c9b5a172c65..7a4ba5777d1 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,14 +24,19 @@ SDCategory: Blackwing Lair
EndScriptData */
#include "ScriptPCH.h"
+enum Say
+{
+ SAY_AGGRO = -1469000,
+ SAY_LEASH = -1469001
+};
-#define SAY_AGGRO -1469000
-#define SAY_LEASH -1469001
-
-#define SPELL_CLEAVE 26350
-#define SPELL_BLASTWAVE 23331
-#define SPELL_MORTALSTRIKE 24573
-#define SPELL_KNOCKBACK 25778
+enum Spells
+{
+ SPELL_CLEAVE = 26350,
+ SPELL_BLASTWAVE = 23331,
+ SPELL_MORTALSTRIKE = 24573,
+ SPELL_KNOCKBACK = 25778
+};
class boss_broodlord : public CreatureScript
{
@@ -45,7 +50,7 @@ public:
struct boss_broodlordAI : public ScriptedAI
{
- boss_broodlordAI(Creature* c) : ScriptedAI(c) {}
+ boss_broodlordAI(Creature* creature) : ScriptedAI(creature) {}
uint32 Cleave_Timer;
uint32 BlastWave_Timer;
@@ -54,10 +59,10 @@ public:
void Reset()
{
- Cleave_Timer = 8000; //These times are probably wrong
- BlastWave_Timer = 12000;
- MortalStrike_Timer = 20000;
- KnockBack_Timer = 30000;
+ Cleave_Timer = 8000; // These times are probably wrong
+ BlastWave_Timer = 12000;
+ MortalStrike_Timer = 20000;
+ KnockBack_Timer = 30000;
}
void EnterCombat(Unit* /*who*/)
@@ -108,7 +113,6 @@ public:
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_broodlord()
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp
index 85d80bee062..818dcace078 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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:
struct boss_chromaggusAI : public ScriptedAI
{
- boss_chromaggusAI(Creature* c) : ScriptedAI(c)
+ boss_chromaggusAI(Creature* creature) : ScriptedAI(creature)
{
//Select the 2 breaths that we are going to use until despawned
//5 possiblities for the first breath, 4 for the second, 20 total possiblites
@@ -197,9 +197,7 @@ public:
Enraged = false;
}
- void EnterCombat(Unit* /*who*/)
- {
- }
+ void EnterCombat(Unit* /*who*/) {}
void UpdateAI(const uint32 diff)
{
@@ -297,7 +295,6 @@ public:
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_chromaggus()
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp
index 4c57c4336d9..c91e0fb3303 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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:
struct boss_ebonrocAI : public ScriptedAI
{
- boss_ebonrocAI(Creature* c) : ScriptedAI(c) {}
+ boss_ebonrocAI(Creature* creature) : ScriptedAI(creature) {}
uint32 ShadowFlame_Timer;
uint32 WingBuffet_Timer;
@@ -100,7 +100,6 @@ public:
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_ebonroc()
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp
index 9d53a7a0a95..c2a2350c0e8 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -41,7 +41,7 @@ public:
struct boss_firemawAI : public ScriptedAI
{
- boss_firemawAI(Creature* c) : ScriptedAI(c) {}
+ boss_firemawAI(Creature* creature) : ScriptedAI(creature) {}
uint32 ShadowFlame_Timer;
uint32 WingBuffet_Timer;
@@ -91,7 +91,6 @@ public:
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_firemaw()
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp
index a7c984fa536..41bcb6c5427 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,11 +25,17 @@ EndScriptData */
#include "ScriptPCH.h"
-#define EMOTE_FRENZY -1469031
+enum Emotes
+{
+ EMOTE_FRENZY = -1469031
+};
-#define SPELL_SHADOWFLAME 22539
-#define SPELL_WINGBUFFET 23339
-#define SPELL_FRENZY 23342 //This spell periodically triggers fire nova
+enum Spells
+{
+ SPELL_SHADOWFLAME = 22539,
+ SPELL_WINGBUFFET = 23339,
+ SPELL_FRENZY = 23342 //This spell periodically triggers fire nova
+};
class boss_flamegor : public CreatureScript
{
@@ -43,7 +49,7 @@ public:
struct boss_flamegorAI : public ScriptedAI
{
- boss_flamegorAI(Creature* c) : ScriptedAI(c) {}
+ boss_flamegorAI(Creature* creature) : ScriptedAI(creature) {}
uint32 ShadowFlame_Timer;
uint32 WingBuffet_Timer;
@@ -94,7 +100,6 @@ public:
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_flamegor()
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp
index 89298862688..c4e0d6ea715 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,40 +25,46 @@ EndScriptData */
#include "ScriptPCH.h"
-#define SAY_AGGRO -1469007
-#define SAY_XHEALTH -1469008
-#define SAY_SHADOWFLAME -1469009
-#define SAY_RAISE_SKELETONS -1469010
-#define SAY_SLAY -1469011
-#define SAY_DEATH -1469012
-
-#define SAY_MAGE -1469013
-#define SAY_WARRIOR -1469014
-#define SAY_DRUID -1469015
-#define SAY_PRIEST -1469016
-#define SAY_PALADIN -1469017
-#define SAY_SHAMAN -1469018
-#define SAY_WARLOCK -1469019
-#define SAY_HUNTER -1469020
-#define SAY_ROGUE -1469021
-
-#define SPELL_SHADOWFLAME_INITIAL 22972
-#define SPELL_SHADOWFLAME 22539
-#define SPELL_BELLOWINGROAR 22686
-#define SPELL_VEILOFSHADOW 7068
-#define SPELL_CLEAVE 20691
-#define SPELL_TAILLASH 23364
-#define SPELL_BONECONTRUST 23363 //23362, 23361
-
-#define SPELL_MAGE 23410 //wild magic
-#define SPELL_WARRIOR 23397 //beserk
-#define SPELL_DRUID 23398 // cat form
-#define SPELL_PRIEST 23401 // corrupted healing
-#define SPELL_PALADIN 23418 //syphon blessing
-#define SPELL_SHAMAN 23425 //totems
-#define SPELL_WARLOCK 23427 //infernals
-#define SPELL_HUNTER 23436 //bow broke
-#define SPELL_ROGUE 23414 //Paralise
+enum Say
+{
+ SAY_AGGRO = -1469007,
+ SAY_XHEALTH = -1469008,
+ SAY_SHADOWFLAME = -1469009,
+ SAY_RAISE_SKELETONS = -1469010,
+ SAY_SLAY = -1469011,
+ SAY_DEATH = -1469012,
+
+ SAY_MAGE = -1469013,
+ SAY_WARRIOR = -1469014,
+ SAY_DRUID = -1469015,
+ SAY_PRIEST = -1469016,
+ SAY_PALADIN = -1469017,
+ SAY_SHAMAN = -1469018,
+ SAY_WARLOCK = -1469019,
+ SAY_HUNTER = -1469020,
+ SAY_ROGUE = -1469021
+};
+
+enum Spells
+{
+ SPELL_SHADOWFLAME_INITIAL = 22972,
+ SPELL_SHADOWFLAME = 22539,
+ SPELL_BELLOWINGROAR = 22686,
+ SPELL_VEILOFSHADOW = 7068,
+ SPELL_CLEAVE = 20691,
+ SPELL_TAILLASH = 23364,
+ SPELL_BONECONTRUST = 23363, //23362, 23361
+
+ SPELL_MAGE = 23410, //wild magic
+ SPELL_WARRIOR = 23397, //beserk
+ SPELL_DRUID = 23398, // cat form
+ SPELL_PRIEST = 23401, // corrupted healing
+ SPELL_PALADIN = 23418, //syphon blessing
+ SPELL_SHAMAN = 23425, //totems
+ SPELL_WARLOCK = 23427, //infernals
+ SPELL_HUNTER = 23436, //bow broke
+ SPELL_ROGUE = 23414 //Paralise
+};
class boss_nefarian : public CreatureScript
{
@@ -72,7 +78,7 @@ public:
struct boss_nefarianAI : public ScriptedAI
{
- boss_nefarianAI(Creature* c) : ScriptedAI(c) {}
+ boss_nefarianAI(Creature* creature) : ScriptedAI(creature) {}
uint32 ShadowFlame_Timer;
uint32 BellowingRoar_Timer;
@@ -86,15 +92,15 @@ public:
void Reset()
{
- ShadowFlame_Timer = 12000; //These times are probably wrong
- BellowingRoar_Timer = 30000;
- VeilOfShadow_Timer = 15000;
- Cleave_Timer = 7000;
- TailLash_Timer = 10000;
- ClassCall_Timer = 35000; //35-40 seconds
+ ShadowFlame_Timer = 12000; // These times are probably wrong
+ BellowingRoar_Timer = 30000;
+ VeilOfShadow_Timer = 15000;
+ Cleave_Timer = 7000;
+ TailLash_Timer = 10000;
+ ClassCall_Timer = 35000; // 35-40 seconds
Phase3 = false;
- DespawnTimer = 5000;
+ DespawnTimer = 5000;
}
void KilledUnit(Unit* Victim)
@@ -227,7 +233,6 @@ public:
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_nefarian()
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp
index b4ccc8544a1..a4fb4ad22a3 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,15 +27,21 @@ EndScriptData */
//Razorgore Phase 2 Script
-#define SAY_EGGS_BROKEN1 -1469022
-#define SAY_EGGS_BROKEN2 -1469023
-#define SAY_EGGS_BROKEN3 -1469024
-#define SAY_DEATH -1469025
+enum Say
+{
+ SAY_EGGS_BROKEN1 = -1469022,
+ SAY_EGGS_BROKEN2 = -1469023,
+ SAY_EGGS_BROKEN3 = -1469024,
+ SAY_DEATH = -1469025
+};
-#define SPELL_CLEAVE 22540
-#define SPELL_WARSTOMP 24375
-#define SPELL_FIREBALLVOLLEY 22425
-#define SPELL_CONFLAGRATION 23023
+enum Spells
+{
+ SPELL_CLEAVE = 22540,
+ SPELL_WARSTOMP = 24375,
+ SPELL_FIREBALLVOLLEY = 22425,
+ SPELL_CONFLAGRATION = 23023
+};
class boss_razorgore : public CreatureScript
{
@@ -49,7 +55,7 @@ public:
struct boss_razorgoreAI : public ScriptedAI
{
- boss_razorgoreAI(Creature* c) : ScriptedAI(c) {}
+ boss_razorgoreAI(Creature* creature) : ScriptedAI(creature) {}
uint32 Cleave_Timer;
uint32 WarStomp_Timer;
@@ -120,7 +126,6 @@ public:
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_razorgore()
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp
index ba6bc4fa533..4a72bd0ca38 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,40 +25,46 @@ EndScriptData */
#include "ScriptPCH.h"
-#define SAY_LINE1 -1469026
-#define SAY_LINE2 -1469027
-#define SAY_LINE3 -1469028
-#define SAY_HALFLIFE -1469029
-#define SAY_KILLTARGET -1469030
+enum Says
+{
+ SAY_LINE1 = -1469026,
+ SAY_LINE2 = -1469027,
+ SAY_LINE3 = -1469028,
+ SAY_HALFLIFE = -1469029,
+ SAY_KILLTARGET = -1469030
+};
#define GOSSIP_ITEM "Start Event <Needs Gossip Text>"
-#define SPELL_ESSENCEOFTHERED 23513
-#define SPELL_FLAMEBREATH 23461
-#define SPELL_FIRENOVA 23462
-#define SPELL_TAILSWIPE 15847
-#define SPELL_BURNINGADRENALINE 23620
-#define SPELL_CLEAVE 20684 //Chain cleave is most likely named something different and contains a dummy effect
+enum Spells
+{
+ SPELL_ESSENCEOFTHERED = 23513,
+ SPELL_FLAMEBREATH = 23461,
+ SPELL_FIRENOVA = 23462,
+ SPELL_TAILSWIPE = 15847,
+ SPELL_BURNINGADRENALINE = 23620,
+ SPELL_CLEAVE = 20684 //Chain cleave is most likely named something different and contains a dummy effect
+};
class boss_vaelastrasz : public CreatureScript
{
public:
boss_vaelastrasz() : CreatureScript("boss_vaelastrasz") { }
- void SendDefaultMenu(Player* player, Creature* creature, uint32 uiAction)
+ void SendDefaultMenu(Player* player, Creature* creature, uint32 Action)
{
- if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
+ if (Action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
{
player->CLOSE_GOSSIP_MENU();
CAST_AI(boss_vaelastrasz::boss_vaelAI, creature->AI())->BeginSpeech(player);
}
}
- bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction)
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 Action)
{
player->PlayerTalkClass->ClearMenus();
- if (uiSender == GOSSIP_SENDER_MAIN)
- SendDefaultMenu(player, creature, uiAction);
+ if (Sender == GOSSIP_SENDER_MAIN)
+ SendDefaultMenu(player, creature, Action);
return true;
}
@@ -81,11 +87,11 @@ public:
struct boss_vaelAI : public ScriptedAI
{
- boss_vaelAI(Creature* c) : ScriptedAI(c)
+ boss_vaelAI(Creature* creature) : ScriptedAI(creature)
{
- c->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- c->setFaction(35);
- c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ creature->setFaction(35);
+ creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
uint64 PlayerGUID;
@@ -102,17 +108,17 @@ public:
void Reset()
{
- PlayerGUID = 0;
- SpeechTimer = 0;
- SpeechNum = 0;
- Cleave_Timer = 8000; //These times are probably wrong
- FlameBreath_Timer = 11000;
- BurningAdrenalineCaster_Timer = 15000;
- BurningAdrenalineTank_Timer = 45000;
- FireNova_Timer = 5000;
- TailSwipe_Timer = 20000;
- HasYelled = false;
- DoingSpeech = false;
+ PlayerGUID = 0;
+ SpeechTimer = 0;
+ SpeechNum = 0;
+ Cleave_Timer = 8000; //These times are probably wrong
+ FlameBreath_Timer = 11000;
+ BurningAdrenalineCaster_Timer = 15000;
+ BurningAdrenalineTank_Timer = 45000;
+ FireNova_Timer = 5000;
+ TailSwipe_Timer = 20000;
+ HasYelled = false;
+ DoingSpeech = false;
}
void BeginSpeech(Unit* target)
@@ -213,7 +219,7 @@ public:
Unit* target = NULL;
uint8 i = 0;
- while (i < 3) // max 3 tries to get a random target with power_mana
+ while (i < 3) // max 3 tries to get a random target with power_mana
{
++i;
target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); //not aggro leader
@@ -258,7 +264,6 @@ public:
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_vael()
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp
index 13574a71b8b..2c7cd73c604 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,40 +25,49 @@ EndScriptData */
#include "ScriptPCH.h"
-#define SAY_GAMESBEGIN_1 -1469004
-#define SAY_GAMESBEGIN_2 -1469005
-#define SAY_VAEL_INTRO -1469006 //when he corrupts Vaelastrasz
+enum Says
+{
+ SAY_GAMESBEGIN_1 = -1469004,
+ SAY_GAMESBEGIN_2 = -1469005,
+ SAY_VAEL_INTRO = -1469006 //when he corrupts Vaelastrasz
+};
#define GOSSIP_ITEM_1 "I've made no mistakes."
#define GOSSIP_ITEM_2 "You have lost your mind, Nefarius. You speak in riddles."
#define GOSSIP_ITEM_3 "Please do."
-#define CREATURE_BRONZE_DRAKANOID 14263
-#define CREATURE_BLUE_DRAKANOID 14261
-#define CREATURE_RED_DRAKANOID 14264
-#define CREATURE_GREEN_DRAKANOID 14262
-#define CREATURE_BLACK_DRAKANOID 14265
-
-#define CREATURE_CHROMATIC_DRAKANOID 14302
-#define CREATURE_NEFARIAN 11583
+enum Creatures
+{
+ CREATURE_BRONZE_DRAKANOID = 14263,
+ CREATURE_BLUE_DRAKANOID = 14261,
+ CREATURE_RED_DRAKANOID = 14264,
+ CREATURE_GREEN_DRAKANOID = 14262,
+ CREATURE_BLACK_DRAKANOID = 14265,
+
+ CREATURE_CHROMATIC_DRAKANOID = 14302,
+ CREATURE_NEFARIAN = 11583
+};
-#define ADD_X1 -7591.151855f
-#define ADD_X2 -7514.598633f
-#define ADD_Y1 -1204.051880f
-#define ADD_Y2 -1150.448853f
-#define ADD_Z1 476.800476f
-#define ADD_Z2 476.796570f
+#define ADD_X1 -7591.151855f
+#define ADD_X2 -7514.598633f
+#define ADD_Y1 -1204.051880f
+#define ADD_Y2 -1150.448853f
+#define ADD_Z1 476.800476f
+#define ADD_Z2 476.796570f
-#define NEF_X -7445
-#define NEF_Y -1332
-#define NEF_Z 536
+#define NEF_X -7445
+#define NEF_Y -1332
+#define NEF_Z 536
-#define HIDE_X -7592
-#define HIDE_Y -1264
-#define HIDE_Z 481
+#define HIDE_X -7592
+#define HIDE_Y -1264
+#define HIDE_Z 481
-#define SPELL_SHADOWBOLT 21077
-#define SPELL_FEAR 26070
+enum Spells
+{
+ SPELL_SHADOWBOLT = 21077,
+ SPELL_FEAR = 26070
+};
//This script is complicated
//Instead of morphing Victor Nefarius we will have him control phase 1
@@ -74,10 +83,10 @@ class boss_victor_nefarius : public CreatureScript
public:
boss_victor_nefarius() : CreatureScript("boss_victor_nefarius") { }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 Action)
{
player->PlayerTalkClass->ClearMenus();
- switch (uiAction)
+ switch (Action)
{
case GOSSIP_ACTION_INFO_DEF+1:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
@@ -110,7 +119,7 @@ public:
struct boss_victor_nefariusAI : public ScriptedAI
{
- boss_victor_nefariusAI(Creature* c) : ScriptedAI(c)
+ boss_victor_nefariusAI(Creature* creature) : ScriptedAI(creature)
{
NefarianGUID = 0;
switch (urand(0, 19))
@@ -211,13 +220,13 @@ public:
void Reset()
{
- SpawnedAdds = 0;
- AddSpawnTimer = 10000;
- ShadowBoltTimer = 5000;
- FearTimer = 8000;
- ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier
- NefarianGUID = 0;
- NefCheckTime = 2000;
+ SpawnedAdds = 0;
+ AddSpawnTimer = 10000;
+ ShadowBoltTimer = 5000;
+ FearTimer = 8000;
+ ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier
+ NefarianGUID = 0;
+ NefCheckTime = 2000;
me->SetUInt32Value(UNIT_NPC_FLAGS, 1);
me->setFaction(35);
@@ -342,7 +351,7 @@ public:
//Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues)
DoTeleportTo(HIDE_X, HIDE_Y, HIDE_Z);
- me->AddUnitState(UNIT_STAT_FLEEING);
+ me->AddUnitState(UNIT_STATE_FLEEING);
//Spawn nef and have him attack a random target
Creature* Nefarian = me->SummonCreature(CREATURE_NEFARIAN, NEF_X, NEF_Y, NEF_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
@@ -378,7 +387,6 @@ public:
}
}
};
-
};
void AddSC_boss_victor_nefarius()
diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp
index 7e50b507262..8a9b930aa09 100644
--- a/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,4 +24,3 @@ SDCategory: Blackwing Lair
EndScriptData */
#include "ScriptPCH.h"
-
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
index cef44bb446a..9830563ac87 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
index 13e2832bfde..fffd8d41264 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 627b0b703f8..55726fb2a8e 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
+++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 ae0042dcfa5..76bdfe753c6 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
index 1cbe48ae5da..cd5566007ee 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/gnomeregan.h b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h
index 495ac216612..a62cf9f9cae 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 cf9a3ffc9c1..0bbe787827b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 423b73eed49..b1fa4d54eb6 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 8db9221c764..66de84abbc2 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 e804d2b2b61..65b758b55e7 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
index fc2860dad5a..484515be0f8 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp
index aa0fee873e1..c1fe9c9c56c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
index 63ca3e32e6e..728446aa833 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -186,7 +186,7 @@ public:
void MovementInform(uint32 type, uint32 id)
{
if (type != POINT_MOTION_TYPE)
- return;
+ return;
if (Intro)
{
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
index 5f8a9ad6f1c..14add92fd16 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -393,7 +393,7 @@ public:
EnfeebleResetTimer = 0;
} else EnfeebleResetTimer -= diff;
- if (me->HasUnitState(UNIT_STAT_STUNNED)) // While shifting to phase 2 malchezaar stuns himself
+ if (me->HasUnitState(UNIT_STATE_STUNNED)) // While shifting to phase 2 malchezaar stuns himself
return;
if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->getVictim()->GetGUID())
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 f97fc49eb7c..119cb7d9de6 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
index ea7e3113246..15750c5b9c5 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
index 389f0d0a959..b15cb7d3da1 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -655,7 +655,7 @@ public:
{
DoScriptText(RAND(SAY_CRONE_AGGRO, SAY_CRONE_AGGRO2), me);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
}
void JustDied(Unit* /*killer*/)
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp
index 3dd37fc66c7..8e86024f4d8 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 6a9831655a9..056a2e95448 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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.h b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h
index e9d37958944..08b9a729596 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h
+++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 c64fc6f2dab..94c894f7e47 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
index bf58d6f2853..b9d4f600329 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp
index 93b0b45a3e3..fa97e4eefc0 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
index 906bbe6f528..5f3716d9dea 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp
index 69d8ecbae62..642f7955b2e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 b47e9cd1666..679db023b63 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 105c975122d..dcea4424bf5 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/MoltenCore/boss_baron_geddon.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp
index 72f89c4f47d..f792b861c99 100644
--- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp
+++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 @@ class boss_baron_geddon : public CreatureScript
return;
}
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp
index 028362f2199..a9d32ebca9a 100644
--- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp
+++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 @@ class boss_garr : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp
index 92b0e370f9f..7261bbf1fbd 100644
--- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp
+++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 @@ class boss_gehennas : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp
index 47f192bc55c..84e9957a60c 100644
--- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp
+++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 @@ class boss_golemagg : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp
index 54bb5bc7880..e3e04002112 100644
--- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp
+++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 @@ class boss_lucifron : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp
index ebc6bcec24f..65a630a58f7 100644
--- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp
+++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 @@ class boss_magmadar : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp
index e716e4a7361..862a980394a 100644
--- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp
+++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 @@ class boss_majordomo : public CreatureScript
return;
}
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if (HealthBelowPct(50))
diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp
index 4bc3da16651..47d50925d56 100644
--- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp
+++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/MoltenCore/boss_shazzrah.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp
index 8928dca0750..f696ec58e1b 100644
--- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp
+++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -73,7 +73,7 @@ class boss_shazzrah : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp
index 9126df968e2..9f511c1394a 100644
--- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp
+++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 @@ class boss_sulfuron : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -169,7 +169,7 @@ class mob_flamewaker_priest : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp
index 3c7ec790f40..f6a6e647a1d 100644
--- a/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp
+++ b/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/MoltenCore/molten_core.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp
index 871cef96316..801a11fbfc8 100644
--- a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp
+++ b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,16 +30,19 @@ EndContentData */
#include "ScriptPCH.h"
#include "ScriptedSimpleAI.h"
-#define SPELL_CONE_OF_FIRE 19630
-#define SPELL_BITE 19771
+enum Spells
+{
+ SPELL_CONE_OF_FIRE = 19630,
+ SPELL_BITE = 19771,
-//Random Debuff (each hound has only one of these)
-#define SPELL_GROUND_STOMP 19364
-#define SPELL_ANCIENT_DREAD 19365
-#define SPELL_CAUTERIZING_FLAMES 19366
-#define SPELL_WITHERING_HEAT 19367
-#define SPELL_ANCIENT_DESPAIR 19369
-#define SPELL_ANCIENT_HYSTERIA 19372
+ //Random Debuff (each hound has only one of these)
+ SPELL_GROUND_STOMP = 19364,
+ SPELL_ANCIENT_DREAD = 19365,
+ SPELL_CAUTERIZING_FLAMES = 19366,
+ SPELL_WITHERING_HEAT = 19367,
+ SPELL_ANCIENT_DESPAIR = 19369,
+ SPELL_ANCIENT_HYSTERIA = 19372
+};
class mob_ancient_core_hound : public CreatureScript
{
@@ -75,7 +78,6 @@ public:
return ai;
}
-
};
void AddSC_molten_core()
diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h
index 7bbae236f52..99dd74fb5fe 100644
--- a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h
+++ b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 395f4f3ace4..a2c8a890feb 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -125,7 +125,7 @@ public:
phase = PHASE_CHAINED;
events.Reset();
me->setFaction(7);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8);
me->LoadEquipment(0, true);
}
@@ -230,7 +230,7 @@ public:
else
{
me->setFaction(14);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
phase = PHASE_ATTACKING;
if (Player* target = Unit::GetPlayer(*me, playerGUID))
@@ -378,7 +378,7 @@ public:
return true;
}
- creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15);
int32 uiSayId = rand()% (sizeof(m_auiRandomSay)/sizeof(int32));
@@ -877,7 +877,7 @@ public:
{
npc_scarlet_miner_cartAI(Creature* c) : PassiveAI(c), minerGUID(0)
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetDisplayId(me->GetCreatureInfo()->Modelid1); // Modelid2 is a horse.
}
@@ -1009,7 +1009,7 @@ public:
me->SetInFront(car);
me->SendMovementFlagUpdate();
car->Relocate(car->GetPositionX(), car->GetPositionY(), me->GetPositionZ() + 1);
- car->SendMonsterStop();
+ car->StopMoving();
car->RemoveAura(SPELL_CART_DRAG);
}
me->MonsterSay(SAY_SCARLET_MINER2, LANG_UNIVERSAL, 0);
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
index 6d316eff94f..4583a33a196 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -264,7 +264,7 @@ public:
m_uiValrothGUID = summoned->GetGUID();
summoned->AddThreat(me, 0.0f);
- summoned->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ summoned->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
}
void SummonAcolyte(uint32 uiAmount)
@@ -605,7 +605,7 @@ public:
ExecuteSpeech_Counter = 0;
PlayerGUID = 0;
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
}
bool MeetQuestCondition(Unit* player)
@@ -702,7 +702,7 @@ public:
case 9:
DoScriptText(SAY_EXEC_TIME_6, me, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break;
case 11:
@@ -730,7 +730,7 @@ public:
case 9:
DoScriptText(SAY_EXEC_TIME_8, me, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break;
case 11:
@@ -758,7 +758,7 @@ public:
case 9:
DoScriptText(SAY_EXEC_TIME_3, me, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break;
case 11:
@@ -786,7 +786,7 @@ public:
case 9:
DoScriptText(SAY_EXEC_TIME_7, me, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break;
case 11:
@@ -814,7 +814,7 @@ public:
case 9:
DoScriptText(SAY_EXEC_TIME_4, me, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break;
case 11:
@@ -842,7 +842,7 @@ public:
case 9:
DoScriptText(SAY_EXEC_TIME_9, me, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break;
case 11:
@@ -870,7 +870,7 @@ public:
case 9:
DoScriptText(SAY_EXEC_TIME_5, me, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break;
case 11:
@@ -898,7 +898,7 @@ public:
case 9:
DoScriptText(SAY_EXEC_TIME_10, me, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break;
case 11:
@@ -926,7 +926,7 @@ public:
case 9:
DoScriptText(SAY_EXEC_TIME_1, me, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break;
case 11:
@@ -954,7 +954,7 @@ public:
case 9:
DoScriptText(SAY_EXEC_TIME_2, me, player);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break;
case 11:
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
index 5b89651f2b0..81c4b1261ef 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp
index a6bb95995be..9512d66b6eb 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -91,7 +91,7 @@ public:
case 2:
if (!player->isRessurectRequested())
{
- me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_01);
DoCast(player, SPELL_REVIVE, true);
me->MonsterWhisper(VALK_WHISPER, player->GetGUID());
}
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp
index 25295e62ff3..e5886cc39d4 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,7 +49,7 @@ public:
struct boss_arcanist_doanAI : public ScriptedAI
{
- boss_arcanist_doanAI(Creature* c) : ScriptedAI(c) {}
+ boss_arcanist_doanAI(Creature* creature) : ScriptedAI(creature) {}
uint32 Polymorph_Timer;
uint32 AoESilence_Timer;
@@ -105,26 +105,28 @@ public:
DoCast(target, SPELL_POLYMORPH);
Polymorph_Timer = 20000;
- } else Polymorph_Timer -= diff;
+ }
+ else Polymorph_Timer -= diff;
//AoESilence_Timer
if (AoESilence_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_AOESILENCE);
AoESilence_Timer = urand(15000, 20000);
- } else AoESilence_Timer -= diff;
+ }
+ else AoESilence_Timer -= diff;
//ArcaneExplosion_Timer
if (ArcaneExplosion_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION);
ArcaneExplosion_Timer = 8000;
- } else ArcaneExplosion_Timer -= diff;
+ }
+ else ArcaneExplosion_Timer -= diff;
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_arcanist_doan()
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 83a5b5808f4..30105cc7315 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,12 @@ EndScriptData */
#include "ScriptPCH.h"
-#define SPELL_CALLOFTHEGRAVE 17831
-#define SPELL_TERRIFY 7399
-#define SPELL_SOULSIPHON 7290
+enum Spells
+{
+ SPELL_CALLOFTHEGRAVE = 17831,
+ SPELL_TERRIFY = 7399,
+ SPELL_SOULSIPHON = 7290
+};
class boss_azshir_the_sleepless : public CreatureScript
{
@@ -41,7 +44,7 @@ public:
struct boss_azshir_the_sleeplessAI : public ScriptedAI
{
- boss_azshir_the_sleeplessAI(Creature* c) : ScriptedAI(c) {}
+ boss_azshir_the_sleeplessAI(Creature* creature) : ScriptedAI(creature) {}
uint32 SoulSiphon_Timer;
uint32 CallOftheGrave_Timer;
@@ -54,9 +57,7 @@ public:
Terrify_Timer = 20000;
}
- void EnterCombat(Unit* /*who*/)
- {
- }
+ void EnterCombat(Unit* /*who*/) {}
void UpdateAI(const uint32 diff)
{
@@ -73,7 +74,8 @@ public:
return;
//SoulSiphon_Timer = 20000;
- } else SoulSiphon_Timer -= diff;
+ }
+ else SoulSiphon_Timer -= diff;
}
//CallOfTheGrave_Timer
@@ -81,19 +83,20 @@ public:
{
DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE);
CallOftheGrave_Timer = 30000;
- } else CallOftheGrave_Timer -= diff;
+ }
+ else CallOftheGrave_Timer -= diff;
//Terrify_Timer
if (Terrify_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_TERRIFY);
Terrify_Timer = 20000;
- } else Terrify_Timer -= diff;
+ }
+ else Terrify_Timer -= diff;
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_azshir_the_sleepless()
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp
index 733b3a91f93..466f940621d 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,7 +49,7 @@ public:
struct boss_bloodmage_thalnosAI : public ScriptedAI
{
- boss_bloodmage_thalnosAI(Creature* c) : ScriptedAI(c) {}
+ boss_bloodmage_thalnosAI(Creature* creature) : ScriptedAI(creature) {}
bool HpYell;
uint32 FlameShock_Timer;
@@ -93,33 +93,36 @@ public:
{
DoCast(me->getVictim(), SPELL_FLAMESHOCK);
FlameShock_Timer = urand(10000, 15000);
- } else FlameShock_Timer -= diff;
+ }
+ else FlameShock_Timer -= diff;
//FlameSpike_Timer
if (FlameSpike_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_FLAMESPIKE);
FlameSpike_Timer = 30000;
- } else FlameSpike_Timer -= diff;
+ }
+ else FlameSpike_Timer -= diff;
//FireNova_Timer
if (FireNova_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_FIRENOVA);
FireNova_Timer = 40000;
- } else FireNova_Timer -= diff;
+ }
+ else FireNova_Timer -= diff;
//ShadowBolt_Timer
if (ShadowBolt_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SHADOWBOLT);
ShadowBolt_Timer = 2000;
- } else ShadowBolt_Timer -= diff;
+ }
+ else ShadowBolt_Timer -= diff;
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_bloodmage_thalnos()
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
index c9ab9084d22..77099f2e2d7 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,66 @@ EndScriptData */
#include "scarlet_monastery.h"
//this texts are already used by 3975 and 3976
-#define SAY_ENTRANCE -1189001
-#define SAY_REJOINED -1189002
-#define SAY_LOST_HEAD -1189003
-#define SAY_CONFLAGRATION -1189004
-#define SAY_SPROUTING_PUMPKINS -1189005
-#define SAY_PLAYER_DEATH -1189006
-#define SAY_DEATH -1189007
+enum Says
+{
+ SAY_ENTRANCE = -1189001,
+ SAY_REJOINED = -1189002,
+ SAY_LOST_HEAD = -1189003,
+ SAY_CONFLAGRATION = -1189004,
+ SAY_SPROUTING_PUMPKINS = -1189005,
+ SAY_PLAYER_DEATH = -1189006,
+ SAY_DEATH = -1189007
+};
uint32 RandomLaugh[] = {11965, 11975, 11976};
- // Entryes
-#define HH_MOUNTED 23682
-#define HH_UNHORSED 23800
-#define HEAD 23775
-#define PULSING_PUMPKIN 23694
-#define PUMPKIN_FIEND 23545
-#define HELPER 23686
-#define WISP_INVIS 24034
-
- //Spells
-#define SPELL_CLEAVE 42587
-#define SPELL_CONFLAGRATION 42380 //Phase 2, can't find real spell(Dim Fire?)
-//#define SPELL_CONFL_SPEED 22587 //8% increase speed, value 22587 from SPELL_CONFLAGRATION mains that spell?
-#define SPELL_SUMMON_PUMPKIN 42394
-
-#define SPELL_WHIRLWIND 43116
-#define SPELL_IMMUNE 42556
-#define SPELL_BODY_REGEN 42403
-#define SPELL_CONFUSE 43105
-
-#define SPELL_FLYING_HEAD 42399 //visual flying head
-#define SPELL_HEAD 42413 //visual buff, "head"
-#define SPELL_HEAD_IS_DEAD 42428 //at killing head, Phase 3
-
-#define SPELL_PUMPKIN_AURA 42280
-#define SPELL_PUMPKIN_AURA_GREEN 42294
-#define SPELL_SQUASH_SOUL 42514
-#define SPELL_SPROUTING 42281
-#define SPELL_SPROUT_BODY 42285
+enum Entry
+{
+ HH_MOUNTED = 23682,
+ HH_DISMOUNTED = 23800, // unhorsed?? wtf type of engrish was that?
+ HEAD = 23775,
+ PULSING_PUMPKIN = 23694,
+ PUMPKIN_FIEND = 23545,
+ HELPER = 23686,
+ WISP_INVIS = 24034
+};
+
+enum Spells
+{
+ SPELL_CLEAVE = 42587,
+ SPELL_CONFLAGRATION = 42380, //Phase 2, can't find real spell(Dim Fire?)
+ // SPELL_CONFL_SPEED = 22587, //8% increase speed, value 22587 from SPELL_CONFLAGRATION mains that spell?
+ SPELL_SUMMON_PUMPKIN = 42394,
+
+ SPELL_WHIRLWIND = 43116,
+ SPELL_IMMUNE = 42556,
+ SPELL_BODY_REGEN = 42403,
+ SPELL_CONFUSE = 43105,
+
+ SPELL_FLYING_HEAD = 42399, //visual flying head
+ SPELL_HEAD = 42413, //visual buff, "head"
+ SPELL_HEAD_IS_DEAD = 42428, //at killing head, Phase 3
+
+ SPELL_PUMPKIN_AURA = 42280,
+ SPELL_PUMPKIN_AURA_GREEN = 42294,
+ SPELL_SQUASH_SOUL = 42514,
+ SPELL_SPROUTING = 42281,
+ SPELL_SPROUT_BODY = 42285,
//Effects
-#define SPELL_RHYME_BIG 42909
-//#define SPELL_RHYME_SMALL 42910
-#define SPELL_HEAD_SPEAKS 43129
-#define SPELL_HEAD_LANDS 42400
-#define SPELL_BODY_FLAME 42074
-#define SPELL_HEAD_FLAME 42971
-//#define SPELL_ENRAGE_VISUAL 42438 // he uses this spell?
-#define SPELL_WISP_BLUE 42821
-#define SPELL_WISP_FLIGHT_PORT 42818
-//#define SPELL_WISP_INVIS 42823
-#define SPELL_SMOKE 42355
-#define SPELL_DEATH 42566 //not correct spell
+ SPELL_RHYME_BIG = 42909,
+ // SPELL_RHYME_SMALL = 42910,
+ SPELL_HEAD_SPEAKS = 43129,
+ SPELL_HEAD_LANDS = 42400,
+ SPELL_BODY_FLAME = 42074,
+ SPELL_HEAD_FLAME = 42971,
+ // SPELL_ENRAGE_VISUAL = 42438, // he uses this spell?
+ SPELL_WISP_BLUE = 42821,
+ SPELL_WISP_FLIGHT_PORT = 42818,
+ // SPELL_WISP_INVIS = 42823,
+ SPELL_SMOKE = 42355,
+ SPELL_DEATH = 42566 //not correct spell
+};
struct Locations
{
@@ -114,7 +121,7 @@ static Locations FlightPoint[]=
static Locations Spawn[]=
{
- {1776.27f, 1348.74f, 19.20f}, //spawn point for pumpkin shrine mob
+ {1776.27f, 1348.74f, 19.20f}, //spawn point for pumpkin shrine mob
{1765.28f, 1347.46f, 17.55f} //spawn point for smoke
};
@@ -126,7 +133,7 @@ static const char* Text[]=
"Now, know demise!"
};
-#define EMOTE_LAUGHS "Headless Horseman laughs"
+#define EMOTE_LAUGHS "Headless Horseman laughs" // needs assigned to db.
class mob_wisp_invis : public CreatureScript
{
@@ -140,7 +147,7 @@ public:
struct mob_wisp_invisAI : public ScriptedAI
{
- mob_wisp_invisAI(Creature* c) : ScriptedAI(c)
+ mob_wisp_invisAI(Creature* creature) : ScriptedAI(creature)
{
Creaturetype = delay = spell = spell2 = 0;
}
@@ -149,8 +156,8 @@ public:
uint32 delay;
uint32 spell;
uint32 spell2;
- void Reset(){}
- void EnterCombat(Unit* /*who*/){}
+ void Reset() {}
+ void EnterCombat(Unit* /*who*/) {}
void SetType(uint32 _type)
{
switch (Creaturetype = _type)
@@ -205,7 +212,6 @@ public:
}
}
};
-
};
class mob_head : public CreatureScript
@@ -220,7 +226,7 @@ public:
struct mob_headAI : public ScriptedAI
{
- mob_headAI(Creature* c) : ScriptedAI(c) {}
+ mob_headAI(Creature* creature) : ScriptedAI(creature) {}
uint64 bodyGUID;
@@ -316,7 +322,8 @@ public:
if (!me->getVictim()) return;
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveFleeing(me->getVictim());
- } else wait -= diff;
+ }
+ else wait -= diff;
if (laugh <= diff)
{
@@ -327,7 +334,8 @@ public:
if (speaker)
speaker->CastSpell(speaker, SPELL_HEAD_SPEAKS, false);
me->MonsterTextEmote(EMOTE_LAUGHS, 0);
- } else laugh -= diff;
+ }
+ else laugh -= diff;
}
else
{
@@ -339,12 +347,12 @@ public:
if (Unit* body = Unit::GetUnit((*me), bodyGUID))
body->Kill(body);
me->Kill(me);
- } else wait -= diff;
+ }
+ else wait -= diff;
}
}
}
};
-
};
class boss_headless_horseman : public CreatureScript
@@ -359,9 +367,9 @@ public:
struct boss_headless_horsemanAI : public ScriptedAI
{
- boss_headless_horsemanAI(Creature* c) : ScriptedAI(c)
+ boss_headless_horsemanAI(Creature* creature) : ScriptedAI(creature)
{
- instance = c->GetInstanceScript();
+ instance = creature->GetInstanceScript();
}
InstanceScript* instance;
@@ -636,7 +644,8 @@ public:
break;
}
++count;
- } else say_timer -= diff;
+ }
+ else say_timer -= diff;
}
else
{
@@ -657,7 +666,8 @@ public:
if (Creature* flame = me->SummonCreature(HELPER, Spawn[0].x, Spawn[0].y, Spawn[0].z, 0, TEMPSUMMON_TIMED_DESPAWN, 17000))
CAST_AI(mob_wisp_invis::mob_wisp_invisAI, flame->AI())->SetType(2);
burned = true;
- } else burn -= diff;
+ }
+ else burn -= diff;
break;
case 2:
if (conflagrate <= diff)
@@ -665,7 +675,8 @@ public:
if (Unit* player = SelectRandomPlayer(30.0f))
DoCast(player, SPELL_CONFLAGRATION, false);
conflagrate = urand(10000, 16000);
- } else conflagrate -= diff;
+ }
+ else conflagrate -= diff;
break;
case 3:
if (summonadds <= diff)
@@ -674,7 +685,8 @@ public:
DoCast(me, SPELL_SUMMON_PUMPKIN);
SaySound(SAY_SPROUTING_PUMPKINS);
summonadds = urand(25000, 35000);
- } else summonadds -= diff;
+ }
+ else summonadds -= diff;
break;
}
@@ -683,7 +695,8 @@ public:
laugh = urand(11000, 22000);
me->MonsterTextEmote(EMOTE_LAUGHS, 0);
DoPlaySoundToSet(me, RandomLaugh[rand()%3]);
- } else laugh -= diff;
+ }
+ else laugh -= diff;
if (UpdateVictim())
{
@@ -692,7 +705,8 @@ public:
{
DoCast(me->getVictim(), SPELL_CLEAVE);
cleave = urand(2000, 6000); //1 cleave per 2.0f-6.0fsec
- } else cleave -= diff;
+ }
+ else cleave -= diff;
}
}
else
@@ -725,13 +739,14 @@ public:
me->RemoveAurasDueToSpell(SPELL_CONFUSE);
DoCast(me, SPELL_WHIRLWIND, true);
DoCast(me, SPELL_CONFUSE);
- } else
+ }
+ else
me->RemoveAurasDueToSpell(SPELL_WHIRLWIND);
- } else whirlwind -= diff;
+ }
+ else whirlwind -= diff;
}
}
};
-
};
class mob_pulsing_pumpkin : public CreatureScript
@@ -746,7 +761,7 @@ public:
struct mob_pulsing_pumpkinAI : public ScriptedAI
{
- mob_pulsing_pumpkinAI(Creature* c) : ScriptedAI(c) {}
+ mob_pulsing_pumpkinAI(Creature* creature) : ScriptedAI(creature) {}
bool sprouted;
uint64 debuffGUID;
@@ -771,7 +786,7 @@ public:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
}
- void EnterCombat(Unit* /*who*/){}
+ void EnterCombat(Unit* /*who*/) {}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
{
@@ -813,7 +828,6 @@ public:
DoMeleeAttackIfReady();
}
};
-
};
class go_loosely_turned_soil : public GameObjectScript
@@ -846,13 +860,13 @@ public:
//}
return true;
}
-
};
void mob_head::mob_headAI::Disappear()
{
if (withbody)
return;
+
if (bodyGUID)
{
Creature* body = Unit::GetCreature((*me), bodyGUID);
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp
index bb2fea6a1a7..16b90f89bb5 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -26,19 +26,32 @@ EndScriptData */
#include "ScriptPCH.h"
#include "ScriptedEscortAI.h"
-#define SAY_AGGRO -1189000
-#define SAY_WHIRLWIND -1189001
-#define SAY_ENRAGE -1189002
-#define SAY_KILL -1189003
-#define EMOTE_ENRAGE -1189004
+enum Says
+{
+ SAY_AGGRO = -1189000,
+ SAY_WHIRLWIND = -1189001,
+ SAY_ENRAGE = -1189002,
+ SAY_KILL = -1189003
+};
-#define SPELL_RUSHINGCHARGE 8260
-#define SPELL_CLEAVE 15496
-#define SPELL_WHIRLWIND 8989
-#define SPELL_FRENZY 8269
+enum Emotes
+{
+ EMOTE_ENRAGE = -1189004
+};
-#define ENTRY_SCARLET_TRAINEE 6575
-#define ENTRY_SCARLET_MYRMIDON 4295
+enum Spells
+{
+ SPELL_RUSHINGCHARGE = 8260,
+ SPELL_CLEAVE = 15496,
+ SPELL_WHIRLWIND = 8989,
+ SPELL_FRENZY = 8269
+};
+
+enum Entry
+{
+ ENTRY_SCARLET_TRAINEE = 6575,
+ ENTRY_SCARLET_MYRMIDON = 4295
+};
class boss_herod : public CreatureScript
{
@@ -52,7 +65,7 @@ public:
struct boss_herodAI : public ScriptedAI
{
- boss_herodAI(Creature* c) : ScriptedAI(c) {}
+ boss_herodAI(Creature* creature) : ScriptedAI(creature) {}
bool Enrage;
@@ -102,7 +115,8 @@ public:
{
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 12000;
- } else Cleave_Timer -= diff;
+ }
+ else Cleave_Timer -= diff;
// Whirlwind_Timer
if (Whirlwind_Timer <= diff)
@@ -110,12 +124,12 @@ public:
DoScriptText(SAY_WHIRLWIND, me);
DoCast(me->getVictim(), SPELL_WHIRLWIND);
Whirlwind_Timer = 30000;
- } else Whirlwind_Timer -= diff;
+ }
+ else Whirlwind_Timer -= diff;
DoMeleeAttackIfReady();
}
};
-
};
class mob_scarlet_trainee : public CreatureScript
@@ -130,7 +144,7 @@ public:
struct mob_scarlet_traineeAI : public npc_escortAI
{
- mob_scarlet_traineeAI(Creature* c) : npc_escortAI(c)
+ mob_scarlet_traineeAI(Creature* creature) : npc_escortAI(creature)
{
Start_Timer = urand(1000, 6000);
}
@@ -138,7 +152,7 @@ public:
uint32 Start_Timer;
void Reset() {}
- void WaypointReached(uint32 /*uiPoint*/) {}
+ void WaypointReached(uint32 /*point*/) {}
void EnterCombat(Unit* /*who*/) {}
void UpdateAI(const uint32 diff)
@@ -155,7 +169,6 @@ public:
npc_escortAI::UpdateAI(diff);
}
};
-
};
void AddSC_boss_herod()
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 5c6b31c2ab7..a64636a4223 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@ public:
struct boss_high_inquisitor_fairbanksAI : public ScriptedAI
{
- boss_high_inquisitor_fairbanksAI(Creature* c) : ScriptedAI(c) {}
+ boss_high_inquisitor_fairbanksAI(Creature* creature) : ScriptedAI(creature) {}
uint32 CurseOfBlood_Timer;
uint32 DispelMagic_Timer;
@@ -68,9 +68,7 @@ public:
PowerWordShield = false;
}
- void EnterCombat(Unit* /*who*/)
- {
- }
+ void EnterCombat(Unit* /*who*/) {}
void UpdateAI(const uint32 diff)
{
@@ -82,7 +80,8 @@ public:
{
DoCast(me, SPELL_HEAL);
Heal_Timer = 30000;
- } else Heal_Timer -= diff;
+ }
+ else Heal_Timer -= diff;
//Fear_Timer
if (Fear_Timer <= diff)
@@ -91,7 +90,8 @@ public:
DoCast(target, SPELL_FEAR);
Fear_Timer = 40000;
- } else Fear_Timer -= diff;
+ }
+ else Fear_Timer -= diff;
//Sleep_Timer
if (Sleep_Timer <= diff)
@@ -100,7 +100,8 @@ public:
DoCast(target, SPELL_SLEEP);
Sleep_Timer = 30000;
- } else Sleep_Timer -= diff;
+ }
+ else Sleep_Timer -= diff;
//PowerWordShield_Timer
if (!PowerWordShield && !HealthAbovePct(25))
@@ -116,19 +117,20 @@ public:
DoCast(target, SPELL_DISPELMAGIC);
DispelMagic_Timer = 30000;
- } else DispelMagic_Timer -= diff;
+ }
+ else DispelMagic_Timer -= diff;
//CurseOfBlood_Timer
if (CurseOfBlood_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_CURSEOFBLOOD);
CurseOfBlood_Timer = 25000;
- } else CurseOfBlood_Timer -= diff;
+ }
+ else CurseOfBlood_Timer -= diff;
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_high_inquisitor_fairbanks()
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp
index 8b0f793d2df..f311da401d4 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,7 @@ public:
struct boss_houndmaster_lokseyAI : public ScriptedAI
{
- boss_houndmaster_lokseyAI(Creature* c) : ScriptedAI(c) {}
+ boss_houndmaster_lokseyAI(Creature* creature) : ScriptedAI(creature) {}
uint32 BloodLust_Timer;
@@ -67,12 +67,12 @@ public:
{
DoCast(me, SPELL_BLOODLUST);
BloodLust_Timer = 20000;
- } else BloodLust_Timer -= diff;
+ }
+ else BloodLust_Timer -= diff;
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_houndmaster_loksey()
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
index e66c639896e..058c688641f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -26,15 +26,18 @@ EndScriptData */
#include "ScriptPCH.h"
#include "scarlet_monastery.h"
-enum eEnums
+enum Says
{
SAY_AGGRO = -1189011,
SAY_HEALTH1 = -1189012,
SAY_HEALTH2 = -1189013,
SAY_KILL = -1189014,
- SAY_TRIGGER_VORREL = -1189015,
+ SAY_TRIGGER_VORREL = -1189015
+};
- SPELL_SHADOWWORDPAIN = 2767,
+enum Spells
+{
+ SPELL_SHADOWWORDPAIN = 2767
};
class boss_interrogator_vishas : public CreatureScript
@@ -49,7 +52,7 @@ public:
struct boss_interrogator_vishasAI : public ScriptedAI
{
- boss_interrogator_vishasAI(Creature* c) : ScriptedAI(c)
+ boss_interrogator_vishasAI(Creature* creature) : ScriptedAI(creature)
{
instance = me->GetInstanceScript();
}
@@ -108,12 +111,12 @@ public:
{
DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN);
ShadowWordPain_Timer = urand(5000, 15000);
- } else ShadowWordPain_Timer -= diff;
+ }
+ else ShadowWordPain_Timer -= diff;
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_interrogator_vishas()
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 d0ea617b734..ec6ac34b0bb 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@ EndScriptData */
#include "ScriptPCH.h"
#include "scarlet_monastery.h"
-enum eEnums
+enum Says
{
//Mograine says
SAY_MO_AGGRO = -1189005,
@@ -37,7 +37,10 @@ enum eEnums
SAY_WH_INTRO = -1189008,
SAY_WH_KILL = -1189009,
SAY_WH_RESSURECT = -1189010,
+};
+enum Spells
+{
//Mograine Spells
SPELL_CRUSADERSTRIKE = 14518,
SPELL_HAMMEROFJUSTICE = 5589,
@@ -67,43 +70,43 @@ public:
{
boss_scarlet_commander_mograineAI(Creature* creature) : ScriptedAI(creature)
{
- m_instance = creature->GetInstanceScript();
+ instance = creature->GetInstanceScript();
}
- InstanceScript* m_instance;
+ InstanceScript* instance;
- uint32 m_uiCrusaderStrike_Timer;
- uint32 m_uiHammerOfJustice_Timer;
+ uint32 CrusaderStrike_Timer;
+ uint32 HammerOfJustice_Timer;
- bool m_bHasDied;
- bool m_bHeal;
- bool m_bFakeDeath;
+ bool _bHasDied;
+ bool _bHeal;
+ bool _bFakeDeath;
void Reset()
{
- m_uiCrusaderStrike_Timer = 10000;
- m_uiHammerOfJustice_Timer = 10000;
+ CrusaderStrike_Timer = 10000;
+ HammerOfJustice_Timer = 10000;
//Incase wipe during phase that mograine fake death
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetStandState(UNIT_STAND_STATE_STAND);
- if (m_instance)
+ if (instance)
if (me->isAlive())
- m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
+ instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
- m_bHasDied = false;
- m_bHeal = false;
- m_bFakeDeath = false;
+ _bHasDied = false;
+ _bHeal = false;
+ _bFakeDeath = false;
}
void JustReachedHome()
{
- if (m_instance)
+ if (instance)
{
- if (m_instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != NOT_STARTED)
- m_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);
}
}
@@ -120,18 +123,18 @@ public:
DoScriptText(SAY_MO_KILL, me);
}
- void DamageTaken(Unit* /*pDoneBy*/, uint32 &uiDamage)
+ void DamageTaken(Unit* /*doneBy*/, uint32 &damage)
{
- if (uiDamage < me->GetHealth() || m_bHasDied || m_bFakeDeath)
+ if (damage < me->GetHealth() || _bHasDied || _bFakeDeath)
return;
- if (!m_instance)
+ if (!instance)
return;
//On first death, fake death and open door, as well as initiate whitemane if exist
- if (Unit* Whitemane = Unit::GetUnit((*me), m_instance->GetData64(DATA_WHITEMANE)))
+ if (Unit* Whitemane = Unit::GetUnit((*me), instance->GetData64(DATA_WHITEMANE)))
{
- m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS);
+ instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS);
Whitemane->GetMotionMaster()->MovePoint(1, 1163.113370f, 1398.856812f, 32.527786f);
@@ -150,72 +153,73 @@ public:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetStandState(UNIT_STAND_STATE_DEAD);
- m_bHasDied = true;
- m_bFakeDeath = true;
+ _bHasDied = true;
+ _bFakeDeath = true;
- uiDamage = 0;
+ damage = 0;
}
}
- void SpellHit(Unit* /*who*/, const SpellInfo* pSpell)
+ void SpellHit(Unit* /*who*/, const SpellInfo* spell)
{
//When hit with ressurection say text
- if (pSpell->Id == SPELL_SCARLETRESURRECTION)
+ if (spell->Id == SPELL_SCARLETRESURRECTION)
{
DoScriptText(SAY_MO_RESSURECTED, me);
- m_bFakeDeath = false;
+ _bFakeDeath = false;
- if (m_instance)
- m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL);
+ if (instance)
+ instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL);
}
}
- void UpdateAI(const uint32 uiDiff)
+ void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
- if (m_bHasDied && !m_bHeal && m_instance && m_instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL)
+ if (_bHasDied && !_bHeal && instance && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL)
{
//On ressurection, stop fake death and heal whitemane and resume fight
- if (Unit* Whitemane = Unit::GetUnit((*me), m_instance->GetData64(DATA_WHITEMANE)))
+ if (Unit* Whitemane = Unit::GetUnit((*me), instance->GetData64(DATA_WHITEMANE)))
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetStandState(UNIT_STAND_STATE_STAND);
DoCast(Whitemane, SPELL_LAYONHANDS);
- m_uiCrusaderStrike_Timer = 10000;
- m_uiHammerOfJustice_Timer = 10000;
+ CrusaderStrike_Timer = 10000;
+ HammerOfJustice_Timer = 10000;
if (me->getVictim())
me->GetMotionMaster()->MoveChase(me->getVictim());
- m_bHeal = true;
+ _bHeal = true;
}
}
//This if-check to make sure mograine does not attack while fake death
- if (m_bFakeDeath)
+ if (_bFakeDeath)
return;
- //m_uiCrusaderStrike_Timer
- if (m_uiCrusaderStrike_Timer <= uiDiff)
+ //CrusaderStrike_Timer
+ if (CrusaderStrike_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_CRUSADERSTRIKE);
- m_uiCrusaderStrike_Timer = 10000;
- } else m_uiCrusaderStrike_Timer -= uiDiff;
+ CrusaderStrike_Timer = 10000;
+ }
+ else CrusaderStrike_Timer -= diff;
- //m_uiHammerOfJustice_Timer
- if (m_uiHammerOfJustice_Timer <= uiDiff)
+ //HammerOfJustice_Timer
+ if (HammerOfJustice_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_HAMMEROFJUSTICE);
- m_uiHammerOfJustice_Timer = 60000;
- } else m_uiHammerOfJustice_Timer -= uiDiff;
+ HammerOfJustice_Timer = 60000;
+ }
+ else HammerOfJustice_Timer -= diff;
DoMeleeAttackIfReady();
}
};
-
};
class boss_high_inquisitor_whitemane : public CreatureScript
@@ -232,37 +236,37 @@ public:
{
boss_high_inquisitor_whitemaneAI(Creature* creature) : ScriptedAI(creature)
{
- m_instance = creature->GetInstanceScript();
+ instance = creature->GetInstanceScript();
}
- InstanceScript* m_instance;
+ InstanceScript* instance;
- uint32 m_uiHeal_Timer;
- uint32 m_uiPowerWordShield_Timer;
- uint32 m_uiHolySmite_Timer;
- uint32 m_uiWait_Timer;
+ uint32 Heal_Timer;
+ uint32 PowerWordShield_Timer;
+ uint32 HolySmite_Timer;
+ uint32 Wait_Timer;
- bool m_bCanResurrectCheck;
- bool m_bCanResurrect;
+ bool _bCanResurrectCheck;
+ bool _bCanResurrect;
void Reset()
{
- m_uiWait_Timer = 7000;
- m_uiHeal_Timer = 10000;
- m_uiPowerWordShield_Timer = 15000;
- m_uiHolySmite_Timer = 6000;
+ Wait_Timer = 7000;
+ Heal_Timer = 10000;
+ PowerWordShield_Timer = 15000;
+ HolySmite_Timer = 6000;
- m_bCanResurrectCheck = false;
- m_bCanResurrect = false;
+ _bCanResurrectCheck = false;
+ _bCanResurrect = false;
- if (m_instance)
+ if (instance)
if (me->isAlive())
- m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
+ instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
}
void AttackStart(Unit* who)
{
- if (m_instance && m_instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED)
+ if (instance && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED)
return;
ScriptedAI::AttackStart(who);
@@ -278,84 +282,86 @@ public:
DoScriptText(SAY_WH_KILL, me);
}
- void UpdateAI(const uint32 uiDiff)
+ void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
- if (m_bCanResurrect)
+ if (_bCanResurrect)
{
//When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out
- if (m_instance && m_uiWait_Timer <= uiDiff)
+ if (instance && Wait_Timer <= diff)
{
- if (Unit* Mograine = Unit::GetUnit((*me), m_instance->GetData64(DATA_MOGRAINE)))
+ if (Unit* Mograine = Unit::GetUnit((*me), instance->GetData64(DATA_MOGRAINE)))
{
DoCast(Mograine, SPELL_SCARLETRESURRECTION);
DoScriptText(SAY_WH_RESSURECT, me);
- m_bCanResurrect = false;
+ _bCanResurrect = false;
}
}
- else m_uiWait_Timer -= uiDiff;
+ else Wait_Timer -= diff;
}
//Cast Deep sleep when health is less than 50%
- if (!m_bCanResurrectCheck && !HealthAbovePct(50))
+ if (!_bCanResurrectCheck && !HealthAbovePct(50))
{
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
DoCast(me->getVictim(), SPELL_DEEPSLEEP);
- m_bCanResurrectCheck = true;
- m_bCanResurrect = true;
+ _bCanResurrectCheck = true;
+ _bCanResurrect = true;
return;
}
//while in "resurrect-mode", don't do anything
- if (m_bCanResurrect)
+ if (_bCanResurrect)
return;
//If we are <75% hp cast healing spells at self or Mograine
- if (m_uiHeal_Timer <= uiDiff)
+ if (Heal_Timer <= diff)
{
Creature* target = NULL;
if (!HealthAbovePct(75))
target = me;
- if (m_instance)
+ if (instance)
{
- if (Creature* pMograine = Unit::GetCreature((*me), m_instance->GetData64(DATA_MOGRAINE)))
+ if (Creature* mograine = Unit::GetCreature((*me), instance->GetData64(DATA_MOGRAINE)))
{
- // checking m_bCanResurrectCheck prevents her healing Mograine while he is "faking death"
- if (m_bCanResurrectCheck && pMograine->isAlive() && !pMograine->HealthAbovePct(75))
- target = pMograine;
+ // checking _bCanResurrectCheck prevents her healing Mograine while he is "faking death"
+ if (_bCanResurrectCheck && mograine->isAlive() && !mograine->HealthAbovePct(75))
+ target = mograine;
}
}
if (target)
DoCast(target, SPELL_HEAL);
- m_uiHeal_Timer = 13000;
- } else m_uiHeal_Timer -= uiDiff;
+ Heal_Timer = 13000;
+ }
+ else Heal_Timer -= diff;
- //m_uiPowerWordShield_Timer
- if (m_uiPowerWordShield_Timer <= uiDiff)
+ //PowerWordShield_Timer
+ if (PowerWordShield_Timer <= diff)
{
DoCast(me, SPELL_POWERWORDSHIELD);
- m_uiPowerWordShield_Timer = 15000;
- } else m_uiPowerWordShield_Timer -= uiDiff;
+ PowerWordShield_Timer = 15000;
+ }
+ else PowerWordShield_Timer -= diff;
- //m_uiHolySmite_Timer
- if (m_uiHolySmite_Timer <= uiDiff)
+ //HolySmite_Timer
+ if (HolySmite_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_HOLYSMITE);
- m_uiHolySmite_Timer = 6000;
- } else m_uiHolySmite_Timer -= uiDiff;
+ HolySmite_Timer = 6000;
+ }
+ else HolySmite_Timer -= diff;
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_mograine_and_whitemane()
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp
index 7ee479727ed..8035adfc33f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,10 +25,13 @@ EndScriptData */
#include "ScriptPCH.h"
-#define SPELL_LICHSLAP 28873
-#define SPELL_FROSTBOLTVOLLEY 8398
-#define SPELL_MINDFLAY 17313
-#define SPELL_FROSTNOVA 15531
+enum Spells
+{
+ SPELL_LICHSLAP = 28873,
+ SPELL_FROSTBOLTVOLLEY = 8398,
+ SPELL_MINDFLAY = 17313,
+ SPELL_FROSTNOVA = 15531
+};
class boss_scorn : public CreatureScript
{
@@ -42,7 +45,7 @@ public:
struct boss_scornAI : public ScriptedAI
{
- boss_scornAI(Creature* c) : ScriptedAI(c) {}
+ boss_scornAI(Creature* creature) : ScriptedAI(creature) {}
uint32 LichSlap_Timer;
uint32 FrostboltVolley_Timer;
@@ -57,9 +60,7 @@ public:
FrostNova_Timer = 30000;
}
- void EnterCombat(Unit* /*who*/)
- {
- }
+ void EnterCombat(Unit* /*who*/) {}
void UpdateAI(const uint32 diff)
{
@@ -71,33 +72,36 @@ public:
{
DoCast(me->getVictim(), SPELL_LICHSLAP);
LichSlap_Timer = 45000;
- } else LichSlap_Timer -= diff;
+ }
+ else LichSlap_Timer -= diff;
//FrostboltVolley_Timer
if (FrostboltVolley_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_FROSTBOLTVOLLEY);
FrostboltVolley_Timer = 20000;
- } else FrostboltVolley_Timer -= diff;
+ }
+ else FrostboltVolley_Timer -= diff;
//MindFlay_Timer
if (MindFlay_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_MINDFLAY);
MindFlay_Timer = 20000;
- } else MindFlay_Timer -= diff;
+ }
+ else MindFlay_Timer -= diff;
//FrostNova_Timer
if (FrostNova_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_FROSTNOVA);
FrostNova_Timer = 15000;
- } else FrostNova_Timer -= diff;
+ }
+ else FrostNova_Timer -= diff;
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_scorn()
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp
index ba3759e7062..ba0b854754e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -26,10 +26,13 @@ EndScriptData */
#include "ScriptPCH.h"
#include "scarlet_monastery.h"
-#define ENTRY_PUMPKIN_SHRINE 186267
-#define ENTRY_HORSEMAN 23682
-#define ENTRY_HEAD 23775
-#define ENTRY_PUMPKIN 23694
+enum Entry
+{
+ ENTRY_PUMPKIN_SHRINE = 186267,
+ ENTRY_HORSEMAN = 23682,
+ ENTRY_HEAD = 23775,
+ ENTRY_PUMPKIN = 23694
+};
#define MAX_ENCOUNTER 2
@@ -57,11 +60,11 @@ public:
uint64 VorrelGUID;
uint64 DoorHighInquisitorGUID;
- uint32 m_auiEncounter[MAX_ENCOUNTER];
+ uint32 encounter[MAX_ENCOUNTER];
void Initialize()
{
- memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
+ memset(&encounter, 0, sizeof(encounter));
PumpkinShrineGUID = 0;
HorsemanGUID = 0;
@@ -106,13 +109,13 @@ public:
if (data == FAIL)
DoUseDoorOrButton(DoorHighInquisitorGUID);
- m_auiEncounter[0] = data;
+ encounter[0] = data;
break;
case GAMEOBJECT_PUMPKIN_SHRINE:
HandleGameObject(PumpkinShrineGUID, false);
break;
case DATA_HORSEMAN_EVENT:
- m_auiEncounter[1] = data;
+ encounter[1] = data;
if (data == DONE)
{
for (std::set<uint64>::const_iterator itr = HorsemanAdds.begin(); itr != HorsemanAdds.end(); ++itr)
@@ -146,13 +149,12 @@ public:
uint32 GetData(uint32 type)
{
if (type == TYPE_MOGRAINE_AND_WHITE_EVENT)
- return m_auiEncounter[0];
+ return encounter[0];
if (type == DATA_HORSEMAN_EVENT)
- return m_auiEncounter[1];
+ return encounter[1];
return 0;
}
};
-
};
void AddSC_instance_scarlet_monastery()
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h
index 4b5cd422198..70b18919704 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,17 @@
#ifndef DEF_SCARLET_M
#define DEF_SCARLET_M
-#define TYPE_MOGRAINE_AND_WHITE_EVENT 1
-#define DATA_MOGRAINE 2
-#define DATA_WHITEMANE 3
-#define DATA_DOOR_WHITEMANE 4
+enum eEnums
+{
+ TYPE_MOGRAINE_AND_WHITE_EVENT = 1,
-#define DATA_HORSEMAN_EVENT 5
-#define GAMEOBJECT_PUMPKIN_SHRINE 6
+ DATA_MOGRAINE = 2,
+ DATA_WHITEMANE = 3,
+ DATA_DOOR_WHITEMANE = 4,
-#define DATA_VORREL 7
-#endif
+ DATA_HORSEMAN_EVENT = 5,
+ GAMEOBJECT_PUMPKIN_SHRINE = 6,
+ DATA_VORREL = 7
+};
+#endif
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
index d930dd4a14c..4ddc240a03c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_death_knight_darkreaver.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp
index 4c66c129893..693cad06bd5 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 4ea79c8332a..05d662c4fe3 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp
index a5c1436153b..92f0fcd25c4 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp
index e7388503177..295d9440d2e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_jandice_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp
index 2d1d78193ed..48bf000745c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_kormok.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp
index 72685d29181..7c279e726a6 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 ac9a62f2b27..5109e6e1468 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_lorekeeper_polkelt.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
index a575d039dfa..754640bff9e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_ras_frostwhisper.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
index efff8042824..902838da152 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_the_ravenian.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp
index 052e950b4e8..13fa450f5ee 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_vectus.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp
index 3512e4cd1cf..657b458e148 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 a96fe8b935b..86023d21eca 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/scholomance.h b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h
index 4c0d2061639..6e8ed21e4bb 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h
+++ b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/instance_shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
index d5a641fc0f6..57b902ac6d4 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -252,7 +252,7 @@ public:
{
case 1:
summon = pArchmage->SummonCreature(pArchmage->GetEntry(), SpawnLocation[4], TEMPSUMMON_TIMED_DESPAWN, 10000);
- summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
summon->SetReactState(REACT_DEFENSIVE);
summon->CastSpell(summon, SPELL_ASHCROMBE_TELEPORT, true);
DoScriptText(SAY_ARCHMAGE, summon);
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
index 666bc690f8d..dded75e193c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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.h b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h
index 9b1ffe5e1b2..0c41239c9b4 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 86cd3019fd8..0c659117f5d 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_baroness_anastari.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp
index 3cd6078eb41..a01846cb862 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_cannon_master_willey.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp
index edf291a7c0e..d84bd489dab 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 3cbf00f291d..8a14f1e2401 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_magistrate_barthilas.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp
index 1a4acf9be7e..48b1fc2acc7 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 cb423d9a781..1dc22a20d08 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_nerubenkan.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp
index 13ce7631be5..a7c91c3636d 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_order_of_silver_hand.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp
index b93d289e0cc..3393b9e5797 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_postmaster_malown.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp
index f6d6ae377e4..869a82011ad 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 5d7e6c9467e..f35bcc05ec2 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_timmy_the_cruel.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp
index 96e313dc6a2..405527ab383 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 618ac8b7c27..387b6d7b13c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 39019c46850..5b2b2fd46c1 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 b7707899089..b28271f5915 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h
+++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 931fc46a85a..e804fff44f5 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 50eb34e6ffb..35d6766872f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 91f62958be5..6b93ef03fa8 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 75bca682660..1404fd14e91 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
index d00f2b8de48..56d7909336c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
index 4e3f3899b35..c65ce2c8f98 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
index 747d9e29ec1..d7c90732a80 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
index ca853d5684e..337eea13438 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -425,7 +425,7 @@ public:
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->AddUnitState(UNIT_STAT_STUNNED);
+ me->AddUnitState(UNIT_STATE_STUNNED);
ScriptedAI::InitializeAI();
}
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
index 7c14845f060..9b5d941589b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -151,7 +151,7 @@ public:
summoned->CastSpell(summoned, SPELL_DARKFIEND_VISUAL, false);
break;
case CREATURE_DARKNESS:
- summoned->AddUnitState(UNIT_STAT_STUNNED);
+ summoned->AddUnitState(UNIT_STATE_STUNNED);
float x, y, z, o;
summoned->GetHomePosition(x, y, z, o);
me->SummonCreature(CREATURE_DARK_FIENDS, x, y, z, o, TEMPSUMMON_CORPSE_DESPAWN, 0);
@@ -399,7 +399,7 @@ public:
InAction = false;
SummonSentinel = false;
- me->AddUnitState(UNIT_STAT_STUNNED);
+ me->AddUnitState(UNIT_STATE_STUNNED);
Summons.DespawnAll();
}
@@ -472,7 +472,7 @@ public:
WaitTimer = 2000;
InAction = false;
- me->AddUnitState(UNIT_STAT_STUNNED);
+ me->AddUnitState(UNIT_STATE_STUNNED);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* Spell)
@@ -491,7 +491,7 @@ public:
{
if (!InAction)
{
- me->ClearUnitState(UNIT_STAT_STUNNED);
+ me->ClearUnitState(UNIT_STATE_STUNNED);
DoCastAOE(SPELL_DARKFIEND_SKIN, false);
AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true));
InAction = true;
@@ -599,7 +599,7 @@ public:
SpellTimer = 5000;
Phase = 0;
- me->AddUnitState(UNIT_STAT_STUNNED);
+ me->AddUnitState(UNIT_STATE_STUNNED);
DoCastAOE(SPELL_BLACKHOLE_SPAWN, true);
}
@@ -611,7 +611,7 @@ public:
switch (NeedForAHack)
{
case 0:
- me->ClearUnitState(UNIT_STAT_STUNNED);
+ me->ClearUnitState(UNIT_STATE_STUNNED);
DoCastAOE(SPELL_BLACKHOLE_GROW, false);
if (Victim)
AttackStart(Victim);
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp
index a6d631a5b85..645026c343d 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp
index 59be2f2a643..e6349e3497e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 efd00ca238f..ed21077cc63 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
index 74c9e6b66b4..0872ac9adca 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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/boss_ironaya.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp
index 0ec25a265fc..8a845dbb7f6 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
index 0b97274310a..60d17a7e5d2 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 0a80900edf4..7bcd2598271 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 af0e9c18311..360a80ac4f3 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.h
+++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 ffccfbce2b6..eee6b08d834 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -325,7 +325,7 @@ class boss_akilzon : public CreatureScript
if (target)
{
target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
- target->SendMonsterMove(x, y, me->GetPositionZ()+15, 0);
+ target->MonsterMoveWithSpeed(x, y, me->GetPositionZ()+15, 0);
}
Unit* Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000);
if (Cloud)
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp
index 80c31d42a46..db0e201298c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
index 162c84f1fa7..5efd4af55ea 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
index aea9e322583..21245209e45 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
index 0ae8a9bc5c4..954f232f786 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
index 5dbe3fc9409..b5130630d05 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
index 2785c61dec5..ac1554bd00e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 a6eb4c91d4c..bf951dd186c 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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.h b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h
index 844e1c33eca..daad916c0aa 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h
+++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 076545ae9d4..27ddc215543 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp
index 5ca43e9268e..a944a857f74 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 d3922602a17..68ae6dbbf0c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 484499b1567..6a1309983c3 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp
index 73fa91dbdd8..69a4f5dbab5 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 87dc0e372f6..d2ac4f3bceb 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp
index 9c82c3eddfb..132812c932a 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
index 06ae34b79b2..10708cd7f95 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp
index 5dafa54a2ba..38d9be78f2a 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
index c3bf09ee28d..f988d0df77a 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 743ec211529..4185ba2f3e7 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp
index b0bbc0c6c79..bd6f6ec4748 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -173,7 +173,7 @@ class boss_venoxis : public CreatureScript
events.Update(diff);
// return back to main code if we're still casting
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp
index 179935524a8..702a69207ba 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 e059b7945ee..e3dd5d5933b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
index 53dfbd9e93d..d127680cec5 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/alterac_mountains.cpp b/src/server/scripts/EasternKingdoms/alterac_mountains.cpp
index 36daf41ec78..e4b24dc00ee 100644
--- a/src/server/scripts/EasternKingdoms/alterac_mountains.cpp
+++ b/src/server/scripts/EasternKingdoms/alterac_mountains.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp
index 0ce940723cb..e2a9717882b 100644
--- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp
+++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,16 +36,16 @@ EndContentData */
enum eEnums
{
- SAY_PROGRESS_1 = -1000264,
- SAY_PROGRESS_2 = -1000265,
- SAY_PROGRESS_3 = -1000266,
- EMOTE_PROGRESS_4 = -1000267,
- SAY_AGGRO = -1000268,
- SAY_PROGRESS_5 = -1000269,
- SAY_PROGRESS_6 = -1000270,
- SAY_PROGRESS_7 = -1000271,
- EMOTE_PROGRESS_8 = -1000272,
- SAY_PROGRESS_9 = -1000273,
+ 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,
QUEST_SUNKEN_TREASURE = 665,
MOB_VENGEFUL_SURGE = 2776
@@ -73,24 +73,24 @@ class npc_professor_phizzlethorpe : public CreatureScript
switch (uiPointId)
{
- case 4:DoScriptText(SAY_PROGRESS_2, me, player);break;
- case 5:DoScriptText(SAY_PROGRESS_3, me, player);break;
- case 8:DoScriptText(EMOTE_PROGRESS_4, me);break;
+ case 4:Talk(SAY_PROGRESS_2, player->GetGUID());break;
+ case 5:Talk(SAY_PROGRESS_3, player->GetGUID());break;
+ case 8:Talk(EMOTE_PROGRESS_4);break;
case 9:
{
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
break;
}
- case 10:DoScriptText(SAY_PROGRESS_5, me, player);break;
+ case 10:Talk(SAY_PROGRESS_5, player->GetGUID());break;
case 11:
- DoScriptText(SAY_PROGRESS_6, me, player);
+ Talk(SAY_PROGRESS_6, player->GetGUID());
SetRun();
break;
- case 19:DoScriptText(SAY_PROGRESS_7, me, player); break;
+ case 19:Talk(SAY_PROGRESS_7, player->GetGUID()); break;
case 20:
- DoScriptText(EMOTE_PROGRESS_8, me);
- DoScriptText(SAY_PROGRESS_9, me, player);
+ Talk(EMOTE_PROGRESS_8);
+ Talk(SAY_PROGRESS_9, player->GetGUID());
if (player)
CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
break;
@@ -104,7 +104,7 @@ class npc_professor_phizzlethorpe : public CreatureScript
void EnterCombat(Unit* /*who*/)
{
- DoScriptText(SAY_AGGRO, me);
+ Talk(SAY_AGGRO);
}
void UpdateAI(const uint32 diff)
@@ -122,7 +122,7 @@ class npc_professor_phizzlethorpe : public CreatureScript
{
if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
{
- DoScriptText(SAY_PROGRESS_1, creature, player);
+ 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);
diff --git a/src/server/scripts/EasternKingdoms/blasted_lands.cpp b/src/server/scripts/EasternKingdoms/blasted_lands.cpp
index 38a577b9ba9..1e34051db28 100644
--- a/src/server/scripts/EasternKingdoms/blasted_lands.cpp
+++ b/src/server/scripts/EasternKingdoms/blasted_lands.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/boss_kruul.cpp b/src/server/scripts/EasternKingdoms/boss_kruul.cpp
index 3167eadc5fe..126f55838b9 100644
--- a/src/server/scripts/EasternKingdoms/boss_kruul.cpp
+++ b/src/server/scripts/EasternKingdoms/boss_kruul.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/burning_steppes.cpp b/src/server/scripts/EasternKingdoms/burning_steppes.cpp
index 885cd8b00af..1d2725b10ee 100644
--- a/src/server/scripts/EasternKingdoms/burning_steppes.cpp
+++ b/src/server/scripts/EasternKingdoms/burning_steppes.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/duskwood.cpp b/src/server/scripts/EasternKingdoms/duskwood.cpp
index 7487ddbc548..5d04489bbca 100644
--- a/src/server/scripts/EasternKingdoms/duskwood.cpp
+++ b/src/server/scripts/EasternKingdoms/duskwood.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,6 +25,14 @@ EndScriptData */
#include "ScriptPCH.h"
+enum Yells
+{
+ YELL_TWILIGHTCORRUPTOR_RESPAWN = 0,
+ YELL_TWILIGHTCORRUPTOR_AGGRO = 1,
+ YELL_TWILIGHTCORRUPTOR_KILL = 2,
+};
+
+
/*######
# at_twilight_grove
######*/
@@ -43,11 +51,11 @@ public:
TCorrupter->setFaction(14);
TCorrupter->SetMaxHealth(832750);
}
- if (Unit* CorrupterSpeaker = player->SummonCreature(1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()-1, 0, TEMPSUMMON_TIMED_DESPAWN, 15000))
+ 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->MonsterYell("Come, $N. See what the Nightmare brings...", 0, player->GetGUID());
+ CorrupterSpeaker->AI()->Talk(YELL_TWILIGHTCORRUPTOR_RESPAWN, player->GetGUID());
}
}
return false;
@@ -89,7 +97,7 @@ public:
}
void EnterCombat(Unit* /*who*/)
{
- me->MonsterYell("The Nightmare cannot be stopped!", 0, me->GetGUID());
+ Talk(YELL_TWILIGHTCORRUPTOR_AGGRO);
}
void KilledUnit(Unit* victim)
@@ -97,7 +105,7 @@ public:
if (victim->GetTypeId() == TYPEID_PLAYER)
{
++KillCount;
- me->MonsterTextEmote("Twilight Corrupter squeezes the last bit of life out of $N and swallows their soul.", victim->GetGUID(), true);
+ Talk(YELL_TWILIGHTCORRUPTOR_KILL, victim->GetGUID());
if (KillCount == 3)
{
diff --git a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp
index c30d5db0244..2b4bb61c603 100644
--- a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp
+++ b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp
index d9171308ba6..4797774ef49 100644
--- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp
+++ b/src/server/scripts/EasternKingdoms/eversong_woods.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,10 +69,10 @@ enum eFaction
enum eSays
{
- TEXT_SECOND_TRIAL_1 = -1000637,
- TEXT_SECOND_TRIAL_2 = -1000638,
- TEXT_SECOND_TRIAL_3 = -1000639,
- TEXT_SECOND_TRIAL_4 = -1000640,
+ TEXT_SECOND_TRIAL_1 = 0,
+ TEXT_SECOND_TRIAL_2 = 1,
+ TEXT_SECOND_TRIAL_3 = 2,
+ TEXT_SECOND_TRIAL_4 = 3,
};
struct Locations
@@ -335,16 +335,16 @@ public:
switch (paladinPhase)
{
case 0:
- DoScriptText(TEXT_SECOND_TRIAL_1, me);
+ Talk(TEXT_SECOND_TRIAL_1);
break;
case 1:
- DoScriptText(TEXT_SECOND_TRIAL_2, me);
+ Talk(TEXT_SECOND_TRIAL_2);
break;
case 2:
- DoScriptText(TEXT_SECOND_TRIAL_3, me);
+ Talk(TEXT_SECOND_TRIAL_3);
break;
case 3:
- DoScriptText(TEXT_SECOND_TRIAL_4, me);
+ Talk(TEXT_SECOND_TRIAL_4);
break;
}
}
diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp
index 655ad4514fe..412613572f1 100644
--- a/src/server/scripts/EasternKingdoms/ghostlands.cpp
+++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,45 +34,6 @@ EndContentData */
#include "ScriptedEscortAI.h"
/*######
-## npc_blood_knight_dawnstar
-######*/
-
-#define GOSSIP_H_BKD "Take Blood Knight Insignia"
-
-class npc_blood_knight_dawnstar : public CreatureScript
-{
-public:
- npc_blood_knight_dawnstar() : CreatureScript("npc_blood_knight_dawnstar") { }
-
- bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction)
- {
- player->PlayerTalkClass->ClearMenus();
- if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
- {
- ItemPosCountVec dest;
- uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 24226, 1, NULL);
- if (msg == EQUIP_ERR_OK)
- {
- player->StoreNewItem(dest, 24226, 1, true);
- player->PlayerTalkClass->ClearMenus();
- }
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->GetQuestStatus(9692) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(24226, 1, true))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_BKD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-
-};
-
-/*######
## npc_budd_nedreck
######*/
@@ -255,7 +216,6 @@ public:
void AddSC_ghostlands()
{
- new npc_blood_knight_dawnstar();
new npc_budd_nedreck();
new npc_rathis_tomber();
new npc_ranger_lilatha();
diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp
index 89adfee87c4..7021deeae75 100644
--- a/src/server/scripts/EasternKingdoms/hinterlands.cpp
+++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/ironforge.cpp b/src/server/scripts/EasternKingdoms/ironforge.cpp
index 7b37ddb8991..5a0ee3c5630 100644
--- a/src/server/scripts/EasternKingdoms/ironforge.cpp
+++ b/src/server/scripts/EasternKingdoms/ironforge.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp
index 6b16eb2937b..f2095de49c3 100644
--- a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp
+++ b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/loch_modan.cpp b/src/server/scripts/EasternKingdoms/loch_modan.cpp
index 25156201e95..9ce9de4381a 100644
--- a/src/server/scripts/EasternKingdoms/loch_modan.cpp
+++ b/src/server/scripts/EasternKingdoms/loch_modan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp
index 6e5429582e7..d7b00af33e8 100644
--- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp
+++ b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/searing_gorge.cpp b/src/server/scripts/EasternKingdoms/searing_gorge.cpp
index eb5b26a94a0..74172dda743 100644
--- a/src/server/scripts/EasternKingdoms/searing_gorge.cpp
+++ b/src/server/scripts/EasternKingdoms/searing_gorge.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/silvermoon_city.cpp b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp
index c4e105d3bee..8d04e92b9b8 100644
--- a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp
+++ b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp
index 68ab0432bb3..4d897c4f3b8 100644
--- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp
+++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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: Silverpine_Forest
SD%Complete: 100
-SDComment: Quest support: 1886, 435, 452
+SDComment: Quest support: 435, 452
SDCategory: Silverpine Forest
EndScriptData */
/* ContentData
-npc_astor_hadren
npc_deathstalker_erland
pyrewood_ambush
EndContentData */
@@ -33,73 +32,6 @@ EndContentData */
#include "ScriptedEscortAI.h"
/*######
-## npc_astor_hadren
-######*/
-
-#define GOSSIP_HAH "You're Astor Hadren, right?"
-#define GOSSIP_SAH "You've got something I need, Astor. And I'll be taking it now."
-
-class npc_astor_hadren : public CreatureScript
-{
-public:
- npc_astor_hadren() : CreatureScript("npc_astor_hadren") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_astor_hadrenAI(creature);
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (uiAction)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SAH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(624, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->CLOSE_GOSSIP_MENU();
- creature->setFaction(21);
- if (player)
- CAST_AI(npc_astor_hadren::npc_astor_hadrenAI, creature->AI())->AttackStart(player);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->GetQuestStatus(1886) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HAH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- player->SEND_GOSSIP_MENU(623, creature->GetGUID());
-
- return true;
- }
-
- struct npc_astor_hadrenAI : public ScriptedAI
- {
- npc_astor_hadrenAI(Creature* c) : ScriptedAI(c) {}
-
- void Reset()
- {
- me->setFaction(68);
- }
-
- void EnterCombat(Unit* /*who*/)
- {
- }
-
- void JustDied(Unit* /*who*/)
- {
- me->setFaction(68);
- }
- };
-
-};
-
-/*######
## npc_deathstalker_erland
######*/
@@ -386,7 +318,6 @@ public:
void AddSC_silverpine_forest()
{
- new npc_astor_hadren();
new npc_deathstalker_erland();
new pyrewood_ambush();
}
diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp
index 09533ab4ccb..a4eca1950f8 100644
--- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp
+++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@ EndScriptData */
/* ContentData
npc_archmage_malin
npc_bartleby
-npc_dashel_stonefist
npc_lady_katrana_prestor
npc_tyrion
npc_tyrion_spybot
@@ -148,78 +147,6 @@ public:
};
/*######
-## npc_dashel_stonefist
-######*/
-
-enum eDashel
-{
- QUEST_MISSING_DIPLO_PT8 = 1447,
- FACTION_HOSTILE = 168
-};
-
-class npc_dashel_stonefist : public CreatureScript
-{
-public:
- npc_dashel_stonefist() : CreatureScript("npc_dashel_stonefist") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
- {
- if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT8)
- {
- creature->setFaction(FACTION_HOSTILE);
- CAST_AI(npc_dashel_stonefist::npc_dashel_stonefistAI, creature->AI())->AttackStart(player);
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_dashel_stonefistAI(creature);
- }
-
- struct npc_dashel_stonefistAI : public ScriptedAI
- {
- npc_dashel_stonefistAI(Creature* c) : ScriptedAI(c)
- {
- m_uiNormalFaction = c->getFaction();
- }
-
- uint32 m_uiNormalFaction;
-
- void Reset()
- {
- if (me->getFaction() != m_uiNormalFaction)
- me->setFaction(m_uiNormalFaction);
- }
-
- void AttackedBy(Unit* pAttacker)
- {
- if (me->getVictim())
- return;
-
- if (me->IsFriendlyTo(pAttacker))
- return;
-
- AttackStart(pAttacker);
- }
-
- void DamageTaken(Unit* pDoneBy, uint32 &uiDamage)
- {
- if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(15, uiDamage))
- {
- uiDamage = 0;
-
- if (pDoneBy->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(pDoneBy)->AreaExploredOrEventHappens(QUEST_MISSING_DIPLO_PT8);
-
- EnterEvadeMode();
- }
- }
- };
-
-};
-
-/*######
## npc_lady_katrana_prestor
######*/
@@ -716,7 +643,6 @@ void AddSC_stormwind_city()
{
new npc_archmage_malin();
new npc_bartleby();
- new npc_dashel_stonefist();
new npc_lady_katrana_prestor();
new npc_tyrion();
new npc_tyrion_spybot();
diff --git a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp
index 4e4a077636b..a6effe29ff7 100644
--- a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp
+++ b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp
index 71359a07afa..ef6fccd8bde 100644
--- a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp
+++ b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp
index e6c528e4c89..0d72ab6fb2f 100644
--- a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp
+++ b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@ public:
if (quest->GetQuestId() == QUEST_590)
{
creature->setFaction(FACTION_HOSTILE);
- creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
CAST_AI(npc_calvin_montague::npc_calvin_montagueAI, creature->AI())->AttackStart(player);
}
return true;
@@ -80,8 +80,8 @@ public:
me->RestoreFaction();
- if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
}
void EnterCombat(Unit* /*who*/) {}
@@ -101,7 +101,7 @@ public:
uiDamage = 0;
me->RestoreFaction();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->CombatStop(true);
m_uiPhase = 1;
diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp
index b8f2499c4e6..fe9c40e6dbd 100644
--- a/src/server/scripts/EasternKingdoms/undercity.cpp
+++ b/src/server/scripts/EasternKingdoms/undercity.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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:
{
if (Creature* target = Unit::GetCreature(*summoned, targetGUID))
{
- target->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0);
+ target->MonsterMoveWithSpeed(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0);
target->SetPosition(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0.0f);
summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false);
}
@@ -186,7 +186,7 @@ public:
if (EventMove_Timer <= diff)
{
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- me->SendMonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, 5000);
+ me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetDistance(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW) / (5000 * 0.001f));
me->SetPosition(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation());
EventMove = false;
} else EventMove_Timer -= diff;
diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp
index 06c64b76242..a04a94f73b1 100644
--- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp
+++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/westfall.cpp b/src/server/scripts/EasternKingdoms/westfall.cpp
index e82da353cd0..271e1d99d63 100644
--- a/src/server/scripts/EasternKingdoms/westfall.cpp
+++ b/src/server/scripts/EasternKingdoms/westfall.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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:
case 4:
SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE);
me->SetSheath(SHEATH_STATE_RANGED);
- me->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE);
+ me->HandleEmoteCommand(EMOTE_STATE_USE_STANDING_NO_SHEATHE);
break;
case 7:
me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836f, 1569.755f, 54.267f, 4.230f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
@@ -141,7 +141,7 @@ public:
case 13:
SetEquipmentSlots(true);
me->SetSheath(SHEATH_STATE_UNARMED);
- me->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE);
+ me->HandleEmoteCommand(EMOTE_STATE_USE_STANDING_NO_SHEATHE);
break;
case 17:
player->GroupEventHappens(QUEST_TOME_VALOR, me);
diff --git a/src/server/scripts/EasternKingdoms/wetlands.cpp b/src/server/scripts/EasternKingdoms/wetlands.cpp
index cb5fa6782ac..3b196720242 100644
--- a/src/server/scripts/EasternKingdoms/wetlands.cpp
+++ b/src/server/scripts/EasternKingdoms/wetlands.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_commandscript.cpp b/src/server/scripts/Examples/example_commandscript.cpp
index 8513fbf8cf2..6b7a3d8def7 100644
--- a/src/server/scripts/Examples/example_commandscript.cpp
+++ b/src/server/scripts/Examples/example_commandscript.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 1a030728218..f1b336f07f9 100644
--- a/src/server/scripts/Examples/example_creature.cpp
+++ b/src/server/scripts/Examples/example_creature.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_escort.cpp b/src/server/scripts/Examples/example_escort.cpp
index dfac4321a23..cae09266b49 100644
--- a/src/server/scripts/Examples/example_escort.cpp
+++ b/src/server/scripts/Examples/example_escort.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_gossip_codebox.cpp b/src/server/scripts/Examples/example_gossip_codebox.cpp
index 13680a8ea9c..c288123f117 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 8619d03df30..d83a00ed82f 100644
--- a/src/server/scripts/Examples/example_misc.cpp
+++ b/src/server/scripts/Examples/example_misc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 372abc45268..b1a8f17d16a 100644
--- a/src/server/scripts/Examples/example_spell.cpp
+++ b/src/server/scripts/Examples/example_spell.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,6 +76,38 @@ class spell_ex_5581 : public SpellScriptLoader
delete localVariable2;
}
+ void HandleBeforeCast()
+ {
+ // this hook is executed before anything about casting the spell is done
+ // after this hook is executed all the machinery starts
+ sLog->outString("Caster just finished preparing the spell (cast bar has expired)");
+ }
+
+ void HandleOnCast()
+ {
+ // cast is validated and spell targets are selected at this moment
+ // this is a last place when the spell can be safely interrupted
+ sLog->outString("Spell is about to do take reagents, power, launch missile, do visuals and instant spell effects");
+ }
+
+ void HandleAfterCast()
+ {
+ sLog->outString("All immediate actions for the spell are finished now");
+ // this is a safe for triggering additional effects for a spell without interfering
+ // with visuals or with other effects of the spell
+ //GetCaster()->CastSpell(target, SPELL_TRIGGERED, true);
+ }
+
+ SpellCastResult CheckRequirement()
+ {
+ // in this hook you can add additional requirements for spell caster (and throw a client error if reqs're not passed)
+ // in this case we're disallowing to select non-player as a target of the spell
+ //if (!GetTargetUnit() || GetTargetUnit()->ToPlayer())
+ //return SPELL_FAILED_BAD_TARGETS;
+ return SPELL_CAST_OK;
+ }
+
+
void HandleDummyLaunch(SpellEffIndex /*effIndex*/)
{
sLog->outString("Spell %u with SPELL_EFFECT_DUMMY is just launched!", GetSpellInfo()->Id);
@@ -127,7 +159,11 @@ class spell_ex_5581 : public SpellScriptLoader
// register functions used in spell script - names of these functions do not matter
void Register()
{
- // we're registering our function here
+ // we're registering our functions here
+ BeforeCast += SpellCastFn(spell_ex_5581SpellScript::HandleBeforeCast);
+ OnCast += SpellCastFn(spell_ex_5581SpellScript::HandleOnCast);
+ AfterCast += SpellCastFn(spell_ex_5581SpellScript::HandleAfterCast);
+ OnCheckCast += SpellCheckCastFn(spell_ex_5581SpellScript::CheckRequirement);
// function HandleDummy will be called when spell is launched, independant from targets selected for spell, just before default effect 0 launch handler
OnEffectLaunch += SpellEffectFn(spell_ex_5581SpellScript::HandleDummyLaunch, EFFECT_0, SPELL_EFFECT_DUMMY);
// function HandleDummy will be called when spell is launched at target, just before default effect 0 launch at target handler
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
index 4aa2cea958b..878116ad476 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -43,7 +43,6 @@ public:
player->AddAura(SPELL_BLESSING_OF_BLACKFATHOM, player);
return true;
}
-
};
class go_blackfathom_fire : public GameObjectScript
@@ -64,7 +63,6 @@ public:
}
return false;
}
-
};
class npc_blackfathom_deeps_event : public CreatureScript
@@ -92,9 +90,9 @@ public:
InstanceScript* instance;
- uint32 uiRavageTimer;
- uint32 uiFrostNovaTimer;
- uint32 uiFrostBoltVolleyTimer;
+ uint32 ravageTimer;
+ uint32 frostNovaTimer;
+ uint32 frostBoltVolleyTimer;
bool bFlee;
@@ -102,9 +100,9 @@ public:
{
bFlee = false;
- uiRavageTimer = urand(5000, 8000);
- uiFrostNovaTimer = urand(9000, 12000);
- uiFrostBoltVolleyTimer = urand(2000, 4000);
+ ravageTimer = urand(5000, 8000);
+ frostNovaTimer = urand(9000, 12000);
+ frostBoltVolleyTimer = urand(2000, 4000);
}
void AttackPlayer()
@@ -131,7 +129,7 @@ public:
}
}
- void UpdateAI(const uint32 uiDiff)
+ void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
@@ -140,11 +138,11 @@ public:
{
case NPC_AKU_MAI_SNAPJAW:
{
- if (uiRavageTimer <= uiDiff)
+ if (ravageTimer <= diff)
{
DoCast(me->getVictim(), SPELL_RAVAGE);
- uiRavageTimer = urand(9000, 14000);
- } else uiRavageTimer -= uiDiff;
+ ravageTimer = urand(9000, 14000);
+ } else ravageTimer -= diff;
break;
}
case NPC_MURKSHALLOW_SOFTSHELL:
@@ -159,20 +157,23 @@ public:
}
case NPC_AKU_MAI_SERVANT:
{
- if (uiFrostBoltVolleyTimer <= uiDiff)
+ if (frostBoltVolleyTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
if (target)
DoCast(target, SPELL_FROST_BOLT_VOLLEY);
}
- uiFrostBoltVolleyTimer = urand(5000, 8000);
- } else uiFrostBoltVolleyTimer -= uiDiff;
- if (uiFrostNovaTimer <= uiDiff)
+ frostBoltVolleyTimer = urand(5000, 8000);
+ }
+ else frostBoltVolleyTimer -= diff;
+
+ if (frostNovaTimer <= diff)
{
DoCastAOE(SPELL_FROST_NOVA, false);
- uiFrostNovaTimer = urand(25000, 30000);
- } else uiFrostNovaTimer -= uiDiff;
+ frostNovaTimer = urand(25000, 30000);
+ }
+ else frostNovaTimer -= diff;
break;
}
}
@@ -187,7 +188,6 @@ public:
instance->SetData(DATA_EVENT, instance->GetData(DATA_EVENT) + 1);
}
};
-
};
enum eMorridune
@@ -201,12 +201,12 @@ class npc_morridune : public CreatureScript
public:
npc_morridune() : CreatureScript("npc_morridune") { }
- bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction)
+ bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*Sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
- switch (uiAction)
+ switch (action)
{
- case GOSSIP_ACTION_INFO_DEF+1:
+ case GOSSIP_ACTION_INFO_DEF + 1:
player->TeleportTo(1, 9952.239f, 2284.277f, 1341.394f, 1.595f);
player->CLOSE_GOSSIP_MENU();
break;
@@ -216,7 +216,7 @@ public:
bool OnGossipHello(Player* player, Creature* creature)
{
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MORRIDUNE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MORRIDUNE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
@@ -250,7 +250,6 @@ public:
}
}
};
-
};
void AddSC_blackfathom_deeps()
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h
index 1a14ac38ea4..21768b15895 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 8f1d0025c5b..32a6bcbde77 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,19 +36,19 @@ public:
struct boss_aku_maiAI : public ScriptedAI
{
- boss_aku_maiAI(Creature* c) : ScriptedAI(c)
+ boss_aku_maiAI(Creature* creature) : ScriptedAI(creature)
{
- instance = c->GetInstanceScript();
+ instance = creature->GetInstanceScript();
}
- uint32 uiPoisonCloudTimer;
+ uint32 poisonCloudTimer;
bool bIsEnraged;
InstanceScript* instance;
void Reset()
{
- uiPoisonCloudTimer = urand(5000, 9000);
+ poisonCloudTimer = urand(5000, 9000);
bIsEnraged = false;
if (instance)
instance->SetData(TYPE_AKU_MAI, NOT_STARTED);
@@ -71,11 +71,11 @@ public:
if (!UpdateVictim())
return;
- if (uiPoisonCloudTimer < diff)
+ if (poisonCloudTimer < diff)
{
DoCastVictim(SPELL_POISON_CLOUD);
- uiPoisonCloudTimer = urand(25000, 50000);
- } else uiPoisonCloudTimer -= diff;
+ poisonCloudTimer = urand(25000, 50000);
+ } else poisonCloudTimer -= diff;
if (!bIsEnraged && HealthBelowPct(30))
{
@@ -86,7 +86,6 @@ public:
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_aku_mai()
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp
index a03c0a01d41..5a60a849b75 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,18 +35,18 @@ public:
struct boss_gelihastAI : public ScriptedAI
{
- boss_gelihastAI(Creature* c) : ScriptedAI(c)
+ boss_gelihastAI(Creature* creature) : ScriptedAI(creature)
{
- instance = c->GetInstanceScript();
+ instance = creature->GetInstanceScript();
}
- uint32 uiNetTimer;
+ uint32 netTimer;
InstanceScript* instance;
void Reset()
{
- uiNetTimer = urand(2000, 4000);
+ netTimer = urand(2000, 4000);
if (instance)
instance->SetData(TYPE_GELIHAST, NOT_STARTED);
}
@@ -68,16 +68,15 @@ public:
if (!UpdateVictim())
return;
- if (uiNetTimer < diff)
+ if (netTimer < diff)
{
DoCastVictim(SPELL_NET);
- uiNetTimer = urand(4000, 7000);
- } else uiNetTimer -= diff;
+ netTimer = urand(4000, 7000);
+ } else netTimer -= diff;
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_gelihast()
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp
index 0a282dafac3..7ee17172102 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,20 +44,20 @@ public:
struct boss_kelrisAI : public ScriptedAI
{
- boss_kelrisAI(Creature* c) : ScriptedAI(c)
+ boss_kelrisAI(Creature* creature) : ScriptedAI(creature)
{
- instance = c->GetInstanceScript();
+ instance = creature->GetInstanceScript();
}
- uint32 uiMindBlastTimer;
- uint32 uiSleepTimer;
+ uint32 mindBlastTimer;
+ uint32 sleepTimer;
InstanceScript* instance;
void Reset()
{
- uiMindBlastTimer = urand(2000, 5000);
- uiSleepTimer = urand(9000, 12000);
+ mindBlastTimer = urand(2000, 5000);
+ sleepTimer = urand(9000, 12000);
if (instance)
instance->SetData(TYPE_KELRIS, NOT_STARTED);
}
@@ -81,26 +81,25 @@ public:
if (!UpdateVictim())
return;
- if (uiMindBlastTimer < diff)
+ if (mindBlastTimer < diff)
{
DoCastVictim(SPELL_MIND_BLAST);
- uiMindBlastTimer = urand(7000, 9000);
- } else uiMindBlastTimer -= diff;
+ mindBlastTimer = urand(7000, 9000);
+ } else mindBlastTimer -= diff;
- if (uiSleepTimer < diff)
+ if (sleepTimer < diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoScriptText(SAY_SLEEP, me);
DoCast(target, SPELL_SLEEP);
}
- uiSleepTimer = urand(15000, 20000);
- } else uiSleepTimer -= diff;
+ sleepTimer = urand(15000, 20000);
+ } else sleepTimer -= diff;
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_kelris()
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
index abfb91d5d6e..ea33499a960 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,33 +65,33 @@ public:
{
instance_blackfathom_deeps_InstanceMapScript(Map* map) : InstanceScript(map) {}
- uint64 m_uiTwilightLordKelrisGUID;
- uint64 m_uiShrine1GUID;
- uint64 m_uiShrine2GUID;
- uint64 m_uiShrine3GUID;
- uint64 m_uiShrine4GUID;
- uint64 m_uiShrineOfGelihastGUID;
- uint64 m_uiAltarOfTheDeepsGUID;
- uint64 m_uiMainDoorGUID;
+ uint64 twilightLordKelrisGUID;
+ uint64 shrine1GUID;
+ uint64 shrine2GUID;
+ uint64 shrine3GUID;
+ uint64 shrine4GUID;
+ uint64 shrineOfGelihastGUID;
+ uint64 altarOfTheDeepsGUID;
+ uint64 mainDoorGUID;
- uint8 m_auiEncounter[MAX_ENCOUNTER];
- uint8 m_uiCountFires;
- uint8 uiDeathTimes;
+ uint8 encounter[MAX_ENCOUNTER];
+ uint8 countFires;
+ uint8 deathTimes;
void Initialize()
{
- memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
+ memset(&encounter, 0, sizeof(encounter));
- m_uiTwilightLordKelrisGUID = 0;
- m_uiShrine1GUID = 0;
- m_uiShrine2GUID = 0;
- m_uiShrine3GUID = 0;
- m_uiShrine4GUID = 0;
- m_uiShrineOfGelihastGUID = 0;
- m_uiAltarOfTheDeepsGUID = 0;
- m_uiMainDoorGUID = 0;
- m_uiCountFires = 0;
- uiDeathTimes = 0;
+ twilightLordKelrisGUID = 0;
+ shrine1GUID = 0;
+ shrine2GUID = 0;
+ shrine3GUID = 0;
+ shrine4GUID = 0;
+ shrineOfGelihastGUID = 0;
+ altarOfTheDeepsGUID = 0;
+ mainDoorGUID = 0;
+ countFires = 0;
+ deathTimes = 0;
}
void OnCreatureCreate(Creature* creature)
@@ -99,7 +99,7 @@ public:
switch (creature->GetEntry())
{
case NPC_TWILIGHT_LORD_KELRIS:
- m_uiTwilightLordKelrisGUID = creature->GetGUID();
+ twilightLordKelrisGUID = creature->GetGUID();
break;
case NPC_LORGUS_JETT:
creature->SetHomePosition(LorgusPosition[urand(0, 3)]);
@@ -112,150 +112,149 @@ public:
switch (go->GetEntry())
{
case GO_FIRE_OF_AKU_MAI_1:
- m_uiShrine1GUID = go->GetGUID();
+ shrine1GUID = go->GetGUID();
break;
case GO_FIRE_OF_AKU_MAI_2:
- m_uiShrine2GUID = go->GetGUID();
+ shrine2GUID = go->GetGUID();
break;
case GO_FIRE_OF_AKU_MAI_3:
- m_uiShrine3GUID = go->GetGUID();
+ shrine3GUID = go->GetGUID();
break;
case GO_FIRE_OF_AKU_MAI_4:
- m_uiShrine4GUID = go->GetGUID();
+ shrine4GUID = go->GetGUID();
break;
case GO_SHRINE_OF_GELIHAST:
- m_uiShrineOfGelihastGUID = go->GetGUID();
- if (m_auiEncounter[0] != DONE)
+ shrineOfGelihastGUID = go->GetGUID();
+ if (encounter[0] != DONE)
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
break;
case GO_ALTAR_OF_THE_DEEPS:
- m_uiAltarOfTheDeepsGUID = go->GetGUID();
- if (m_auiEncounter[3] != DONE)
+ altarOfTheDeepsGUID = go->GetGUID();
+ if (encounter[3] != DONE)
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
break;
case GO_AKU_MAI_DOOR:
- if (m_auiEncounter[2] == DONE)
+ if (encounter[2] == DONE)
HandleGameObject(0, true, go);
- m_uiMainDoorGUID = go->GetGUID();
+ mainDoorGUID = go->GetGUID();
break;
}
}
- void SetData(uint32 uiType, uint32 uiData)
+ void SetData(uint32 type, uint32 data)
{
- switch (uiType)
+ switch (type)
{
case TYPE_GELIHAST:
- m_auiEncounter[0] = uiData;
- if (uiData == DONE)
- if (GameObject* go = instance->GetGameObject(m_uiShrineOfGelihastGUID))
+ encounter[0] = data;
+ if (data == DONE)
+ if (GameObject* go = instance->GetGameObject(shrineOfGelihastGUID))
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
break;
case TYPE_AKU_MAI:
- m_auiEncounter[3] = uiData;
- if (uiData == DONE)
- if (GameObject* go = instance->GetGameObject(m_uiAltarOfTheDeepsGUID))
+ encounter[3] = data;
+ if (data == DONE)
+ if (GameObject* go = instance->GetGameObject(altarOfTheDeepsGUID))
{
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
go->SummonCreature(NPC_MORRIDUNE, SpawnsLocation[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
case DATA_FIRE:
- m_uiCountFires = uiData;
- switch (m_uiCountFires)
+ countFires = data;
+ switch (countFires)
{
case 1:
- if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID))
+ if (GameObject* go = instance->GetGameObject(shrine1GUID))
{
- pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
- pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
- pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
- pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
+ go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
+ go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
+ go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
+ go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
case 2:
- if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID))
+ if (GameObject* go = instance->GetGameObject(shrine1GUID))
{
for (uint8 i = 0; i < 2; ++i)
{
- pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
- pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
- pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
- pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
+ go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
+ go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
+ go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
+ go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
}
break;
case 3:
- if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID))
+ if (GameObject* go = instance->GetGameObject(shrine1GUID))
{
- pGO->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
- pGO->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
+ go->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
+ go->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
case 4:
- if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID))
+ if (GameObject* go = instance->GetGameObject(shrine1GUID))
{
- pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
- pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
- pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
- pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
+ go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
+ go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
+ go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
+ go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
}
break;
case DATA_EVENT:
- uiDeathTimes = uiData;
- if (uiDeathTimes == 18)
- HandleGameObject(m_uiMainDoorGUID, true);
+ deathTimes = data;
+ if (deathTimes == 18)
+ HandleGameObject(mainDoorGUID, true);
break;
}
}
- uint32 GetData(uint32 uiType)
+ uint32 GetData(uint32 type)
{
- switch (uiType)
+ switch (type)
{
case TYPE_GELIHAST:
- return m_auiEncounter[0];
+ return encounter[0];
case TYPE_KELRIS:
- return m_auiEncounter[1];
+ return encounter[1];
case TYPE_SHRINE:
- return m_auiEncounter[2];
+ return encounter[2];
case TYPE_AKU_MAI:
- return m_auiEncounter[3];
+ return encounter[3];
case DATA_FIRE:
- return m_uiCountFires;
+ return countFires;
case DATA_EVENT:
- return uiDeathTimes;
+ return deathTimes;
}
return 0;
}
- uint64 GetData64(uint32 uiData)
+ uint64 GetData64(uint32 data)
{
- switch (uiData)
+ switch (data)
{
case DATA_TWILIGHT_LORD_KELRIS:
- return m_uiTwilightLordKelrisGUID;
+ return twilightLordKelrisGUID;
case DATA_SHRINE1:
- return m_uiShrine1GUID;
+ return shrine1GUID;
case DATA_SHRINE2:
- return m_uiShrine2GUID;
+ return shrine2GUID;
case DATA_SHRINE3:
- return m_uiShrine3GUID;
+ return shrine3GUID;
case DATA_SHRINE4:
- return m_uiShrine4GUID;
+ return shrine4GUID;
case DATA_SHRINE_OF_GELIHAST:
- return m_uiShrineOfGelihastGUID;
+ return shrineOfGelihastGUID;
case DATA_MAINDOOR:
- return m_uiMainDoorGUID;
+ return mainDoorGUID;
}
return 0;
}
};
-
};
void AddSC_instance_blackfathom_deeps()
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp
index 6ea2b21fe65..6bc179bba40 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp
index f4252ad3d45..a5239e5a649 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp
index 3f9bca5925b..2885276f2b6 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp
index eabfbfc024c..7d1b292fd12 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp
index 1537b6eed3b..3f39b61192a 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp
index 35de4c70214..12485293650 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h
index 278bf9f68cf..e045d3cbf05 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 187ff9b9dd7..0caec3c7069 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h
index 9f37df3063f..d91c2ead123 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 748d0dfa071..65bc8f6a8e6 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -678,7 +678,7 @@ public:
}
if (i == LastOverronPos && IsOverrun)
{
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACKUNARMED);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACK_UNARMED);
if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21))
{
me->setDeathState(DEAD);
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h
index e2017b1f260..047c0dc308e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 338f320dcc2..b87379d599f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/CullingOfStratholme/boss_epoch.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp
index 8354f1d873c..35c1848456b 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/boss_infinite.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp
index 0b8faa71299..7947c9be48d 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/boss_mal_ganis.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp
index 798ea3925dc..b61838a253a 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/boss_meathook.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp
index 4c00dd5bb2b..c36b98ed510 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/boss_salramm.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp
index 246e4bee24e..7a5e0d06158 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
index 7cbb1b91755..9518abd1635 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -234,53 +234,53 @@ public:
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
- npc_arthasAI* pAI = CAST_AI(npc_arthas::npc_arthasAI, creature->AI());
+ npc_arthasAI* ai = CAST_AI(npc_arthas::npc_arthasAI, creature->AI());
- if (!pAI)
+ if (!ai)
return false;
switch (action)
{
case GOSSIP_ACTION_INFO_DEF:
- pAI->Start(true, true, player->GetGUID(), 0, false, false);
- pAI->SetDespawnAtEnd(false);
- pAI->bStepping = false;
- pAI->uiStep = 1;
+ ai->Start(true, true, player->GetGUID(), 0, false, false);
+ ai->SetDespawnAtEnd(false);
+ ai->bStepping = false;
+ ai->uiStep = 1;
break;
case GOSSIP_ACTION_INFO_DEF+1:
- pAI->bStepping = true;
- pAI->uiStep = 24;
+ ai->bStepping = true;
+ ai->uiStep = 24;
break;
case GOSSIP_ACTION_INFO_DEF+2:
- pAI->SetHoldState(false);
- pAI->bStepping = false;
- pAI->uiStep = 61;
+ ai->SetHoldState(false);
+ ai->bStepping = false;
+ ai->uiStep = 61;
break;
case GOSSIP_ACTION_INFO_DEF+3:
- pAI->SetHoldState(false);
+ ai->SetHoldState(false);
break;
case GOSSIP_ACTION_INFO_DEF+4:
- pAI->bStepping = true;
- pAI->uiStep = 84;
+ ai->bStepping = true;
+ ai->uiStep = 84;
break;
case GOSSIP_ACTION_INFO_DEF+5:
- pAI->bStepping = true;
- pAI->uiStep = 85;
+ ai->bStepping = true;
+ ai->uiStep = 85;
break;
}
player->CLOSE_GOSSIP_MENU();
- pAI->SetDespawnAtFar(true);
+ ai->SetDespawnAtFar(true);
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
return true;
}
bool OnGossipHello(Player* player, Creature* creature)
{
- npc_arthasAI* pAI = CAST_AI(npc_arthas::npc_arthasAI, creature->AI());
+ npc_arthasAI* ai = CAST_AI(npc_arthas::npc_arthasAI, creature->AI());
- if (pAI && pAI->bStepping == false)
+ if (ai && ai->bStepping == false)
{
- switch (pAI->uiGossipStep)
+ switch (ai->uiGossipStep)
{
case 0: //This one is a workaround since the very beggining of the script is wrong.
{
@@ -414,7 +414,7 @@ public:
if (Creature* temp = me->SummonCreature((uint32)RiftAndSpawnsLocations[i][0], RiftAndSpawnsLocations[timeRiftID][1], RiftAndSpawnsLocations[timeRiftID][2], RiftAndSpawnsLocations[timeRiftID][3], RiftAndSpawnsLocations[timeRiftID][4], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000))
{
guidVector[i-timeRiftID-1] = temp->GetGUID();
- temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE);
+ temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
temp->SetReactState(REACT_PASSIVE);
temp->GetMotionMaster()->MovePoint(0, RiftAndSpawnsLocations[i][1], RiftAndSpawnsLocations[i][2], RiftAndSpawnsLocations[i][3]);
if ((uint32)RiftAndSpawnsLocations[i][0] == NPC_EPOCH)
@@ -1003,7 +1003,7 @@ public:
{
pDisguised2->UpdateEntry(NPC_INFINITE_HUNTER, 0);
//Make them unattackable
- pDisguised2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE);
+ pDisguised2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
pDisguised2->SetReactState(REACT_PASSIVE);
}
JumpToNextStep(2000);
@@ -1013,7 +1013,7 @@ public:
{
pDisguised1->UpdateEntry(NPC_INFINITE_AGENT, 0);
//Make them unattackable
- pDisguised1->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE);
+ pDisguised1->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
pDisguised1->SetReactState(REACT_PASSIVE);
}
JumpToNextStep(2000);
@@ -1023,7 +1023,7 @@ public:
{
pDisguised0->UpdateEntry(NPC_INFINITE_ADVERSARY, 0);
//Make them unattackable
- pDisguised0->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE);
+ pDisguised0->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
pDisguised0->SetReactState(REACT_PASSIVE);
}
JumpToNextStep(2000);
@@ -1037,7 +1037,7 @@ public:
for (uint32 i = 0; i< ENCOUNTER_DRACONIAN_NUMBER; ++i)
if (Creature* temp = Unit::GetCreature(*me, uiInfiniteDraconianGUID[i]))
{
- temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE);
+ temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
temp->SetReactState(REACT_AGGRESSIVE);
}
JumpToNextStep(5000);
@@ -1095,7 +1095,7 @@ public:
if (Creature* pEpoch = Unit::GetCreature(*me, uiEpochGUID))
{
//Make Epoch attackable
- pEpoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE);
+ pEpoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
pEpoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pEpoch->SetReactState(REACT_AGGRESSIVE);
}
@@ -1150,7 +1150,7 @@ public:
case 87:
if (Creature* pMalganis = Unit::GetCreature(*me, uiMalganisGUID))
{
- pMalganis->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_UNK_6 | UNIT_FLAG_PASSIVE | UNIT_FLAG_UNK_15);
+ pMalganis->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_UNK_6 | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_UNK_15);
pMalganis->SetReactState(REACT_AGGRESSIVE);
}
JumpToNextStep(1000);
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 ed0f237d600..86014940b91 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 168d78baa87..9a91e1e232b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/DarkPortal/boss_aeonus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp
index 30f3c4c056c..b895b56379c 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/DarkPortal/boss_chrono_lord_deja.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp
index aa775e0947d..99e43495c96 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/DarkPortal/boss_temporus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp
index 9e62244498f..9b272491717 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/DarkPortal/dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp
index 653781a1d3f..4ff34fc3349 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/DarkPortal/dark_portal.h b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.h
index a22f83ae0ed..dc208d8ab09 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/DarkPortal/instance_dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp
index 659a22178f9..dabf3db13cb 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/boss_captain_skarloc.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp
index 488c7195534..89877f2cc7b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/boss_epoch_hunter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp
index 9e6957a5e0c..8307eb44013 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/boss_leutenant_drake.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp
index 28f095dbaf8..1f0ba93645f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 cdcbbf04c60..b179a15e878 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 65ae3287381..b2c4911a20c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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.h b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h
index a4f3a9a86d2..2a7b4703f14 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_celebras_the_cursed.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp
index 8b6b1bc26dc..74e7a919263 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,12 @@ EndScriptData */
#include "ScriptPCH.h"
-#define SPELL_WRATH 21807
-#define SPELL_ENTANGLINGROOTS 12747
-#define SPELL_CORRUPT_FORCES 21968
+enum Spells
+{
+ SPELL_WRATH = 21807,
+ SPELL_ENTANGLINGROOTS = 12747,
+ SPELL_CORRUPT_FORCES = 21968
+};
class celebras_the_cursed : public CreatureScript
{
@@ -41,7 +44,7 @@ public:
struct celebras_the_cursedAI : public ScriptedAI
{
- celebras_the_cursedAI(Creature* c) : ScriptedAI(c) {}
+ celebras_the_cursedAI(Creature* creature) : ScriptedAI(creature) {}
uint32 Wrath_Timer;
uint32 EntanglingRoots_Timer;
@@ -74,14 +77,16 @@ public:
if (target)
DoCast(target, SPELL_WRATH);
Wrath_Timer = 8000;
- } else Wrath_Timer -= diff;
+ }
+ else Wrath_Timer -= diff;
//EntanglingRoots
if (EntanglingRoots_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_ENTANGLINGROOTS);
EntanglingRoots_Timer = 20000;
- } else EntanglingRoots_Timer -= diff;
+ }
+ else EntanglingRoots_Timer -= diff;
//CorruptForces
if (CorruptForces_Timer <= diff)
@@ -89,12 +94,12 @@ public:
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_CORRUPT_FORCES);
CorruptForces_Timer = 20000;
- } else CorruptForces_Timer -= diff;
+ }
+ else CorruptForces_Timer -= diff;
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_celebras_the_cursed()
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp
index 1f9dbf75dcf..418bf3a09ce 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,12 @@ EndScriptData */
#include "ScriptPCH.h"
-#define SPELL_KNOCKAWAY 18670
-#define SPELL_TRAMPLE 5568
-#define SPELL_LANDSLIDE 21808
+enum Spells
+{
+ SPELL_KNOCKAWAY = 18670,
+ SPELL_TRAMPLE = 5568,
+ SPELL_LANDSLIDE = 21808
+};
class boss_landslide : public CreatureScript
{
@@ -41,7 +44,7 @@ public:
struct boss_landslideAI : public ScriptedAI
{
- boss_landslideAI(Creature* c) : ScriptedAI(c) {}
+ boss_landslideAI(Creature* creature) : ScriptedAI(creature) {}
uint32 KnockAway_Timer;
uint32 Trample_Timer;
@@ -68,14 +71,16 @@ public:
{
DoCast(me->getVictim(), SPELL_KNOCKAWAY);
KnockAway_Timer = 15000;
- } else KnockAway_Timer -= diff;
+ }
+ else KnockAway_Timer -= diff;
//Trample_Timer
if (Trample_Timer <= diff)
{
DoCast(me, SPELL_TRAMPLE);
Trample_Timer = 8000;
- } else Trample_Timer -= diff;
+ }
+ else Trample_Timer -= diff;
//Landslide
if (HealthBelowPct(50))
@@ -85,13 +90,13 @@ public:
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_LANDSLIDE);
Landslide_Timer = 60000;
- } else Landslide_Timer -= diff;
+ }
+ else Landslide_Timer -= diff;
}
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_landslide()
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp
index 9fc4f76d8e5..0e3ee5dc52b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,9 +24,11 @@ SDCategory: Maraudon
EndScriptData */
#include "ScriptPCH.h"
-
-#define SPELL_TOXICVOLLEY 21687
-#define SPELL_UPPERCUT 22916
+enum Spells
+{
+ SPELL_TOXICVOLLEY = 21687,
+ SPELL_UPPERCUT = 22916
+};
class boss_noxxion : public CreatureScript
{
@@ -40,7 +42,7 @@ public:
struct boss_noxxionAI : public ScriptedAI
{
- boss_noxxionAI(Creature* c) : ScriptedAI(c) {}
+ boss_noxxionAI(Creature* creature) : ScriptedAI(creature) {}
uint32 ToxicVolley_Timer;
uint32 Uppercut_Timer;
@@ -78,7 +80,8 @@ public:
me->SetDisplayId(11172);
Invisible = false;
//me->m_canMove = true;
- } else if (Invisible)
+ }
+ else if (Invisible)
{
Invisible_Timer -= diff;
//Do nothing while invisible
@@ -94,14 +97,16 @@ public:
{
DoCast(me->getVictim(), SPELL_TOXICVOLLEY);
ToxicVolley_Timer = 9000;
- } else ToxicVolley_Timer -= diff;
+ }
+ else ToxicVolley_Timer -= diff;
//Uppercut_Timer
if (Uppercut_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_UPPERCUT);
Uppercut_Timer = 12000;
- } else Uppercut_Timer -= diff;
+ }
+ else Uppercut_Timer -= diff;
//Adds_Timer
if (!Invisible && Adds_Timer <= diff)
@@ -122,12 +127,12 @@ public:
Invisible_Timer = 15000;
Adds_Timer = 40000;
- } else Adds_Timer -= diff;
+ }
+ else Adds_Timer -= diff;
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_noxxion()
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp
index caa2327511c..bade5655f36 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,10 +25,13 @@ EndScriptData */
#include "ScriptPCH.h"
-#define SPELL_DUSTFIELD 21909
-#define SPELL_BOULDER 21832
-#define SPELL_THRASH 3391
-#define SPELL_REPULSIVEGAZE 21869
+enum Spells
+{
+ SPELL_DUSTFIELD = 21909,
+ SPELL_BOULDER = 21832,
+ SPELL_THRASH = 3391,
+ SPELL_REPULSIVEGAZE = 21869
+};
class boss_princess_theradras : public CreatureScript
{
@@ -42,7 +45,7 @@ public:
struct boss_ptheradrasAI : public ScriptedAI
{
- boss_ptheradrasAI(Creature* c) : ScriptedAI(c) {}
+ boss_ptheradrasAI(Creature* creature) : ScriptedAI(creature) {}
uint32 Dustfield_Timer;
uint32 Boulder_Timer;
@@ -57,9 +60,7 @@ public:
RepulsiveGaze_Timer = 23000;
}
- void EnterCombat(Unit* /*who*/)
- {
- }
+ void EnterCombat(Unit* /*who*/) {}
void JustDied(Unit* /*killer*/)
{
@@ -76,7 +77,8 @@ public:
{
DoCast(me, SPELL_DUSTFIELD);
Dustfield_Timer = 14000;
- } else Dustfield_Timer -= diff;
+ }
+ else Dustfield_Timer -= diff;
//Boulder_Timer
if (Boulder_Timer <= diff)
@@ -86,26 +88,28 @@ public:
if (target)
DoCast(target, SPELL_BOULDER);
Boulder_Timer = 10000;
- } else Boulder_Timer -= diff;
+ }
+ else Boulder_Timer -= diff;
//RepulsiveGaze_Timer
if (RepulsiveGaze_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_REPULSIVEGAZE);
RepulsiveGaze_Timer = 20000;
- } else RepulsiveGaze_Timer -= diff;
+ }
+ else RepulsiveGaze_Timer -= diff;
//Thrash_Timer
if (Thrash_Timer <= diff)
{
DoCast(me, SPELL_THRASH);
Thrash_Timer = 18000;
- } else Thrash_Timer -= diff;
+ }
+ else Thrash_Timer -= diff;
DoMeleeAttackIfReady();
}
};
-
};
void AddSC_boss_ptheradras()
diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
index c76cc790274..3b42fc3ed7b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/instance_onyxias_lair.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp
index a727164564a..1c599ce7c6f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 bd163b2d484..eaf6cac43af 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 fd1966d106c..d0da864809c 100644
--- a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/RazorfenDowns/instance_razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp
index 764b9a1523f..8b138468f4c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
index 9ad593da2ed..ac9bf524e7a 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/RazorfenDowns/razorfen_downs.h b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h
index 8b801c7d5e9..fde1e7b277d 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/RazorfenKraul/instance_razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp
index b747fa31f36..98395305d57 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 496d7d3f3dd..1bc0a3b7a19 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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.h b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h
index 4f54324536b..abc1afb58d8 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 a85dfaa219d..d729764ae01 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_buru.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
index e49099238ae..459dc87a9b8 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_kurinnaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp
index 7b084a3b5fc..36a1ff1bade 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -75,7 +75,7 @@ class boss_kurinnaxx : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp
index 030da10e515..a290b07e60f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -127,7 +127,7 @@ class boss_moam : public CreatureScript
}
// Messing up mana-drain channel
- //if (me->HasUnitState(UNIT_STAT_CASTING))
+ //if (me->HasUnitState(UNIT_STATE_CASTING))
// return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp
index 9e6d0d58392..91c0110abd5 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_rajaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp
index 09972388212..afa8eff5823 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -93,7 +93,7 @@ class boss_rajaxx : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
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 58080d766f5..d4549242a4c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 8386a91a075..14d129a7468 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 34b481c97f4..eaeec50ef7b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
index 43265cb4430..a6409ca056f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp
index 505907cd0f5..9ccff0bff48 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 d6d23cf7426..c0ccd55f219 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 4595e4e5095..b0e5112aa6b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 27aa72d3e55..4d5aff16770 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp
index c9a9865e36e..7f3c19ac69c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@ EndScriptData */
#define SPELL_ARCANE_EXPLOSION 25679
#define SPELL_EARTH_SHOCK 26194
-#define SPELL_TRUE_FULFILLMENT4 26526
+#define SPELL_TRUE_FULFILLMENT 785
#define SPELL_BLINK 28391
class ov_mycoordinates
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp
index b005f9d0953..b03d2dc3a4a 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 @@ struct boss_twinemperorsAI : public ScriptedAI
AfterTeleportTimer = 0;
Abuse_Bug_Timer = urand(10000, 17000);
BugsTimer = 2000;
- me->ClearUnitState(UNIT_STAT_STUNNED);
+ me->ClearUnitState(UNIT_STATE_STUNNED);
DontYellWhenDead = false;
EnrageTimer = 15*60000;
}
@@ -234,7 +234,7 @@ struct boss_twinemperorsAI : public ScriptedAI
DoStopAttack();
DoResetThreat();
DoCast(me, SPELL_TWIN_TELEPORT_VISUAL);
- me->AddUnitState(UNIT_STAT_STUNNED);
+ me->AddUnitState(UNIT_STATE_STUNNED);
AfterTeleport = true;
AfterTeleportTimer = 2000;
tspellcasted = false;
@@ -246,9 +246,9 @@ struct boss_twinemperorsAI : public ScriptedAI
{
if (!tspellcasted)
{
- me->ClearUnitState(UNIT_STAT_STUNNED);
+ me->ClearUnitState(UNIT_STATE_STUNNED);
DoCast(me, SPELL_TWIN_TELEPORT);
- me->AddUnitState(UNIT_STAT_STUNNED);
+ me->AddUnitState(UNIT_STATE_STUNNED);
}
tspellcasted = true;
@@ -256,7 +256,7 @@ struct boss_twinemperorsAI : public ScriptedAI
if (AfterTeleportTimer <= diff)
{
AfterTeleport = false;
- me->ClearUnitState(UNIT_STAT_STUNNED);
+ me->ClearUnitState(UNIT_STATE_STUNNED);
if (Unit* nearu = me->SelectNearestTarget(100))
{
//DoYell(nearu->GetName(), LANG_UNIVERSAL, 0);
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp
index dd63128ddfc..7b30200b0b3 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/instance_temple_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp
index 3b0d38fe2d4..38ea8e8748b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 13b4acbca3e..45e9797328e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 571a7be973f..13c3d56d14c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 36864245305..e61e20c35bc 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 cf72c0305c6..8eb3d20d528 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,7 +98,7 @@ public:
DoScriptText(SAY_MAKE_PREPARATIONS, creature);
creature->setFaction(250);
- creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
CAST_AI(npc_escortAI, (creature->AI()))->Start(false, false, player->GetGUID());
CAST_AI(npc_escortAI, (creature->AI()))->SetDespawnAtFar(false);
@@ -143,7 +143,7 @@ public:
currentEvent = 0;
eventProgress = 0;
me->setActive(true);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
}
uint32 eventTimer;
diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h
index f6cf41ff30f..a39de54ee06 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/instance_zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp
index d48a8fee197..33a2ce73e21 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 97ad7cea315..dd90eaa0e7f 100644
--- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
+++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp
index a33ed68879f..5d26653a1a8 100644
--- a/src/server/scripts/Kalimdor/ashenvale.cpp
+++ b/src/server/scripts/Kalimdor/ashenvale.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -35,34 +35,42 @@ EndContentData */
# npc_torek
####*/
-#define SAY_READY -1000106
-#define SAY_MOVE -1000107
-#define SAY_PREPARE -1000108
-#define SAY_WIN -1000109
-#define SAY_END -1000110
+enum TorekSays
+{
+ SAY_READY = 0,
+ SAY_MOVE = 1,
+ SAY_PREPARE = 2,
+ SAY_WIN = 3,
+ SAY_END = 4,
+};
-#define SPELL_REND 11977
-#define SPELL_THUNDERCLAP 8078
+enum TorekSpells
+{
+ SPELL_REND = 11977,
+ SPELL_THUNDERCLAP = 8078,
+};
-#define QUEST_TOREK_ASSULT 6544
+enum TorekMisc
+{
+ QUEST_TOREK_ASSULT = 6544,
-#define ENTRY_SPLINTERTREE_RAIDER 12859
-#define ENTRY_DURIEL 12860
-#define ENTRY_SILVERWING_SENTINEL 12896
-#define ENTRY_SILVERWING_WARRIOR 12897
+ ENTRY_SPLINTERTREE_RAIDER = 12859,
+ ENTRY_DURIEL = 12860,
+ ENTRY_SILVERWING_SENTINEL = 12896,
+ ENTRY_SILVERWING_WARRIOR = 12897,
+};
class npc_torek : public CreatureScript
{
public:
- npc_torek()
- : CreatureScript("npc_torek")
+ npc_torek() : CreatureScript("npc_torek")
{
}
struct npc_torekAI : public npc_escortAI
{
- npc_torekAI(Creature* c) : npc_escortAI(c) {}
+ npc_torekAI(Creature* creature) : npc_escortAI(creature) {}
uint32 Rend_Timer;
uint32 Thunderclap_Timer;
@@ -78,10 +86,10 @@ class npc_torek : public CreatureScript
switch (i)
{
case 1:
- DoScriptText(SAY_MOVE, me, player);
+ Talk(SAY_MOVE, player->GetGUID());
break;
case 8:
- DoScriptText(SAY_PREPARE, me, player);
+ Talk(SAY_PREPARE, player->GetGUID());
break;
case 19:
//TODO: verify location and creatures amount.
@@ -96,7 +104,7 @@ class npc_torek : public CreatureScript
player->GroupEventHappens(QUEST_TOREK_ASSULT, me);
break;
case 21:
- DoScriptText(SAY_END, me, player);
+ Talk(SAY_END, player->GetGUID());
break;
}
}
@@ -148,7 +156,7 @@ class npc_torek : public CreatureScript
if (quest->GetQuestId() == QUEST_TOREK_ASSULT)
{
//TODO: find companions, make them follow Torek, at any time (possibly done by core/database in future?)
- DoScriptText(SAY_READY, creature, player);
+ creature->AI()->Talk(SAY_READY, player->GetGUID());
creature->setFaction(113);
if (npc_escortAI* pEscortAI = CAST_AI(npc_torekAI, creature->AI()))
diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp
index 6fbc424f3d4..2e621c4a3ba 100644
--- a/src/server/scripts/Kalimdor/azshara.cpp
+++ b/src/server/scripts/Kalimdor/azshara.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp
index 1898186f615..09f4b9415a9 100644
--- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp
+++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp
index cf08c4bfef0..c114c02b16d 100644
--- a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp
+++ b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp
index 19b5e36e113..4c415014eef 100644
--- a/src/server/scripts/Kalimdor/boss_azuregos.cpp
+++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/darkshore.cpp b/src/server/scripts/Kalimdor/darkshore.cpp
index a6450fab6ea..a2c10b94ff9 100644
--- a/src/server/scripts/Kalimdor/darkshore.cpp
+++ b/src/server/scripts/Kalimdor/darkshore.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/desolace.cpp b/src/server/scripts/Kalimdor/desolace.cpp
index 5badc7fe725..421a1d7b38a 100644
--- a/src/server/scripts/Kalimdor/desolace.cpp
+++ b/src/server/scripts/Kalimdor/desolace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp
index d6d2d633890..6c91c64f981 100644
--- a/src/server/scripts/Kalimdor/durotar.cpp
+++ b/src/server/scripts/Kalimdor/durotar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -84,7 +84,7 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (work == true)
- me->HandleEmoteCommand(466);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_WORK_CHOPWOOD);
if (m_uiRebuffTimer <= uiDiff)
{
DoCast(me, SPELL_BUFF_SLEEP);
diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp
index 5b1c285d7b3..eede1aa069a 100644
--- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp
+++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -176,7 +176,7 @@ public:
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
creature->SetSpeed(MOVE_RUN, creature->GetSpeedRate(MOVE_RUN), true);
creature->setFaction(35);
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NON_ATTACKABLE);
+ creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE);
creature->SetReactState(REACT_PASSIVE);
creature->GetMotionMaster()->MovePoint(1, DeserterDisappearPos);
break;
@@ -198,7 +198,7 @@ public:
void Reset()
{
me->RestoreFaction();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_AGGRESSIVE);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
@@ -531,7 +531,7 @@ public:
return;
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
SetCombatMovement(true);
if (me->isInCombat())
diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/felwood.cpp
index b4cc9972b69..91d8a875f17 100644
--- a/src/server/scripts/Kalimdor/felwood.cpp
+++ b/src/server/scripts/Kalimdor/felwood.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/feralas.cpp b/src/server/scripts/Kalimdor/feralas.cpp
index ff7ae84c892..37a0e4e8f88 100644
--- a/src/server/scripts/Kalimdor/feralas.cpp
+++ b/src/server/scripts/Kalimdor/feralas.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp
index b8b8b31ba2c..2d6e34ab9ee 100644
--- a/src/server/scripts/Kalimdor/moonglade.cpp
+++ b/src/server/scripts/Kalimdor/moonglade.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -573,9 +573,151 @@ public:
};
/*####
-#
+# npc_omen
####*/
+enum Omen
+{
+ NPC_OMEN = 15467,
+
+ SPELL_OMEN_CLEAVE = 15284,
+ SPELL_OMEN_STARFALL = 26540,
+ SPELL_OMEN_SUMMON_SPOTLIGHT = 26392,
+ SPELL_ELUNE_CANDLE = 26374,
+
+ GO_ELUNE_TRAP_1 = 180876,
+ GO_ELUNE_TRAP_2 = 180877,
+
+ EVENT_CAST_CLEAVE = 1,
+ EVENT_CAST_STARFALL = 2,
+ EVENT_DESPAWN = 3,
+};
+
+class npc_omen : public CreatureScript
+{
+public:
+ npc_omen() : CreatureScript("npc_omen") { }
+
+ struct npc_omenAI : public ScriptedAI
+ {
+ npc_omenAI(Creature* creature) : ScriptedAI(creature)
+ {
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->GetMotionMaster()->MovePoint(1, 7549.977f, -2855.137f, 456.9678f);
+ }
+
+ EventMap events;
+
+ void MovementInform(uint32 type, uint32 pointId)
+ {
+ if (type != POINT_MOTION_TYPE)
+ return;
+
+ if (pointId == 1)
+ {
+ me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ if (Player* player = me->SelectNearestPlayer(40.0f))
+ AttackStart(player);
+ }
+ }
+
+ void EnterCombat(Unit* /*attacker*/)
+ {
+ events.Reset();
+ events.ScheduleEvent(EVENT_CAST_CLEAVE, urand(3000, 5000));
+ events.ScheduleEvent(EVENT_CAST_STARFALL, urand(8000, 10000));
+ }
+
+ void JustDied(Unit* /*killer*/)
+ {
+ DoCast(SPELL_OMEN_SUMMON_SPOTLIGHT);
+ }
+
+ void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
+ {
+ if (spell->Id == SPELL_ELUNE_CANDLE)
+ {
+ if (me->HasAura(SPELL_OMEN_STARFALL))
+ me->RemoveAurasDueToSpell(SPELL_OMEN_STARFALL);
+
+ events.RescheduleEvent(EVENT_CAST_STARFALL, urand(14000, 16000));
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ switch (events.ExecuteEvent())
+ {
+ case EVENT_CAST_CLEAVE:
+ DoCastVictim(SPELL_OMEN_CLEAVE);
+ events.ScheduleEvent(EVENT_CAST_CLEAVE, urand(8000, 10000));
+ break;
+ case EVENT_CAST_STARFALL:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ DoCast(target, SPELL_OMEN_STARFALL);
+ events.ScheduleEvent(EVENT_CAST_STARFALL, urand(14000, 16000));
+ break;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_omenAI(creature);
+ }
+};
+
+class npc_giant_spotlight : public CreatureScript
+{
+public:
+ npc_giant_spotlight() : CreatureScript("npc_giant_spotlight") { }
+
+ struct npc_giant_spotlightAI : public ScriptedAI
+ {
+ npc_giant_spotlightAI(Creature* creature) : ScriptedAI(creature) {}
+
+ EventMap events;
+
+ void Reset()
+ {
+ events.Reset();
+ events.ScheduleEvent(EVENT_DESPAWN, 5*MINUTE*IN_MILLISECONDS);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ events.Update(diff);
+
+ if (events.ExecuteEvent() == EVENT_DESPAWN)
+ {
+ if (GameObject* trap = me->FindNearestGameObject(GO_ELUNE_TRAP_1, 5.0f))
+ trap->RemoveFromWorld();
+
+ if (GameObject* trap = me->FindNearestGameObject(GO_ELUNE_TRAP_2, 5.0f))
+ trap->RemoveFromWorld();
+
+ if (Creature* omen = me->FindNearestCreature(NPC_OMEN, 5.0f, false))
+ omen->DespawnOrUnsummon();
+
+ me->DespawnOrUnsummon();
+ }
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_giant_spotlightAI(creature);
+ }
+};
+
void AddSC_moonglade()
{
new npc_bunthen_plainswind();
@@ -583,4 +725,6 @@ void AddSC_moonglade()
new npc_silva_filnaveth();
new npc_clintar_dreamwalker();
new npc_clintar_spirit();
+ new npc_omen();
+ new npc_giant_spotlight();
}
diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/mulgore.cpp
index 4cea827e5e7..c689d6954a4 100644
--- a/src/server/scripts/Kalimdor/mulgore.cpp
+++ b/src/server/scripts/Kalimdor/mulgore.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,7 +171,7 @@ public:
break;
case 2:
DoScriptText(EMOTE_EAT_LUNCH, me);
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USESTANDING);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING);
break;
case 3:
if (Player* unit = Unit::GetPlayer(*me, uiPlayerGUID))
diff --git a/src/server/scripts/Kalimdor/orgrimmar.cpp b/src/server/scripts/Kalimdor/orgrimmar.cpp
index 96bc2b009ba..629abb84fc1 100644
--- a/src/server/scripts/Kalimdor/orgrimmar.cpp
+++ b/src/server/scripts/Kalimdor/orgrimmar.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp
index 4fbcef167cc..e6322591bf3 100644
--- a/src/server/scripts/Kalimdor/silithus.cpp
+++ b/src/server/scripts/Kalimdor/silithus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp
index ff6127f336e..c31a7731865 100644
--- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp
+++ b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -154,7 +154,7 @@ public:
DoScriptText(SAY_START, creature);
creature->setFaction(113);
- creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
}
return true;
}
diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp
index fa5f6850689..ff6cdccb66a 100644
--- a/src/server/scripts/Kalimdor/tanaris.cpp
+++ b/src/server/scripts/Kalimdor/tanaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -410,7 +410,7 @@ public:
creature->setFaction(113);
creature->SetFullHealth();
creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
DoScriptText(SAY_OOX_START, creature);
if (npc_escortAI* pEscortAI = CAST_AI(npc_OOX17::npc_OOX17AI, creature->AI()))
diff --git a/src/server/scripts/Kalimdor/teldrassil.cpp b/src/server/scripts/Kalimdor/teldrassil.cpp
index dc4fab4066e..d7cac99c374 100644
--- a/src/server/scripts/Kalimdor/teldrassil.cpp
+++ b/src/server/scripts/Kalimdor/teldrassil.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp
index 25954d2bf52..e12897c1def 100644
--- a/src/server/scripts/Kalimdor/the_barrens.cpp
+++ b/src/server/scripts/Kalimdor/the_barrens.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -512,7 +512,7 @@ public:
//creature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32f);
//creature->GetMotionMaster()->MovePoint(1, -1684, -4333, 2.78f);
creature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79f);
- creature->HandleEmoteCommand(EMOTE_STATE_READYUNARMED);
+ creature->HandleEmoteCommand(EMOTE_STATE_READY_UNARMED);
EventBigWill = true;
Wave_Timer = 1000;
}
diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/thousand_needles.cpp
index 041f477a0b2..2349b4493ce 100644
--- a/src/server/scripts/Kalimdor/thousand_needles.cpp
+++ b/src/server/scripts/Kalimdor/thousand_needles.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/thunder_bluff.cpp b/src/server/scripts/Kalimdor/thunder_bluff.cpp
index 36c81eecb9c..67a876c40b2 100644
--- a/src/server/scripts/Kalimdor/thunder_bluff.cpp
+++ b/src/server/scripts/Kalimdor/thunder_bluff.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/ungoro_crater.cpp b/src/server/scripts/Kalimdor/ungoro_crater.cpp
index 15d900ef45d..0e2a1b2c4d9 100644
--- a/src/server/scripts/Kalimdor/ungoro_crater.cpp
+++ b/src/server/scripts/Kalimdor/ungoro_crater.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/winterspring.cpp b/src/server/scripts/Kalimdor/winterspring.cpp
index 897be7bbfa7..00bb250d64d 100644
--- a/src/server/scripts/Kalimdor/winterspring.cpp
+++ b/src/server/scripts/Kalimdor/winterspring.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/AzjolNerub/Ahnkahet/ahnkahet.h b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h
index e19054d2f46..92d5c782e27 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 cde97f8d37b..b16ad9934d8 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 a2371fa0121..85abaa46a5d 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_herald_volazj.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp
index bc4d4ba5eea..f1eaa0c87c5 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -115,7 +115,7 @@ public:
DoCast(me, INSANITY_VISUAL, true);
// Unattackable
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetControlled(true, UNIT_STAT_STUNNED);
+ me->SetControlled(true, UNIT_STATE_STUNNED);
}
// phase mask
target->CastSpell(target, SPELL_INSANITY_TARGET+insanityHandled, true);
@@ -171,7 +171,7 @@ public:
// Cleanup
Summons.DespawnAll();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetControlled(false, UNIT_STAT_STUNNED);
+ me->SetControlled(false, UNIT_STATE_STUNNED);
}
void EnterCombat(Unit* /*who*/)
@@ -271,7 +271,7 @@ public:
insanityHandled = 0;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetControlled(false, UNIT_STAT_STUNNED);
+ me->SetControlled(false, UNIT_STATE_STUNNED);
me->RemoveAurasDueToSpell(INSANITY_VISUAL);
}
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 b2975797a02..4e1b9da0adb 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
index 9a7dc2f2cc9..0f4b046f7d5 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -82,7 +82,7 @@ public:
boss_taldaramAI(Creature* c) : ScriptedAI(c)
{
instance = c->GetInstanceScript();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
@@ -314,7 +314,7 @@ public:
{
if (!instance)
return;
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->RemoveAurasDueToSpell(SPELL_BEAM_VISUAL);
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp
index 5ba11dd5353..3ae78d4053b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 fa199651950..6e865860403 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 e0892ffb009..79a102c803f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -283,7 +283,7 @@ public:
if (((UndergroundPhase == 0 && HealthBelowPct(75))
|| (UndergroundPhase == 1 && HealthBelowPct(50))
|| (UndergroundPhase == 2 && HealthBelowPct(25)))
- && !me->HasUnitState(UNIT_STAT_CASTING))
+ && !me->HasUnitState(UNIT_STATE_CASTING))
{
GuardianSummoned = false;
VenomancerSummoned = false;
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp
index 605f3a11c8a..da629fd45e9 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_krikthir_the_gatewatcher.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp
index 6a734035005..878e1f7555f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/instance_azjol_nerub.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp
index 6b8299e6c4b..e00db5d6494 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
index 187d82887e7..d01e2663b12 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/ObsidianSanctum/instance_obsidian_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp
index fa685421141..91d67697ebb 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/ObsidianSanctum/obsidian_sanctum.h b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h
index b70dfe6bdc3..a363758f953 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_baltharus_the_warborn.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp
index f602f41ce11..e848c29c466 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -174,7 +174,7 @@ class boss_baltharus_the_warborn : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK))
+ if (me->HasUnitState(UNIT_STATE_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -268,7 +268,7 @@ class npc_baltharus_the_warborn_clone : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
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 107aed734e1..f41522f844d 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -97,7 +97,7 @@ class boss_general_zarithrian : public CreatureScript
{
_Reset();
if (instance->GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && instance->GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE)
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
}
void EnterCombat(Unit* /*who*/)
@@ -148,7 +148,7 @@ class boss_general_zarithrian : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -257,7 +257,7 @@ class npc_onyx_flamecaller : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
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 733af8553e0..78810e27b05 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -137,7 +137,7 @@ class boss_saviana_ragefire : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
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 abfaaa0229d..f9e302d7634 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -189,7 +189,7 @@ class instance_ruby_sanctum : public InstanceMapScript
{
HandleGameObject(FlameWallsGUID, true);
if (Creature* zarithrian = instance->GetCreature(GeneralZarithrianGUID))
- zarithrian->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ zarithrian->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
}
break;
}
@@ -199,7 +199,7 @@ class instance_ruby_sanctum : public InstanceMapScript
{
HandleGameObject(FlameWallsGUID, true);
if (Creature* zarithrian = instance->GetCreature(GeneralZarithrianGUID))
- zarithrian->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ zarithrian->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
}
break;
}
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp
index dc41dcaaf11..cfbbb79c5f6 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 52a4c67e544..02ade2ff3e7 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 e46dc3d741a..d5695a0f39d 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp
index f73e9779248..0848d1e9524 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,7 +111,7 @@ public:
{
RemoveSummons();
me->SetDisplayId(me->GetNativeDisplayId());
- me->ClearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
+ me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
bEventInProgress = false;
bEvent = false;
@@ -167,7 +167,7 @@ public:
uiPhase++;
uiResurrectTimer = 4000;
bEventInProgress = false;
- me->ClearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
+ me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
} else uiResurrectTimer -= uiDiff;
}
@@ -211,14 +211,14 @@ public:
if (!bSummonArmy)
{
bSummonArmy = true;
- me->AddUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
+ me->AddUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
DoCast(me, SPELL_ARMY_DEAD);
}
if (!bDeathArmyDone)
{
if (uiDeathArmyCheckTimer <= uiDiff)
{
- me->ClearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
+ me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
uiDeathArmyCheckTimer = 0;
bDeathArmyDone = true;
} else uiDeathArmyCheckTimer -= uiDiff;
@@ -263,7 +263,7 @@ public:
}
}
- if (!me->HasUnitState(UNIT_STAT_ROOT) && !me->HealthBelowPct(1))
+ if (!me->HasUnitState(UNIT_STATE_ROOT) && !me->HealthBelowPct(1))
DoMeleeAttackIfReady();
}
@@ -273,7 +273,7 @@ public:
{
uiDamage = 0;
me->SetHealth(0);
- me->AddUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED);
+ me->AddUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
RemoveSummons();
switch (uiPhase)
{
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 2f6a01e73d7..9fcfcfa47e5 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 @@ void AggroAllPlayers(Creature* temp)
if (player->isAlive())
{
- temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
temp->SetReactState(REACT_AGGRESSIVE);
temp->SetInCombatWith(player);
player->SetInCombatWith(temp);
@@ -320,7 +320,7 @@ public:
me->SetReactState(REACT_PASSIVE);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
}
InstanceScript* instance;
@@ -453,7 +453,7 @@ public:
me->SetReactState(REACT_PASSIVE);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
}
InstanceScript* instance;
@@ -592,7 +592,7 @@ public:
me->SetReactState(REACT_PASSIVE);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
}
InstanceScript* instance;
@@ -739,7 +739,7 @@ public:
me->SetReactState(REACT_PASSIVE);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
}
InstanceScript* instance;
@@ -895,7 +895,7 @@ public:
me->SetReactState(REACT_PASSIVE);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
}
InstanceScript* instance;
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 1f3db4c4976..9ccd136731a 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 a1e906e214a..c17ea7411a0 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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.h b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h
index d8ce6b9dca7..cb3a43acdd0 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 be83c4d326a..a9e41d90899 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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
@@ -122,6 +122,11 @@ const Position SphereSpawn[6] =
{ 706.6383f, 161.5266f, 155.6701f, 0 },
};
+enum MovementPoints
+{
+ POINT_FALL_GROUND = 1
+};
+
class boss_anubarak_trial : public CreatureScript
{
public:
@@ -530,7 +535,7 @@ public:
{
me->RemoveAurasDueToSpell(SPELL_SUBMERGE_EFFECT);
DoCast(me, SPELL_EMERGE_EFFECT);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
me->CombatStart(me->SelectNearestTarget());
}
else
@@ -538,7 +543,7 @@ public:
if (!me->HasAura(SPELL_PERMAFROST_HELPER))
{
DoCast(me, SPELL_SUBMERGE_EFFECT);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
me->CombatStop();
}
}
@@ -553,82 +558,68 @@ public:
class mob_frost_sphere : public CreatureScript
{
-public:
- mob_frost_sphere() : CreatureScript("mob_frost_sphere") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_frost_sphereAI(creature);
- };
+ public:
+ mob_frost_sphere() : CreatureScript("mob_frost_sphere") { }
- struct mob_frost_sphereAI : public ScriptedAI
- {
- mob_frost_sphereAI(Creature* creature) : ScriptedAI(creature)
+ struct mob_frost_sphereAI : public ScriptedAI
{
- }
-
- bool m_bFall;
- uint32 m_uiPermafrostTimer;
+ mob_frost_sphereAI(Creature* creature) : ScriptedAI(creature)
+ {
+ }
- void Reset()
- {
- m_bFall = false;
- m_uiPermafrostTimer = 0;
- me->SetReactState(REACT_PASSIVE);
- me->SetFlying(true);
- me->SetDisplayId(25144);
- me->SetSpeed(MOVE_RUN, 0.5f, false);
- me->GetMotionMaster()->MoveRandom(20.0f);
- DoCast(SPELL_FROST_SPHERE);
- }
+ void Reset()
+ {
+ _isFalling = false;
+ me->SetReactState(REACT_PASSIVE);
+ me->SetFlying(true);
+ me->SetDisplayId(me->GetCreatureInfo()->Modelid2);
+ me->SetSpeed(MOVE_RUN, 0.5f, false);
+ me->GetMotionMaster()->MoveRandom(20.0f);
+ DoCast(SPELL_FROST_SPHERE);
+ }
- void DamageTaken(Unit* /*who*/, uint32& uiDamage)
- {
- if (me->GetHealth() < uiDamage)
+ void DamageTaken(Unit* /*who*/, uint32& damage)
{
- uiDamage = 0;
- if (!m_bFall)
+ if (me->GetHealth() <= damage)
{
- m_bFall = true;
- me->SetFlying(false);
- me->GetMotionMaster()->MoveIdle();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //At hit the ground
- me->GetMotionMaster()->MoveFall(142.2f, 0);
- //me->FallGround(); //need correct vmap use (i believe it isn't working properly right now)
+ damage = 0;
+ if (!_isFalling)
+ {
+ _isFalling = true;
+ me->GetMotionMaster()->MoveIdle();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //At hit the ground
+ me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH);
+ me->GetMotionMaster()->MoveFall(POINT_FALL_GROUND);
+ }
}
}
- }
- void MovementInform(uint32 uiType, uint32 uiId)
- {
- if (uiType != POINT_MOTION_TYPE) return;
-
- switch (uiId)
+ void MovementInform(uint32 type, uint32 pointId)
{
- case 0:
- m_uiPermafrostTimer = IN_MILLISECONDS;
- break;
- }
- }
+ if (type != EFFECT_MOTION_TYPE)
+ return;
- void UpdateAI(const uint32 uiDiff)
- {
- if (m_uiPermafrostTimer)
- {
- if (m_uiPermafrostTimer <= uiDiff)
+ switch (pointId)
{
- m_uiPermafrostTimer = 0;
- me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE);
- me->SetDisplayId(11686);
- me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f);
- DoCast(SPELL_PERMAFROST_VISUAL);
- DoCast(SPELL_PERMAFROST);
- } else m_uiPermafrostTimer -= uiDiff;
+ case POINT_FALL_GROUND:
+ me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE);
+ me->SetDisplayId(me->GetCreatureInfo()->Modelid1);
+ DoCast(SPELL_PERMAFROST_VISUAL);
+ DoCast(SPELL_PERMAFROST);
+ me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f);
+ break;
+ }
}
- }
- };
+ private:
+ bool _isFalling;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new mob_frost_sphereAI(creature);
+ };
};
class mob_anubarak_spike : public CreatureScript
@@ -656,7 +647,7 @@ public:
void Reset()
{
// For an unknown reason this npc isn't recognize the Aura of Permafrost with this flags =/
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
m_uiTargetGUID = 0;
}
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 7be6775f705..2fe0bd3f397 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -172,7 +172,7 @@ public:
{
Summons.Summon(temp);
temp->SetReactState(REACT_PASSIVE);
- temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
if (playerTeam == ALLIANCE)
{
temp->SetHomePosition(vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 0);
@@ -203,7 +203,7 @@ public:
if (Creature* temp = Unit::GetCreature(*me, *i))
{
temp->SetReactState(REACT_AGGRESSIVE);
- temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
}
}
break;
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 df166c1bf04..fc01ad2efea 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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
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 1ee7bcb4120..1eca7edb590 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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
@@ -155,15 +155,16 @@ public:
ScriptedAI::EnterEvadeMode();
}
- void MovementInform(uint32 uiType, uint32 uiId)
+ void MovementInform(uint32 type, uint32 pointId)
{
- if (uiType != POINT_MOTION_TYPE) return;
+ if (type != POINT_MOTION_TYPE)
+ return;
- switch (uiId)
+ switch (pointId)
{
case 0:
m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR));
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
break;
@@ -215,24 +216,24 @@ public:
Summons.Despawn(summon);
}
- void UpdateAI(const uint32 uiDiff)
+ void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
- if (m_uiImpaleTimer <= uiDiff)
+ if (m_uiImpaleTimer <= diff)
{
DoCastVictim(SPELL_IMPALE);
m_uiImpaleTimer = urand(8*IN_MILLISECONDS, 10*IN_MILLISECONDS);
- } else m_uiImpaleTimer -= uiDiff;
+ } else m_uiImpaleTimer -= diff;
- if (m_uiStaggeringStompTimer <= uiDiff)
+ if (m_uiStaggeringStompTimer <= diff)
{
DoCastVictim(SPELL_STAGGERING_STOMP);
m_uiStaggeringStompTimer = urand(20*IN_MILLISECONDS, 25*IN_MILLISECONDS);
- } else m_uiStaggeringStompTimer -= uiDiff;
+ } else m_uiStaggeringStompTimer -= diff;
- if (m_uiSummonTimer <= uiDiff)
+ if (m_uiSummonTimer <= diff)
{
if (m_uiSummonCount > 0)
{
@@ -240,7 +241,7 @@ public:
DoScriptText(SAY_SNOBOLLED, me);
}
m_uiSummonTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
- } else m_uiSummonTimer -= uiDiff;
+ } else m_uiSummonTimer -= diff;
DoMeleeAttackIfReady();
}
@@ -286,7 +287,7 @@ public:
if (m_instance)
m_uiBossGUID = m_instance->GetData64(NPC_GORMOK);
//Workaround for Snobold
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
}
void EnterEvadeMode()
@@ -308,11 +309,12 @@ public:
uiDamage = 0;
}
- void MovementInform(uint32 uiType, uint32 uiId)
+ void MovementInform(uint32 type, uint32 pointId)
{
- if (uiType != POINT_MOTION_TYPE) return;
+ if (type != POINT_MOTION_TYPE)
+ return;
- switch (uiId)
+ switch (pointId)
{
case 0:
if (m_bTargetDied)
@@ -330,7 +332,7 @@ public:
m_instance->SetData(DATA_SNOBOLD_COUNT, DECREASE);
}
- void UpdateAI(const uint32 uiDiff)
+ void UpdateAI(uint32 const diff)
{
if (m_bTargetDied || !UpdateVictim())
return;
@@ -357,29 +359,29 @@ public:
}
}
- if (m_uiFireBombTimer < uiDiff)
+ if (m_uiFireBombTimer < diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_FIRE_BOMB);
m_uiFireBombTimer = 20000;
}
- else m_uiFireBombTimer -= uiDiff;
+ else m_uiFireBombTimer -= diff;
- if (m_uiBatterTimer < uiDiff)
+ if (m_uiBatterTimer < diff)
{
if (Unit* target = Unit::GetPlayer(*me, m_uiTargetGUID))
DoCast(target, SPELL_BATTER);
m_uiBatterTimer = 10000;
}
- else m_uiBatterTimer -= uiDiff;
+ else m_uiBatterTimer -= diff;
- if (m_uiHeadCrackTimer < uiDiff)
+ if (m_uiHeadCrackTimer < diff)
{
if (Unit* target = Unit::GetPlayer(*me, m_uiTargetGUID))
DoCast(target, SPELL_HEAD_CRACK);
m_uiHeadCrackTimer = 35000;
}
- else m_uiHeadCrackTimer -= uiDiff;
+ else m_uiHeadCrackTimer -= diff;
DoMeleeAttackIfReady();
}
@@ -450,7 +452,7 @@ struct boss_jormungarAI : public ScriptedAI
instanceScript->SetData(TYPE_NORTHREND_BEASTS, SNAKES_IN_PROGRESS);
}
- void UpdateAI(const uint32 uiDiff)
+ void UpdateAI(uint32 const diff)
{
if (!UpdateVictim()) return;
@@ -458,7 +460,7 @@ struct boss_jormungarAI : public ScriptedAI
{
DoScriptText(SAY_EMERGE, me);
me->RemoveAurasDueToSpell(SPELL_SUBMERGE_0);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
DoCast(SPELL_ENRAGE);
enraged = true;
DoScriptText(SAY_BERSERK, me);
@@ -478,98 +480,98 @@ struct boss_jormungarAI : public ScriptedAI
switch (stage)
{
case 0: // Mobile
- if (biteTimer <= uiDiff)
+ if (biteTimer <= diff)
{
DoCastVictim(biteSpell);
biteTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
- } else biteTimer -= uiDiff;
+ } else biteTimer -= diff;
- if (spewTimer <= uiDiff)
+ if (spewTimer <= diff)
{
DoCastAOE(spewSpell);
spewTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
- } else spewTimer -= uiDiff;
+ } else spewTimer -= diff;
- if (slimePoolTimer <= uiDiff)
+ if (slimePoolTimer <= diff)
{
/* Spell summon has only 30s duration */
DoCast(me, SUMMON_SLIME_POOL);
slimePoolTimer = 30*IN_MILLISECONDS;
- } else slimePoolTimer -= uiDiff;
+ } else slimePoolTimer -= diff;
- if (submergeTimer <= uiDiff && !enraged)
+ if (submergeTimer <= diff && !enraged)
{
stage = 1;
submergeTimer = 5*IN_MILLISECONDS;
- } else submergeTimer -= uiDiff;
+ } else submergeTimer -= diff;
DoMeleeAttackIfReady();
break;
case 1: // Submerge
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
DoCast(me, SPELL_SUBMERGE_0);
DoScriptText(SAY_SUBMERGE, me);
- me->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX()+urand(0, 80)-40, ToCCommonLoc[1].GetPositionY()+urand(0, 80)-40, ToCCommonLoc[1].GetPositionZ());
+ me->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX()+ frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionY() + frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionZ());
stage = 2;
case 2: // Wait til emerge
- if (submergeTimer <= uiDiff)
+ if (submergeTimer <= diff)
{
stage = 3;
submergeTimer = 50*IN_MILLISECONDS;
- } else submergeTimer -= uiDiff;
+ } else submergeTimer -= diff;
break;
case 3: // Emerge
me->SetDisplayId(modelStationary);
DoScriptText(SAY_EMERGE, me);
me->RemoveAurasDueToSpell(SPELL_SUBMERGE_0);
DoCast(me, SPELL_EMERGE_0);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
SetCombatMovement(false);
me->GetMotionMaster()->MoveIdle();
stage = 4;
break;
case 4: // Stationary
- if (sprayTimer <= uiDiff)
+ if (sprayTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, spraySpell);
sprayTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
- } else sprayTimer -= uiDiff;
+ } else sprayTimer -= diff;
- if (sweepTimer <= uiDiff)
+ if (sweepTimer <= diff)
{
DoCastAOE(SPELL_SWEEP_0);
sweepTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
- } else sweepTimer -= uiDiff;
+ } else sweepTimer -= diff;
- if (submergeTimer <= uiDiff)
+ if (submergeTimer <= diff)
{
stage = 5;
submergeTimer = 10*IN_MILLISECONDS;
- } else submergeTimer -= uiDiff;
+ } else submergeTimer -= diff;
DoSpellAttackIfReady(spitSpell);
break;
case 5: // Submerge
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
DoCast(me, SPELL_SUBMERGE_0);
DoScriptText(SAY_SUBMERGE, me);
- me->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX()+urand(0, 80)-40, ToCCommonLoc[1].GetPositionY()+urand(0, 80)-40, ToCCommonLoc[1].GetPositionZ());
+ me->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX() + frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionY() + frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionZ());
stage = 6;
case 6: // Wait til emerge
- if (submergeTimer <= uiDiff)
+ if (submergeTimer <= diff)
{
stage = 7;
submergeTimer = 45*IN_MILLISECONDS;
- } else submergeTimer -= uiDiff;
+ } else submergeTimer -= diff;
break;
case 7: // Emerge
me->SetDisplayId(modelMobile);
DoScriptText(SAY_EMERGE, me);
me->RemoveAurasDueToSpell(SPELL_SUBMERGE_0);
DoCast(me, SPELL_EMERGE_0);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
SetCombatMovement(true);
me->GetMotionMaster()->MoveChase(me->getVictim());
@@ -662,20 +664,21 @@ public:
stage = 0;
}
- void MovementInform(uint32 uiType, uint32 uiId)
+ void MovementInform(uint32 type, uint32 pointId)
{
- if (uiType != POINT_MOTION_TYPE) return;
+ if (type != POINT_MOTION_TYPE)
+ return;
- switch (uiId)
+ switch (pointId)
{
case 0:
instanceScript->DoUseDoorOrButton(instanceScript->GetData64(GO_MAIN_GATE_DOOR));
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
if (Creature* otherWorm = Unit::GetCreature(*me, instanceScript->GetData64(otherWormEntry)))
{
- otherWorm->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ otherWorm->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
otherWorm->SetReactState(REACT_AGGRESSIVE);
otherWorm->SetVisible(true);
otherWorm->SetInCombatWithZone();
@@ -728,7 +731,7 @@ public:
me->SetReactState(REACT_PASSIVE);
}
- void UpdateAI(const uint32 /*uiDiff*/)
+ void UpdateAI(uint32 const /*diff*/)
{
if (!casted)
{
@@ -795,11 +798,12 @@ public:
m_instance->SetData(TYPE_NORTHREND_BEASTS, ICEHOWL_DONE);
}
- void MovementInform(uint32 uiType, uint32 uiId)
+ void MovementInform(uint32 type, uint32 pointId)
{
- if (uiType != POINT_MOTION_TYPE) return;
+ if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE)
+ return;
- switch (uiId)
+ switch (pointId)
{
case 0:
if (me->GetDistance2d(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY()) < 6.0f)
@@ -813,7 +817,9 @@ public:
if (Unit::GetPlayer(*me, m_uiTrampleTargetGUID))
{
m_uiStage = 4;
- } else m_uiStage = 6;
+ }
+ else
+ m_uiStage = 6;
}
break;
case 1: // Finish trample
@@ -821,7 +827,7 @@ public:
break;
case 2:
m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR));
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
break;
@@ -860,7 +866,7 @@ public:
me->SetInCombatWithZone();
}
- void SpellHitTarget(Unit* target, const SpellInfo* spell)
+ void SpellHitTarget(Unit* target, SpellInfo const* spell)
{
if (spell->Id == SPELL_TRAMPLE && target->GetTypeId() == TYPEID_PLAYER)
{
@@ -872,7 +878,7 @@ public:
}
}
- void UpdateAI(const uint32 uiDiff)
+ void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
@@ -880,31 +886,31 @@ public:
switch (m_uiStage)
{
case 0:
- if (m_uiFerociousButtTimer <= uiDiff)
+ if (m_uiFerociousButtTimer <= diff)
{
DoCastVictim(SPELL_FEROCIOUS_BUTT);
m_uiFerociousButtTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
- } else m_uiFerociousButtTimer -= uiDiff;
+ } else m_uiFerociousButtTimer -= diff;
- if (m_uiArticBreathTimer <= uiDiff)
+ if (m_uiArticBreathTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_ARCTIC_BREATH);
m_uiArticBreathTimer = urand(25*IN_MILLISECONDS, 40*IN_MILLISECONDS);
- } else m_uiArticBreathTimer -= uiDiff;
+ } else m_uiArticBreathTimer -= diff;
- if (m_uiWhirlTimer <= uiDiff)
+ if (m_uiWhirlTimer <= diff)
{
DoCastAOE(SPELL_WHIRL);
m_uiWhirlTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
- } else m_uiWhirlTimer -= uiDiff;
+ } else m_uiWhirlTimer -= diff;
- if (m_uiMassiveCrashTimer <= uiDiff)
+ if (m_uiMassiveCrashTimer <= diff)
{
me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 10.0f, 20.0f); // 1: Middle of the room
m_uiStage = 7; //Invalid (Do nothing more than move)
m_uiMassiveCrashTimer = 30*IN_MILLISECONDS;
- } else m_uiMassiveCrashTimer -= uiDiff;
+ } else m_uiMassiveCrashTimer -= diff;
DoMeleeAttackIfReady();
break;
@@ -927,7 +933,7 @@ public:
} else m_uiStage = 6;
break;
case 3:
- if (m_uiTrampleTimer <= uiDiff)
+ if (m_uiTrampleTimer <= diff)
{
if (Unit* target = Unit::GetPlayer(*me, m_uiTrampleTargetGUID))
{
@@ -942,7 +948,7 @@ public:
10.0f, 20.0f); // 2: Hop Backwards
m_uiStage = 7; //Invalid (Do nothing more than move)
} else m_uiStage = 6;
- } else m_uiTrampleTimer -= uiDiff;
+ } else m_uiTrampleTimer -= diff;
break;
case 4:
DoScriptText(SAY_TRAMPLE_START, me);
@@ -953,12 +959,12 @@ public:
case 5:
if (m_bMovementFinish)
{
- if (m_uiTrampleTimer <= uiDiff) DoCastAOE(SPELL_TRAMPLE);
+ if (m_uiTrampleTimer <= diff) DoCastAOE(SPELL_TRAMPLE);
m_bMovementFinish = false;
m_uiStage = 6;
return;
}
- if (m_uiTrampleTimer <= uiDiff)
+ if (m_uiTrampleTimer <= diff)
{
Map::PlayerList const &lPlayers = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
@@ -971,7 +977,7 @@ public:
break;
}
}
- } else m_uiTrampleTimer -= uiDiff;
+ } else m_uiTrampleTimer -= diff;
break;
case 6:
if (!m_bTrampleCasted)
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 495faf6f855..c1009963df0 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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
@@ -172,7 +172,7 @@ struct boss_twin_baseAI : public ScriptedAI
uint32 m_uiTouchSpellId;
void Reset() {
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_PASSIVE);
me->ModifyAuraState(m_uiAuraState, true);
/* Uncomment this once that they are flying above the ground
@@ -205,7 +205,7 @@ struct boss_twin_baseAI : public ScriptedAI
{
case 1:
m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR));
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_AGGRESSIVE);
break;
}
@@ -572,7 +572,7 @@ struct mob_unleashed_ballAI : public ScriptedAI
void Reset()
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_PASSIVE);
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->SetFlying(true);
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 99a6abb91a9..03de3d374ef 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 76295f403fa..3831e4824ad 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -429,7 +429,7 @@ class npc_fizzlebang_toc : public CreatureScript
case 1130:
me->GetMotionMaster()->MovementExpired();
DoScriptText(SAY_STAGE_1_03, me);
- me->HandleEmoteCommand(EMOTE_ONESHOT_SPELLCAST_OMNI);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_SPELL_CAST_OMNI);
if (Unit* pTrigger = me->SummonCreature(NPC_TRIGGER, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 4.69494f, TEMPSUMMON_MANUAL_DESPAWN))
{
m_uiTriggerGUID = pTrigger->GetGUID();
@@ -446,7 +446,7 @@ class npc_fizzlebang_toc : public CreatureScript
m_uiUpdateTimer = 4000;
break;
case 1134:
- me->HandleEmoteCommand(EMOTE_ONESHOT_SPELLCAST_OMNI);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_SPELL_CAST_OMNI);
if (Creature* pPortal = me->SummonCreature(NPC_WILFRED_PORTAL, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 4.71239f, TEMPSUMMON_MANUAL_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
@@ -563,7 +563,7 @@ class npc_tirion_toc : public CreatureScript
if (Creature* temp = me->SummonCreature(NPC_GORMOK, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30*IN_MILLISECONDS))
{
temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ());
- temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
temp->SetReactState(REACT_PASSIVE);
}
}
@@ -591,13 +591,13 @@ class npc_tirion_toc : public CreatureScript
if (Creature* temp = me->SummonCreature(NPC_DREADSCALE, ToCSpawnLoc[1].GetPositionX(), ToCSpawnLoc[1].GetPositionY(), ToCSpawnLoc[1].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN))
{
temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[8].GetPositionX(), ToCCommonLoc[8].GetPositionY(), ToCCommonLoc[8].GetPositionZ());
- temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
temp->SetReactState(REACT_PASSIVE);
}
if (Creature* temp = me->SummonCreature(NPC_ACIDMAW, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN))
{
temp->SetVisible(true);
- temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
temp->SetReactState(REACT_PASSIVE);
}
}
@@ -623,7 +623,7 @@ class npc_tirion_toc : public CreatureScript
if (Creature* temp = me->SummonCreature(NPC_ICEHOWL, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_DEAD_DESPAWN))
{
temp->GetMotionMaster()->MovePoint(2, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ());
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_PASSIVE);
}
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp
index 48616d8e6e4..e96ef4ff366 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
index e877126364e..5418cf8c4d0 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -100,8 +100,8 @@ public:
lSummons.DespawnAll();
crystalHandlerAmount = 0;
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
@@ -136,7 +136,7 @@ public:
}
instance->SetData(DATA_NOVOS_EVENT, IN_PROGRESS);
}
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
@@ -227,7 +227,7 @@ public:
if (luiCrystals.empty())
{
me->CastStop();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Phase = PHASE_2;
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp
index d877bbd0842..97f2ee4e9a1 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
index fdd27c73171..9fc964000e3 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 816ff0dfba0..46d6414978f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 865f98a0203..8e5e7c3e185 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
index 1e29ec55dc8..4a28ebe6495 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,6 +67,7 @@ class boss_bronjahm : public CreatureScript
{
boss_bronjahmAI(Creature* creature) : BossAI(creature, DATA_BRONJAHM)
{
+ DoCast(me, SPELL_SOULSTORM_CHANNEL, true);
}
void InitializeAI()
@@ -82,14 +83,17 @@ class boss_bronjahm : public CreatureScript
events.Reset();
events.SetPhase(PHASE_1);
events.ScheduleEvent(EVENT_SHADOW_BOLT, 2000);
- events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 15000));
+ events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 20000));
events.ScheduleEvent(EVENT_CORRUPT_SOUL, urand(25000, 35000), 0, PHASE_1);
- me->CastSpell(me, SPELL_SOULSTORM_CHANNEL, true);
-
instance->SetBossState(DATA_BRONJAHM, NOT_STARTED);
}
+ void JustReachedHome()
+ {
+ DoCast(me, SPELL_SOULSTORM_CHANNEL, true);
+ }
+
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
@@ -118,7 +122,7 @@ class boss_bronjahm : public CreatureScript
events.SetPhase(PHASE_2);
DoCast(me, SPELL_TELEPORT);
events.ScheduleEvent(EVENT_FEAR, urand(12000, 16000), 0, PHASE_2);
- events.ScheduleEvent(EVENT_SOULSTORM, 700, 0, PHASE_2);
+ events.ScheduleEvent(EVENT_SOULSTORM, 100, 0, PHASE_2);
}
}
@@ -138,7 +142,7 @@ class boss_bronjahm : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -147,7 +151,7 @@ class boss_bronjahm : public CreatureScript
{
case EVENT_MAGIC_BANE:
DoCastVictim(SPELL_MAGIC_S_BANE);
- events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 15000));
+ events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 20000));
break;
case EVENT_SHADOW_BOLT:
if (!me->IsWithinMeleeRange(me->getVictim()))
@@ -201,7 +205,7 @@ class mob_corrupted_soul_fragment : public CreatureScript
void MovementInform(uint32 type, uint32 id)
{
- if (type != TARGETED_MOTION_TYPE)
+ if (type != CHASE_MOTION_TYPE)
return;
if (instance)
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 68223f170c5..ad49f6cbce8 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -260,7 +260,7 @@ class boss_devourer_of_souls : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -306,6 +306,7 @@ class boss_devourer_of_souls : public CreatureScript
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
me->SetOrientation(me->GetAngle(target));
+ me->SendMovementFlagUpdate();
DoCast(me, SPELL_WAILING_SOULS_BEAM);
}
@@ -332,6 +333,7 @@ class boss_devourer_of_souls : public CreatureScript
case EVENT_WAILING_SOULS_TICK:
beamAngle += beamAngleDiff;
me->SetOrientation(beamAngle);
+ me->SendMovementFlagUpdate();
me->StopMoving();
DoCast(me, SPELL_WAILING_SOULS);
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 f6062951228..c8f18dba1d0 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -441,7 +441,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -497,7 +497,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -555,7 +555,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -612,7 +612,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -672,7 +672,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -738,7 +738,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -811,7 +811,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -878,7 +878,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
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 9f34e412847..ca68314df18 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 0425a34d8dc..bad4b8e38b2 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 2eab25c51c1..9cfcb78f6f1 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp
index eb8b0d06146..a9bfb603794 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -100,7 +100,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.ExecuteEvent())
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 cd9037d6489..1583bdbdcd4 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -659,7 +659,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -742,7 +742,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -842,7 +842,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -912,7 +912,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -978,7 +978,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
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 2aab61b006c..1557fd1a56b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 655856208cc..3c4d05854bb 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 d8fddad41dc..0f9495d4928 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -190,7 +190,7 @@ class boss_garfrost : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
index 33ce2ac71fd..8e211cbd2cb 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -215,7 +215,7 @@ class boss_ick : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
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 7a6aefe90fb..d6b2c2e3a97 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/instance_pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp
index 29a89328336..24529801564 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 034bfafe8b0..25cd292d390 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -72,7 +72,7 @@ class mob_ymirjar_flamebearer : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
@@ -187,7 +187,7 @@ class mob_wrathbone_laborer : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
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 e4282dfa5fa..728e0ccd955 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 57c14993e2d..b66c3d795f3 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -97,7 +97,7 @@ class boss_drakkari_colossus : public CreatureScript
if (GetData(DATA_INTRO_DONE))
{
me->SetReactState(REACT_AGGRESSIVE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->RemoveAura(SPELL_FREEZE_ANIM);
}
@@ -149,7 +149,7 @@ class boss_drakkari_colossus : public CreatureScript
me->GetMotionMaster()->MoveIdle();
me->SetReactState(REACT_PASSIVE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
DoCast(me, SPELL_FREEZE_ANIM);
break;
case ACTION_UNFREEZE_COLOSSUS:
@@ -158,7 +158,7 @@ class boss_drakkari_colossus : public CreatureScript
return;
me->SetReactState(REACT_AGGRESSIVE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->RemoveAura(SPELL_FREEZE_ANIM);
me->SetInCombatWithZone();
@@ -172,7 +172,7 @@ class boss_drakkari_colossus : public CreatureScript
void DamageTaken(Unit* /*attacker*/, uint32& damage)
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))
damage = 0;
if (phase == COLOSSUS_PHASE_NORMAL ||
@@ -212,7 +212,7 @@ class boss_drakkari_colossus : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -289,7 +289,7 @@ class boss_drakkari_elemental : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -335,7 +335,7 @@ class boss_drakkari_elemental : public CreatureScript
damage = 0;
// to prevent spell spaming
- if (me->HasUnitState(UNIT_STAT_CHARGING))
+ if (me->HasUnitState(UNIT_STATE_CHARGING))
return;
// not sure about this, the idea of this code is to prevent bug the elemental
diff --git a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp
index 1b40dab2aad..c665d3cdf5a 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp
index ea1ac951eb6..daa5ee86483 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -148,7 +148,7 @@ public:
DoScriptText(SAY_TRANSFORM_1, me);
uiTransformationTimer = 5*IN_MILLISECONDS;
bStartOfTransformation = true;
- me->ClearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
+ me->ClearUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT);
me->SetReactState(REACT_AGGRESSIVE);
}
else
@@ -158,7 +158,7 @@ public:
if (bStartOfTransformation)
{
bStartOfTransformation = false;
- me->AddUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
+ me->AddUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT);
me->SetReactState(REACT_PASSIVE);
}
}
@@ -191,7 +191,7 @@ public:
DoScriptText(SAY_TRANSFORM_2, me);
uiTransformationTimer = 9*IN_MILLISECONDS;
bStartOfTransformation = true;
- me->ClearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
+ me->ClearUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT);
me->SetReactState(REACT_AGGRESSIVE);
}
else
@@ -201,7 +201,7 @@ public:
if (bStartOfTransformation)
{
bStartOfTransformation = false;
- me->AddUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
+ me->AddUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT);
me->SetReactState(REACT_PASSIVE);
}
}
diff --git a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp
index 07ade9c0201..1085e993322 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp
index f2b9fb704d5..5071802f897 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/gundrak.h b/src/server/scripts/Northrend/Gundrak/gundrak.h
index 08cdd24c724..4c1c04c5559 100644
--- a/src/server/scripts/Northrend/Gundrak/gundrak.h
+++ b/src/server/scripts/Northrend/Gundrak/gundrak.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 d4c55d80dc0..c0fc722385b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 4a5d609eb67..f5e207a9442 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -287,7 +287,7 @@ class boss_blood_council_controller : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -383,7 +383,7 @@ class boss_prince_keleseth_icc : public CreatureScript
events.Reset();
summons.DespawnAll();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
_isEmpowered = false;
me->SetHealth(_spawnHealth);
instance->SetData(DATA_ORB_WHISPERER_ACHIEVEMENT, uint32(true));
@@ -489,7 +489,7 @@ class boss_prince_keleseth_icc : public CreatureScript
{
case ACTION_STAND_UP:
me->RemoveAurasDueToSpell(SPELL_FEIGN_DEATH);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
me->ForceValuesUpdateAtIndex(UNIT_NPC_FLAGS); // was in sniff. don't ask why
@@ -535,7 +535,7 @@ class boss_prince_keleseth_icc : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -607,7 +607,7 @@ class boss_prince_taldaram_icc : public CreatureScript
events.Reset();
summons.DespawnAll();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
_isEmpowered = false;
me->SetHealth(_spawnHealth);
instance->SetData(DATA_ORB_WHISPERER_ACHIEVEMENT, uint32(true));
@@ -707,7 +707,7 @@ class boss_prince_taldaram_icc : public CreatureScript
{
case ACTION_STAND_UP:
me->RemoveAurasDueToSpell(SPELL_FEIGN_DEATH);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
me->ForceValuesUpdateAtIndex(UNIT_NPC_FLAGS); // was in sniff. don't ask why
@@ -753,7 +753,7 @@ class boss_prince_taldaram_icc : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -830,7 +830,7 @@ class boss_prince_valanar_icc : public CreatureScript
events.Reset();
summons.DespawnAll();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
_isEmpowered = false;
me->SetHealth(me->GetMaxHealth());
instance->SetData(DATA_ORB_WHISPERER_ACHIEVEMENT, uint32(true));
@@ -944,7 +944,7 @@ class boss_prince_valanar_icc : public CreatureScript
{
case ACTION_STAND_UP:
me->RemoveAurasDueToSpell(SPELL_FEIGN_DEATH);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
me->ForceValuesUpdateAtIndex(UNIT_NPC_FLAGS); // was in sniff. don't ask why
@@ -990,7 +990,7 @@ class boss_prince_valanar_icc : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -1159,7 +1159,7 @@ class npc_ball_of_flame : public CreatureScript
void MovementInform(uint32 type, uint32 id)
{
- if (type == TARGETED_MOTION_TYPE && id == GUID_LOPART(_chaseGUID) && _chaseGUID)
+ if (type == CHASE_MOTION_TYPE && id == GUID_LOPART(_chaseGUID) && _chaseGUID)
{
me->RemoveAurasDueToSpell(SPELL_BALL_OF_FLAMES_PERIODIC);
DoCast(me, SPELL_FLAMES);
@@ -1179,7 +1179,7 @@ class npc_ball_of_flame : public CreatureScript
if (Player* target = ObjectAccessor::GetPlayer(*me, _chaseGUID))
{
// need to clear states now because this call is before AuraEffect is fully removed
- me->ClearUnitState(UNIT_STAT_CASTING | UNIT_STAT_STUNNED);
+ me->ClearUnitState(UNIT_STATE_CASTING | UNIT_STATE_STUNNED);
if (target && me->Attack(target, true))
me->GetMotionMaster()->MoveChase(target, 1.0f);
}
@@ -1316,7 +1316,7 @@ class npc_dark_nucleus : public CreatureScript
}
DoCast(who, SPELL_SHADOW_RESONANCE_RESIST);
- me->ClearUnitState(UNIT_STAT_CASTING);
+ me->ClearUnitState(UNIT_STATE_CASTING);
}
void MoveInLineOfSight(Unit* who)
@@ -1350,7 +1350,7 @@ class npc_dark_nucleus : public CreatureScript
!victim->HasAura(SPELL_SHADOW_RESONANCE_RESIST, me->GetGUID()))
{
DoCast(victim, SPELL_SHADOW_RESONANCE_RESIST);
- me->ClearUnitState(UNIT_STAT_CASTING);
+ me->ClearUnitState(UNIT_STATE_CASTING);
}
}
else
@@ -1369,7 +1369,7 @@ class npc_dark_nucleus : public CreatureScript
_lockedTarget = true;
AttackStart(victim);
DoCast(victim, SPELL_SHADOW_RESONANCE_RESIST);
- me->ClearUnitState(UNIT_STAT_CASTING);
+ me->ClearUnitState(UNIT_STATE_CASTING);
}
}
}
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 559c9ae6aa9..79a577f6591 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,7 @@ class boss_blood_queen_lana_thel : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
index 4703e827522..3c795187f43 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -279,7 +279,7 @@ class boss_deathbringer_saurfang : public CreatureScript
events.Reset();
events.SetPhase(PHASE_COMBAT);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
if (!_introDone)
{
DoCast(me, SPELL_GRIP_OF_AGONY);
@@ -314,7 +314,7 @@ class boss_deathbringer_saurfang : public CreatureScript
void AttackStart(Unit* victim)
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))
return;
ScriptedAI::AttackStart(victim);
@@ -324,7 +324,7 @@ class boss_deathbringer_saurfang : public CreatureScript
{
ScriptedAI::EnterEvadeMode();
if (_introDone)
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
}
void JustReachedHome()
@@ -403,7 +403,7 @@ class boss_deathbringer_saurfang : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -434,7 +434,7 @@ class boss_deathbringer_saurfang : public CreatureScript
case EVENT_INTRO_FINISH:
events.SetPhase(PHASE_COMBAT);
_introDone = true;
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
break;
case EVENT_SUMMON_BLOOD_BEAST:
for (uint32 i10 = 0; i10 < 2; ++i10)
@@ -608,7 +608,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->SendMovementFlagUpdate();
me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f);
- me->SendMonsterMove(me->GetPositionX(), me->GetPositionY(), 539.2917f, SPLINEFLAG_FALLING, 0, 0.0f);
+ me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f);
for (std::list<Creature*>::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr)
(*itr)->AI()->DoAction(ACTION_DESPAWN);
break;
@@ -815,7 +815,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->SendMovementFlagUpdate();
me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f);
- me->SendMonsterMove(me->GetPositionX(), me->GetPositionY(), 539.2917f, SPLINEFLAG_FALLING, 0, 0.0f);
+ me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f);
for (std::list<Creature*>::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr)
(*itr)->AI()->DoAction(ACTION_DESPAWN);
break;
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp
index fd693789064..a97c6f7d138 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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_festergut : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -305,7 +305,7 @@ class npc_stinky_icc : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
index ae6f3feb57f..ea2f73e788f 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -410,7 +410,7 @@ class boss_lady_deathwhisper : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK))
+ if (me->HasUnitState(UNIT_STATE_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -665,7 +665,7 @@ class npc_cult_fanatic : public CreatureScript
Events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = Events.ExecuteEvent())
@@ -743,7 +743,7 @@ class npc_cult_adherent : public CreatureScript
Events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = Events.ExecuteEvent())
@@ -888,7 +888,7 @@ class npc_darnavan : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if (_canShatter && me->getVictim() && me->getVictim()->IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL))
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
index a52965f925f..1672d8b2d87 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,6 +106,7 @@ class boss_lord_marrowgar : public CreatureScript
events.ScheduleEvent(EVENT_COLDFLAME, 5000, EVENT_GROUP_SPECIAL);
events.ScheduleEvent(EVENT_WARN_BONE_STORM, urand(45000, 50000));
events.ScheduleEvent(EVENT_ENRAGE, 600000);
+ _boneSlice = false;
}
void EnterCombat(Unit* /*who*/)
@@ -153,7 +154,7 @@ class boss_lord_marrowgar : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
index a84471d132b..28964a28d78 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -75,6 +75,7 @@ enum Spells
SPELL_PLAGUE_SICKNESS = 70953,
SPELL_UNBOUND_PLAGUE_PROTECTION = 70955,
SPELL_MUTATED_PLAGUE = 72451,
+ SPELL_MUTATED_PLAGUE_CLEAR = 72618,
// Slime Puddle
SPELL_GROW_STACKER = 70345,
@@ -195,7 +196,7 @@ class boss_professor_putricide : public CreatureScript
me->GetMotionMaster()->MovementExpired();
if (instance->GetBossState(DATA_ROTFACE) == DONE && instance->GetBossState(DATA_FESTERGUT) == DONE)
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit* who)
@@ -244,6 +245,7 @@ class boss_professor_putricide : public CreatureScript
{
_JustDied();
Talk(SAY_DEATH);
+ DoCast(SPELL_MUTATED_PLAGUE_CLEAR);
}
void JustSummoned(Creature* summon)
@@ -517,7 +519,7 @@ class boss_professor_putricide : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -794,7 +796,7 @@ class spell_putricide_ooze_channel : public SpellScriptLoader
void StartAttack()
{
- GetCaster()->ClearUnitState(UNIT_STAT_CASTING);
+ GetCaster()->ClearUnitState(UNIT_STATE_CASTING);
GetCaster()->ToCreature()->AI()->AttackStart(GetHitUnit());
}
@@ -1427,6 +1429,34 @@ class spell_putricide_regurgitated_ooze : public SpellScriptLoader
}
};
+class spell_putricide_clear_mutated_plague : public SpellScriptLoader
+{
+ public:
+ spell_putricide_clear_mutated_plague() : SpellScriptLoader("spell_putricide_clear_mutated_plague") { }
+
+ class spell_putricide_clear_mutated_plague_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_putricide_clear_mutated_plague_SpellScript);
+
+ void HandleScript(SpellEffIndex effIndex)
+ {
+ PreventHitDefaultEffect(effIndex);
+ uint32 auraId = sSpellMgr->GetSpellIdForDifficulty(uint32(GetEffectValue()), GetCaster());
+ GetHitUnit()->RemoveAurasDueToSpell(auraId);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_putricide_clear_mutated_plague_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_putricide_clear_mutated_plague_SpellScript();
+ }
+};
+
// Stinky and Precious spell, it's here because its used for both (Festergut and Rotface "pets")
class spell_stinky_precious_decimate : public SpellScriptLoader
{
@@ -1478,5 +1508,6 @@ void AddSC_boss_professor_putricide()
new spell_putricide_mutated_transformation();
new spell_putricide_mutated_transformation_dmg();
new spell_putricide_regurgitated_ooze();
+ new spell_putricide_clear_mutated_plague();
new spell_stinky_precious_decimate();
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
index 58ae5f48797..9649b6c8ef8 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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_rotface : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -384,7 +384,7 @@ class npc_precious_icc : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
index 25610341a2f..fb04d9ce7a4 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
@@ -268,7 +268,7 @@ class boss_sindragosa : public CreatureScript
void MovementInform(uint32 type, uint32 point)
{
- if (type != POINT_MOTION_TYPE)
+ if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE)
return;
switch (point)
@@ -379,7 +379,7 @@ class boss_sindragosa : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -638,7 +638,7 @@ class npc_spinestalker : public CreatureScript
float moveTime = me->GetExactDist(&SpinestalkerFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f);
me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, SpinestalkerLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250));
me->SetDefaultMovementType(IDLE_MOTION_TYPE);
- me->GetMotionMaster()->MoveIdle(MOTION_SLOT_IDLE);
+ me->GetMotionMaster()->MoveIdle();
me->StopMoving();
me->GetMotionMaster()->MovePoint(POINT_FROSTWYRM_FLY_IN, SpinestalkerFlyPos);
}
@@ -646,7 +646,7 @@ class npc_spinestalker : public CreatureScript
void MovementInform(uint32 type, uint32 point)
{
- if (type != POINT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND)
+ if (type != EFFECT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND)
return;
me->setActive(false);
@@ -663,7 +663,7 @@ class npc_spinestalker : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
@@ -749,11 +749,11 @@ class npc_rimefang : public CreatureScript
me->setActive(true);
me->SetSpeed(MOVE_FLIGHT, 2.0f);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
float moveTime = me->GetExactDist(&RimefangFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f);
me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, RimefangLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250));
me->SetDefaultMovementType(IDLE_MOTION_TYPE);
- me->GetMotionMaster()->MoveIdle(MOTION_SLOT_IDLE);
+ me->GetMotionMaster()->MoveIdle();
me->StopMoving();
me->GetMotionMaster()->MovePoint(POINT_FROSTWYRM_FLY_IN, RimefangFlyPos);
}
@@ -761,14 +761,14 @@ class npc_rimefang : public CreatureScript
void MovementInform(uint32 type, uint32 point)
{
- if (type != POINT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND)
+ if (type != EFFECT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND)
return;
me->setActive(false);
me->SetFlying(false);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->SetHomePosition(RimefangLandPos);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
}
void EnterCombat(Unit* /*victim*/)
@@ -783,7 +783,7 @@ class npc_rimefang : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
@@ -911,7 +911,7 @@ class npc_sindragosa_trash : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
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 2f4f225561c..2acd014e063 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -508,7 +508,7 @@ class boss_the_lich_king : public CreatureScript
if (fabs(ground_Z - z) < 0.1f)
return;
- me->GetMotionMaster()->MoveFall(ground_Z);
+ me->GetMotionMaster()->MoveFall();
}
void EnterCombat(Unit* target)
@@ -701,7 +701,7 @@ class boss_the_lich_king : public CreatureScript
summon->CastSpell(summon, SPELL_ICE_SPHERE, false);
summon->CastSpell(summon, SPELL_ICE_BURST_TARGET_SEARCH, false);
summon->CastSpell(target, SPELL_ICE_PULSE, false);
- summon->ClearUnitState(UNIT_STAT_CASTING);
+ summon->ClearUnitState(UNIT_STATE_CASTING);
summon->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f);
}
else
@@ -801,7 +801,7 @@ class boss_the_lich_king : public CreatureScript
events.ScheduleEvent(EVENT_INTRO_TALK_1, 9000, 0, PHASE_INTRO);
break;
case POINT_CENTER_1:
- me->SetFacing(0.0f);
+ me->SetFacingTo(0.0f);
Talk(SAY_LK_REMORSELESS_WINTER);
SendMusicToPlayers(MUSIC_SPECIAL);
me->SetReactState(REACT_PASSIVE);
@@ -818,7 +818,7 @@ class boss_the_lich_king : public CreatureScript
events.ScheduleEvent(EVENT_SOUL_REAPER, 94000, 0, PHASE_TWO);
break;
case POINT_CENTER_2:
- me->SetFacing(0.0f);
+ me->SetFacingTo(0.0f);
Talk(SAY_LK_REMORSELESS_WINTER);
SendMusicToPlayers(MUSIC_SPECIAL);
me->SetReactState(REACT_PASSIVE);
@@ -861,7 +861,7 @@ class boss_the_lich_king : public CreatureScript
events.Update(diff);
// during Remorseless Winter phases The Lich King is channeling a spell, but we must continue casting other spells
- if (me->HasUnitState(UNIT_STAT_CASTING) && !(events.GetPhaseMask() & PHASE_MASK_NO_CAST_CHECK))
+ if (me->HasUnitState(UNIT_STATE_CASTING) && !(events.GetPhaseMask() & PHASE_MASK_NO_CAST_CHECK))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -883,7 +883,7 @@ class boss_the_lich_king : public CreatureScript
case EVENT_INTRO_TALK_1:
Talk(SAY_LK_INTRO_2);
// for some reason blizz sends 2 emotes in row here so (we handle one in Talk)
- me->HandleEmoteCommand(EMOTE_ONESHOT_TALK_NOSHEATHE);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_TALK_NO_SHEATHE);
events.ScheduleEvent(EVENT_EMOTE_CAST_SHOUT, 7000, 0, PHASE_INTRO);
events.ScheduleEvent(EVENT_INTRO_EMOTE_1, 13000, 0, PHASE_INTRO);
events.ScheduleEvent(EVENT_EMOTE_CAST_SHOUT, 18000, 0, PHASE_INTRO);
@@ -893,7 +893,7 @@ class boss_the_lich_king : public CreatureScript
DoCast(me, SPELL_EMOTE_SHOUT_NO_SHEATH, false);
break;
case EVENT_INTRO_EMOTE_1:
- me->HandleEmoteCommand(EMOTE_ONESHOT_POINT_NOSHEATHE);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_POINT_NO_SHEATHE);
break;
case EVENT_INTRO_CAST_FREEZE:
Talk(SAY_LK_INTRO_3);
@@ -902,7 +902,7 @@ class boss_the_lich_king : public CreatureScript
break;
case EVENT_FINISH_INTRO:
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE);
events.SetPhase(PHASE_ONE);
break;
@@ -966,14 +966,14 @@ class boss_the_lich_king : public CreatureScript
break;
case EVENT_QUAKE:
events.SetPhase(PHASE_TWO);
- me->ClearUnitState(UNIT_STAT_CASTING); // clear state to ensure check in DoCastAOE passes
+ me->ClearUnitState(UNIT_STATE_CASTING); // clear state to ensure check in DoCastAOE passes
DoCastAOE(SPELL_QUAKE);
SendMusicToPlayers(MUSIC_SPECIAL);
Talk(SAY_LK_QUAKE);
break;
case EVENT_QUAKE_2:
events.SetPhase(PHASE_THREE);
- me->ClearUnitState(UNIT_STAT_CASTING); // clear state to ensure check in DoCastAOE passes
+ me->ClearUnitState(UNIT_STATE_CASTING); // clear state to ensure check in DoCastAOE passes
DoCastAOE(SPELL_QUAKE);
SendMusicToPlayers(MUSIC_SPECIAL);
Talk(SAY_LK_QUAKE);
@@ -1043,23 +1043,23 @@ class boss_the_lich_king : public CreatureScript
DoCastAOE(SPELL_EMOTE_QUESTION_NO_SHEATH);
break;
case EVENT_OUTRO_EMOTE_TALK:
- me->HandleEmoteCommand(EMOTE_ONESHOT_TALK_NOSHEATHE);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_TALK_NO_SHEATHE);
break;
case EVENT_OUTRO_TALK_3:
if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING)))
- me->SetFacing(0.0f, tirion);
+ me->SetFacingToObject(tirion);
Talk(SAY_LK_OUTRO_3);
break;
case EVENT_OUTRO_MOVE_CENTER:
me->GetMotionMaster()->MovePoint(POINT_LK_OUTRO_1, CenterPosition);
break;
case EVENT_OUTRO_TALK_4:
- me->SetFacing(0.01745329f);
+ me->SetFacingTo(0.01745329f);
Talk(SAY_LK_OUTRO_4);
break;
case EVENT_OUTRO_RAISE_DEAD:
DoCastAOE(SPELL_RAISE_DEAD);
- me->ClearUnitState(UNIT_STAT_CASTING);
+ me->ClearUnitState(UNIT_STATE_CASTING);
SendMusicToPlayers(MUSIC_FINAL);
break;
case EVENT_OUTRO_TALK_5:
@@ -1070,8 +1070,8 @@ class boss_the_lich_king : public CreatureScript
case EVENT_OUTRO_TALK_6:
Talk(SAY_LK_OUTRO_6);
if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING)))
- tirion->SetFacing(0.0f, me);
- me->ClearUnitState(UNIT_STAT_CASTING);
+ tirion->SetFacingToObject(me);
+ me->ClearUnitState(UNIT_STATE_CASTING);
DoCastAOE(SPELL_SUMMON_BROKEN_FROSTMOURNE_3);
SetEquipmentSlots(false, EQUIP_UNEQUIP);
break;
@@ -1222,7 +1222,7 @@ class npc_tirion_fordring_tft : public CreatureScript
void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
{
if (spell->Id == SPELL_ICE_LOCK)
- me->SetFacing(3.085098f);
+ me->SetFacingTo(3.085098f);
else if (spell->Id == SPELL_BROKEN_FROSTMOURNE_KNOCK)
SetEquipmentSlots(true); // remove glow on ashbringer
}
@@ -1255,7 +1255,7 @@ class npc_tirion_fordring_tft : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
@@ -1268,7 +1268,7 @@ class npc_tirion_fordring_tft : public CreatureScript
_events.ScheduleEvent(EVENT_INTRO_CHARGE, 5000, 0, PHASE_INTRO);
break;
case EVENT_INTRO_EMOTE_1:
- me->HandleEmoteCommand(EMOTE_ONESHOT_POINT_NOSHEATHE);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_POINT_NO_SHEATHE);
break;
case EVENT_INTRO_CHARGE:
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
@@ -1285,7 +1285,7 @@ class npc_tirion_fordring_tft : public CreatureScript
SetEquipmentSlots(false, EQUIP_ASHBRINGER_GLOWING);
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_THE_LICH_KING)))
{
- me->SetFacing(0.0f, lichKing);
+ me->SetFacingToObject(lichKing);
lichKing->AI()->DoAction(ACTION_PLAY_MUSIC);
}
break;
@@ -1349,7 +1349,7 @@ class npc_shambling_horror_icc : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
@@ -1429,7 +1429,7 @@ class npc_raging_spirit : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
@@ -1498,7 +1498,7 @@ class npc_valkyr_shadowguard : public CreatureScript
_events.Reset();
DoCastAOE(SPELL_EJECT_ALL_PASSENGERS);
me->GetMotionMaster()->MoveTargetedHome();
- me->ClearUnitState(UNIT_STAT_EVADE);
+ me->ClearUnitState(UNIT_STATE_EVADE);
}
}
@@ -1564,7 +1564,7 @@ class npc_valkyr_shadowguard : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
@@ -1621,7 +1621,7 @@ class npc_strangulate_vehicle : public CreatureScript
void IsSummonedBy(Unit* summoner)
{
- me->SetFacing(0.0f, summoner);
+ me->SetFacingToObject(summoner);
DoCast(summoner, SPELL_HARVEST_SOUL_VEHICLE);
_events.Reset();
_events.ScheduleEvent(EVENT_MOVE_TO_LICH_KING, 2000);
@@ -1656,7 +1656,8 @@ class npc_strangulate_vehicle : public CreatureScript
switch (eventId)
{
case EVENT_TELEPORT:
- me->GetMotionMaster()->MoveIdle(MOTION_SLOT_ACTIVE);
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MoveIdle();
if (TempSummon* summ = me->ToTempSummon())
{
if (Unit* summoner = summ->GetSummoner())
@@ -1788,7 +1789,7 @@ class npc_terenas_menethil : public CreatureScript
_events.Reset();
_events.SetPhase(PHASE_OUTRO);
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_THE_LICH_KING)))
- me->SetFacing(0.0f, lichKing);
+ me->SetFacingToObject(lichKing);
_events.ScheduleEvent(EVENT_OUTRO_TERENAS_TALK_1, 2000, 0, PHASE_OUTRO);
_events.ScheduleEvent(EVENT_OUTRO_TERENAS_TALK_2, 14000, 0, PHASE_OUTRO);
@@ -1824,7 +1825,7 @@ class npc_terenas_menethil : public CreatureScript
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_THE_LICH_KING)))
{
lichKing->AI()->DoAction(ACTION_FINISH_OUTRO);
- lichKing->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE);
+ lichKing->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
if (Creature* tirion = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING)))
tirion->AI()->AttackStart(lichKing);
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
index 5f62c2b5424..e0993178890 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -426,7 +426,7 @@ class boss_valithria_dreamwalker : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
@@ -626,7 +626,7 @@ class npc_the_lich_king_controller : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
@@ -741,7 +741,7 @@ class npc_risen_archmage : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
@@ -807,7 +807,7 @@ class npc_blazing_skeleton : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
@@ -873,7 +873,7 @@ class npc_suppresser : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
// this code will never be reached while channeling
@@ -967,7 +967,7 @@ class npc_gluttonous_abomination : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
index ab3046806db..00a6a02f2da 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
@@ -477,7 +477,7 @@ class npc_highlord_tirion_fordring_lh : public CreatureScript
Talk(SAY_TIRION_INTRO_3);
break;
case EVENT_LK_INTRO_1:
- me->HandleEmoteCommand(EMOTE_ONESHOT_POINT_NOSHEATHE);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_POINT_NO_SHEATHE);
if (Creature* theLichKing = ObjectAccessor::GetCreature(*me, _theLichKing))
theLichKing->AI()->Talk(SAY_LK_INTRO_1);
break;
@@ -611,7 +611,7 @@ class npc_rotting_frost_giant : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
@@ -809,7 +809,7 @@ class boss_sister_svalna : public CreatureScript
case ACTION_START_GAUNTLET:
me->setActive(true);
_isEventInProgress = true;
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
events.ScheduleEvent(EVENT_SVALNA_START, 25000);
break;
case ACTION_RESURRECT_CAPTAINS:
@@ -843,7 +843,7 @@ class boss_sister_svalna : public CreatureScript
_isEventInProgress = false;
me->setActive(false);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
me->SetFlying(false);
}
@@ -874,7 +874,7 @@ class boss_sister_svalna : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -1130,7 +1130,7 @@ class npc_crok_scourgebane : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
@@ -1264,7 +1264,7 @@ struct npc_argent_captainAI : public ScriptedAI
void EnterEvadeMode()
{
// not yet following
- if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_IDLE) != TARGETED_MOTION_TYPE || IsUndead)
+ if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_IDLE) != CHASE_MOTION_TYPE || IsUndead)
{
ScriptedAI::EnterEvadeMode();
return;
@@ -1353,7 +1353,7 @@ class npc_captain_arnath : public CreatureScript
Events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = Events.ExecuteEvent())
@@ -1434,7 +1434,7 @@ class npc_captain_brandon : public CreatureScript
Events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = Events.ExecuteEvent())
@@ -1502,7 +1502,7 @@ class npc_captain_grondel : public CreatureScript
Events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = Events.ExecuteEvent())
@@ -1567,7 +1567,7 @@ class npc_captain_rupert : public CreatureScript
Events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = Events.ExecuteEvent())
@@ -1680,7 +1680,7 @@ class spell_icc_stoneform : public SpellScriptLoader
if (Creature* target = GetTarget()->ToCreature())
{
target->SetReactState(REACT_PASSIVE);
- target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
target->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_CUSTOM_SPELL_02);
}
}
@@ -1690,7 +1690,7 @@ class spell_icc_stoneform : public SpellScriptLoader
if (Creature* target = GetTarget()->ToCreature())
{
target->SetReactState(REACT_AGGRESSIVE);
- target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
target->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
}
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h
index ece966fcda5..085aea139a3 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 1242e90c2f3..0266db5f26b 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 a7235e34f3a..2a61d00d119 100755
--- 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -335,8 +335,12 @@ class instance_icecrown_citadel : public InstanceMapScript
return entry;
}
- void OnCreatureDeath(Creature* creature)
+ void OnUnitDeath(Unit* unit)
{
+ Creature* creature = unit->ToCreature();
+ if (!creature)
+ return;
+
switch (creature->GetEntry())
{
case NPC_YMIRJAR_BATTLE_MAIDEN:
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
index 9096282c3f6..942cfd7c5a8 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_faerlina.cpp b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp
index 97594c168ef..058c5b35e3a 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -137,7 +137,7 @@ class boss_faerlina : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
index 0462f669d88..47151ef6d80 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -342,7 +342,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
index 1849849d907..0ef4e3d74c2 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
index bbf5b669494..8c6afba18fd 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -354,7 +354,7 @@ class boss_gothik : public CreatureScript
}
if (spellId && me->isInCombat())
{
- me->HandleEmoteCommand(EMOTE_ONESHOT_SPELLCAST);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_SPELL_CAST);
if (Creature* pRandomDeadTrigger = Unit::GetCreature(*me, DeadTriggerGUID[rand() % POS_DEAD]))
me->CastSpell(pRandomDeadTrigger, spellId, true);
}
@@ -400,7 +400,7 @@ class boss_gothik : public CreatureScript
instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
}
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp
index 3badccd3a80..e353a71b0b9 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_heigan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
index bb8a0909df4..7a2d3ec55ab 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
index 96c061f4c98..161c9160293 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -486,7 +486,7 @@ public:
else uiGuardiansOfIcecrownTimer -= diff;
}
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if (uint32 eventId = events.GetEvent())
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp
index 6db29be8fbd..58d3a4240b2 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,79 +20,185 @@
enum Spells
{
- SPELL_NECROTIC_AURA = 55593,
- SPELL_SUMMON_SPORE = 29234,
- SPELL_DEATHBLOOM = 29865,
- H_SPELL_DEATHBLOOM = 55053,
- SPELL_INEVITABLE_DOOM = 29204,
- H_SPELL_INEVITABLE_DOOM = 55052
+ SPELL_NECROTIC_AURA = 55593,
+ SPELL_WARN_NECROTIC_AURA = 59481,
+ SPELL_SUMMON_SPORE = 29234,
+ SPELL_DEATHBLOOM = 29865,
+ H_SPELL_DEATHBLOOM = 55053,
+ SPELL_INEVITABLE_DOOM = 29204,
+ H_SPELL_INEVITABLE_DOOM = 55052
+};
+
+enum Texts
+{
+ SAY_NECROTIC_AURA_APPLIED = 0,
+ SAY_NECROTIC_AURA_REMOVED = 1,
+ SAY_NECROTIC_AURA_FADING = 2,
};
enum Events
{
- EVENT_NONE,
- EVENT_AURA,
- EVENT_BLOOM,
- EVENT_DOOM,
+ EVENT_NECROTIC_AURA = 1,
+ EVENT_DEATHBLOOM = 2,
+ EVENT_INEVITABLE_DOOM = 3,
+ EVENT_SPORE = 4,
+ EVENT_NECROTIC_AURA_FADING = 5,
+};
+
+enum Achievement
+{
+ DATA_ACHIEVEMENT_SPORE_LOSER = 21822183,
};
class boss_loatheb : public CreatureScript
{
-public:
- boss_loatheb() : CreatureScript("boss_loatheb") { }
+ public:
+ boss_loatheb() : CreatureScript("boss_loatheb") { }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new boss_loathebAI (creature);
- }
+ struct boss_loathebAI : public BossAI
+ {
+ boss_loathebAI(Creature* creature) : BossAI(creature, BOSS_LOATHEB)
+ {
+ }
- struct boss_loathebAI : public BossAI
- {
- boss_loathebAI(Creature* c) : BossAI(c, BOSS_LOATHEB) {}
+ void Reset()
+ {
+ _Reset();
+ _doomCounter = 0;
+ _sporeLoserData = true;
+ }
- void EnterCombat(Unit* /*who*/)
- {
- _EnterCombat();
- events.ScheduleEvent(EVENT_AURA, 10000);
- events.ScheduleEvent(EVENT_BLOOM, 5000);
- events.ScheduleEvent(EVENT_DOOM, 120000);
- }
+ void EnterCombat(Unit* /*who*/)
+ {
+ _EnterCombat();
+ events.ScheduleEvent(EVENT_NECROTIC_AURA, 17000);
+ events.ScheduleEvent(EVENT_DEATHBLOOM, 5000);
+ events.ScheduleEvent(EVENT_SPORE, IsHeroic() ? 18000 : 36000);
+ events.ScheduleEvent(EVENT_INEVITABLE_DOOM, 120000);
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ void SummonedCreatureDies(Creature* /*summon*/, Unit* /*killer*/)
+ {
+ _sporeLoserData = false;
+ }
- events.Update(diff);
+ uint32 GetData(uint32 id)
+ {
+ if (id != DATA_ACHIEVEMENT_SPORE_LOSER)
+ return 0;
- while (uint32 eventId = events.ExecuteEvent())
+ return uint32(_sporeLoserData);
+ }
+
+ void UpdateAI(uint32 const diff)
{
- switch (eventId)
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
{
- case EVENT_AURA:
- DoCastAOE(SPELL_NECROTIC_AURA);
- events.ScheduleEvent(EVENT_AURA, 20000);
- break;
- case EVENT_BLOOM:
- // TODO : Add missing text
- DoCastAOE(SPELL_SUMMON_SPORE, true);
- DoCastAOE(RAID_MODE(SPELL_DEATHBLOOM, H_SPELL_DEATHBLOOM));
- events.ScheduleEvent(EVENT_BLOOM, 30000);
- break;
- case EVENT_DOOM:
- DoCastAOE(RAID_MODE(SPELL_INEVITABLE_DOOM, H_SPELL_INEVITABLE_DOOM));
- events.ScheduleEvent(EVENT_DOOM, events.GetTimer() < 5*60000 ? 30000 : 15000);
- break;
+ switch (eventId)
+ {
+ case EVENT_NECROTIC_AURA:
+ DoCastAOE(SPELL_NECROTIC_AURA);
+ DoCast(me, SPELL_WARN_NECROTIC_AURA);
+ events.ScheduleEvent(EVENT_NECROTIC_AURA, 20000);
+ events.ScheduleEvent(EVENT_NECROTIC_AURA_FADING, 14000);
+ break;
+ case EVENT_DEATHBLOOM:
+ DoCastAOE(RAID_MODE(SPELL_DEATHBLOOM, H_SPELL_DEATHBLOOM));
+ events.ScheduleEvent(EVENT_DEATHBLOOM, 30000);
+ break;
+ case EVENT_INEVITABLE_DOOM:
+ _doomCounter++;
+ DoCastAOE(RAID_MODE(SPELL_INEVITABLE_DOOM, H_SPELL_INEVITABLE_DOOM));
+ events.ScheduleEvent(EVENT_INEVITABLE_DOOM, std::max(120000 - _doomCounter * 15000, 15000)); // needs to be confirmed
+ break;
+ case EVENT_SPORE:
+ DoCast(me, SPELL_SUMMON_SPORE, false);
+ events.ScheduleEvent(EVENT_SPORE, IsHeroic() ? 18000 : 36000);
+ break;
+ case EVENT_NECROTIC_AURA_FADING:
+ Talk(SAY_NECROTIC_AURA_FADING);
+ break;
+ default:
+ break;
+ }
}
+
+ DoMeleeAttackIfReady();
}
- DoMeleeAttackIfReady();
+ private:
+ bool _sporeLoserData;
+ uint8 _doomCounter;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new boss_loathebAI(creature);
+ }
+};
+
+class achievement_spore_loser : public AchievementCriteriaScript
+{
+ public:
+ achievement_spore_loser() : AchievementCriteriaScript("achievement_spore_loser") { }
+
+ bool OnCheck(Player* /*source*/, Unit* target)
+ {
+ return target && target->GetAI()->GetData(DATA_ACHIEVEMENT_SPORE_LOSER);
}
- };
+};
+
+typedef boss_loatheb::boss_loathebAI LoathebAI;
+
+class spell_loatheb_necrotic_aura_warning : public SpellScriptLoader
+{
+ public:
+ spell_loatheb_necrotic_aura_warning() : SpellScriptLoader("spell_loatheb_necrotic_aura_warning") { }
+
+ class spell_loatheb_necrotic_aura_warning_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_loatheb_necrotic_aura_warning_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellStore.LookupEntry(SPELL_WARN_NECROTIC_AURA))
+ return false;
+ return true;
+ }
+ void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (GetTarget()->IsAIEnabled)
+ CAST_AI(LoathebAI, GetTarget()->GetAI())->Talk(SAY_NECROTIC_AURA_APPLIED);
+ }
+
+ void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (GetTarget()->IsAIEnabled)
+ CAST_AI(LoathebAI, GetTarget()->GetAI())->Talk(SAY_NECROTIC_AURA_REMOVED);
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_loatheb_necrotic_aura_warning_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_loatheb_necrotic_aura_warning_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_loatheb_necrotic_aura_warning_AuraScript();
+ }
};
void AddSC_boss_loatheb()
{
new boss_loatheb();
+ new achievement_spore_loser();
+ new spell_loatheb_necrotic_aura_warning();
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
index e98b004f9e9..0163101b8ed 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 b7d74c02dd8..7143b940916 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
index 3b87dea025c..a9ed499c5e5 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_razuvious.cpp b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp
index 7adc17cc852..b27ab3730da 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 ed1bbd1971a..16b1e7ac996 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
index c2099b1346b..7977fa4df8a 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,11 @@ enum ThaddiusSpells
SPELL_BALL_LIGHTNING = 28299,
SPELL_CHAIN_LIGHTNING = 28167,
H_SPELL_CHAIN_LIGHTNING = 54531,
- SPELL_BERSERK = 27680
+ SPELL_BERSERK = 27680,
+ SPELL_POSITIVE_CHARGE = 28062,
+ SPELL_POSITIVE_CHARGE_STACK = 29659,
+ SPELL_NEGATIVE_CHARGE = 28085,
+ SPELL_NEGATIVE_CHARGE_STACK = 29660
};
enum Events
@@ -94,6 +98,11 @@ enum Events
EVENT_BERSERK,
};
+enum Achievement
+{
+ DATA_POLARITY_SWITCH = 76047605,
+};
+
class boss_thaddius : public CreatureScript
{
public:
@@ -123,18 +132,19 @@ public:
if (!checkFeugenAlive && !checkStalaggAlive)
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED);
me->SetReactState(REACT_AGGRESSIVE);
}
else
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED);
me->SetReactState(REACT_PASSIVE);
}
}
bool checkStalaggAlive;
bool checkFeugenAlive;
+ bool polaritySwitch;
uint32 uiAddsTimer;
void KilledUnit(Unit* /*victim*/)
@@ -169,13 +179,13 @@ public:
if (!checkFeugenAlive && !checkStalaggAlive)
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED);
// REACT_AGGRESSIVE only reset when he takes damage.
DoZoneInCombat();
}
else
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED);
me->SetReactState(REACT_PASSIVE);
}
}
@@ -194,6 +204,20 @@ public:
me->SetReactState(REACT_AGGRESSIVE);
}
+ void SetData(uint32 id, uint32 data)
+ {
+ if (id == DATA_POLARITY_SWITCH)
+ polaritySwitch = data ? true : false;
+ }
+
+ uint32 GetData(uint32 id)
+ {
+ if (id != DATA_POLARITY_SWITCH)
+ return 0;
+
+ return uint32(polaritySwitch);
+ }
+
void UpdateAI(const uint32 diff)
{
if (checkFeugenAlive && checkStalaggAlive)
@@ -224,7 +248,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -400,9 +424,101 @@ public:
};
+class spell_thaddius_pos_neg_charge : public SpellScriptLoader
+{
+ public:
+ spell_thaddius_pos_neg_charge() : SpellScriptLoader("spell_thaddius_pos_neg_charge") { }
+
+ class spell_thaddius_pos_neg_charge_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_thaddius_pos_neg_charge_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_CHARGE))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_CHARGE_STACK))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_CHARGE))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_CHARGE_STACK))
+ return false;
+ return true;
+ }
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_UNIT;
+ }
+
+ void HandleTargets(std::list<Unit*>& targetList)
+ {
+ uint8 count = 0;
+ for (std::list<Unit*>::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit)
+ if ((*ihit)->GetGUID() != GetCaster()->GetGUID())
+ if (Player* target = (*ihit)->ToPlayer())
+ if (target->HasAura(GetTriggeringSpell()->Id))
+ ++count;
+
+ if (count)
+ {
+ uint32 spellId = 0;
+
+ if (GetSpellInfo()->Id == SPELL_POSITIVE_CHARGE)
+ spellId = SPELL_POSITIVE_CHARGE_STACK;
+ else // if (GetSpellInfo()->Id == SPELL_NEGATIVE_CHARGE)
+ spellId = SPELL_NEGATIVE_CHARGE_STACK;
+
+ GetCaster()->SetAuraStack(spellId, GetCaster(), count);
+ }
+ }
+
+ void HandleDamage(SpellEffIndex /*effIndex*/)
+ {
+ if (!GetTriggeringSpell())
+ return;
+
+ Unit* target = GetHitUnit();
+ Unit* caster = GetCaster();
+
+ if (target->HasAura(GetTriggeringSpell()->Id))
+ SetHitDamage(0);
+ else
+ {
+ if (target->GetTypeId() == TYPEID_PLAYER && caster->IsAIEnabled)
+ caster->ToCreature()->AI()->SetData(DATA_POLARITY_SWITCH, 1);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_thaddius_pos_neg_charge_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_thaddius_pos_neg_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_thaddius_pos_neg_charge_SpellScript();
+ }
+};
+
+class achievement_polarity_switch : public AchievementCriteriaScript
+{
+ public:
+ achievement_polarity_switch() : AchievementCriteriaScript("achievement_polarity_switch") { }
+
+ bool OnCheck(Player* /*source*/, Unit* target)
+ {
+ return target && target->GetAI()->GetData(DATA_POLARITY_SWITCH);
+ }
+};
+
void AddSC_boss_thaddius()
{
new boss_thaddius();
new mob_stalagg();
new mob_feugen();
+ new spell_thaddius_pos_neg_charge();
+ new achievement_polarity_switch();
}
diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
index 077aa708e14..c05d9a21850 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -121,24 +121,24 @@ public:
LoadMinionData(minionData);
}
- std::set<uint64> HeiganEruptionGUID[4];
- uint64 GothikGateGUID;
- uint64 HorsemenChestGUID;
- uint64 SapphironGUID;
- uint64 uiFaerlina;
- uint64 uiThane;
- uint64 uiLady;
- uint64 uiBaron;
- uint64 uiSir;
-
- uint64 uiThaddius;
- uint64 uiHeigan;
- uint64 uiFeugen;
- uint64 uiStalagg;
-
- uint64 uiKelthuzad;
- uint64 uiKelthuzadTrigger;
- uint64 uiPortals[4];
+ std::set<uint64> heiganEruptionGUID[4];
+ uint64 gothikGateGUID;
+ uint64 horsemenChestGUID;
+ uint64 sapphironGUID;
+ uint64 faerlinaGUID;
+ uint64 thaneGUID;
+ uint64 ladyGUID;
+ uint64 baronGUID;
+ uint64 sirGUID;
+
+ uint64 thaddiusGUID;
+ uint64 heiganGUID;
+ uint64 feugenGUID;
+ uint64 stalaggGUID;
+
+ uint64 kelthuzadGUID;
+ uint64 kelthuzadTriggerGUID;
+ uint64 portalsGUID[4];
uint32 AbominationCount;
@@ -147,41 +147,46 @@ public:
time_t minHorsemenDiedTime;
time_t maxHorsemenDiedTime;
+ uint32 playerDied;
+
void Initialize()
{
- GothikGateGUID = 0;
- HorsemenChestGUID = 0;
- SapphironGUID = 0;
- uiFaerlina = 0;
- uiThane = 0;
- uiLady = 0;
- uiBaron = 0;
- uiSir = 0;
- uiThaddius = 0;
- uiHeigan = 0;
- uiFeugen = 0;
- uiStalagg = 0;
- uiKelthuzad = 0;
- uiKelthuzadTrigger = 0;
-
- memset(uiPortals, 0, sizeof(uiPortals));
+ gothikGateGUID = 0;
+ horsemenChestGUID = 0;
+ sapphironGUID = 0;
+ faerlinaGUID = 0;
+ thaneGUID = 0;
+ ladyGUID = 0;
+ baronGUID = 0;
+ sirGUID = 0;
+ thaddiusGUID = 0;
+ heiganGUID = 0;
+ feugenGUID = 0;
+ stalaggGUID = 0;
+ kelthuzadGUID = 0;
+ kelthuzadTriggerGUID = 0;
+
+ playerDied = 0;
+ gothikDoorState = GO_STATE_ACTIVE;
+
+ memset(portalsGUID, 0, sizeof(portalsGUID));
}
void OnCreatureCreate(Creature* creature)
{
switch (creature->GetEntry())
{
- case 15989: SapphironGUID = creature->GetGUID(); return;
- case 15953: uiFaerlina = creature->GetGUID(); return;
- case 16064: uiThane = creature->GetGUID(); return;
- case 16065: uiLady = creature->GetGUID(); return;
- case 30549: uiBaron = creature->GetGUID(); return;
- case 16063: uiSir = creature->GetGUID(); return;
- case 15928: uiThaddius = creature->GetGUID(); return;
- case 15936: uiHeigan = creature->GetGUID(); return;
- case 15930: uiFeugen = creature->GetGUID(); return;
- case 15929: uiStalagg = creature->GetGUID(); return;
- case 15990: uiKelthuzad = creature->GetGUID(); return;
+ case 15989: sapphironGUID = creature->GetGUID(); return;
+ case 15953: faerlinaGUID = creature->GetGUID(); return;
+ case 16064: thaneGUID = creature->GetGUID(); return;
+ case 16065: ladyGUID = creature->GetGUID(); return;
+ case 30549: baronGUID = creature->GetGUID(); return;
+ case 16063: sirGUID = creature->GetGUID(); return;
+ case 15928: thaddiusGUID = creature->GetGUID(); return;
+ case 15936: heiganGUID = creature->GetGUID(); return;
+ case 15930: feugenGUID = creature->GetGUID(); return;
+ case 15929: stalaggGUID = creature->GetGUID(); return;
+ case 15990: kelthuzadGUID = creature->GetGUID(); return;
}
AddMinion(creature, true);
@@ -197,7 +202,7 @@ public:
if (go->GetGOInfo()->displayId == 6785 || go->GetGOInfo()->displayId == 1287)
{
uint32 section = GetEruptionSection(go->GetPositionX(), go->GetPositionY());
- HeiganEruptionGUID[section].insert(go->GetGUID());
+ heiganEruptionGUID[section].insert(go->GetGUID());
return;
}
@@ -205,29 +210,29 @@ public:
switch (go->GetEntry())
{
case GO_GOTHIK_GATE:
- GothikGateGUID = go->GetGUID();
+ gothikGateGUID = go->GetGUID();
go->SetGoState(gothikDoorState);
break;
case GO_HORSEMEN_CHEST:
- HorsemenChestGUID = go->GetGUID();
+ horsemenChestGUID = go->GetGUID();
break;
case GO_HORSEMEN_CHEST_HERO:
- HorsemenChestGUID = go->GetGUID();
+ horsemenChestGUID = go->GetGUID();
break;
case GO_KELTHUZAD_PORTAL01:
- uiPortals[0] = go->GetGUID();
+ portalsGUID[0] = go->GetGUID();
break;
case GO_KELTHUZAD_PORTAL02:
- uiPortals[1] = go->GetGUID();
+ portalsGUID[1] = go->GetGUID();
break;
case GO_KELTHUZAD_PORTAL03:
- uiPortals[2] = go->GetGUID();
+ portalsGUID[2] = go->GetGUID();
break;
case GO_KELTHUZAD_PORTAL04:
- uiPortals[3] = go->GetGUID();
+ portalsGUID[3] = go->GetGUID();
break;
case GO_KELTHUZAD_TRIGGER:
- uiKelthuzadTrigger = go->GetGUID();
+ kelthuzadTriggerGUID = go->GetGUID();
break;
default:
break;
@@ -242,16 +247,16 @@ public:
{
uint32 section = GetEruptionSection(go->GetPositionX(), go->GetPositionY());
- HeiganEruptionGUID[section].erase(go->GetGUID());
+ heiganEruptionGUID[section].erase(go->GetGUID());
return;
}
switch (go->GetEntry())
{
case GO_BIRTH:
- if (SapphironGUID)
+ if (sapphironGUID)
{
- if (Creature* pSapphiron = instance->GetCreature(SapphironGUID))
+ if (Creature* pSapphiron = instance->GetCreature(sapphironGUID))
pSapphiron->AI()->DoAction(DATA_SAPPHIRON_BIRTH);
return;
}
@@ -263,6 +268,15 @@ public:
AddDoor(go, false);
}
+ void OnUnitDeath(Unit* unit)
+ {
+ if (unit->GetTypeId() == TYPEID_PLAYER && IsEncounterInProgress())
+ {
+ playerDied = 1;
+ SaveToDB();
+ }
+ }
+
void SetData(uint32 id, uint32 value)
{
switch (id)
@@ -271,11 +285,10 @@ public:
HeiganErupt(value);
break;
case DATA_GOTHIK_GATE:
- if (GameObject* gothikGate = instance->GetGameObject(GothikGateGUID))
+ if (GameObject* gothikGate = instance->GetGameObject(gothikGateGUID))
gothikGate->SetGoState(GOState(value));
gothikDoorState = GOState(value);
break;
-
case DATA_HORSEMEN0:
case DATA_HORSEMEN1:
case DATA_HORSEMEN2:
@@ -319,35 +332,35 @@ public:
switch (id)
{
case DATA_FAERLINA:
- return uiFaerlina;
+ return faerlinaGUID;
case DATA_THANE:
- return uiThane;
+ return thaneGUID;
case DATA_LADY:
- return uiLady;
+ return ladyGUID;
case DATA_BARON:
- return uiBaron;
+ return baronGUID;
case DATA_SIR:
- return uiSir;
+ return sirGUID;
case DATA_THADDIUS:
- return uiThaddius;
+ return thaddiusGUID;
case DATA_HEIGAN:
- return uiHeigan;
+ return heiganGUID;
case DATA_FEUGEN:
- return uiFeugen;
+ return feugenGUID;
case DATA_STALAGG:
- return uiStalagg;
+ return stalaggGUID;
case DATA_KELTHUZAD:
- return uiKelthuzad;
+ return kelthuzadGUID;
case DATA_KELTHUZAD_PORTAL01:
- return uiPortals[0];
+ return portalsGUID[0];
case DATA_KELTHUZAD_PORTAL02:
- return uiPortals[1];
+ return portalsGUID[1];
case DATA_KELTHUZAD_PORTAL03:
- return uiPortals[2];
+ return portalsGUID[2];
case DATA_KELTHUZAD_PORTAL04:
- return uiPortals[3];
+ return portalsGUID[3];
case DATA_KELTHUZAD_TRIGGER:
- return uiKelthuzadTrigger;
+ return kelthuzadTriggerGUID;
}
return 0;
}
@@ -359,7 +372,7 @@ public:
if (id == BOSS_HORSEMEN && state == DONE)
{
- if (GameObject* pHorsemenChest = instance->GetGameObject(HorsemenChestGUID))
+ if (GameObject* pHorsemenChest = instance->GetGameObject(horsemenChestGUID))
pHorsemenChest->SetRespawnTime(pHorsemenChest->GetRespawnDelay());
}
@@ -373,7 +386,7 @@ public:
if (i == section)
continue;
- for (std::set<uint64>::const_iterator itr = HeiganEruptionGUID[i].begin(); itr != HeiganEruptionGUID[i].end(); ++itr)
+ for (std::set<uint64>::const_iterator itr = heiganEruptionGUID[i].begin(); itr != heiganEruptionGUID[i].end(); ++itr)
{
if (GameObject* pHeiganEruption = instance->GetGameObject(*itr))
{
@@ -384,6 +397,21 @@ public:
}
}
+ // This Function is called in CheckAchievementCriteriaMeet and CheckAchievementCriteriaMeet is called before SetBossState(bossId, DONE),
+ // so to check if all bosses are done the checker must exclude 1 boss, the last done, if there is at most 1 encouter in progress when is
+ // called this function then all bosses are done. The one boss that check is the boss that calls this function, so it is dead.
+ bool AreAllEncoutersDone()
+ {
+ uint32 numBossAlive = 0;
+ for (uint32 i = 0; i < MAX_BOSS_NUMBER; ++i)
+ if (GetBossState(i) != DONE)
+ numBossAlive++;
+
+ if (numBossAlive > 1)
+ return false;
+ return true;
+ }
+
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target = NULL*/, uint32 /*miscvalue1 = 0*/)
{
switch (criteria_id)
@@ -396,12 +424,22 @@ public:
if (Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_25MAN_NORMAL && (maxHorsemenDiedTime - minHorsemenDiedTime) < 15)
return true;
return false;
- case 13233: // Criteria for achievement 2186: The Immortal (25-man)
- // TODO.
- break;
- case 13237: // Criteria for achievement 2187: The Undying (10-man)
- // TODO.
- break;
+ // Difficulty checks are done on DB.
+ // Criteria for achievement 2186: The Immortal (25-man)
+ case 13233: // The Four Horsemen
+ case 13234: // Maexxna
+ case 13235: // Thaddius
+ case 13236: // Loatheb
+ case 7616: // Kel'Thuzad
+ // Criteria for achievement 2187: The Undying (10-man)
+ case 13237: // The Four Horsemen
+ case 13238: // Maexxna
+ case 13239: // Loatheb
+ case 13240: // Thaddius
+ case 7617: // Kel'Thuzad
+ if (AreAllEncoutersDone() && !playerDied)
+ return true;
+ return false;
}
return false;
}
@@ -409,16 +447,22 @@ public:
std::string GetSaveData()
{
std::ostringstream saveStream;
- saveStream << GetBossSaveData() << ' ' << gothikDoorState;
+ saveStream << GetBossSaveData() << gothikDoorState << ' ' << playerDied;
return saveStream.str();
}
void Load(const char * data)
{
std::istringstream loadStream(LoadBossState(data));
- uint32 buff;
+ uint32 temp, buff, buff2;
+
+ for (uint32 i = 0; i < MAX_BOSS_NUMBER; ++i)
+ loadStream >> temp;
+
loadStream >> buff;
gothikDoorState = GOState(buff);
+ loadStream >> buff2;
+ playerDied = buff2;
}
};
diff --git a/src/server/scripts/Northrend/Naxxramas/naxxramas.h b/src/server/scripts/Northrend/Naxxramas/naxxramas.h
index bb25ad691e0..43393aff844 100644
--- a/src/server/scripts/Northrend/Naxxramas/naxxramas.h
+++ b/src/server/scripts/Northrend/Naxxramas/naxxramas.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 f28cd537e03..6dfa62df2d1 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -523,7 +523,7 @@ public:
return;
// We can't cast if we are casting already.
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -838,7 +838,7 @@ public:
return;
}
- if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE)
me->GetMotionMaster()->MoveFollow(malygos, 0.0f, 0.0f);
}
}
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 cc74ce9b8bc..b16cbffcd1c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 4d4b8e90e7b..fcb54985357 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 0568bb13a8e..5e87ffb8973 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp
index caf6b64eea7..44c6c25fa3e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -144,14 +144,14 @@ public:
{
if (remove)
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (me->HasAura(SPELL_FROZEN_PRISON))
me->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON);
}
else
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
DoCast(me, SPELL_FROZEN_PRISON, false);
}
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 a8edd40d6b5..03f467ce180 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/boss_ormorok.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp
index afbe3a123a8..4453ec94494 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/commander_kolurg.cpp b/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp
index 0d537955ec5..6d07ac960b5 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/commander_stoutbeard.cpp b/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp
index 1804c75987f..71a153c802a 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/instance_nexus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp
index cb81c5d54fe..5af982bb694 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 58efd78dcee..cb88be89afd 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 bb62b921289..bb75b789fff 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -95,7 +95,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp
index df606f61d57..ab814a2ca22 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -200,7 +200,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp
index e63d50b0133..aef959aad70 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
index 4dcd2618895..8852338c362 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,7 +101,7 @@ public:
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -256,10 +256,10 @@ class spell_varos_centrifuge_shield : public SpellScriptLoader
{
// flags taken from sniffs
// UNIT_FLAG_UNK_9 -> means passive but it is not yet implemented in core
- if (caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_PASSIVE|UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_UNK_6))
+ if (caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_IMMUNE_TO_NPC|UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_UNK_6))
{
caster->ToCreature()->SetReactState(REACT_PASSIVE);
- caster->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_PASSIVE|UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_UNK_6);
+ caster->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_IMMUNE_TO_NPC|UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_UNK_6);
}
}
}
@@ -269,7 +269,7 @@ class spell_varos_centrifuge_shield : public SpellScriptLoader
if (Unit* caster = GetCaster())
{
caster->ToCreature()->SetReactState(REACT_AGGRESSIVE);
- caster->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_PASSIVE|UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_UNK_6);
+ caster->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_IMMUNE_TO_NPC|UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_UNK_6);
}
}
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp
index e6b3416b89c..46498a69c6f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,8 +58,12 @@ public:
gameObjectList.clear();
}
- void OnCreatureDeath(Creature* creature)
+ void OnUnitDeath(Unit* unit)
{
+ Creature* creature = unit->ToCreature();
+ if (!creature)
+ return;
+
if (creature->GetEntry() != NPC_CENTRIFUGE_CONSTRUCT)
return;
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
index b9799103214..c687aad8bd2 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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.h b/src/server/scripts/Northrend/Nexus/Oculus/oculus.h
index dab2821b5e5..81d1e9f9ea8 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 5e2b6551f84..c6f72890d1f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,7 +61,7 @@ enum eEnums
//OTHER SPELLS
//SPELL_CHARGE_UP = 52098, // only used when starting walk from one platform to the other
- //SPELL_TEMPORARY_ELECTRICAL_CHARGE = 52092, // triggered part of above
+ SPELL_TEMPORARY_ELECTRICAL_CHARGE = 52092, // triggered part of above
NPC_STORMFORGED_LIEUTENANT = 29240,
SPELL_ARC_WELD = 59085,
@@ -98,11 +98,13 @@ public:
m_instance = creature->GetInstanceScript();
m_uiStance = STANCE_DEFENSIVE;
memset(&m_auiStormforgedLieutenantGUID, 0, sizeof(m_auiStormforgedLieutenantGUID));
+ canBuff = true;
}
InstanceScript* m_instance;
bool m_bIsChangingStance;
+ bool canBuff;
uint8 m_uiChargingStatus;
uint8 m_uiStance;
@@ -126,6 +128,10 @@ public:
void Reset()
{
+ if (canBuff)
+ if (!me->HasAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE))
+ me->AddAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE, me);
+
m_bIsChangingStance = false;
m_uiChargingStatus = 0;
@@ -167,6 +173,16 @@ public:
m_instance->SetData(TYPE_BJARNGRIM, NOT_STARTED);
}
+ void EnterEvadeMode()
+ {
+ if (me->HasAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE))
+ canBuff = true;
+ else
+ canBuff = false;
+
+ ScriptedAI::EnterEvadeMode();
+ }
+
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
@@ -211,7 +227,7 @@ public:
void UpdateAI(const uint32 uiDiff)
{
//Return since we have no target
- if (!UpdateVictim())
+ if (!UpdateVictim())
return;
// Change stance
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
index e7f8ad4e5e8..016c4d27cfa 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
index d90704dd352..171215c605a 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
index 719d74a3bde..1fc724c8b6c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -243,7 +243,7 @@ public:
{
if (m_uiPause_Timer <= uiDiff)
{
- if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE)
if (me->getVictim())
me->GetMotionMaster()->MoveChase(me->getVictim());
@@ -421,7 +421,7 @@ public:
// me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //Set in DB
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
- if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
me->GetMotionMaster()->MovementExpired();
m_bIsFrozen = true;
}
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 598af7efc98..d5bca9c257d 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp
index c5c7f9546ba..f25be6dae0d 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp
index 65b5d3eaad1..d1aba800094 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -174,7 +174,7 @@ public:
bIsSlam = false;
//and correct movement, if not already
- if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE)
{
if (me->getVictim())
me->GetMotionMaster()->MoveChase(me->getVictim());
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 4f512089119..cd4d7ae94a1 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_sjonnir.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp
index dd61fe549c3..2c7026207e5 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 273a0bf6f8e..1c8d9380a2b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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.h b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h
index 37ef4e458b4..a6f1eb86178 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 ffd3706a7e5..ee5cb87dd85 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp
index 1892702d336..e54d8a898de 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 a8a4fad5e4e..eadc524348b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -283,7 +283,7 @@ class boss_steelbreaker : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -404,7 +404,7 @@ class boss_runemaster_molgeim : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -634,7 +634,7 @@ class boss_stormcaller_brundir : public CreatureScript
// Prevent to have Brundir somewhere in the air when he die in Air phase
if (me->GetPositionZ() > FLOOR_Z)
- me->GetMotionMaster()->MoveFall(FLOOR_Z);
+ me->GetMotionMaster()->MoveFall();
}
void KilledUnit(Unit* /*who*/)
@@ -649,7 +649,7 @@ class boss_stormcaller_brundir : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp
index bcc417c50cd..1c478cd83e9 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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 @@ class boss_auriaya : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -348,7 +348,7 @@ class npc_sanctum_sentry : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -418,7 +418,7 @@ class npc_feral_defender : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
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 ad79d1b56cc..47f74b1ddba 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -384,7 +384,7 @@ class boss_flame_leviathan : public CreatureScript
return;
}
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -425,7 +425,7 @@ class boss_flame_leviathan : public CreatureScript
break;
case EVENT_REPAIR:
me->MonsterTextEmote(EMOTE_REPAIR, 0, true);
- me->ClearUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
+ me->ClearUnitState(UNIT_STATE_STUNNED | UNIT_STATE_ROOT);
events.ScheduleEvent(EVENT_SHUTDOWN, 150*IN_MILLISECONDS);
events.CancelEvent(EVENT_REPAIR);
break;
@@ -1576,7 +1576,7 @@ class spell_systems_shutdown : public SpellScriptLoader
return;
//! This could probably in the SPELL_EFFECT_SEND_EVENT handler too:
- owner->AddUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
+ owner->AddUnitState(UNIT_STATE_STUNNED | UNIT_STATE_ROOT);
owner->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
owner->RemoveAurasDueToSpell(SPELL_GATHERING_SPEED);
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
index 13c174a9607..12d953a07b4 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -401,7 +401,7 @@ class boss_freya : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -436,7 +436,7 @@ class boss_freya : public CreatureScript
break;
case EVENT_WAVE:
SpawnWave();
- if (waveCount < 6)
+ if (waveCount <= 6) // If set to 6 The Bombs appear during the Final Add wave
events.ScheduleEvent(EVENT_WAVE, WAVE_TIME);
else
events.ScheduleEvent(EVENT_NATURE_BOMB, urand(10000, 20000));
@@ -739,7 +739,7 @@ class boss_elder_brightleaf : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -872,7 +872,7 @@ class boss_elder_stonebark : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -985,7 +985,7 @@ class boss_elder_ironbranch : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -1372,7 +1372,7 @@ class npc_healthy_spore : public CreatureScript
{
npc_healthy_sporeAI(Creature* creature) : Scripted_NoMovementAI(creature)
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_PASSIVE);
DoCast(me, SPELL_HEALTHY_SPORE_VISUAL);
DoCast(me, SPELL_POTENT_PHEROMONES);
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 7d00c0e59fc..c7918f85245 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -138,7 +138,7 @@ class boss_general_vezax : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -336,7 +336,7 @@ class boss_saronite_animus : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
index bb21da94bc5..33f50d0b3de 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -370,7 +370,7 @@ class boss_hodir : public CreatureScript
me->StopMoving();
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
- me->SetControlled(true, UNIT_STAT_STUNNED);
+ me->SetControlled(true, UNIT_STATE_STUNNED);
me->CombatStop(true);
me->setFaction(35);
@@ -387,7 +387,7 @@ class boss_hodir : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -612,12 +612,12 @@ class npc_hodir_priest : public CreatureScript
void UpdateAI(uint32 const diff)
{
- if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED))
+ if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED))
return;
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if (HealthBelowPct(30))
@@ -688,12 +688,12 @@ class npc_hodir_shaman : public CreatureScript
void UpdateAI(uint32 const diff)
{
- if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED))
+ if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED))
return;
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -750,12 +750,12 @@ class npc_hodir_druid : public CreatureScript
void UpdateAI(uint32 const diff)
{
- if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED))
+ if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED))
return;
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -825,12 +825,12 @@ class npc_hodir_mage : public CreatureScript
void UpdateAI(uint32 const diff)
{
- if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED))
+ if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED))
return;
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
index b8876ae577a..d8a3ef0b8df 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -202,7 +202,7 @@ class boss_ignis : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
index 5da1c485986..a156e6ef08b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -224,7 +224,7 @@ class boss_kologarn : public CreatureScript
summon->CastSpell(summon, SPELL_FOCUSED_EYEBEAM_VISUAL, true);
summon->SetReactState(REACT_PASSIVE);
// One of the above spells is a channeled spell, we need to clear this unit state for MoveChase to work
- summon->ClearUnitState(UNIT_STAT_CASTING);
+ summon->ClearUnitState(UNIT_STATE_CASTING);
// Victim gets 67351
if (eyebeamTarget)
@@ -244,7 +244,7 @@ class boss_kologarn : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
index 11b7c54975e..98b3a6b658b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 0e3a8926203..45f9a1fa012 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-2011 TrinityCore <http://www.trinitycore.org/>
+* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -668,7 +668,7 @@ class npc_expedition_commander : public CreatureScript
break;
case 4:
for (uint8 n = 0; n < RAID_MODE(2, 4); n++)
- Engineer[n]->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USESTANDING);
+ Engineer[n]->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING);
for (uint8 n = 0; n < 4; ++n)
Defender[n]->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
me->MonsterYell(SAY_AGGRO_2, LANG_UNIVERSAL, 0);
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp
index f993c419b8c..72741ee0679 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 ae803b24642..724eb45d586 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,7 +263,7 @@ class boss_xt002 : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp
index e4b21e1f66e..3f01f21b189 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
index 3c5697a7995..e12393f047f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,8 +358,12 @@ class instance_ulduar : public InstanceMapScript
}
}
- void OnCreatureDeath(Creature* creature)
+ void OnUnitDeath(Unit* unit)
{
+ Creature* creature = unit->ToCreature();
+ if (!creature)
+ return;
+
switch (creature->GetEntry())
{
case NPC_CORRUPTED_SERVITOR:
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h
index f11212d535e..a31954b8a16 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 05b1e395d1e..29eb5ad3367 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 3712bd748a5..a11f88fc6af 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,7 +18,7 @@
/* ScriptData
SDName: Boss_Ingvar_The_Plunderer
SD%Complete: 95
-SDComment: Some Problems with Annhylde Movement, Blizzlike Timers
+SDComment: Some Problems with Annhylde Movement, Blizzlike Timers (just shadow axe summon needs a new timer)
SDCategory: Udgarde Keep
EndScriptData */
@@ -45,16 +45,32 @@ enum Creatures
MOB_INGVAR_UNDEAD = 23980,
};
+enum Events
+{
+ EVENT_CLEAVE = 1,
+ EVENT_SMASH,
+ EVENT_STAGGERING_ROAR,
+ EVENT_ENRAGE,
+
+ EVENT_DARK_SMASH,
+ EVENT_DREADFUL_ROAR,
+ EVENT_WOE_STRIKE,
+ EVENT_SHADOW_AXE
+};
+
+enum Phases
+{
+ PHASE_HUMAN = 1,
+ PHASE_UNDEAD,
+};
+
enum Spells
{
//Ingvar Spells human form
SPELL_CLEAVE = 42724,
SPELL_SMASH = 42669,
- H_SPELL_SMASH = 59706,
SPELL_STAGGERING_ROAR = 42708,
- H_SPELL_STAGGERING_ROAR = 59708,
SPELL_ENRAGE = 42705,
- H_SPELL_ENRAGE = 59707,
SPELL_INGVAR_FEIGN_DEATH = 42795,
SPELL_SUMMON_BANSHEE = 42912,
@@ -63,9 +79,7 @@ enum Spells
//Ingvar Spells undead form
SPELL_DARK_SMASH = 42723,
SPELL_DREADFUL_ROAR = 42729,
- H_SPELL_DREADFUL_ROAR = 59734,
SPELL_WOE_STRIKE = 42730,
- H_SPELL_WOE_STRIKE = 59735,
ENTRY_THROW_TARGET = 23996,
SPELL_SHADOW_AXE_SUMMON = 42749
@@ -83,9 +97,9 @@ public:
struct boss_ingvar_the_plundererAI : public ScriptedAI
{
- boss_ingvar_the_plundererAI(Creature* c) : ScriptedAI(c)
+ boss_ingvar_the_plundererAI(Creature* creature) : ScriptedAI(creature)
{
- instance = c->GetInstanceScript();
+ instance = creature->GetInstanceScript();
}
InstanceScript* instance;
@@ -93,10 +107,6 @@ public:
bool bIsUndead;
bool bEventInProgress;
- uint32 uiCleaveTimer;
- uint32 uiSmashTimer;
- uint32 uiEnrageTimer;
- uint32 uiRoarTimer;
uint32 uiSpawnResTimer;
void Reset()
@@ -107,13 +117,21 @@ public:
bIsUndead = false;
bEventInProgress = false;
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetStandState(UNIT_STAND_STATE_STAND);
- uiCleaveTimer = 2000;
- uiSmashTimer = 5000;
- uiEnrageTimer = 10000;
- uiRoarTimer = 15000;
+ events.Reset();
+ events.SetPhase(PHASE_HUMAN);
+
+ events.ScheduleEvent(EVENT_CLEAVE, urand(6,12)*IN_MILLISECONDS, 0, PHASE_HUMAN);
+ events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_HUMAN);
+ events.ScheduleEvent(EVENT_ENRAGE, urand(7,14)*IN_MILLISECONDS, 0, PHASE_HUMAN);
+ events.ScheduleEvent(EVENT_SMASH, urand(12,17)*IN_MILLISECONDS, 0, PHASE_HUMAN);
+
+ events.ScheduleEvent(EVENT_DARK_SMASH, urand(14,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
+ events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
+ events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10,14)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
+ events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD);
uiSpawnResTimer = 3000;
@@ -138,6 +156,7 @@ public:
bEventInProgress = true;
bIsUndead = true;
+ events.SetPhase(PHASE_UNDEAD);
DoScriptText(YELL_DEAD_1, me);
}
@@ -208,70 +227,60 @@ public:
return;
}
- if (uiCleaveTimer <= diff)
- {
- if (!me->HasUnitState(UNIT_STAT_CASTING))
- {
- if (bIsUndead)
- DoCast(me->getVictim(), SPELL_WOE_STRIKE);
- else
- DoCast(me->getVictim(), SPELL_CLEAVE);
- uiCleaveTimer = rand()%5000 + 2000;
- }
- } else uiCleaveTimer -= diff;
+ events.Update(diff);
- if (uiSmashTimer <= diff)
- {
- if (!me->HasUnitState(UNIT_STAT_CASTING))
- {
- if (bIsUndead)
- DoCast(me->getVictim(), SPELL_DARK_SMASH);
- else
- DoCast(me->getVictim(), SPELL_SMASH);
- uiSmashTimer = 10000;
- }
- } else uiSmashTimer -= diff;
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
- if (!bIsUndead)
- {
- if (uiEnrageTimer <= diff)
- {
- DoCast(me, SPELL_ENRAGE);
- uiEnrageTimer = 10000;
- } else uiEnrageTimer -= diff;
- } else // In Undead form used to summon weapon
+ while (uint32 eventId = events.ExecuteEvent())
{
- if (uiEnrageTimer <= diff)
+ switch (eventId)
{
- if (!me->HasUnitState(UNIT_STAT_CASTING))
- {
- // Spawn target for Axe
- Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
- if (target)
+ // PHASE ONE
+ case EVENT_CLEAVE:
+ DoCastVictim(SPELL_CLEAVE);
+ events.ScheduleEvent(EVENT_CLEAVE, urand(6,12)*IN_MILLISECONDS, 0, PHASE_HUMAN);
+ break;
+ case EVENT_STAGGERING_ROAR:
+ DoCast(me, SPELL_STAGGERING_ROAR);
+ events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_HUMAN);
+ break;
+ case EVENT_ENRAGE:
+ DoCast(me, SPELL_ENRAGE);
+ events.ScheduleEvent(EVENT_ENRAGE, urand(7,14)*IN_MILLISECONDS, 0, PHASE_HUMAN);
+ break;
+ case EVENT_SMASH:
+ DoCastVictim(SPELL_SMASH);
+ events.ScheduleEvent(EVENT_SMASH, urand(12,17)*IN_MILLISECONDS, 0, PHASE_HUMAN);
+ break;
+ // PHASE TWO
+ case EVENT_DARK_SMASH:
+ DoCastVictim(SPELL_DARK_SMASH);
+ events.ScheduleEvent(EVENT_DARK_SMASH, urand(14,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
+ break;
+ case EVENT_DREADFUL_ROAR:
+ DoCast(me, SPELL_DREADFUL_ROAR);
+ events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
+ break;
+ case EVENT_WOE_STRIKE:
+ DoCastVictim(SPELL_WOE_STRIKE);
+ events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10,14)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
+ break;
+ case EVENT_SHADOW_AXE:
+ if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1))
{
me->SummonCreature(ENTRY_THROW_TARGET, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 2000);
-
DoCast(me, SPELL_SHADOW_AXE_SUMMON);
}
- uiEnrageTimer = 30000;
- }
- } else uiEnrageTimer -= diff;
- }
-
- if (uiRoarTimer <= diff)
- {
- if (!me->HasUnitState(UNIT_STAT_CASTING))
- {
- if (bIsUndead)
- DoCast(me, SPELL_DREADFUL_ROAR);
- else
- DoCast(me, SPELL_STAGGERING_ROAR);
- uiRoarTimer = 10000;
+ events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD);
+ break;
}
- } else uiRoarTimer -= diff;
+ }
DoMeleeAttackIfReady();
}
+ private:
+ EventMap events;
};
};
@@ -381,8 +390,9 @@ public:
{
ingvar->RemoveAurasDueToSpell(SPELL_SCOURG_RESURRECTION_DUMMY);
- if (boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI* pAI = CAST_AI(boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI, ingvar->AI()))
- pAI->StartZombiePhase();
+ if (ingvar->getVictim())
+ if (boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI* ai = CAST_AI(boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI, ingvar->AI()))
+ ai->StartZombiePhase();
me->GetMotionMaster()->MovePoint(2, x+1, y, z+30);
++uiResurectPhase;
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp
index 0a3f2dc3078..8a6d7f80818 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,354 +17,323 @@
/* ScriptData
SDName: Boss_Prince_Keleseth
-SD%Complete: 90
-SDComment: Needs Prince Movements, Needs adjustments to blizzlike timers, Needs Shadowbolt castbar, Needs right Ressurect Visual, Needs Some Heroic Spells
+SD%Complete: 100
+SDComment:
SDCategory: Utgarde Keep
EndScriptData */
#include "ScriptPCH.h"
#include "utgarde_keep.h"
-enum eEnums
+enum KelsethEncounter
{
- ACHIEVEMENT_ON_THE_ROCKS = 1919,
-
SPELL_SHADOWBOLT = 43667,
- SPELL_SHADOWBOLT_HEROIC = 59389,
SPELL_FROST_TOMB = 48400,
+ SPELL_FROST_TOMB_STUN = 42672,
SPELL_FROST_TOMB_SUMMON = 42714,
+
+ SPELL_SHADOW_FISSURE = 50657,
+ SPELL_FULL_HEAL = 17683,
SPELL_DECREPIFY = 42702,
- SPELL_SCOURGE_RESSURRECTION = 42704,
- CREATURE_FROSTTOMB = 23965,
- CREATURE_SKELETON = 23970,
-
- SAY_AGGRO = -1574000,
- SAY_FROST_TOMB = -1574001,
- SAY_SKELETONS = -1574002,
- SAY_KILL = -1574003,
- SAY_DEATH = -1574004
+ SPELL_BONE_ARMOR = 59386,
+
+ NPC_FROSTTOMB = 23965,
+ NPC_SKELETON = 23970,
+
+ SAY_START_COMBAT = 1,
+ SAY_SUMMON_SKELETONS,
+ SAY_FROST_TOMB,
+ SAY_FROST_TOMB_EMOTE,
+ SAY_DEATH,
+
+ EVENT_SHADOWBOLT = 1,
+ EVENT_FROST_TOMB,
+ EVENT_SUMMON_SKELETONS,
+
+ EVENT_DECREPIFY,
+ EVENT_FULL_HEAL,
+ EVENT_SHADOW_FISSURE,
+ EVENT_RESURRECT,
+
+ DATA_ON_THE_ROCKS
};
#define SKELETONSPAWN_Z 42.8668f
-float SkeletonSpawnPoint[5][5]=
+float const SkeletonSpawnPoint[1][2] =
{
{156.2559f, 259.2093f},
- {156.2559f, 259.2093f},
- {156.2559f, 259.2093f},
- {156.2559f, 259.2093f},
- {156.2559f, 259.2093f},
};
-float AttackLoc[3]={197.636f, 194.046f, 40.8164f};
+float AttackLoc[3]= {197.636f, 194.046f, 40.8164f};
-bool ShatterFrostTomb; // needed for achievement: On The Rocks(1919)
-
-class mob_frost_tomb : public CreatureScript
+class npc_frost_tomb : public CreatureScript
{
public:
- mob_frost_tomb() : CreatureScript("mob_frost_tomb") { }
+ npc_frost_tomb() : CreatureScript("npc_frost_tomb") {}
CreatureAI* GetAI(Creature* creature) const
{
- return new mob_frost_tombAI(creature);
+ return new npc_frost_tombAI(creature);
}
- struct mob_frost_tombAI : public ScriptedAI
+ struct npc_frost_tombAI : public ScriptedAI
{
- mob_frost_tombAI(Creature* c) : ScriptedAI(c)
+ npc_frost_tombAI(Creature* creature) : ScriptedAI(creature)
{
- FrostTombGUID = 0;
- }
-
- uint64 FrostTombGUID;
+ if (me->isSummon())
+ if (Unit* summon = me->ToTempSummon()->GetSummoner())
+ DoCast(summon, SPELL_FROST_TOMB, true);
- void SetPrisoner(Unit* uPrisoner)
- {
- FrostTombGUID = uPrisoner->GetGUID();
+ instance = creature->GetInstanceScript();
}
- void Reset(){ FrostTombGUID = 0; }
- void EnterCombat(Unit* /*who*/) {}
- void AttackStart(Unit* /*who*/) {}
- void MoveInLineOfSight(Unit* /*who*/) {}
+ void UpdateAI(const uint32 /*diff*/) {}
- void JustDied(Unit* killer)
+ void JustDied(Unit* /*killer*/)
{
- if (killer->GetGUID() != me->GetGUID())
- ShatterFrostTomb = true;
-
- if (FrostTombGUID)
- {
- Unit* FrostTomb = Unit::GetUnit((*me), FrostTombGUID);
- if (FrostTomb)
- FrostTomb->RemoveAurasDueToSpell(SPELL_FROST_TOMB);
- }
+ if (instance)
+ if (Unit* boss = me->GetUnit(*me, instance->GetData64(DATA_PRINCEKELESETH)))
+ if (boss->ToCreature() && boss->ToCreature()->AI())
+ boss->ToCreature()->AI()->SetData(DATA_ON_THE_ROCKS, false);
}
- void UpdateAI(const uint32 /*diff*/)
- {
- Unit* temp = Unit::GetUnit((*me), FrostTombGUID);
- if ((temp && temp->isAlive() && !temp->HasAura(SPELL_FROST_TOMB)) || !temp)
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
+ private:
+ InstanceScript* instance;
};
-
};
class boss_keleseth : public CreatureScript
{
public:
- boss_keleseth() : CreatureScript("boss_keleseth") { }
+ boss_keleseth() : CreatureScript("boss_keleseth") {}
CreatureAI* GetAI(Creature* creature) const
{
return new boss_kelesethAI (creature);
}
- struct boss_kelesethAI : public ScriptedAI
+ struct boss_kelesethAI : public BossAI
{
- boss_kelesethAI(Creature* c) : ScriptedAI(c)
+ boss_kelesethAI(Creature* creature) : BossAI(creature, DATA_PRINCEKELESETH_EVENT)
{
- instance = c->GetInstanceScript();
+ creature->SetReactState(REACT_DEFENSIVE);
}
- InstanceScript* instance;
-
- uint32 FrostTombTimer;
- uint32 SummonSkeletonsTimer;
- uint32 RespawnSkeletonsTimer;
- uint32 ShadowboltTimer;
- uint64 SkeletonGUID[5];
- bool Skeletons;
- bool RespawnSkeletons;
-
void Reset()
{
- ShadowboltTimer = 0;
- Skeletons = false;
+ instance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED);
- ShatterFrostTomb = false;
+ events.Reset();
+ events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2,3)*IN_MILLISECONDS);
+ events.ScheduleEvent(EVENT_FROST_TOMB, urand(14,19)*IN_MILLISECONDS);
+ events.ScheduleEvent(EVENT_SUMMON_SKELETONS, 6*IN_MILLISECONDS);
- ResetTimer();
+ summons.DespawnAll();
- if (instance)
- instance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED);
+ onTheRocks = true;
}
- void KilledUnit(Unit* victim)
+ void EnterCombat(Unit* /*who*/)
{
- if (victim == me)
- return;
-
- DoScriptText(SAY_KILL, me);
+ me->SetInCombatWithZone();
+ instance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS);
+ Talk(SAY_START_COMBAT);
}
void JustDied(Unit* /*killer*/)
{
- DoScriptText(SAY_DEATH, me);
-
- if (IsHeroic() && !ShatterFrostTomb)
- {
- AchievementEntry const* AchievOnTheRocks = GetAchievementStore()->LookupEntry(ACHIEVEMENT_ON_THE_ROCKS);
- if (AchievOnTheRocks)
- {
- Map* map = me->GetMap();
- if (map && map->IsDungeon())
- {
- Map::PlayerList const &players = map->GetPlayers();
- for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- itr->getSource()->CompletedAchievement(AchievOnTheRocks);
- }
- }
- }
-
- if (instance)
- instance->SetData(DATA_PRINCEKELESETH_EVENT, DONE);
+ instance->SetData(DATA_PRINCEKELESETH_EVENT, DONE);
+ summons.DespawnAll();
+ Talk(SAY_DEATH);
}
- void EnterCombat(Unit* /*who*/)
+ void SetData(uint32 data, uint32 value)
{
- DoScriptText(SAY_AGGRO, me);
- DoZoneInCombat();
-
- if (instance)
- instance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS);
+ if (data == DATA_ON_THE_ROCKS)
+ onTheRocks = value;
}
- void ResetTimer(uint32 inc = 0)
+ uint32 GetData(uint32 data)
{
- SummonSkeletonsTimer = 5000 + inc;
- FrostTombTimer = 28000 + inc;
+ if (data == DATA_ON_THE_ROCKS)
+ return onTheRocks;
+
+ return 0;
}
- void UpdateAI(const uint32 diff)
+ void ExecuteEvent(uint32 const eventId)
{
- if (!UpdateVictim())
- return;
-
- if (ShadowboltTimer <= diff)
+ switch (eventId)
{
- Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0);
- if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
- me->CastSpell(target, DUNGEON_MODE(SPELL_SHADOWBOLT, SPELL_SHADOWBOLT_HEROIC), true);
- ShadowboltTimer = 10000;
- } else ShadowboltTimer -= diff;
-
- if (!Skeletons)
- {
- if ((SummonSkeletonsTimer <= diff))
- {
- Creature* Skeleton;
- DoScriptText(SAY_SKELETONS, me);
- for (uint8 i = 0; i < 5; ++i)
+ case EVENT_SUMMON_SKELETONS:
+ Talk(SAY_SUMMON_SKELETONS);
+ SummonSkeletons();
+ break;
+ case EVENT_SHADOWBOLT:
+ DoCastVictim(SPELL_SHADOWBOLT);
+ events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2,3)*IN_MILLISECONDS);
+ break;
+ case EVENT_FROST_TOMB:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true, -SPELL_FROST_TOMB))
{
- Skeleton = me->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1], SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
- if (Skeleton)
- {
- Skeleton->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
- Skeleton->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
- Skeleton->AddThreat(me->getVictim(), 0.0f);
- DoZoneInCombat(Skeleton);
- }
- }
- Skeletons = true;
- } else SummonSkeletonsTimer -= diff;
- }
+ Talk(SAY_FROST_TOMB);
+ Talk(SAY_FROST_TOMB_EMOTE, target->GetGUID());
- if (FrostTombTimer <= diff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- if (target->isAlive())
- {
- //DoCast(target, SPELL_FROST_TOMB_SUMMON, true);
- if (Creature* pChains = me->SummonCreature(CREATURE_FROSTTOMB, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000))
- {
- CAST_AI(mob_frost_tomb::mob_frost_tombAI, pChains->AI())->SetPrisoner(target);
- pChains->CastSpell(target, SPELL_FROST_TOMB, true);
-
- DoScriptText(SAY_FROST_TOMB, me);
- }
+ DoCast(target, SPELL_FROST_TOMB_STUN, true);
+ // checked from sniffs - the player casts the spell
+ target->CastSpell(target, SPELL_FROST_TOMB_SUMMON, true);
}
- FrostTombTimer = 15000;
- } else FrostTombTimer -= diff;
+ events.ScheduleEvent(EVENT_FROST_TOMB, urand(14,19)*IN_MILLISECONDS);
+ break;
+ }
+ }
- DoMeleeAttackIfReady();
+ void SummonSkeletons()
+ {
+ // I could not found any spell casted for this
+ for (uint8 i = 0; i < 4; ++i)
+ me->SummonCreature(NPC_SKELETON, SkeletonSpawnPoint[0][0], SkeletonSpawnPoint[0][1], SKELETONSPAWN_Z, 0);
}
+ private:
+ bool onTheRocks;
};
-
};
-class mob_vrykul_skeleton : public CreatureScript
+class npc_vrykul_skeleton : public CreatureScript
{
public:
- mob_vrykul_skeleton() : CreatureScript("mob_vrykul_skeleton") { }
+ npc_vrykul_skeleton() : CreatureScript("npc_vrykul_skeleton") {}
CreatureAI* GetAI(Creature* creature) const
{
- return new mob_vrykul_skeletonAI (creature);
+ return new npc_vrykul_skeletonAI (creature);
}
- struct mob_vrykul_skeletonAI : public ScriptedAI
+ struct npc_vrykul_skeletonAI : public ScriptedAI
{
- mob_vrykul_skeletonAI(Creature* c) : ScriptedAI(c)
- {
- instance = c->GetInstanceScript();
- }
-
- InstanceScript* instance;
- uint32 Respawn_Time;
- uint64 Target_Guid;
- uint32 Decrepify_Timer;
-
- bool isDead;
+ npc_vrykul_skeletonAI(Creature* creature) : ScriptedAI(creature) {}
void Reset()
{
- Respawn_Time = 12000;
- Decrepify_Timer = urand(10000, 20000);
- isDead = false;
+ events.Reset();
+ events.ScheduleEvent(EVENT_DECREPIFY, urand(4,6)*IN_MILLISECONDS);
+
+ DoCast(SPELL_BONE_ARMOR);
}
- void EnterCombat(Unit* /*who*/){}
- void DamageTaken(Unit* done_by, uint32 &damage)
+ void DamageTaken(Unit* /*done_by*/, uint32 &damage)
{
- if (done_by->GetGUID() == me->GetGUID())
- return;
-
if (damage >= me->GetHealth())
{
- PretendToDie();
damage = 0;
- }
- }
- void PretendToDie()
- {
- isDead = true;
- me->InterruptNonMeleeSpells(true);
- me->RemoveAllAuras();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->GetMotionMaster()->MovementExpired(false);
- me->GetMotionMaster()->MoveIdle();
- me->SetStandState(UNIT_STAND_STATE_DEAD);
- };
+ // There are some issues with pets
+ // they will still attack. I would say it is a PetAI bug
+ if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
+ {
+ // from sniffs
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
- void Resurrect()
- {
- isDead = false;
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->SetStandState(UNIT_STAND_STATE_STAND);
- DoCast(me, SPELL_SCOURGE_RESSURRECTION, true);
+ events.Reset();
+ events.ScheduleEvent(EVENT_RESURRECT, urand(18,22)*IN_MILLISECONDS);
- if (me->getVictim())
- {
- me->GetMotionMaster()->MoveChase(me->getVictim());
- me->AI()->AttackStart(me->getVictim());
+ me->GetMotionMaster()->MovementExpired(false);
+ me->GetMotionMaster()->MoveIdle();
+ }
}
- else
- me->GetMotionMaster()->Initialize();
- };
+ }
void UpdateAI(const uint32 diff)
{
- if (instance && instance->GetData(DATA_PRINCEKELESETH_EVENT) == IN_PROGRESS)
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ while (uint32 eventId = events.ExecuteEvent())
{
- if (isDead)
+ switch (eventId)
{
- if (Respawn_Time <= diff)
- {
- Resurrect();
- Respawn_Time = 12000;
- } else Respawn_Time -= diff;
+ case EVENT_DECREPIFY:
+ DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_DECREPIFY), SPELL_DECREPIFY);
+ events.ScheduleEvent(EVENT_DECREPIFY, urand(1,5)*IN_MILLISECONDS);
+ break;
+ case EVENT_RESURRECT:
+ events.ScheduleEvent(EVENT_FULL_HEAL, 1*IN_MILLISECONDS);
+ events.ScheduleEvent(EVENT_SHADOW_FISSURE, 1*IN_MILLISECONDS);
+ break;
+ case EVENT_FULL_HEAL:
+ DoCast(me, SPELL_FULL_HEAL, true);
+ break;
+ case EVENT_SHADOW_FISSURE:
+ DoCast(me, SPELL_SHADOW_FISSURE, true);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
+ me->GetMotionMaster()->MoveChase(me->getVictim());
+ events.ScheduleEvent(EVENT_DECREPIFY, urand(4,6)*IN_MILLISECONDS);
+ break;
}
- else
- {
- if (!UpdateVictim())
- return;
+ }
- if (Decrepify_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_DECREPIFY);
- Decrepify_Timer = 30000;
- } else Decrepify_Timer -= diff;
+ if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
+ DoMeleeAttackIfReady();
+ }
- DoMeleeAttackIfReady();
- }
- }else
+ private:
+ EventMap events;
+ };
+};
+
+class spell_frost_tomb : public SpellScriptLoader
+{
+ public:
+ spell_frost_tomb() : SpellScriptLoader("spell_frost_tomb") {}
+
+ class spell_frost_tomb_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_frost_tomb_AuraScript);
+ void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- if (me->isAlive())
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
+ if (Unit* caster = GetCaster())
+ if (caster->ToCreature() && caster->isAlive())
+ caster->ToCreature()->DespawnOrUnsummon(1000);
}
+ void Register()
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_frost_tomb_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_frost_tomb_AuraScript();
}
- };
+};
+
+
+class achievement_on_the_rocks : public AchievementCriteriaScript
+{
+ public:
+ achievement_on_the_rocks() : AchievementCriteriaScript("achievement_on_the_rocks") {}
+ bool OnCheck(Player* /*source*/, Unit* target)
+ {
+ return target && target->IsAIEnabled && target->GetAI()->GetData(DATA_ON_THE_ROCKS);
+ }
};
void AddSC_boss_keleseth()
{
new boss_keleseth();
- new mob_frost_tomb();
- new mob_vrykul_skeleton();
+ new npc_frost_tomb();
+ new npc_vrykul_skeleton();
+ new spell_frost_tomb();
+ new achievement_on_the_rocks();
}
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 e828d81e05a..333278daa10 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/instance_utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp
index 488c38f5a6e..6ecc1883afc 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 45ceb85a640..d660b1516b3 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 275ffa659e8..971dab98f4d 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 9fa9c7c9d4f..656b2931abb 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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 @@ public:
void JustReachedHome()
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_IMMUNE_TO_PC);
me->SetStandState(UNIT_STAND_STATE_STAND);
DoCast(me, SPELL_FREEZE);
}
@@ -381,7 +381,7 @@ public:
void JustReachedHome()
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC);
me->SetStandState(UNIT_STAND_STATE_STAND);
DoCast(me, SPELL_FREEZE);
}
@@ -496,7 +496,7 @@ public:
void JustReachedHome()
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC);
me->SetStandState(UNIT_STAND_STATE_STAND);
DoCast(me, SPELL_FREEZE);
}
@@ -611,7 +611,7 @@ public:
void JustReachedHome()
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC);
me->SetStandState(UNIT_STAND_STATE_STAND);
DoCast(me, SPELL_FREEZE);
}
@@ -732,7 +732,7 @@ public:
void JustReachedHome()
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC);
me->SetStandState(UNIT_STAND_STATE_STAND);
DoCast(me, SPELL_FREEZE);
}
@@ -793,7 +793,7 @@ public:
if (pNext)
{
pNext->RemoveAurasDueToSpell(SPELL_FREEZE);
- pNext->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ pNext->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC);
pNext->SetStandState(UNIT_STAND_STATE_STAND);
pNext->SetInCombatWithZone();
pNext->Attack(pNext->SelectNearestTarget(100), true);
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
index f31271b825e..d5cd79b25f1 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -288,7 +288,7 @@ public:
me->Dismount();
if (Creature* pGrauf = me->SummonCreature(CREATURE_GRAUF, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3*IN_MILLISECONDS))
{
- pGrauf->GetMotionMaster()->MoveFall(0);
+ pGrauf->GetMotionMaster()->MoveFall();
pGrauf->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH);
}
me->GetMotionMaster()->MoveJump(Location[4].GetPositionX(), Location[4].GetPositionY(), Location[4].GetPositionZ(), 5.0f, 10.0f);
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
index 45534824860..989e1e57453 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,69 +20,94 @@
enum Spells
{
- SPELL_CALL_FLAMES = 48258,
- SPELL_RITUAL_OF_THE_SWORD = 48276, //Effect #1 Teleport, Effect #2 Dummy
+ SPELL_SVALA_TRANSFORMING1 = 54140,
+ SPELL_SVALA_TRANSFORMING2 = 54205,
+ SPELL_TRANSFORMING_CHANNEL = 54142,
+
+ SPELL_CALL_FLAMES = 48258, // caster effect only, triggers event 17841
SPELL_SINSTER_STRIKE = 15667,
H_SPELL_SINSTER_STRIKE = 59409,
- SPELL_SVALA_TRANSFORMING1 = 54140,
- SPELL_SVALA_TRANSFORMING2 = 54205
+
+ SPELL_RITUAL_PREPARATION = 48267,
+ SPELL_RITUAL_OF_THE_SWORD = 48276,
+ SPELL_RITUAL_STRIKE_TRIGGER = 48331, // triggers 48277 & 59930, needs NPC_RITUAL_TARGET as spell_script_target
+ SPELL_RITUAL_DISARM = 54159,
+ SPELL_RITUAL_STRIKE_EFF_1 = 48277,
+ SPELL_RITUAL_STRIKE_EFF_2 = 59930,
+
+ SPELL_SUMMONED_VIS = 64446,
+ SPELL_RITUAL_CHANNELER_1 = 48271,
+ SPELL_RITUAL_CHANNELER_2 = 48274,
+ SPELL_RITUAL_CHANNELER_3 = 48275,
+
+ // Ritual Channeler spells
+ SPELL_PARALYZE = 48278,
+ SPELL_SHADOWS_IN_THE_DARK = 59407,
+
+ // Scourge Hulk spells
+ SPELL_MIGHTY_BLOW = 48697,
+ SPELL_VOLATILE_INFECTION = 56785,
+ H_SPELL_VOLATILE_INFECTION = 59228
};
-//not in db
+
enum Yells
{
- SAY_DIALOG_WITH_ARTHAS_1 = -1575015,
- SAY_DIALOG_WITH_ARTHAS_2 = -1575016,
- SAY_DIALOG_WITH_ARTHAS_3 = -1575017,
- SAY_AGGRO = -1575018,
- SAY_SLAY_1 = -1575019,
- SAY_SLAY_2 = -1575020,
- SAY_SLAY_3 = -1575021,
- SAY_DEATH = -1575022,
- SAY_SACRIFICE_PLAYER_1 = -1575023,
- SAY_SACRIFICE_PLAYER_2 = -1575024,
- SAY_SACRIFICE_PLAYER_3 = -1575025,
- SAY_SACRIFICE_PLAYER_4 = -1575026,
- SAY_SACRIFICE_PLAYER_5 = -1575027,
- SAY_DIALOG_OF_ARTHAS_1 = -1575028,
- SAY_DIALOG_OF_ARTHAS_2 = -1575029
+ // Svala
+ SAY_SVALA_INTRO_0 = 0,
+
+ // Svala Sorrowgrave
+ SAY_SVALA_INTRO_1 = 0,
+ SAY_SVALA_INTRO_2 = 1,
+ SAY_AGGRO = 2,
+ SAY_SLAY = 3,
+ SAY_DEATH = 4,
+ SAY_SACRIFICE_PLAYER = 5,
+
+ // Image of Arthas
+ SAY_DIALOG_OF_ARTHAS_1 = 0,
+ SAY_DIALOG_OF_ARTHAS_2 = 1
};
+
enum Creatures
{
CREATURE_ARTHAS = 29280, // Image of Arthas
CREATURE_SVALA_SORROWGRAVE = 26668, // Svala after transformation
CREATURE_SVALA = 29281, // Svala before transformation
- CREATURE_RITUAL_CHANNELER = 27281
+ CREATURE_RITUAL_CHANNELER = 27281,
+ CREATURE_SPECTATOR = 26667,
+ CREATURE_RITUAL_TARGET = 27327,
+ CREATURE_FLAME_BRAZIER = 27273,
+ CREATURE_SCOURGE_HULK = 26555
};
-enum ChannelerSpells
-{
- //ritual channeler's spells
- SPELL_PARALYZE = 48278,
- SPELL_SHADOWS_IN_THE_DARK = 59407
-};
-enum Misc
+
+enum Objects
{
- DATA_SVALA_DISPLAY_ID = 25944
+ OBJECT_UTGARDE_MIRROR = 191745
};
-enum IntroPhase
+
+enum SvalaPhase
{
IDLE,
INTRO,
- FINISHED
+ NORMAL,
+ SACRIFICING,
+ SVALADEAD
};
-enum CombatPhase
+
+enum SvalaPoint
{
- NORMAL,
- SACRIFICING
+ POINT_FALL_GROUND = 1,
};
-static Position RitualChannelerPos[]=
+#define DATA_INCREDIBLE_HULK 2043
+
+static const float spectatorWP[2][3] =
{
- {296.42f, -355.01f, 90.94f, 0.0f},
- {302.36f, -352.01f, 90.54f, 0.0f},
- {291.39f, -350.89f, 90.54f, 0.0f}
+ {296.95f,-312.76f,86.36f},
+ {297.69f,-275.81f,86.36f}
};
+
static Position ArthasPos = { 295.81f, -366.16f, 92.57f, 1.58f };
-static Position SvalaPos = { 296.632f, -346.075f, 90.6307f, 1.58f };
class boss_svala : public CreatureScript
{
@@ -96,31 +121,96 @@ public:
struct boss_svalaAI : public ScriptedAI
{
- boss_svalaAI(Creature* c) : ScriptedAI(c)
+ boss_svalaAI(Creature* creature) : ScriptedAI(creature), summons(creature)
{
- instance = c->GetInstanceScript();
+ instance = creature->GetInstanceScript();
+ Phase = IDLE;
+
+ me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_RITUAL_STRIKE_EFF_1, true);
+ me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_RITUAL_STRIKE_EFF_2, true);
}
- uint32 uiIntroTimer;
+ InstanceScript* instance;
+ SummonList summons;
+ SvalaPhase Phase;
+
+ Position pos;
+ float x, y, z;
- uint8 uiIntroPhase;
+ uint32 introTimer;
+ uint8 introPhase;
+ uint8 sacrePhase;
- IntroPhase Phase;
+ TempSummon* arthas;
+ uint64 arthasGUID;
- TempSummon* pArthas;
- uint64 uiArthasGUID;
+ uint32 sinsterStrikeTimer;
+ uint32 callFlamesTimer;
+ uint32 sacrificeTimer;
- InstanceScript* instance;
+ bool sacrificed;
void Reset()
{
- Phase = IDLE;
- uiIntroTimer = 1 * IN_MILLISECONDS;
- uiIntroPhase = 0;
- uiArthasGUID = 0;
+ sacrificed = false;
+ SetCombatMovement(true);
+
+ summons.DespawnAll();
+ me->RemoveAllAuras();
+
+ if (Phase > INTRO)
+ {
+ me->SetFlying(true);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ }
+
+ if (Phase > NORMAL)
+ Phase = NORMAL;
+
+ introTimer = 1 * IN_MILLISECONDS;
+ introPhase = 0;
+ arthasGUID = 0;
if (instance)
+ {
instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, NOT_STARTED);
+ instance->SetData64(DATA_SACRIFICED_PLAYER, 0);
+ }
+ }
+
+ void JustReachedHome()
+ {
+ if (Phase > INTRO)
+ {
+ me->SetFlying(false);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->SetOrientation(1.58f);
+ me->SendMovementFlagUpdate();
+ }
+ }
+
+ void EnterCombat(Unit* /*who*/)
+ {
+ Talk(SAY_AGGRO);
+
+ sinsterStrikeTimer = 7 * IN_MILLISECONDS;
+ callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
+
+ if (instance)
+ instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, IN_PROGRESS);
+ }
+
+ void JustSummoned(Creature* summon)
+ {
+ if (summon->GetEntry() == CREATURE_RITUAL_CHANNELER)
+ summon->CastSpell(summon, SPELL_SUMMONED_VIS, true);
+
+ summons.Summon(summon);
+ }
+
+ void SummonedCreatureDespawn(Creature* summon)
+ {
+ summons.Despawn(summon);
}
void MoveInLineOfSight(Unit* who)
@@ -132,287 +222,492 @@ public:
{
Phase = INTRO;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ if (GameObject* mirror = GetClosestGameObjectWithEntry(me, OBJECT_UTGARDE_MIRROR, 100.0f))
+ mirror->SetGoState(GO_STATE_READY);
- if (Creature* pArthas = me->SummonCreature(CREATURE_ARTHAS, ArthasPos, TEMPSUMMON_MANUAL_DESPAWN))
+ if (Creature* arthas = me->SummonCreature(CREATURE_ARTHAS, ArthasPos, TEMPSUMMON_MANUAL_DESPAWN))
{
- pArthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
- uiArthasGUID = pArthas->GetGUID();
+ arthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ arthasGUID = arthas->GetGUID();
}
}
}
+
+ void KilledUnit(Unit* victim)
+ {
+ if (victim != me)
+ Talk(SAY_SLAY);
+ }
+
+ void DamageTaken(Unit* attacker, uint32 &damage)
+ {
+ if (Phase == SVALADEAD)
+ {
+ if (attacker != me)
+ damage = 0;
+ return;
+ }
- void AttackStart(Unit* /*who*/) {}
+ if (damage >= me->GetHealth())
+ {
+ if (Phase == SACRIFICING)
+ SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
+
+ damage = 0;
+ Phase = SVALADEAD;
+ me->InterruptNonMeleeSpells(true);
+ me->RemoveAllAuras();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetHealth(1);
+
+ SetCombatMovement(false);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH);
+ me->GetMotionMaster()->MoveFall(POINT_FALL_GROUND);
+ }
+ }
+
+ void MovementInform(uint32 motionType, uint32 pointId)
+ {
+ if (motionType != EFFECT_MOTION_TYPE)
+ return;
+
+ if (pointId == POINT_FALL_GROUND)
+ me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+
+ void JustDied(Unit* /*killer*/)
+ {
+ summons.DespawnAll();
+
+ if (instance)
+ instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, DONE);
+
+ Talk(SAY_DEATH);
+ }
+
+ void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell)
+ {
+ if (spell->Id == SPELL_RITUAL_STRIKE_EFF_1 && Phase != NORMAL && Phase != SVALADEAD)
+ {
+ Phase = NORMAL;
+ SetCombatMovement(true);
+
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 300.0f, true))
+ me->GetMotionMaster()->MoveChase(target);
+ }
+ }
void UpdateAI(const uint32 diff)
{
- if (Phase != INTRO)
+ if (Phase == IDLE)
return;
- if (uiIntroTimer <= diff)
+ if (Phase == INTRO)
{
- Creature* pArthas = Unit::GetCreature(*me, uiArthasGUID);
- if (!pArthas)
+ if (introTimer <= diff)
+ {
+ Creature* arthas = Unit::GetCreature(*me, arthasGUID);
+ if (!arthas)
+ return;
+
+ switch (introPhase)
+ {
+ case 0:
+ Talk(SAY_SVALA_INTRO_0);
+ ++introPhase;
+ introTimer = 8100;
+ break;
+ case 1:
+ arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_1);
+ ++introPhase;
+ introTimer = 10000;
+ break;
+ case 2:
+ arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, false);
+ me->SetFlying(true);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ pos.Relocate(me);
+ pos.m_positionZ += 8.0f;
+ me->GetMotionMaster()->MoveTakeoff(0, pos, 3.30078125f);
+ // spectators flee event
+ if (instance)
+ {
+ std::list<Creature*> lspectatorList;
+ GetCreatureListWithEntryInGrid(lspectatorList, me, CREATURE_SPECTATOR, 100.0f);
+ for (std::list<Creature*>::iterator itr = lspectatorList.begin(); itr != lspectatorList.end(); ++itr)
+ {
+ if ((*itr)->isAlive())
+ {
+ (*itr)->SetStandState(UNIT_STAND_STATE_STAND);
+ (*itr)->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ (*itr)->GetMotionMaster()->MovePoint(1, spectatorWP[0][0], spectatorWP[0][1], spectatorWP[0][2]);
+ }
+ }
+ }
+ ++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);
+ arthas->InterruptNonMeleeSpells(true);
+ me->RemoveAllAuras();
+ me->UpdateEntry(CREATURE_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:
+ arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_2);
+ ++introPhase;
+ introTimer = 7200;
+ break;
+ case 7:
+ Talk(SAY_SVALA_INTRO_2);
+ me->SetOrientation(1.58f);
+ me->SendMovementFlagUpdate();
+ arthas->SetVisible(false);
+ ++introPhase;
+ introTimer = 13800;
+ break;
+ case 8:
+ me->SetFlying(false);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->SendMovementFlagUpdate();
+ 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, 6.247422f);
+ ++introPhase;
+ introTimer = 3000;
+ break;
+ case 9:
+ if (GameObject* mirror = GetClosestGameObjectWithEntry(me, OBJECT_UTGARDE_MIRROR, 100.0f))
+ 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)
+ {
+ //Return since we have no target
+ if (!UpdateVictim())
return;
- switch (uiIntroPhase)
+ if (me->IsWithinMeleeRange(me->getVictim()) && me->HasUnitMovementFlag(MOVEMENTFLAG_LEVITATING))
+ {
+ me->SetFlying(false);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->SendMovementFlagUpdate();
+ }
+
+ if (sinsterStrikeTimer <= diff)
+ {
+ DoCast(me->getVictim(), 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, true))
+ {
+ DoCast(target, SPELL_CALL_FLAMES);
+ callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
+ }
+ } else callFlamesTimer -= diff;
+
+ if (!sacrificed)
{
- case 0:
- DoScriptText(SAY_DIALOG_WITH_ARTHAS_1, me);
- ++uiIntroPhase;
- uiIntroTimer = 3500;
- break;
- case 1:
- DoScriptText(SAY_DIALOG_OF_ARTHAS_1, pArthas);
- ++uiIntroPhase;
- uiIntroTimer = 3500;
- break;
- case 2:
- DoScriptText(SAY_DIALOG_WITH_ARTHAS_2, me);
- ++uiIntroPhase;
- uiIntroTimer = 3500;
- break;
- case 3:
- DoScriptText(SAY_DIALOG_OF_ARTHAS_2, pArthas);
- ++uiIntroPhase;
- uiIntroTimer = 3500;
- break;
- case 4:
- DoScriptText(SAY_DIALOG_WITH_ARTHAS_3, me);
- DoCast(me, SPELL_SVALA_TRANSFORMING1);
- ++uiIntroPhase;
- uiIntroTimer = 2800;
- break;
- case 5:
- DoCast(me, SPELL_SVALA_TRANSFORMING2);
- ++uiIntroPhase;
- uiIntroTimer = 200;
- break;
- case 6:
- if (me->SummonCreature(CREATURE_SVALA_SORROWGRAVE, SvalaPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60*IN_MILLISECONDS))
+ if (HealthBelowPct(50))
+ {
+ if (Unit* sacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true))
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
- me->SetDisplayId(DATA_SVALA_DISPLAY_ID);
- pArthas->DespawnOrUnsummon();
- uiArthasGUID = 0;
- Phase = FINISHED;
+ if (instance)
+ instance->SetData64(DATA_SACRIFICED_PLAYER, sacrificeTarget->GetGUID());
+
+ Talk(SAY_SACRIFICE_PLAYER);
+
+ DoCast(sacrificeTarget, SPELL_RITUAL_PREPARATION);
+
+ SetCombatMovement(false);
+ me->SetFlying(true);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+
+ Phase = SACRIFICING;
+ sacrePhase = 0;
+ sacrificeTimer = 1 * IN_MILLISECONDS;
+
+ DoCast(me, SPELL_RITUAL_OF_THE_SWORD);
+ sacrificed = true;
}
- else
- Reset();
- break;
+ }
}
- } else uiIntroTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ else //SACRIFICING
+ {
+ if (sacrificeTimer <= diff)
+ {
+ switch (sacrePhase)
+ {
+ case 0:
+ // spawn ritual channelers
+ if (instance)
+ {
+ 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;
+ }
+ }
+ else sacrificeTimer -= diff;
+ }
}
};
};
-class mob_ritual_channeler : public CreatureScript
+class npc_ritual_channeler : public CreatureScript
{
public:
- mob_ritual_channeler() : CreatureScript("mob_ritual_channeler") { }
+ npc_ritual_channeler() : CreatureScript("npc_ritual_channeler") { }
CreatureAI* GetAI(Creature* creature) const
{
- return new mob_ritual_channelerAI(creature);
+ return new npc_ritual_channelerAI(creature);
}
- struct mob_ritual_channelerAI : public Scripted_NoMovementAI
+ struct npc_ritual_channelerAI : public Scripted_NoMovementAI
{
- mob_ritual_channelerAI(Creature* c) :Scripted_NoMovementAI(c)
+ npc_ritual_channelerAI(Creature* creature) :Scripted_NoMovementAI(creature)
{
- instance = c->GetInstanceScript();
+ instance = creature->GetInstanceScript();
}
InstanceScript* instance;
+ uint32 paralyzeTimer;
void Reset()
{
- DoCast(me, SPELL_SHADOWS_IN_THE_DARK);
- }
-
- // called by svala sorrowgrave to set guid of victim
- void DoAction(const int32 /*action*/)
- {
+ paralyzeTimer = 1600;
if (instance)
- if (Unit* victim = me->GetUnit(*me, instance->GetData64(DATA_SACRIFICED_PLAYER)))
- DoCast(victim, SPELL_PARALYZE);
+ if (IsHeroic())
+ DoCast(me, SPELL_SHADOWS_IN_THE_DARK);
}
-
- void EnterCombat(Unit* /*who*/)
+
+ void UpdateAI(const uint32 diff)
{
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ if (paralyzeTimer <= diff)
+ {
+ if (instance)
+ if (Unit* victim = me->GetUnit(*me, instance->GetData64(DATA_SACRIFICED_PLAYER)))
+ DoCast(victim, SPELL_PARALYZE, false);
+
+ paralyzeTimer = 200;
+ }
+ else
+ paralyzeTimer -= diff;
}
};
-
};
-class boss_svala_sorrowgrave : public CreatureScript
+class npc_spectator : public CreatureScript
{
public:
- boss_svala_sorrowgrave() : CreatureScript("boss_svala_sorrowgrave") { }
+ npc_spectator() : CreatureScript("npc_spectator") { }
CreatureAI* GetAI(Creature* creature) const
{
- return new boss_svala_sorrowgraveAI(creature);
+ return new npc_spectatorAI(creature);
}
- struct boss_svala_sorrowgraveAI : public ScriptedAI
+ struct npc_spectatorAI : public ScriptedAI
{
- boss_svala_sorrowgraveAI(Creature* c) : ScriptedAI(c), summons(c)
+ npc_spectatorAI(Creature* creature) : ScriptedAI(creature) { }
+
+ void Reset() { }
+
+ void MovementInform(uint32 motionType, uint32 pointId)
{
- instance = c->GetInstanceScript();
+ if (motionType == POINT_MOTION_TYPE)
+ {
+ if (pointId == 1)
+ me->GetMotionMaster()->MovePoint(2,spectatorWP[1][0],spectatorWP[1][1],spectatorWP[1][2]);
+ else if (pointId == 2)
+ me->DespawnOrUnsummon(1000);
+ }
}
+ };
+};
- uint32 uiSinsterStrikeTimer;
- uint32 uiCallFlamesTimer;
- uint32 uiRitualOfSwordTimer;
- uint32 uiSacrificeTimer;
+class checkRitualTarget
+{
+ public:
+ explicit checkRitualTarget(Unit* _caster) : caster(_caster) { }
- CombatPhase Phase;
+ bool operator() (Unit* unit)
+ {
+ if (InstanceScript* instance = caster->GetInstanceScript())
+ if (instance->GetData64(DATA_SACRIFICED_PLAYER) == unit->GetGUID())
+ return false;
- SummonList summons;
+ return true;
+ }
- bool bSacrificed;
+ private:
+ Unit* caster;
+};
- InstanceScript* instance;
+class spell_paralyze_pinnacle : public SpellScriptLoader
+{
+ public:
+ spell_paralyze_pinnacle() : SpellScriptLoader("spell_paralyze_pinnacle") { }
- void Reset()
+ class spell_paralyze_pinnacle_SpellScript : public SpellScript
{
- uiSinsterStrikeTimer = 7 * IN_MILLISECONDS;
- uiCallFlamesTimer = 10 * IN_MILLISECONDS;
- uiRitualOfSwordTimer = 20 * IN_MILLISECONDS;
- uiSacrificeTimer = 8 * IN_MILLISECONDS;
-
- bSacrificed = false;
-
- Phase = NORMAL;
-
- DoTeleportTo(296.632f, -346.075f, 90.6307f);
- me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
+ PrepareSpellScript(spell_paralyze_pinnacle_SpellScript);
- summons.DespawnAll();
+ void FilterTargets(std::list<Unit*>& unitList)
+ {
+ unitList.remove_if(checkRitualTarget(GetCaster()));
+ }
- if (instance)
+ void Register()
{
- instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, NOT_STARTED);
- instance->SetData64(DATA_SACRIFICED_PLAYER, 0);
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_paralyze_pinnacle_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
- }
+ };
- void EnterCombat(Unit* /*who*/)
+ SpellScript* GetSpellScript() const
{
- DoScriptText(SAY_AGGRO, me);
-
- if (instance)
- instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, IN_PROGRESS);
+ return new spell_paralyze_pinnacle_SpellScript();
}
+};
- void JustSummoned(Creature* summon)
- {
- summons.Summon(summon);
- }
+class npc_scourge_hulk : public CreatureScript
+{
+ public:
+ npc_scourge_hulk() : CreatureScript("npc_scourge_hulk") { }
- void SummonedCreatureDespawn(Creature* summon)
+ struct npc_scourge_hulkAI : public ScriptedAI
{
- summons.Despawn(summon);
- }
+ npc_scourge_hulkAI(Creature* creature) : ScriptedAI(creature) { }
- void UpdateAI(const uint32 diff)
- {
- if (Phase == NORMAL)
+ uint32 mightyBlow;
+ uint32 volatileInfection;
+
+ void Reset()
+ {
+ mightyBlow = urand(4000, 9000);
+ volatileInfection = urand(10000, 14000);
+ killedByRitualStrike = false;
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ return type == DATA_INCREDIBLE_HULK ? killedByRitualStrike : 0;
+ }
+
+ void DamageTaken(Unit* attacker, uint32 &damage)
+ {
+ if (damage >= me->GetHealth() && attacker->GetEntry() == CREATURE_SVALA_SORROWGRAVE)
+ killedByRitualStrike = true;
+ }
+
+ void UpdateAI(uint32 const diff)
{
- //Return since we have no target
if (!UpdateVictim())
return;
- if (uiSinsterStrikeTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SINSTER_STRIKE);
- uiSinsterStrikeTimer = urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS);
- } else uiSinsterStrikeTimer -= diff;
-
- if (uiCallFlamesTimer <= diff)
+ if (mightyBlow <= diff)
{
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- {
- DoCast(target, SPELL_CALL_FLAMES);
- uiCallFlamesTimer = urand(8 * IN_MILLISECONDS, 12 * IN_MILLISECONDS);
- }
- } else uiCallFlamesTimer -= diff;
+ if (Unit* victim = me->getVictim())
+ if (!victim->HasUnitState(UNIT_STATE_STUNNED)) // Prevent knocking back a ritual player
+ DoCast(victim, SPELL_MIGHTY_BLOW);
+ mightyBlow = urand(12000, 17000);
+ }
+ else
+ mightyBlow -= diff;
- if (!bSacrificed)
+ if (volatileInfection <= diff)
{
- if (uiRitualOfSwordTimer <= diff)
- {
- if (Unit* pSacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- {
- DoScriptText(RAND(SAY_SACRIFICE_PLAYER_1, SAY_SACRIFICE_PLAYER_2, SAY_SACRIFICE_PLAYER_3, SAY_SACRIFICE_PLAYER_4, SAY_SACRIFICE_PLAYER_5), me);
- DoCast(pSacrificeTarget, SPELL_RITUAL_OF_THE_SWORD);
- //Spell doesn't teleport
- DoTeleportPlayer(pSacrificeTarget, 296.632f, -346.075f, 90.63f, 4.6f);
- me->SetUnitMovementFlags(MOVEMENTFLAG_CAN_FLY);
- DoTeleportTo(296.632f, -346.075f, 120.85f);
- Phase = SACRIFICING;
- if (instance)
- {
- instance->SetData64(DATA_SACRIFICED_PLAYER, pSacrificeTarget->GetGUID());
-
- for (uint8 i = 0; i < 3; ++i)
- if (Creature* summon = me->SummonCreature(CREATURE_RITUAL_CHANNELER, RitualChannelerPos[i], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
- summon->AI()->DoAction(0);
- }
-
- bSacrificed = true;
- }
- } else uiRitualOfSwordTimer -= diff;
+ DoCastVictim(SPELL_VOLATILE_INFECTION);
+ volatileInfection = urand(13000, 17000);
}
+ else
+ volatileInfection -= diff;
DoMeleeAttackIfReady();
}
- else //SACRIFICING
- {
- if (uiSacrificeTimer <= diff)
- {
- Unit* pSacrificeTarget = instance ? Unit::GetUnit(*me, instance->GetData64(DATA_SACRIFICED_PLAYER)) : NULL;
- if (instance && !summons.empty() && pSacrificeTarget && pSacrificeTarget->isAlive())
- me->Kill(pSacrificeTarget, false); // durability damage?
-
- //go down
- Phase = NORMAL;
- pSacrificeTarget = NULL;
- me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- me->GetMotionMaster()->MoveChase(target);
- uiSacrificeTimer = 8 * IN_MILLISECONDS;
- }
- else uiSacrificeTimer -= diff;
- }
- }
+ private:
+ bool killedByRitualStrike;
+ };
- void KilledUnit(Unit* /*victim*/)
+ CreatureAI* GetAI(Creature* creature) const
{
- DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me);
+ return new npc_scourge_hulkAI(creature);
}
+};
- void JustDied(Unit* killer)
- {
- if (instance)
- {
- Creature* pSvala = Unit::GetCreature((*me), instance->GetData64(DATA_SVALA));
- if (pSvala && pSvala->isAlive())
- killer->Kill(pSvala);
+class achievement_incredible_hulk : public AchievementCriteriaScript
+{
+ public:
+ achievement_incredible_hulk() : AchievementCriteriaScript("achievement_incredible_hulk") { }
- instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, DONE);
- }
- DoScriptText(SAY_DEATH, me);
+ bool OnCheck(Player* /*player*/, Unit* target)
+ {
+ return target && target->IsAIEnabled && target->GetAI()->GetData(DATA_INCREDIBLE_HULK);
}
- };
-
};
void AddSC_boss_svala()
{
new boss_svala();
- new mob_ritual_channeler();
- new boss_svala_sorrowgrave();
+ new npc_ritual_channeler();
+ new npc_spectator();
+ new spell_paralyze_pinnacle();
+ new npc_scourge_hulk();
+ new achievement_incredible_hulk();
}
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
index 911be1815b3..29d6278124f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_pinnacle.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp
index 5dbd431fe21..cb596f284c5 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,8 +170,12 @@ public:
void SetData64(uint32 type, uint64 data)
{
- if (type == DATA_SACRIFICED_PLAYER)
- uiSacrificedPlayer = data;
+ switch (type)
+ {
+ case DATA_SACRIFICED_PLAYER:
+ uiSacrificedPlayer = data;
+ break;
+ }
}
uint32 GetData(uint32 type)
@@ -201,6 +205,7 @@ public:
case DATA_MOB_ORB: return uiPalehoofOrb;
case DATA_SVALA: return uiSvala;
case DATA_GORTOK_PALEHOOF_SPHERE: return uiGortokPalehoofSphere;
+ case DATA_SACRIFICED_PLAYER: return uiSacrificedPlayer;
}
return 0;
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h
index 76dfd0ebec4..872314ee25e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -53,7 +53,7 @@ enum eCreatures
MOB_MASSIVE_JORMUNGAR = 26685,
MOB_FEROCIOUS_RHINO = 26686,
MOB_SVALA = 29281,
- MOB_PALEHOOF_ORB = 26688,
+ MOB_PALEHOOF_ORB = 26688
};
#endif
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp
index 66487c6f6f9..bffc6af2a3a 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,7 +81,7 @@ class boss_archavon : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -161,7 +161,7 @@ class mob_archavon_warder : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp
index bb9302c911d..2f4079d4e3c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -120,7 +120,7 @@ class boss_emalon : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -221,7 +221,7 @@ class mob_tempest_minion : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if (Aura const* overchargedAura = me->GetAura(SPELL_OVERCHARGED))
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp
index 3c752ae6ae0..dd9db1c0a99 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,7 +79,7 @@ class boss_koralon : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp
index 41e80b1b777..162f59fa5b7 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,7 +80,7 @@ class boss_toravon : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
@@ -148,7 +148,7 @@ class mob_frost_warder : public CreatureScript
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if (events.ExecuteEvent() == EVENT_FROST_BLAST)
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 8d668011f9a..ec0de41ed6d 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 04f50d3adeb..9242a5df1eb 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 25233eb92ef..74fc2505969 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
index 584e5b8979a..63f0cd39893 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -97,7 +97,7 @@ public:
void AttackStart(Unit* who)
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (me->Attack(who, true))
@@ -109,13 +109,13 @@ public:
if (Creature* pGuard1 = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_EREKEM_GUARD_1) : 0))
{
- pGuard1->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
+ pGuard1->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE);
if (!pGuard1->getVictim() && pGuard1->AI())
pGuard1->AI()->AttackStart(who);
}
if (Creature* pGuard2 = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_EREKEM_GUARD_2) : 0))
{
- pGuard2->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
+ pGuard2->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE);
if (!pGuard2->getVictim() && pGuard2->AI())
pGuard2->AI()->AttackStart(who);
}
@@ -290,7 +290,7 @@ public:
void AttackStart(Unit* who)
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (me->Attack(who, true))
diff --git a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp
index 622fc2355fa..a191d9349f2 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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 @@ public:
void AttackStart(Unit* who)
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (me->Attack(who, true))
diff --git a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp
index 648c4a71762..c5b2cb3c327 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,7 +87,7 @@ public:
void AttackStart(Unit* who)
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (me->Attack(who, true))
diff --git a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp
index 42ce12ec903..84b04579681 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,7 +80,7 @@ public:
void AttackStart(Unit* who)
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (me->Attack(who, true))
diff --git a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp
index d61b81e6ba7..ac165ac39ef 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -123,7 +123,7 @@ public:
void AttackStart(Unit* who)
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (me->Attack(who, true))
diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp
index d0f29422912..ff2009c2a17 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -91,7 +91,7 @@ public:
void AttackStart(Unit* who)
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
if (me->Attack(who, true))
diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
index 4df44f1c851..5980c534595 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -249,7 +249,7 @@ public:
if (uiCountErekemGuards < 2)
{
uiErekemGuard[uiCountErekemGuards++] = creature->GetGUID();
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
+ creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE);
}
break;
case CREATURE_MORAGG:
@@ -257,7 +257,7 @@ public:
break;
case CREATURE_CYANIGOSA:
uiCyanigosa = creature->GetGUID();
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
+ creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE);
break;
case CREATURE_SINCLARI:
uiSinclari = creature->GetGUID();
@@ -499,18 +499,18 @@ public:
if (Creature* pGuard1 = instance->GetCreature(uiErekemGuard[0]))
{
if (bForceRespawn)
- pGuard1->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
+ pGuard1->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE);
else
- pGuard1->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
+ pGuard1->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE);
pGuard1->GetMotionMaster()->MovePoint(0, BossStartMove21);
}
if (Creature* pGuard2 = instance->GetCreature(uiErekemGuard[1]))
{
if (bForceRespawn)
- pGuard2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
+ pGuard2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE);
else
- pGuard2->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
+ pGuard2->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE);
pGuard2->GetMotionMaster()->MovePoint(0, BossStartMove22);
}
break;
@@ -543,7 +543,7 @@ public:
// generic boss state changes
if (pBoss)
{
- pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
+ pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE);
pBoss->SetReactState(REACT_AGGRESSIVE);
if (!bForceRespawn)
@@ -554,7 +554,7 @@ public:
pBoss->Respawn();
pBoss->RemoveLootMode(1);
}
- pBoss->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
+ pBoss->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE);
uiWaveCount = 0;
}
}
@@ -750,7 +750,7 @@ public:
case 3:
pCyanigosa->RemoveAurasDueToSpell(CYANIGOSA_BLUE_AURA);
pCyanigosa->CastSpell(pCyanigosa, CYANIGOSA_SPELL_TRANSFORM, 0);
- pCyanigosa->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
+ pCyanigosa->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE);
pCyanigosa->SetReactState(REACT_AGGRESSIVE);
uiCyanigosaEventTimer = 2*IN_MILLISECONDS;
++uiCyanigosaEventPhase;
diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp
index 801ab408685..8b77cb250da 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -443,7 +443,7 @@ public:
if (instance && !uiBoss)
uiBoss = instance->GetData(DATA_WAVE_COUNT) == 6 ? instance->GetData(DATA_FIRST_BOSS) : instance->GetData(DATA_SECOND_BOSS);
me->SetReactState(REACT_PASSIVE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.h b/src/server/scripts/Northrend/VioletHold/violet_hold.h
index ff663efe275..2a0032bac95 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp
index 96f1cb49b84..11fb0933b9b 100644
--- a/src/server/scripts/Northrend/borean_tundra.cpp
+++ b/src/server/scripts/Northrend/borean_tundra.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -1328,7 +1328,7 @@ public:
if (uiType != POINT_MOTION_TYPE)
return;
- me->AddUnitState(UNIT_STAT_STUNNED);
+ me->AddUnitState(UNIT_STATE_STUNNED);
me->CastSpell(me, SPELL_STUN, true);
if (me->isSummon())
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
@@ -1445,7 +1445,7 @@ public:
DoScriptText(SAY_LERYSSA_1, pLeryssa);
pArlos->Kill(pArlos, false);
pLeryssa->RemoveAura(SPELL_STUN);
- pLeryssa->ClearUnitState(UNIT_STAT_STUNNED);
+ pLeryssa->ClearUnitState(UNIT_STATE_STUNNED);
pLeryssa->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
pLeryssa->GetMotionMaster()->MovePoint(0, 3722.114502f, 3564.201660f, 477.441437f);
@@ -1495,7 +1495,7 @@ public:
if (Creature* pTalbot = me->FindNearestCreature(NPC_PRINCE_VALANAR, 50.0f, true))
CAST_AI(npc_counselor_talbot::npc_counselor_talbotAI, pTalbot->GetAI())->bCheck = true;
- me->AddUnitState(UNIT_STAT_STUNNED);
+ me->AddUnitState(UNIT_STATE_STUNNED);
me->CastSpell(me, SPELL_STUN, true);
if (me->isSummon())
diff --git a/src/server/scripts/Northrend/crystalsong_forest.cpp b/src/server/scripts/Northrend/crystalsong_forest.cpp
index 22b72586e37..d48903696ec 100644
--- a/src/server/scripts/Northrend/crystalsong_forest.cpp
+++ b/src/server/scripts/Northrend/crystalsong_forest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/dalaran.cpp b/src/server/scripts/Northrend/dalaran.cpp
index 8ff5a314dcc..cd3cbf29d0d 100644
--- a/src/server/scripts/Northrend/dalaran.cpp
+++ b/src/server/scripts/Northrend/dalaran.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,12 @@ Script Data End */
enum Spells
{
SPELL_TRESPASSER_A = 54028,
- SPELL_TRESPASSER_H = 54029
+ SPELL_TRESPASSER_H = 54029,
+
+ SPELL_SUNREAVER_DISGUISE_FEMALE = 70973,
+ SPELL_SUNREAVER_DISGUISE_MALE = 70974,
+ SPELL_SILVER_COVENANT_DISGUISE_FEMALE = 70971,
+ SPELL_SILVER_COVENANT_DISGUISE_MALE = 70972,
};
enum NPCs // All outdoor guards are within 35.0f of these NPCs
@@ -71,8 +76,10 @@ public:
Player* player = who->GetCharmerOrOwnerPlayerOrPlayerItself();
- // If player has Disguise aura for quest A Meeting With The Magister or An Audience With The Arcanist, do not teleport it away but let it pass
- if (!player || player->isGameMaster() || player->IsBeingTeleported() || player->HasAura(70973) || player->HasAura(70971))
+ if (!player || player->isGameMaster() || player->IsBeingTeleported() ||
+ // If player has Disguise aura for quest A Meeting With The Magister or An Audience With The Arcanist, do not teleport it away but let it pass
+ player->HasAura(SPELL_SUNREAVER_DISGUISE_FEMALE) || player->HasAura(SPELL_SUNREAVER_DISGUISE_MALE) ||
+ player->HasAura(SPELL_SILVER_COVENANT_DISGUISE_FEMALE) || player->HasAura(SPELL_SILVER_COVENANT_DISGUISE_MALE))
return;
switch (me->GetEntry())
diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/dragonblight.cpp
index 7606ecd81c1..0c1837ec37d 100644
--- a/src/server/scripts/Northrend/dragonblight.cpp
+++ b/src/server/scripts/Northrend/dragonblight.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/grizzly_hills.cpp b/src/server/scripts/Northrend/grizzly_hills.cpp
index 6ed452857aa..ccb31c869a4 100644
--- a/src/server/scripts/Northrend/grizzly_hills.cpp
+++ b/src/server/scripts/Northrend/grizzly_hills.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,115 +16,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Grizzly_Hills
-SD%Complete: 80
-SDComment: Quest support: 12231, 12247
-SDCategory: Grizzly Hills
-EndScriptData */
-
-/* ContentData
-npc_orsonn_and_kodian
-EndContentData */
-
#include "ScriptPCH.h"
#include "ScriptedEscortAI.h"
-#define GOSSIP_ITEM1 "You're free to go Orsonn, but first tell me what's wrong with the furbolg."
-#define GOSSIP_ITEM2 "What happened then?"
-#define GOSSIP_ITEM3 "Thank you, Son of Ursoc. I'll see what can be done."
-#define GOSSIP_ITEM4 "Who was this stranger?"
-#define GOSSIP_ITEM5 "Thank you, Kodian. I'll do what I can."
-
-enum eEnums
-{
- GOSSIP_TEXTID_ORSONN1 = 12793,
- GOSSIP_TEXTID_ORSONN2 = 12794,
- GOSSIP_TEXTID_ORSONN3 = 12796,
-
- GOSSIP_TEXTID_KODIAN1 = 12797,
- GOSSIP_TEXTID_KODIAN2 = 12798,
-
- NPC_ORSONN = 27274,
- NPC_KODIAN = 27275,
-
- //trigger creatures
- NPC_ORSONN_CREDIT = 27322,
- NPC_KODIAN_CREDIT = 27321,
-
- QUEST_CHILDREN_OF_URSOC = 12247,
- QUEST_THE_BEAR_GODS_OFFSPRING = 12231
-};
-
-class npc_orsonn_and_kodian : public CreatureScript
-{
-public:
- npc_orsonn_and_kodian() : CreatureScript("npc_orsonn_and_kodian") { }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(QUEST_CHILDREN_OF_URSOC) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_THE_BEAR_GODS_OFFSPRING) == QUEST_STATUS_INCOMPLETE)
- {
- switch (creature->GetEntry())
- {
- case NPC_ORSONN:
- if (!player->GetReqKillOrCastCurrentCount(QUEST_CHILDREN_OF_URSOC, NPC_ORSONN_CREDIT) || !player->GetReqKillOrCastCurrentCount(QUEST_THE_BEAR_GODS_OFFSPRING, NPC_ORSONN_CREDIT))
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ORSONN1, creature->GetGUID());
- return true;
- }
- break;
- case NPC_KODIAN:
- if (!player->GetReqKillOrCastCurrentCount(QUEST_CHILDREN_OF_URSOC, NPC_KODIAN_CREDIT) || !player->GetReqKillOrCastCurrentCount(QUEST_THE_BEAR_GODS_OFFSPRING, NPC_KODIAN_CREDIT))
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_KODIAN1, creature->GetGUID());
- return true;
- }
- break;
- }
- }
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (uiAction)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ORSONN2, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ORSONN3, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->CLOSE_GOSSIP_MENU();
- player->TalkedToCreature(NPC_ORSONN_CREDIT, creature->GetGUID());
- break;
-
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_KODIAN2, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->CLOSE_GOSSIP_MENU();
- player->TalkedToCreature(NPC_KODIAN_CREDIT, creature->GetGUID());
- break;
- }
-
- return true;
- }
-};
-
/*######
## Quest 12027: Mr. Floppy's Perilous Adventure
######*/
@@ -476,7 +370,7 @@ public:
if (me->FindNearestGameObject(OBJECT_HAUNCH, 2.0f))
{
me->SetStandState(UNIT_STAND_STATE_DEAD);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
}
m_uiPhase = 0;
@@ -521,7 +415,7 @@ public:
// call this each update tick?
if (me->FindNearestCreature(TALLHORN_STAG, 0.2f))
{
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USESTANDING);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING);
}
else
if (m_uiPhase)
@@ -730,7 +624,7 @@ public:
uiPlayerGUID = 0;
uiTimer = 0;
uiChopTimer = urand(10000, 12500);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE);
}
@@ -789,7 +683,7 @@ public:
{
if (pCaster && pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_SMOKE_BOMB)
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_PASSIVE);
me->CombatStop(false);
uiPlayerGUID = pCaster->GetGUID();
@@ -801,7 +695,6 @@ public:
void AddSC_grizzly_hills()
{
- new npc_orsonn_and_kodian;
new npc_emily;
new npc_mrfloppy;
new npc_outhouse_bunny;
diff --git a/src/server/scripts/Northrend/howling_fjord.cpp b/src/server/scripts/Northrend/howling_fjord.cpp
index f76ac69ab7a..3c44fa0eb44 100644
--- a/src/server/scripts/Northrend/howling_fjord.cpp
+++ b/src/server/scripts/Northrend/howling_fjord.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/icecrown.cpp b/src/server/scripts/Northrend/icecrown.cpp
index 27054b5755a..8da992af8fb 100644
--- a/src/server/scripts/Northrend/icecrown.cpp
+++ b/src/server/scripts/Northrend/icecrown.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,38 +115,6 @@ public:
};
/*######
-## npc_dame_evniki_kapsalis
-######*/
-
-enum eDameEnvikiKapsalis
-{
- TITLE_CRUSADER = 123
-};
-
-class npc_dame_evniki_kapsalis : public CreatureScript
-{
-public:
- npc_dame_evniki_kapsalis() : CreatureScript("npc_dame_evniki_kapsalis") { }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->HasTitle(TITLE_CRUSADER))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
- {
- player->PlayerTalkClass->ClearMenus();
- if (uiAction == GOSSIP_ACTION_TRADE)
- player->GetSession()->SendListInventory(creature->GetGUID());
- return true;
- }
-};
-
-/*######
## npc_squire_david
######*/
@@ -276,65 +244,6 @@ public:
};
/*######
-## npc_alorah_and_grimmin
-######*/
-
-enum ealorah_and_grimmin
-{
- SPELL_CHAIN = 68341,
- NPC_FJOLA_LIGHTBANE = 36065,
- NPC_EYDIS_DARKBANE = 36066,
- NPC_PRIESTESS_ALORAH = 36101,
- NPC_PRIEST_GRIMMIN = 36102
-};
-
-class npc_alorah_and_grimmin : public CreatureScript
-{
-public:
- npc_alorah_and_grimmin() : CreatureScript("npc_alorah_and_grimmin") { }
-
- struct npc_alorah_and_grimminAI : public ScriptedAI
- {
- npc_alorah_and_grimminAI(Creature* creature) : ScriptedAI(creature) {}
-
- bool uiCast;
-
- void Reset()
- {
- uiCast = false;
- }
-
- void UpdateAI(const uint32 /*uiDiff*/)
- {
- if (uiCast)
- return;
- uiCast = true;
- Creature* target = NULL;
-
- switch (me->GetEntry())
- {
- case NPC_PRIESTESS_ALORAH:
- target = me->FindNearestCreature(NPC_EYDIS_DARKBANE, 10.0f);
- break;
- case NPC_PRIEST_GRIMMIN:
- target = me->FindNearestCreature(NPC_FJOLA_LIGHTBANE, 10.0f);
- break;
- }
- if (target)
- DoCast(target, SPELL_CHAIN);
-
- if (!UpdateVictim())
- return;
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_alorah_and_grimminAI(creature);
- }
-};
-
-/*######
## npc_guardian_pavilion
######*/
@@ -426,13 +335,168 @@ public:
}
};
+/*######
+* npc_tournament_training_dummy
+######*/
+enum TournamentDummy
+{
+ NPC_CHARGE_TARGET = 33272,
+ NPC_MELEE_TARGET = 33229,
+ NPC_RANGED_TARGET = 33243,
+
+ SPELL_CHARGE_CREDIT = 62658,
+ SPELL_MELEE_CREDIT = 62672,
+ SPELL_RANGED_CREDIT = 62673,
+
+ SPELL_PLAYER_THRUST = 62544,
+ SPELL_PLAYER_BREAK_SHIELD = 62626,
+ SPELL_PLAYER_CHARGE = 62874,
+
+ SPELL_RANGED_DEFEND = 62719,
+ SPELL_CHARGE_DEFEND = 64100,
+ SPELL_VULNERABLE = 62665,
+
+ SPELL_COUNTERATTACK = 62709,
+
+ EVENT_DUMMY_RECAST_DEFEND = 1,
+ EVENT_DUMMY_RESET = 2,
+};
+
+class npc_tournament_training_dummy : public CreatureScript
+{
+ public:
+ npc_tournament_training_dummy(): CreatureScript("npc_tournament_training_dummy"){}
+
+ struct npc_tournament_training_dummyAI : Scripted_NoMovementAI
+ {
+ npc_tournament_training_dummyAI(Creature* creature) : Scripted_NoMovementAI(creature) {}
+
+ EventMap events;
+ bool isVulnerable;
+
+ void Reset()
+ {
+ me->SetControlled(true, UNIT_STATE_STUNNED);
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
+ isVulnerable = false;
+
+ // Cast Defend spells to max stack size
+ switch (me->GetEntry())
+ {
+ case NPC_CHARGE_TARGET:
+ DoCast(SPELL_CHARGE_DEFEND);
+ break;
+ case NPC_RANGED_TARGET:
+ me->CastCustomSpell(SPELL_RANGED_DEFEND, SPELLVALUE_AURA_STACK, 3, me);
+ break;
+ }
+
+ events.Reset();
+ events.ScheduleEvent(EVENT_DUMMY_RECAST_DEFEND, 5000);
+ }
+
+ void EnterEvadeMode()
+ {
+ if (!_EnterEvadeMode())
+ return;
+
+ Reset();
+ }
+
+ void DamageTaken(Unit* /*attacker*/, uint32& damage)
+ {
+ damage = 0;
+ events.RescheduleEvent(EVENT_DUMMY_RESET, 10000);
+ }
+
+ void SpellHit(Unit* caster, SpellInfo const* spell)
+ {
+ switch (me->GetEntry())
+ {
+ case NPC_CHARGE_TARGET:
+ if (spell->Id == SPELL_PLAYER_CHARGE)
+ if (isVulnerable)
+ DoCast(caster, SPELL_CHARGE_CREDIT, true);
+ break;
+ case NPC_MELEE_TARGET:
+ if (spell->Id == SPELL_PLAYER_THRUST)
+ {
+ DoCast(caster, SPELL_MELEE_CREDIT, true);
+
+ if (Unit* target = caster->GetVehicleBase())
+ DoCast(target, SPELL_COUNTERATTACK, true);
+ }
+ break;
+ case NPC_RANGED_TARGET:
+ if (spell->Id == SPELL_PLAYER_BREAK_SHIELD)
+ if (isVulnerable)
+ DoCast(caster, SPELL_RANGED_CREDIT, true);
+ break;
+ }
+
+ if (spell->Id == SPELL_PLAYER_BREAK_SHIELD)
+ if (!me->HasAura(SPELL_CHARGE_DEFEND) && !me->HasAura(SPELL_RANGED_DEFEND))
+ isVulnerable = true;
+ }
+
+ void UpdateAI(uint32 const diff)
+ {
+ events.Update(diff);
+
+ switch (events.ExecuteEvent())
+ {
+ case EVENT_DUMMY_RECAST_DEFEND:
+ switch (me->GetEntry())
+ {
+ case NPC_CHARGE_TARGET:
+ {
+ if (!me->HasAura(SPELL_CHARGE_DEFEND))
+ DoCast(SPELL_CHARGE_DEFEND);
+ break;
+ }
+ case NPC_RANGED_TARGET:
+ {
+ Aura* defend = me->GetAura(SPELL_RANGED_DEFEND);
+ if (!defend || defend->GetStackAmount() < 3 || defend->GetDuration() <= 8000)
+ DoCast(SPELL_RANGED_DEFEND);
+ break;
+ }
+ }
+ isVulnerable = false;
+ events.ScheduleEvent(EVENT_DUMMY_RECAST_DEFEND, 5000);
+ break;
+ case EVENT_DUMMY_RESET:
+ if (UpdateVictim())
+ {
+ EnterEvadeMode();
+ events.ScheduleEvent(EVENT_DUMMY_RESET, 10000);
+ }
+ break;
+ }
+
+ if (!UpdateVictim())
+ return;
+
+ if (!me->HasUnitState(UNIT_STATE_STUNNED))
+ me->SetControlled(true, UNIT_STATE_STUNNED);
+ }
+
+ void MoveInLineOfSight(Unit* /*who*/){}
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_tournament_training_dummyAI(creature);
+ }
+
+};
+
void AddSC_icecrown()
{
new npc_arete;
- new npc_dame_evniki_kapsalis;
new npc_squire_david;
new npc_argent_valiant;
- new npc_alorah_and_grimmin;
new npc_guardian_pavilion;
new npc_vereth_the_cunning;
+ new npc_tournament_training_dummy;
}
diff --git a/src/server/scripts/Northrend/isle_of_conquest.cpp b/src/server/scripts/Northrend/isle_of_conquest.cpp
index 269ff05090e..6d76e348980 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp
index 6f9481ec226..40e1051f218 100644
--- a/src/server/scripts/Northrend/sholazar_basin.cpp
+++ b/src/server/scripts/Northrend/sholazar_basin.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -665,6 +665,86 @@ public:
}
};
+/*######
+## Quest The Lifewarden's Wrath
+######*/
+
+enum MiscLifewarden
+{
+ NPC_PRESENCE = 28563, // Freya's Presence
+ NPC_SABOTEUR = 28538, // Cultist Saboteur
+ NPC_SERVANT = 28320, // Servant of Freya
+
+ WHISPER_ACTIVATE = 0,
+
+ SPELL_FREYA_DUMMY = 51318,
+ SPELL_LIFEFORCE = 51395,
+ SPELL_FREYA_DUMMY_TRIGGER = 51335,
+ SPELL_LASHER_EMERGE = 48195,
+ SPELL_WILD_GROWTH = 52948,
+};
+
+class spell_q12620_the_lifewarden_wrath : public SpellScriptLoader
+{
+public:
+ spell_q12620_the_lifewarden_wrath() : SpellScriptLoader("spell_q12620_the_lifewarden_wrath") { }
+
+ class spell_q12620_the_lifewarden_wrath_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q12620_the_lifewarden_wrath_SpellScript);
+
+ void HandleSendEvent(SpellEffIndex effIndex)
+ {
+ PreventHitDefaultEffect(effIndex);
+
+ if (Unit* caster = GetCaster())
+ {
+ if (Creature* presence = caster->FindNearestCreature(NPC_PRESENCE, 50.0f))
+ {
+ presence->AI()->Talk(WHISPER_ACTIVATE, caster->GetGUID());
+ presence->CastSpell(presence, SPELL_FREYA_DUMMY, true); // will target plants
+ // Freya Dummy could be scripted with the following code
+
+ // Revive plants
+ std::list<Creature*> servants;
+ GetCaster()->GetCreatureListWithEntryInGrid(servants, NPC_SERVANT, 200.0f);
+ for (std::list<Creature*>::iterator itr = servants.begin(); itr != servants.end(); ++itr)
+ {
+ // Couldn't find a spell that does this
+ if ((*itr)->isDead())
+ (*itr)->Respawn(true);
+
+ (*itr)->CastSpell(*itr, SPELL_FREYA_DUMMY_TRIGGER, true);
+ (*itr)->CastSpell(*itr, SPELL_LASHER_EMERGE, false);
+ (*itr)->CastSpell(*itr, SPELL_WILD_GROWTH, false);
+
+ if (Unit* target = (*itr)->SelectNearestTarget(150.0f))
+ (*itr)->AI()->AttackStart(target);
+ }
+
+ // Kill nearby enemies
+ std::list<Creature*> saboteurs;
+ caster->GetCreatureListWithEntryInGrid(saboteurs, NPC_SABOTEUR, 200.0f);
+ for (std::list<Creature*>::iterator itr = saboteurs.begin(); itr != saboteurs.end(); ++itr)
+ if ((*itr)->isAlive())
+ // Lifeforce has a cast duration, it should be cast at all saboteurs one by one
+ presence->CastSpell((*itr), SPELL_LIFEFORCE, false);
+ }
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHit += SpellEffectFn(spell_q12620_the_lifewarden_wrath_SpellScript::HandleSendEvent, EFFECT_0, SPELL_EFFECT_SEND_EVENT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_q12620_the_lifewarden_wrath_SpellScript();
+ }
+};
+
void AddSC_sholazar_basin()
{
new npc_injured_rainspeaker_oracle();
@@ -674,4 +754,5 @@ void AddSC_sholazar_basin()
new npc_engineer_helice();
new npc_adventurous_dwarf();
new npc_jungle_punch_target();
+ new spell_q12620_the_lifewarden_wrath();
}
diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp
index 687f7945e4c..7bd59b92b7f 100644
--- a/src/server/scripts/Northrend/storm_peaks.cpp
+++ b/src/server/scripts/Northrend/storm_peaks.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp
index aa3b696f5fd..0af82345dce 100644
--- a/src/server/scripts/Northrend/zuldrak.cpp
+++ b/src/server/scripts/Northrend/zuldrak.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -586,7 +586,7 @@ public:
{
npc_orinoko_tuskbreakerAI(Creature* creature) : ScriptedAI(creature)
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_PASSIVE);
}
@@ -622,7 +622,7 @@ public:
if (uiType != POINT_MOTION_TYPE)
return;
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE);
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
uiBattleShoutTimer = 7000;
@@ -734,7 +734,7 @@ public:
void Reset()
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_PASSIVE);
uiChargeTimer = 15000;
uiUppercutTimer = 12000;
@@ -747,7 +747,7 @@ public:
{
case 6:
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE);
break;
}
@@ -914,7 +914,7 @@ public:
{
npc_stinkbeardAI(Creature* creature) : npc_escortAI(creature)
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_PASSIVE);
Start(true, true, 0, NULL);
SetDespawnAtEnd(false);
@@ -940,7 +940,7 @@ public:
switch (uiI)
{
case 7:
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE);
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
break;
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
index b78811ce6a0..6eb306b52af 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 01da001a990..e019ba7ed7b 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 a868e46b890..06c1813d1dc 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 9f494b748be..59bce7be298 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 9b0a4a469ae..f912f25d87f 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 3a322bbaba0..ace68034dfc 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 bcdcc69181a..a69dd3ed874 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 fe696dea7e4..c4975d142f0 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 56895951665..ec0c10f4afe 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 642f45090a9..dfab6d12cb8 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 7d15f1edc40..5b3468de203 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 048ba04dc57..2a11139a701 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 71de7177e2b..ef160a3a5c5 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp
index ab1057f042a..d359917ab28 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,7 +82,7 @@ public:
summoned->CastSpell(summoned, SPELL_FOCUS_FIRE_VISUAL, false);
summoned->setFaction(me->getFaction());
summoned->SetLevel(me->getLevel());
- summoned->AddUnitState(UNIT_STAT_ROOT);
+ summoned->AddUnitState(UNIT_STATE_ROOT);
if (Unit* pFocusedTarget = Unit::GetUnit(*me, FocusedTargetGUID))
summoned->AI()->AttackStart(pFocusedTarget);
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 8a7eefbf633..aa63f1adf18 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -187,7 +187,7 @@ public:
//expire movement, will prevent from running right back to victim after cast
//(but should MoveChase be used again at a certain time or should he not move?)
- if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
me->GetMotionMaster()->MovementExpired();
DoCast(me, SPELL_BLINK);
diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp
index ca8557b22af..d9ba99fcf24 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/SethekkHalls/boss_darkweaver_syth.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp
index e744cd0f8fb..2fd7498ea82 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/SethekkHalls/boss_tailonking_ikiss.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp
index ffe3e6081e7..c3c53416a9b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/SethekkHalls/instance_sethekk_halls.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
index eaa64cd9e16..02c5a035375 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/SethekkHalls/sethekk_halls.h b/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h
index 1972809ee15..706862ac301 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_ambassador_hellmaw.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp
index 7ffc203f694..d3ea73c5ba0 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 dd5df358d53..f7032d78bb6 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 8cf8d61b845..81a7750d512 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 ebb279f74ac..5fd908c44e8 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 4c6aaadfec6..1a9155dacb2 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/shadow_labyrinth.h b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h
index 0f746555c98..0dfe9d01de5 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp
index 5e126d4c6f7..a934d5587c2 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackTemple/black_temple.h b/src/server/scripts/Outland/BlackTemple/black_temple.h
index c1aa8fa1b83..813070d837c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp
index 8f37778b948..3227e685fc4 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
index c28fe68d9e0..58f0e10c950 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -1865,7 +1865,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::Reset()
TransformCount = 0;
me->SetDisplayId(21135);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
@@ -1982,7 +1982,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::HandleTalkSequence()
Akama->GetMotionMaster()->Clear(false);
// Akama->GetMotionMaster()->MoveIdle();
Akama->SetPosition(x, y, z, 0.0f);
- Akama->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_NONE, 0); // Illidan must not die until Akama arrives.
+ Akama->MonsterMoveWithSpeed(x, y, z, 0); // Illidan must not die until Akama arrives.
Akama->GetMotionMaster()->MoveChase(me);
}
diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
index 645a9fe7978..3c7f0d3b89c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
index 8b39fe8a8f7..b0c29afda34 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
index 58585d0028e..5ca3189ebca 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp
index 6941a175698..5a02ffc891f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
index d6510db0cbb..15c7cdb187d 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
index 6bf26e795ca..47f82447a80 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp
index 6fe24378f79..b0c6dcdda41 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
index 3663372d751..d4184a0b145 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/CMakeLists.txt b/src/server/scripts/Outland/CMakeLists.txt
index ffd9332c8aa..229f7de72ec 100644
--- a/src/server/scripts/Outland/CMakeLists.txt
+++ b/src/server/scripts/Outland/CMakeLists.txt
@@ -45,6 +45,7 @@ set(scripts_STAT_SRCS
Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp
Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp
Outland/shattrath_city.cpp
+ Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp
Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp
Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
Outland/TempestKeep/Mechanar/mechanar.h
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 3f6afc9c76e..9edc7179d5e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp
index a5e0f60fb6c..6f020c16402 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
index fcb4b58a1ad..33ce04e45e3 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
index a29fafe4edb..5111a8eaa8e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
index f8ed96632df..0ed9d8e7833 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -136,7 +136,7 @@ public:
DoCast(me, SPELL_SUBMERGE);//submerge anim
me->SetVisible(false);//we start invis under water, submerged
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
}
void JustDied(Unit* /*Killer*/)
@@ -205,7 +205,7 @@ public:
{
WaitTimer = 3000;
CanStartEvent = true;//fresh fished from pool
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
else
@@ -325,7 +325,7 @@ public:
Submerged = false;
me->InterruptNonMeleeSpells(false);//shouldn't be any
me->RemoveAllAuras();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->RemoveFlag(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED);
DoCast(me, SPELL_EMERGE, true);
Spawned = false;
@@ -344,7 +344,7 @@ public:
if (!Spawned)
{
- me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
//spawn adds
for (uint8 i = 0; i < 9; ++i)
{
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 745aa162139..eeef50e3f9c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/instance_serpent_shrine.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
index 7a8973c4f0a..6c4019c7989 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 dd7405c7b26..786db3cb86b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 4ca3ef7891d..c3203621dbb 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_mekgineer_steamrigger.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp
index 5be2c99f362..ce73e467c0c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_warlord_kalithresh.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
index 36161d05473..bfbeff81d3e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/instance_steam_vault.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp
index 9719a1e19db..51032fd70ed 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/steam_vault.h b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h
index 9eccbb60c68..b2b25d960ed 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/underbog/boss_hungarfen.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp
index e570537c71c..aebd71bbd47 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/underbog/boss_the_black_stalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp
index c00a365057a..fb3be660b5e 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
index 5265dff16e2..b7604c41794 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -151,7 +151,7 @@ public:
m_bPerformingGroundSlam = false;
//and correct movement, if not already
- if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
+ if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE)
{
if (me->getVictim())
me->GetMotionMaster()->MoveChase(me->getVictim());
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 b941e3bc581..4636334e668 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 fd78dd945a8..163ab97ed5f 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
index 1666e9adb9c..bd4f91e8e39 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BloodFurnace/blood_furnace.h b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
index 892b74ff341..e34e86c16a7 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
index 75de303a3d8..7fa417cacb2 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
index 4bc273ece8f..b847500fc36 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BloodFurnace/boss_the_maker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp
index 49054f51241..f056ccd40ee 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/BloodFurnace/instance_blood_furnace.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
index 7754cb1339d..d9f6b7e303e 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_omor_the_unscarred.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp
index 0a60a1584dc..a6adb6b952e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp
index 1fd1094494d..ecea5e6abb4 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -337,7 +337,7 @@ class boss_vazruden_the_herald : public CreatureScript
VazrudenGUID = 0;
}
summoned = false;
- me->ClearUnitState(UNIT_STAT_ROOT);
+ me->ClearUnitState(UNIT_STATE_ROOT);
me->SetVisible(true);
}
}
@@ -352,7 +352,7 @@ class boss_vazruden_the_herald : public CreatureScript
NazanGUID = Nazan->GetGUID();
summoned = true;
me->SetVisible(false);
- me->AddUnitState(UNIT_STAT_ROOT);
+ me->AddUnitState(UNIT_STATE_ROOT);
}
}
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 f01f01b5bf8..b2f8af2c80d 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 e34e466368d..571071c724a 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 b25b3806823..3dab24eab1b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 755106f7092..c355079e0e8 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -252,8 +252,8 @@ class boss_magtheridon : public CreatureScript
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- me->AddUnitState(UNIT_STAT_STUNNED);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->AddUnitState(UNIT_STATE_STUNNED);
DoCast(me, SPELL_SHADOW_CAGE_C, true);
}
@@ -334,7 +334,7 @@ class boss_magtheridon : public CreatureScript
void AttackStart(Unit* who)
{
- if (!me->HasUnitState(UNIT_STAT_STUNNED))
+ if (!me->HasUnitState(UNIT_STATE_STUNNED))
ScriptedAI::AttackStart(who);
}
@@ -388,7 +388,7 @@ class boss_magtheridon : public CreatureScript
if (BlastNova_Timer <= diff)
{
// to avoid earthquake interruption
- if (!me->HasUnitState(UNIT_STAT_STUNNED))
+ if (!me->HasUnitState(UNIT_STATE_STUNNED))
{
DoScriptText(EMOTE_BLASTNOVA, me);
DoCast(me, SPELL_BLASTNOVA);
@@ -431,7 +431,7 @@ class boss_magtheridon : public CreatureScript
if (!Phase3 && HealthBelowPct(30)
&& !me->IsNonMeleeSpellCasted(false) // blast nova
- && !me->HasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake
+ && !me->HasUnitState(UNIT_STATE_STUNNED)) // shadow cage and earthquake
{
Phase3 = true;
DoScriptText(SAY_CHAMBER_DESTROY, me);
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 7461bb5ceee..caaedc4c51b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -223,7 +223,7 @@ class instance_magtheridons_lair : public InstanceMapScript
Creature* Magtheridon = instance->GetCreature(MagtheridonGUID);
if (Magtheridon && Magtheridon->isAlive())
{
- Magtheridon->ClearUnitState(UNIT_STAT_STUNNED);
+ Magtheridon->ClearUnitState(UNIT_STATE_STUNNED);
Magtheridon->AI()->AttackStart(Magtheridon->SelectNearestTarget(999));
}
CageTimer = 0;
diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h
index f98eb09d86e..6a232264ba2 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 4c051f46945..970c089918e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_warbringer_omrogg.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp
index 3f542ce76e4..5e8ed53fa4b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
index 5965c352975..3f07552441b 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/instance_shattered_halls.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
index e8f7844bfc5..cc36bf9a385 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 ad3ec3b3171..60140704012 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 dcbc2832f27..fcfe6c0ea16 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
index 6fac13aa8ad..218c5a122f1 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
index d987601c5bd..904b2851816 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,7 +397,7 @@ class boss_kaelthas : public CreatureScript
void MoveInLineOfSight(Unit* who)
{
- if (!me->HasUnitState(UNIT_STAT_STUNNED) && me->canCreatureAttack(who))
+ if (!me->HasUnitState(UNIT_STATE_STUNNED) && me->canCreatureAttack(who))
{
if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
@@ -820,7 +820,7 @@ class boss_kaelthas : public CreatureScript
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->SetPosition(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
- me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0);
+ me->MonsterMoveWithSpeed(afGravityPos[0], afGravityPos[1], afGravityPos[2], 1);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_FULLPOWER);
@@ -887,7 +887,7 @@ class boss_kaelthas : public CreatureScript
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->SetPosition(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
- me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, MOVEMENTFLAG_NONE, 0);
+ me->MonsterMoveWithSpeed(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
// 1) Kael'thas will portal the whole raid right into his body
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
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 e2a2176de5f..576d0a8bbf2 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/instance_the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp
index f5a7bad0d8e..1ec4a6e55ec 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 71a38340a3d..421f9f2f545 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 7aac0bc0b45..9a2bd3425b6 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 2f14edef145..4d579ac8c16 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_ironhand.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp
index cae13adfef7..b8b0ffd4d2e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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
new file mode 100644
index 00000000000..ed818fb13be
--- /dev/null
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program 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/>.
+ */
+
+//! TODO - Boss not scripted, just ported required spellscript from core
+
+#include "ScriptMgr.h"
+#include "SpellScript.h"
+
+enum Spells
+{
+ SPELL_POSITIVE_CHARGE = 39090,
+ SPELL_POSITIVE_CHARGE_STACK = 39089,
+ SPELL_NEGATIVE_CHARGE = 39093,
+ SPELL_NEGATIVE_CHARGE_STACK = 39092
+};
+
+class spell_capacitus_polarity_shift : public SpellScriptLoader
+{
+ public:
+ spell_capacitus_polarity_shift() : SpellScriptLoader("spell_capacitus_polarity_shift") { }
+
+ class spell_capacitus_polarity_shift_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_capacitus_polarity_shift_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_CHARGE))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_CHARGE_STACK))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_CHARGE))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_CHARGE_STACK))
+ return false;
+ return true;
+ }
+
+ void HandleTargets(std::list<Unit*>& targetList)
+ {
+ uint8 count = 0;
+ for (std::list<Unit*>::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit)
+ if ((*ihit)->GetGUID() != GetCaster()->GetGUID())
+ if (Player* target = (*ihit)->ToPlayer())
+ if (target->HasAura(GetTriggeringSpell()->Id))
+ ++count;
+
+ if (count)
+ {
+ uint32 spellId = 0;
+
+ if (GetSpellInfo()->Id == SPELL_POSITIVE_CHARGE)
+ spellId = SPELL_POSITIVE_CHARGE_STACK;
+ else // if (GetSpellInfo()->Id == SPELL_NEGATIVE_CHARGE)
+ spellId = SPELL_NEGATIVE_CHARGE_STACK;
+
+ GetCaster()->SetAuraStack(spellId, GetCaster(), count);
+ }
+ }
+
+ void HandleDamage(SpellEffIndex /*effIndex*/)
+ {
+ if (!GetTriggeringSpell())
+ return;
+
+ Unit* target = GetHitUnit();
+
+ if (target->HasAura(GetTriggeringSpell()->Id))
+ SetHitDamage(0);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_shift_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_capacitus_polarity_shift_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_capacitus_polarity_shift_SpellScript();
+ }
+};
+
+void AddSC_boss_mechano_lord_capacitus()
+{
+ new spell_capacitus_polarity_shift();
+}
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 c5408b4bbf5..7e435187be9 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_pathaleon_the_calculator.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp
index 30a6bdbc0dd..cdc3b799b2c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 ef48ebbcf11..9db2b660d2a 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 d2fbfc326f4..1ad436892bb 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
index d811390e3d0..db95f60f556 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -38,19 +38,18 @@ EndContentData */
enum eMillhouseSays
{
- SAY_INTRO_1 = -1552010,
- SAY_INTRO_2 = -1552011,
- SAY_WATER = -1552012,
- SAY_BUFFS = -1552013,
- SAY_DRINK = -1552014,
- SAY_READY = -1552015,
- SAY_KILL_1 = -1552016,
- SAY_KILL_2 = -1552017,
- SAY_PYRO = -1552018,
- SAY_ICEBLOCK = -1552019,
- SAY_LOWHP = -1552020,
- SAY_DEATH = -1552021,
- SAY_COMPLETE = -1552022,
+ SAY_INTRO_1 = 0,
+ SAY_INTRO_2 = 1,
+ SAY_WATER = 2,
+ SAY_BUFFS = 3,
+ SAY_DRINK = 4,
+ SAY_READY = 5,
+ SAY_KILL = 6,
+ SAY_PYRO = 7,
+ SAY_ICEBLOCK = 8,
+ SAY_LOWHP = 9,
+ SAY_DEATH = 10,
+ SAY_COMPLETE = 11,
};
enum eMillhouseSpells
@@ -107,7 +106,7 @@ class npc_millhouse_manastorm : public CreatureScript
Init = true;
if (instance->GetData(TYPE_HARBINGERSKYRISS) == DONE)
- DoScriptText(SAY_COMPLETE, me);
+ Talk(SAY_COMPLETE);
}
}
@@ -126,12 +125,12 @@ class npc_millhouse_manastorm : public CreatureScript
void KilledUnit(Unit* /*victim*/)
{
- DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2), me);
+ Talk(SAY_KILL);
}
void JustDied(Unit* /*victim*/)
{
- DoScriptText(SAY_DEATH, me);
+ Talk(SAY_DEATH);
/*for questId 10886 (heroic mode only)
if (instance && instance->GetData(TYPE_HARBINGERSKYRISS) != DONE)
@@ -149,30 +148,30 @@ class npc_millhouse_manastorm : public CreatureScript
switch (Phase)
{
case 1:
- DoScriptText(SAY_INTRO_1, me);
+ Talk(SAY_INTRO_1);
EventProgress_Timer = 18000;
break;
case 2:
- DoScriptText(SAY_INTRO_2, me);
+ Talk(SAY_INTRO_2);
EventProgress_Timer = 18000;
break;
case 3:
- DoScriptText(SAY_WATER, me);
+ Talk(SAY_WATER);
DoCast(me, SPELL_CONJURE_WATER);
EventProgress_Timer = 7000;
break;
case 4:
- DoScriptText(SAY_BUFFS, me);
+ Talk(SAY_BUFFS);
DoCast(me, SPELL_ICE_ARMOR);
EventProgress_Timer = 7000;
break;
case 5:
- DoScriptText(SAY_DRINK, me);
+ Talk(SAY_DRINK);
DoCast(me, SPELL_ARCANE_INTELLECT);
EventProgress_Timer = 7000;
break;
case 6:
- DoScriptText(SAY_READY, me);
+ Talk(SAY_READY);
EventProgress_Timer = 6000;
break;
case 7:
@@ -192,7 +191,7 @@ class npc_millhouse_manastorm : public CreatureScript
return;
if (!LowHp && HealthBelowPct(20))
{
- DoScriptText(SAY_LOWHP, me);
+ Talk(SAY_LOWHP);
LowHp = true;
}
@@ -201,7 +200,7 @@ class npc_millhouse_manastorm : public CreatureScript
if (me->IsNonMeleeSpellCasted(false))
return;
- DoScriptText(SAY_PYRO, me);
+ Talk(SAY_PYRO);
DoCast(me->getVictim(), SPELL_PYROBLAST);
Pyroblast_Timer = 40000;
@@ -232,14 +231,14 @@ class npc_millhouse_manastorm : public CreatureScript
enum eWardenSays
{
- YELL_INTRO1 = -1552023,
- YELL_INTRO2 = -1552024,
- YELL_RELEASE1 = -1552025,
- YELL_RELEASE2A = -1552026,
- YELL_RELEASE2B = -1552027,
- YELL_RELEASE3 = -1552028,
- YELL_RELEASE4 = -1552029,
- YELL_WELCOME = -1552030,
+ YELL_INTRO1 = 0,
+ YELL_INTRO2 = 1,
+ YELL_RELEASE1 = 2,
+ YELL_RELEASE2A = 3,
+ YELL_RELEASE2B = 4,
+ YELL_RELEASE3 = 5,
+ YELL_RELEASE4 = 6,
+ YELL_WELCOME = 7,
};
enum eWardenUnits
@@ -274,10 +273,10 @@ class npc_warden_mellichar : public CreatureScript
{
public:
- npc_warden_mellichar()
- : CreatureScript("npc_warden_mellichar")
+ npc_warden_mellichar() : CreatureScript("npc_warden_mellichar")
{
}
+
struct npc_warden_mellicharAI : public ScriptedAI
{
npc_warden_mellicharAI(Creature* creature) : ScriptedAI(creature)
@@ -330,7 +329,7 @@ class npc_warden_mellichar : public CreatureScript
void EnterCombat(Unit* /*who*/)
{
- DoScriptText(YELL_INTRO1, me);
+ Talk(YELL_INTRO1);
DoCast(me, SPELL_BUBBLE_VISUAL);
if (instance)
@@ -437,7 +436,7 @@ class npc_warden_mellichar : public CreatureScript
me->SummonCreature(ENTRY_MILLHOUSE, 413.292f, -148.378f, 42.56f, 6.27f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
break;
case 4:
- DoScriptText(YELL_RELEASE2B, me);
+ Talk(YELL_RELEASE2B);
break;
case 5:
switch (urand(0, 1))
@@ -463,7 +462,7 @@ class npc_warden_mellichar : public CreatureScript
break;
case 7:
me->SummonCreature(ENTRY_SKYRISS, 445.763f, -191.639f, 44.64f, 1.60f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
- DoScriptText(YELL_WELCOME, me);
+ Talk(YELL_WELCOME);
break;
}
CanSpawn = false;
@@ -474,17 +473,17 @@ class npc_warden_mellichar : public CreatureScript
switch (Phase)
{
case 1:
- DoScriptText(YELL_INTRO2, me);
+ Talk(YELL_INTRO2);
EventProgress_Timer = 10000;
++Phase;
break;
case 2:
- DoScriptText(YELL_RELEASE1, me);
+ Talk(YELL_RELEASE1);
DoPrepareForPhase();
EventProgress_Timer = 7000;
break;
case 3:
- DoScriptText(YELL_RELEASE2A, me);
+ Talk(YELL_RELEASE2A);
DoPrepareForPhase();
EventProgress_Timer = 10000;
break;
@@ -493,12 +492,12 @@ class npc_warden_mellichar : public CreatureScript
EventProgress_Timer = 15000;
break;
case 5:
- DoScriptText(YELL_RELEASE3, me);
+ Talk(YELL_RELEASE3);
DoPrepareForPhase();
EventProgress_Timer = 15000;
break;
case 6:
- DoScriptText(YELL_RELEASE4, me);
+ Talk(YELL_RELEASE4);
DoPrepareForPhase();
EventProgress_Timer = 15000;
break;
@@ -524,14 +523,16 @@ class npc_warden_mellichar : public CreatureScript
# mob_zerekethvoidzone (this script probably not needed in future -> `creature_template_addon`.`auras`='36120 0')
#####*/
-#define SPELL_VOID_ZONE_DAMAGE 36120
+enum ZerekethSpell
+{
+ SPELL_VOID_ZONE_DAMAGE = 36120,
+};
class mob_zerekethvoidzone : public CreatureScript
{
public:
- mob_zerekethvoidzone()
- : CreatureScript("mob_zerekethvoidzone")
+ mob_zerekethvoidzone() : CreatureScript("mob_zerekethvoidzone")
{
}
struct mob_zerekethvoidzoneAI : public ScriptedAI
@@ -555,10 +556,10 @@ class mob_zerekethvoidzone : public CreatureScript
return new mob_zerekethvoidzoneAI(creature);
}
};
+
void AddSC_arcatraz()
{
new npc_millhouse_manastorm();
new npc_warden_mellichar();
new mob_zerekethvoidzone();
}
-
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h
index c25ec2600c2..8b897b1b96e 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/arcatraz/boss_harbinger_skyriss.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp
index d2375f377c4..de86ec8672c 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,7 +89,7 @@ class boss_harbinger_skyriss : public CreatureScript
void Reset()
{
if (!Intro)
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
IsImage33 = false;
IsImage66 = false;
@@ -184,7 +184,7 @@ class boss_harbinger_skyriss : public CreatureScript
Intro_Timer = 3000;
break;
case 3:
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
Intro = true;
break;
}
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
index 0988f6ffeb9..6a27d295ebc 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_high_botanist_freywinn.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp
index 64fea1c41e5..ccac73c5dc6 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_laj.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp
index 43078c48537..488ddba40cf 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
index 75c80b06816..7e9960225bb 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp
index 87304a3f721..97ce9f45430 100644
--- a/src/server/scripts/Outland/blades_edge_mountains.cpp
+++ b/src/server/scripts/Outland/blades_edge_mountains.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -562,6 +562,564 @@ class go_thunderspike : public GameObjectScript
}
};
+enum SimonGame
+{
+ NPC_SIMON_BUNNY = 22923,
+ NPC_APEXIS_GUARDIAN = 22275,
+
+ GO_APEXIS_RELIC = 185890,
+ GO_APEXIS_MONUMENT = 185944,
+ GO_AURA_BLUE = 185872,
+ GO_AURA_GREEN = 185873,
+ GO_AURA_RED = 185874,
+ GO_AURA_YELLOW = 185875,
+
+ GO_BLUE_CLUSTER_DISPLAY = 7369,
+ GO_GREEN_CLUSTER_DISPLAY = 7371,
+ GO_RED_CLUSTER_DISPLAY = 7373,
+ GO_YELLOW_CLUSTER_DISPLAY = 7375,
+ GO_BLUE_CLUSTER_DISPLAY_LARGE = 7364,
+ GO_GREEN_CLUSTER_DISPLAY_LARGE = 7365,
+ GO_RED_CLUSTER_DISPLAY_LARGE = 7366,
+ GO_YELLOW_CLUSTER_DISPLAY_LARGE = 7367,
+
+ SPELL_PRE_GAME_BLUE = 40176,
+ SPELL_PRE_GAME_GREEN = 40177,
+ SPELL_PRE_GAME_RED = 40178,
+ SPELL_PRE_GAME_YELLOW = 40179,
+ SPELL_VISUAL_BLUE = 40244,
+ SPELL_VISUAL_GREEN = 40245,
+ SPELL_VISUAL_RED = 40246,
+ SPELL_VISUAL_YELLOW = 40247,
+
+ SOUND_BLUE = 11588,
+ SOUND_GREEN = 11589,
+ SOUND_RED = 11590,
+ SOUND_YELLOW = 11591,
+ SOUND_DISABLE_NODE = 11758,
+
+ SPELL_AUDIBLE_GAME_TICK = 40391,
+ SPELL_VISUAL_START_PLAYER_LEVEL = 40436,
+ SPELL_VISUAL_START_AI_LEVEL = 40387,
+
+ SPELL_BAD_PRESS_TRIGGER = 41241,
+ SPELL_BAD_PRESS_DAMAGE = 40065,
+ SPELL_REWARD_BUFF_1 = 40310,
+ SPELL_REWARD_BUFF_2 = 40311,
+ SPELL_REWARD_BUFF_3 = 40312,
+};
+
+enum SimonEvents
+{
+ EVENT_SIMON_SETUP_PRE_GAME = 1,
+ EVENT_SIMON_PLAY_SEQUENCE = 2,
+ EVENT_SIMON_RESET_CLUSTERS = 3,
+ EVENT_SIMON_PERIODIC_PLAYER_CHECK = 4,
+ EVENT_SIMON_TOO_LONG_TIME = 5,
+ EVENT_SIMON_GAME_TICK = 6,
+ EVENT_SIMON_ROUND_FINISHED = 7,
+
+ ACTION_SIMON_CORRECT_FULL_SEQUENCE = 8,
+ ACTION_SIMON_WRONG_SEQUENCE = 9,
+ ACTION_SIMON_ROUND_FINISHED = 10,
+};
+
+enum SimonColors
+{
+ SIMON_BLUE = 0,
+ SIMON_RED = 1,
+ SIMON_GREEN = 2,
+ SIMON_YELLOW = 3,
+ SIMON_MAX_COLORS = 4,
+};
+
+class npc_simon_bunny : public CreatureScript
+{
+ public:
+ npc_simon_bunny() : CreatureScript("npc_simon_bunny") { }
+
+ struct npc_simon_bunnyAI : public ScriptedAI
+ {
+ npc_simon_bunnyAI(Creature* creature) : ScriptedAI(creature) { }
+
+ bool large;
+ bool listening;
+ uint8 gameLevel;
+ uint8 fails;
+ uint8 gameTicks;
+ uint64 playerGUID;
+ uint32 clusterIds[SIMON_MAX_COLORS];
+ float zCoordCorrection;
+ float searchDistance;
+ EventMap _events;
+ std::list<uint8> colorSequence, playableSequence, playerSequence;
+
+ void UpdateAI(const uint32 diff)
+ {
+ _events.Update(diff);
+
+ switch(_events.ExecuteEvent())
+ {
+ case EVENT_SIMON_PERIODIC_PLAYER_CHECK:
+ if (!CheckPlayer())
+ ResetNode();
+ else
+ _events.ScheduleEvent(EVENT_SIMON_PERIODIC_PLAYER_CHECK, 2000);
+ break;
+ case EVENT_SIMON_SETUP_PRE_GAME:
+ SetUpPreGame();
+ _events.CancelEvent(EVENT_SIMON_GAME_TICK);
+ _events.ScheduleEvent(EVENT_SIMON_PLAY_SEQUENCE, 1000);
+ break;
+ case EVENT_SIMON_PLAY_SEQUENCE:
+ if (!playableSequence.empty())
+ {
+ PlayNextColor();
+ _events.ScheduleEvent(EVENT_SIMON_PLAY_SEQUENCE, 1500);
+ }
+ else
+ {
+ listening = true;
+ DoCast(SPELL_VISUAL_START_PLAYER_LEVEL);
+ playerSequence.clear();
+ PrepareClusters();
+ gameTicks = 0;
+ _events.ScheduleEvent(EVENT_SIMON_GAME_TICK, 3000);
+ }
+ break;
+ case EVENT_SIMON_GAME_TICK:
+ DoCast(SPELL_AUDIBLE_GAME_TICK);
+
+ if (gameTicks > gameLevel)
+ _events.ScheduleEvent(EVENT_SIMON_TOO_LONG_TIME, 500);
+ else
+ _events.ScheduleEvent(EVENT_SIMON_GAME_TICK, 3000);
+ gameTicks++;
+ break;
+ case EVENT_SIMON_RESET_CLUSTERS:
+ PrepareClusters(true);
+ break;
+ case EVENT_SIMON_TOO_LONG_TIME:
+ DoAction(ACTION_SIMON_WRONG_SEQUENCE);
+ break;
+ case EVENT_SIMON_ROUND_FINISHED:
+ DoAction(ACTION_SIMON_ROUND_FINISHED);
+ break;
+ }
+ }
+
+ void DoAction(const int32 action)
+ {
+ switch (action)
+ {
+ case ACTION_SIMON_ROUND_FINISHED:
+ listening = false;
+ DoCast(SPELL_VISUAL_START_AI_LEVEL);
+ GiveRewardForLevel(gameLevel);
+ _events.CancelEventGroup(0);
+ if (gameLevel == 10)
+ ResetNode();
+ else
+ _events.ScheduleEvent(EVENT_SIMON_SETUP_PRE_GAME, 1000);
+ break;
+ case ACTION_SIMON_CORRECT_FULL_SEQUENCE:
+ gameLevel++;
+ DoAction(ACTION_SIMON_ROUND_FINISHED);
+ break;
+ case ACTION_SIMON_WRONG_SEQUENCE:
+ GivePunishment();
+ DoAction(ACTION_SIMON_ROUND_FINISHED);
+ break;
+ }
+ }
+
+ // Called by color clusters script (go_simon_cluster) and used for knowing the button pressed by player
+ void SetData(uint32 type, uint32 /*data*/)
+ {
+ if (!listening)
+ return;
+
+ uint8 pressedColor;
+
+ if (type == clusterIds[SIMON_RED])
+ pressedColor = SIMON_RED;
+ else if (type == clusterIds[SIMON_BLUE])
+ pressedColor = SIMON_BLUE;
+ else if (type == clusterIds[SIMON_GREEN])
+ pressedColor = SIMON_GREEN;
+ else if (type == clusterIds[SIMON_YELLOW])
+ pressedColor = SIMON_YELLOW;
+
+ PlayColor(pressedColor);
+ playerSequence.push_back(pressedColor);
+ _events.ScheduleEvent(EVENT_SIMON_RESET_CLUSTERS, 500);
+ CheckPlayerSequence();
+ }
+
+ // Used for getting involved player guid. Parameter id is used for defining if is a large(Monument) or small(Relic) node
+ void SetGUID(uint64 guid, int32 id)
+ {
+ me->SetFlying(true);
+
+ large = (bool)id;
+ playerGUID = guid;
+ StartGame();
+ }
+
+ /*
+ Resets all variables and also find the ids of the four closests color clusters, since every simon
+ node have diferent ids for clusters this is absolutely NECESSARY.
+ */
+ void StartGame()
+ {
+ listening = false;
+ gameLevel = 0;
+ fails = 0;
+ gameTicks = 0;
+ zCoordCorrection = large ? 8.0f : 2.75f;
+ searchDistance = large ? 13.0f : 5.0f;
+ colorSequence.clear();
+ playableSequence.clear();
+ playerSequence.clear();
+ me->SetFloatValue(OBJECT_FIELD_SCALE_X, large ? 2 : 1);
+
+ std::list<WorldObject*> ClusterList;
+ Trinity::AllWorldObjectsInRange objects(me, searchDistance);
+ Trinity::WorldObjectListSearcher<Trinity::AllWorldObjectsInRange> searcher(me, ClusterList, objects);
+ me->VisitNearbyObject(searchDistance, searcher);
+
+ for (std::list<WorldObject*>::const_iterator i = ClusterList.begin(); i != ClusterList.end(); ++i)
+ {
+ if (GameObject* go = (*i)->ToGameObject())
+ {
+ // We are checking for displayid because all simon nodes have 4 clusters with different entries
+ if (large)
+ {
+ switch (go->GetGOInfo()->displayId)
+ {
+ case GO_BLUE_CLUSTER_DISPLAY_LARGE: clusterIds[SIMON_BLUE] = go->GetEntry(); break;
+ case GO_RED_CLUSTER_DISPLAY_LARGE: clusterIds[SIMON_RED] = go->GetEntry(); break;
+ case GO_GREEN_CLUSTER_DISPLAY_LARGE: clusterIds[SIMON_GREEN] = go->GetEntry(); break;
+ case GO_YELLOW_CLUSTER_DISPLAY_LARGE: clusterIds[SIMON_YELLOW] = go->GetEntry(); break;
+ }
+ }
+ else
+ {
+ switch (go->GetGOInfo()->displayId)
+ {
+ case GO_BLUE_CLUSTER_DISPLAY: clusterIds[SIMON_BLUE] = go->GetEntry(); break;
+ case GO_RED_CLUSTER_DISPLAY: clusterIds[SIMON_RED] = go->GetEntry(); break;
+ case GO_GREEN_CLUSTER_DISPLAY: clusterIds[SIMON_GREEN] = go->GetEntry(); break;
+ case GO_YELLOW_CLUSTER_DISPLAY: clusterIds[SIMON_YELLOW] = go->GetEntry(); break;
+ }
+ }
+ }
+ }
+
+ _events.Reset();
+ _events.ScheduleEvent(EVENT_SIMON_ROUND_FINISHED, 1000);
+ _events.ScheduleEvent(EVENT_SIMON_PERIODIC_PLAYER_CHECK, 2000);
+
+ if (GameObject* relic = me->FindNearestGameObject(large ? GO_APEXIS_MONUMENT : GO_APEXIS_RELIC, searchDistance))
+ relic->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
+ }
+
+ // Called when despawning the bunny. Sets all the node GOs to their default states.
+ void ResetNode()
+ {
+ DoPlaySoundToSet(me, SOUND_DISABLE_NODE);
+
+ for (uint32 clusterId = SIMON_BLUE; clusterId < SIMON_MAX_COLORS; clusterId++)
+ if (GameObject* cluster = me->FindNearestGameObject(clusterIds[clusterId], searchDistance))
+ cluster->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
+
+ for (uint32 auraId = GO_AURA_BLUE; auraId <= GO_AURA_YELLOW; auraId++)
+ if (GameObject* auraGo = me->FindNearestGameObject(auraId, searchDistance))
+ auraGo->RemoveFromWorld();
+
+ if (GameObject* relic = me->FindNearestGameObject(large ? GO_APEXIS_MONUMENT : GO_APEXIS_RELIC, searchDistance))
+ relic->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
+
+ me->ForcedDespawn(1000);
+ }
+
+ /*
+ Called on every button click of player. Adds the clicked color to the player created sequence and
+ checks if it corresponds to the AI created sequence. If so, incremente gameLevel and start a new
+ round, if not, give punishment and restart current level.
+ */
+ void CheckPlayerSequence()
+ {
+ bool correct = true;
+ if (playerSequence.size() <= colorSequence.size())
+ for (std::list<uint8>::const_iterator i = playerSequence.begin(), j = colorSequence.begin(); i != playerSequence.end(); ++i, ++j)
+ if ((*i) != (*j))
+ correct = false;
+
+ if (correct && (playerSequence.size() == colorSequence.size()))
+ DoAction(ACTION_SIMON_CORRECT_FULL_SEQUENCE);
+ else if (!correct)
+ DoAction(ACTION_SIMON_WRONG_SEQUENCE);
+ }
+
+ /*
+ Generates a random sequence of colors depending on the gameLevel. We also copy this sequence to
+ the playableSequence wich will be used when playing the sequence to the player.
+ */
+ void GenerateColorSequence()
+ {
+ colorSequence.clear();
+ for (uint8 i = 0; i <= gameLevel; i++)
+ colorSequence.push_back(RAND(SIMON_BLUE, SIMON_RED, SIMON_GREEN, SIMON_YELLOW));
+
+ for (std::list<uint8>::const_iterator i = colorSequence.begin(); i != colorSequence.end(); ++i)
+ playableSequence.push_back(*i);
+ }
+
+
+ // Remove any existant glowing auras over clusters and set clusters ready for interating with them.
+ void PrepareClusters(bool clustersOnly = false)
+ {
+ for (uint32 clusterId = SIMON_BLUE; clusterId < SIMON_MAX_COLORS; clusterId++)
+ if (GameObject* cluster = me->FindNearestGameObject(clusterIds[clusterId], searchDistance))
+ cluster->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
+
+ if (clustersOnly)
+ return;
+
+ for (uint32 auraId = GO_AURA_BLUE; auraId <= GO_AURA_YELLOW; auraId++)
+ if (GameObject* auraGo = me->FindNearestGameObject(auraId, searchDistance))
+ auraGo->RemoveFromWorld();
+ }
+
+ /*
+ Called when AI is playing the sequence for player. We cast the visual spell and then remove the
+ casted color from the casting sequence.
+ */
+ void PlayNextColor()
+ {
+ PlayColor(*playableSequence.begin());
+ playableSequence.erase(playableSequence.begin());
+ }
+
+ // Casts a spell and plays a sound depending on parameter color.
+ void PlayColor(uint8 color)
+ {
+ switch (color)
+ {
+ case SIMON_BLUE:
+ DoCast(SPELL_VISUAL_BLUE);
+ DoPlaySoundToSet(me, SOUND_BLUE);
+ break;
+ case SIMON_GREEN:
+ DoCast(SPELL_VISUAL_GREEN);
+ DoPlaySoundToSet(me, SOUND_GREEN);
+ break;
+ case SIMON_RED:
+ DoCast(SPELL_VISUAL_RED);
+ DoPlaySoundToSet(me, SOUND_RED);
+ break;
+ case SIMON_YELLOW:
+ DoCast(SPELL_VISUAL_YELLOW);
+ DoPlaySoundToSet(me, SOUND_YELLOW);
+ break;
+ }
+ }
+
+ /*
+ Creates the transparent glowing auras on every cluster of this node.
+ After calling this function bunny is teleported to the center of the node.
+ */
+ void SetUpPreGame()
+ {
+ for (uint32 clusterId = SIMON_BLUE; clusterId < SIMON_MAX_COLORS; clusterId++)
+ {
+ if (GameObject* cluster = me->FindNearestGameObject(clusterIds[clusterId], 2.0f*searchDistance))
+ {
+ cluster->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
+
+ // break since we don't need glowing auras for large clusters
+ if (large)
+ break;
+
+ float x, y, z, o;
+ cluster->GetPosition(x, y, z, o);
+ me->NearTeleportTo(x, y, z, o);
+
+ uint32 preGameSpellId;
+ if (cluster->GetEntry() == clusterIds[SIMON_RED])
+ preGameSpellId = SPELL_PRE_GAME_RED;
+ else if (cluster->GetEntry() == clusterIds[SIMON_BLUE])
+ preGameSpellId = SPELL_PRE_GAME_BLUE;
+ else if (cluster->GetEntry() == clusterIds[SIMON_GREEN])
+ preGameSpellId = SPELL_PRE_GAME_GREEN;
+ else if (cluster->GetEntry() == clusterIds[SIMON_YELLOW])
+ preGameSpellId = SPELL_PRE_GAME_YELLOW;
+ else break;
+
+ me->CastSpell(cluster, preGameSpellId, true);
+ }
+ }
+
+ if (GameObject* relic = me->FindNearestGameObject(large ? GO_APEXIS_MONUMENT : GO_APEXIS_RELIC, searchDistance))
+ {
+ float x, y, z, o;
+ relic->GetPosition(x, y, z, o);
+ me->NearTeleportTo(x, y, z + zCoordCorrection, o);
+ }
+
+ GenerateColorSequence();
+ }
+
+ // Handles the spell rewards. The spells also have the QuestCompleteEffect, so quests credits are working.
+ void GiveRewardForLevel(uint8 level)
+ {
+ uint32 rewSpell;
+ switch (level)
+ {
+ case 6:
+ if (large)
+ GivePunishment();
+ else
+ rewSpell = SPELL_REWARD_BUFF_1;
+ break;
+ case 8:
+ rewSpell = SPELL_REWARD_BUFF_2;
+ break;
+ case 10:
+ rewSpell = SPELL_REWARD_BUFF_3;
+ break;
+ default:
+ rewSpell = 0;
+ }
+
+ if (rewSpell)
+ if (Player* player = me->GetPlayer(*me, playerGUID))
+ DoCast(player, rewSpell, true);
+ }
+
+ /*
+ Depending on the number of failed pushes for player the damage of the spell scales, so we first
+ cast the spell on the target that hits for 50 and shows the visual and then forces the player
+ to cast the damaging spell on it self with the modified basepoints.
+ 4 fails = death.
+ On large nodes punishment and reward are the same, summoning the Apexis Guardian.
+ */
+ void GivePunishment()
+ {
+ if (large)
+ {
+ if (Player* player = me->GetPlayer(*me, playerGUID))
+ if (Creature* guardian = me->SummonCreature(NPC_APEXIS_GUARDIAN, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() - zCoordCorrection, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000))
+ guardian->AI()->AttackStart(player);
+
+ ResetNode();
+ }
+ else
+ {
+ fails++;
+
+ if (Player* player = me->GetPlayer(*me, playerGUID))
+ DoCast(player, SPELL_BAD_PRESS_TRIGGER, true);
+
+ if (fails >= 4)
+ ResetNode();
+ }
+ }
+
+ void SpellHitTarget(Unit* target, const SpellInfo* spell)
+ {
+ // Cast SPELL_BAD_PRESS_DAMAGE with scaled basepoints when the visual hits the target.
+ // Need Fix: When SPELL_BAD_PRESS_TRIGGER hits target it triggers spell SPELL_BAD_PRESS_DAMAGE by itself
+ // so player gets damage equal to calculated damage dbc basepoints for SPELL_BAD_PRESS_DAMAGE (~50)
+ if (spell->Id == SPELL_BAD_PRESS_TRIGGER)
+ {
+ int32 bp = (int32)((float)(fails)*0.33f*target->GetMaxHealth());
+ target->CastCustomSpell(target, SPELL_BAD_PRESS_DAMAGE, &bp, NULL, NULL, true);
+ }
+ }
+
+ // Checks if player has already die or has get too far from the current node
+ bool CheckPlayer()
+ {
+ if (Player* player = me->GetPlayer(*me, playerGUID))
+ {
+ if (player->isDead())
+ return false;
+ if (player->GetDistance2d(me) >= 2.0f*searchDistance)
+ {
+ GivePunishment();
+ return false;
+ }
+ }
+ else
+ return false;
+
+ return true;
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_simon_bunnyAI(creature);
+ }
+};
+
+class go_simon_cluster : public GameObjectScript
+{
+ public:
+ go_simon_cluster() : GameObjectScript("go_simon_cluster") { }
+
+ bool OnGossipHello(Player* player, GameObject* go)
+ {
+ if (Creature* bunny = go->FindNearestCreature(NPC_SIMON_BUNNY, 12.0f, true))
+ bunny->AI()->SetData(go->GetEntry(), 0);
+
+ player->CastSpell(player, go->GetGOInfo()->goober.spellId, true);
+ go->AddUse();
+ return true;
+ }
+};
+
+enum ApexisRelic
+{
+ QUEST_CRYSTALS = 11025,
+ GOSSIP_TEXT_ID = 10948,
+
+ ITEM_APEXIS_SHARD = 32569,
+ SPELL_TAKE_REAGENTS_SOLO = 41145,
+ SPELL_TAKE_REAGENTS_GROUP = 41146,
+};
+
+class go_apexis_relic : public GameObjectScript
+{
+ public:
+ go_apexis_relic() : GameObjectScript("go_apexis_relic") { }
+
+ bool OnGossipHello(Player* player, GameObject* go)
+ {
+ player->PrepareGossipMenu(go, go->GetGOInfo()->questgiver.gossipID);
+ player->SendPreparedGossip(go);
+ return true;
+ }
+
+ bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 /*action*/)
+ {
+ player->CLOSE_GOSSIP_MENU();
+
+ bool large = (go->GetEntry() == GO_APEXIS_MONUMENT);
+ if (player->HasItemCount(ITEM_APEXIS_SHARD, large ? 35 : 1))
+ {
+ player->CastSpell(player, large ? SPELL_TAKE_REAGENTS_GROUP : SPELL_TAKE_REAGENTS_SOLO, false);
+
+ if (Creature* bunny = player->SummonCreature(NPC_SIMON_BUNNY, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ()))
+ bunny->AI()->SetGUID(player->GetGUID(), large);
+ }
+
+ return true;
+ }
+};
+
void AddSC_blades_edge_mountains()
{
new mobs_bladespire_ogre();
@@ -573,4 +1131,7 @@ void AddSC_blades_edge_mountains()
new npc_bloodmaul_brutebane();
new npc_ogre_brute();
new go_thunderspike();
+ new npc_simon_bunny();
+ new go_simon_cluster();
+ new go_apexis_relic();
}
diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
index 2f725e78666..2f6e0823da1 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 @@ class boss_doomlord_kazzak : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
diff --git a/src/server/scripts/Outland/boss_doomwalker.cpp b/src/server/scripts/Outland/boss_doomwalker.cpp
index 5cb84eb1303..c4bd232cc85 100644
--- a/src/server/scripts/Outland/boss_doomwalker.cpp
+++ b/src/server/scripts/Outland/boss_doomwalker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 @@ class boss_doomwalker : public CreatureScript
_events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
diff --git a/src/server/scripts/Outland/hellfire_peninsula.cpp b/src/server/scripts/Outland/hellfire_peninsula.cpp
index e28e1c3c685..7d4de409b8b 100644
--- a/src/server/scripts/Outland/hellfire_peninsula.cpp
+++ b/src/server/scripts/Outland/hellfire_peninsula.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp
index bae3aa65b98..668db2efcbb 100644
--- a/src/server/scripts/Outland/nagrand.cpp
+++ b/src/server/scripts/Outland/nagrand.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -632,7 +632,7 @@ public:
if (!UpdateVictim())
return;
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if (ChainLightningTimer <= diff)
diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp
index e5ee8d19c59..79811069402 100644
--- a/src/server/scripts/Outland/netherstorm.cpp
+++ b/src/server/scripts/Outland/netherstorm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -796,7 +796,7 @@ public:
Materialize = true;
}
- if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->HasUnitState(UNIT_STAT_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it
+ if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->HasUnitState(UNIT_STATE_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it
DoCast(me, SPELL_PHASE_SLIP);
if (!UpdateVictim())
diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp
index ecbdb921567..19c4754c4fd 100644
--- a/src/server/scripts/Outland/shadowmoon_valley.cpp
+++ b/src/server/scripts/Outland/shadowmoon_valley.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -117,7 +117,7 @@ public:
{
bIsEating = true;
EatTimer = 7000;
- me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED);
}
}
@@ -1195,7 +1195,7 @@ public:
AggroTargetGUID = 0;
Timers = false;
- me->AddUnitState(UNIT_STAT_ROOT);
+ me->AddUnitState(UNIT_STATE_ROOT);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetTarget(0);
}
@@ -1239,7 +1239,7 @@ public:
if (Player* AggroTarget = (Unit::GetPlayer(*me, AggroTargetGUID)))
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->ClearUnitState(UNIT_STAT_ROOT);
+ me->ClearUnitState(UNIT_STATE_ROOT);
float x, y, z;
AggroTarget->GetPosition(x, y, z);
diff --git a/src/server/scripts/Outland/shattrath_city.cpp b/src/server/scripts/Outland/shattrath_city.cpp
index 6ac60e2086b..ed68f55aeb5 100644
--- a/src/server/scripts/Outland/shattrath_city.cpp
+++ b/src/server/scripts/Outland/shattrath_city.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/terokkar_forest.cpp b/src/server/scripts/Outland/terokkar_forest.cpp
index 91fae26ec74..043b74b6924 100644
--- a/src/server/scripts/Outland/terokkar_forest.cpp
+++ b/src/server/scripts/Outland/terokkar_forest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/zangarmarsh.cpp b/src/server/scripts/Outland/zangarmarsh.cpp
index 9aecbeb67be..fc7a3f4d667 100644
--- a/src/server/scripts/Outland/zangarmarsh.cpp
+++ b/src/server/scripts/Outland/zangarmarsh.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/Spells/CMakeLists.txt b/src/server/scripts/Spells/CMakeLists.txt
index 0df7cf907b6..496324e4de9 100644
--- a/src/server/scripts/Spells/CMakeLists.txt
+++ b/src/server/scripts/Spells/CMakeLists.txt
@@ -23,6 +23,7 @@ set(scripts_STAT_SRCS
Spells/spell_mage.cpp
Spells/spell_paladin.cpp
Spells/spell_item.cpp
+ Spells/spell_holiday.cpp
)
message(" -> Prepared: Spells")
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index 86b92eebfe3..f62d62c671a 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 17849027dd4..130f61565f7 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 298e9b6410e..9899e50cd28 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -342,11 +342,8 @@ class spell_gen_remove_flight_auras : public SpellScriptLoader
PrepareSpellScript(spell_gen_remove_flight_auras_SpellScript);
void HandleScript(SpellEffIndex /*effIndex*/)
{
- Unit* target = GetHitUnit();
- if (!target)
- return;
- target->RemoveAurasByType(SPELL_AURA_FLY);
- target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
+ GetHitUnit()->RemoveAurasByType(SPELL_AURA_FLY);
+ GetHitUnit()->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
}
void Register()
@@ -412,6 +409,72 @@ class spell_gen_leeching_swarm : public SpellScriptLoader
}
};
+enum EluneCandle
+{
+ NPC_OMEN = 15467,
+
+ SPELL_ELUNE_CANDLE_OMEN_HEAD = 26622,
+ SPELL_ELUNE_CANDLE_OMEN_CHEST = 26624,
+ SPELL_ELUNE_CANDLE_OMEN_HAND_R = 26625,
+ SPELL_ELUNE_CANDLE_OMEN_HAND_L = 26649,
+ SPELL_ELUNE_CANDLE_NORMAL = 26636,
+};
+
+class spell_gen_elune_candle : public SpellScriptLoader
+{
+ public:
+ spell_gen_elune_candle() : SpellScriptLoader("spell_gen_elune_candle") {}
+
+ class spell_gen_elune_candle_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_elune_candle_SpellScript);
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HEAD))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_CHEST))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_R))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_L))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_NORMAL))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ uint32 spellId = 0;
+
+ if (GetHitUnit()->GetEntry() == NPC_OMEN)
+ {
+ switch (urand(0, 3))
+ {
+ case 0: spellId = SPELL_ELUNE_CANDLE_OMEN_HEAD; break;
+ case 1: spellId = SPELL_ELUNE_CANDLE_OMEN_CHEST; break;
+ case 2: spellId = SPELL_ELUNE_CANDLE_OMEN_HAND_R; break;
+ case 3: spellId = SPELL_ELUNE_CANDLE_OMEN_HAND_L; break;
+ }
+ }
+ else
+ spellId = SPELL_ELUNE_CANDLE_NORMAL;
+
+ GetCaster()->CastSpell(GetHitUnit(), spellId, true, NULL);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_elune_candle_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_elune_candle_SpellScript();
+ }
+};
+
// 24750 Trick
enum eTrickSpells
{
@@ -878,11 +941,8 @@ class spell_generic_clone : public SpellScriptLoader
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
- Unit* caster = GetCaster();
uint32 spellId = uint32(GetSpellInfo()->Effects[effIndex].CalcValue());
-
- if (Unit* target = GetHitUnit())
- target->CastSpell(caster, spellId, true);
+ GetHitUnit()->CastSpell(GetCaster(), spellId, true);
}
void Register()
@@ -1445,7 +1505,17 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader
if (GetUnitOwner()->GetTypeId() != TYPEID_PLAYER)
return;
- LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*(sLFGMgr->GetSelectedDungeons(GetUnitOwner()->GetGUID()).begin()));
+ const LfgDungeonSet dungeons = sLFGMgr->GetSelectedDungeons(GetUnitOwner()->GetGUID());
+ LfgDungeonSet::const_iterator itr = dungeons.begin();
+
+ if (itr == dungeons.end())
+ {
+ Remove(AURA_REMOVE_BY_DEFAULT);
+ return;
+ }
+
+
+ LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*itr);
Group* group = GetUnitOwner()->ToPlayer()->GetGroup();
Map const* map = GetUnitOwner()->GetMap();
if (group && group->isLFGGroup())
@@ -1471,6 +1541,816 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader
}
};
+enum DalaranDisguiseSpells
+{
+ SPELL_SUNREAVER_DISGUISE_TRIGGER = 69672,
+ SPELL_SUNREAVER_DISGUISE_FEMALE = 70973,
+ SPELL_SUNREAVER_DISGUISE_MALE = 70974,
+
+ SPELL_SILVER_COVENANT_DISGUISE_TRIGGER = 69673,
+ SPELL_SILVER_COVENANT_DISGUISE_FEMALE = 70971,
+ SPELL_SILVER_COVENANT_DISGUISE_MALE = 70972,
+};
+
+class spell_gen_dalaran_disguise : public SpellScriptLoader
+{
+ public:
+ spell_gen_dalaran_disguise(const char* name) : SpellScriptLoader(name) {}
+
+ class spell_gen_dalaran_disguise_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_dalaran_disguise_SpellScript);
+ bool Validate(SpellInfo const* spellEntry)
+ {
+ switch (spellEntry->Id)
+ {
+ case SPELL_SUNREAVER_DISGUISE_TRIGGER:
+ if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_FEMALE))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_MALE))
+ return false;
+ break;
+ case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER:
+ if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_FEMALE))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_MALE))
+ return false;
+ break;
+ }
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Player* player = GetHitPlayer())
+ {
+ uint8 gender = player->getGender();
+
+ uint32 spellId = GetSpellInfo()->Id;
+
+ switch (spellId)
+ {
+ case SPELL_SUNREAVER_DISGUISE_TRIGGER:
+ spellId = gender ? SPELL_SUNREAVER_DISGUISE_FEMALE : SPELL_SUNREAVER_DISGUISE_MALE;
+ break;
+ case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER:
+ spellId = gender ? SPELL_SILVER_COVENANT_DISGUISE_FEMALE : SPELL_SILVER_COVENANT_DISGUISE_MALE;
+ break;
+ default:
+ break;
+ }
+
+ GetCaster()->CastSpell(player, spellId, true);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_dalaran_disguise_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_dalaran_disguise_SpellScript();
+ }
+};
+
+/* DOCUMENTATION: Break-Shield spells
+ Break-Shield spells can be classified in three groups:
+
+ - Spells on vehicle bar used by players:
+ + EFFECT_0: SCRIPT_EFFECT
+ + EFFECT_1: NONE
+ + EFFECT_2: NONE
+ - Spells casted by players triggered by script:
+ + EFFECT_0: SCHOOL_DAMAGE
+ + EFFECT_1: SCRIPT_EFFECT
+ + EFFECT_2: FORCE_CAST
+ - Spells casted 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.
+*/
+
+enum BreakShieldSpells
+{
+ SPELL_BREAK_SHIELD_DAMAGE_2K = 62626,
+ SPELL_BREAK_SHIELD_DAMAGE_10K = 64590,
+
+ SPELL_BREAK_SHIELD_TRIGGER_FACTION_MOUNTS = 62575, // Also on ToC5 mounts
+ SPELL_BREAK_SHIELD_TRIGGER_CAMPAING_WARHORSE = 64595,
+ SPELL_BREAK_SHIELD_TRIGGER_UNK = 66480,
+};
+
+class spell_gen_break_shield: public SpellScriptLoader
+{
+ public:
+ spell_gen_break_shield(const char* name) : SpellScriptLoader(name) {}
+
+ class spell_gen_break_shield_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_break_shield_SpellScript)
+
+ void HandleScriptEffect(SpellEffIndex effIndex)
+ {
+ Unit* target = GetHitUnit();
+
+ switch (effIndex)
+ {
+ case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual)
+ {
+ uint32 spellId;
+
+ switch (GetSpellInfo()->Id)
+ {
+ case SPELL_BREAK_SHIELD_TRIGGER_UNK:
+ case SPELL_BREAK_SHIELD_TRIGGER_CAMPAING_WARHORSE:
+ spellId = SPELL_BREAK_SHIELD_DAMAGE_10K;
+ break;
+ case SPELL_BREAK_SHIELD_TRIGGER_FACTION_MOUNTS:
+ spellId = SPELL_BREAK_SHIELD_DAMAGE_2K;
+ break;
+ default:
+ return;
+ }
+
+ if (Unit* rider = GetCaster()->GetCharmer())
+ rider->CastSpell(target, spellId, false);
+ else
+ GetCaster()->CastSpell(target, spellId, false);
+ break;
+ }
+ case EFFECT_1: // On damaging spells, for removing a defend layer
+ {
+ Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
+ for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
+ {
+ Aura* aura = itr->second->GetBase();
+ SpellInfo const* auraInfo = aura->GetSpellInfo();
+ if (aura && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
+ {
+ aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
+ // Remove dummys from rider (Necessary for updating visual shields)
+ if (Unit* rider = target->GetCharmer())
+ if (Aura* defend = rider->GetAura(aura->GetId()))
+ defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_break_shield_SpellScript::HandleScriptEffect, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_break_shield_SpellScript();
+ }
+};
+
+/* DOCUMENTATION: Charge spells
+ Charge spells can be classified in four groups:
+
+ - Spells on vehicle bar used by players:
+ + EFFECT_0: SCRIPT_EFFECT
+ + EFFECT_1: TRIGGER_SPELL
+ + EFFECT_2: NONE
+ - Spells casted 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:
+ + EFFECT_0: SCHOOL_DAMAGE
+ + EFFECT_1: SCRIPT_EFFECT
+ + EFFECT_2: NONE
+ - Spells casted by NPCs on players:
+ + EFFECT_0: SCHOOL_DAMAGE
+ + EFFECT_1: CHARGE
+ + EFFECT_2: SCRIPT_EFFECT
+
+ 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
+ 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
+ damaging spell on target with a small chance of failing it.
+*/
+
+enum ChargeSpells
+{
+ SPELL_CHARGE_DAMAGE_8K5 = 62874,
+ SPELL_CHARGE_DAMAGE_20K = 68498,
+ SPELL_CHARGE_DAMAGE_45K = 64591,
+
+ SPELL_CHARGE_CHARGING_EFFECT_8K5 = 63661,
+ SPELL_CHARGE_CHARGING_EFFECT_20K_1 = 68284,
+ SPELL_CHARGE_CHARGING_EFFECT_20K_2 = 68501,
+ SPELL_CHARGE_CHARGING_EFFECT_45K_1 = 62563,
+ SPELL_CHARGE_CHARGING_EFFECT_45K_2 = 66481,
+
+ SPELL_CHARGE_TRIGGER_FACTION_MOUNTS = 62960,
+ SPELL_CHARGE_TRIGGER_TRIAL_CHAMPION = 68282,
+
+ SPELL_CHARGE_MISS_EFFECT = 62977,
+};
+
+class spell_gen_mounted_charge: public SpellScriptLoader
+{
+ public:
+ spell_gen_mounted_charge() : SpellScriptLoader("spell_gen_mounted_charge") { }
+
+ class spell_gen_mounted_charge_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_mounted_charge_SpellScript)
+
+ void HandleScriptEffect(SpellEffIndex effIndex)
+ {
+ Unit* target = GetHitUnit();
+
+ switch (effIndex)
+ {
+ case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual)
+ {
+ uint32 spellId;
+
+ switch (GetSpellInfo()->Id)
+ {
+ case SPELL_CHARGE_TRIGGER_TRIAL_CHAMPION:
+ spellId = SPELL_CHARGE_CHARGING_EFFECT_20K_1;
+ case SPELL_CHARGE_TRIGGER_FACTION_MOUNTS:
+ spellId = SPELL_CHARGE_CHARGING_EFFECT_8K5;
+ break;
+ default:
+ return;
+ }
+
+ // If target isn't a training dummy there's a chance of failing the charge
+ if (!target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE) && roll_chance_f(12.5f))
+ spellId = SPELL_CHARGE_MISS_EFFECT;
+
+ if (Unit* vehicle = GetCaster()->GetVehicleBase())
+ vehicle->CastSpell(target, spellId, false);
+ else
+ GetCaster()->CastSpell(target, spellId, false);
+ break;
+ }
+ case EFFECT_1: // On damaging spells, for removing a defend layer
+ case EFFECT_2:
+ {
+ Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
+ for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
+ {
+ Aura* aura = itr->second->GetBase();
+ SpellInfo const* auraInfo = aura->GetSpellInfo();
+ if (aura && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
+ {
+ aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
+ // Remove dummys from rider (Necessary for updating visual shields)
+ if (Unit* rider = target->GetCharmer())
+ if (Aura* defend = rider->GetAura(aura->GetId()))
+ defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ void HandleChargeEffect(SpellEffIndex effIndex)
+ {
+ uint32 spellId;
+
+ switch (GetSpellInfo()->Id)
+ {
+ case SPELL_CHARGE_CHARGING_EFFECT_8K5:
+ spellId = SPELL_CHARGE_DAMAGE_8K5;
+ break;
+ case SPELL_CHARGE_CHARGING_EFFECT_20K_1:
+ case SPELL_CHARGE_CHARGING_EFFECT_20K_2:
+ spellId = SPELL_CHARGE_DAMAGE_20K;
+ break;
+ case SPELL_CHARGE_CHARGING_EFFECT_45K_1:
+ case SPELL_CHARGE_CHARGING_EFFECT_45K_2:
+ spellId = SPELL_CHARGE_DAMAGE_45K;
+ break;
+ default:
+ return;
+ }
+
+ if (Unit* rider = GetCaster()->GetCharmer())
+ rider->CastSpell(GetHitUnit(), spellId, false);
+ else
+ GetCaster()->CastSpell(GetHitUnit(), spellId, false);
+ }
+
+ void Register()
+ {
+ SpellInfo const* spell = sSpellMgr->GetSpellInfo(m_scriptSpellId);
+
+ if (spell->HasEffect(SPELL_EFFECT_SCRIPT_EFFECT))
+ OnEffectHitTarget += SpellEffectFn(spell_gen_mounted_charge_SpellScript::HandleScriptEffect, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT);
+
+ if (spell->Effects[EFFECT_0].Effect == SPELL_EFFECT_CHARGE)
+ OnEffectHitTarget += SpellEffectFn(spell_gen_mounted_charge_SpellScript::HandleChargeEffect, EFFECT_0, SPELL_EFFECT_CHARGE);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_mounted_charge_SpellScript();
+ }
+};
+
+enum DefendVisuals
+{
+ SPELL_VISUAL_SHIELD_1 = 63130,
+ SPELL_VISUAL_SHIELD_2 = 63131,
+ SPELL_VISUAL_SHIELD_3 = 63132,
+};
+
+class spell_gen_defend : public SpellScriptLoader
+{
+ public:
+ spell_gen_defend() : SpellScriptLoader("spell_gen_defend") { }
+
+ class spell_gen_defendAuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_defendAuraScript);
+
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_1))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_2))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_3))
+ return false;
+ return true;
+ }
+
+ void RefreshVisualShields(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ {
+ Unit* target = GetTarget();
+
+ for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
+ target->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i);
+
+ target->CastSpell(target, SPELL_VISUAL_SHIELD_1 + GetAura()->GetStackAmount() - 1, true, NULL, aurEff);
+ }
+ else
+ GetTarget()->RemoveAurasDueToSpell(GetId());
+ }
+
+ void RemoveVisualShields(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
+ GetTarget()->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i);
+ }
+
+ void RemoveDummyFromDriver(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ if (TempSummon* vehicle = caster->ToTempSummon())
+ if (Unit* rider = vehicle->GetSummoner())
+ rider->RemoveAurasDueToSpell(GetId());
+ }
+
+ void Register()
+ {
+ SpellInfo const* spell = sSpellMgr->GetSpellInfo(m_scriptSpellId);
+
+ // Defend spells casted by NPCs (add visuals)
+ if (spell->Effects[EFFECT_0].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_gen_defendAuraScript::RefreshVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ OnEffectRemove += AuraEffectRemoveFn(spell_gen_defendAuraScript::RemoveVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ }
+
+ // Remove Defend spell from player when he dismounts
+ if (spell->Effects[EFFECT_2].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)
+ OnEffectRemove += AuraEffectRemoveFn(spell_gen_defendAuraScript::RemoveDummyFromDriver, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL);
+
+ // Defend spells casted by players (add/remove visuals)
+ if (spell->Effects[EFFECT_1].ApplyAuraName == SPELL_AURA_DUMMY)
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_gen_defendAuraScript::RefreshVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ OnEffectRemove += AuraEffectRemoveFn(spell_gen_defendAuraScript::RemoveVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ }
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_gen_defendAuraScript();
+ }
+};
+
+enum MountedDuelSpells
+{
+ SPELL_ON_TOURNAMENT_MOUNT = 63034,
+ SPELL_MOUNTED_DUEL = 62875,
+};
+
+class spell_gen_tournament_duel : public SpellScriptLoader
+{
+ public:
+ spell_gen_tournament_duel() : SpellScriptLoader("spell_gen_tournament_duel") { }
+
+ class spell_gen_tournament_duel_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_tournament_duel_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_ON_TOURNAMENT_MOUNT))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_MOUNTED_DUEL))
+ return false;
+ return true;
+ }
+
+ void HandleScriptEffect(SpellEffIndex effIndex)
+ {
+ if (Unit* rider = GetCaster()->GetCharmer())
+ {
+ if (Player* plrTarget = GetHitPlayer())
+ {
+ if (plrTarget->HasAura(SPELL_ON_TOURNAMENT_MOUNT) && plrTarget->GetVehicleBase())
+ rider->CastSpell(plrTarget, SPELL_MOUNTED_DUEL, true);
+ }
+ else if (Unit* unitTarget = GetHitUnit())
+ {
+ if (unitTarget->GetCharmer() && unitTarget->GetCharmer()->GetTypeId() == TYPEID_PLAYER && unitTarget->GetCharmer()->HasAura(SPELL_ON_TOURNAMENT_MOUNT))
+ rider->CastSpell(unitTarget->GetCharmer(), SPELL_MOUNTED_DUEL, true);
+ }
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_tournament_duel_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_tournament_duel_SpellScript();
+ }
+};
+
+enum TournamentMountsSpells
+{
+ SPELL_LANCE_EQUIPPED = 62853,
+};
+
+class spell_gen_summon_tournament_mount : public SpellScriptLoader
+{
+ public:
+ spell_gen_summon_tournament_mount() : SpellScriptLoader("spell_gen_summon_tournament_mount") { }
+
+ class spell_gen_summon_tournament_mount_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_summon_tournament_mount_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_LANCE_EQUIPPED))
+ return false;
+ return true;
+ }
+
+ SpellCastResult CheckIfLanceEquiped()
+ {
+ if (GetCaster()->IsInDisallowedMountForm())
+ GetCaster()->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
+
+ if (!GetCaster()->HasAura(SPELL_LANCE_EQUIPPED))
+ {
+ SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_LANCE_EQUIPPED);
+ return SPELL_FAILED_CUSTOM_ERROR;
+ }
+
+ return SPELL_CAST_OK;
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_gen_summon_tournament_mount_SpellScript::CheckIfLanceEquiped);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_summon_tournament_mount_SpellScript();
+ }
+};
+
+enum TournamentPennantSpells
+{
+ SPELL_PENNANT_STORMWIND_ASPIRANT = 62595,
+ SPELL_PENNANT_STORMWIND_VALIANT = 62596,
+ SPELL_PENNANT_STORMWIND_CHAMPION = 62594,
+ SPELL_PENNANT_GNOMEREGAN_ASPIRANT = 63394,
+ SPELL_PENNANT_GNOMEREGAN_VALIANT = 63395,
+ SPELL_PENNANT_GNOMEREGAN_CHAMPION = 63396,
+ SPELL_PENNANT_SEN_JIN_ASPIRANT = 63397,
+ SPELL_PENNANT_SEN_JIN_VALIANT = 63398,
+ SPELL_PENNANT_SEN_JIN_CHAMPION = 63399,
+ SPELL_PENNANT_SILVERMOON_ASPIRANT = 63401,
+ SPELL_PENNANT_SILVERMOON_VALIANT = 63402,
+ SPELL_PENNANT_SILVERMOON_CHAMPION = 63403,
+ SPELL_PENNANT_DARNASSUS_ASPIRANT = 63404,
+ SPELL_PENNANT_DARNASSUS_VALIANT = 63405,
+ SPELL_PENNANT_DARNASSUS_CHAMPION = 63406,
+ SPELL_PENNANT_EXODAR_ASPIRANT = 63421,
+ SPELL_PENNANT_EXODAR_VALIANT = 63422,
+ SPELL_PENNANT_EXODAR_CHAMPION = 63423,
+ SPELL_PENNANT_IRONFORGE_ASPIRANT = 63425,
+ SPELL_PENNANT_IRONFORGE_VALIANT = 63426,
+ SPELL_PENNANT_IRONFORGE_CHAMPION = 63427,
+ SPELL_PENNANT_UNDERCITY_ASPIRANT = 63428,
+ SPELL_PENNANT_UNDERCITY_VALIANT = 63429,
+ SPELL_PENNANT_UNDERCITY_CHAMPION = 63430,
+ SPELL_PENNANT_ORGRIMMAR_ASPIRANT = 63431,
+ SPELL_PENNANT_ORGRIMMAR_VALIANT = 63432,
+ SPELL_PENNANT_ORGRIMMAR_CHAMPION = 63433,
+ SPELL_PENNANT_THUNDER_BLUFF_ASPIRANT = 63434,
+ SPELL_PENNANT_THUNDER_BLUFF_VALIANT = 63435,
+ SPELL_PENNANT_THUNDER_BLUFF_CHAMPION = 63436,
+ SPELL_PENNANT_ARGENT_CRUSADE_ASPIRANT = 63606,
+ SPELL_PENNANT_ARGENT_CRUSADE_VALIANT = 63500,
+ SPELL_PENNANT_ARGENT_CRUSADE_CHAMPION = 63501,
+ SPELL_PENNANT_EBON_BLADE_ASPIRANT = 63607,
+ SPELL_PENNANT_EBON_BLADE_VALIANT = 63608,
+ SPELL_PENNANT_EBON_BLADE_CHAMPION = 63609,
+};
+
+enum TournamentMounts
+{
+ NPC_STORMWIND_STEED = 33217,
+ NPC_IRONFORGE_RAM = 33316,
+ NPC_GNOMEREGAN_MECHANOSTRIDER = 33317,
+ NPC_EXODAR_ELEKK = 33318,
+ NPC_DARNASSIAN_NIGHTSABER = 33319,
+ NPC_ORGRIMMAR_WOLF = 33320,
+ NPC_DARK_SPEAR_RAPTOR = 33321,
+ NPC_THUNDER_BLUFF_KODO = 33322,
+ NPC_SILVERMOON_HAWKSTRIDER = 33323,
+ NPC_FORSAKEN_WARHORSE = 33324,
+ NPC_ARGENT_WARHORSE = 33782,
+ NPC_ARGENT_STEED_ASPIRANT = 33845,
+ NPC_ARGENT_HAWKSTRIDER_ASPIRANT = 33844,
+};
+
+enum TournamentQuestsAchievements
+{
+ ACHIEVEMENT_CHAMPION_STORMWIND = 2781,
+ ACHIEVEMENT_CHAMPION_DARNASSUS = 2777,
+ ACHIEVEMENT_CHAMPION_IRONFORGE = 2780,
+ ACHIEVEMENT_CHAMPION_GNOMEREGAN = 2779,
+ ACHIEVEMENT_CHAMPION_THE_EXODAR = 2778,
+ ACHIEVEMENT_CHAMPION_ORGRIMMAR = 2783,
+ ACHIEVEMENT_CHAMPION_SEN_JIN = 2784,
+ ACHIEVEMENT_CHAMPION_THUNDER_BLUFF = 2786,
+ ACHIEVEMENT_CHAMPION_UNDERCITY = 2787,
+ ACHIEVEMENT_CHAMPION_SILVERMOON = 2785,
+ ACHIEVEMENT_ARGENT_VALOR = 2758,
+ ACHIEVEMENT_CHAMPION_ALLIANCE = 2782,
+ ACHIEVEMENT_CHAMPION_HORDE = 2788,
+
+ QUEST_VALIANT_OF_STORMWIND = 13593,
+ QUEST_A_VALIANT_OF_STORMWIND = 13684,
+ QUEST_VALIANT_OF_DARNASSUS = 13706,
+ QUEST_A_VALIANT_OF_DARNASSUS = 13689,
+ QUEST_VALIANT_OF_IRONFORGE = 13703,
+ QUEST_A_VALIANT_OF_IRONFORGE = 13685,
+ QUEST_VALIANT_OF_GNOMEREGAN = 13704,
+ QUEST_A_VALIANT_OF_GNOMEREGAN = 13688,
+ QUEST_VALIANT_OF_THE_EXODAR = 13705,
+ QUEST_A_VALIANT_OF_THE_EXODAR = 13690,
+ QUEST_VALIANT_OF_ORGRIMMAR = 13707,
+ QUEST_A_VALIANT_OF_ORGRIMMAR = 13691,
+ QUEST_VALIANT_OF_SEN_JIN = 13708,
+ QUEST_A_VALIANT_OF_SEN_JIN = 13693,
+ QUEST_VALIANT_OF_THUNDER_BLUFF = 13709,
+ QUEST_A_VALIANT_OF_THUNDER_BLUFF = 13694,
+ QUEST_VALIANT_OF_UNDERCITY = 13710,
+ QUEST_A_VALIANT_OF_UNDERCITY = 13695,
+ QUEST_VALIANT_OF_SILVERMOON = 13711,
+ QUEST_A_VALIANT_OF_SILVERMOON = 13696,
+};
+
+class spell_gen_on_tournament_mount : public SpellScriptLoader
+{
+ public:
+ spell_gen_on_tournament_mount() : SpellScriptLoader("spell_gen_on_tournament_mount") { }
+
+ class spell_gen_on_tournament_mountAuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_on_tournament_mountAuraScript);
+
+ uint32 _pennantSpellId;
+
+ bool Load()
+ {
+ _pennantSpellId = 0;
+ return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ {
+ if (Unit* vehicle = caster->GetVehicleBase())
+ {
+ _pennantSpellId = GetPennatSpellId(caster->ToPlayer(), vehicle);
+ caster->CastSpell(caster, _pennantSpellId, true);
+ }
+ }
+ }
+
+ void HandleRemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ caster->RemoveAurasDueToSpell(_pennantSpellId);
+ }
+
+ uint32 GetPennatSpellId(Player* player, Unit* mount)
+ {
+ switch (mount->GetEntry())
+ {
+ case NPC_ARGENT_STEED_ASPIRANT:
+ case NPC_STORMWIND_STEED:
+ {
+ if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_STORMWIND))
+ return SPELL_PENNANT_STORMWIND_CHAMPION;
+ else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_STORMWIND) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_STORMWIND))
+ return SPELL_PENNANT_STORMWIND_VALIANT;
+ else
+ return SPELL_PENNANT_STORMWIND_ASPIRANT;
+ }
+ case NPC_GNOMEREGAN_MECHANOSTRIDER:
+ {
+ if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_GNOMEREGAN))
+ return SPELL_PENNANT_GNOMEREGAN_CHAMPION;
+ else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_GNOMEREGAN) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_GNOMEREGAN))
+ return SPELL_PENNANT_GNOMEREGAN_VALIANT;
+ else
+ return SPELL_PENNANT_GNOMEREGAN_ASPIRANT;
+ }
+ case NPC_DARK_SPEAR_RAPTOR:
+ {
+ if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_SEN_JIN))
+ return SPELL_PENNANT_SEN_JIN_CHAMPION;
+ else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_SEN_JIN) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_SEN_JIN))
+ return SPELL_PENNANT_SEN_JIN_VALIANT;
+ else
+ return SPELL_PENNANT_SEN_JIN_ASPIRANT;
+ }
+ case NPC_ARGENT_HAWKSTRIDER_ASPIRANT:
+ case NPC_SILVERMOON_HAWKSTRIDER:
+ {
+ if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_SILVERMOON))
+ return SPELL_PENNANT_SILVERMOON_CHAMPION;
+ else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_SILVERMOON) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_SILVERMOON))
+ return SPELL_PENNANT_SILVERMOON_VALIANT;
+ else
+ return SPELL_PENNANT_SILVERMOON_ASPIRANT;
+ }
+ case NPC_DARNASSIAN_NIGHTSABER:
+ {
+ if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_DARNASSUS))
+ return SPELL_PENNANT_DARNASSUS_CHAMPION;
+ else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_DARNASSUS) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_DARNASSUS))
+ return SPELL_PENNANT_DARNASSUS_VALIANT;
+ else
+ return SPELL_PENNANT_DARNASSUS_ASPIRANT;
+ }
+ case NPC_EXODAR_ELEKK:
+ {
+ if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_THE_EXODAR))
+ return SPELL_PENNANT_EXODAR_CHAMPION;
+ else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_THE_EXODAR) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_THE_EXODAR))
+ return SPELL_PENNANT_EXODAR_VALIANT;
+ else
+ return SPELL_PENNANT_EXODAR_ASPIRANT;
+ }
+ case NPC_IRONFORGE_RAM:
+ {
+ if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_IRONFORGE))
+ return SPELL_PENNANT_IRONFORGE_CHAMPION;
+ else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_IRONFORGE) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_IRONFORGE))
+ return SPELL_PENNANT_IRONFORGE_VALIANT;
+ else
+ return SPELL_PENNANT_IRONFORGE_ASPIRANT;
+ }
+ case NPC_FORSAKEN_WARHORSE:
+ {
+ if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_UNDERCITY))
+ return SPELL_PENNANT_UNDERCITY_CHAMPION;
+ else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_UNDERCITY) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_UNDERCITY))
+ return SPELL_PENNANT_UNDERCITY_VALIANT;
+ else
+ return SPELL_PENNANT_UNDERCITY_ASPIRANT;
+ }
+ case NPC_ORGRIMMAR_WOLF:
+ {
+ if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_ORGRIMMAR))
+ return SPELL_PENNANT_ORGRIMMAR_CHAMPION;
+ else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_ORGRIMMAR) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_ORGRIMMAR))
+ return SPELL_PENNANT_ORGRIMMAR_VALIANT;
+ else
+ return SPELL_PENNANT_ORGRIMMAR_ASPIRANT;
+ }
+ case NPC_THUNDER_BLUFF_KODO:
+ {
+ if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_THUNDER_BLUFF))
+ return SPELL_PENNANT_THUNDER_BLUFF_CHAMPION;
+ else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_THUNDER_BLUFF) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_THUNDER_BLUFF))
+ return SPELL_PENNANT_THUNDER_BLUFF_VALIANT;
+ else
+ return SPELL_PENNANT_THUNDER_BLUFF_ASPIRANT;
+ }
+ case NPC_ARGENT_WARHORSE:
+ {
+ if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_ALLIANCE) || player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_HORDE))
+ return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_CHAMPION : SPELL_PENNANT_ARGENT_CRUSADE_CHAMPION;
+ else if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_ARGENT_VALOR))
+ return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_VALIANT : SPELL_PENNANT_ARGENT_CRUSADE_VALIANT;
+ else
+ return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_ASPIRANT : SPELL_PENNANT_ARGENT_CRUSADE_ASPIRANT;
+ }
+ default:
+ return 0;
+ }
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_gen_on_tournament_mountAuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ OnEffectRemove += AuraEffectRemoveFn(spell_gen_on_tournament_mountAuraScript::HandleRemoveEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_gen_on_tournament_mountAuraScript();
+ }
+};
+
+class spell_gen_tournament_pennant : public SpellScriptLoader
+{
+ public:
+ spell_gen_tournament_pennant() : SpellScriptLoader("spell_gen_tournament_pennant") { }
+
+ class spell_gen_tournament_pennantAuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_tournament_pennantAuraScript);
+
+ bool Load()
+ {
+ return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ if (!caster->GetVehicleBase())
+ caster->RemoveAurasDueToSpell(GetId());
+ }
+
+ void Register()
+ {
+ OnEffectApply += AuraEffectApplyFn(spell_gen_tournament_pennantAuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_gen_tournament_pennantAuraScript();
+ }
+};
+
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -1504,4 +2384,15 @@ void AddSC_generic_spell_scripts()
new spell_gen_oracle_wolvar_reputation();
new spell_gen_damage_reduction_aura();
new spell_gen_luck_of_the_draw();
+ new spell_gen_dalaran_disguise("spell_gen_sunreaver_disguise");
+ new spell_gen_dalaran_disguise("spell_gen_silver_covenant_disguise");
+ new spell_gen_elune_candle();
+ new spell_gen_break_shield("spell_gen_break_shield");
+ new spell_gen_break_shield("spell_gen_tournament_counterattack");
+ new spell_gen_mounted_charge();
+ new spell_gen_defend();
+ new spell_gen_tournament_duel();
+ new spell_gen_summon_tournament_mount();
+ new spell_gen_on_tournament_mount();
+ new spell_gen_tournament_pennant();
}
diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp
new file mode 100644
index 00000000000..dabe978b58c
--- /dev/null
+++ b/src/server/scripts/Spells/spell_holiday.cpp
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program 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/>.
+ */
+
+/*
+ * Spells used in holidays/game events that do not fit any other category.
+ * Scriptnames in this file should be prefixed with "spell_#holidayname_".
+ */
+
+#include "ScriptPCH.h"
+
+// 45102 Romantic Picnic
+enum SpellsPicnic
+{
+ SPELL_BASKET_CHECK = 45119, // Holiday - Valentine - Romantic Picnic Near Basket Check
+ SPELL_MEAL_PERIODIC = 45103, // Holiday - Valentine - Romantic Picnic Meal Periodic - effect dummy
+ SPELL_MEAL_EAT_VISUAL = 45120, // Holiday - Valentine - Romantic Picnic Meal Eat Visual
+ //SPELL_MEAL_PARTICLE = 45114, // Holiday - Valentine - Romantic Picnic Meal Particle - unused
+ SPELL_DRINK_VISUAL = 45121, // Holiday - Valentine - Romantic Picnic Drink Visual
+ SPELL_ROMANTIC_PICNIC_ACHIEV = 45123, // Romantic Picnic periodic = 5000
+};
+
+class spell_love_is_in_the_air_romantic_picnic : public SpellScriptLoader
+{
+ public:
+ spell_love_is_in_the_air_romantic_picnic() : SpellScriptLoader("spell_love_is_in_the_air_romantic_picnic") { }
+
+ class spell_love_is_in_the_air_romantic_picnic_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_love_is_in_the_air_romantic_picnic_AuraScript);
+
+ void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ target->SetStandState(UNIT_STAND_STATE_SIT);
+ target->CastSpell(target, SPELL_MEAL_PERIODIC, false);
+ }
+
+ void OnPeriodic(AuraEffect const* /*aurEff*/)
+ {
+ // Every 5 seconds
+ Unit* target = GetTarget();
+ Unit* caster = GetCaster();
+
+ // If our player is no longer sit, remove all auras
+ if (target->getStandState() != UNIT_STAND_STATE_SIT)
+ {
+ target->RemoveAura(SPELL_ROMANTIC_PICNIC_ACHIEV);
+ target->RemoveAura(GetAura());
+ return;
+ }
+
+ target->CastSpell(target, SPELL_BASKET_CHECK, false); // unknown use, it targets Romantic Basket
+ target->CastSpell(target, RAND(SPELL_MEAL_EAT_VISUAL, SPELL_DRINK_VISUAL), false);
+
+ bool foundSomeone = false;
+ // For nearby players, check if they have the same aura. If so, cast Romantic Picnic (45123)
+ // required by achievement and "hearts" visual
+ std::list<Player*> playerList;
+ Trinity::AnyPlayerInObjectRangeCheck checker(target, INTERACTION_DISTANCE*2);
+ Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(target, playerList, checker);
+ target->VisitNearbyWorldObject(INTERACTION_DISTANCE*2, searcher);
+ for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
+ {
+ if ((*itr) != target && (*itr)->HasAura(GetId())) // && (*itr)->getStandState() == UNIT_STAND_STATE_SIT)
+ {
+ if (caster)
+ {
+ caster->CastSpell(*itr, SPELL_ROMANTIC_PICNIC_ACHIEV, true);
+ caster->CastSpell(target, SPELL_ROMANTIC_PICNIC_ACHIEV, true);
+ }
+ foundSomeone = true;
+ // break;
+ }
+ }
+
+ if (!foundSomeone && target->HasAura(SPELL_ROMANTIC_PICNIC_ACHIEV))
+ target->RemoveAura(SPELL_ROMANTIC_PICNIC_ACHIEV);
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_love_is_in_the_air_romantic_picnic_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_love_is_in_the_air_romantic_picnic_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_love_is_in_the_air_romantic_picnic_AuraScript();
+ }
+};
+
+void AddSC_holiday_spell_scripts()
+{
+ new spell_love_is_in_the_air_romantic_picnic();
+}
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index 1318a9aa333..8a3424ab1e7 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 2346a30640c..b40879d500e 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -1128,6 +1128,51 @@ class spell_magic_eater_food : public SpellScriptLoader
}
};
+enum Refocus
+{
+ SPELL_AIMED_SHOT = 19434,
+ SPELL_MULTISHOT = 2643,
+ SPELL_VOLLEY = 42243,
+};
+
+class spell_item_refocus : public SpellScriptLoader
+{
+ public:
+ spell_item_refocus() : SpellScriptLoader("spell_item_refocus") { }
+
+ class spell_item_refocus_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_refocus_SpellScript);
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+
+ if (!caster || caster->getClass() != CLASS_HUNTER)
+ return;
+
+ if (caster->HasSpellCooldown(SPELL_AIMED_SHOT))
+ caster->RemoveSpellCooldown(SPELL_AIMED_SHOT, true);
+
+ if (caster->HasSpellCooldown(SPELL_MULTISHOT))
+ caster->RemoveSpellCooldown(SPELL_MULTISHOT, true);
+
+ if (caster->HasSpellCooldown(SPELL_VOLLEY))
+ caster->RemoveSpellCooldown(SPELL_VOLLEY, true);
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_refocus_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_item_refocus_SpellScript();
+ }
+};
+
void AddSC_item_spell_scripts()
{
// 23074 Arcanite Dragonling
@@ -1160,4 +1205,5 @@ void AddSC_item_spell_scripts()
new spell_item_ashbringer();
new spell_magic_eater_food();
+ new spell_item_refocus();
}
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp
index 339f6ed8eca..b0b619c8b08 100644
--- a/src/server/scripts/Spells/spell_mage.cpp
+++ b/src/server/scripts/Spells/spell_mage.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 84df4418078..39360e04aa1 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,6 +37,10 @@ enum PaladinSpells
SPELL_BLESSING_OF_LOWER_CITY_PALADIN = 37879,
SPELL_BLESSING_OF_LOWER_CITY_PRIEST = 37880,
SPELL_BLESSING_OF_LOWER_CITY_SHAMAN = 37881,
+
+ SPELL_DIVINE_STORM = 53385,
+ SPELL_DIVINE_STORM_DUMMY = 54171,
+ SPELL_DIVINE_STORM_HEAL = 54172,
};
// 31850 - Ardent Defender
@@ -327,6 +331,40 @@ public:
}
};
+class spell_pal_divine_storm : public SpellScriptLoader
+{
+public:
+ spell_pal_divine_storm() : SpellScriptLoader("spell_pal_divine_storm") { }
+
+ class spell_pal_divine_storm_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pal_divine_storm_SpellScript);
+
+ uint32 healPct;
+
+ bool Load()
+ {
+ healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster());
+ return true;
+ }
+
+ void TriggerHeal()
+ {
+ GetCaster()->CastCustomSpell(SPELL_DIVINE_STORM_DUMMY, SPELLVALUE_BASE_POINT0, (GetHitDamage() * healPct) / 100, GetCaster(), true);
+ }
+
+ void Register()
+ {
+ AfterHit += SpellHitFn(spell_pal_divine_storm_SpellScript::TriggerHeal);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_pal_divine_storm_SpellScript();
+ }
+};
+
void AddSC_paladin_spell_scripts()
{
new spell_pal_ardent_defender();
@@ -335,4 +373,5 @@ void AddSC_paladin_spell_scripts()
new spell_pal_guarded_by_the_light();
new spell_pal_holy_shock();
new spell_pal_judgement_of_command();
+ new spell_pal_divine_storm();
}
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index 07b8a79691a..ee5f6a6d772 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 ecdbd582b76..940e494f18f 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -223,13 +223,13 @@ public:
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
- target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
- target->AddUnitState(UNIT_STAT_ROOT);
+ target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ target->AddUnitState(UNIT_STATE_ROOT);
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- GetTarget()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ GetTarget()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
}
void Register()
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index e9caa40255e..c88d7b891d6 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 76dac9b59f1..b0116d6d33d 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -26,16 +26,16 @@
enum ShamanSpells
{
- SHAMAN_SPELL_GLYPH_OF_MANA_TIDE = 55441,
- SHAMAN_SPELL_MANA_TIDE_TOTEM = 39609,
- SHAMAN_SPELL_FIRE_NOVA_R1 = 1535,
- SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349,
- SHAMAN_SPELL_SATED = 57724,
- SHAMAN_SPELL_EXHAUSTION = 57723,
-
- //For Earthen Power
- SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM = 6474, //Spell casted by totem
- SHAMAN_TOTEM_SPELL_EARTHEN_POWER = 59566, //Spell witch remove snare effect
+ SHAMAN_SPELL_GLYPH_OF_MANA_TIDE = 55441,
+ SHAMAN_SPELL_MANA_TIDE_TOTEM = 39609,
+ SHAMAN_SPELL_FIRE_NOVA_R1 = 1535,
+ SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349,
+ SHAMAN_SPELL_SATED = 57724,
+ SHAMAN_SPELL_EXHAUSTION = 57723,
+
+ // For Earthen Power
+ SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM = 6474,
+ SHAMAN_TOTEM_SPELL_EARTHEN_POWER = 59566,
};
// 51474 - Astral shift
@@ -125,7 +125,7 @@ class spell_sha_fire_nova : public SpellScriptLoader
{
Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]);
if (totem && totem->isTotem())
- totem->CastSpell(totem, spellId, true);
+ caster->CastSpell(totem, spellId, true);
}
}
@@ -215,9 +215,11 @@ class spell_sha_earthbind_totem : public SpellScriptLoader
{
Unit* target = GetTarget();
if (Unit* caster = aurEff->GetBase()->GetCaster())
- if (AuraEffect* aur = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0))
- if (roll_chance_i(aur->GetBaseAmount()))
- target->CastSpell(target, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true, NULL, aurEff);
+ if (TempSummon* summon = caster->ToTempSummon())
+ if (Unit* owner = summon->GetOwner())
+ if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0))
+ if (roll_chance_i(aur->GetBaseAmount()) && target->HasAuraWithMechanic(1 << MECHANIC_SNARE))
+ caster->CastSpell(caster, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true, NULL, aurEff);
}
void Register()
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index 17035c2a3d2..51b2de5d0f3 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 b9def701fca..f39ad3d1426 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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/achievement_scripts.cpp b/src/server/scripts/World/achievement_scripts.cpp
index 29cb6c082a2..9bcf450b3aa 100755
--- a/src/server/scripts/World/achievement_scripts.cpp
+++ b/src/server/scripts/World/achievement_scripts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -285,6 +285,34 @@ class achievement_bg_sa_defense_of_ancients : public AchievementCriteriaScript
}
};
+enum ArgentTournamentAreas
+{
+ AREA_ARGENT_TOURNAMENT_FIELDS = 4658,
+ AREA_RING_OF_ASPIRANTS = 4670,
+ AREA_RING_OF_ARGENT_VALIANTS = 4671,
+ AREA_RING_OF_ALLIANCE_VALIANTS = 4672,
+ AREA_RING_OF_HORDE_VALIANTS = 4673,
+ AREA_RING_OF_CHAMPIONS = 4669,
+};
+
+class achievement_tilted : public AchievementCriteriaScript
+{
+ public:
+ achievement_tilted() : AchievementCriteriaScript("achievement_tilted") {}
+
+ bool OnCheck(Player* player, Unit* /*target*/)
+ {
+ bool checkArea = player->GetAreaId() == AREA_ARGENT_TOURNAMENT_FIELDS ||
+ player->GetAreaId() == AREA_RING_OF_ASPIRANTS ||
+ player->GetAreaId() == AREA_RING_OF_ARGENT_VALIANTS ||
+ player->GetAreaId() == AREA_RING_OF_ALLIANCE_VALIANTS ||
+ player->GetAreaId() == AREA_RING_OF_HORDE_VALIANTS ||
+ player->GetAreaId() == AREA_RING_OF_CHAMPIONS;
+
+ return player && checkArea && player->duel && player->duel->isMounted;
+ }
+};
+
void AddSC_achievement_scripts()
{
new achievement_resilient_victory();
@@ -302,4 +330,5 @@ void AddSC_achievement_scripts()
new achievement_arena_kills("achievement_arena_3v3_kills", ARENA_TYPE_3v3);
new achievement_arena_kills("achievement_arena_5v5_kills", ARENA_TYPE_5v5);
new achievement_bg_sa_defense_of_ancients();
+ new achievement_tilted();
}
diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp
index 7d1ed17ed29..8f86f760775 100644
--- a/src/server/scripts/World/areatrigger_scripts.cpp
+++ b/src/server/scripts/World/areatrigger_scripts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp
index e5c584df6e1..9f652e7a859 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-2011 TrinityCore <http://www.trinitycore.org/>
+* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -144,7 +144,7 @@ struct emerald_dragonAI : public WorldBossAI
events.Update(diff);
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
diff --git a/src/server/scripts/World/chat_log.cpp b/src/server/scripts/World/chat_log.cpp
index 0592a452211..2a5d814bfde 100755
--- a/src/server/scripts/World/chat_log.cpp
+++ b/src/server/scripts/World/chat_log.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 e93dd2751e6..fff01c83d07 100644
--- a/src/server/scripts/World/go_scripts.cpp
+++ b/src/server/scripts/World/go_scripts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 f869138d58f..9bc511931b9 100644
--- a/src/server/scripts/World/guards.cpp
+++ b/src/server/scripts/World/guards.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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:
globalCooldown = GENERIC_CREATURE_COOLDOWN;
} //If no spells available and we arn't moving run to target
- else if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
+ else if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE)
{
//Cancel our current spell and then mutate new movement generator
me->InterruptNonMeleeSpells(false);
diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp
index 9bfa77271f5..165ef9f18b1 100644
--- a/src/server/scripts/World/item_scripts.cpp
+++ b/src/server/scripts/World/item_scripts.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -242,7 +242,7 @@ public:
{
summon->SetVisible(false);
summon->SetReactState(REACT_PASSIVE);
- summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
+ summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
}
return false;
}
diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp
index 92909f3885a..3a61b9f9e18 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-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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_innkeeper.cpp b/src/server/scripts/World/npc_innkeeper.cpp
index 55f6eaac687..334eb48cb05 100644
--- a/src/server/scripts/World/npc_innkeeper.cpp
+++ b/src/server/scripts/World/npc_innkeeper.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 01f12086477..336e232236d 100644
--- a/src/server/scripts/World/npc_professions.cpp
+++ b/src/server/scripts/World/npc_professions.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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 ff83b0c1ec5..aff326e152d 100644
--- a/src/server/scripts/World/npc_taxi.cpp
+++ b/src/server/scripts/World/npc_taxi.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 03fc07c9582..13609a490e5 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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,6 +40,7 @@ npc_sayge 100% Darkmoon event fortune teller, buff player based
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
npc_locksmith 75% list of keys needs to be confirmed
+npc_firework 100% NPC's summoned by rockets and rocket clusters, for making them cast visual
EndContentData */
#include "ScriptPCH.h"
@@ -1737,6 +1738,12 @@ public:
if (!UpdateVictim())
return;
+ if (me->getVictim()->HasBreakableByDamageCrowdControlAura(me))
+ {
+ me->InterruptNonMeleeSpells(false);
+ return;
+ }
+
if (SpellTimer <= diff)
{
if (IsViper) //Viper
@@ -1909,7 +1916,7 @@ public:
Unit* owner = me->GetCharmerOrOwner();
me->CombatStop(true);
- if (owner && !me->HasUnitState(UNIT_STAT_FOLLOW))
+ if (owner && !me->HasUnitState(UNIT_STATE_FOLLOW))
{
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE);
@@ -2068,7 +2075,7 @@ public:
void Reset()
{
- me->SetControlled(true, UNIT_STAT_STUNNED);//disable rotate
+ me->SetControlled(true, UNIT_STATE_STUNNED);//disable rotate
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);//imune to knock aways like blast wave
ResetTimer = 5000;
@@ -2100,8 +2107,8 @@ public:
if (!UpdateVictim())
return;
- if (!me->HasUnitState(UNIT_STAT_STUNNED))
- me->SetControlled(true, UNIT_STAT_STUNNED);//disable rotate
+ if (!me->HasUnitState(UNIT_STATE_STUNNED))
+ me->SetControlled(true, UNIT_STATE_STUNNED);//disable rotate
if (Entry != NPC_ADVANCED_TARGET_DUMMY && Entry != NPC_TARGET_DUMMY)
{
@@ -2202,7 +2209,7 @@ public:
if (!UpdateVictim())
return;
- if (me->HasUnitState(UNIT_STAT_CASTING))
+ if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if (FireShield_Timer <= diff)
@@ -2764,6 +2771,379 @@ public:
}
};
+enum Fireworks
+{
+ NPC_OMEN = 15467,
+ NPC_MINION_OF_OMEN = 15466,
+ NPC_FIREWORK_BLUE = 15879,
+ NPC_FIREWORK_GREEN = 15880,
+ NPC_FIREWORK_PURPLE = 15881,
+ NPC_FIREWORK_RED = 15882,
+ NPC_FIREWORK_YELLOW = 15883,
+ NPC_FIREWORK_WHITE = 15884,
+ NPC_FIREWORK_BIG_BLUE = 15885,
+ NPC_FIREWORK_BIG_GREEN = 15886,
+ NPC_FIREWORK_BIG_PURPLE = 15887,
+ NPC_FIREWORK_BIG_RED = 15888,
+ NPC_FIREWORK_BIG_YELLOW = 15889,
+ NPC_FIREWORK_BIG_WHITE = 15890,
+
+ NPC_CLUSTER_BLUE = 15872,
+ NPC_CLUSTER_RED = 15873,
+ NPC_CLUSTER_GREEN = 15874,
+ NPC_CLUSTER_PURPLE = 15875,
+ NPC_CLUSTER_WHITE = 15876,
+ NPC_CLUSTER_YELLOW = 15877,
+ NPC_CLUSTER_BIG_BLUE = 15911,
+ NPC_CLUSTER_BIG_GREEN = 15912,
+ NPC_CLUSTER_BIG_PURPLE = 15913,
+ NPC_CLUSTER_BIG_RED = 15914,
+ NPC_CLUSTER_BIG_WHITE = 15915,
+ NPC_CLUSTER_BIG_YELLOW = 15916,
+ NPC_CLUSTER_ELUNE = 15918,
+
+ GO_FIREWORK_LAUNCHER_1 = 180771,
+ GO_FIREWORK_LAUNCHER_2 = 180868,
+ GO_FIREWORK_LAUNCHER_3 = 180850,
+ GO_CLUSTER_LAUNCHER_1 = 180772,
+ GO_CLUSTER_LAUNCHER_2 = 180859,
+ GO_CLUSTER_LAUNCHER_3 = 180869,
+ GO_CLUSTER_LAUNCHER_4 = 180874,
+
+ SPELL_ROCKET_BLUE = 26344,
+ SPELL_ROCKET_GREEN = 26345,
+ SPELL_ROCKET_PURPLE = 26346,
+ SPELL_ROCKET_RED = 26347,
+ SPELL_ROCKET_WHITE = 26348,
+ SPELL_ROCKET_YELLOW = 26349,
+ SPELL_ROCKET_BIG_BLUE = 26351,
+ SPELL_ROCKET_BIG_GREEN = 26352,
+ SPELL_ROCKET_BIG_PURPLE = 26353,
+ SPELL_ROCKET_BIG_RED = 26354,
+ SPELL_ROCKET_BIG_WHITE = 26355,
+ SPELL_ROCKET_BIG_YELLOW = 26356,
+ SPELL_LUNAR_FORTUNE = 26522,
+
+ ANIM_GO_LAUNCH_FIREWORK = 3,
+ ZONE_MOONGLADE = 493,
+};
+
+Position omenSummonPos = {7558.993f, -2839.999f, 450.0214f, 4.46f};
+
+class npc_firework : public CreatureScript
+{
+public:
+ npc_firework() : CreatureScript("npc_firework") { }
+
+ struct npc_fireworkAI : public ScriptedAI
+ {
+ npc_fireworkAI(Creature* creature) : ScriptedAI(creature) {}
+
+ bool isCluster()
+ {
+ switch (me->GetEntry())
+ {
+ case NPC_FIREWORK_BLUE:
+ case NPC_FIREWORK_GREEN:
+ case NPC_FIREWORK_PURPLE:
+ case NPC_FIREWORK_RED:
+ case NPC_FIREWORK_YELLOW:
+ case NPC_FIREWORK_WHITE:
+ case NPC_FIREWORK_BIG_BLUE:
+ case NPC_FIREWORK_BIG_GREEN:
+ case NPC_FIREWORK_BIG_PURPLE:
+ case NPC_FIREWORK_BIG_RED:
+ case NPC_FIREWORK_BIG_YELLOW:
+ case NPC_FIREWORK_BIG_WHITE:
+ return false;
+ case NPC_CLUSTER_BLUE:
+ case NPC_CLUSTER_GREEN:
+ case NPC_CLUSTER_PURPLE:
+ case NPC_CLUSTER_RED:
+ case NPC_CLUSTER_YELLOW:
+ case NPC_CLUSTER_WHITE:
+ case NPC_CLUSTER_BIG_BLUE:
+ case NPC_CLUSTER_BIG_GREEN:
+ case NPC_CLUSTER_BIG_PURPLE:
+ case NPC_CLUSTER_BIG_RED:
+ case NPC_CLUSTER_BIG_YELLOW:
+ case NPC_CLUSTER_BIG_WHITE:
+ case NPC_CLUSTER_ELUNE:
+ default:
+ return true;
+ }
+ }
+
+ GameObject* FindNearestLauncher()
+ {
+ GameObject* launcher = NULL;
+
+ if (isCluster())
+ {
+ GameObject* launcher1 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_1, 0.5f);
+ GameObject* launcher2 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_2, 0.5f);
+ GameObject* launcher3 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_3, 0.5f);
+ GameObject* launcher4 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_4, 0.5f);
+
+ if (launcher1)
+ launcher = launcher1;
+ else if (launcher2)
+ launcher = launcher2;
+ else if (launcher3)
+ launcher = launcher3;
+ else if (launcher4)
+ launcher = launcher4;
+ }
+ else
+ {
+ GameObject* launcher1 = GetClosestGameObjectWithEntry(me, GO_FIREWORK_LAUNCHER_1, 0.5f);
+ GameObject* launcher2 = GetClosestGameObjectWithEntry(me, GO_FIREWORK_LAUNCHER_2, 0.5f);
+ GameObject* launcher3 = GetClosestGameObjectWithEntry(me, GO_FIREWORK_LAUNCHER_3, 0.5f);
+
+ if (launcher1)
+ launcher = launcher1;
+ else if (launcher2)
+ launcher = launcher2;
+ else if (launcher3)
+ launcher = launcher3;
+ }
+
+ return launcher;
+ }
+
+ uint32 GetFireworkSpell(uint32 entry)
+ {
+ switch (entry)
+ {
+ case NPC_FIREWORK_BLUE:
+ return SPELL_ROCKET_BLUE;
+ case NPC_FIREWORK_GREEN:
+ return SPELL_ROCKET_GREEN;
+ case NPC_FIREWORK_PURPLE:
+ return SPELL_ROCKET_PURPLE;
+ case NPC_FIREWORK_RED:
+ return SPELL_ROCKET_RED;
+ case NPC_FIREWORK_YELLOW:
+ return SPELL_ROCKET_YELLOW;
+ case NPC_FIREWORK_WHITE:
+ return SPELL_ROCKET_WHITE;
+ case NPC_FIREWORK_BIG_BLUE:
+ return SPELL_ROCKET_BIG_BLUE;
+ case NPC_FIREWORK_BIG_GREEN:
+ return SPELL_ROCKET_BIG_GREEN;
+ case NPC_FIREWORK_BIG_PURPLE:
+ return SPELL_ROCKET_BIG_PURPLE;
+ case NPC_FIREWORK_BIG_RED:
+ return SPELL_ROCKET_BIG_RED;
+ case NPC_FIREWORK_BIG_YELLOW:
+ return SPELL_ROCKET_BIG_YELLOW;
+ case NPC_FIREWORK_BIG_WHITE:
+ return SPELL_ROCKET_BIG_WHITE;
+ default:
+ return 0;
+ }
+ }
+
+ uint32 GetFireworkGameObjectId()
+ {
+ uint32 spellId = 0;
+
+ switch (me->GetEntry())
+ {
+ case NPC_CLUSTER_BLUE:
+ spellId = GetFireworkSpell(NPC_FIREWORK_BLUE);
+ break;
+ case NPC_CLUSTER_GREEN:
+ spellId = GetFireworkSpell(NPC_FIREWORK_GREEN);
+ break;
+ case NPC_CLUSTER_PURPLE:
+ spellId = GetFireworkSpell(NPC_FIREWORK_PURPLE);
+ break;
+ case NPC_CLUSTER_RED:
+ spellId = GetFireworkSpell(NPC_FIREWORK_RED);
+ break;
+ case NPC_CLUSTER_YELLOW:
+ spellId = GetFireworkSpell(NPC_FIREWORK_YELLOW);
+ break;
+ case NPC_CLUSTER_WHITE:
+ spellId = GetFireworkSpell(NPC_FIREWORK_WHITE);
+ break;
+ case NPC_CLUSTER_BIG_BLUE:
+ spellId = GetFireworkSpell(NPC_FIREWORK_BIG_BLUE);
+ break;
+ case NPC_CLUSTER_BIG_GREEN:
+ spellId = GetFireworkSpell(NPC_FIREWORK_BIG_GREEN);
+ break;
+ case NPC_CLUSTER_BIG_PURPLE:
+ spellId = GetFireworkSpell(NPC_FIREWORK_BIG_PURPLE);
+ break;
+ case NPC_CLUSTER_BIG_RED:
+ spellId = GetFireworkSpell(NPC_FIREWORK_BIG_RED);
+ break;
+ case NPC_CLUSTER_BIG_YELLOW:
+ spellId = GetFireworkSpell(NPC_FIREWORK_BIG_YELLOW);
+ break;
+ case NPC_CLUSTER_BIG_WHITE:
+ spellId = GetFireworkSpell(NPC_FIREWORK_BIG_WHITE);
+ break;
+ case NPC_CLUSTER_ELUNE:
+ spellId = GetFireworkSpell(urand(NPC_FIREWORK_BLUE, NPC_FIREWORK_WHITE));
+ break;
+ }
+
+ const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId);
+
+ if (spellInfo && spellInfo->Effects[0].Effect == SPELL_EFFECT_SUMMON_OBJECT_WILD)
+ return spellInfo->Effects[0].MiscValue;
+
+ return 0;
+ }
+
+ void Reset()
+ {
+ if (GameObject* launcher = FindNearestLauncher())
+ {
+ launcher->SendCustomAnim(ANIM_GO_LAUNCH_FIREWORK);
+ me->SetOrientation(launcher->GetOrientation() + M_PI/2);
+ }
+ else
+ return;
+
+ if (isCluster())
+ {
+ // Check if we are near Elune'ara lake south, if so try to summon Omen or a minion
+ if (me->GetZoneId() == ZONE_MOONGLADE)
+ {
+ if (!me->FindNearestCreature(NPC_OMEN, 100.0f, false) && me->GetDistance2d(omenSummonPos.GetPositionX(), omenSummonPos.GetPositionY()) <= 100.0f)
+ {
+ switch (urand(0,9))
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ if (Creature* minion = me->SummonCreature(NPC_MINION_OF_OMEN, me->GetPositionX()+frand(-5.0f, 5.0f), me->GetPositionY()+frand(-5.0f, 5.0f), me->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
+ minion->AI()->AttackStart(me->SelectNearestPlayer(20.0f));
+ break;
+ case 9:
+ me->SummonCreature(NPC_OMEN, omenSummonPos);
+ break;
+ }
+ }
+ }
+ if (me->GetEntry() == NPC_CLUSTER_ELUNE)
+ DoCast(SPELL_LUNAR_FORTUNE);
+
+ float displacement = 0.7f;
+ for (uint8 i = 0; i < 4; i++)
+ me->SummonGameObject(GetFireworkGameObjectId(), me->GetPositionX() + (i%2 == 0 ? displacement : -displacement), me->GetPositionY() + (i > 1 ? displacement : -displacement), me->GetPositionZ() + 4.0f, me->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 1);
+ }
+ else
+ //me->CastSpell(me, GetFireworkSpell(me->GetEntry()), true);
+ me->CastSpell(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), GetFireworkSpell(me->GetEntry()), true);
+ }
+ };
+
+ CreatureAI *GetAI(Creature* creature) const
+ {
+ return new npc_fireworkAI(creature);
+ }
+};
+
+/*#####
+# npc_spring_rabbit
+#####*/
+
+enum rabbitSpells
+{
+ SPELL_SPRING_FLING = 61875,
+ SPELL_SPRING_RABBIT_JUMP = 61724,
+ SPELL_SPRING_RABBIT_WANDER = 61726,
+ SPELL_SUMMON_BABY_BUNNY = 61727,
+ SPELL_SPRING_RABBIT_IN_LOVE = 61728,
+ NPC_SPRING_RABBIT = 32791
+};
+
+class npc_spring_rabbit : public CreatureScript
+{
+public:
+ npc_spring_rabbit() : CreatureScript("npc_spring_rabbit") { }
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_spring_rabbitAI(creature);
+ }
+
+ struct npc_spring_rabbitAI : public ScriptedAI
+ {
+ npc_spring_rabbitAI(Creature* c) : ScriptedAI(c) { }
+
+ bool inLove;
+ uint32 jumpTimer;
+ uint32 bunnyTimer;
+ uint32 searchTimer;
+ uint64 rabbitGUID;
+
+ void Reset()
+ {
+ inLove = false;
+ rabbitGUID = 0;
+ jumpTimer = urand(5000, 10000);
+ bunnyTimer = urand(10000, 20000);
+ searchTimer = urand(5000, 10000);
+ if (Unit* owner = me->GetOwner())
+ me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ }
+
+ void EnterCombat(Unit * /*who*/) { }
+
+ void DoAction(const int32 /*param*/)
+ {
+ inLove = true;
+ if (Unit* owner = me->GetOwner())
+ owner->CastSpell(owner, SPELL_SPRING_FLING, true);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (inLove)
+ {
+ if (jumpTimer <= diff)
+ {
+ if (Unit* rabbit = Unit::GetUnit(*me, rabbitGUID))
+ DoCast(rabbit, SPELL_SPRING_RABBIT_JUMP);
+ jumpTimer = urand(5000, 10000);
+ } else jumpTimer -= diff;
+
+ if (bunnyTimer <= diff)
+ {
+ DoCast(SPELL_SUMMON_BABY_BUNNY);
+ bunnyTimer = urand(20000, 40000);
+ } else bunnyTimer -= diff;
+ }
+ else
+ {
+ if (searchTimer <= diff)
+ {
+ if (Creature* rabbit = me->FindNearestCreature(NPC_SPRING_RABBIT, 10.0f))
+ {
+ if (rabbit == me || rabbit->HasAura(SPELL_SPRING_RABBIT_IN_LOVE))
+ return;
+
+ me->AddAura(SPELL_SPRING_RABBIT_IN_LOVE, me);
+ DoAction(1);
+ rabbit->AddAura(SPELL_SPRING_RABBIT_IN_LOVE, rabbit);
+ rabbit->AI()->DoAction(1);
+ rabbit->CastSpell(rabbit, SPELL_SPRING_RABBIT_JUMP, true);
+ rabbitGUID = rabbit->GetGUID();
+ }
+ searchTimer = urand(5000, 10000);
+ } else searchTimer -= diff;
+ }
+ }
+ };
+};
+
void AddSC_npcs_special()
{
new npc_air_force_bots;
@@ -2796,5 +3176,7 @@ void AddSC_npcs_special()
new npc_experience;
new npc_fire_elemental;
new npc_earth_elemental;
+ new npc_firework;
+ new npc_spring_rabbit();
}
diff --git a/src/server/shared/CMakeLists.txt b/src/server/shared/CMakeLists.txt
index e5df566462f..3ec35b5394a 100644
--- a/src/server/shared/CMakeLists.txt
+++ b/src/server/shared/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2012 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 68b5a62b963..88e7d5a76fc 100755
--- a/src/server/shared/Common.cpp
+++ b/src/server/shared/Common.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 bc9c0c62ccc..57809cca255 100755
--- a/src/server/shared/Common.h
+++ b/src/server/shared/Common.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 377556a8948..f7e3d0b4979 100755
--- a/src/server/shared/CompilerDefs.h
+++ b/src/server/shared/CompilerDefs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 d5a3a7e46bc..b82d86cc5d0 100755
--- a/src/server/shared/Configuration/Config.cpp
+++ b/src/server/shared/Configuration/Config.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 46d019fd800..a870379881b 100755
--- a/src/server/shared/Configuration/Config.h
+++ b/src/server/shared/Configuration/Config.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.cpp b/src/server/shared/Cryptography/ARC4.cpp
index b1a6da31334..52a60573eca 100755
--- a/src/server/shared/Cryptography/ARC4.cpp
+++ b/src/server/shared/Cryptography/ARC4.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 abf753be02f..541135e52f2 100755
--- a/src/server/shared/Cryptography/ARC4.h
+++ b/src/server/shared/Cryptography/ARC4.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 a2db02dfbe3..5b4ffabd4f6 100755
--- a/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp
+++ b/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 e7463b0d962..7081b4973d4 100755
--- a/src/server/shared/Cryptography/Authentication/AuthCrypt.h
+++ b/src/server/shared/Cryptography/Authentication/AuthCrypt.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 76cb74d5e13..f55e87c99fc 100755
--- a/src/server/shared/Cryptography/BigNumber.cpp
+++ b/src/server/shared/Cryptography/BigNumber.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 eb450c27777..7196aae6579 100755
--- a/src/server/shared/Cryptography/BigNumber.h
+++ b/src/server/shared/Cryptography/BigNumber.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 5bb837b1544..447d0b58efc 100755
--- a/src/server/shared/Cryptography/HMACSHA1.cpp
+++ b/src/server/shared/Cryptography/HMACSHA1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -18,6 +18,7 @@
#include "HMACSHA1.h"
#include "BigNumber.h"
+#include "Common.h"
HmacHash::HmacHash(uint32 len, uint8 *seed)
{
diff --git a/src/server/shared/Cryptography/HMACSHA1.h b/src/server/shared/Cryptography/HMACSHA1.h
index 2d6e0c276a8..bd0418b600e 100755
--- a/src/server/shared/Cryptography/HMACSHA1.h
+++ b/src/server/shared/Cryptography/HMACSHA1.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.cpp b/src/server/shared/Cryptography/SHA1.cpp
index c60b8bfb70a..2af8e4d4cbe 100755
--- a/src/server/shared/Cryptography/SHA1.cpp
+++ b/src/server/shared/Cryptography/SHA1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 9cb9b7b90f9..b5bf97fd7d9 100755
--- a/src/server/shared/Cryptography/SHA1.h
+++ b/src/server/shared/Cryptography/SHA1.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.cpp b/src/server/shared/DataStores/DBCFileLoader.cpp
index 998724f84ce..f909c8566bb 100755
--- a/src/server/shared/DataStores/DBCFileLoader.cpp
+++ b/src/server/shared/DataStores/DBCFileLoader.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 b2d99e9302f..a43807a3b59 100755
--- a/src/server/shared/DataStores/DBCFileLoader.h
+++ b/src/server/shared/DataStores/DBCFileLoader.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 b580048ed45..c5b8b6f5a21 100755
--- a/src/server/shared/DataStores/DBCStore.h
+++ b/src/server/shared/DataStores/DBCStore.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 603c159162a..9e795ae853a 100755
--- a/src/server/shared/Database/AdhocStatement.cpp
+++ b/src/server/shared/Database/AdhocStatement.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 1a76956809b..e17a85e7466 100755
--- a/src/server/shared/Database/AdhocStatement.h
+++ b/src/server/shared/Database/AdhocStatement.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 5e8ddfe4cde..13b900d8392 100755
--- a/src/server/shared/Database/DatabaseEnv.h
+++ b/src/server/shared/Database/DatabaseEnv.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 209ca35abae..662c879ad5e 100644
--- a/src/server/shared/Database/DatabaseWorker.cpp
+++ b/src/server/shared/Database/DatabaseWorker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 f2249fa750c..c01a9c1bc3c 100755
--- a/src/server/shared/Database/DatabaseWorker.h
+++ b/src/server/shared/Database/DatabaseWorker.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 a128eda3b70..b91972e5b0c 100755
--- a/src/server/shared/Database/DatabaseWorkerPool.h
+++ b/src/server/shared/Database/DatabaseWorkerPool.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 a3428916cc2..3ea153bdc0c 100755
--- a/src/server/shared/Database/Field.cpp
+++ b/src/server/shared/Database/Field.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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.h b/src/server/shared/Database/Field.h
index dde7b902b2d..355f6b47ff2 100755
--- a/src/server/shared/Database/Field.h
+++ b/src/server/shared/Database/Field.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 28f7f95b319..fe276b26738 100755..100644
--- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp
+++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -23,299 +23,315 @@ void CharacterDatabaseConnection::DoPrepareStatements()
m_stmts.resize(MAX_CHARACTERDATABASE_STATEMENTS);
PREPARE_STATEMENT(CHAR_DEL_QUEST_POOL_SAVE, "DELETE FROM pool_quest_save WHERE pool_id = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_ADD_QUEST_POOL_SAVE, "INSERT INTO pool_quest_save (pool_id, quest_id) VALUES (?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_QUEST_POOL_SAVE, "INSERT INTO pool_quest_save (pool_id, quest_id) VALUES (?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEM, "DELETE FROM guild_bank_item WHERE guildid = ? AND TabId = ? AND SlotId = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_EXPIRED_BANS, "UPDATE character_banned SET active = 0 WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate <> bandate", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_GET_GUID_BY_NAME, "SELECT guid FROM characters WHERE name = ?", CONNECTION_BOTH);
- PREPARE_STATEMENT(CHAR_GET_CHECK_NAME, "SELECT 1 FROM characters WHERE name = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_GET_SUM_CHARS, "SELECT COUNT(guid) FROM characters WHERE account = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_GET_CHAR_CREATE_INFO, "SELECT level, race, class FROM characters WHERE account = ? LIMIT 0, ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_ADD_BAN, "INSERT INTO character_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_NOT_BANNED, "UPDATE character_banned SET active = 0 WHERE guid = ? AND active != 0", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_GET_BANINFO, "SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate, banreason, bannedby FROM character_banned WHERE guid = ? ORDER BY bandate ASC", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_GET_GUID_BY_NAME_FILTER, "SELECT guid, name FROM characters WHERE name LIKE CONCAT('%', ?, '%')", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_GET_BANINFO_LIST, "SELECT bandate, unbandate, bannedby, banreason FROM character_banned WHERE guid = ? ORDER BY unbandate", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_GET_BANNED_NAME, "SELECT characters.name FROM characters, character_banned WHERE character_banned.guid = ? AND character_banned.guid = characters.guid", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_GET_ENUM, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_GET_ENUM_DECLINED_NAME, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid, cd.genitive FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_GET_PET_SLOTS, "SELECT owner, slot FROM character_pet WHERE owner = ? AND slot >= ? AND slot <= ? ORDER BY slot", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_GET_PET_SLOTS_DETAIL, "SELECT owner, id, entry, level, name FROM character_pet WHERE owner = ? AND slot >= ? AND slot <= ? ORDER BY slot", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_GET_PET_ENTRY, "SELECT entry FROM character_pet WHERE owner = ? AND id = ? AND slot >= ? AND slot <= ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_GET_PET_SLOT_BY_ID, "SELECT slot, entry FROM character_pet WHERE owner = ? AND id = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_GET_FREE_NAME, "SELECT guid, name FROM characters WHERE guid = ? AND account = ? AND (at_login & ?) = ? AND NOT EXISTS (SELECT NULL FROM characters WHERE name = ?)", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_GET_GUID_RACE_ACC_BY_NAME, "SELECT guid, race, account FROM characters WHERE name = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_SEL_GUID_BY_NAME, "SELECT guid FROM characters WHERE name = ?", CONNECTION_BOTH);
+ PREPARE_STATEMENT(CHAR_SEL_CHECK_NAME, "SELECT 1 FROM characters WHERE name = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_SEL_SUM_CHARS, "SELECT COUNT(guid) FROM characters WHERE account = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_SEL_CHAR_CREATE_INFO, "SELECT level, race, class FROM characters WHERE account = ? LIMIT 0, ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_INS_CHARACTER_BAN, "INSERT INTO character_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_CHARACTER_BAN, "UPDATE character_banned SET active = 0 WHERE guid = ? AND active != 0", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_BANINFO, "SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate, banreason, bannedby FROM character_banned WHERE guid = ? ORDER BY bandate ASC", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_GUID_BY_NAME_FILTER, "SELECT guid, name FROM characters WHERE name LIKE CONCAT('%', ?, '%')", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_BANINFO_LIST, "SELECT bandate, unbandate, bannedby, banreason FROM character_banned WHERE guid = ? ORDER BY unbandate", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_BANNED_NAME, "SELECT characters.name FROM characters, character_banned WHERE character_banned.guid = ? AND character_banned.guid = characters.guid", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_ENUM, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_SEL_ENUM_DECLINED_NAME, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid, cd.genitive FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_SEL_PET_SLOTS, "SELECT owner, slot FROM character_pet WHERE owner = ? AND slot >= ? AND slot <= ? ORDER BY slot", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_SEL_PET_SLOTS_DETAIL, "SELECT owner, id, entry, level, name FROM character_pet WHERE owner = ? AND slot >= ? AND slot <= ? ORDER BY slot", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_SEL_PET_ENTRY, "SELECT entry FROM character_pet WHERE owner = ? AND id = ? AND slot >= ? AND slot <= ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_SEL_PET_SLOT_BY_ID, "SELECT slot, entry FROM character_pet WHERE owner = ? AND id = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_SEL_FREE_NAME, "SELECT guid, name FROM characters WHERE guid = ? AND account = ? AND (at_login & ?) = ? AND NOT EXISTS (SELECT NULL FROM characters WHERE name = ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_SEL_GUID_RACE_ACC_BY_NAME, "SELECT guid, race, account FROM characters WHERE name = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_DAILY, "DELETE FROM character_queststatus_daily", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_WEEKLY, "DELETE FROM character_queststatus_weekly", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_SEASONAL, "DELETE FROM character_queststatus_seasonal WHERE event = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_DAILY_CHAR, "DELETE FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_WEEKLY_CHAR, "DELETE FROM character_queststatus_weekly WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_SEASONAL_CHAR, "DELETE FROM character_queststatus_seasonal WHERE guid = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_BATTLEGROUND_RANDOM, "DELETE FROM character_battleground_random", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_INS_BATTLEGROUND_RANDOM, "INSERT INTO character_battleground_random (guid) VALUES (?)", CONNECTION_ASYNC);
// Start LoginQueryHolder content
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER, "SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, "
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER, "SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, "
"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, "
"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, "
"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, "
"health, power1, power2, power3, power4, power5, power6, power7, instance_id, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_GROUP, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_BOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_AURAS, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, "
+ PREPARE_STATEMENT(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_INSTANCE, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_AURAS, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, "
"base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM character_aura WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_SPELLS, "SELECT spell, active, disabled FROM character_spell WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_QUESTSTATUS, "SELECT quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, "
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SPELL, "SELECT spell, active, disabled FROM character_spell WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_QUESTSTATUS, "SELECT quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, "
"itemcount1, itemcount2, itemcount3, itemcount4, playercount FROM character_queststatus WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_DAILYQUESTSTATUS, "SELECT quest, time FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_WEKLYQUESTSTATUS, "SELECT quest FROM character_queststatus_weekly WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_REPUTATION, "SELECT faction, standing, flags FROM character_reputation WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_INVENTORY, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, bag, slot, "
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_DAILYQUESTSTATUS, "SELECT quest, time FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_WEEKLYQUESTSTATUS, "SELECT quest FROM character_queststatus_weekly WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SEASONALQUESTSTATUS, "SELECT quest, event FROM character_queststatus_seasonal WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_CHARACTER_DAILYQUESTSTATUS, "INSERT INTO character_queststatus_daily (guid, quest, time) VALUES (?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_CHARACTER_WEEKLYQUESTSTATUS, "INSERT INTO character_queststatus_weekly (guid, quest) VALUES (?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_CHARACTER_SEASONALQUESTSTATUS, "INSERT INTO character_queststatus_seasonal (guid, quest, event) VALUES (?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_REPUTATION, "SELECT faction, standing, flags FROM character_reputation WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_INVENTORY, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, bag, slot, "
"item, itemEntry FROM character_inventory ci JOIN item_instance ii ON ci.item = ii.guid WHERE ci.guid = ? ORDER BY bag, slot", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_ACTIONS, "SELECT a.button, a.action, a.type FROM character_action as a, characters as c WHERE a.guid = c.guid AND a.spec = c.activespec AND a.guid = ? ORDER BY button", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_MAILCOUNT, "SELECT COUNT(id) FROM mail WHERE receiver = ? AND (checked & 1) = 0 AND deliver_time <= ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_MAILDATE, "SELECT MIN(deliver_time) FROM mail WHERE receiver = ? AND (checked & 1) = 0", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_SOCIALLIST, "SELECT friend, flags, note FROM character_social JOIN characters ON characters.guid = character_social.friend WHERE character_social.guid = ? AND deleteinfos_name IS NULL LIMIT 255", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_HOMEBIND, "SELECT mapId, zoneId, posX, posY, posZ FROM character_homebind WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_SPELLCOOLDOWNS, "SELECT spell, item, time FROM character_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_DECLINEDNAMES, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_GUILD, "SELECT guildid, rank FROM guild_member WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_ACHIEVEMENTS, "SELECT achievement, date FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_CRITERIAPROGRESS, "SELECT criteria, counter, date FROM character_achievement_progress WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_EQUIPMENTSETS, "SELECT setguid, setindex, name, iconname, item0, item1, item2, item3, item4, item5, item6, item7, item8, "
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_ACTIONS, "SELECT a.button, a.action, a.type FROM character_action as a, characters as c WHERE a.guid = c.guid AND a.spec = c.activespec AND a.guid = ? ORDER BY button", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_MAILCOUNT, "SELECT COUNT(id) FROM mail WHERE receiver = ? AND (checked & 1) = 0 AND deliver_time <= ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_MAILDATE, "SELECT MIN(deliver_time) FROM mail WHERE receiver = ? AND (checked & 1) = 0", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SOCIALLIST, "SELECT friend, flags, note FROM character_social JOIN characters ON characters.guid = character_social.friend WHERE character_social.guid = ? AND deleteinfos_name IS NULL LIMIT 255", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_HOMEBIND, "SELECT mapId, zoneId, posX, posY, posZ FROM character_homebind WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SPELLCOOLDOWNS, "SELECT spell, item, time FROM character_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_DECLINEDNAMES, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_GUILD_MEMBER, "SELECT guildid, rank FROM guild_member WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_ACHIEVEMENTS, "SELECT achievement, date FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_CRITERIAPROGRESS, "SELECT criteria, counter, date FROM character_achievement_progress WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_EQUIPMENTSETS, "SELECT setguid, setindex, name, iconname, item0, item1, item2, item3, item4, item5, item6, item7, item8, "
"item9, item10, item11, item12, item13, item14, item15, item16, item17, item18 FROM character_equipmentsets WHERE guid = ? ORDER BY setindex", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_BGDATA, "SELECT instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell FROM character_battleground_data WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_GLYPHS, "SELECT spec, glyph1, glyph2, glyph3, glyph4, glyph5, glyph6 FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_TALENTS, "SELECT spell, spec FROM character_talent WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_SKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_RANDOMBG, "SELECT guid FROM character_battleground_random WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_BANNED, "SELECT guid FROM character_banned WHERE guid = ? AND active = 1", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_QUESTSTATUSREW, "SELECT quest FROM character_queststatus_rewarded WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_ACCOUNT_INSTANCELOCKTIMES, "SELECT instanceId, releaseTime FROM account_instance_times WHERE accountId = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_BGDATA, "SELECT instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell FROM character_battleground_data WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_GLYPHS, "SELECT spec, glyph1, glyph2, glyph3, glyph4, glyph5, glyph6 FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_TALENTS, "SELECT spell, spec FROM character_talent WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_RANDOMBG, "SELECT guid FROM character_battleground_random WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_BANNED, "SELECT guid FROM character_banned WHERE guid = ? AND active = 1", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_QUESTSTATUSREW, "SELECT quest FROM character_queststatus_rewarded WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_INSTANCELOCKTIMES, "SELECT instanceId, releaseTime FROM account_instance_times WHERE accountId = ?", CONNECTION_ASYNC)
// End LoginQueryHolder content
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_ACTIONS_SPEC, "SELECT button, action, type FROM character_action WHERE guid = ? AND spec = ? ORDER BY button", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_MAILITEMS, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, item_guid, itemEntry, owner_guid FROM mail_items mi JOIN item_instance ii ON mi.item_guid = ii.guid WHERE mail_id = ?", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_LOAD_AUCTION_ITEMS, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, itemguid, itemEntry FROM auctionhouse ah JOIN item_instance ii ON ah.itemguid = ii.guid", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_LOAD_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_ADD_AUCTION, "INSERT INTO auctionhouse (id, auctioneerguid, itemguid, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_ACTIONS_SPEC, "SELECT button, action, type FROM character_action WHERE guid = ? AND spec = ? ORDER BY button", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_MAILITEMS, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, item_guid, itemEntry, owner_guid FROM mail_items mi JOIN item_instance ii ON mi.item_guid = ii.guid WHERE mail_id = ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_AUCTION_ITEMS, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, itemguid, itemEntry FROM auctionhouse ah JOIN item_instance ii ON ah.itemguid = ii.guid", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_INS_AUCTION, "INSERT INTO auctionhouse (id, auctioneerguid, itemguid, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_AUCTION, "DELETE FROM auctionhouse WHERE id = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_ADD_MAIL, "INSERT INTO mail(id, messageType, stationery, mailTemplateId, sender, receiver, subject, body, has_items, expire_time, deliver_time, money, cod, checked) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_MAIL, "INSERT INTO mail(id, messageType, stationery, mailTemplateId, sender, receiver, subject, body, has_items, expire_time, deliver_time, money, cod, checked) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_MAIL, "DELETE FROM mail WHERE id = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_ADD_MAIL_ITEM, "INSERT INTO mail_items(mail_id, item_guid, receiver) VALUES (?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_MAIL_ITEM, "INSERT INTO mail_items(mail_id, item_guid, receiver) VALUES (?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_DEL_MAIL_ITEM, "DELETE FROM mail_items WHERE item_guid = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_INVALID_MAIL_ITEM, "DELETE FROM mail_items WHERE item_guid = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_EMPTY_EXPIRED_MAIL, "DELETE FROM mail WHERE expire_time < ? AND has_items = 0 AND body = ''", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_GET_EXPIRED_MAIL, "SELECT id, messageType, sender, receiver, has_items, expire_time, cod, checked, mailTemplateId FROM mail WHERE expire_time < ?", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_GET_EXPIRED_MAIL_ITEMS, "SELECT item_guid, itemEntry, mail_id FROM mail_items mi INNER JOIN item_instance ii ON ii.guid = mi.item_guid LEFT JOIN mail mm ON mi.mail_id = mm.id WHERE mm.id IS NOT NULL AND mm.expire_time < ?", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_SET_MAIL_RETURNED, "UPDATE mail SET sender = ?, receiver = ?, expire_time = ?, deliver_time = ?, cod = 0, checked = ? WHERE id = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_MAIL_ITEM_RECEIVER, "UPDATE mail_items SET receiver = ? WHERE item_guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_ITEM_OWNER, "UPDATE item_instance SET owner_guid = ? WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_EXPIRED_MAIL, "SELECT id, messageType, sender, receiver, has_items, expire_time, cod, checked, mailTemplateId FROM mail WHERE expire_time < ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_EXPIRED_MAIL_ITEMS, "SELECT item_guid, itemEntry, mail_id FROM mail_items mi INNER JOIN item_instance ii ON ii.guid = mi.item_guid LEFT JOIN mail mm ON mi.mail_id = mm.id WHERE mm.id IS NOT NULL AND mm.expire_time < ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_UPD_MAIL_RETURNED, "UPDATE mail SET sender = ?, receiver = ?, expire_time = ?, deliver_time = ?, cod = 0, checked = ? WHERE id = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_MAIL_ITEM_RECEIVER, "UPDATE mail_items SET receiver = ? WHERE item_guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_ITEM_OWNER, "UPDATE item_instance SET owner_guid = ? WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_ITEM_REFUNDS, "SELECT player_guid, paidMoney, paidExtendedCost FROM item_refund_instance WHERE item_guid = ? AND player_guid = ? LIMIT 1", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_LOAD_ITEM_BOP_TRADE, "SELECT allowedPlayers FROM item_soulbound_trade_data WHERE itemGuid = ? LIMIT 1", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_ITEM_REFUNDS, "SELECT player_guid, paidMoney, paidExtendedCost FROM item_refund_instance WHERE item_guid = ? AND player_guid = ? LIMIT 1", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_ITEM_BOP_TRADE, "SELECT allowedPlayers FROM item_soulbound_trade_data WHERE itemGuid = ? LIMIT 1", CONNECTION_SYNCH)
PREPARE_STATEMENT(CHAR_DEL_ITEM_BOP_TRADE, "DELETE FROM item_soulbound_trade_data WHERE itemGuid = ? LIMIT 1", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_ADD_ITEM_BOP_TRADE, "INSERT INTO item_soulbound_trade_data VALUES (?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_ITEM_BOP_TRADE, "INSERT INTO item_soulbound_trade_data VALUES (?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_REP_INVENTORY_ITEM, "REPLACE INTO character_inventory (guid, bag, slot, item) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_INVENTORY_ITEM, "DELETE FROM character_inventory WHERE item = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_ADD_ITEM_INSTANCE, "REPLACE INTO item_instance (itemEntry, owner_guid, creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, guid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_UPDATE_ITEM_INSTANCE, "UPDATE item_instance SET itemEntry = ?, owner_guid = ?, creatorGuid = ?, giftCreatorGuid = ?, count = ?, duration = ?, charges = ?, flags = ?, enchantments = ?, randomPropertyId = ?, durability = ?, playedTime = ?, text = ? WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_UPDATE_ITEM_INSTANCE_ON_LOAD, "UPDATE item_instance SET duration = ?, flags = ?, durability = ? WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_REP_ITEM_INSTANCE, "REPLACE INTO item_instance (itemEntry, owner_guid, creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, guid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_ITEM_INSTANCE, "UPDATE item_instance SET itemEntry = ?, owner_guid = ?, creatorGuid = ?, giftCreatorGuid = ?, count = ?, duration = ?, charges = ?, flags = ?, enchantments = ?, randomPropertyId = ?, durability = ?, playedTime = ?, text = ? WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_ITEM_INSTANCE_ON_LOAD, "UPDATE item_instance SET duration = ?, flags = ?, durability = ? WHERE guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_ITEM_INSTANCE, "DELETE FROM item_instance WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_UPDATE_GIFT_OWNER, "UPDATE character_gifts SET guid = ? WHERE item_guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GIFT_OWNER, "UPDATE character_gifts SET guid = ? WHERE item_guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_GIFT, "DELETE FROM character_gifts WHERE item_guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_GET_ACCOUNT_BY_NAME, "SELECT account FROM characters WHERE name = ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_BY_NAME, "SELECT account FROM characters WHERE name = ?", CONNECTION_SYNCH)
PREPARE_STATEMENT(CHAR_DEL_ACCOUNT_INSTANCE_LOCK_TIMES, "DELETE FROM account_instance_times WHERE accountId = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_ADD_ACCOUNT_INSTANCE_LOCK_TIMES, "INSERT INTO account_instance_times (accountId, instanceId, releaseTime) VALUES (?, ?, ?)", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_NAME_CLASS, "SELECT name, class FROM characters WHERE guid = ?", CONNECTION_SYNCH);
- PREPARE_STATEMENT(CHAR_LOAD_MATCH_MAKER_RATING, "SELECT matchMakerRating FROM character_arena_stats WHERE guid = ? AND slot = ?", CONNECTION_SYNCH);
- PREPARE_STATEMENT(CHAR_GET_CHARACTER_COUNT, "SELECT account, COUNT(guid) FROM characters WHERE account = ? GROUP BY account", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_NAME, "UPDATE characters set name = ?, at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_INS_ACCOUNT_INSTANCE_LOCK_TIMES, "INSERT INTO account_instance_times (accountId, instanceId, releaseTime) VALUES (?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_NAME_CLASS, "SELECT name, class FROM characters WHERE guid = ?", CONNECTION_SYNCH);
+ PREPARE_STATEMENT(CHAR_SEL_MATCH_MAKER_RATING, "SELECT matchMakerRating FROM character_arena_stats WHERE guid = ? AND slot = ?", CONNECTION_SYNCH);
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_COUNT, "SELECT account, COUNT(guid) FROM characters WHERE account = ? GROUP BY account", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_NAME, "UPDATE characters set name = ?, at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_DECLINED_NAME, "DELETE FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC);
// Guild handling
// 0: uint32, 1: string, 2: uint32, 3: string, 4: string, 5: uint64, 6-10: uint32, 11: uint64
- PREPARE_STATEMENT(CHAR_ADD_GUILD, "INSERT INTO guild (guildid, name, leaderguid, info, motd, createdate, EmblemStyle, EmblemColor, BorderStyle, BorderColor, BackgroundColor, BankMoney) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_GUILD, "INSERT INTO guild (guildid, name, leaderguid, info, motd, createdate, EmblemStyle, EmblemColor, BorderStyle, BorderColor, BackgroundColor, BankMoney) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_GUILD, "DELETE FROM guild WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32
// 0: uint32, 1: uint32, 2: uint8, 4: string, 5: string
- PREPARE_STATEMENT(CHAR_ADD_GUILD_MEMBER, "INSERT INTO guild_member (guildid, guid, rank, pnote, offnote) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_GUILD_MEMBER, "INSERT INTO guild_member (guildid, guid, rank, pnote, offnote) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_GUILD_MEMBER, "DELETE FROM guild_member WHERE guid = ?", CONNECTION_ASYNC) // 0: uint32
PREPARE_STATEMENT(CHAR_DEL_GUILD_MEMBERS, "DELETE FROM guild_member WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32
// 0: uint32, 1: uint8, 3: string, 4: uint32
- PREPARE_STATEMENT(CHAR_ADD_GUILD_RANK, "INSERT INTO guild_rank (guildid, rid, rname, rights) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_GUILD_RANK, "INSERT INTO guild_rank (guildid, rid, rname, rights) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_GUILD_RANKS, "DELETE FROM guild_rank WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32
PREPARE_STATEMENT(CHAR_DEL_GUILD_LOWEST_RANK, "DELETE FROM guild_rank WHERE guildid = ? AND rid >= ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8
- PREPARE_STATEMENT(CHAR_ADD_GUILD_BANK_TAB, "INSERT INTO guild_bank_tab (guildid, TabId) VALUES (?, ?)", CONNECTION_ASYNC) // 0: uint32, 1: uint8
+ PREPARE_STATEMENT(CHAR_INS_GUILD_BANK_TAB, "INSERT INTO guild_bank_tab (guildid, TabId) VALUES (?, ?)", CONNECTION_ASYNC) // 0: uint32, 1: uint8
PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_TAB, "DELETE FROM guild_bank_tab WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8
PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_TABS, "DELETE FROM guild_bank_tab WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32
// 0: uint32, 1: uint8, 2: uint8, 3: uint32, 4: uint32
- PREPARE_STATEMENT(CHAR_ADD_GUILD_BANK_ITEM, "INSERT INTO guild_bank_item (guildid, TabId, SlotId, item_guid) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_GUILD_BANK_ITEM, "INSERT INTO guild_bank_item (guildid, TabId, SlotId, item_guid) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_ITEM, "DELETE FROM guild_bank_item WHERE guildid = ? AND TabId = ? AND SlotId = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint8
PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_ITEMS, "DELETE FROM guild_bank_item WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32
- PREPARE_STATEMENT(CHAR_ADD_GUILD_BANK_RIGHT_DEFAULT, "INSERT INTO guild_bank_right (guildid, TabId, rid) VALUES (?, ?, ?)", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint8
+ PREPARE_STATEMENT(CHAR_INS_GUILD_BANK_RIGHT_DEFAULT, "INSERT INTO guild_bank_right (guildid, TabId, rid) VALUES (?, ?, ?)", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint8
// 0: uint32, 1: uint8, 2: uint8, 3: uint8, 4: uint32
- PREPARE_STATEMENT(CHAR_ADD_GUILD_BANK_RIGHT, "INSERT INTO guild_bank_right (guildid, TabId, rid, gbright, SlotPerDay) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_GUILD_BANK_RIGHT, "INSERT INTO guild_bank_right (guildid, TabId, rid, gbright, SlotPerDay) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_RIGHT, "DELETE FROM guild_bank_right WHERE guildid = ? AND TabId = ? AND rid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint8
PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_RIGHTS, "DELETE FROM guild_bank_right WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32
PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_RIGHTS_FOR_RANK, "DELETE FROM guild_bank_right WHERE guildid = ? AND rid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8
// 0-1: uint32, 2-3: uint8, 4-5: uint32, 6: uint16, 7: uint8, 8: uint64
- PREPARE_STATEMENT(CHAR_ADD_GUILD_BANK_EVENTLOG, "INSERT INTO guild_bank_eventlog (guildid, LogGuid, TabId, EventType, PlayerGuid, ItemOrMoney, ItemStackCount, DestTabId, TimeStamp) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_GUILD_BANK_EVENTLOG, "INSERT INTO guild_bank_eventlog (guildid, LogGuid, TabId, EventType, PlayerGuid, ItemOrMoney, ItemStackCount, DestTabId, TimeStamp) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_EVENTLOG, "DELETE FROM guild_bank_eventlog WHERE guildid = ? AND LogGuid = ? AND TabId = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint32, 2: uint8
PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_EVENTLOGS, "DELETE FROM guild_bank_eventlog WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32
// 0-1: uint32, 2: uint8, 3-4: uint32, 5: uint8, 6: uint64
- PREPARE_STATEMENT(CHAR_ADD_GUILD_EVENTLOG, "INSERT INTO guild_eventlog (guildid, LogGuid, EventType, PlayerGuid1, PlayerGuid2, NewRank, TimeStamp) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_GUILD_EVENTLOG, "INSERT INTO guild_eventlog (guildid, LogGuid, EventType, PlayerGuid1, PlayerGuid2, NewRank, TimeStamp) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_GUILD_EVENTLOG, "DELETE FROM guild_eventlog WHERE guildid = ? AND LogGuid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint32
PREPARE_STATEMENT(CHAR_DEL_GUILD_EVENTLOGS, "DELETE FROM guild_eventlog WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_PNOTE, "UPDATE guild_member SET pnote = ? WHERE guid = ?", CONNECTION_ASYNC) // 0: string, 1: uint32
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_OFFNOTE, "UPDATE guild_member SET offnote = ? WHERE guid = ?", CONNECTION_ASYNC) // 0: string, 1: uint32
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_RANK, "UPDATE guild_member SET rank = ? WHERE guid = ?", CONNECTION_ASYNC) // 0: uint8, 1: uint32
- PREPARE_STATEMENT(CHAR_SET_GUILD_MOTD, "UPDATE guild SET motd = ? WHERE guildid = ?", CONNECTION_ASYNC) // 0: string, 1: uint32
- PREPARE_STATEMENT(CHAR_SET_GUILD_INFO, "UPDATE guild SET info = ? WHERE guildid = ?", CONNECTION_ASYNC) // 0: string, 1: uint32
- PREPARE_STATEMENT(CHAR_SET_GUILD_LEADER, "UPDATE guild SET leaderguid = ? WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint32
- PREPARE_STATEMENT(CHAR_SET_GUILD_RANK_NAME, "UPDATE guild_rank SET rname = ? WHERE rid = ? AND guildid = ?", CONNECTION_ASYNC) // 0: string, 1: uint8, 2: uint32
- PREPARE_STATEMENT(CHAR_SET_GUILD_RANK_RIGHTS, "UPDATE guild_rank SET rights = ? WHERE rid = ? AND guildid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint32
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_PNOTE, "UPDATE guild_member SET pnote = ? WHERE guid = ?", CONNECTION_ASYNC) // 0: string, 1: uint32
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_OFFNOTE, "UPDATE guild_member SET offnote = ? WHERE guid = ?", CONNECTION_ASYNC) // 0: string, 1: uint32
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_RANK, "UPDATE guild_member SET rank = ? WHERE guid = ?", CONNECTION_ASYNC) // 0: uint8, 1: uint32
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MOTD, "UPDATE guild SET motd = ? WHERE guildid = ?", CONNECTION_ASYNC) // 0: string, 1: uint32
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_INFO, "UPDATE guild SET info = ? WHERE guildid = ?", CONNECTION_ASYNC) // 0: string, 1: uint32
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_LEADER, "UPDATE guild SET leaderguid = ? WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint32
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_NAME, "UPDATE guild_rank SET rname = ? WHERE rid = ? AND guildid = ?", CONNECTION_ASYNC) // 0: string, 1: uint8, 2: uint32
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_RIGHTS, "UPDATE guild_rank SET rights = ? WHERE rid = ? AND guildid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint32
// 0-5: uint32
- PREPARE_STATEMENT(CHAR_SET_GUILD_EMBLEM_INFO, "UPDATE guild SET EmblemStyle = ?, EmblemColor = ?, BorderStyle = ?, BorderColor = ?, BackgroundColor = ? WHERE guildid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_EMBLEM_INFO, "UPDATE guild SET EmblemStyle = ?, EmblemColor = ?, BorderStyle = ?, BorderColor = ?, BackgroundColor = ? WHERE guildid = ?", CONNECTION_ASYNC)
// 0: string, 1: string, 2: uint32, 3: uint8
- PREPARE_STATEMENT(CHAR_SET_GUILD_BANK_TAB_INFO, "UPDATE guild_bank_tab SET TabName = ?, TabIcon = ? WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_GUILD_BANK_MONEY, "UPDATE guild SET BankMoney = ? WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint64, 1: uint32
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_BANK_TAB_INFO, "UPDATE guild_bank_tab SET TabName = ?, TabIcon = ? WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_BANK_MONEY, "UPDATE guild SET BankMoney = ? WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint64, 1: uint32
// 0: uint8, 1: uint32, 2: uint8, 3: uint32
- PREPARE_STATEMENT(CHAR_SET_GUILD_BANK_EVENTLOG_TAB, "UPDATE guild_bank_eventlog SET TabId = ? WHERE guildid = ? AND TabId = ? AND LogGuid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_BANK_REM_MONEY, "UPDATE guild_member SET BankRemMoney = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint32, 2: uint32
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_BANK_TIME_MONEY, "UPDATE guild_member SET BankResetTimeMoney = ?, BankRemMoney = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint32, 2: uint32, 3: uint32
- PREPARE_STATEMENT(CHAR_RESET_GUILD_RANK_BANK_RESET_TIME, "UPDATE guild_member SET BankResetTimeMoney = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8
- PREPARE_STATEMENT(CHAR_SET_GUILD_RANK_BANK_MONEY, "UPDATE guild_rank SET BankMoneyPerDay = ? WHERE rid = ? AND guildid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint32
- PREPARE_STATEMENT(CHAR_SET_GUILD_BANK_TAB_TEXT, "UPDATE guild_bank_tab SET TabText = ? WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC) // 0: string, 1: uint32, 2: uint8
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_BANK_EVENTLOG_TAB, "UPDATE guild_bank_eventlog SET TabId = ? WHERE guildid = ? AND TabId = ? AND LogGuid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_MONEY, "UPDATE guild_member SET BankRemMoney = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint32, 2: uint32
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_MONEY, "UPDATE guild_member SET BankResetTimeMoney = ?, BankRemMoney = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint32, 2: uint32, 3: uint32
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_RESET_TIME, "UPDATE guild_member SET BankResetTimeMoney = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_MONEY, "UPDATE guild_rank SET BankMoneyPerDay = ? WHERE rid = ? AND guildid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint32
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_BANK_TAB_TEXT, "UPDATE guild_bank_tab SET TabText = ? WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC) // 0: string, 1: uint32, 2: uint8
// 0: uint32, 1: uint32, 2: uint32
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_BANK_REM_SLOTS0, "UPDATE guild_member SET BankRemSlotsTab0 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_BANK_REM_SLOTS1, "UPDATE guild_member SET BankRemSlotsTab1 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_BANK_REM_SLOTS2, "UPDATE guild_member SET BankRemSlotsTab2 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_BANK_REM_SLOTS3, "UPDATE guild_member SET BankRemSlotsTab3 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_BANK_REM_SLOTS4, "UPDATE guild_member SET BankRemSlotsTab4 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_BANK_REM_SLOTS5, "UPDATE guild_member SET BankRemSlotsTab5 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS0, "UPDATE guild_member SET BankRemSlotsTab0 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS1, "UPDATE guild_member SET BankRemSlotsTab1 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS2, "UPDATE guild_member SET BankRemSlotsTab2 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS3, "UPDATE guild_member SET BankRemSlotsTab3 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS4, "UPDATE guild_member SET BankRemSlotsTab4 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS5, "UPDATE guild_member SET BankRemSlotsTab5 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
// 0: uint32, 1: uint32, 2: uint32, 3: uint32
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_BANK_TIME_REM_SLOTS0, "UPDATE guild_member SET BankResetTimeTab0 = ?, BankRemSlotsTab0 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_BANK_TIME_REM_SLOTS1, "UPDATE guild_member SET BankResetTimeTab1 = ?, BankRemSlotsTab1 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_BANK_TIME_REM_SLOTS2, "UPDATE guild_member SET BankResetTimeTab2 = ?, BankRemSlotsTab2 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_BANK_TIME_REM_SLOTS3, "UPDATE guild_member SET BankResetTimeTab3 = ?, BankRemSlotsTab3 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_BANK_TIME_REM_SLOTS4, "UPDATE guild_member SET BankResetTimeTab4 = ?, BankRemSlotsTab4 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_GUILD_MEMBER_BANK_TIME_REM_SLOTS5, "UPDATE guild_member SET BankResetTimeTab5 = ?, BankRemSlotsTab5 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS0, "UPDATE guild_member SET BankResetTimeTab0 = ?, BankRemSlotsTab0 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS1, "UPDATE guild_member SET BankResetTimeTab1 = ?, BankRemSlotsTab1 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS2, "UPDATE guild_member SET BankResetTimeTab2 = ?, BankRemSlotsTab2 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS3, "UPDATE guild_member SET BankResetTimeTab3 = ?, BankRemSlotsTab3 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS4, "UPDATE guild_member SET BankResetTimeTab4 = ?, BankRemSlotsTab4 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS5, "UPDATE guild_member SET BankResetTimeTab5 = ?, BankRemSlotsTab5 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
// 0: uint32, 1: uint8
- PREPARE_STATEMENT(CHAR_RESET_GUILD_RANK_BANK_TIME0, "UPDATE guild_member SET BankResetTimeTab0 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_RESET_GUILD_RANK_BANK_TIME1, "UPDATE guild_member SET BankResetTimeTab1 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_RESET_GUILD_RANK_BANK_TIME2, "UPDATE guild_member SET BankResetTimeTab2 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_RESET_GUILD_RANK_BANK_TIME3, "UPDATE guild_member SET BankResetTimeTab3 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_RESET_GUILD_RANK_BANK_TIME4, "UPDATE guild_member SET BankResetTimeTab4 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_RESET_GUILD_RANK_BANK_TIME5, "UPDATE guild_member SET BankResetTimeTab5 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_CHAR_DATA_FOR_GUILD, "SELECT name, level, class, zone, account FROM characters WHERE guid = ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME0, "UPDATE guild_member SET BankResetTimeTab0 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME1, "UPDATE guild_member SET BankResetTimeTab1 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME2, "UPDATE guild_member SET BankResetTimeTab2 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME3, "UPDATE guild_member SET BankResetTimeTab3 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME4, "UPDATE guild_member SET BankResetTimeTab4 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME5, "UPDATE guild_member SET BankResetTimeTab5 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHAR_DATA_FOR_GUILD, "SELECT name, level, class, zone, account FROM characters WHERE guid = ?", CONNECTION_SYNCH)
// Chat channel handling
- PREPARE_STATEMENT(CHAR_LOAD_CHANNEL, "SELECT announce, ownership, password, bannedList FROM channels WHERE name = ? AND team = ?", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_ADD_CHANNEL, "INSERT INTO channels(name, team, lastUsed) VALUES (?, ?, UNIX_TIMESTAMP())", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_CHANNEL, "UPDATE channels SET announce = ?, ownership = ?, password = ?, bannedList = ?, lastUsed = UNIX_TIMESTAMP() WHERE name = ? AND team = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_CHANNEL_USAGE, "UPDATE channels SET lastUsed = UNIX_TIMESTAMP() WHERE name = ? AND team = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_CHANNEL_OWNERSHIP, "UPDATE channels SET ownership = ? WHERE name LIKE ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CHANNEL, "SELECT announce, ownership, password, bannedList FROM channels WHERE name = ? AND team = ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_INS_CHANNEL, "INSERT INTO channels(name, team, lastUsed) VALUES (?, ?, UNIX_TIMESTAMP())", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_CHANNEL, "UPDATE channels SET announce = ?, ownership = ?, password = ?, bannedList = ?, lastUsed = UNIX_TIMESTAMP() WHERE name = ? AND team = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_CHANNEL_USAGE, "UPDATE channels SET lastUsed = UNIX_TIMESTAMP() WHERE name = ? AND team = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_CHANNEL_OWNERSHIP, "UPDATE channels SET ownership = ? WHERE name LIKE ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_OLD_CHANNELS, "DELETE FROM channels WHERE ownership = 1 AND lastUsed + ? < UNIX_TIMESTAMP()", CONNECTION_ASYNC)
// Equipmentsets
- PREPARE_STATEMENT(CHAR_SET_EQUIP_SET, "UPDATE character_equipmentsets SET name=?, iconname=?, item0=?, item1=?, item2=?, item3=?, item4=?, item5=?, item6=?, item7=?, item8=?, item9=?, item10=?, item11=?, item12=?, item13=?, item14=?, item15=?, item16=?, item17=?, item18=? WHERE guid=? AND setguid=? AND setindex=?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_ADD_EQUIP_SET, "INSERT INTO character_equipmentsets (guid, setguid, setindex, name, iconname, item0, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_EQUIP_SET, "UPDATE character_equipmentsets SET name=?, iconname=?, item0=?, item1=?, item2=?, item3=?, item4=?, item5=?, item6=?, item7=?, item8=?, item9=?, item10=?, item11=?, item12=?, item13=?, item14=?, item15=?, item16=?, item17=?, item18=? WHERE guid=? AND setguid=? AND setindex=?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_EQUIP_SET, "INSERT INTO character_equipmentsets (guid, setguid, setindex, name, iconname, item0, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_EQUIP_SET, "DELETE FROM character_equipmentsets WHERE setguid=?", CONNECTION_ASYNC)
// Auras
PREPARE_STATEMENT(CHAR_DEL_AURA, "DELETE FROM character_aura WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_ADD_AURA, "INSERT INTO character_aura (guid, caster_guid, item_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) "
+ PREPARE_STATEMENT(CHAR_INS_AURA, "INSERT INTO character_aura (guid, caster_guid, item_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) "
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
// Account data
- PREPARE_STATEMENT(CHAR_LOAD_ACCOUNT_DATA, "SELECT type, time, data FROM account_data WHERE accountId = ?", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_SET_ACCOUNT_DATA, "REPLACE INTO account_data(accountId, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_DATA, "SELECT type, time, data FROM account_data WHERE accountId = ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_REP_ACCOUNT_DATA, "REPLACE INTO account_data(accountId, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_ACCOUNT_DATA, "DELETE FROM account_data WHERE accountId = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_ACCOUNT_DATA, "SELECT type, time, data FROM character_account_data WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_PLAYER_ACCOUNT_DATA, "REPLACE INTO character_account_data(guid, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_PLAYER_ACCOUNT_DATA, "SELECT type, time, data FROM character_account_data WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_REP_PLAYER_ACCOUNT_DATA, "REPLACE INTO character_account_data(guid, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_PLAYER_ACCOUNT_DATA, "DELETE FROM character_account_data WHERE guid = ?", CONNECTION_ASYNC)
// Tutorials
- PREPARE_STATEMENT(CHAR_LOAD_TUTORIALS, "SELECT tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7 FROM account_tutorial WHERE accountId = ?", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_GET_HAS_TUTORIALS, "SELECT 1 FROM account_tutorial WHERE accountId = ?", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_ADD_TUTORIALS, "INSERT INTO account_tutorial(tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7, accountId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_TUTORIALS, "UPDATE account_tutorial SET tut0 = ?, tut1 = ?, tut2 = ?, tut3 = ?, tut4 = ?, tut5 = ?, tut6 = ?, tut7 = ? WHERE accountId = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_TUTORIALS, "SELECT tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7 FROM account_tutorial WHERE accountId = ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_HAS_TUTORIALS, "SELECT 1 FROM account_tutorial WHERE accountId = ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_INS_TUTORIALS, "INSERT INTO account_tutorial(tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7, accountId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_TUTORIALS, "UPDATE account_tutorial SET tut0 = ?, tut1 = ?, tut2 = ?, tut3 = ?, tut4 = ?, tut5 = ?, tut6 = ?, tut7 = ? WHERE accountId = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_TUTORIALS, "DELETE FROM account_tutorial WHERE accountId = ?", CONNECTION_ASYNC)
// Instance saves
- PREPARE_STATEMENT(CHAR_ADD_INSTANCE_SAVE, "INSERT INTO instance (id, map, resettime, difficulty, completedEncounters, data) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_UPDATE_INSTANCE_DATA, "UPDATE instance SET completedEncounters=?, data=? WHERE id=?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_INSTANCE_SAVE, "INSERT INTO instance (id, map, resettime, difficulty, completedEncounters, data) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_INSTANCE_DATA, "UPDATE instance SET completedEncounters=?, data=? WHERE id=?", CONNECTION_ASYNC)
// Game event saves
PREPARE_STATEMENT(CHAR_DEL_GAME_EVENT_SAVE, "DELETE FROM game_event_save WHERE eventEntry = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_ADD_GAME_EVENT_SAVE, "INSERT INTO game_event_save (eventEntry, state, next_start) VALUES (?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_GAME_EVENT_SAVE, "INSERT INTO game_event_save (eventEntry, state, next_start) VALUES (?, ?, ?)", CONNECTION_ASYNC)
// Game event condition saves
PREPARE_STATEMENT(CHAR_DEL_ALL_GAME_EVENT_CONDITION_SAVE, "DELETE FROM game_event_condition_save WHERE eventEntry = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_GAME_EVENT_CONDITION_SAVE, "DELETE FROM game_event_condition_save WHERE eventEntry = ? AND condition_id = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_ADD_GAME_EVENT_CONDITION_SAVE, "INSERT INTO game_event_condition_save (eventEntry, condition_id, done) VALUES (?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_GAME_EVENT_CONDITION_SAVE, "INSERT INTO game_event_condition_save (eventEntry, condition_id, done) VALUES (?, ?, ?)", CONNECTION_ASYNC)
// Petitions
- PREPARE_STATEMENT(CHAR_LOAD_PETITION, "SELECT ownerguid, name, type FROM petition WHERE petitionguid = ?", CONNECTION_SYNCH);
- PREPARE_STATEMENT(CHAR_LOAD_PETITION_SIGNATURE, "SELECT playerguid FROM petition_sign WHERE petitionguid = ?", CONNECTION_SYNCH);
+ PREPARE_STATEMENT(CHAR_SEL_PETITION, "SELECT ownerguid, name, type FROM petition WHERE petitionguid = ?", CONNECTION_SYNCH);
+ PREPARE_STATEMENT(CHAR_SEL_PETITION_SIGNATURE, "SELECT playerguid FROM petition_sign WHERE petitionguid = ?", CONNECTION_SYNCH);
+ PREPARE_STATEMENT(CHAR_DEL_ALL_PETITION_SIGNATURES, "DELETE FROM petition_sign WHERE playerguid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE, "DELETE FROM petition_sign WHERE playerguid = ? AND type = ?", CONNECTION_ASYNC);
// Arena teams
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_ARENAINFO, "SELECT arenaTeamId, weekGames, seasonGames, seasonWins, personalRating FROM arena_team_member WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_ADD_ARENA_TEAM, "INSERT INTO arena_team (arenaTeamId, name, captainGuid, type, rating, backgroundColor, emblemStyle, emblemColor, borderStyle, borderColor) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_SET_ARENA_TEAM_MEMBER, "INSERT INTO arena_team_member (arenaTeamId, guid) VALUES (?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_SEL_CHARACTER_ARENAINFO, "SELECT arenaTeamId, weekGames, seasonGames, seasonWins, personalRating FROM arena_team_member WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_ARENA_TEAM, "INSERT INTO arena_team (arenaTeamId, name, captainGuid, type, rating, backgroundColor, emblemStyle, emblemColor, borderStyle, borderColor) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_INS_ARENA_TEAM_MEMBER, "INSERT INTO arena_team_member (arenaTeamId, guid) VALUES (?, ?)", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_ARENA_TEAM, "DELETE FROM arena_team where arenaTeamId = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_ARENA_TEAM_MEMBERS, "DELETE FROM arena_team_member WHERE arenaTeamId = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_ARENA_TEAM_CAPTAIN, "UPDATE arena_team SET captainGuid = ? WHERE arenaTeamId = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_ARENA_TEAM_CAPTAIN, "UPDATE arena_team SET captainGuid = ? WHERE arenaTeamId = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_ARENA_TEAM_MEMBER, "DELETE FROM arena_team_member WHERE arenaTeamId = ? AND guid = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_ARENA_TEAM_STATS, "UPDATE arena_team SET rating = ?, weekGames = ?, weekWins = ?, seasonGames = ?, seasonWins = ?, rank = ? WHERE arenaTeamId = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_ARENA_TEAM_MEMBER, "UPDATE arena_team_member SET personalRating = ?, weekGames = ?, weekWins = ?, seasonGames = ?, seasonWins = ? WHERE arenaTeamId = ? AND guid = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_CHARACTER_ARENA_STATS, "REPLACE INTO character_arena_stats (guid, slot, matchMakerRating) VALUES (?, ?, ?)", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_LOAD_PLAYER_ARENA_TEAMS, "SELECT arena_team_member.arenaTeamId FROM arena_team_member JOIN arena_team ON arena_team_member.arenaTeamId = arena_team.arenaTeamId WHERE guid = ?", CONNECTION_SYNCH);
+ PREPARE_STATEMENT(CHAR_UPD_ARENA_TEAM_STATS, "UPDATE arena_team SET rating = ?, weekGames = ?, weekWins = ?, seasonGames = ?, seasonWins = ?, rank = ? WHERE arenaTeamId = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_ARENA_TEAM_MEMBER, "UPDATE arena_team_member SET personalRating = ?, weekGames = ?, weekWins = ?, seasonGames = ?, seasonWins = ? WHERE arenaTeamId = ? AND guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_REP_CHARACTER_ARENA_STATS, "REPLACE INTO character_arena_stats (guid, slot, matchMakerRating) VALUES (?, ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_SEL_PLAYER_ARENA_TEAMS, "SELECT arena_team_member.arenaTeamId FROM arena_team_member JOIN arena_team ON arena_team_member.arenaTeamId = arena_team.arenaTeamId WHERE guid = ?", CONNECTION_SYNCH);
// Character battleground data
- PREPARE_STATEMENT(CHAR_ADD_PLAYER_BGDATA, "INSERT INTO character_battleground_data (guid, instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_PLAYER_BGDATA, "INSERT INTO character_battleground_data (guid, instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_PLAYER_BGDATA, "DELETE FROM character_battleground_data WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_RESET_PLAYERS_BGDATA, "UPDATE character_battleground_data SET instanceId = 0", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_UPD_PLAYERS_BGDATA, "UPDATE character_battleground_data SET instanceId = 0", CONNECTION_SYNCH)
// Character homebind
- PREPARE_STATEMENT(CHAR_ADD_PLAYER_HOMEBIND, "INSERT INTO character_homebind (guid, mapId, zoneId, posX, posY, posZ) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_SET_PLAYER_HOMEBIND, "UPDATE character_homebind SET mapId = ?, zoneId = ?, posX = ?, posY = ?, posZ = ? WHERE guid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_PLAYER_HOMEBIND, "INSERT INTO character_homebind (guid, mapId, zoneId, posX, posY, posZ) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_UPD_PLAYER_HOMEBIND, "UPDATE character_homebind SET mapId = ?, zoneId = ?, posX = ?, posY = ?, posZ = ? WHERE guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_PLAYER_HOMEBIND, "DELETE FROM character_homebind WHERE guid = ?", CONNECTION_ASYNC)
// Corpse
- PREPARE_STATEMENT(CHAR_LOAD_CORPSES, "SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, guildId, flags, dynFlags, time, corpseType, instanceId, phaseMask, corpseGuid, guid FROM corpse WHERE corpseType <> 0", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_ADD_CORPSE, "INSERT INTO corpse (corpseGuid, guid, posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, guildId, flags, dynFlags, time, corpseType, instanceId, phaseMask) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CORPSES, "SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, guildId, flags, dynFlags, time, corpseType, instanceId, phaseMask, corpseGuid, guid FROM corpse WHERE corpseType <> 0", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_INS_CORPSE, "INSERT INTO corpse (corpseGuid, guid, posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, guildId, flags, dynFlags, time, corpseType, instanceId, phaseMask) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_CORPSE, "DELETE FROM corpse WHERE corpseGuid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_PLAYER_CORPSES, "DELETE FROM corpse WHERE guid = ? AND corpseType <> 0", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_OLD_CORPSES, "DELETE FROM corpse WHERE corpseType = 0 OR time < (UNIX_TIMESTAMP(NOW()) - ?)", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_RESET_NONEXISTENT_INSTANCE_FOR_CORPSES, "UPDATE corpse SET instanceId = 0 WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_UPD_NONEXISTENT_INSTANCE_FOR_CORPSES, "UPDATE corpse SET instanceId = 0 WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)", CONNECTION_SYNCH)
// Creature respawn
- PREPARE_STATEMENT(CHAR_LOAD_CREATURE_RESPAWNS, "SELECT guid, respawnTime, instanceId FROM creature_respawn", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_ADD_CREATURE_RESPAWN, "REPLACE INTO creature_respawn (guid, respawnTime, instanceId) VALUES (?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_CREATURE_RESPAWNS, "SELECT guid, respawnTime, instanceId FROM creature_respawn", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_REP_CREATURE_RESPAWN, "REPLACE INTO creature_respawn (guid, respawnTime, instanceId) VALUES (?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN, "DELETE FROM creature_respawn WHERE guid = ? AND instanceId = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN_BY_GUID, "DELETE FROM creature_respawn WHERE guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE, "DELETE FROM creature_respawn WHERE instanceId = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_GET_MAX_CREATURE_RESPAWNS, "SELECT MAX(respawnTime), instanceId FROM creature_respawn WHERE instanceId > 0 GROUP BY instanceId", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_INSTANCE_CREATURE_RESPAWNS, "DELETE FROM creature_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT instanceId FROM instance)", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_MAX_CREATURE_RESPAWNS, "SELECT MAX(respawnTime), instanceId FROM creature_respawn WHERE instanceId > 0 GROUP BY instanceId", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_INSTANCE_CREATURE_RESPAWNS, "DELETE FROM creature_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)", CONNECTION_SYNCH)
// Gameobject respawn
- PREPARE_STATEMENT(CHAR_LOAD_GO_RESPAWNS, "SELECT guid, respawnTime, instanceId FROM gameobject_respawn", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_ADD_GO_RESPAWN, "REPLACE INTO gameobject_respawn (guid, respawnTime, instanceId) VALUES (?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_GO_RESPAWNS, "SELECT guid, respawnTime, instanceId FROM gameobject_respawn", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_REP_GO_RESPAWN, "REPLACE INTO gameobject_respawn (guid, respawnTime, instanceId) VALUES (?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_GO_RESPAWN, "DELETE FROM gameobject_respawn WHERE guid = ? AND instanceId = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_GO_RESPAWN_BY_INSTANCE, "DELETE FROM gameobject_respawn WHERE instanceId = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_EXPIRED_GO_RESPAWNS, "DELETE FROM gameobject_respawn WHERE respawnTime <= UNIX_TIMESTAMP(NOW())", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_INSTANCE_GO_RESPAWNS, "DELETE FROM gameobject_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT instanceId FROM instance)", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_INSTANCE_GO_RESPAWNS, "DELETE FROM gameobject_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)", CONNECTION_SYNCH)
// GM Tickets
- PREPARE_STATEMENT(CHAR_LOAD_GM_TICKETS, "SELECT ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed FROM gm_tickets", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_ADD_GM_TICKET, "REPLACE INTO gm_tickets (ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_SEL_GM_TICKETS, "SELECT ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed FROM gm_tickets", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_REP_GM_TICKET, "REPLACE INTO gm_tickets (ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_GM_TICKET, "DELETE FROM gm_tickets WHERE ticketId = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_PLAYER_GM_TICKETS, "DELETE FROM gm_tickets WHERE guid = ?", CONNECTION_ASYNC)
// GM Survey/subsurvey/lag report
- PREPARE_STATEMENT(CHAR_ADD_GM_SURVEY, "INSERT INTO gm_surveys (guid, surveyId, mainSurvey, overallComment, createTime) VALUES (?, ?, ?, ?, UNIX_TIMESTAMP(NOW()))", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_ADD_GM_SUBSURVEY, "INSERT INTO gm_subsurveys (surveyId, subsurveyId, rank, comment) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC)
- PREPARE_STATEMENT(CHAR_ADD_LAG_REPORT, "INSERT INTO lag_reports (guid, lagType, mapId, posX, posY, posZ) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_GM_SURVEY, "INSERT INTO gm_surveys (guid, surveyId, mainSurvey, overallComment, createTime) VALUES (?, ?, ?, ?, UNIX_TIMESTAMP(NOW()))", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_GM_SUBSURVEY, "INSERT INTO gm_subsurveys (surveyId, subsurveyId, rank, comment) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_INS_LAG_REPORT, "INSERT INTO lag_reports (guid, lagType, mapId, posX, posY, posZ) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
// For loading and deleting expired auctions at startup
- PREPARE_STATEMENT(CHAR_LOAD_EXPIRED_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE ah.time <= ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(CHAR_SEL_EXPIRED_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE ah.time <= ?", CONNECTION_SYNCH)
+
+ // LFG Data
+ PREPARE_STATEMENT(CHAR_INS_LFG_DATA, "INSERT INTO lfg_data (guid, dungeon, state) VALUES (?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_DEL_LFG_DATA, "DELETE FROM lfg_data WHERE guid = ?", CONNECTION_ASYNC)
// Player saving
- PREPARE_STATEMENT(CHAR_ADD_CHARACTER, "INSERT INTO characters (guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, "
+ PREPARE_STATEMENT(CHAR_INS_CHARACTER, "INSERT INTO characters (guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, "
"map, instance_id, instance_mode_mask, position_x, position_y, position_z, orientation, "
"taximask, cinematic, "
"totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, "
@@ -331,34 +347,52 @@ void CharacterDatabaseConnection::DoPrepareStatements()
"watchedFaction=?,drunk=?,health=?,power1=?,power2=?,power3=?,power4=?,power5=?,power6=?,power7=?,latency=?,speccount=?,activespec=?,exploredZones=?,"
"equipmentCache=?,ammoId=?,knownTitles=?,actionBars=?,grantableLevels=?,online=? WHERE guid=?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_AT_LOGIN_FLAG, "UPDATE characters SET at_login = at_login | ? WHERE guid = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_ALL_AT_LOGIN_FLAGS, "UPDATE characters SET at_login = at_login | ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_ADD_BUG_REPORT, "INSERT INTO bugreport (type, content) VALUES(?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_ADD_AT_LOGIN_FLAG, "UPDATE characters SET at_login = at_login | ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_REM_AT_LOGIN_FLAG, "UPDATE characters set at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_ALL_AT_LOGIN_FLAGS, "UPDATE characters SET at_login = at_login | ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_INS_BUG_REPORT, "INSERT INTO bugreport (type, content) VALUES(?, ?)", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_UPD_PETITION_NAME, "UPDATE petition SET name = ? WHERE petitionguid = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_ADD_PETITION_SIGNATURE, "INSERT INTO petition_sign (ownerguid, petitionguid, playerguid, player_account) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_INS_PETITION_SIGNATURE, "INSERT INTO petition_sign (ownerguid, petitionguid, playerguid, player_account) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_UPD_ACCOUNT_ONLINE, "UPDATE characters SET online = 0 WHERE account = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_ADD_GROUP, "INSERT INTO groups (guid, leaderGuid, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, groupType, difficulty, raiddifficulty) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_ADD_GROUP_MEMBER, "INSERT INTO group_member (guid, memberGuid, memberFlags, subgroup, roles) VALUES(?, ?, ?, ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_INS_GROUP, "INSERT INTO groups (guid, leaderGuid, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, groupType, difficulty, raiddifficulty) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_INS_GROUP_MEMBER, "INSERT INTO group_member (guid, memberGuid, memberFlags, subgroup, roles) VALUES(?, ?, ?, ?, ?)", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_GROUP_MEMBER, "DELETE FROM group_member WHERE memberGuid = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_GROUP_INSTANCE_PERM_BINDING, "DELETE FROM group_instance WHERE guid = ? AND (permanent = 1 OR instance IN (SELECT instance FROM character_instance WHERE guid = ?))", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_GROUP_LEADER, "UPDATE groups SET leaderGuid = ? WHERE guid = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_GROUP_TYPE, "UPDATE groups SET groupType = ? WHERE guid = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_GROUP_MEMBER_SUBGROUP, "UPDATE group_member SET subgroup = ? WHERE memberGuid = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_GROUP_MEMBER_FLAG, "UPDATE group_member SET memberFlags = ? WHERE memberGuid = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_GROUP_DIFFICULTY, "UPDATE groups SET difficulty = ? WHERE guid = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_GROUP_RAID_DIFFICULTY, "UPDATE groups SET raiddifficulty = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_GROUP_LEADER, "UPDATE groups SET leaderGuid = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_GROUP_TYPE, "UPDATE groups SET groupType = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_GROUP_MEMBER_SUBGROUP, "UPDATE group_member SET subgroup = ? WHERE memberGuid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_GROUP_MEMBER_FLAG, "UPDATE group_member SET memberFlags = ? WHERE memberGuid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_GROUP_DIFFICULTY, "UPDATE groups SET difficulty = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_GROUP_RAID_DIFFICULTY, "UPDATE groups SET raiddifficulty = ? WHERE guid = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_ALL_GM_TICKETS, "TRUNCATE TABLE gm_tickets", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_INVALID_SPELL, "DELETE FROM character_talent WHERE spell = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_DELETE_INFO, "UPDATE characters SET deleteInfos_Name = name, deleteInfos_Account = account, deleteDate = UNIX_TIMESTAMP(), name = '', account = 0 WHERE guid = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_ZONE, "UPDATE characters SET zone = ? WHERE guid = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_LEVEL, "UPDATE characters SET level = ?, xp = 0 WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_DELETE_INFO, "UPDATE characters SET deleteInfos_Name = name, deleteInfos_Account = account, deleteDate = UNIX_TIMESTAMP(), name = '', account = 0 WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UDP_RESTORE_DELETE_INFO, "UPDATE characters SET name = ?, account = ?, deleteDate = NULL, deleteInfos_Name = NULL, deleteInfos_Account = NULL WHERE deleteDate IS NOT NULL AND guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_ZONE, "UPDATE characters SET zone = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_LEVEL, "UPDATE characters SET level = ?, xp = 0 WHERE guid = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA, "DELETE FROM character_achievement_progress WHERE criteria = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_INVALID_ACHIEVMENT, "DELETE FROM character_achievement WHERE achievement = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_ADD_ADDON, "INSERT INTO addons (name, crc) VALUES (?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_INS_ADDON, "INSERT INTO addons (name, crc) VALUES (?, ?)", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_INVALID_PET_SPELL, "DELETE FROM pet_spell WHERE spell = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_GROUP_INSTANCE_BY_INSTANCE, "DELETE FROM group_instance WHERE instance = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(CHAR_DEL_GROUP_INSTANCE_BY_GUID, "DELETE FROM group_instance WHERE guid = ? AND instance = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_ADD_GROUP_INSTANCE, "REPLACE INTO group_instance (guid, instance, permanent) VALUES (?, ?, ?)", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_INSTANCE_RESETTIME, "UPDATE instance SET resettime = ? WHERE id = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(CHAR_UPDATE_GLOBAL_INSTANCE_RESETTIME, "UPDATE instance_reset SET resettime = ? WHERE mapid = ? AND difficulty = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_REP_GROUP_INSTANCE, "REPLACE INTO group_instance (guid, instance, permanent) VALUES (?, ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_INSTANCE_RESETTIME, "UPDATE instance SET resettime = ? WHERE id = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME, "UPDATE instance_reset SET resettime = ? WHERE mapid = ? AND difficulty = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_CHAR_ONLINE, "UPDATE characters SET online = 1 WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_CHAR_NAME_AT_LOGIN, "UPDATE characters set name = ?, at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_WORLDSTATE, "UPDATE worldstates SET value = ? WHERE entry = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_INS_WORLDSTATE, "INSERT INTO worldstates (entry, value) VALUES (?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE, "DELETE FROM character_instance WHERE guid = ? AND instance = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_CHAR_INSTANCE, "UPDATE character_instance SET instance = ?, permanent = ? WHERE guid = ? AND instance = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_INS_CHAR_INSTANCE, "INSERT INTO character_instance (guid, instance, permanent) VALUES (?, ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_GENDER_PLAYERBYTES, "UPDATE characters SET gender = ?, playerBytes = ?, playerBytes2 = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_DEL_CHARACTER_SKILL, "DELETE FROM character_skills WHERE guid = ? AND skill = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_ADD_CHARACTER_SOCIAL_FLAGS, "UPDATE character_social SET flags = flags | ? WHERE guid = ? AND friend = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_REM_CHARACTER_SOCIAL_FLAGS, "UPDATE character_social SET flags = flags & ~ ? WHERE guid = ? AND friend = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_INS_CHARACTER_SOCIAL, "INSERT INTO character_social (guid, friend, flags) VALUES (?, ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_DEL_CHARACTER_SOCIAL, "DELETE FROM character_social WHERE guid = ? AND friend = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_CHARACTER_SOCIAL_NOTE, "UPDATE character_social SET note = ? WHERE guid = ? AND friend = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(CHAR_UPD_CHARACTER_POSITION, "UPDATE characters SET position_x = ?, position_y = ?, position_z = ?, orientation = ?, map = ?, zone = ?, trans_x = 0, trans_y = 0, trans_z = 0, transguid = 0, taxi_path = '' WHERE guid = ?", CONNECTION_ASYNC);
+
}
diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h
index eea02ee60b9..18b488e055a 100755..100644
--- a/src/server/shared/Database/Implementation/CharacterDatabase.h
+++ b/src/server/shared/Database/Implementation/CharacterDatabase.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,291 +37,323 @@ typedef DatabaseWorkerPool<CharacterDatabaseConnection> CharacterDatabaseWorkerP
enum CharacterDatabaseStatements
{
/* Naming standard for defines:
- {DB}_{SET/DEL/ADD/REP}_{Summary of data changed}
+ {DB}_{SEL/INS/UPD/DEL/REP}_{Summary of data changed}
When updating more than one field, consider looking at the calling function
name for a suiting suffix.
*/
CHAR_DEL_QUEST_POOL_SAVE,
- CHAR_ADD_QUEST_POOL_SAVE,
+ CHAR_INS_QUEST_POOL_SAVE,
CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEM,
CHAR_DEL_EXPIRED_BANS,
- CHAR_GET_GUID_BY_NAME,
- CHAR_GET_CHECK_NAME,
- CHAR_GET_SUM_CHARS,
- CHAR_GET_CHAR_CREATE_INFO,
- CHAR_ADD_BAN,
- CHAR_SET_NOT_BANNED,
- CHAR_GET_BANINFO,
- CHAR_GET_GUID_BY_NAME_FILTER,
- CHAR_GET_BANINFO_LIST,
- CHAR_GET_BANNED_NAME,
- CHAR_GET_ENUM,
- CHAR_GET_ENUM_DECLINED_NAME,
- CHAR_GET_PET_SLOTS,
- CHAR_GET_PET_SLOTS_DETAIL,
- CHAR_GET_PET_ENTRY,
- CHAR_GET_PET_SLOT_BY_ID,
- CHAR_GET_FREE_NAME,
- CHAR_GET_GUID_RACE_ACC_BY_NAME,
+ CHAR_SEL_GUID_BY_NAME,
+ CHAR_SEL_CHECK_NAME,
+ CHAR_SEL_SUM_CHARS,
+ CHAR_SEL_CHAR_CREATE_INFO,
+ CHAR_INS_CHARACTER_BAN,
+ CHAR_UPD_CHARACTER_BAN,
+ CHAR_SEL_BANINFO,
+ CHAR_SEL_GUID_BY_NAME_FILTER,
+ CHAR_SEL_BANINFO_LIST,
+ CHAR_SEL_BANNED_NAME,
+ CHAR_SEL_ENUM,
+ CHAR_SEL_ENUM_DECLINED_NAME,
+ CHAR_SEL_PET_SLOTS,
+ CHAR_SEL_PET_SLOTS_DETAIL,
+ CHAR_SEL_PET_ENTRY,
+ CHAR_SEL_PET_SLOT_BY_ID,
+ CHAR_SEL_FREE_NAME,
+ CHAR_SEL_GUID_RACE_ACC_BY_NAME,
CHAR_DEL_QUEST_STATUS_DAILY,
CHAR_DEL_QUEST_STATUS_WEEKLY,
+ CHAR_DEL_QUEST_STATUS_SEASONAL,
+ CHAR_DEL_QUEST_STATUS_DAILY_CHAR,
+ CHAR_DEL_QUEST_STATUS_WEEKLY_CHAR,
+ CHAR_DEL_QUEST_STATUS_SEASONAL_CHAR,
CHAR_DEL_BATTLEGROUND_RANDOM,
- CHAR_LOAD_PLAYER,
- CHAR_LOAD_PLAYER_GROUP,
- CHAR_LOAD_PLAYER_BOUNDINSTANCES,
- CHAR_LOAD_PLAYER_AURAS,
- CHAR_LOAD_PLAYER_SPELLS,
- CHAR_LOAD_PLAYER_QUESTSTATUS,
- CHAR_LOAD_PLAYER_DAILYQUESTSTATUS,
- CHAR_LOAD_PLAYER_WEKLYQUESTSTATUS,
- CHAR_LOAD_PLAYER_REPUTATION,
- CHAR_LOAD_PLAYER_INVENTORY,
- CHAR_LOAD_PLAYER_ACTIONS,
- CHAR_LOAD_PLAYER_ACTIONS_SPEC,
- CHAR_LOAD_PLAYER_MAILCOUNT,
- CHAR_LOAD_PLAYER_MAILDATE,
- CHAR_LOAD_PLAYER_SOCIALLIST,
- CHAR_LOAD_PLAYER_HOMEBIND,
- CHAR_LOAD_PLAYER_SPELLCOOLDOWNS,
- CHAR_LOAD_PLAYER_DECLINEDNAMES,
- CHAR_LOAD_PLAYER_GUILD,
- CHAR_LOAD_PLAYER_ARENAINFO,
- CHAR_LOAD_PLAYER_ACHIEVEMENTS,
- CHAR_LOAD_PLAYER_CRITERIAPROGRESS,
- CHAR_LOAD_PLAYER_EQUIPMENTSETS,
- CHAR_LOAD_PLAYER_BGDATA,
- CHAR_LOAD_PLAYER_GLYPHS,
- CHAR_LOAD_PLAYER_TALENTS,
- CHAR_LOAD_PLAYER_SKILLS,
- CHAR_LOAD_PLAYER_RANDOMBG,
- CHAR_LOAD_PLAYER_BANNED,
- CHAR_LOAD_PLAYER_QUESTSTATUSREW,
- CHAR_LOAD_ACCOUNT_INSTANCELOCKTIMES,
- CHAR_LOAD_PLAYER_MAILITEMS,
- CHAR_LOAD_AUCTION_ITEMS,
- CHAR_ADD_AUCTION,
+ CHAR_INS_BATTLEGROUND_RANDOM,
+
+ CHAR_SEL_CHARACTER,
+ CHAR_SEL_GROUP_MEMBER,
+ CHAR_SEL_CHARACTER_INSTANCE,
+ CHAR_SEL_CHARACTER_AURAS,
+ CHAR_SEL_CHARACTER_SPELL,
+ CHAR_SEL_CHARACTER_QUESTSTATUS,
+ CHAR_SEL_CHARACTER_DAILYQUESTSTATUS,
+ CHAR_SEL_CHARACTER_WEEKLYQUESTSTATUS,
+ CHAR_SEL_CHARACTER_SEASONALQUESTSTATUS,
+ CHAR_INS_CHARACTER_DAILYQUESTSTATUS,
+ CHAR_INS_CHARACTER_WEEKLYQUESTSTATUS,
+ CHAR_INS_CHARACTER_SEASONALQUESTSTATUS,
+ CHAR_SEL_CHARACTER_REPUTATION,
+ CHAR_SEL_CHARACTER_INVENTORY,
+ CHAR_SEL_CHARACTER_ACTIONS,
+ CHAR_SEL_CHARACTER_ACTIONS_SPEC,
+ CHAR_SEL_CHARACTER_MAILCOUNT,
+ CHAR_SEL_CHARACTER_MAILDATE,
+ CHAR_SEL_CHARACTER_SOCIALLIST,
+ CHAR_SEL_CHARACTER_HOMEBIND,
+ CHAR_SEL_CHARACTER_SPELLCOOLDOWNS,
+ CHAR_SEL_CHARACTER_DECLINEDNAMES,
+ CHAR_SEL_GUILD_MEMBER,
+ CHAR_SEL_CHARACTER_ARENAINFO,
+ CHAR_SEL_CHARACTER_ACHIEVEMENTS,
+ CHAR_SEL_CHARACTER_CRITERIAPROGRESS,
+ CHAR_SEL_CHARACTER_EQUIPMENTSETS,
+ CHAR_SEL_CHARACTER_BGDATA,
+ CHAR_SEL_CHARACTER_GLYPHS,
+ CHAR_SEL_CHARACTER_TALENTS,
+ CHAR_SEL_CHARACTER_SKILLS,
+ CHAR_SEL_CHARACTER_RANDOMBG,
+ CHAR_SEL_CHARACTER_BANNED,
+ CHAR_SEL_CHARACTER_QUESTSTATUSREW,
+ CHAR_SEL_ACCOUNT_INSTANCELOCKTIMES,
+ CHAR_SEL_MAILITEMS,
+ CHAR_SEL_AUCTION_ITEMS,
+ CHAR_INS_AUCTION,
CHAR_DEL_AUCTION,
- CHAR_LOAD_AUCTIONS,
- CHAR_ADD_MAIL,
+ CHAR_SEL_AUCTIONS,
+ CHAR_INS_MAIL,
CHAR_DEL_MAIL,
- CHAR_ADD_MAIL_ITEM,
+ CHAR_INS_MAIL_ITEM,
+ CHAR_DEL_MAIL_ITEM,
CHAR_DEL_INVALID_MAIL_ITEM,
CHAR_DEL_EMPTY_EXPIRED_MAIL,
- CHAR_GET_EXPIRED_MAIL,
- CHAR_GET_EXPIRED_MAIL_ITEMS,
- CHAR_SET_MAIL_RETURNED,
- CHAR_SET_MAIL_ITEM_RECEIVER,
- CHAR_SET_ITEM_OWNER,
- CHAR_LOAD_GUILD_BANK_ITEMS,
- CHAR_LOAD_ITEM_REFUNDS,
- CHAR_LOAD_ITEM_BOP_TRADE,
+ CHAR_SEL_EXPIRED_MAIL,
+ CHAR_SEL_EXPIRED_MAIL_ITEMS,
+ CHAR_UPD_MAIL_RETURNED,
+ CHAR_UPD_MAIL_ITEM_RECEIVER,
+ CHAR_UPD_ITEM_OWNER,
+ CHAR_SEL_ITEM_REFUNDS,
+ CHAR_SEL_ITEM_BOP_TRADE,
CHAR_DEL_ITEM_BOP_TRADE,
- CHAR_ADD_ITEM_BOP_TRADE,
+ CHAR_INS_ITEM_BOP_TRADE,
CHAR_REP_INVENTORY_ITEM,
CHAR_DEL_INVENTORY_ITEM,
- CHAR_ADD_ITEM_INSTANCE,
- CHAR_UPDATE_ITEM_INSTANCE,
- CHAR_UPDATE_ITEM_INSTANCE_ON_LOAD,
+ CHAR_REP_ITEM_INSTANCE,
+ CHAR_UPD_ITEM_INSTANCE,
+ CHAR_UPD_ITEM_INSTANCE_ON_LOAD,
CHAR_DEL_ITEM_INSTANCE,
- CHAR_UPDATE_GIFT_OWNER,
+ CHAR_UPD_GIFT_OWNER,
CHAR_DEL_GIFT,
- CHAR_GET_ACCOUNT_BY_NAME,
+ CHAR_SEL_ACCOUNT_BY_NAME,
CHAR_DEL_ACCOUNT_INSTANCE_LOCK_TIMES,
- CHAR_ADD_ACCOUNT_INSTANCE_LOCK_TIMES,
- CHAR_LOAD_PLAYER_NAME_CLASS,
- CHAR_LOAD_MATCH_MAKER_RATING,
- CHAR_GET_CHARACTER_COUNT,
- CHAR_UPDATE_NAME,
+ CHAR_INS_ACCOUNT_INSTANCE_LOCK_TIMES,
+ CHAR_SEL_CHARACTER_NAME_CLASS,
+ CHAR_SEL_MATCH_MAKER_RATING,
+ CHAR_SEL_CHARACTER_COUNT,
+ CHAR_UPD_NAME,
CHAR_DEL_DECLINED_NAME,
- CHAR_ADD_GUILD,
+ CHAR_INS_GUILD,
CHAR_DEL_GUILD,
- CHAR_ADD_GUILD_MEMBER,
+ CHAR_INS_GUILD_MEMBER,
CHAR_DEL_GUILD_MEMBER,
CHAR_DEL_GUILD_MEMBERS,
- CHAR_ADD_GUILD_RANK,
+ CHAR_INS_GUILD_RANK,
CHAR_DEL_GUILD_RANKS,
CHAR_DEL_GUILD_LOWEST_RANK,
- CHAR_ADD_GUILD_BANK_TAB,
+ CHAR_INS_GUILD_BANK_TAB,
CHAR_DEL_GUILD_BANK_TAB,
CHAR_DEL_GUILD_BANK_TABS,
- CHAR_ADD_GUILD_BANK_ITEM,
+ CHAR_INS_GUILD_BANK_ITEM,
CHAR_DEL_GUILD_BANK_ITEM,
CHAR_DEL_GUILD_BANK_ITEMS,
- CHAR_ADD_GUILD_BANK_RIGHT_DEFAULT,
- CHAR_ADD_GUILD_BANK_RIGHT,
+ CHAR_INS_GUILD_BANK_RIGHT_DEFAULT,
+ CHAR_INS_GUILD_BANK_RIGHT,
CHAR_DEL_GUILD_BANK_RIGHT,
CHAR_DEL_GUILD_BANK_RIGHTS,
CHAR_DEL_GUILD_BANK_RIGHTS_FOR_RANK,
- CHAR_ADD_GUILD_BANK_EVENTLOG,
+ CHAR_INS_GUILD_BANK_EVENTLOG,
CHAR_DEL_GUILD_BANK_EVENTLOG,
CHAR_DEL_GUILD_BANK_EVENTLOGS,
- CHAR_ADD_GUILD_EVENTLOG,
+ CHAR_INS_GUILD_EVENTLOG,
CHAR_DEL_GUILD_EVENTLOG,
CHAR_DEL_GUILD_EVENTLOGS,
- CHAR_SET_GUILD_MEMBER_PNOTE,
- CHAR_SET_GUILD_MEMBER_OFFNOTE,
- CHAR_SET_GUILD_MEMBER_RANK,
- CHAR_SET_GUILD_MOTD,
- CHAR_SET_GUILD_INFO,
- CHAR_SET_GUILD_LEADER,
- CHAR_SET_GUILD_RANK_NAME,
- CHAR_SET_GUILD_RANK_RIGHTS,
- CHAR_SET_GUILD_EMBLEM_INFO,
- CHAR_SET_GUILD_BANK_TAB_INFO,
- CHAR_SET_GUILD_BANK_MONEY,
- CHAR_SET_GUILD_BANK_EVENTLOG_TAB,
- CHAR_SET_GUILD_MEMBER_BANK_REM_MONEY,
- CHAR_SET_GUILD_MEMBER_BANK_TIME_MONEY,
- CHAR_RESET_GUILD_RANK_BANK_RESET_TIME,
- CHAR_SET_GUILD_RANK_BANK_MONEY,
- CHAR_SET_GUILD_BANK_TAB_TEXT,
- CHAR_SET_GUILD_MEMBER_BANK_TIME_REM_SLOTS0,
- CHAR_SET_GUILD_MEMBER_BANK_TIME_REM_SLOTS1,
- CHAR_SET_GUILD_MEMBER_BANK_TIME_REM_SLOTS2,
- CHAR_SET_GUILD_MEMBER_BANK_TIME_REM_SLOTS3,
- CHAR_SET_GUILD_MEMBER_BANK_TIME_REM_SLOTS4,
- CHAR_SET_GUILD_MEMBER_BANK_TIME_REM_SLOTS5,
- CHAR_SET_GUILD_MEMBER_BANK_REM_SLOTS0,
- CHAR_SET_GUILD_MEMBER_BANK_REM_SLOTS1,
- CHAR_SET_GUILD_MEMBER_BANK_REM_SLOTS2,
- CHAR_SET_GUILD_MEMBER_BANK_REM_SLOTS3,
- CHAR_SET_GUILD_MEMBER_BANK_REM_SLOTS4,
- CHAR_SET_GUILD_MEMBER_BANK_REM_SLOTS5,
- CHAR_RESET_GUILD_RANK_BANK_TIME0,
- CHAR_RESET_GUILD_RANK_BANK_TIME1,
- CHAR_RESET_GUILD_RANK_BANK_TIME2,
- CHAR_RESET_GUILD_RANK_BANK_TIME3,
- CHAR_RESET_GUILD_RANK_BANK_TIME4,
- CHAR_RESET_GUILD_RANK_BANK_TIME5,
- CHAR_LOAD_CHAR_DATA_FOR_GUILD,
+ CHAR_UPD_GUILD_MEMBER_PNOTE,
+ CHAR_UPD_GUILD_MEMBER_OFFNOTE,
+ CHAR_UPD_GUILD_MEMBER_RANK,
+ CHAR_UPD_GUILD_MOTD,
+ CHAR_UPD_GUILD_INFO,
+ CHAR_UPD_GUILD_LEADER,
+ CHAR_UPD_GUILD_RANK_NAME,
+ CHAR_UPD_GUILD_RANK_RIGHTS,
+ CHAR_UPD_GUILD_EMBLEM_INFO,
+ CHAR_UPD_GUILD_BANK_TAB_INFO,
+ CHAR_UPD_GUILD_BANK_MONEY,
+ CHAR_UPD_GUILD_BANK_EVENTLOG_TAB,
+ CHAR_UPD_GUILD_MEMBER_BANK_REM_MONEY,
+ CHAR_UPD_GUILD_MEMBER_BANK_TIME_MONEY,
+ CHAR_UPD_GUILD_RANK_BANK_RESET_TIME,
+ CHAR_UPD_GUILD_RANK_BANK_MONEY,
+ CHAR_UPD_GUILD_BANK_TAB_TEXT,
+ CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS0,
+ CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS1,
+ CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS2,
+ CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS3,
+ CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS4,
+ CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS5,
+ CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS0,
+ CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS1,
+ CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS2,
+ CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS3,
+ CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS4,
+ CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS5,
+ CHAR_UPD_GUILD_RANK_BANK_TIME0,
+ CHAR_UPD_GUILD_RANK_BANK_TIME1,
+ CHAR_UPD_GUILD_RANK_BANK_TIME2,
+ CHAR_UPD_GUILD_RANK_BANK_TIME3,
+ CHAR_UPD_GUILD_RANK_BANK_TIME4,
+ CHAR_UPD_GUILD_RANK_BANK_TIME5,
+ CHAR_SEL_CHAR_DATA_FOR_GUILD,
- CHAR_LOAD_CHANNEL,
- CHAR_ADD_CHANNEL,
- CHAR_SET_CHANNEL,
- CHAR_SET_CHANNEL_USAGE,
- CHAR_SET_CHANNEL_OWNERSHIP,
+ CHAR_SEL_CHANNEL,
+ CHAR_INS_CHANNEL,
+ CHAR_UPD_CHANNEL,
+ CHAR_UPD_CHANNEL_USAGE,
+ CHAR_UPD_CHANNEL_OWNERSHIP,
CHAR_DEL_OLD_CHANNELS,
- CHAR_SET_EQUIP_SET,
- CHAR_ADD_EQUIP_SET,
+ CHAR_UPD_EQUIP_SET,
+ CHAR_INS_EQUIP_SET,
CHAR_DEL_EQUIP_SET,
CHAR_DEL_AURA,
- CHAR_ADD_AURA,
+ CHAR_INS_AURA,
- CHAR_LOAD_ACCOUNT_DATA,
- CHAR_SET_ACCOUNT_DATA,
+ CHAR_SEL_ACCOUNT_DATA,
+ CHAR_REP_ACCOUNT_DATA,
CHAR_DEL_ACCOUNT_DATA,
- CHAR_LOAD_PLAYER_ACCOUNT_DATA,
- CHAR_SET_PLAYER_ACCOUNT_DATA,
+ CHAR_SEL_PLAYER_ACCOUNT_DATA,
+ CHAR_REP_PLAYER_ACCOUNT_DATA,
CHAR_DEL_PLAYER_ACCOUNT_DATA,
- CHAR_LOAD_TUTORIALS,
- CHAR_GET_HAS_TUTORIALS,
- CHAR_ADD_TUTORIALS,
- CHAR_SET_TUTORIALS,
+ CHAR_SEL_TUTORIALS,
+ CHAR_SEL_HAS_TUTORIALS,
+ CHAR_INS_TUTORIALS,
+ CHAR_UPD_TUTORIALS,
CHAR_DEL_TUTORIALS,
- CHAR_ADD_INSTANCE_SAVE,
- CHAR_UPDATE_INSTANCE_DATA,
+ CHAR_INS_INSTANCE_SAVE,
+ CHAR_UPD_INSTANCE_DATA,
CHAR_DEL_GAME_EVENT_SAVE,
- CHAR_ADD_GAME_EVENT_SAVE,
+ CHAR_INS_GAME_EVENT_SAVE,
CHAR_DEL_ALL_GAME_EVENT_CONDITION_SAVE,
CHAR_DEL_GAME_EVENT_CONDITION_SAVE,
- CHAR_ADD_GAME_EVENT_CONDITION_SAVE,
+ CHAR_INS_GAME_EVENT_CONDITION_SAVE,
- CHAR_ADD_ARENA_TEAM,
- CHAR_SET_ARENA_TEAM_MEMBER,
+ CHAR_INS_ARENA_TEAM,
+ CHAR_INS_ARENA_TEAM_MEMBER,
CHAR_DEL_ARENA_TEAM,
CHAR_DEL_ARENA_TEAM_MEMBERS,
- CHAR_UPDATE_ARENA_TEAM_CAPTAIN,
+ CHAR_UPD_ARENA_TEAM_CAPTAIN,
CHAR_DEL_ARENA_TEAM_MEMBER,
- CHAR_UPDATE_ARENA_TEAM_STATS,
- CHAR_UPDATE_ARENA_TEAM_MEMBER,
- CHAR_UPDATE_CHARACTER_ARENA_STATS,
- CHAR_LOAD_PLAYER_ARENA_TEAMS,
+ CHAR_UPD_ARENA_TEAM_STATS,
+ CHAR_UPD_ARENA_TEAM_MEMBER,
+ CHAR_REP_CHARACTER_ARENA_STATS,
+ CHAR_SEL_PLAYER_ARENA_TEAMS,
- CHAR_LOAD_PETITION,
- CHAR_LOAD_PETITION_SIGNATURE,
+ CHAR_SEL_PETITION,
+ CHAR_SEL_PETITION_SIGNATURE,
+ CHAR_DEL_ALL_PETITION_SIGNATURES,
+ CHAR_DEL_PETITION_SIGNATURE,
- CHAR_ADD_PLAYER_BGDATA,
+ CHAR_INS_PLAYER_BGDATA,
CHAR_DEL_PLAYER_BGDATA,
- CHAR_RESET_PLAYERS_BGDATA,
+ CHAR_UPD_PLAYERS_BGDATA,
- CHAR_ADD_PLAYER_HOMEBIND,
- CHAR_SET_PLAYER_HOMEBIND,
+ CHAR_INS_PLAYER_HOMEBIND,
+ CHAR_UPD_PLAYER_HOMEBIND,
CHAR_DEL_PLAYER_HOMEBIND,
- CHAR_LOAD_CORPSES,
- CHAR_ADD_CORPSE,
+ CHAR_SEL_CORPSES,
+ CHAR_INS_CORPSE,
CHAR_DEL_CORPSE,
CHAR_DEL_PLAYER_CORPSES,
CHAR_DEL_OLD_CORPSES,
- CHAR_RESET_NONEXISTENT_INSTANCE_FOR_CORPSES,
+ CHAR_UPD_NONEXISTENT_INSTANCE_FOR_CORPSES,
- CHAR_LOAD_CREATURE_RESPAWNS,
- CHAR_ADD_CREATURE_RESPAWN,
+ CHAR_SEL_CREATURE_RESPAWNS,
+ CHAR_REP_CREATURE_RESPAWN,
CHAR_DEL_CREATURE_RESPAWN,
CHAR_DEL_CREATURE_RESPAWN_BY_GUID,
CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE,
- CHAR_GET_MAX_CREATURE_RESPAWNS,
+ CHAR_SEL_MAX_CREATURE_RESPAWNS,
CHAR_DEL_NONEXISTENT_INSTANCE_CREATURE_RESPAWNS,
- CHAR_LOAD_GO_RESPAWNS,
- CHAR_ADD_GO_RESPAWN,
+ CHAR_SEL_GO_RESPAWNS,
+ CHAR_REP_GO_RESPAWN,
CHAR_DEL_GO_RESPAWN,
CHAR_DEL_GO_RESPAWN_BY_INSTANCE,
CHAR_DEL_EXPIRED_GO_RESPAWNS,
CHAR_DEL_NONEXISTENT_INSTANCE_GO_RESPAWNS,
- CHAR_LOAD_GM_TICKETS,
- CHAR_ADD_GM_TICKET,
+ CHAR_SEL_GM_TICKETS,
+ CHAR_REP_GM_TICKET,
CHAR_DEL_GM_TICKET,
CHAR_DEL_ALL_GM_TICKETS,
CHAR_DEL_PLAYER_GM_TICKETS,
- CHAR_ADD_GM_SURVEY,
- CHAR_ADD_GM_SUBSURVEY,
- CHAR_ADD_LAG_REPORT,
+ CHAR_INS_GM_SURVEY,
+ CHAR_INS_GM_SUBSURVEY,
+ CHAR_INS_LAG_REPORT,
- CHAR_LOAD_EXPIRED_AUCTIONS,
+ CHAR_SEL_EXPIRED_AUCTIONS,
- CHAR_ADD_CHARACTER,
+ CHAR_INS_CHARACTER,
CHAR_UPD_CHARACTER,
- CHAR_UPDATE_AT_LOGIN_FLAG,
- CHAR_UPDATE_ALL_AT_LOGIN_FLAGS,
- CHAR_ADD_BUG_REPORT,
+ CHAR_UPD_ADD_AT_LOGIN_FLAG,
+ CHAR_UPD_REM_AT_LOGIN_FLAG,
+ CHAR_UPD_ALL_AT_LOGIN_FLAGS,
+ CHAR_INS_BUG_REPORT,
CHAR_UPD_PETITION_NAME,
- CHAR_ADD_PETITION_SIGNATURE,
+ CHAR_INS_PETITION_SIGNATURE,
CHAR_UPD_ACCOUNT_ONLINE,
- CHAR_ADD_GROUP,
- CHAR_ADD_GROUP_MEMBER,
+ CHAR_INS_GROUP,
+ CHAR_INS_GROUP_MEMBER,
CHAR_DEL_GROUP_MEMBER,
CHAR_DEL_GROUP_INSTANCE_PERM_BINDING,
- CHAR_UPDATE_GROUP_LEADER,
- CHAR_UPDATE_GROUP_TYPE,
- CHAR_UPDATE_GROUP_MEMBER_SUBGROUP,
- CHAR_UPDATE_GROUP_MEMBER_FLAG,
- CHAR_UPDATE_GROUP_DIFFICULTY,
- CHAR_UPDATE_GROUP_RAID_DIFFICULTY,
+ CHAR_UPD_GROUP_LEADER,
+ CHAR_UPD_GROUP_TYPE,
+ CHAR_UPD_GROUP_MEMBER_SUBGROUP,
+ CHAR_UPD_GROUP_MEMBER_FLAG,
+ CHAR_UPD_GROUP_DIFFICULTY,
+ CHAR_UPD_GROUP_RAID_DIFFICULTY,
CHAR_DEL_INVALID_SPELL,
- CHAR_UPDATE_DELETE_INFO,
- CHAR_UPDATE_ZONE,
- CHAR_UPDATE_LEVEL,
+ CHAR_UPD_DELETE_INFO,
+ CHAR_UDP_RESTORE_DELETE_INFO,
+ CHAR_UPD_ZONE,
+ CHAR_UPD_LEVEL,
CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA,
CHAR_DEL_INVALID_ACHIEVMENT,
- CHAR_ADD_ADDON,
+ CHAR_INS_ADDON,
CHAR_DEL_INVALID_PET_SPELL,
CHAR_DEL_GROUP_INSTANCE_BY_INSTANCE,
CHAR_DEL_GROUP_INSTANCE_BY_GUID,
- CHAR_ADD_GROUP_INSTANCE,
- CHAR_UPDATE_INSTANCE_RESETTIME,
- CHAR_UPDATE_GLOBAL_INSTANCE_RESETTIME,
+ CHAR_REP_GROUP_INSTANCE,
+ CHAR_UPD_INSTANCE_RESETTIME,
+ CHAR_UPD_GLOBAL_INSTANCE_RESETTIME,
+ CHAR_UPD_CHAR_ONLINE,
+ CHAR_UPD_CHAR_NAME_AT_LOGIN,
+ CHAR_UPD_WORLDSTATE,
+ CHAR_INS_WORLDSTATE,
+ CHAR_DEL_CHAR_INSTANCE,
+ CHAR_UPD_CHAR_INSTANCE,
+ CHAR_INS_CHAR_INSTANCE,
+ CHAR_UPD_GENDER_PLAYERBYTES,
+ CHAR_DEL_CHARACTER_SKILL,
+ CHAR_UPD_ADD_CHARACTER_SOCIAL_FLAGS,
+ CHAR_UPD_REM_CHARACTER_SOCIAL_FLAGS,
+ CHAR_INS_CHARACTER_SOCIAL,
+ CHAR_DEL_CHARACTER_SOCIAL,
+ CHAR_UPD_CHARACTER_SOCIAL_NOTE,
+ CHAR_UPD_CHARACTER_POSITION,
+
+ CHAR_INS_LFG_DATA,
+ CHAR_DEL_LFG_DATA,
MAX_CHARACTERDATABASE_STATEMENTS,
};
diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp
index 713d4a31e6d..7e497c4437b 100755
--- a/src/server/shared/Database/Implementation/LoginDatabase.cpp
+++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -22,38 +22,44 @@ void LoginDatabaseConnection::DoPrepareStatements()
if (!m_reconnecting)
m_stmts.resize(MAX_LOGINDATABASE_STATEMENTS);
- PREPARE_STATEMENT(LOGIN_GET_REALMLIST, "SELECT id, name, address, port, icon, color, timezone, allowedSecurityLevel, population, gamebuild FROM realmlist WHERE color <> 3 ORDER BY name", CONNECTION_SYNCH)
- PREPARE_STATEMENT(LOGIN_SET_EXPIREDIPBANS, "DELETE FROM ip_banned WHERE unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC)
- PREPARE_STATEMENT(LOGIN_SET_EXPIREDACCBANS, "UPDATE account_banned SET active = 0 WHERE active = 1 AND unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC)
- PREPARE_STATEMENT(LOGIN_GET_IPBANNED, "SELECT * FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH)
- PREPARE_STATEMENT(LOGIN_SET_IPAUTOBANNED, "INSERT INTO ip_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban')", CONNECTION_ASYNC)
- PREPARE_STATEMENT(LOGIN_GET_ACCBANNED, "SELECT bandate, unbandate FROM account_banned WHERE id = ? AND active = 1", CONNECTION_SYNCH)
- PREPARE_STATEMENT(LOGIN_SET_ACCAUTOBANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban', 1)", CONNECTION_ASYNC)
- PREPARE_STATEMENT(LOGIN_GET_SESSIONKEY, "SELECT a.sessionkey, a.id, aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE username = ?", CONNECTION_SYNCH)
- PREPARE_STATEMENT(LOGIN_SET_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(LOGIN_SET_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0 WHERE username = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(LOGIN_GET_LOGONCHALLENGE, "SELECT a.sha_pass_hash, a.id, a.locked, a.last_ip, aa.gmlevel, a.v, a.s FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = ?", CONNECTION_SYNCH)
- PREPARE_STATEMENT(LOGIN_SET_FAILEDLOGINS, "UPDATE account SET failed_logins = failed_logins + 1 WHERE username = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(LOGIN_GET_FAILEDLOGINS, "SELECT id, failed_logins FROM account WHERE username = ?", CONNECTION_SYNCH)
- PREPARE_STATEMENT(LOGIN_GET_ACCIDBYNAME, "SELECT id FROM account WHERE username = ?", CONNECTION_SYNCH)
- PREPARE_STATEMENT(LOGIN_GET_NUMCHARSONREALM, "SELECT numchars FROM realmcharacters WHERE realmid = ? AND acctid= ?", CONNECTION_SYNCH)
- PREPARE_STATEMENT(LOGIN_GET_ACCOUNT_BY_IP, "SELECT id FROM account WHERE last_ip = ?", CONNECTION_SYNCH)
- PREPARE_STATEMENT(LOGIN_SET_IP_BANNED, "INSERT INTO ip_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?)", CONNECTION_ASYNC)
- PREPARE_STATEMENT(LOGIN_SET_IP_NOT_BANNED, "DELETE FROM ip_banned WHERE ip = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(LOGIN_SET_ACCOUNT_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC)
- PREPARE_STATEMENT(LOGIN_SET_ACCOUNT_NOT_BANNED, "UPDATE account_banned SET active = 0 WHERE id = ? AND active != 0", CONNECTION_ASYNC)
- PREPARE_STATEMENT(LOGIN_DEL_REALMCHARACTERS, "DELETE FROM realmcharacters WHERE acctid = ? AND realmid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(LOGIN_ADD_REALMCHARACTERS, "INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (?, ?, ?)", CONNECTION_ASYNC)
- PREPARE_STATEMENT(LOGIN_GET_SUM_REALMCHARS, "SELECT SUM(numchars) FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(LOGIN_ADD_ACCOUNT, "INSERT INTO account(username, sha_pass_hash, joindate) VALUES(?, ?, NOW())", CONNECTION_ASYNC);
- PREPARE_STATEMENT(LOGIN_ADD_REALM_CHARS, "INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist, account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_SEL_REALMLIST, "SELECT id, name, address, port, icon, color, timezone, allowedSecurityLevel, population, gamebuild FROM realmlist WHERE color <> 3 ORDER BY name", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(LOGIN_DEL_EXPIRED_IP_BANS, "DELETE FROM ip_banned WHERE unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(LOGIN_UPD_EXPIRED_ACCOUNT_BANS, "UPDATE account_banned SET active = 0 WHERE active = 1 AND unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(LOGIN_SEL_IP_BANNED, "SELECT * FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(LOGIN_INS_IP_AUTO_BANNED, "INSERT INTO ip_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban')", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BANNED, "SELECT bandate, unbandate FROM account_banned WHERE id = ? AND active = 1", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban', 1)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(LOGIN_SEL_SESSIONKEY, "SELECT a.sessionkey, a.id, aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE username = ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(LOGIN_UPD_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(LOGIN_UPD_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0 WHERE username = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(LOGIN_SEL_LOGONCHALLENGE, "SELECT a.sha_pass_hash, a.id, a.locked, a.last_ip, aa.gmlevel, a.v, a.s FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(LOGIN_UPD_FAILEDLOGINS, "UPDATE account SET failed_logins = failed_logins + 1 WHERE username = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(LOGIN_SEL_FAILEDLOGINS, "SELECT id, failed_logins FROM account WHERE username = ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_ID_BY_NAME, "SELECT id FROM account WHERE username = ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(LOGIN_SEL_NUM_CHARS_ON_REALM, "SELECT numchars FROM realmcharacters WHERE realmid = ? AND acctid= ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BY_IP, "SELECT id FROM account WHERE last_ip = ?", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(LOGIN_INS_IP_BANNED, "INSERT INTO ip_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(LOGIN_DEL_IP_NOT_BANNED, "DELETE FROM ip_banned WHERE ip = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(LOGIN_INS_ACCOUNT_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(LOGIN_UPD_ACCOUNT_NOT_BANNED, "UPDATE account_banned SET active = 0 WHERE id = ? AND active != 0", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(LOGIN_DEL_REALM_CHARACTERS, "DELETE FROM realmcharacters WHERE acctid = ? AND realmid = ?", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(LOGIN_INS_REALM_CHARACTERS, "INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(LOGIN_SEL_SUM_REALM_CHARACTERS, "SELECT SUM(numchars) FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_INS_ACCOUNT, "INSERT INTO account(username, sha_pass_hash, joindate) VALUES(?, ?, NOW())", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_INS_REALM_CHARACTERS_INIT, "INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist, account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL", CONNECTION_ASYNC);
PREPARE_STATEMENT(LOGIN_DEL_OLD_BANS, "DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate", CONNECTION_ASYNC);
PREPARE_STATEMENT(LOGIN_DEL_OLD_IP_BANS, "DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate", CONNECTION_ASYNC);
- PREPARE_STATEMENT(LOGIN_UPDATE_EXPANSION, "UPDATE account SET expansion = ? WHERE id = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(LOGIN_UPDATE_ACCOUNT_LOCK, "UPDATE account SET locked = ? WHERE id = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(LOGIN_ADD_LOG, "INSERT INTO logs (time, realm, type, string) VALUES (UNIX_TIMESTAMP(), ? , ?, ?)", CONNECTION_ASYNC);
- PREPARE_STATEMENT(LOGIN_UPDATE_USERNAME, "UPDATE account SET v = 0, s = 0, username = ?, sha_pass_hash = ? WHERE id = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(LOGIN_UPDATE_PASSWORD, "UPDATE account SET v = 0, s = 0, sha_pass_hash = ? WHERE id = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(LOGIN_UPDATE_MUTE_TIME, "UPDATE account SET mutetime = ? WHERE id = ?", CONNECTION_ASYNC);
- PREPARE_STATEMENT(LOGIN_UPDATE_LAST_IP, "UPDATE account SET last_ip = ? WHERE username = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_UPD_EXPANSION, "UPDATE account SET expansion = ? WHERE id = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_UPD_ACCOUNT_LOCK, "UPDATE account SET locked = ? WHERE id = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_INS_LOG, "INSERT INTO logs (time, realm, type, string) VALUES (UNIX_TIMESTAMP(), ? , ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_UPD_USERNAME, "UPDATE account SET v = 0, s = 0, username = ?, sha_pass_hash = ? WHERE id = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_UPD_PASSWORD, "UPDATE account SET v = 0, s = 0, sha_pass_hash = ? WHERE id = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_UPD_MUTE_TIME, "UPDATE account SET mutetime = ? WHERE id = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_UPD_LAST_IP, "UPDATE account SET last_ip = ? WHERE username = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_UPD_ACCOUNT_ONLINE, "UPDATE account SET online = 1 WHERE id = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_UPD_UPTIME_PLAYERS, "UPDATE uptime SET uptime = ?, maxplayers = ? WHERE realmid = ? AND starttime = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_DEL_OLD_LOGS, "DELETE FROM logs WHERE (time + ?) < ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_DEL_ACCOUNT_ACCESS, "DELETE FROM account_access WHERE id = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM, "DELETE FROM account_access WHERE id = ? AND (RealmID = ? OR RealmID = -1)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(LOGIN_INS_ACCOUNT_ACCESS, "INSERT INTO account_access (id,gmlevel,RealmID) VALUES (?, ?, ?)", CONNECTION_ASYNC);
}
diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h
index 98d9c505fa0..afb188020c7 100755
--- a/src/server/shared/Database/Implementation/LoginDatabase.h
+++ b/src/server/shared/Database/Implementation/LoginDatabase.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,45 +37,51 @@ typedef DatabaseWorkerPool<LoginDatabaseConnection> LoginDatabaseWorkerPool;
enum LoginDatabaseStatements
{
/* Naming standard for defines:
- {DB}_{SET/DEL/ADD/REP}_{Summary of data changed}
+ {DB}_{SEL/INS/UPD/DEL/REP}_{Summary of data changed}
When updating more than one field, consider looking at the calling function
name for a suiting suffix.
*/
- LOGIN_GET_REALMLIST,
- LOGIN_SET_EXPIREDIPBANS,
- LOGIN_SET_EXPIREDACCBANS,
- LOGIN_GET_IPBANNED,
- LOGIN_SET_IPAUTOBANNED,
- LOGIN_GET_ACCBANNED,
- LOGIN_SET_ACCAUTOBANNED,
- LOGIN_GET_SESSIONKEY,
- LOGIN_SET_VS,
- LOGIN_SET_LOGONPROOF,
- LOGIN_GET_LOGONCHALLENGE,
- LOGIN_SET_FAILEDLOGINS,
- LOGIN_GET_FAILEDLOGINS,
- LOGIN_GET_ACCIDBYNAME,
- LOGIN_GET_NUMCHARSONREALM,
- LOGIN_GET_ACCOUNT_BY_IP,
- LOGIN_SET_IP_BANNED,
- LOGIN_SET_IP_NOT_BANNED,
- LOGIN_SET_ACCOUNT_BANNED,
- LOGIN_SET_ACCOUNT_NOT_BANNED,
- LOGIN_DEL_REALMCHARACTERS,
- LOGIN_ADD_REALMCHARACTERS,
- LOGIN_GET_SUM_REALMCHARS,
- LOGIN_ADD_ACCOUNT,
- LOGIN_ADD_REALM_CHARS,
+ LOGIN_SEL_REALMLIST,
+ LOGIN_DEL_EXPIRED_IP_BANS,
+ LOGIN_UPD_EXPIRED_ACCOUNT_BANS,
+ LOGIN_SEL_IP_BANNED,
+ LOGIN_INS_IP_AUTO_BANNED,
+ LOGIN_SEL_ACCOUNT_BANNED,
+ LOGIN_INS_ACCOUNT_AUTO_BANNED,
+ LOGIN_SEL_SESSIONKEY,
+ LOGIN_UPD_VS,
+ LOGIN_UPD_LOGONPROOF,
+ LOGIN_SEL_LOGONCHALLENGE,
+ LOGIN_UPD_FAILEDLOGINS,
+ LOGIN_SEL_FAILEDLOGINS,
+ LOGIN_SEL_ACCOUNT_ID_BY_NAME,
+ LOGIN_SEL_NUM_CHARS_ON_REALM,
+ LOGIN_SEL_ACCOUNT_BY_IP,
+ LOGIN_INS_IP_BANNED,
+ LOGIN_DEL_IP_NOT_BANNED,
+ LOGIN_INS_ACCOUNT_BANNED,
+ LOGIN_UPD_ACCOUNT_NOT_BANNED,
+ LOGIN_DEL_REALM_CHARACTERS,
+ LOGIN_INS_REALM_CHARACTERS,
+ LOGIN_SEL_SUM_REALM_CHARACTERS,
+ LOGIN_INS_ACCOUNT,
+ LOGIN_INS_REALM_CHARACTERS_INIT,
LOGIN_DEL_OLD_BANS,
LOGIN_DEL_OLD_IP_BANS,
- LOGIN_UPDATE_EXPANSION,
- LOGIN_UPDATE_ACCOUNT_LOCK,
- LOGIN_ADD_LOG,
- LOGIN_UPDATE_USERNAME,
- LOGIN_UPDATE_PASSWORD,
- LOGIN_UPDATE_MUTE_TIME,
- LOGIN_UPDATE_LAST_IP,
+ LOGIN_UPD_EXPANSION,
+ LOGIN_UPD_ACCOUNT_LOCK,
+ LOGIN_INS_LOG,
+ LOGIN_UPD_USERNAME,
+ LOGIN_UPD_PASSWORD,
+ LOGIN_UPD_MUTE_TIME,
+ LOGIN_UPD_LAST_IP,
+ LOGIN_UPD_ACCOUNT_ONLINE,
+ LOGIN_UPD_UPTIME_PLAYERS,
+ LOGIN_DEL_OLD_LOGS,
+ LOGIN_DEL_ACCOUNT_ACCESS,
+ LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM,
+ LOGIN_INS_ACCOUNT_ACCESS,
MAX_LOGINDATABASE_STATEMENTS,
};
diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp
index 5df8299310f..d7d8491008b 100755
--- a/src/server/shared/Database/Implementation/WorldDatabase.cpp
+++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -22,12 +22,42 @@ void WorldDatabaseConnection::DoPrepareStatements()
if (!m_reconnecting)
m_stmts.resize(MAX_WORLDDATABASE_STATEMENTS);
- PREPARE_STATEMENT(WORLD_LOAD_QUEST_POOLS, "SELECT entry, pool_entry FROM pool_quest", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(WORLD_SEL_QUEST_POOLS, "SELECT entry, pool_entry FROM pool_quest", CONNECTION_SYNCH)
PREPARE_STATEMENT(WORLD_DEL_CRELINKED_RESPAWN, "DELETE FROM linked_respawn WHERE guid = ?", CONNECTION_ASYNC)
- PREPARE_STATEMENT(WORLD_REP_CRELINKED_RESPAWN, "REPLACE INTO linked_respawn (guid, linkedGuid) VALUES (?, ?)", CONNECTION_ASYNC)
- PREPARE_STATEMENT(WORLD_LOAD_CRETEXT, "SELECT entry, groupid, id, text, type, language, probability, emote, duration, sound FROM creature_text", CONNECTION_SYNCH)
- PREPARE_STATEMENT(WORLD_LOAD_SMART_SCRIPTS, "SELECT entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o FROM smart_scripts ORDER BY entryorguid, source_type, id, link", CONNECTION_SYNCH)
- PREPARE_STATEMENT(WORLD_LOAD_SMARTAI_WP, "SELECT entry, pointid, position_x, position_y, position_z FROM waypoints ORDER BY entry, pointid", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(WORLD_REP_CREATURE_LINKED_RESPAWN, "REPLACE INTO linked_respawn (guid, linkedGuid) VALUES (?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(WORLD_SEL_CREATURE_TEXT, "SELECT entry, groupid, id, text, type, language, probability, emote, duration, sound FROM creature_text", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(WORLD_SEL_SMART_SCRIPTS, "SELECT entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o FROM smart_scripts ORDER BY entryorguid, source_type, id, link", CONNECTION_SYNCH)
+ PREPARE_STATEMENT(WORLD_SEL_SMARTAI_WP, "SELECT entry, pointid, position_x, position_y, position_z FROM waypoints ORDER BY entry, pointid", CONNECTION_SYNCH)
PREPARE_STATEMENT(WORLD_DEL_GAMEOBJECT, "DELETE FROM gameobject WHERE guid = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(WORLD_DEL_EVENT_GAMEOBJECT, "DELETE FROM game_event_gameobject WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_INS_GRAVEYARD_ZONE, "INSERT INTO game_graveyard_zone (id, ghost_zone, faction) VALUES (?, ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_DEL_GRAVEYARD_ZONE, "DELETE FROM game_graveyard_zone WHERE id = ? AND ghost_zone = ? AND faction = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_INS_GAME_TELE, "INSERT INTO game_tele (id, position_x, position_y, position_z, orientation, map, name) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_DEL_GAME_TELE, "DELETE FROM game_tele WHERE name = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_INS_NPC_VENODR, "INSERT INTO npc_vendor (entry, item, maxcount, incrtime, extendedcost) VALUES(?, ?, ?, ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_DEL_NPC_VENDOR, "DELETE FROM npc_vendor WHERE entry = ? AND item = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_CREATURE_MOVEMENT_TYPE, "UPDATE creature SET MovementType = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_CREATURE_FACTION, "UPDATE creature_template SET faction_A = ?, faction_H = ? WHERE entry = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_CREATURE_NPCFLAG, "UPDATE creature_template SET npcflag = ? WHERE entry = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_CREATURE_POSITION, "UPDATE creature SET position_x = ?, position_y = ?, position_z = ?, orientation = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_CREATURE_SPAWN_DISTANCE, "UPDATE creature SET spawndist = ?, MovementType = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_CREATURE_SPAWN_TIME_SECS, "UPDATE creature SET spawntimesecs = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_INS_CREATURE_FORMATION, "INSERT INTO creature_formations (leaderGUID, memberGUID, dist, angle, groupAI) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_INS_WAYPOINT_DATA, "INSERT INTO waypoint_data (id, point, position_x, position_y, position_z) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_DEL_WAYPOINT_DATA, "DELETE FROM waypoint_data WHERE id = ? AND point = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_DATA_POINT, "UPDATE waypoint_data SET point = point - 1 WHERE id = ? AND point > ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_DATA_POSITION, "UPDATE waypoint_data SET position_x = ?, position_y = ?, position_z = ? where id = ? AND point = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_DATA_WPGUID, "UPDATE waypoint_data SET wpguid = ? WHERE id = ? and point = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_ALL_WAYPOINT_DATA_WPGUID, "UPDATE waypoint_data SET wpguid = 0", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_INS_CREATURE_ADDON, "INSERT INTO creature_addon(guid, path_id) VALUES (?, ?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_CREATURE_ADDON_PATH, "UPDATE creature_addon SET path_id = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_DEL_CREATURE_ADDON, "DELETE FROM creature_addon WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_INS_WAYPOINT_SCRIPT, "INSERT INTO waypoint_scripts (guid) VALUES (?)", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_DEL_WAYPOINT_SCRIPT, "DELETE FROM waypoint_scripts WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_ID, "UPDATE waypoint_scripts SET id = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_X, "UPDATE waypoint_scripts SET x = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_Y, "UPDATE waypoint_scripts SET y = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_Z, "UPDATE waypoint_scripts SET z = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_O, "UPDATE waypoint_scripts SET o = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PREPARE_STATEMENT(WORLD_DEL_CREATURE, "DELETE FROM creature WHERE guid = ?", CONNECTION_ASYNC);
}
diff --git a/src/server/shared/Database/Implementation/WorldDatabase.h b/src/server/shared/Database/Implementation/WorldDatabase.h
index 94d6365c081..e708177503f 100755
--- a/src/server/shared/Database/Implementation/WorldDatabase.h
+++ b/src/server/shared/Database/Implementation/WorldDatabase.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program 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,19 +37,49 @@ typedef DatabaseWorkerPool<WorldDatabaseConnection> WorldDatabaseWorkerPool;
enum WorldDatabaseStatements
{
/* Naming standard for defines:
- {DB}_{SET/DEL/ADD/REP}_{Summary of data changed}
+ {DB}_{SEL/INS/UPD/DEL/REP}_{Summary of data changed}
When updating more than one field, consider looking at the calling function
name for a suiting suffix.
*/
- WORLD_LOAD_QUEST_POOLS,
+ WORLD_SEL_QUEST_POOLS,
WORLD_DEL_CRELINKED_RESPAWN,
- WORLD_REP_CRELINKED_RESPAWN,
- WORLD_LOAD_CRETEXT,
- WORLD_LOAD_SMART_SCRIPTS,
- WORLD_LOAD_SMARTAI_WP,
+ WORLD_REP_CREATURE_LINKED_RESPAWN,
+ WORLD_SEL_CREATURE_TEXT,
+ WORLD_SEL_SMART_SCRIPTS,
+ WORLD_SEL_SMARTAI_WP,
WORLD_DEL_GAMEOBJECT,
WORLD_DEL_EVENT_GAMEOBJECT,
+ WORLD_INS_GRAVEYARD_ZONE,
+ WORLD_DEL_GRAVEYARD_ZONE,
+ WORLD_INS_GAME_TELE,
+ WORLD_DEL_GAME_TELE,
+ WORLD_INS_NPC_VENODR,
+ WORLD_DEL_NPC_VENDOR,
+ WORLD_UPD_CREATURE_MOVEMENT_TYPE,
+ WORLD_UPD_CREATURE_FACTION,
+ WORLD_UPD_CREATURE_NPCFLAG,
+ WORLD_UPD_CREATURE_POSITION,
+ WORLD_UPD_CREATURE_SPAWN_DISTANCE,
+ WORLD_UPD_CREATURE_SPAWN_TIME_SECS,
+ WORLD_INS_CREATURE_FORMATION,
+ WORLD_INS_WAYPOINT_DATA,
+ WORLD_DEL_WAYPOINT_DATA,
+ WORLD_UPD_WAYPOINT_DATA_POINT,
+ WORLD_UPD_WAYPOINT_DATA_POSITION,
+ WORLD_UPD_WAYPOINT_DATA_WPGUID,
+ WORLD_UPD_ALL_WAYPOINT_DATA_WPGUID,
+ WORLD_UPD_CREATURE_ADDON_PATH,
+ WORLD_INS_CREATURE_ADDON,
+ WORLD_DEL_CREATURE_ADDON,
+ WORLD_INS_WAYPOINT_SCRIPT,
+ WORLD_DEL_WAYPOINT_SCRIPT,
+ WORLD_UPD_WAYPOINT_SCRIPT_ID,
+ WORLD_UPD_WAYPOINT_SCRIPT_X,
+ WORLD_UPD_WAYPOINT_SCRIPT_Y,
+ WORLD_UPD_WAYPOINT_SCRIPT_Z,
+ WORLD_UPD_WAYPOINT_SCRIPT_O,
+ WORLD_DEL_CREATURE,
MAX_WORLDDATABASE_STATEMENTS,
};
diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp
index 9ce924127ba..f686db4c199 100755
--- a/src/server/shared/Database/MySQLConnection.cpp
+++ b/src/server/shared/Database/MySQLConnection.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 2e134cfa814..46e14d81a5e 100755
--- a/src/server/shared/Database/MySQLConnection.h
+++ b/src/server/shared/Database/MySQLConnection.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 33f24d9aba5..2004ee9826c 100755
--- a/src/server/shared/Database/MySQLThreading.h
+++ b/src/server/shared/Database/MySQLThreading.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 22ca31fc20a..baeb591ffb1 100755
--- a/src/server/shared/Database/PreparedStatement.cpp
+++ b/src/server/shared/Database/PreparedStatement.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 97240d79801..11ece3e3032 100755
--- a/src/server/shared/Database/PreparedStatement.h
+++ b/src/server/shared/Database/PreparedStatement.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 b948a92fc5f..a3602531205 100755
--- a/src/server/shared/Database/QueryHolder.cpp
+++ b/src/server/shared/Database/QueryHolder.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 06cfde72e48..86b3b5955bd 100755
--- a/src/server/shared/Database/QueryHolder.h
+++ b/src/server/shared/Database/QueryHolder.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 9c6ad20222e..dff055b8d3d 100755
--- a/src/server/shared/Database/QueryResult.cpp
+++ b/src/server/shared/Database/QueryResult.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 6dc01076b59..c165a9456f5 100755
--- a/src/server/shared/Database/QueryResult.h
+++ b/src/server/shared/Database/QueryResult.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 ff91771b1a6..b911c1c92aa 100755
--- a/src/server/shared/Database/SQLOperation.h
+++ b/src/server/shared/Database/SQLOperation.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 b4295379664..5aecda87797 100755
--- a/src/server/shared/Database/Transaction.cpp
+++ b/src/server/shared/Database/Transaction.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 1537f238f37..92002819951 100755
--- a/src/server/shared/Database/Transaction.h
+++ b/src/server/shared/Database/Transaction.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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.h b/src/server/shared/Debugging/Errors.h
index 921363d6dc5..6927fdb483f 100755
--- a/src/server/shared/Debugging/Errors.h
+++ b/src/server/shared/Debugging/Errors.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Define.h b/src/server/shared/Define.h
index 42663fb6bd4..bb3bab75e87 100755
--- a/src/server/shared/Define.h
+++ b/src/server/shared/Define.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 4184eec119e..830e6d8b67d 100755
--- a/src/server/shared/Dynamic/FactoryHolder.h
+++ b/src/server/shared/Dynamic/FactoryHolder.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 19a2bb1c8cf..29cbeb2e66c 100755
--- a/src/server/shared/Dynamic/LinkedList.h
+++ b/src/server/shared/Dynamic/LinkedList.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 ab56de9bc24..1c6e6956dbd 100755
--- a/src/server/shared/Dynamic/LinkedReference/RefManager.h
+++ b/src/server/shared/Dynamic/LinkedReference/RefManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 fd5ce8fc25b..d4c607470cc 100755
--- a/src/server/shared/Dynamic/LinkedReference/Reference.h
+++ b/src/server/shared/Dynamic/LinkedReference/Reference.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 db5e28eff8f..ca481671796 100755
--- a/src/server/shared/Dynamic/ObjectRegistry.h
+++ b/src/server/shared/Dynamic/ObjectRegistry.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 7f6f5fa661c..67789d8ff42 100755
--- a/src/server/shared/Dynamic/TypeContainer.h
+++ b/src/server/shared/Dynamic/TypeContainer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 9bfbf47da93..19ebfb3adfc 100755
--- a/src/server/shared/Dynamic/TypeContainerFunctions.h
+++ b/src/server/shared/Dynamic/TypeContainerFunctions.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/TypeContainerFunctionsPtr.h b/src/server/shared/Dynamic/TypeContainerFunctionsPtr.h
index 7b03f8503b5..2c065d96d4a 100755
--- a/src/server/shared/Dynamic/TypeContainerFunctionsPtr.h
+++ b/src/server/shared/Dynamic/TypeContainerFunctionsPtr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 66ab8443375..beddb31f343 100755
--- a/src/server/shared/Dynamic/TypeContainerVisitor.h
+++ b/src/server/shared/Dynamic/TypeContainerVisitor.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 588bfc65755..4967ab0fbc0 100755
--- a/src/server/shared/Dynamic/TypeList.h
+++ b/src/server/shared/Dynamic/TypeList.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 92a7dddf8a8..5e7b48f9b7b 100755
--- a/src/server/shared/Dynamic/UnorderedMap.h
+++ b/src/server/shared/Dynamic/UnorderedMap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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/Log.cpp b/src/server/shared/Logging/Log.cpp
index 11f2fc090b1..abdeace4d97 100755
--- a/src/server/shared/Logging/Log.cpp
+++ b/src/server/shared/Logging/Log.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -374,7 +374,7 @@ void Log::outDB(LogTypes type, const char * str)
if (logStr.empty())
return;
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_ADD_LOG);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_LOG);
stmt->setInt32(0, realm);
stmt->setInt32(1, type);
diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h
index 5b2eb6aafb6..2381d91d98d 100755
--- a/src/server/shared/Logging/Log.h
+++ b/src/server/shared/Logging/Log.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 08318aa7a5b..6b99b79625d 100755
--- a/src/server/shared/Packets/ByteBuffer.h
+++ b/src/server/shared/Packets/ByteBuffer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 c27801a8d58..7ab95bc496d 100755
--- a/src/server/shared/Packets/WorldPacket.h
+++ b/src/server/shared/Packets/WorldPacket.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 18acc739018..2431ebb7165 100755
--- a/src/server/shared/SystemConfig.h
+++ b/src/server/shared/SystemConfig.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 6ec2f49c8ff..fd7a1130fb4 100755
--- a/src/server/shared/Threading/Callback.h
+++ b/src/server/shared/Threading/Callback.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 4d2ddd33f5f..7f78dc07db8 100755
--- a/src/server/shared/Threading/LockedQueue.h
+++ b/src/server/shared/Threading/LockedQueue.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 7e22f1afdae..f31db8fbdcd 100755
--- a/src/server/shared/Threading/Threading.cpp
+++ b/src/server/shared/Threading/Threading.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 89550ec996f..8b10e223828 100755
--- a/src/server/shared/Threading/Threading.h
+++ b/src/server/shared/Threading/Threading.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 e202b822309..d0790acadd3 100755
--- a/src/server/shared/Utilities/ByteConverter.h
+++ b/src/server/shared/Utilities/ByteConverter.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 56dcad2516b..b4f67471323 100755
--- a/src/server/shared/Utilities/EventProcessor.cpp
+++ b/src/server/shared/Utilities/EventProcessor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 3edd531035b..149ca9a4098 100755
--- a/src/server/shared/Utilities/EventProcessor.h
+++ b/src/server/shared/Utilities/EventProcessor.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.cpp b/src/server/shared/Utilities/ServiceWin32.cpp
index cd623c62132..f2887a4d1bd 100755
--- a/src/server/shared/Utilities/ServiceWin32.cpp
+++ b/src/server/shared/Utilities/ServiceWin32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 da65aebc5d2..f810a0e5624 100755
--- a/src/server/shared/Utilities/ServiceWin32.h
+++ b/src/server/shared/Utilities/ServiceWin32.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 143cde71ceb..a478c1f58d9 100755
--- a/src/server/shared/Utilities/SignalHandler.h
+++ b/src/server/shared/Utilities/SignalHandler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 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 9e9265ddc09..4d3f02f6688 100755
--- a/src/server/shared/Utilities/Timer.h
+++ b/src/server/shared/Utilities/Timer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -133,7 +133,7 @@ struct TimeTrackerSmall
{
public:
- TimeTrackerSmall(uint32 expiry)
+ TimeTrackerSmall(uint32 expiry = 0)
: i_expiryTime(expiry)
{
}
diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp
index 5919529c6bf..6ae43bc6840 100755
--- a/src/server/shared/Utilities/Util.cpp
+++ b/src/server/shared/Utilities/Util.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -30,17 +30,22 @@
typedef ACE_TSS<SFMTRand> SFMTRandTSS;
static SFMTRandTSS sfmtRand;
-int32 irand (int32 min, int32 max)
+int32 irand(int32 min, int32 max)
{
return int32(sfmtRand->IRandom(min, max));
}
-uint32 urand (uint32 min, uint32 max)
+uint32 urand(uint32 min, uint32 max)
{
return sfmtRand->URandom(min, max);
}
-int32 rand32 ()
+float frand(float min, float max)
+{
+ return float(sfmtRand->Random() * (max - min) + min);
+}
+
+int32 rand32()
{
return int32(sfmtRand->BRandom());
}
@@ -50,27 +55,33 @@ double rand_norm(void)
return sfmtRand->Random();
}
-double rand_chance (void)
+double rand_chance(void)
{
return sfmtRand->Random() * 100.0;
}
+
#else
typedef ACE_TSS<MTRand> MTRandTSS;
static MTRandTSS mtRand;
int32 irand(int32 min, int32 max)
{
- return int32(mtRand->randInt (max - min)) + min;
+ return int32(mtRand->randInt(max - min)) + min;
}
uint32 urand(uint32 min, uint32 max)
{
- return mtRand->randInt (max - min) + min;
+ return mtRand->randInt(max - min) + min;
+}
+
+float frand(float min, float max)
+{
+ return float(mtRand->randExc(max - min) + min);
}
int32 rand32()
{
- return mtRand->randInt ();
+ return mtRand->randInt();
}
double rand_norm(void)
diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h
index 8ded45a7bb6..684b26eea63 100755
--- a/src/server/shared/Utilities/Util.h
+++ b/src/server/shared/Utilities/Util.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -64,6 +64,9 @@ inline uint32 secsToTimeBitFields(time_t secs)
/* Return a random number in the range 0 .. RAND32_MAX. */
int32 rand32();
+ /* Return a random number in the range min..max */
+ float frand(float min, float max);
+
/* Return a random double from 0.0 to 1.0 (exclusive). Floats support only 7 valid decimal digits.
* A double supports up to 15 valid decimal digits and is used internally (RAND32_MAX has 10 digits).
* With an FPU, there is usually no difference in performance between float and double. */
diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt
index cdd9b04c234..191bbbf35b4 100644
--- a/src/server/worldserver/CMakeLists.txt
+++ b/src/server/worldserver/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2012 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
@@ -57,12 +57,10 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/shared/Database
${CMAKE_SOURCE_DIR}/src/server/shared/DataStores
${CMAKE_SOURCE_DIR}/src/server/shared/Debugging
- ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/CountedReference
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic
${CMAKE_SOURCE_DIR}/src/server/shared/Logging
${CMAKE_SOURCE_DIR}/src/server/shared/Packets
- ${CMAKE_SOURCE_DIR}/src/server/shared/Policies
${CMAKE_SOURCE_DIR}/src/server/shared/Threading
${CMAKE_SOURCE_DIR}/src/server/shared/Utilities
${CMAKE_SOURCE_DIR}/src/server/game
@@ -108,6 +106,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/game/Grids
${CMAKE_SOURCE_DIR}/src/server/game/Groups
${CMAKE_SOURCE_DIR}/src/server/game/Guilds
+ ${CMAKE_SOURCE_DIR}/src/server/game/Handlers
${CMAKE_SOURCE_DIR}/src/server/game/Instances
${CMAKE_SOURCE_DIR}/src/server/game/Loot
${CMAKE_SOURCE_DIR}/src/server/game/Mails
@@ -123,7 +122,6 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/game/Reputation
${CMAKE_SOURCE_DIR}/src/server/game/Scripting
${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol
- ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol/Handlers
${CMAKE_SOURCE_DIR}/src/server/game/Server
${CMAKE_SOURCE_DIR}/src/server/game/Skills
${CMAKE_SOURCE_DIR}/src/server/game/Spells
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp
index 61352521d9f..8e04a9c2f34 100755
--- a/src/server/worldserver/CommandLine/CliRunnable.cpp
+++ b/src/server/worldserver/CommandLine/CliRunnable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -292,8 +292,13 @@ void ChatHandler::HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo
return;
}
- CharacterDatabase.PExecute("UPDATE characters SET name='%s', account='%u', deleteDate=NULL, deleteInfos_Name=NULL, deleteInfos_Account=NULL WHERE deleteDate IS NOT NULL AND guid = %u",
- delInfo.name.c_str(), delInfo.accountId, delInfo.lowguid);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_RESTORE_DELETE_INFO);
+
+ stmt->setString(0, delInfo.name);
+ stmt->setUInt32(1, delInfo.accountId);
+ stmt->setUInt32(2, delInfo.lowguid);
+
+ CharacterDatabase.Execute(stmt);
}
/**
diff --git a/src/server/worldserver/CommandLine/CliRunnable.h b/src/server/worldserver/CommandLine/CliRunnable.h
index 416dc8e9008..af5691367b3 100755
--- a/src/server/worldserver/CommandLine/CliRunnable.h
+++ b/src/server/worldserver/CommandLine/CliRunnable.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 1ce247d9249..23f925dedef 100755
--- a/src/server/worldserver/Main.cpp
+++ b/src/server/worldserver/Main.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 42d72aa2c6f..d84cfc1a4a4 100755
--- a/src/server/worldserver/Master.cpp
+++ b/src/server/worldserver/Master.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -457,7 +457,7 @@ bool Master::_StartDB()
clearOnlineAccounts();
///- Insert version info into DB
- WorldDatabase.PExecute("UPDATE version SET core_version = '%s', core_revision = '%s'", _FULLVERSION, _HASH);
+ WorldDatabase.PExecute("UPDATE version SET core_version = '%s', core_revision = '%s'", _FULLVERSION, _HASH); // One-time query
sWorld->LoadDBVersion();
@@ -486,5 +486,5 @@ void Master::clearOnlineAccounts()
CharacterDatabase.DirectExecute("UPDATE characters SET online = 0 WHERE online <> 0");
// Battleground instance ids reset at server restart
- CharacterDatabase.DirectExecute(CharacterDatabase.GetPreparedStatement(CHAR_RESET_PLAYERS_BGDATA));
+ CharacterDatabase.DirectExecute(CharacterDatabase.GetPreparedStatement(CHAR_UPD_PLAYERS_BGDATA));
}
diff --git a/src/server/worldserver/Master.h b/src/server/worldserver/Master.h
index 76259199d68..17c230ef7c7 100755
--- a/src/server/worldserver/Master.h
+++ b/src/server/worldserver/Master.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 60145cf99aa..3f5d7bde736 100644
--- a/src/server/worldserver/RemoteAccess/RARunnable.cpp
+++ b/src/server/worldserver/RemoteAccess/RARunnable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 76807e5797c..9b3e93cc5fa 100644
--- a/src/server/worldserver/RemoteAccess/RARunnable.h
+++ b/src/server/worldserver/RemoteAccess/RARunnable.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 82238ee54bc..e5637d282c6 100755
--- a/src/server/worldserver/RemoteAccess/RASocket.cpp
+++ b/src/server/worldserver/RemoteAccess/RASocket.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 0c626d5840e..1c9b1ac24b5 100755
--- a/src/server/worldserver/RemoteAccess/RASocket.h
+++ b/src/server/worldserver/RemoteAccess/RASocket.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 fa7c34cffbf..8b7d8c19071 100755
--- a/src/server/worldserver/TCSoap/TCSoap.cpp
+++ b/src/server/worldserver/TCSoap/TCSoap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 37ed841086d..285adaaaf4b 100755
--- a/src/server/worldserver/TCSoap/TCSoap.h
+++ b/src/server/worldserver/TCSoap/TCSoap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can 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 c7e4891747d..8ea54ca599e 100755
--- a/src/server/worldserver/WorldThread/WorldRunnable.cpp
+++ b/src/server/worldserver/WorldThread/WorldRunnable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 03805e67541..31ae51f064d 100755
--- a/src/server/worldserver/WorldThread/WorldRunnable.h
+++ b/src/server/worldserver/WorldThread/WorldRunnable.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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.rc b/src/server/worldserver/worldserver.rc
index 7712a50cffb..2f778e599a1 100755
--- a/src/server/worldserver/worldserver.rc
+++ b/src/server/worldserver/worldserver.rc
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2012 TrinityCore <http://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 64a7dcb7276..82f71aed030 100644
--- a/src/tools/CMakeLists.txt
+++ b/src/tools/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2012 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 641bf00c678..afeb8af99ba 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-2011 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2012 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/vmap3_assembler/CMakeLists.txt b/src/tools/vmap3_assembler/CMakeLists.txt
index d596fb3e818..ba5d1649d38 100644
--- a/src/tools/vmap3_assembler/CMakeLists.txt
+++ b/src/tools/vmap3_assembler/CMakeLists.txt
@@ -1,5 +1,5 @@
# Copyright (C) 2005-2009 MaNGOS project <http://getmangos.com/>
-# Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2012 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/vmap3_extractor/CMakeLists.txt b/src/tools/vmap3_extractor/CMakeLists.txt
index 905e9318985..2ff2fd0cf6b 100644
--- a/src/tools/vmap3_extractor/CMakeLists.txt
+++ b/src/tools/vmap3_extractor/CMakeLists.txt
@@ -1,5 +1,5 @@
# Copyright (C) 2005-2009 MaNGOS project <http://getmangos.com/>
-# Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2012 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