aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/base/characters_database.sql28
-rw-r--r--sql/updates/characters/master/2020_04_25_00_characters_2017_04_03_00_characters.sql11
-rw-r--r--sql/updates/characters/master/2020_04_26_00_characters_2017_04_12_00_characters.sql2
-rw-r--r--sql/updates/characters/master/2020_04_26_01_characters_2017_04_12_01_characters.sql4
-rw-r--r--sql/updates/world/master/2020_04_25_00_world_2017_02_21_03_world.sql10
-rw-r--r--sql/updates/world/master/2020_04_25_01_world_2017_04_01_03_world.sql1
-rw-r--r--sql/updates/world/master/2020_04_25_02_world_2017_04_01_04_world.sql9
-rw-r--r--sql/updates/world/master/2020_04_25_03_world_2017_04_02_01_world.sql1
-rw-r--r--sql/updates/world/master/2020_04_26_00_world_2017_04_09_00_world.sql2
-rw-r--r--sql/updates/world/master/2020_04_26_01_world_2017_04_09_02_world.sql18
-rw-r--r--sql/updates/world/master/2020_04_26_02_world_2017_04_12_00_world.sql1
-rw-r--r--sql/updates/world/master/2020_04_26_03_world_2017_04_13_01_world.sql50
-rw-r--r--sql/updates/world/master/2020_04_26_04_world_2017_04_13_02_world.sql4
-rw-r--r--sql/updates/world/master/2020_04_26_05_world_2017_04_20_01_world.sql11
-rw-r--r--sql/updates/world/master/2020_04_27_00_world_2017_04_24_03_world.sql29
-rw-r--r--sql/updates/world/master/2020_04_27_01_world_2017_04_24_04_world.sql97
-rw-r--r--sql/updates/world/master/2020_04_27_02_world_2017_04_24_05_world.sql13
-rw-r--r--sql/updates/world/master/2020_04_27_03_world_2017_04_24_07_world.sql16
-rw-r--r--sql/updates/world/master/2020_04_27_04_world_2017_04_24_08_world.sql19
-rw-r--r--sql/updates/world/master/2020_04_27_05_world_2017_04_24_09_world.sql13
-rw-r--r--sql/updates/world/master/2020_04_27_06_world_2017_04_24_10_world.sql229
-rw-r--r--sql/updates/world/master/2020_04_27_07_world_2017_04_27_02_world.sql661
-rw-r--r--sql/updates/world/master/2020_04_27_08_world_2017_04_28_00_world.sql264
-rw-r--r--sql/updates/world/master/2020_04_29_00_world_2017_04_10_00_world.sql83
-rw-r--r--src/common/Collision/Maps/TileAssembler.cpp5
-rw-r--r--src/server/database/Database/Implementation/CharacterDatabase.cpp11
-rw-r--r--src/server/database/Database/Implementation/CharacterDatabase.h3
-rw-r--r--src/server/game/AI/CoreAI/TotemAI.cpp3
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.cpp10
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.h3
-rw-r--r--src/server/game/AI/CreatureAI.cpp32
-rw-r--r--src/server/game/AI/CreatureAI.h7
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp6
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp8
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.h1
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp13
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp9
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h4
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseMgr.cpp10
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseMgr.h2
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBot.cpp43
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBot.h39
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp290
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h76
-rw-r--r--src/server/game/Battlefield/Zones/BattlefieldTB.cpp2
-rw-r--r--src/server/game/Battlefield/Zones/BattlefieldWG.cpp24
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp2
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp4
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp8
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp12
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp8
-rw-r--r--src/server/game/Chat/Chat.cpp2
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp51
-rw-r--r--src/server/game/Entities/Creature/Creature.h4
-rw-r--r--src/server/game/Entities/Creature/CreatureGroups.cpp11
-rw-r--r--src/server/game/Entities/Creature/CreatureGroups.h3
-rw-r--r--src/server/game/Entities/Creature/TemporarySummon.cpp8
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp4
-rw-r--r--src/server/game/Entities/Item/Item.cpp190
-rw-r--r--src/server/game/Entities/Item/Item.h8
-rw-r--r--src/server/game/Entities/Object/Object.cpp2
-rw-r--r--src/server/game/Entities/Object/Updates/ViewerDependentValues.h2
-rw-r--r--src/server/game/Entities/Pet/Pet.cpp6
-rw-r--r--src/server/game/Entities/Pet/Pet.h1
-rw-r--r--src/server/game/Entities/Player/Player.cpp268
-rw-r--r--src/server/game/Entities/Player/Player.h12
-rw-r--r--src/server/game/Entities/Unit/StatSystem.cpp98
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp245
-rw-r--r--src/server/game/Entities/Unit/Unit.h29
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp27
-rw-r--r--src/server/game/Handlers/AuctionHouseHandler.cpp34
-rw-r--r--src/server/game/Handlers/LootHandler.cpp3
-rw-r--r--src/server/game/Handlers/NPCHandler.cpp2
-rw-r--r--src/server/game/Handlers/PetHandler.cpp6
-rw-r--r--src/server/game/Handlers/QuestHandler.cpp52
-rw-r--r--src/server/game/Instances/InstanceSaveMgr.cpp62
-rw-r--r--src/server/game/Loot/Loot.cpp28
-rw-r--r--src/server/game/Loot/Loot.h8
-rw-r--r--src/server/game/Loot/LootItemStorage.cpp365
-rw-r--r--src/server/game/Loot/LootItemStorage.h99
-rw-r--r--src/server/game/Maps/Map.cpp8
-rw-r--r--src/server/game/Movement/MotionMaster.cpp20
-rw-r--r--src/server/game/Movement/MotionMaster.h5
-rwxr-xr-xsrc/server/game/Movement/MovementGenerator.h17
-rw-r--r--src/server/game/Movement/MovementGeneratorImpl.h8
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp109
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h13
-rw-r--r--src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp253
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h24
-rw-r--r--src/server/game/Movement/MovementGenerators/FormationMovementGenerator.cpp130
-rw-r--r--src/server/game/Movement/MovementGenerators/FormationMovementGenerator.h49
-rw-r--r--src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp80
-rw-r--r--src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h32
-rw-r--r--src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp32
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/IdleMovementGenerator.h15
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp149
-rw-r--r--src/server/game/Movement/MovementGenerators/PointMovementGenerator.h41
-rw-r--r--src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp208
-rw-r--r--src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h21
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp426
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h105
-rw-r--r--src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp15
-rw-r--r--src/server/game/Quests/QuestDef.h4
-rw-r--r--src/server/game/Reputation/ReputationMgr.cpp7
-rw-r--r--src/server/game/Reputation/ReputationMgr.h8
-rw-r--r--src/server/game/Scripting/ScriptMgr.cpp27
-rw-r--r--src/server/game/Scripting/ScriptMgr.h12
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp45
-rw-r--r--src/server/game/Spells/Spell.cpp85
-rw-r--r--src/server/game/Spells/SpellEffects.cpp36
-rw-r--r--src/server/game/Spells/SpellInfo.cpp20
-rw-r--r--src/server/game/Spells/SpellMgr.cpp183
-rw-r--r--src/server/game/Spells/SpellMgr.h24
-rw-r--r--src/server/game/Time/UpdateTime.cpp1
-rw-r--r--src/server/game/World/World.cpp4
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp4
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp4
-rw-r--r--src/server/scripts/Commands/cs_pet.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp44
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp14
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp16
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_ghostlands.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_hinterlands.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/zone_wetlands.cpp2
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp4
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp2
-rw-r--r--src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp2
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp4
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp6
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp4
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp6
-rw-r--r--src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp2
-rw-r--r--src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp2
-rw-r--r--src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp12
-rw-r--r--src/server/scripts/Kalimdor/zone_ashenvale.cpp4
-rw-r--r--src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp12
-rw-r--r--src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_felwood.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_silithus.cpp6
-rw-r--r--src/server/scripts/Kalimdor/zone_tanaris.cpp6
-rw-r--r--src/server/scripts/Kalimdor/zone_the_barrens.cpp18
-rw-r--r--src/server/scripts/Kalimdor/zone_winterspring.cpp2
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp2
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp48
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp4
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp2
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp3
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp6
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp3
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp9
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp5
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp10
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp4
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp4
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp3
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp4
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_erekem.cpp2
-rw-r--r--src/server/scripts/Northrend/zone_borean_tundra.cpp14
-rw-r--r--src/server/scripts/Northrend/zone_dragonblight.cpp4
-rw-r--r--src/server/scripts/Northrend/zone_grizzly_hills.cpp4
-rw-r--r--src/server/scripts/Northrend/zone_howling_fjord.cpp2
-rw-r--r--src/server/scripts/Northrend/zone_icecrown.cpp6
-rw-r--r--src/server/scripts/Northrend/zone_sholazar_basin.cpp2
-rw-r--r--src/server/scripts/Northrend/zone_storm_peaks.cpp2
-rw-r--r--src/server/scripts/Northrend/zone_wintergrasp.cpp4
-rw-r--r--src/server/scripts/Northrend/zone_zuldrak.cpp8
-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.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_illidan.cpp8
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp12
-rw-r--r--src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp4
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp6
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp4
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp2
-rw-r--r--src/server/scripts/Outland/zone_hellfire_peninsula.cpp12
-rw-r--r--src/server/scripts/Outland/zone_nagrand.cpp4
-rw-r--r--src/server/scripts/Outland/zone_netherstorm.cpp4
-rw-r--r--src/server/scripts/Outland/zone_shadowmoon_valley.cpp8
-rw-r--r--src/server/scripts/Outland/zone_shattrath_city.cpp4
-rw-r--r--src/server/scripts/Outland/zone_terokkar_forest.cpp20
-rw-r--r--src/server/scripts/Outland/zone_zangarmarsh.cpp8
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp2
-rw-r--r--src/server/scripts/World/go_scripts.cpp2
-rw-r--r--src/server/scripts/World/npcs_special.cpp8
229 files changed, 4434 insertions, 2228 deletions
diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql
index 23240d7d96c..625ad4ef783 100644
--- a/sql/base/characters_database.sql
+++ b/sql/base/characters_database.sql
@@ -481,9 +481,9 @@ DROP TABLE IF EXISTS `character_arena_stats`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `character_arena_stats` (
- `guid` bigint(20) NOT NULL,
- `slot` tinyint(3) NOT NULL,
- `matchMakerRating` smallint(5) NOT NULL,
+ `guid` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `slot` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `matchMakerRating` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`guid`,`slot`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -738,8 +738,8 @@ DROP TABLE IF EXISTS `character_equipmentsets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `character_equipmentsets` (
- `guid` bigint(20) NOT NULL DEFAULT '0',
- `setguid` bigint(20) NOT NULL AUTO_INCREMENT,
+ `guid` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `setguid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`setindex` tinyint(3) unsigned NOT NULL DEFAULT '0',
`name` varchar(31) NOT NULL,
`iconname` varchar(100) NOT NULL,
@@ -1895,7 +1895,7 @@ DROP TABLE IF EXISTS `creature_respawn`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `creature_respawn` (
`guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
- `respawnTime` int(10) unsigned NOT NULL DEFAULT '0',
+ `respawnTime` bigint(20) unsigned NOT NULL DEFAULT '0',
`mapId` smallint(10) unsigned NOT NULL DEFAULT '0',
`instanceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Instance Identifier',
PRIMARY KEY (`guid`,`instanceId`),
@@ -1969,7 +1969,7 @@ DROP TABLE IF EXISTS `gameobject_respawn`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gameobject_respawn` (
`guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
- `respawnTime` int(10) unsigned NOT NULL DEFAULT '0',
+ `respawnTime` bigint(20) unsigned NOT NULL DEFAULT '0',
`mapId` smallint(10) unsigned NOT NULL DEFAULT '0',
`instanceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Instance Identifier',
PRIMARY KEY (`guid`,`instanceId`),
@@ -2616,7 +2616,7 @@ DROP TABLE IF EXISTS `instance`;
CREATE TABLE `instance` (
`id` int(10) unsigned NOT NULL DEFAULT '0',
`map` smallint(5) unsigned NOT NULL DEFAULT '0',
- `resettime` int(10) unsigned NOT NULL DEFAULT '0',
+ `resettime` bigint(20) unsigned NOT NULL DEFAULT '0',
`difficulty` tinyint(3) unsigned NOT NULL DEFAULT '0',
`completedEncounters` int(10) unsigned NOT NULL DEFAULT '0',
`data` tinytext NOT NULL,
@@ -2647,7 +2647,7 @@ DROP TABLE IF EXISTS `instance_reset`;
CREATE TABLE `instance_reset` (
`mapid` smallint(5) unsigned NOT NULL DEFAULT '0',
`difficulty` tinyint(3) unsigned NOT NULL DEFAULT '0',
- `resettime` int(10) unsigned NOT NULL DEFAULT '0',
+ `resettime` bigint(20) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`mapid`,`difficulty`),
KEY `difficulty` (`difficulty`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -3180,8 +3180,8 @@ DROP TABLE IF EXISTS `item_loot_money`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `item_loot_money` (
- `container_id` bigint(20) NOT NULL DEFAULT '0' COMMENT 'guid of container (item_instance.guid)',
- `money` int(10) NOT NULL DEFAULT '0' COMMENT 'money loot (in copper)',
+ `container_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'guid of container (item_instance.guid)',
+ `money` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'money loot (in copper)',
PRIMARY KEY (`container_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -3771,7 +3771,11 @@ INSERT INTO `updates` VALUES
('2019_12_05_00_characters.sql','EA381C9634A5646A3168F15DF4E06A708A622762','RELEASED','2019-12-05 20:56:58',0),
('2020_02_17_00_characters.sql','E1519A81D35F19B48B3C75A83A270CB4BA0B84F2','RELEASED','2020-02-17 21:55:17',0),
('2020_04_20_00_characters.sql','977B5E0C894E0A7E80B2A9626F17CA636A69BD22','RELEASED','2020-04-20 19:08:18',0),
-('2020_04_24_00_characters.sql','85E2E0395A9457A53D73A9E0A7BB39B7E4C429BF','RELEASED','2020-04-24 22:04:59',0);
+('2020_04_24_00_characters.sql','85E2E0395A9457A53D73A9E0A7BB39B7E4C429BF','RELEASED','2020-04-24 22:04:59',0),
+('2020_04_25_00_characters_2017_04_03_00_characters.sql','00FA3EFADAF807AC96619A3FE47216E21C3FCB19','RELEASED','2020-04-25 00:00:00',0),
+('2020_04_26_00_characters_2017_04_12_00_characters.sql','86AA94DA9B1EA283101100886C10F648C0CE6494','RELEASED','2020-04-26 00:00:00',0),
+('2020_04_26_01_characters_2017_04_12_01_characters.sql','5A8A1215E3A2356722F52CD7A64BBE03D21FBEA3','RELEASED','2020-04-26 00:00:00',0);
+
/*!40000 ALTER TABLE `updates` ENABLE KEYS */;
UNLOCK TABLES;
diff --git a/sql/updates/characters/master/2020_04_25_00_characters_2017_04_03_00_characters.sql b/sql/updates/characters/master/2020_04_25_00_characters_2017_04_03_00_characters.sql
new file mode 100644
index 00000000000..3a962753a55
--- /dev/null
+++ b/sql/updates/characters/master/2020_04_25_00_characters_2017_04_03_00_characters.sql
@@ -0,0 +1,11 @@
+ALTER TABLE `character_arena_stats`
+CHANGE `guid` `guid` BIGINT(20) unsigned NOT NULL DEFAULT '0',
+CHANGE `slot` `slot` TINYINT(3) unsigned NOT NULL DEFAULT '0',
+CHANGE `matchMakerRating` `matchMakerRating` SMALLINT(5) unsigned NOT NULL DEFAULT 0;
+
+ALTER TABLE `character_equipmentsets`
+CHANGE `guid` `guid` BIGINT(20) unsigned NOT NULL DEFAULT '0',
+CHANGE `setguid` `setguid` BIGINT(20) unsigned NOT NULL AUTO_INCREMENT;
+
+ALTER TABLE `item_loot_money`
+CHANGE `container_id` `container_id` BIGINT(20) unsigned NOT NULL DEFAULT '0' COMMENT 'guid of container (item_instance.guid)';
diff --git a/sql/updates/characters/master/2020_04_26_00_characters_2017_04_12_00_characters.sql b/sql/updates/characters/master/2020_04_26_00_characters_2017_04_12_00_characters.sql
new file mode 100644
index 00000000000..5340fbfca3e
--- /dev/null
+++ b/sql/updates/characters/master/2020_04_26_00_characters_2017_04_12_00_characters.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `item_loot_money`
+CHANGE `money` `money` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'money loot (in copper)';
diff --git a/sql/updates/characters/master/2020_04_26_01_characters_2017_04_12_01_characters.sql b/sql/updates/characters/master/2020_04_26_01_characters_2017_04_12_01_characters.sql
new file mode 100644
index 00000000000..ed5617d2750
--- /dev/null
+++ b/sql/updates/characters/master/2020_04_26_01_characters_2017_04_12_01_characters.sql
@@ -0,0 +1,4 @@
+ALTER TABLE `creature_respawn` CHANGE `respawnTime` `respawnTime` bigint(20) unsigned NOT NULL DEFAULT '0';
+ALTER TABLE `gameobject_respawn` CHANGE `respawnTime` `respawnTime` bigint(20) unsigned NOT NULL DEFAULT '0';
+ALTER TABLE `instance` CHANGE `resettime` `resettime` bigint(20) unsigned NOT NULL DEFAULT '0';
+ALTER TABLE `instance_reset` CHANGE `resettime` `resettime` bigint(20) unsigned NOT NULL DEFAULT '0';
diff --git a/sql/updates/world/master/2020_04_25_00_world_2017_02_21_03_world.sql b/sql/updates/world/master/2020_04_25_00_world_2017_02_21_03_world.sql
new file mode 100644
index 00000000000..7837187f30e
--- /dev/null
+++ b/sql/updates/world/master/2020_04_25_00_world_2017_02_21_03_world.sql
@@ -0,0 +1,10 @@
+UPDATE `spell_enchant_proc_data` SET `Chance`=2, `ProcsPerMinute`=0, `AttributesMask`=0x3 WHERE `EnchantID`=1894; -- Icy Weapon
+UPDATE `spell_enchant_proc_data` SET `AttributesMask`=0x2 WHERE `EnchantID`=1898; -- Lifestealing
+UPDATE `spell_enchant_proc_data` SET `ProcsPerMinute`=3 WHERE `EnchantID`=1899; -- Unholy Weapon
+UPDATE `spell_enchant_proc_data` SET `AttributesMask`=0x2 WHERE `EnchantID`=1900; -- Crusader
+UPDATE `spell_enchant_proc_data` SET `AttributesMask`=0x1 WHERE `EnchantID`=2675; -- Battlemaster
+
+-- Condition for source Spell condition type Level
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceGroup`=0 AND `SourceEntry`=46629 AND `SourceId`=0;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(17, 0, 46629, 0, 0, 27, 0, 74, 2, 0, 0, 0, 0, '', 'Spell Deathfrost will hit the caster of the spell if player level must be lesser than 74.');
diff --git a/sql/updates/world/master/2020_04_25_01_world_2017_04_01_03_world.sql b/sql/updates/world/master/2020_04_25_01_world_2017_04_01_03_world.sql
new file mode 100644
index 00000000000..713b352e5f6
--- /dev/null
+++ b/sql/updates/world/master/2020_04_25_01_world_2017_04_01_03_world.sql
@@ -0,0 +1 @@
+DELETE FROM `linked_respawn` WHERE `guid` IN(202794,202795,202796);
diff --git a/sql/updates/world/master/2020_04_25_02_world_2017_04_01_04_world.sql b/sql/updates/world/master/2020_04_25_02_world_2017_04_01_04_world.sql
new file mode 100644
index 00000000000..acf5d7d8c0e
--- /dev/null
+++ b/sql/updates/world/master/2020_04_25_02_world_2017_04_01_04_world.sql
@@ -0,0 +1,9 @@
+
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=17734;
+INSERT INTO `smart_scripts` (`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`, `comment`) VALUES
+(17734, 0, 0, 0, 9, 0, 100, 6, 0, 10, 10500, 20000, 11, 25778, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Underbog Lord - On Target within 10 yards range - Cast \'Knock Away\' '),
+(17734, 0, 1, 0, 0, 0, 100, 6, 7100, 7100, 12000, 16000, 11, 32065, 33, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Underbog Lord - In Combat - Cast \'Fungal Decay\''),
+(17734, 0, 2, 0, 2, 0, 100, 6, 10000, 10000, 10000, 12000, 11, 40318, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Underbog Lord - IC - Cast \'Growth\' '),
+(17734, 0, 3, 4, 2, 0, 100, 7, 0, 30, 0, 0, 11, 8599, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Underbog Lord - Between 0-30% Health - Cast \'Enrage\' (No Repeat) '),
+(17734, 0, 4, 0, 61, 0, 100, 7, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Underbog Lord - Between 0-30% Health - Say Line 0 (No Repeat) (Dungeon)');
+UPDATE `creature_template` SET `gossip_menu_id`='7520' WHERE `entry`=22938;
diff --git a/sql/updates/world/master/2020_04_25_03_world_2017_04_02_01_world.sql b/sql/updates/world/master/2020_04_25_03_world_2017_04_02_01_world.sql
new file mode 100644
index 00000000000..dc6e6eeae90
--- /dev/null
+++ b/sql/updates/world/master/2020_04_25_03_world_2017_04_02_01_world.sql
@@ -0,0 +1 @@
+UPDATE`smart_scripts` SET `event_type`=0 WHERE `entryorguid`=17734 AND `source_type`=0 AND `id`=2 AND `link`=0;
diff --git a/sql/updates/world/master/2020_04_26_00_world_2017_04_09_00_world.sql b/sql/updates/world/master/2020_04_26_00_world_2017_04_09_00_world.sql
new file mode 100644
index 00000000000..acdcd14322e
--- /dev/null
+++ b/sql/updates/world/master/2020_04_26_00_world_2017_04_09_00_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `waypoint_scripts` SET `datalong2` = 2 WHERE `id` = 14 AND `command` = 16 AND `datalong` = 9739;
diff --git a/sql/updates/world/master/2020_04_26_01_world_2017_04_09_02_world.sql b/sql/updates/world/master/2020_04_26_01_world_2017_04_09_02_world.sql
new file mode 100644
index 00000000000..0d5d370c620
--- /dev/null
+++ b/sql/updates/world/master/2020_04_26_01_world_2017_04_09_02_world.sql
@@ -0,0 +1,18 @@
+--
+-- Argent Tournament Champion's Pennant gossip option texts
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=35513 WHERE `MenuId`=10317 AND `OptionIndex`=0;
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=35515 WHERE `MenuId`=10317 AND `OptionIndex`=1;
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=35534 WHERE `MenuId`=10317 AND `OptionIndex`=2;
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=33681, `OptionText`="Darkspear Champion's Pennant" WHERE `MenuId`=10317 AND `OptionIndex`=3;
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=33682, `OptionText`="Forsaken Champion's Pennant" WHERE `MenuId`=10317 AND `OptionIndex`=4;
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=33683 WHERE `MenuId`=10317 AND `OptionIndex`=5;
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=33685 WHERE `MenuId`=10317 AND `OptionIndex`=6;
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=33686 WHERE `MenuId`=10317 AND `OptionIndex`=7;
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=35513 WHERE `MenuId`=10318 AND `OptionIndex`=0;
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=35515 WHERE `MenuId`=10318 AND `OptionIndex`=1;
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=35534 WHERE `MenuId`=10318 AND `OptionIndex`=2;
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=33675 WHERE `MenuId`=10318 AND `OptionIndex`=3;
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=33676 WHERE `MenuId`=10318 AND `OptionIndex`=4;
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=33678 WHERE `MenuId`=10318 AND `OptionIndex`=5;
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=33679 WHERE `MenuId`=10318 AND `OptionIndex`=6;
+UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=33401 WHERE `MenuId`=10318 AND `OptionIndex`=7;
diff --git a/sql/updates/world/master/2020_04_26_02_world_2017_04_12_00_world.sql b/sql/updates/world/master/2020_04_26_02_world_2017_04_12_00_world.sql
new file mode 100644
index 00000000000..d532af7b2e9
--- /dev/null
+++ b/sql/updates/world/master/2020_04_26_02_world_2017_04_12_00_world.sql
@@ -0,0 +1 @@
+UPDATE `spell_proc` SET `ProcFlags`=`ProcFlags`|0x00040000 WHERE `SpellId`=33953;
diff --git a/sql/updates/world/master/2020_04_26_03_world_2017_04_13_01_world.sql b/sql/updates/world/master/2020_04_26_03_world_2017_04_13_01_world.sql
new file mode 100644
index 00000000000..d9aee2b31d7
--- /dev/null
+++ b/sql/updates/world/master/2020_04_26_03_world_2017_04_13_01_world.sql
@@ -0,0 +1,50 @@
+--
+UPDATE `creature` SET `MovementType`=0, `spawndist`=0 WHERE `guid`=122602;
+DELETE FROM `creature` WHERE `guid` IN (78330,78331,78332,78333,78334,78335,78336,78337,78338,78339,78340,78341,78343,78344,78345,78346,78347,78348,78349,78350,78351,78352,78353,78354,78355,78356,78357,78358,78559,78560,78561,78562,78563,78564,78694,78717,78718,78719,78797,78798,78799,78800,78801,78802,78803,78804);
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES
+(78330, 25201, 571, 0, 0, '0', 0, 0, 0, 4061.56, 6254.12, 22.0839, 0.366518, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78331, 25201, 571, 0, 0, '0', 0, 0, 0, 4180.65, 6308.74, 13.1165, -2.1293, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78332, 25201, 571, 0, 0, '0', 0, 0, 0, 4104.5, 6300.65, 23.5285, 2.47837, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78333, 25201, 571, 0, 0, '0', 0, 0, 0, 4270.82, 6400.72, 0.6071, -2.35619, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78334, 25201, 571, 0, 0, '0', 0, 0, 0, 3956.81, 6368.30, 11.289, 5.480332, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78335, 25201, 571, 0, 0, '0', 0, 0, 0, 3957.67, 6367.97, 11.289, 5.791350, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78336, 25201, 571, 0, 0, '0', 0, 0, 0, 4175.71, 6243.43, 8.2020, 5.799035, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78337, 25201, 571, 0, 0, '0', 0, 0, 0, 4176.64, 6242.94, 8.2020, 5.799035, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78338, 25201, 571, 0, 0, '0', 0, 0, 0, 4297.82, 6206.78, 0.5043, 2.017601, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78339, 25201, 571, 0, 0, '0', 0, 0, 0, 4298.33, 6205.73, 0.4871, 2.017601, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78340, 25201, 571, 0, 0, '0', 0, 0, 0, 3932.18, 6394.24, 11.314, 3.171899, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78341, 25201, 571, 0, 0, '0', 0, 0, 0, 3932.65, 6393.43, 11.259, 3.142636, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78343, 25201, 571, 0, 0, '0', 0, 0, 0, 4030.72, 6332.52, 8.9144, 5.808798, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78344, 25201, 571, 0, 0, '0', 0, 0, 0, 4031.13, 6331.81, 8.9139, 1.306896, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78345, 25201, 571, 0, 0, '0', 0, 0, 0, 4282.87, 6298.21, 0.4109, 3.798534, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78346, 25201, 571, 0, 0, '0', 0, 0, 0, 4283.54, 6297.61, 0.4076, 3.798534, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78347, 25201, 571, 0, 0, '0', 0, 0, 0, 4231.83, 6183.78, 1.0935, 1.100599, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78348, 25201, 571, 0, 0, '0', 0, 0, 0, 4231.83, 6182.69, 1.0516, 1.204271, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78349, 25201, 571, 0, 0, '0', 0, 0, 0, 4161.01, 6187.51, 9.1954, 0.661131, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78350, 25201, 571, 0, 0, '0', 0, 0, 0, 4161.59, 6187.52, 9.1962, 0.661131, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78351, 25201, 571, 0, 0, '0', 0, 0, 0, 4061.44, 6254.89, 21.996, 0.734084, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78352, 25201, 571, 0, 0, '0', 0, 0, 0, 4062.39, 6253.85, 21.996, 0.734084, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78353, 25201, 571, 0, 0, '0', 0, 0, 0, 4296.56, 6250.80, 0.2237, 5.844411, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78354, 25201, 571, 0, 0, '0', 0, 0, 0, 4296.05, 6250.52, 0.2237, 5.844411, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78355, 25201, 571, 0, 0, '0', 0, 0, 0, 3985.44, 6343.04, 7.8783, 5.061456, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78356, 25201, 571, 0, 0, '0', 0, 0, 0, 3984.80, 6343.43, 7.8614, 5.061456, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78357, 25201, 571, 0, 0, '0', 0, 0, 0, 3986.35, 6481.46, 21.904, 3.438305, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78358, 25201, 571, 0, 0, '0', 0, 0, 0, 3987.27, 6481.25, 21.812, 3.438305, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78559, 25201, 571, 0, 0, '0', 0, 0, 0, 4180.73, 6308.06, 13.098, 5.146629, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78560, 25201, 571, 0, 0, '0', 0, 0, 0, 4180.34, 6308.90, 13.098, 5.146629, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78561, 25201, 571, 0, 0, '0', 0, 0, 0, 4225.53, 6229.37, 1.2251, 4.971051, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78562, 25201, 571, 0, 0, '0', 0, 0, 0, 4225.26, 6230.38, 1.3030, 2.561448, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78563, 25201, 571, 0, 0, '0', 0, 0, 0, 3997.85, 6281.56, 8.0830, 6.248281, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78564, 25201, 571, 0, 0, '0', 0, 0, 0, 3997.26, 6282.03, 7.9745, 6.248281, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78694, 25201, 571, 0, 0, '0', 0, 0, 0, 4104.50, 6301.19, 23.492, 2.575759, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78717, 25201, 571, 0, 0, '0', 0, 0, 0, 4103.94, 6300.31, 23.268, 1.843768, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78718, 25201, 571, 0, 0, '0', 0, 0, 0, 4052.07, 6298.71, 2.6548, 3.493798, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78719, 25201, 571, 0, 0, '0', 0, 0, 0, 4051.17, 6298.75, 2.6548, 3.493798, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78797, 25201, 571, 0, 0, '0', 0, 0, 0, 3830.56, 6425.12, 21.996, 0.087266, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78798, 25201, 571, 0, 0, '0', 0, 0, 0, 3830.25, 6424.62, 21.996, 0.087266, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78799, 25201, 571, 0, 0, '0', 0, 0, 0, 4038.72, 6469.18, 22.230, 1.727880, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78800, 25201, 571, 0, 0, '0', 0, 0, 0, 4038.64, 6468.21, 22.230, 2.095446, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78801, 25201, 571, 0, 0, '0', 0, 0, 0, 3973.89, 6312.81, 7.9676, 5.198990, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78802, 25201, 571, 0, 0, '0', 0, 0, 0, 3973.92, 6313.76, 7.9676, 4.677485, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78803, 25201, 571, 0, 0, '0', 0, 0, 0, 4270.12, 6400.81, 0.4071, 4.040093, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0),
+(78804, 25201, 571, 0, 0, '0', 0, 0, 0, 4270.77, 6399.90, 0.4071, 4.658987, 300, 0, 0, 0, 0, 0, 0, 0, 0, '', 0);
diff --git a/sql/updates/world/master/2020_04_26_04_world_2017_04_13_02_world.sql b/sql/updates/world/master/2020_04_26_04_world_2017_04_13_02_world.sql
new file mode 100644
index 00000000000..727c22aa27c
--- /dev/null
+++ b/sql/updates/world/master/2020_04_26_04_world_2017_04_13_02_world.sql
@@ -0,0 +1,4 @@
+--
+-- UPDATE `creature` SET `spawnMask`=1 WHERE `map` IN (450,449);
+-- UPDATE `gameobject` SET `spawnMask`=1 WHERE `map` IN (450,449);
+UPDATE `creature_addon` SET `auras`="" WHERE `guid`=106950;
diff --git a/sql/updates/world/master/2020_04_26_05_world_2017_04_20_01_world.sql b/sql/updates/world/master/2020_04_26_05_world_2017_04_20_01_world.sql
new file mode 100644
index 00000000000..4ee76969ca3
--- /dev/null
+++ b/sql/updates/world/master/2020_04_26_05_world_2017_04_20_01_world.sql
@@ -0,0 +1,11 @@
+--
+DELETE FROM `creature` WHERE `guid` IN (78807,78808,78809,79283,/*79284,*/79285,79368,79378);
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `phaseId`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(78807, 6491, 530, 0, 0, '0', 0, 0, 0, 6724.2768, -7935.263, 170.098, 5.784735, 72000, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(78808, 6491, 530, 0, 0, '0', 0, 0, 0, -1423.50, 4358.489, 241.566, 5.185481, 72000, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(78809, 6491, 530, 0, 0, '0', 0, 0, 0, -2438.868, 4665.473, 161.979, 4.648291, 72000, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(79283, 6491, 571, 0, 0, '0', 0, 0, 0, 8466.29, 442.502, 596.0717, 1.601781, 72000, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+-- (79284, 6491, 1, 0, 0, '0', 0, 0, 0, -4555.235, -3600.542, 41.486, 3.899855, 72000, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(79285, 6491, 571, 0, 0, '0', 0, 0, 0, 4686.022, 52.123, 73.449, 4.463720, 72000, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(79368, 6491, 571, 0, 0, '0', 0, 0, 0, 6445.856, 2062.501, 563.705, 5.488712, 72000, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(79378, 6491, 571, 0, 0, '0', 0, 0, 0, 2583.27, -5802.575, 295.615, 3.652452, 72000, 0, 0, 0, 0, 0, 0, 0, 0, 0);
diff --git a/sql/updates/world/master/2020_04_27_00_world_2017_04_24_03_world.sql b/sql/updates/world/master/2020_04_27_00_world_2017_04_24_03_world.sql
new file mode 100644
index 00000000000..78f9ec54456
--- /dev/null
+++ b/sql/updates/world/master/2020_04_27_00_world_2017_04_24_03_world.sql
@@ -0,0 +1,29 @@
+-- Arcanist Ithanas
+UPDATE `creature_template` SET `gossip_menu_id`= 15296 WHERE `entry`= 15296;
+
+DELETE FROM `gossip_menu` WHERE `MenuId`= 15296;
+INSERT INTO `gossip_menu` (`MenuId`,`textid`,`VerifiedBuild`) VALUES (15296, 7787, 0);
+
+-- Arcanist Helion
+UPDATE `creature_template` SET `gossip_menu_id`= 15297 WHERE `entry`= 15297;
+
+DELETE FROM `gossip_menu` WHERE `MenuId`= 15297;
+INSERT INTO `gossip_menu` (`MenuId`,`textid`,`VerifiedBuild`) VALUES (15297, 7786, 0);
+
+-- Lanthan Perilon
+DELETE FROM `gossip_menu` WHERE `MenuId`= 6570 AND `textid`= 7785;
+INSERT INTO `gossip_menu` (`MenuId`,`textid`,`VerifiedBuild`) VALUES (6570, 7785, 0);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 14 AND `SourceGroup`= 6570;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`comment`) VALUES
+(14, 6570, 7785, 0, 0, 8, 0, 8335, 0, 0, 1, 0, 0, '', "Gossip text requires quest 'Felendren the Banished' NOT rewarded"),
+(14, 6570, 7869, 0, 0, 8, 0, 8335, 0, 0, 0, 0, 0, '', "Gossip text requires quest 'Felendren the Banished' rewarded");
+
+-- Outrunner Alarion
+DELETE FROM `gossip_menu` WHERE `MenuId`= 6573 AND `textid`= 7788;
+INSERT INTO `gossip_menu` (`MenuId`,`textid`,`VerifiedBuild`) VALUES (6573, 7788, 0);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 14 AND `SourceGroup`= 6573;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`comment`) VALUES
+(14, 6573, 7788, 0, 0, 8, 0, 9705, 0, 0, 1, 0, 0, '', "Gossip text requires quest 'Package Recovery' NOT rewarded"),
+(14, 6573, 7821, 0, 0, 8, 0, 9705, 0, 0, 0, 0, 0, '', "Gossip text requires quest 'Package Recovery' rewarded");
diff --git a/sql/updates/world/master/2020_04_27_01_world_2017_04_24_04_world.sql b/sql/updates/world/master/2020_04_27_01_world_2017_04_24_04_world.sql
new file mode 100644
index 00000000000..204433e88cb
--- /dev/null
+++ b/sql/updates/world/master/2020_04_27_01_world_2017_04_24_04_world.sql
@@ -0,0 +1,97 @@
+-- Tranquillien RP event
+SET @AURIFEROUS :=16231;
+SET @SCRIPT := 1623100;
+SET @MALTENDIS :=16251;
+SET @MAVREN := 16252;
+SET @VALWYN := 16289;
+
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry` IN (@AURIFEROUS, @MAVREN, @VALWYN, @MALTENDIS);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@AURIFEROUS, @SCRIPT, @MAVREN, @VALWYN, @MALTENDIS);
+INSERT INTO `smart_scripts` (`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`,`comment`) VALUES
+(@AURIFEROUS,0, 0, 0, 1, 0, 100, 0, 10000, 60000, 580000, 620000, 80, @SCRIPT, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Aureous - Out Of Combat - Run Script"),
+(@SCRIPT, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 0 (Advisor Valwyn)"),
+(@SCRIPT, 9, 1, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 0"),
+(@SCRIPT, 9, 2, 0, 0, 0, 100, 0, 60000, 70000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Face High Executor Mavren"),
+(@SCRIPT, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 1"),
+(@SCRIPT, 9, 4, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 1 1 (High Executor Mavren)"),
+(@SCRIPT, 9, 5, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 0 (Deathstalker Maltendis)"),
+(@SCRIPT, 9, 6, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Reset Orientation"),
+(@SCRIPT, 9, 7, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 0 (High Executor Mavren)"),
+(@SCRIPT, 9, 8, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 1 (Advisor Valwyn)"),
+(@SCRIPT, 9, 9, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 2 2 (High Executor Mavren)"),
+(@SCRIPT, 9, 10, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 2"),
+(@SCRIPT, 9, 11, 0, 0, 0, 100, 0, 50000, 70000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Face High Executor Mavren"),
+(@SCRIPT, 9, 12, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 3"),
+(@SCRIPT, 9, 13, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 1 1 (High Executor Mavren)"),
+(@SCRIPT, 9, 14, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 0 (Deathstalker Maltendis)"),
+(@SCRIPT, 9, 15, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Reset Orientation"),
+(@SCRIPT, 9, 16, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 1 (High Executor Mavren)"),
+(@SCRIPT, 9, 17, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 1 (Advisor Valwyn)"),
+(@SCRIPT, 9, 18, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 2 2 (High Executor Mavren"),
+(@SCRIPT, 9, 19, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 4"),
+(@SCRIPT, 9, 20, 0, 0, 0, 100, 0, 50000, 70000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Face High Executor Mavren"),
+(@SCRIPT, 9, 21, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 5"),
+(@SCRIPT, 9, 22, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 1 1 (High Executor Mavren)"),
+(@SCRIPT, 9, 23, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 0 (Deathstalker Maltendis)"),
+(@SCRIPT, 9, 24, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Reset Orientation"),
+(@SCRIPT, 9, 25, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 2 (High Executor Mavren)"),
+(@SCRIPT, 9, 26, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 1 (Advisor Valwyn)"),
+(@SCRIPT, 9, 27, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 2 2 (High Executor Mavren"),
+(@SCRIPT, 9, 28, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 6"),
+(@SCRIPT, 9, 29, 0, 0, 0, 100, 0, 150000, 190000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 1 1 (Deathstalker Maltendis)"),
+(@SCRIPT, 9, 30, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 1 (Deathstalker Maltendis)"),
+(@SCRIPT, 9, 31, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 1 1 (Advisor Valwyn)"),
+(@SCRIPT, 9, 32, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 2 (Advisor Valwyn)"),
+(@SCRIPT, 9, 33, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 2 2 (Deathstalker Maltendis)"),
+(@SCRIPT, 9, 34, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 2 2 (Advisor Valwyn)"),
+(@SCRIPT, 9, 35, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 45, 3, 3, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 3 3 (Deathstalker Maltendis)"),
+(@VALWYN, 0, 0, 0, 38, 0, 100, 0, 1, 1, 1000, 1000, 66, 0, 0, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Advisor Valwyn - On Data 1 1 Set - Face Deathstalker Maltendis"),
+(@VALWYN, 0, 1, 0, 38, 0, 100, 0, 2, 2, 1000, 1000, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Advisor Valwyn - On Data 2 2 Set - Reset Orientation"),
+(@MAVREN, 0, 0, 0, 38, 0, 100, 0, 1, 1, 1000, 1000, 66, 0, 0, 0, 0, 0, 0, 19, 16231, 0, 0, 0, 0, 0, 0, "High Executor Mavren - On Data 1 1 Set - Face Dame Auriferious"),
+(@MAVREN, 0, 1, 0, 38, 0, 100, 0, 2, 2, 1000, 1000, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "High Executor Mavren - On Data 2 2 Set - Reset Orientation"),
+(@MALTENDIS, 0, 0, 0, 38, 0, 100, 0, 1, 1, 1000, 1000, 66, 0, 0, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Deathstalker Maltendis - On Data 1 1 Set - Face Advisor Valwyn"),
+(@MALTENDIS, 0, 1, 0, 38, 0, 100, 0, 2, 2, 1000, 1000, 5, 153, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Deathstalker Maltendis - On Data 2 2 Set - Emote Laugh"),
+(@MALTENDIS, 0, 2, 0, 38, 0, 100, 0, 3, 3, 1000, 1000, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Deathstalker Maltendis - On Data 3 3 Set - Reset Orientation");
+
+DELETE FROM `creature_text` WHERE `CreatureId` IN (@AURIFEROUS, @MAVREN, @VALWYN, @MALTENDIS);
+INSERT INTO `creature_text` (`CreatureId`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
+(@AURIFEROUS, 0, 0, "%s nods her head yes at what her advisor has to say.", 16, 0, 100, 273, 0, 0, 13362, 0, "Dame Auriferous"),
+(@AURIFEROUS, 0, 1, "%s disagrees with whatever it is that Valwyn has whispered to her.", 16, 0, 100, 274, 0, 0, 13363, 0, "Dame Auriferous"),
+(@AURIFEROUS, 0, 2, "%s seems nonplussed by whatever it is that her advisor has whispered in her ear.", 16, 0, 100, 6, 0, 0, 13365, 0, "Dame Auriferous"),
+(@AURIFEROUS, 1, 0, "Executor, your direct assault approach will cost us more lives than I am comfortable with. A more nuanced strategy is called for; one that involves us reclaiming the surrounding territory, starting with the villages so as to cut off all points of reinforcement to Deatholme.", 12, 1, 100, 0, 0, 0, 12552, 0, "Dame Auriferous"),
+(@AURIFEROUS, 2, 0, "I hear what you are saying, Mavren. Nevertheless, the final decision is mine. I appreciate your assistance, but the majority of the lives on the line are blood elf. I will not have those lives carelessly thrown away!", 12, 1, 100, 0, 0, 0, 12571, 0, "Dame Auriferous"),
+(@AURIFEROUS, 3, 0, "How long until Forsaken reinforcements arrive? Our position here is tenuous. Your Lady promised us more soldiers. We must be able to concentrate solely on Deatholme and the Scourge!", 12, 1, 100, 0, 0, 0, 12557, 0, "Dame Auriferous"),
+(@AURIFEROUS, 4, 0, "Mavren, I don't want excuses, I want results! The Farstriders aren't available and we've received all that we're going to get from Silvermoon for now. I cannot ignore the Shadowpine trolls and Zul'Aman... they're arrayed across our eastern border!", 12, 1, 100, 0, 0, 0, 12572, 0, "Dame Auriferous"),
+(@AURIFEROUS, 5, 0, "No, I was right to begin with. Deatholme must come last. We must secure all of the Ghostlands first. I will not commit the forces here to a battle against Dar'khan with enemies to our flank and rear!", 12, 1, 100, 0, 0, 0, 12562, 0, "Dame Auriferous"),
+(@AURIFEROUS, 6, 0, "Disagree with me all you like, High Executor. I will weigh your counsel, and then we will take the steps to free all of Quel'Thalas as I deem necessary. We shall continue this discussion anon.", 12, 1, 100, 0, 0, 0, 12573, 0, "Dame Auriferous"),
+(@MAVREN, 0, 0, "With all due respect, milady, you have not fought the Scourge as I have. The Lady appointed me to assist you in defeating Dar'khan because of that, and you would do well to consider what I have to say.", 12, 1, 100, 0, 0, 0, 12553, 0, "High Executor Mavren"),
+(@MAVREN, 0, 1, "I strongly disagree. Dar'khan is not going to get reinforcements because he'll be bottlenecked. Deatholme has only one way in and out. Your traitor was a fool to corner himself there, and I intend to exploit that weakness!", 12, 1, 100, 0, 0, 0, 12554, 0, "High Executor Mavren"),
+(@MAVREN, 0, 2, "This is war, Dame Auriferous, and in any war lives will be lost! The only areas that we need to secure are the two ziggurats. We will turtle in and take the Tower of the Damned and its master by brute force. Then you will have your Quel'Thalas.", 12, 1, 100, 0, 0, 0, 12555, 0, "High Executor Mavren"),
+(@MAVREN, 0, 3, "And if your Farstriders were here to reinforce us, I might agree. But, they are busying themselves instead with the Shadowpine trolls on your eastern border. The longer we wait for them, the stronger the Scourge will become.", 12, 1, 100, 0, 0, 0, 12556, 0, "High Executor Mavren"),
+(@MAVREN, 1, 0, "I believe that you're making my argument for me, but yes it would be nice if we had more reinforcements. I would counter that it would be faster to pull the Farstriders from their senseless skirmishing with the trolls.", 12, 1, 100, 0, 0, 0, 12558, 0, "High Executor Mavren"),
+(@MAVREN, 1, 1, "Dame Auriferous, we are the reinforcements. It may come to pass that The Lady will send more men in time. Better that you convince Silvermoon City to muster all of its forces and put them at our disposal here.", 12, 1, 100, 0, 0, 0, 12559, 0, "High Executor Mavren"),
+(@MAVREN, 1, 2, "You are correct; we must concentrate on the Scourge. Ignore the trolls and the villages, and focus our attentions on Deatholme! With Dar'khan defeated you will find that the rest of the Scourge 'body' will fall quickly, lacking their 'head'.", 12, 1, 100, 0, 0, 0, 12560, 0, "High Executor Mavren"),
+(@MAVREN, 1, 3, "Forsaken reinforcements? Undercity is stretched thin with the Scourge on all sides. No, this will be a matter largely dealt with by the blood elves. We Forsaken are here as backup and advisors.", 12, 1, 100, 0, 0, 0, 12561, 0, "High Executor Mavren"),
+(@MAVREN, 2, 0, "Again I strongly disagree with your view of the strategic situation. Your plan will spread our forces too thin. It will leave us with only a small force to assault Deatholme. I cannot in good conscience execute such a strategy.", 12, 1, 100, 0, 0, 0, 12567, 0, "High Executor Mavren"),
+(@MAVREN, 2, 1, "Spread throughout the Ghostlands, our forces will be of little use in an assault on Deatholme. No, milady, I am here to kill Dar'khan and that is what I intend to do!", 12, 1, 100, 0, 0, 0, 12568, 0, "High Executor Mavren"),
+(@MAVREN, 2, 2, "We've been over this before. Only a focused assault upon Deatholme will meet with success. These other targets are distractions that we can ill afford. I suggest that you inform your Captain Helios that he is to leave off his campaign against the Shadowpine trolls and focus solely on the Scourge.", 12, 1, 100, 0, 0, 0, 12569, 0, "High Executor Mavren"),
+(@MAVREN, 2, 3, "Perhaps we should let the matter rest for the time being until your chef has prepared your meal? You look a bit piqued if you don't mind my saying. We can resume our discussion when you are feeling more yourself.", 12, 1, 100, 0, 0, 0, 12570, 0, "High Executor Mavren"),
+(@VALWYN, 0, 0, "%s whispers something in the Dame's ear.", 16, 0, 100, 0, 0, 0, 13361, 0, "Advisor Valwyn"),
+(@VALWYN, 1, 0, "%s looks appalled at the Executor's tone!", 16, 0, 100, 0, 0, 0, 12574, 0, "Advisor Valwyn"),
+(@VALWYN, 1, 1, "%s tries to busy herself with other matters.", 16, 0, 100, 0, 0, 0, 12575, 0, "Advisor Valwyn"),
+(@VALWYN, 1, 2, "%s glares daggers in the direction of High Executor Mavren and Deathstalker Maltendis.", 16, 0, 100, 0, 0, 0, 12576, 0, "Advisor Valwyn"),
+(@VALWYN, 1, 3, "%s lifts her nose and sniffs in response to the High Executor's reply.", 16, 0, 100, 0, 0, 0, 12577, 0, "Advisor Valwyn"),
+(@VALWYN, 1, 4, "%s shakes her head in disbelief at what she is hearing out of the Forsaken's mouth.", 16, 0, 100, 0, 0, 0, 12578, 0, "Advisor Valwyn"),
+(@VALWYN, 1, 5, "%s blanches as much of the blood drains from her face.", 16, 0, 100, 0, 0, 0, 12579, 0, "Advisor Valwyn"),
+(@VALWYN, 1, 6, "%s reddens furiously at what she is hearing in response to her lady's question.", 16, 0, 100, 0, 0, 0, 12580, 0, "Advisor Valwyn"),
+(@VALWYN, 1, 7, "%s concentrates on the wall opposite her, clearly ignoring the looks of the Executor and his assistant.", 16, 0, 100, 0, 0, 0, 12581, 0, "Advisor Valwyn"),
+(@VALWYN, 2, 0, "%s looks disgusted at the deathstalker's flirtations.", 16, 0, 100, 274, 0, 0, 13367, 0, "Advisor Valwyn"),
+(@MALTENDIS, 0, 0, "%s nods in agreement.", 16, 0, 100, 0, 0, 0, 12582, 0, "Deathstalker Maltendis"),
+(@MALTENDIS, 0, 1, "%s opens his mouth as if to add something, and then apparently thinks the better of it.", 16, 0, 100, 0, 0, 0, 12583, 0, "Deathstalker Maltendis"),
+(@MALTENDIS, 0, 2, "%s looks over at Advisor Valwyn with a smirk on his face.", 16, 0, 100, 0, 0, 0, 12584, 0, "Deathstalker Maltendis"),
+(@MALTENDIS, 0, 3, "%s grins at the High Executor's words.", 16, 0, 100, 0, 0, 0, 12585, 0, "Deathstalker Maltendis"),
+(@MALTENDIS, 0, 4, "%s appears bored with the whole discussion.", 16, 0, 100, 0, 0, 0, 12586, 0, "Deathstalker Maltendis"),
+(@MALTENDIS, 0, 5, "%s winks slyly at Advisor Valwyn.", 16, 0, 100, 0, 0, 0, 12587, 0, "Deathstalker Maltendis"),
+(@MALTENDIS, 0, 6, "%s fidgets with his armor, clearly uncomfortable at the tone of the discussion.", 16, 0, 100, 0, 0, 0, 12588, 0, "Deathstalker Maltendis"),
+(@MALTENDIS, 0, 7, "%s looks like he'd rather be anywhere else but here.", 16, 0, 100, 0, 0, 0, 12589, 0, "Deathstalker Maltendis"),
+(@MALTENDIS, 1, 0, "%s turns to Advisor Valwyn and winks lasciviously in her direction.", 16, 0, 100, 2, 0, 0, 13366, 0, "Deathstalker Maltendis");
diff --git a/sql/updates/world/master/2020_04_27_02_world_2017_04_24_05_world.sql b/sql/updates/world/master/2020_04_27_02_world_2017_04_24_05_world.sql
new file mode 100644
index 00000000000..59deb42d81a
--- /dev/null
+++ b/sql/updates/world/master/2020_04_27_02_world_2017_04_24_05_world.sql
@@ -0,0 +1,13 @@
+SET @R3D0 := 21690;
+
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@R3D0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@R3D0, @R3D0*100);
+INSERT INTO `smart_scripts` (`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`, `comment`) VALUES
+(@R3D0, 0, 0, 0, 64, 0, 100, 0, 0, 0, 0, 0, 80, 2169000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "R-3D0 - On Gossip Hello - Call Actionlist"),
+(@R3D0*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 91, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "R-3D0 - On Script - Remove Standstate Sleep"),
+(@R3D0*100, 9, 1, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "R-3D0 - On Script - Talk"),
+(@R3D0*100, 9, 2, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 90, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "R-3D0 - On Gossip Hello - Set Standstate Sleep");
+
+DELETE FROM `creature_text` WHERE `CreatureId`=@R3D0;
+INSERT INTO `creature_text` (`CreatureId`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(@R3D0, 0, 0, "WARNING! WARNING! AWAY HOSTILE BEINGS! DO NOT HEAD UP THE RIDGE TO TOSHLEY'S STATION!", 12, 0, 100, 35, 0, 0, 19311, 0, "R-3D0");
diff --git a/sql/updates/world/master/2020_04_27_03_world_2017_04_24_07_world.sql b/sql/updates/world/master/2020_04_27_03_world_2017_04_24_07_world.sql
new file mode 100644
index 00000000000..51426bb3c3a
--- /dev/null
+++ b/sql/updates/world/master/2020_04_27_03_world_2017_04_24_07_world.sql
@@ -0,0 +1,16 @@
+--
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=1476;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=1476;
+INSERT INTO `smart_scripts` (`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`, `comment`) VALUES
+(1476, 0, 0, 0, 1, 0, 100, 0, 5000, 30000, 300000, 600000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Hargin Mundar - Out Of Combat - Talk"),
+(1476, 0, 1, 2, 1, 0, 100, 0, 35000, 45000, 300000, 600000, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Hargin Mundar - Out Of Combat - Talk"),
+(1476, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 41995, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Hargin Mundar - Out Of Combat - Cast Vomit");
+
+DELETE FROM `creature_text` WHERE `CreatureId`=1476;
+INSERT INTO `creature_text` (`CreatureId`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(1476, 0, 0, "Stormy seas out there. The sea spirits must be restless....hic!", 12, 6, 100, 0, 0, 0, 318, 0, "Hargin Mundar"),
+(1476, 0, 1, "I saw a Sea Giant once. It's not something I would care to see again. Burp!", 12, 6, 100, 0, 0, 0, 319, 0, "Hargin Mundar"),
+(1476, 0, 2, "I'd go out and clear out some of those gnolls, but this leg has seen better days and I am afraid I'd just wind up dead.", 12, 6, 100, 0, 0, 0, 320, 0, "Hargin Mundar"),
+(1476, 0, 3, "Watch your step out there. Many an adventure seeker has not returned from the marsh. hic!", 12, 6, 100, 0, 0, 0, 321, 0, "Hargin Mundar"),
+(1476, 1, 0, "Huuup...Huuup...Bleeeeehh!", 12, 0, 100, 0, 0, 0, 397, 0, "Hargin Mundar");
+
diff --git a/sql/updates/world/master/2020_04_27_04_world_2017_04_24_08_world.sql b/sql/updates/world/master/2020_04_27_04_world_2017_04_24_08_world.sql
new file mode 100644
index 00000000000..c261528ce0e
--- /dev/null
+++ b/sql/updates/world/master/2020_04_27_04_world_2017_04_24_08_world.sql
@@ -0,0 +1,19 @@
+--
+DELETE FROM `gossip_menu` WHERE `MenuId`=7192 AND `textid`=8473;
+DELETE FROM `gossip_menu` WHERE `MenuId`=7194 AND `textid`=8475;
+INSERT INTO `gossip_menu` (`MenuId`, `textid`, `VerifiedBuild`) VALUES
+(7192, 8473, 0),
+(7194, 8475, 0);
+
+DELETE FROM `npc_text` WHERE `ID`=8473;
+INSERT INTO `npc_text` (`ID`, `Probability0`,`BroadcastTextID0`) VALUES
+(8473, 100, 12182);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup` IN (7192, 7194);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `comment`) VALUES
+(14, 7192, 8472, 0, 0, 8, 0, 9207, 0, 0, 1, 0, 0, "", "Gossip text requires quest Underlight Ore Samples NOT rewarded"),
+(14, 7192, 8473, 0, 0, 8, 0, 9207, 0, 0, 0, 0, 0, "", "Gossip text requires quest Underlight Ore Samples rewarded"),
+(14, 7194, 8474, 0, 0, 8, 0, 9207, 0, 0, 1, 0, 0, "", "Gossip text requires quest Underlight Ore Samples NOT rewarded"),
+(14, 7194, 8475, 0, 0, 8, 0, 9207, 0, 0, 0, 0, 0, "", "Gossip text requires quest Underlight Ore Samples rewarded");
+
+UPDATE `quest_offer_reward` SET `RewardText`="My apprentice was unable to take care of this herself? I shall have a word with her when she returns then, gnolls or not. Speaking of which, why didn't she return with you?$B$B<The magister sighs.>$B$BThat one is a handful, and is going to be quite a challenge to properly train. Thank you, for bringing these samples to me. We are hoping that we can uncover some special property from them that will help in the fight against the Scourge.$B$BPlease take this coin as a token of my appreciation." WHERE `ID`=9207;
diff --git a/sql/updates/world/master/2020_04_27_05_world_2017_04_24_09_world.sql b/sql/updates/world/master/2020_04_27_05_world_2017_04_24_09_world.sql
new file mode 100644
index 00000000000..bc8c6c33c1a
--- /dev/null
+++ b/sql/updates/world/master/2020_04_27_05_world_2017_04_24_09_world.sql
@@ -0,0 +1,13 @@
+--
+DELETE FROM `gossip_menu` WHERE `MenuId`=8558 AND `textid`=10722;
+INSERT INTO `gossip_menu` (`MenuId`,`textid`) VALUES
+(8558,10722);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup` IN (8558,8560);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(14,8558,7778,0,0,5,0,932,16,0,0,0,0,'',"Show gossip text if player is Friendly with The Aldor"),
+(14,8558,10722,0,0,5,0,932,16,0,1,0,0,'',"Show gossip text if player is not Friendly with The Aldor"),
+(14,8560,7778,0,0,5,0,934,16,0,0,0,0,'',"Show gossip text if player is Friendly with The Scryers"),
+(14,8560,10723,0,0,5,0,934,16,0,1,0,0,'',"Show gossip text if player is not Friendly with The Scryers"),
+(15,8558,0,0,0,5,0,932,16,0,0,0,0,'',"Show gossip menu option if player is Friendly with The Aldor"),
+(15,8560,0,0,0,5,0,934,16,0,0,0,0,'',"Show gossip menu option if player is Friendly with The Scryers");
diff --git a/sql/updates/world/master/2020_04_27_06_world_2017_04_24_10_world.sql b/sql/updates/world/master/2020_04_27_06_world_2017_04_24_10_world.sql
new file mode 100644
index 00000000000..825a15ae3b4
--- /dev/null
+++ b/sql/updates/world/master/2020_04_27_06_world_2017_04_24_10_world.sql
@@ -0,0 +1,229 @@
+--
+SET @GUID := 131324;
+DELETE FROM `creature` WHERE `guid` BETWEEN @GUID + 1 AND @GUID + 23;
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `npcflag`, `MovementType`) VALUES
+(@GUID + 1, 11277, 0, 0, 0, 1093.95, -2528.63, 61.2475, 5.74213, 0, 0, 0, 484, 0, 0, 0),
+(@GUID + 2, 11277, 0, 0, 0, 1095.56, -2529.47, 61.1291, 2.37365, 0, 0, 0, 484, 0, 0, 0),
+(@GUID + 3, 11277, 0, 0, 0, 1148.08, -2559.31, 60.1493, 4.15388, 0, 0, 0, 484, 0, 0, 0),
+(@GUID + 4, 11277, 0, 0, 0, 1146.79, -2561.22, 60.1145, 0.959931, 0, 0, 0, 484, 0, 0, 0),
+(@GUID + 5, 11279, 0, 0, 0, 1064.06, -2519.78, 60.2259, 3.19395, 0, 0, 0, 3632, 0, 0, 0),
+(@GUID + 6, 11279, 0, 0, 0, 1056.5, -2536.54, 59.9694, 2.35619, 0, 0, 0, 3632, 0, 0, 0),
+(@GUID + 7, 11279, 0, 0, 0, 1245.02, -2597.47, 90.3675, 3.52556, 0, 0, 0, 3632, 0, 0, 0),
+(@GUID + 8, 11280, 0, 0, 0, 1180.07, -2536.72, 85.3681, 1.0821, 0, 0, 0, 3632, 0, 0, 0),
+(@GUID + 9, 11280, 0, 0, 0, 1187.12, -2532.58, 85.3681, 2.16421, 0, 0, 0, 3632, 0, 0, 0),
+(@GUID + 10, 11280, 0, 0, 0, 1208.19, -2583.32, 98.2479, 2.72271, 0, 0, 0, 3632, 0, 0, 0),
+(@GUID + 11, 11282, 0, 0, 0, 1113.59, -2555.59, 59.2532, 3.50681, 0, 0, 0, 42, 0, 0, 0),
+(@GUID + 12, 11283, 0, 0, 0, 1111.49, -2556.4, 59.2532, 0.365222, 0, 0, 0, 42, 0, 0, 0),
+(@GUID + 13, 11316, 0, 0, 0, 1223.27, -2506.41, 72.9261, 4.10152, 0, 0, 0, 3500, 0, 0, 0),
+(@GUID + 14, 11277, 0, 0, 0, 1155.4, -2383.73, 60.304, 5.43574, 300, 0, 0, 2784, 0, 0, 0),
+(@GUID + 15, 11281, 0, 0, 0, 1098.49, -2523.82, 61.3707, 4.6691, 1272, 0, 0, 2371, 0, 0, 0),
+(@GUID + 16, 11281, 0, 0, 0, 1031.16, -2498.27, 59.177, 4.73616, 1272, 0, 0, 2371, 0, 0, 2),
+(@GUID + 17, 11281, 0, 0, 0, 1090.52, -2541.25, 59.2419, 2.70896, 1272, 0, 0, 2371, 0, 0, 2),
+(@GUID + 18, 11279, 0, 0, 0, 1238.9929, -2586.8103, 90.3722, 3.695799, 0, 0, 0, 3632, 0, 0, 0),
+(@GUID + 19, 11277, 0, 0, 0, 1100.1054, -2589.2932, 60.624, 0.555778, 0, 0, 0, 3632, 0, 0, 0),
+(@GUID + 20, 11277, 0, 0, 0, 1127.81, -2387.71, 59.264, 1.72159, 300, 0, 0, 2784, 0, 0, 0),
+(@GUID + 21, 11287, 0, 0, 0, 1081.91, -2574, 59.957, 0.301, 360, 0, 0, 1536, 0, 0, 0),
+(@GUID + 22, 11277, 0, 11014, 0, 1090.52, -2541.25, 59.2419, 2.70896, 1272, 0, 0, 2784, 0, 0, 2),
+(@GUID + 23, 11277, 0, 11014, 0, 1231.62939, -2558.7126, 91.04164, 4.410, 1272, 0, 0, 2784, 0, 0, 2);
+
+SET @NPC := 131340;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,5228,0,1,0, '17622');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`, `delay`) VALUES
+(@PATH, 1, 1031.16, -2498.27, 59.177, 10000),
+(@PATH, 2, 1034.48, -2468.77, 59.9844, 0),
+(@PATH, 3, 1043.48, -2458.4, 60.4699, 0),
+(@PATH, 4, 1071.23, -2443.23, 61.1634, 5000),
+(@PATH, 5, 1101.41, -2409.45, 59.8655, 0),
+(@PATH, 6, 1125.81, -2397.36, 59.4695, 0),
+(@PATH, 7, 1183.61, -2397.16, 60.1768, 10000),
+(@PATH, 8, 1126.2, -2397.42, 59.4867, 0),
+(@PATH, 9, 1101.19, -2409.67, 59.8831, 0),
+(@PATH, 10, 1070.91, -2443.54, 61.1405, 5000),
+(@PATH, 11, 1043.16, -2458.72, 60.4674, 0),
+(@PATH, 12, 1034.42, -2468.71, 59.9897, 0);
+
+SET @NPC := 131341;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,5228,0,1,0, '17622');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`, `delay`) VALUES
+(@PATH, 1, 1090.52, -2541.25, 59.1419, 10000),
+(@PATH, 2, 1095.36, -2543.49, 59.1418, 0),
+(@PATH, 3, 1118.02, -2601.04, 59.4689, 0),
+(@PATH, 4, 1132.05, -2612.48, 63.1381, 0),
+(@PATH, 5, 1161.32, -2620.66, 70.9007, 0),
+(@PATH, 6, 1193.38, -2629.62, 74.0911, 0),
+(@PATH, 7, 1214.63, -2616.73, 83.1397, 0),
+(@PATH, 8, 1221.01, -2604.11, 86.3537, 0),
+(@PATH, 9, 1237.11, -2595.52, 90.1566, 10000),
+(@PATH, 10, 1221.38, -2603.91, 86.4882, 0),
+(@PATH, 11, 1214.67, -2616.99, 83.1357, 0),
+(@PATH, 12, 1193.52, -2629.6, 74.1169, 0),
+(@PATH, 13, 1161.14, -2620.61, 70.8684, 0),
+(@PATH, 14, 1131.64, -2612.35, 63.038, 0),
+(@PATH, 15, 1117.74, -2600.92, 59.4468, 0),
+(@PATH, 16, 1095.2, -2543.02, 59.1423, 0);
+
+DELETE FROM `creature_formations` WHERE `leaderGUID` IN (131341);
+INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`,`point_1`,`point_2`) VALUES
+(131341,131341,0,0,2,0,0),
+(131341,131339,9,360,2,9,19);
+
+SET @NPC := @GUID + 23;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '17622 10848');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES
+(@PATH, 1, 1235.24, -2562.57, 91.3431, 0, 0, 0, 0, 100, 0),
+(@PATH, 2, 1236.63, -2570.77, 91.5426, 0, 0, 0, 0, 100, 0),
+(@PATH, 3, 1237.19, -2580.81, 90.9381, 0, 0, 0, 0, 100, 0),
+(@PATH, 4, 1238.05, -2593.67, 90.1927, 0, 0, 0, 0, 100, 0),
+(@PATH, 5, 1228.63, -2599.66, 88.6386, 0, 0, 0, 0, 100, 0),
+(@PATH, 6, 1220.7, -2604.7, 86.2027, 0, 0, 0, 0, 100, 0),
+(@PATH, 7, 1212.85, -2601.35, 83.4549, 0, 0, 0, 0, 100, 0),
+(@PATH, 8, 1201.85, -2595.01, 78.5496, 0, 0, 0, 0, 100, 0),
+(@PATH, 9, 1191.01, -2590.97, 74.6417, 0, 0, 0, 0, 100, 0),
+(@PATH, 10, 1180.71, -2595.16, 72.9315, 0, 0, 0, 0, 100, 0),
+(@PATH, 11, 1176.2, -2606.29, 72.8323, 0, 0, 0, 0, 100, 0),
+(@PATH, 12, 1168.01, -2620.18, 71.895, 0, 0, 0, 0, 100, 0),
+(@PATH, 13, 1173.01, -2612.22, 72.7501, 0, 0, 0, 0, 100, 0),
+(@PATH, 14, 1182.33, -2592.46, 72.9574, 0, 0, 0, 0, 100, 0),
+(@PATH, 15, 1197.4, -2592.45, 76.7622, 0, 0, 0, 0, 100, 0),
+(@PATH, 16, 1219.52, -2604.41, 85.8084, 0, 0, 0, 0, 100, 0),
+(@PATH, 17, 1237.83, -2592.45, 90.193, 0, 0, 0, 0, 100, 0),
+(@PATH, 18, 1237.96, -2574.51, 91.5436, 0, 0, 0, 0, 100, 0),
+(@PATH, 19, 1233.04, -2561.64, 90.6976, 0, 0, 0, 0, 100, 0),
+(@PATH, 20, 1232.37, -2553.62, 91.4351, 0, 0, 0, 0, 100, 0);
+
+SET @NPC := 131346;
+UPDATE `creature` SET `position_x`=1127.81, `position_y`=-2387.71, `position_z`=59.264, `orientation`=1.72159 WHERE `guid`=@NPC;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '17622 10848');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES
+(@PATH, 1, 1130.21, -2395.8, 59.6262, 0, 0, 0, 0, 100, 0),
+(@PATH, 2, 1137.21, -2395.91, 59.8531, 0, 0, 0, 0, 100, 0),
+(@PATH, 3, 1158.21, -2396.22, 59.8991, 0, 0, 0, 0, 100, 0),
+(@PATH, 4, 1179.21, -2396.51, 60.0552, 0, 0, 0, 0, 100, 0),
+(@PATH, 5, 1203.92, -2392.72, 60.0587, 0, 0, 0, 0, 100, 0),
+(@PATH, 6, 1190.1, -2394.95, 60.1484, 0, 0, 0, 0, 100, 0),
+(@PATH, 7, 1169.22, -2396.95, 59.9472, 0, 0, 0, 0, 100, 0),
+(@PATH, 8, 1155.23, -2396.77, 59.9844, 0, 0, 0, 0, 100, 0),
+(@PATH, 9, 1124.17, -2397.18, 59.405, 0, 0, 0, 0, 100, 0),
+(@PATH, 10, 1099.73, -2410.8, 59.9901, 0, 0, 0, 0, 100, 0),
+(@PATH, 11, 1090.4, -2420.13, 60.9123, 0, 0, 0, 0, 100, 0),
+(@PATH, 12, 1072.48, -2441.64, 61.2209, 0, 0, 0, 0, 100, 0),
+(@PATH, 13, 1043.13, -2458.38, 60.4831, 0, 0, 0, 0, 100, 0),
+(@PATH, 14, 1035.92, -2468.81, 59.9447, 0, 0, 0, 0, 100, 0),
+(@PATH, 15, 1032.07, -2486.29, 59.3631, 0, 0, 0, 0, 100, 0),
+(@PATH, 16, 1024.47, -2514.34, 59.1417, 0, 0, 0, 0, 100, 0),
+(@PATH, 17, 1037.54, -2519.32, 59.1867, 0, 0, 0, 0, 100, 0),
+(@PATH, 18, 1063.46, -2529.89, 59.1418, 0, 0, 0, 0, 100, 0),
+(@PATH, 19, 1097.75, -2544.71, 59.1428, 0, 0, 0, 0, 100, 0),
+(@PATH, 20, 1102.49, -2557.88, 59.1428, 0, 0, 0, 0, 100, 0),
+(@PATH, 21, 1111.76, -2584.3, 59.1743, 0, 0, 0, 0, 100, 0),
+(@PATH, 22, 1123.54, -2607.25, 61.0399, 0, 0, 0, 0, 100, 0),
+(@PATH, 23, 1136.36, -2612.87, 64.1442, 0, 0, 0, 0, 100, 0),
+(@PATH, 24, 1163.16, -2620.89, 71.2108, 0, 0, 0, 0, 100, 0),
+(@PATH, 25, 1182.45, -2627.27, 72.8355, 0, 0, 0, 0, 100, 0),
+(@PATH, 26, 1196.35, -2625.69, 74.9546, 0, 0, 0, 0, 100, 0),
+(@PATH, 27, 1205.57, -2623.11, 78.4216, 0, 0, 0, 0, 100, 0),
+(@PATH, 28, 1218.12, -2611.44, 84.922, 0, 0, 0, 0, 100, 0),
+(@PATH, 29, 1232.4, -2596.93, 89.4579, 0, 0, 0, 0, 100, 0),
+(@PATH, 30, 1218.97, -2605.37, 85.534, 0, 0, 0, 0, 100, 0),
+(@PATH, 31, 1207.03, -2598.07, 80.8431, 0, 0, 0, 0, 100, 0),
+(@PATH, 32, 1184.18, -2591.84, 73.0826, 0, 0, 0, 0, 100, 0),
+(@PATH, 33, 1180.16, -2598.08, 72.8645, 0, 0, 0, 0, 100, 0),
+(@PATH, 34, 1167.55, -2620.42, 71.8289, 0, 0, 0, 0, 100, 0),
+(@PATH, 35, 1148.76, -2617.4, 67.9948, 0, 0, 0, 0, 100, 0),
+(@PATH, 36, 1128.96, -2610.55, 62.3378, 0, 0, 0, 0, 100, 0),
+(@PATH, 37, 1114.88, -2592.68, 59.2346, 0, 0, 0, 0, 100, 0),
+(@PATH, 38, 1112, -2586.3, 59.1568, 0, 0, 0, 0, 100, 0),
+(@PATH, 39, 1102.92, -2559.83, 59.142, 0, 0, 0, 0, 100, 0),
+(@PATH, 40, 1093.84, -2542.81, 59.1414, 0, 0, 0, 0, 100, 0),
+(@PATH, 41, 1067.78, -2532.62, 59.1415, 0, 0, 0, 0, 100, 0),
+(@PATH, 42, 1035.69, -2518.67, 59.1449, 0, 0, 0, 0, 100, 0),
+(@PATH, 43, 1022.34, -2513.6, 59.1417, 0, 0, 0, 0, 100, 0),
+(@PATH, 44, 1029.52, -2499.31, 59.1618, 0, 0, 0, 0, 100, 0),
+(@PATH, 45, 1032.82, -2480.03, 59.4609, 0, 0, 0, 0, 100, 0),
+(@PATH, 46, 1040.28, -2461.78, 60.4131, 0, 0, 0, 0, 100, 0),
+(@PATH, 47, 1068.44, -2444.34, 60.9293, 0, 0, 0, 0, 100, 0),
+(@PATH, 48, 1089.28, -2422.64, 61.0531, 0, 0, 0, 0, 100, 0),
+(@PATH, 49, 1110.43, -2404.84, 59.3954, 0, 0, 0, 0, 100, 0),
+(@PATH, 50, 1125.89, -2397.4, 59.473, 0, 0, 0, 0, 100, 0);
+
+UPDATE `creature_template_addon` SET `mount` = 5228 WHERE `entry` = 11281;
+
+DELETE FROM `creature_template_addon` WHERE `entry` IN (11282, 11283, 11287, 11279, 11286, 11316, 11280);
+INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(11282, 0, 0, 0, 0, 0, '17622 10848'),
+(11283, 0, 0, 0, 0, 0, '17622 10848'),
+(11287, 0, 0, 0, 0, 0, '17622 10848'),
+(11279, 0, 0, 0, 0, 0, '17622 10848'),
+(11286, 0, 0, 0, 0, 0, '17622 10848'),
+(11316, 0, 0, 0, 69, 0, '17622 10848'),
+(11280, 0, 0, 0, 69, 0, '17622 10848');
+
+UPDATE `creature_template_addon` SET `auras` = '17622 10848' WHERE `entry` = 11277;
+UPDATE `creature_addon` SET `bytes1`=0, `auras` = '17622 10848' WHERE `guid` = 200140;
+
+-- Melia SAI
+SET @ENTRY := 11282;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`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`,`comment`) VALUES
+(@ENTRY,0,0,0,25,0,100,0,0,0,0,0,53,1,11282,1,0,0,0,1,0,0,0,0,0,0,0,"Melia - On Reset - Start Waypoint"),
+(@ENTRY,0,1,0,40,0,100,0,5,11282,0,0,80,@ENTRY*100+00,2,0,0,0,0,1,0,0,0,0,0,0,0,"Melia - On Waypoint 5 Reached - Run Script");
+
+-- Actionlist SAI
+SET @ENTRY := 1128200;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9;
+INSERT INTO `smart_scripts` (`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`,`comment`) VALUES
+(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,54,30000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Melia - On Script - Pause Waypoint"),
+(@ENTRY,9,1,0,0,0,100,0,6000,6000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,3.495,"Melia - On Script - Set Orientation 3.495"),
+(@ENTRY,9,2,0,0,0,100,0,3000,3000,0,0,1,0,2000,0,0,0,0,1,0,0,0,0,0,0,0,"Melia - On Script - Say Line 0"),
+(@ENTRY,9,3,0,0,0,100,0,5000,5000,0,0,1,0,2000,0,0,0,0,19,11283,100,0,0,0,0,0,"Melia - On Script - Say Line 0"),
+(@ENTRY,9,4,0,0,0,100,0,2000,2000,0,0,1,1,2000,0,0,0,0,1,0,0,0,0,0,0,0,"Melia - On Script - Say Line 1"),
+(@ENTRY,9,5,0,0,0,100,0,14000,14000,0,0,1,2,2000,0,0,0,0,1,0,0,0,0,0,0,0,"Melia - On Script - Say Line 2"),
+(@ENTRY,9,6,0,0,0,100,0,1000,1000,0,0,1,1,2000,0,0,0,0,19,11283,100,0,0,0,0,0,"Melia - On Script - Say Line 1");
+
+-- Sammy SAI
+SET @ENTRY := 11283;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`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`,`comment`) VALUES
+(@ENTRY,0,0,0,25,0,100,0,0,0,0,0,53,1,11283,1,0,0,0,1,0,0,0,0,0,0,0,"Sammy - On Reset - Start Waypoint"),
+(@ENTRY,0,1,0,40,0,100,0,5,11283,0,0,54,30000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Sammy - On Waypoint 5 Reached - Pause Waypoint");
+
+DELETE FROM `creature_text` WHERE `CreatureId` IN (11282, 11283);
+INSERT INTO `creature_text` (`CreatureId`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES
+(11282, 0, 0, 'I win!', 12, 0, 100, 0, 2000, 0, 6808, 'Melia'),
+(11282, 1, 0, 'Wanna race again? Best two out of three!', 12, 0, 100, 0, 2000, 0, 6809, 'Melia'),
+(11282, 2, 0, 'Ready. Set. GO!', 12, 0, 100, 0, 2000, 0, 6806, 'Melia'),
+(11283, 0, 0, 'You cheated!', 12, 0, 100, 0, 2000, 0, 6810, 'Sammy'),
+(11283, 1, 0, 'HEY! No fair!', 12, 0, 100, 0, 2000, 0, 6807, 'Sammy');
+
+DELETE FROM `waypoints` WHERE `entry` IN (11282, 11283);
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(11282, 1, 1120.09, -2547.57, 59.2532, 'Melia'),
+(11282, 2, 1111.05, -2537.9, 59.2532, 'Melia'),
+(11282, 3, 1100.43, -2547.73, 59.2532, 'Melia'),
+(11282, 4, 1109.6, -2558.2, 59.2532, 'Melia'),
+(11282, 5, 1113.59, -2555.59, 59.2532, 'Melia'),
+(11282, 6, 1113.59, -2555.59, 59.2532, 'Melia'),
+(11283, 1, 1120.72, -2548.21, 59.2532, 'Sammy'),
+(11283, 2, 1110.95, -2538.51, 59.2532, 'Sammy'),
+(11283, 3, 1100.73, -2547.23, 59.2532, 'Sammy'),
+(11283, 4, 1109.56, -2557.59, 59.2532, 'Sammy'),
+(11283, 5, 1111.49, -2556.4, 59.2532, 'Sammy'),
+(11283, 6, 1111.49, -2556.4, 59.2532, 'Sammy');
diff --git a/sql/updates/world/master/2020_04_27_07_world_2017_04_27_02_world.sql b/sql/updates/world/master/2020_04_27_07_world_2017_04_27_02_world.sql
new file mode 100644
index 00000000000..2b34c98d834
--- /dev/null
+++ b/sql/updates/world/master/2020_04_27_07_world_2017_04_27_02_world.sql
@@ -0,0 +1,661 @@
+--
+SET @CGUID:= 100865;
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+13;
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(@CGUID+0, 25719, 571, 0, 0, '0', 0, 0, 0, 3746.502, 6604.442, 169.675, 3.787364, 300, 0, 0, 0, 0, 0, 0, 0, 0, 23420),
+(@CGUID+1, 25718, 571, 0, 0, '0', 0, 0, 0, 3746.502, 6604.442, 169.675, 3.787364, 300, 0, 0, 0, 0, 0, 0, 0, 0, 23420),
+(@CGUID+2, 25719, 571, 0, 0, '0', 0, 0, 0, 3853.462, 6582.238, 167.075, 3.787364, 300, 0, 0, 0, 0, 0, 0, 0, 0, 23420),
+(@CGUID+3, 25718, 571, 0, 0, '0', 0, 0, 0, 3853.462, 6582.238, 167.075, 3.787364, 300, 0, 0, 0, 0, 0, 0, 0, 0, 23420),
+(@CGUID+4, 25719, 571, 0, 0, '0', 0, 0, 0, 3776.172, 6673.002, 151.503, 3.787364, 300, 0, 0, 0, 0, 0, 0, 0, 0, 23420),
+(@CGUID+5, 25718, 571, 0, 0, '0', 0, 0, 0, 3776.172, 6673.002, 151.503, 3.787364, 300, 0, 0, 0, 0, 0, 0, 0, 0, 23420),
+(@CGUID+6, 25713, 571, 0, 0, '0', 0, 0, 0, 3776.486, 7118.085, 165.538, 3.787364, 300, 0, 0, 0, 0, 0, 0, 0, 0, 23420),
+(@CGUID+7, 25713, 571, 0, 0, '0', 0, 0, 0, 3800.425, 7227.171, 163.598, 3.787364, 300, 0, 0, 0, 0, 0, 0, 0, 0, 23420),
+(@CGUID+8, 25707, 571, 0, 0, '0', 0, 0, 0, 3710.079, 7142.518, 160.422, 3.787364, 300, 0, 0, 0, 0, 0, 0, 0, 0, 23420),
+(@CGUID+9, 25721, 571, 0, 0, '0', 0, 0, 0, 3899.659, 6885.204, 128.814, 3.787364, 300, 0, 0, 0, 0, 0, 0, 0, 0, 23420),
+(@CGUID+10, 25721, 571, 0, 0, '0', 0, 0, 0, 3899.659, 6885.204, 139.779, 3.787364, 300, 0, 0, 0, 0, 0, 0, 0, 0, 23420),
+(@CGUID+11, 25721, 571, 0, 0, '0', 0, 0, 0, 3947.159, 6927.227, 139.775, 3.787364, 300, 0, 0, 0, 0, 0, 0, 0, 0, 23420),
+(@CGUID+12, 25721, 571, 0, 0, '0', 0, 0, 0, 3973.956, 6999.285, 139.779, 3.787364, 300, 0, 0, 0, 0, 0, 0, 0, 0, 23420),
+(@CGUID+13, 25721, 571, 0, 0, '0', 0, 0, 0, 3844.386, 6884.535, 139.779, 3.787364, 300, 0, 0, 0, 0, 0, 0, 0, 0, 23420);
+
+DELETE FROM `creature_addon` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+13;
+INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(@CGUID+0, 0, 0, 0, 1, 0, ''),
+(@CGUID+1, 0, 0, 0, 1, 0, '50637'),
+(@CGUID+2, 0, 0, 0, 1, 0, ''),
+(@CGUID+3, 0, 0, 0, 1, 0, '50637'),
+(@CGUID+4, 0, 0, 0, 1, 0, ''),
+(@CGUID+5, 0, 0, 0, 1, 0, '50637'),
+(@CGUID+6, 0, 0, 0, 1, 0, ''),
+(@CGUID+7, 0, 0, 0, 1, 0, ''),
+(@CGUID+8, 0, 0, 0, 1, 0, ''),
+(@CGUID+9, 0, 0, 0, 1, 0, ''),
+(@CGUID+10, 0, 0, 0, 1, 0, ''),
+(@CGUID+11, 0, 0, 0, 1, 0, ''),
+(@CGUID+12, 0, 0, 0, 1, 0, ''),
+(@CGUID+13, 0, 0, 0, 1, 0, '');
+
+UPDATE `creature` SET `position_x` = 3791.703 , `position_y` = 6564.170 , `position_z` = 170.505 WHERE `guid` = 122548;
+UPDATE `creature` SET `position_x` = 3958.501 , `position_y` = 6647.100 , `position_z` = 169.00 WHERE `guid` = 122549;
+UPDATE `creature` SET `position_x` = 4056.562 , `position_y` = 6855.353 , `position_z` = 165.638 WHERE `guid` = 122827;
+UPDATE `creature` SET `position_x` = 4128.494 , `position_y` = 6852.705 , `position_z` = 174.583 WHERE `guid` = 122737;
+UPDATE `creature` SET `position_x` = 4165.607 , `position_y` = 7021.470 , `position_z` = 166.323 WHERE `guid` = 122654;
+UPDATE `creature` SET `position_x` = 4009.485 , `position_y` = 7183.581 , `position_z` = 173.116 WHERE `guid` = 122824;
+UPDATE `creature` SET `position_x` = 3690.599 , `position_y` = 6963.458 , `position_z` = 156.776 WHERE `guid` = 122551;
+UPDATE `creature` SET `position_x` = 3545.916 , `position_y` = 7085.938 , `position_z` = 210.932 , `spawndist` = 20 WHERE `guid` = 122544;
+UPDATE `creature` SET `position_x` = 3737.879 , `position_y` = 6847.578 , `position_z` = 155.801 , `spawndist` = 15 WHERE `guid` = 122546;
+UPDATE `creature_template` SET `speed_walk` = 1 WHERE `entry` = 25718;
+UPDATE `creature` SET `spawndist` = 35 WHERE `guid` =121092;
+UPDATE `creature` SET `spawndist` = 35 WHERE `guid` BETWEEN 121099 AND 121111;
+UPDATE `creature_template` SET `speed_run` = 5.57143 WHERE `entry` = 24770;
+UPDATE `creature_template` SET `InhabitType` = 4 WHERE `entry` = 32534;
+
+DELETE FROM `creature` WHERE `guid` IN (122567, 122666, 122681);
+DELETE FROM `creature_addon` WHERE `guid` IN (122567, 122666, 122681);
+DELETE FROM `creature_formations` WHERE `leaderGUID`= 122681;
+DELETE FROM `waypoint_data` WHERE `id`=1226810;
+
+-- Pathing for Coldarra Spellbinder Entry: 25719 'TDB FORMAT'
+SET @NPC := @CGUID+0;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3746.502,`position_y`=6604.442,`position_z`=169.6752 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3746.502,6604.442,169.6752,0,0,0,0,100,0), -- 10:09:06
+(@PATH,2,3728.466,6628.31,167.4991,0,0,0,0,100,0), -- 10:09:15
+(@PATH,3,3740.985,6611.622,168.9539,0,0,0,0,100,0), -- 10:09:28
+(@PATH,4,3757.911,6590.785,171.0088,0,0,0,0,100,0), -- 10:09:38
+(@PATH,5,3768.777,6586.423,170.0623,0,0,0,0,100,0), -- 10:09:47
+(@PATH,6,3778.069,6575.995,170.2128,0,0,0,0,100,0), -- 10:09:53
+(@PATH,7,3775.362,6580.682,169.8052,0,0,0,0,100,0), -- 10:10:00
+(@PATH,8,3763.144,6588.104,170.9489,0,0,0,0,100,0), -- 10:10:05
+(@PATH,9,3746.518,6604.487,169.7612,0,0,0,0,100,0); -- 10:10:11
+
+DELETE FROM `creature_formations` WHERE `leaderGUID`= @CGUID+0;
+INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES
+(@CGUID+0,@CGUID+0,0,0,2,0,0),
+(@CGUID+0,@CGUID+1,5,0,2,0,0);
+UPDATE `creature` SET `position_x`=3746.502,`position_y`=6604.442,`position_z`=169.6752 WHERE `guid`=@CGUID+1;
+
+-- Pathing for Coldarra Spellbinder Entry: 25719 'TDB FORMAT'
+SET @NPC := @CGUID+2;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3853.462,`position_y`=6582.238,`position_z`=167.0757 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3853.462,6582.238,167.0757,0,0,0,0,100,0), -- 10:11:07
+(@PATH,2,3865.841,6600.766,165.5853,0,0,0,0,100,0), -- 10:11:18
+(@PATH,3,3876.406,6620.453,165.4134,0,0,0,0,100,0), -- 10:11:27
+(@PATH,4,3891.789,6642.364,166.4661,0,0,0,0,100,0), -- 10:11:39
+(@PATH,5,3882.477,6631.198,166.0065,0,0,0,0,100,0), -- 10:11:50
+(@PATH,6,3874.904,6617.864,165.4072,0,0,0,0,100,0), -- 10:11:59
+(@PATH,7,3853.442,6582.185,167.0698,0,0,0,0,100,0); -- 10:12:11
+
+DELETE FROM `creature_formations` WHERE `leaderGUID`= @CGUID+2;
+INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES
+(@CGUID+2,@CGUID+2,0,0,2,0,0),
+(@CGUID+2,@CGUID+3,5,0,2,0,0);
+UPDATE `creature` SET `position_x`=3853.462,`position_y`=6582.238,`position_z`=167.0757 WHERE `guid`=@CGUID+3;
+
+-- Pathing for Coldarra Spellbinder Entry: 25719 'TDB FORMAT'
+SET @NPC := 122682;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3795.907,`position_y`=6607.033,`position_z`=161.6475 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3795.907,6607.033,161.6475,0,0,0,0,100,0), -- 10:09:55
+(@PATH,2,3801.907,6572.36,168.6988,0,0,0,0,100,0), -- 10:10:12
+(@PATH,3,3786.648,6536.464,175.4959,0,0,0,0,100,0), -- 10:10:27
+(@PATH,4,3786.225,6515.275,178.2393,0,0,0,0,100,0), -- 10:10:42
+(@PATH,5,3786.004,6533.51,176.1741,0,0,0,0,100,0), -- 10:10:52
+(@PATH,6,3802.146,6569.362,169.4081,0,0,0,0,100,0), -- 10:10:59
+(@PATH,7,3795.78,6607.015,161.4402,0,0,0,0,100,0); -- 10:11:15
+
+DELETE FROM `creature_formations` WHERE `leaderGUID`= 122682;
+INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES
+(122682,122682,0,0,2,0,0),
+(122682,122667,5,0,2,0,0);
+UPDATE `creature` SET `position_x`=3853.462,`position_y`=6582.238,`position_z`=167.0757 WHERE `guid`=122667;
+
+-- Pathing for Coldarra Spellbinder Entry: 25719 'TDB FORMAT'
+SET @NPC := @CGUID+4;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3776.172,`position_y`=6673.002,`position_z`=151.5036 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3776.172,6673.002,151.5036,0,0,0,0,100,0), -- 10:09:07
+(@PATH,2,3784.46,6665.239,151.547,0,0,0,0,100,0), -- 10:09:12
+(@PATH,3,3792.497,6660.205,151.600,0,0,0,0,100,0), -- 10:09:12
+(@PATH,4,3784.46,6665.239,151.547,0,0,0,0,100,0), -- 10:09:12
+(@PATH,5,3776.189,6673.356,151.5305,0,0,0,0,100,0), -- 10:09:24
+(@PATH,6,3776.414,6686.501,150.9531,0,0,0,0,100,0), -- 10:09:29
+(@PATH,7,3784.757,6700.908,150.913,0,0,0,0,100,0), -- 10:09:36
+(@PATH,8,3776.298,6686.267,151.0565,0,0,0,0,100,0), -- 10:09:41
+(@PATH,9,3776.17,6673.051,151.5327,0,0,0,0,100,0); -- 10:09:47
+
+DELETE FROM `creature_formations` WHERE `leaderGUID`= @CGUID+4;
+INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES
+(@CGUID+4,@CGUID+4,0,0,2,0,0),
+(@CGUID+4,@CGUID+5,5,0,2,0,0);
+UPDATE `creature` SET `position_x`=3776.172,`position_y`=6673.002,`position_z`=151.5036 WHERE `guid`=@CGUID+5;
+
+-- Pathing for Glacial Ancient Entry: 25709 'TDB FORMAT'
+SET @NPC := 122564;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3835.835,`position_y`=6564.987,`position_z`=169.2873 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3835.835,6564.987,169.2873,0,0,0,0,100,0), -- 10:10:49
+(@PATH,2,3865.19,6586.372,167.1716,0,0,0,0,100,0), -- 10:10:59
+(@PATH,3,3880.876,6574.423,169.4702,0,0,0,0,100,0), -- 10:11:14
+(@PATH,4,3870.494,6547.783,173.7017,0,0,0,0,100,0), -- 10:11:23
+(@PATH,5,3858.838,6527.854,176.9228,0,0,0,0,100,0), -- 10:11:35
+(@PATH,6,3835.596,6539.546,173.554,0,0,0,0,100,0), -- 10:11:46
+(@PATH,7,3835.835,6564.987,169.2873,0,0,0,0,100,0); -- 10:10:49
+
+-- Pathing for Glacial Ancient Entry: 25709 'TDB FORMAT'
+SET @NPC := 122566;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4011.055,`position_y`=6732.877,`position_z`=160.3647 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,4011.055,6732.877,160.3647,0,0,0,0,100,0), -- 11:00:47
+(@PATH,2,3988.562,6729.594,157.1546,0,0,0,0,100,0), -- 11:00:58
+(@PATH,3,3947.162,6749.381,152.4034,0,0,0,0,100,0), -- 11:01:07
+(@PATH,4,3952.662,6772.721,153.4604,0,0,0,0,100,0), -- 11:01:24
+(@PATH,5,3973.193,6814.381,158.2204,0,0,0,0,100,0), -- 11:01:35
+(@PATH,6,3993.947,6794.005,160.8671,0,0,0,0,100,0), -- 11:01:53
+(@PATH,7,4015.606,6759.979,163.3595,0,0,0,0,100,0), -- 11:02:06
+(@PATH,8,4011.093,6732.818,160.366,0,0,0,0,100,0); -- 11:02:28
+
+-- Pathing for Glacial Ancient Entry: 25709 'TDB FORMAT'
+SET @NPC := 122563;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4170.233,`position_y`=7033.129,`position_z`=168.403 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,4170.233,7033.129,168.403,0,0,0,0,100,0), -- 11:03:03
+(@PATH,2,4150.032,7039.117,166.215,0,0,0,0,100,0), -- 11:03:09
+(@PATH,3,4143.993,7041.999,165.5633,0,0,0,0,100,0), -- 11:03:20
+(@PATH,4,4143.929,7041.769,165.4963,0,0,0,0,100,0), -- 11:03:28
+(@PATH,5,4166.755,7032.029,167.6483,0,0,0,0,100,0), -- 11:03:35
+(@PATH,6,4179.019,7036.918,169.7405,0,0,0,0,100,0), -- 11:03:45
+(@PATH,7,4203.13,7044.137,175.2166,0,0,0,0,100,0), -- 11:03:51
+(@PATH,8,4183.847,7038.913,170.8574,0,0,0,0,100,0), -- 11:04:03
+(@PATH,9,4170.236,7033.129,168.4034,0,0,0,0,100,0); -- 11:04:11
+
+-- Pathing for Coldarra Scalesworn Entry: 25717 'TDB FORMAT'
+SET @NPC := 122650;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4110.18,`position_y`=6946.943,`position_z`=163.6098 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,4110.18,6946.943,163.6098,0,0,0,0,100,0), -- 11:02:36
+(@PATH,2,4103.704,6947.318,163.2632,0,0,0,0,100,0), -- 11:02:43
+(@PATH,3,4103.726,6946.983,163.1357,0,0,0,0,100,0), -- 11:02:52
+(@PATH,4,4115.845,6946.851,163.8068,0,0,0,0,100,0), -- 11:02:59
+(@PATH,5,4119.202,6946.812,164.0883,0,0,0,0,100,0), -- 11:03:05
+(@PATH,6,4135.35,6952.008,165.1999,0,0,0,0,100,0), -- 11:03:11
+(@PATH,7,4133.528,6951.487,164.7321,0,0,0,0,100,0), -- 11:03:18
+(@PATH,8,4129.267,6950.042,164.7286,0,0,0,0,100,0), -- 11:03:23
+(@PATH,9,4110.18,6946.943,163.6098,0,0,0,0,100,0); -- 11:02:36
+
+-- Pathing for Coldarra Scalesworn Entry: 25717 'TDB FORMAT'
+SET @NPC := 122653;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4177.346,`position_y`=6999.94,`position_z`=167.1795 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,4177.346,6999.94,167.1795,0,0,0,0,100,0), -- 11:02:53
+(@PATH,2,4178.359,7003.933,167.159,0,0,0,0,100,0), -- 11:03:05
+(@PATH,3,4179.334,6983.605,167.3742,0,0,0,0,100,0), -- 11:03:12
+(@PATH,4,4180.535,6960.606,169.7544,0,0,0,0,100,0), -- 11:03:23
+(@PATH,5,4171.201,6939.539,171.0945,0,0,0,0,100,0), -- 11:03:34
+(@PATH,6,4173.018,6943.02,170.7052,0,0,0,0,100,0), -- 11:03:46
+(@PATH,7,4182.021,6975.294,168.3171,0,0,0,0,100,0), -- 11:03:56
+(@PATH,8,4177.346,6999.94,167.1795,0,0,0,0,100,0); -- 11:02:53
+
+-- Pathing for Blue Drakonid Supplicant Entry: 25713 'TDB FORMAT'
+SET @NPC := @CGUID+6;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3776.486,`position_y`=7118.085,`position_z`=165.5381 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3776.486,7118.085,165.5381,0,0,0,0,100,0), -- 11:31:16
+(@PATH,2,3777.939,7118.563,165.6976,0,0,0,0,100,0), -- 11:31:18
+(@PATH,3,3777.769,7118.291,165.5747,0,0,0,0,100,0), -- 11:31:24
+(@PATH,4,3772.185,7117.834,164.6136,0,0,0,0,100,0), -- 11:31:26
+(@PATH,5,3756.582,7117.771,167.8193,0,0,0,0,100,0), -- 11:31:29
+(@PATH,6,3748.333,7119.222,162.9769,0,0,0,0,100,0), -- 11:31:35
+(@PATH,7,3737.513,7121.027,162.1733,0,0,0,0,100,0), -- 11:31:40
+(@PATH,8,3725.984,7124.862,161.4078,0,0,0,0,100,0), -- 11:31:45
+(@PATH,9,3732.13,7121.827,161.6777,0,0,0,0,100,0), -- 11:31:51
+(@PATH,10,3739.073,7120.887,162.5571,0,0,0,0,100,0), -- 11:31:54
+(@PATH,11,3754.043,7118.356,166.37,0,0,0,0,100,0), -- 11:31:59
+(@PATH,12,3766.063,7117.793,165.3616,0,0,0,0,100,0), -- 11:32:03
+(@PATH,13,3776.254,7118.123,165.5038,0,0,0,0,100,0); -- 11:32:10
+
+-- Pathing for Blue Drakonid Supplicant Entry: 25713 'TDB FORMAT'
+SET @NPC := @CGUID+7;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3800.425,`position_y`=7227.171,`position_z`=163.5981 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3800.425,7227.171,163.5981,0,0,0,0,100,0), -- 11:30:54
+(@PATH,2,3810.142,7206.111,161.8623,0,0,0,0,100,0), -- 11:30:59
+(@PATH,3,3804.592,7221.301,163.6667,0,0,0,0,100,0), -- 11:31:09
+(@PATH,4,3796.86,7231.097,163.0284,0,0,0,0,100,0), -- 11:31:15
+(@PATH,5,3777.21,7239.271,160.0223,0,0,0,0,100,0), -- 11:31:20
+(@PATH,6,3770.141,7240.695,159.4914,0,0,0,0,100,0), -- 11:31:28
+(@PATH,7,3776.136,7239.694,159.5423,0,0,0,0,100,0), -- 11:31:36
+(@PATH,8,3793.909,7233.141,162.8602,0,0,0,0,100,0), -- 11:31:42
+(@PATH,9,3800.39,7227.242,163.4349,0,0,0,0,100,0); -- 11:31:50
+
+-- Pathing for Magic-bound Ancient Entry: 25707 'TDB FORMAT'
+SET @NPC := @CGUID+8;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3710.079,`position_y`=7142.518,`position_z`=160.4226 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3710.079,7142.518,160.4226,0,0,0,0,100,0), -- 11:31:41
+(@PATH,2,3686.689,7155.103,160.3858,0,0,0,0,100,0), -- 11:32:01
+(@PATH,3,3710.107,7142.603,160.6128,0,0,0,0,100,0), -- 11:32:13
+(@PATH,4,3684.977,7134.014,160.5279,0,0,0,0,100,0), -- 11:32:20
+(@PATH,5,3670.651,7109.532,160.3714,0,0,0,0,100,0), -- 11:33:46
+(@PATH,6,3675.45,7074.923,159.6847,0,0,0,0,100,0), -- 11:33:50
+(@PATH,7,3671.232,7082.916,160.2348,0,0,0,0,100,0), -- 11:34:00
+(@PATH,8,3664.486,7095.002,160.777,0,0,0,0,100,0), -- 11:34:07
+(@PATH,9,3671.143,7109.756,160.2934,0,0,0,0,100,0), -- 11:34:12
+(@PATH,10,3685.304,7134.208,160.3568,0,0,0,0,100,0), -- 11:34:18
+(@PATH,11,3710.079,7142.518,160.4226,0,0,0,0,100,0); -- 11:31:41
+
+-- Pathing for Glacial Ancient Entry: 25709 'TDB FORMAT'
+SET @NPC := 122557;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3613.729,`position_y`=7243.817,`position_z`=220.5891 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3613.729,7243.817,220.5891,0,0,0,0,100,0), -- 11:39:14
+(@PATH,2,3606.35,7267.252,225.9267,0,0,0,0,100,0), -- 11:39:28
+(@PATH,3,3597.403,7303.142,237.27,0,0,0,0,100,0), -- 11:39:38
+(@PATH,4,3623.762,7318.709,229.6163,0,0,0,0,100,0), -- 11:39:53
+(@PATH,5,3624.336,7287.603,221.3449,0,0,0,0,100,0), -- 11:40:07
+(@PATH,6,3624.804,7317.062,228.2999,0,0,0,0,100,0), -- 11:40:24
+(@PATH,7,3597.886,7306.813,237.9965,0,0,0,0,100,0), -- 11:40:38
+(@PATH,8,3604.609,7272.363,227.2627,0,0,0,0,100,0), -- 11:40:52
+(@PATH,9,3612.816,7250.049,221.6292,0,0,0,0,100,0), -- 11:41:06
+(@PATH,10,3613.881,7218.981,220.517,0,0,0,0,100,0), -- 11:41:17
+(@PATH,11,3613.729,7243.817,220.5891,0,0,0,0,100,0); -- 11:41:33
+
+-- Pathing for Glacial Ancient Entry: 25709 'TDB FORMAT'
+SET @NPC := 122558;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3517.92,`position_y`=7212.637,`position_z`=236.2428 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3517.92,7212.637,236.2428,0,0,0,0,100,0), -- 11:35:05
+(@PATH,2,3550.075,7207.158,227.5906,0,0,0,0,100,0), -- 11:35:23
+(@PATH,3,3592.844,7188.292,223.4674,0,0,0,0,100,0), -- 11:35:39
+(@PATH,4,3587.187,7147.094,220.9413,0,0,0,0,100,0), -- 11:35:57
+(@PATH,5,3586.441,7120.506,214.5045,0,0,0,0,100,0), -- 11:36:14
+(@PATH,6,3581.853,7110.294,213.1641,0,0,0,0,100,0), -- 11:36:24
+(@PATH,7,3577.837,7101.881,212.4084,0,0,0,0,100,0), -- 11:36:32
+(@PATH,8,3564.537,7091.157,212.0578,0,0,0,0,100,0), -- 11:36:39
+(@PATH,9,3517.627,7113.079,213.7343,0,0,0,0,100,0), -- 11:36:56
+(@PATH,10,3508.483,7146.259,217.3716,0,0,0,0,100,0), -- 11:37:07
+(@PATH,11,3513.477,7184.227,226.257,0,0,0,0,100,0), -- 11:37:21
+(@PATH,12,3507.745,7149.502,218.1569,0,0,0,0,100,0), -- 11:37:36
+(@PATH,13,3514.594,7125.146,214.8003,0,0,0,0,100,0), -- 11:37:50
+(@PATH,14,3520.546,7095.021,212.3433,0,0,0,0,100,0), -- 11:38:03
+(@PATH,15,3520.975,7092.51,211.883,0,0,0,0,100,0), -- 11:38:14
+(@PATH,16,3564.593,7091.29,212.0666,0,0,0,0,100,0), -- 11:38:31
+(@PATH,17,3585.45,7118.269,213.5838,0,0,0,0,100,0), -- 11:38:38
+(@PATH,18,3586.194,7142.931,219.9543,0,0,0,0,100,0), -- 11:38:47
+(@PATH,19,3590.48,7164.959,223.1869,0,0,0,0,100,0), -- 11:38:57
+(@PATH,20,3558.002,7205.05,226.8047,0,0,0,0,100,0), -- 11:39:14
+(@PATH,21,3517.836,7212.686,236.2242,0,0,0,0,100,0); -- 11:39:31
+
+-- Pathing for Glacial Ancient Entry: 25709 'TDB FORMAT'
+SET @NPC := 122559;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3687.762,`position_y`=7297.271,`position_z`=216.3398 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3687.762,7297.271,216.3398,0,0,0,0,100,0), -- 11:59:27
+(@PATH,2,3707.212,7307.455,212.5712,0,0,0,0,100,0), -- 11:59:42
+(@PATH,3,3722.934,7317.455,210.9211,0,0,0,0,100,0), -- 11:59:54
+(@PATH,4,3745.952,7321.007,208.1814,0,0,0,0,100,0), -- 12:00:01
+(@PATH,5,3773.425,7337.966,202.0872,0,0,0,0,100,0), -- 12:00:09
+(@PATH,6,3803.516,7357.45,195.994,0,0,0,0,100,0), -- 12:00:23
+(@PATH,7,3832.716,7372.932,194.2845,0,0,0,0,100,0), -- 12:00:38
+(@PATH,8,3869.961,7381.905,190.084,0,0,0,0,100,0), -- 12:00:51
+(@PATH,9,3872.366,7356.501,185.054,0,0,0,0,100,0), -- 12:01:07
+(@PATH,10,3857.737,7331.208,182.6498,0,0,0,0,100,0), -- 12:01:20
+(@PATH,11,3844.623,7305.171,179.0436,0,0,0,0,100,0), -- 12:01:33
+(@PATH,12,3844.439,7290.313,176.6929,0,0,0,0,100,0), -- 12:01:42
+(@PATH,13,3855.4,7274.202,177.718,0,0,0,0,100,0), -- 12:01:48
+(@PATH,14,3886.856,7257.011,177.3157,0,0,0,0,100,0), -- 12:02:12
+(@PATH,15,3868.667,7259.01,177.2133,0,0,0,0,100,0), -- 12:03:01
+(@PATH,16,3853.885,7253.435,175.0069,0,0,0,0,100,0), -- 12:03:01
+(@PATH,17,3844.439,7290.313,176.6929,0,0,0,0,100,0), -- 12:01:42
+(@PATH,18,3872.366,7356.501,185.054,0,0,0,0,100,0), -- 12:01:07
+(@PATH,19,3869.961,7381.905,190.084,0,0,0,0,100,0), -- 12:00:51
+(@PATH,20,3803.516,7357.45,195.994,0,0,0,0,100,0), -- 12:00:23
+(@PATH,21,3745.952,7321.007,208.1814,0,0,0,0,100,0), -- 12:00:01
+(@PATH,22,3722.934,7317.455,210.9211,0,0,0,0,100,0), -- 11:59:54
+(@PATH,23,3687.762,7297.271,216.3398,0,0,0,0,100,0); -- 11:59:27
+
+-- Pathing for Glacial Ancient Entry: 25709 'TDB FORMAT'
+SET @NPC := 122565;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3708.99,`position_y`=6800.135,`position_z`=161.5988 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3708.99,6800.135,161.5988,0,0,0,0,100,0), -- 12:12:58
+(@PATH,2,3692.747,6804.992,164.3114,0,0,0,0,100,0), -- 12:13:11
+(@PATH,3,3639.456,6825.105,165.9832,0,0,0,0,100,0), -- 12:13:24
+(@PATH,4,3665.913,6795.765,168.4959,0,0,0,0,100,0), -- 12:13:41
+(@PATH,5,3640.409,6822.443,166.3176,0,0,0,0,100,0), -- 12:14:00
+(@PATH,6,3671.205,6812.824,163.8588,0,0,0,0,100,0), -- 12:14:17
+(@PATH,7,3706.647,6800.021,162.3539,0,0,0,0,100,0), -- 12:14:34
+(@PATH,8,3735.945,6812.461,155.727,0,0,0,0,100,0), -- 12:14:47
+(@PATH,9,3770.794,6815.737,150.5865,0,0,0,0,100,0), -- 12:15:00
+(@PATH,10,3782.188,6807.51,151.3537,0,0,0,0,100,0), -- 12:15:17
+(@PATH,11,3781.339,6813.935,150.541,0,0,0,0,100,0), -- 12:15:31
+(@PATH,12,3738.144,6812.984,155.2458,0,0,0,0,100,0), -- 12:15:41
+(@PATH,13,3709.039,6800.329,161.4585,0,0,0,0,100,0); -- 12:15:59
+
+SET @NPC := 122690;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3844.386,`position_y`=6884.535,`position_z`=116.977 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3844.386,6884.535,116.977,0,0,0,0,100,0), -- 12:13:11
+(@PATH,2,3899.659,6885.204,116.977,0,0,0,0,100,0);
+
+SET @NPC := 122691;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3899.659,`position_y`=6885.204,`position_z`=116.977 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3899.659,6885.204,116.977,0,0,0,0,100,0), -- 12:13:24
+(@PATH,2,3947.159,6927.227,116.977,0,0,0,0,100,0);
+
+SET @NPC := 122692;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3947.159,`position_y`=6927.227,`position_z`=116.977 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3947.159,6927.227,116.977,0,0,0,0,100,0), -- 12:13:41
+(@PATH,2,3973.956,6999.285,116.977,0,0,0,0,100,0);
+
+SET @NPC := 122693;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3973.956,`position_y`=6999.285,`position_z`=116.977 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3973.956,6999.285,116.977,0,0,0,0,100,0), -- 12:14:00
+(@PATH,2,3954.742,7044.256,116.977,0,0,0,0,100,0);
+
+SET @NPC := 122694;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3954.742,`position_y`=7044.256,`position_z`=116.977 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3954.742,7044.256,116.977,0,0,0,0,100,0), -- 12:14:17
+(@PATH,2,3849.460,7077.785,116.977,0,0,0,0,100,0);
+
+SET @NPC := 122696;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3849.460,`position_y`=7077.785,`position_z`=116.977 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3849.460,7077.785,116.977,0,0,0,0,100,0), -- 12:14:34
+(@PATH,2,3777.356,7034.979,116.977,0,0,0,0,100,0);
+
+SET @NPC := 122699;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3771.472,`position_y`=6971.930,`position_z`=128.814 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,2,3777.356,7034.979,128.814,0,0,0,0,100,0), -- 12:14:47
+(@PATH,1,3771.472,6971.930,128.814,0,0,0,0,100,0); -- 12:15:00
+
+SET @NPC := 122701;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3777.356,`position_y`=7034.979,`position_z`=128.814 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,2,3849.460,7077.785,128.814,0,0,0,0,100,0), -- 12:14:34
+(@PATH,1,3777.356,7034.979,128.814,0,0,0,0,100,0); -- 12:14:47
+
+SET @NPC := 122702;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3849.460,`position_y`=7077.785,`position_z`=128.814 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,2,3954.742,7044.256,128.814,0,0,0,0,100,0), -- 12:14:17
+(@PATH,1,3849.460,7077.785,128.814,0,0,0,0,100,0);
+
+SET @NPC := 122703;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3954.742,`position_y`=7044.256,`position_z`=128.814 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,2,3973.956,6999.285,128.814,0,0,0,0,100,0), -- 12:14:00
+(@PATH,1,3954.742,7044.256,128.814,0,0,0,0,100,0);
+
+SET @NPC := 122704;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3973.956,`position_y`=6999.285,`position_z`=128.814 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,2,3947.159,6927.227,128.814,0,0,0,0,100,0), -- 12:13:41
+(@PATH,1,3973.956,6999.285,128.814,0,0,0,0,100,0);
+
+SET @NPC := 122705;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3947.159,`position_y`=6927.227,`position_z`=128.814 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,2,3899.659,6885.204,128.814,0,0,0,0,100,0), -- 12:13:24
+(@PATH,1,3947.159,6927.227,128.814,0,0,0,0,100,0);
+
+SET @NPC := @CGUID+9;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3899.659,`position_y`=6885.204,`position_z`=128.814 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,2,3844.386,6884.535,128.814,0,0,0,0,100,0), -- 12:13:11
+(@PATH,1,3899.659,6885.204,128.814,0,0,0,0,100,0); -- 12:13:24
+
+SET @NPC := @CGUID+10;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3899.659,`position_y`=6885.204,`position_z`=139.779 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3899.659,6885.204,139.779,0,0,0,0,100,0), -- 12:13:24
+(@PATH,2,3947.159,6927.227,139.779,0,0,0,0,100,0);
+
+SET @NPC := @CGUID+11;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3947.159,`position_y`=6927.227,`position_z`=139.779 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3947.159,6927.227,139.779,0,0,0,0,100,0), -- 12:13:41
+(@PATH,2,3973.956,6999.285,139.779,0,0,0,0,100,0);
+
+SET @NPC := @CGUID+12;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3973.956,`position_y`=6999.285,`position_z`=139.779 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3973.956,6999.285,139.779,0,0,0,0,100,0), -- 12:14:00
+(@PATH,2,3954.742,7044.256,139.779,0,0,0,0,100,0);
+
+SET @NPC := 122699;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3954.742,`position_y`=7044.256,`position_z`=139.779 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3954.742,7044.256,139.779,0,0,0,0,100,0), -- 12:14:17
+(@PATH,2,3849.460,7077.785,139.779,0,0,0,0,100,0);
+
+
+SET @NPC := @CGUID+13;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3844.386,`position_y`=6884.535,`position_z`=139.779 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3844.386,6884.535,139.779,0,0,0,0,100,0), -- 12:13:11
+(@PATH,2,3899.659,6885.204,139.779,0,0,0,0,100,0);
+
+SET @NPC := 122700;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3608.967,`position_y`=6921.947,`position_z`=171.243 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3608.967,6921.947,171.243,0,0,0,0,100,0), -- 12:12:58
+(@PATH,2,3645.704,6919.833,162.704,0,0,0,0,100,0), -- 12:13:11
+(@PATH,3,3708.166,6916.377,141.299,0,0,0,0,100,0), -- 12:13:24
+(@PATH,4,3755.512,6942.326,128.528,0,0,0,0,100,0), -- 12:13:41
+(@PATH,5,3708.166,6916.377,141.299,0,0,0,0,100,0), -- 12:13:24
+(@PATH,6,3645.704,6919.833,162.704,0,0,0,0,100,0), -- 12:13:11
+(@PATH,7,3608.967,6921.947,171.243,0,0,0,0,100,0);
+
+SET @NPC := 122697;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4101.004,`position_y`= 6768.417,`position_z`= 175.147 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,4101.004,6768.417,175.147,0,0,0,0,100,0), -- 12:12:58
+(@PATH,2,4044.740,6779.533,166.437,0,0,0,0,100,0), -- 12:13:11
+(@PATH,3,4027.592,6806.338,164.339,0,0,0,0,100,0), -- 12:13:24
+(@PATH,4,4035.885,6847.380,164.952,0,0,0,0,100,0), -- 12:13:41
+(@PATH,5,4003.515,6883.456,159.719,0,0,0,0,100,0), -- 12:13:24
+(@PATH,6,3984.422,6925.823,132.130,0,0,0,0,100,0), -- 12:13:11
+(@PATH,7,4003.515,6883.456,159.719,0,0,0,0,100,0), -- 12:13:24
+(@PATH,8,4035.885,6847.380,164.952,0,0,0,0,100,0), -- 12:13:41
+(@PATH,9,4027.592,6806.338,164.339,0,0,0,0,100,0), -- 12:13:24
+(@PATH,10,4044.740,6779.533,166.437,0,0,0,0,100,0), -- 12:13:11
+(@PATH,11,4101.004,6768.417,175.147,0,0,0,0,100,0); -- 12:12:58
+
+SET @NPC := 122698;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3971.448,`position_y`= 7253.354,`position_z`= 181.999 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3971.448,7253.354,181.999,0,0,0,0,100,0), -- 12:12:58
+(@PATH,2,3947.747,7224.773,172.647,0,0,0,0,100,0), -- 12:13:11
+(@PATH,3,3958.392,7169.247,166.275,0,0,0,0,100,0), -- 12:13:24
+(@PATH,4,3922.217,7111.124,157.287,0,0,0,0,100,0), -- 12:13:41
+(@PATH,5,3912.121,7088.232,138.103,0,0,0,0,100,0), -- 12:13:24
+(@PATH,6,3922.217,7111.124,157.287,0,0,0,0,100,0), -- 12:13:41
+(@PATH,7,3958.392,7169.247,166.275,0,0,0,0,100,0), -- 12:13:24
+(@PATH,8,3947.747,7224.773,172.647,0,0,0,0,100,0), -- 12:13:11
+(@PATH,9,3971.448,7253.354,181.999,0,0,0,0,100,0);
+
+-- Glacial Ancient SAI
+SET @ENTRY := 25709;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`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`,`comment`) VALUES
+(@ENTRY,0,0,0,0,0,100,0,5000,8000,12000,16000,11,50505,0,0,0,0,0,2,0,0,0,0,0,0,0,"Glacial Ancient - In Combat - Cast 'Frost Breath'");
+
+-- Coldarra Scalesworn SAI
+SET @ENTRY := 25717;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`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`,`comment`) VALUES
+(@ENTRY,0,0,0,0,0,100,0,3000,5000,15000,17000,11,11977,0,0,0,0,0,2,0,0,0,0,0,0,0,"Coldarra Scalesworn - In Combat - Cast 'Rend'"),
+(@ENTRY,0,1,0,0,0,100,0,1000,3000,8000,12000,11,12748,0,0,0,0,0,2,0,0,0,0,0,0,0,"Coldarra Scalesworn - In Combat - Cast 'Frost Nova'");
+
+-- Scalesworn Elite SAI
+SET @ENTRY := 32534;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`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`,`comment`) VALUES
+(@ENTRY,0,0,0,0,0,100,0,0,3000,3000,8000,11,61269,0,0,0,0,0,2,0,0,0,0,0,0,0,"Scalesworn Elite - In Combat - Cast 'Ice Shard'"),
+(@ENTRY,0,1,0,0,0,100,0,6000,9000,16000,22000,11,61272,0,0,0,0,0,2,0,0,0,0,0,0,0,"Scalesworn Elite - In Combat - Cast 'Arcane Surge'");
+
+DELETE FROM `gameobject` WHERE `guid`IN(46,48,50,55,57);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES
+(46, 188113, 571, 0, 0, '0', 0, 4127.31, 6852.023, 174.3926, 3.717554, 0, 0, -0.9588194, 0.2840165, 120, 255, 1, 23420), -- 188113 (Area: -1)
+(48, 188113, 571, 0, 0, '0', 0, 4123.374, 6881.992, 172.3801, 0.4188786, 0, 0, 0.2079115, 0.9781476, 120, 255, 1, 23420), -- 188113 (Area: -1)
+(50, 188113, 571, 0, 0, '0', 0, 4095.132, 6847.428, 168.9135, 2.007128, 0, 0, 0.8433914, 0.5372996, 120, 255, 1, 23420), -- 188113 (Area: -1)
+(55, 188113, 571, 0, 0, '0', 0, 3872.185, 7336.54, 181.9368, 2.495818, 0, 0, 0.9483232, 0.3173059, 120, 255, 1, 23420), -- 188113 (Area: -1)
+(57, 188113, 571, 0, 0, '0', 0, 3880.16, 7309.908, 181.1171, 6.178466, 0, 0, -0.05233574, 0.9986296, 120, 255, 1, 23420); -- 188113 (Area: -1)
+ \ No newline at end of file
diff --git a/sql/updates/world/master/2020_04_27_08_world_2017_04_28_00_world.sql b/sql/updates/world/master/2020_04_27_08_world_2017_04_28_00_world.sql
new file mode 100644
index 00000000000..b5e6c43e35a
--- /dev/null
+++ b/sql/updates/world/master/2020_04_27_08_world_2017_04_28_00_world.sql
@@ -0,0 +1,264 @@
+SET @CGUID:= 146625;
+DELETE FROM `creature` WHERE `id` = 25390;
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+249;
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(@CGUID+0, 25377, 571, 0, 0, '0', 1, 0, 0, 3856.362, 3761.855, 51.49897, 1.787884, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+1, 25377, 571, 0, 0, '0', 1, 0, 0, 3848.972, 3760.094, 53.60237, 2.532431, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+2, 25377, 571, 0, 0, '0', 1, 0, 0, 3845.313, 3760.938, 55.2104, 2.888491, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+3, 25377, 571, 0, 0, '0', 1, 0, 0, 3854.785, 3778.629, 56.78143, 1.964004, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+4, 25377, 571, 0, 0, '0', 1, 0, 0, 3895.797, 3773.958, 51.84527, 5.737518, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+5, 15214, 571, 0, 0, '0', 1, 0, 0, 3889.836, 3771.971, 51.535, 1.236767, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 15214 (Area: -1)
+(@CGUID+6, 25378, 571, 0, 0, '0', 1, 0, 0, 3945.438, 3731.835, 62.38454, 1.710423, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: -1)
+(@CGUID+7, 25377, 571, 0, 0, '0', 1, 0, 0, 3873.349, 3778.878, 54.86187, 0.915302, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+8, 25377, 571, 0, 0, '0', 1, 0, 0, 3937.869, 3761.81, 66.29324, 2.285362, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+9, 25377, 571, 0, 0, '0', 1, 0, 0, 3905.761, 3785.872, 56.2091, 5.008369, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+10, 25377, 571, 0, 0, '0', 1, 0, 0, 3852.035, 3777.488, 56.57757, 2.511892, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+11, 25377, 571, 0, 0, '0', 1, 0, 0, 3895.971, 3777.111, 52.89691, 5.152364, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+12, 25377, 571, 0, 0, '0', 1, 0, 0, 3859.266, 3777.747, 55.64642, 3.875577, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+13, 25377, 571, 0, 0, '0', 1, 0, 0, 3873.917, 3773.739, 53.1734, 3.546263, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+14, 25377, 571, 0, 0, '0', 1, 0, 0, 3858.755, 3773.773, 54.30145, 2.155118, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+15, 25377, 571, 0, 0, '0', 1, 0, 0, 3934.469, 3758.464, 65.99844, 0.7296588, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+16, 25377, 571, 0, 0, '0', 1, 0, 0, 3871.434, 3774.329, 52.98407, 1.029868, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+17, 25377, 571, 0, 0, '0', 1, 0, 0, 3895.806, 3782.894, 54.03167, 2.843827, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+18, 25377, 571, 0, 0, '0', 1, 0, 0, 3857.359, 3780.822, 57.45977, 6.231272, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+19, 25378, 571, 0, 0, '0', 1, 0, 0, 3887.787, 3748.568, 46.64261, 1.832596, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: -1)
+(@CGUID+20, 25377, 571, 0, 0, '0', 1, 0, 0, 3881.459, 3771.939, 52.34649, 2.209149, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+21, 25377, 571, 0, 0, '0', 1, 0, 0, 3901.681, 3773.557, 53.1372, 2.395434, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+22, 25377, 571, 0, 0, '0', 1, 0, 0, 3876.524, 3776.051, 54.03057, 1.422759, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+23, 25377, 571, 0, 0, '0', 1, 0, 0, 3853.302, 3774.513, 55.80389, 2.107602, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+24, 25377, 571, 0, 0, '0', 1, 0, 0, 3942.292, 3757.19, 65.39615, 0.939211, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+25, 25377, 571, 0, 0, '0', 1, 0, 0, 3877.188, 3770.377, 51.82452, 0.562353, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+26, 25377, 571, 0, 0, '0', 1, 0, 0, 3946.085, 3758.676, 65.89896, 3.295287, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+27, 25377, 571, 0, 0, '0', 1, 0, 0, 3901.85, 3781.824, 55.3778, 0.7305052, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+28, 25377, 571, 0, 0, '0', 1, 0, 0, 3950.509, 3760.267, 66.09, 2.847162, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+29, 15214, 571, 0, 0, '0', 1, 0, 0, 3942.177, 3756.028, 65.025, 4.628274, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 15214 (Area: -1) (Auras: )
+-- (@CGUID+30, 25492, 571, 0, 0, '0', 0, 0, 0, 4023.196, 3604.876, 106.491, 1.675516, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25492 (Area: -1)
+(@CGUID+31, 25377, 571, 0, 0, '0', 1, 0, 0, 3940.087, 3778.05, 67.43326, 5.391348, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+32, 25377, 571, 0, 0, '0', 1, 0, 0, 3947.441, 3774.648, 67.16287, 5.483166, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+33, 25377, 571, 0, 0, '0', 1, 0, 0, 3950.542, 3756.351, 65.14139, 1.024377, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+34, 25377, 571, 0, 0, '0', 1, 0, 0, 3951.158, 3783.321, 66.46609, 1.680158, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+35, 25377, 571, 0, 0, '0', 1, 0, 0, 3946.375, 3798.536, 69.6951, 1.496066, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+36, 25377, 571, 0, 0, '0', 1, 0, 0, 3950.66, 3779.663, 66.48564, 0.2942728, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+37, 25377, 571, 0, 0, '0', 1, 0, 0, 3953.416, 3814.574, 71.72324, 1.447305, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+38, 25378, 571, 0, 0, '0', 1, 0, 0, 3983.542, 3769.677, 62.64833, 4.859846, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: -1)
+(@CGUID+39, 25377, 571, 0, 0, '0', 1, 0, 0, 3942.997, 3797.084, 69.11807, 4.048098, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+40, 25377, 571, 0, 0, '0', 1, 0, 0, 3939.094, 3821.365, 70.90989, 4.823489, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+41, 25377, 571, 0, 0, '0', 1, 0, 0, 3943.163, 3783.04, 67.5856, 0.6302186, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+42, 25377, 571, 0, 0, '0', 1, 0, 0, 3947.942, 3807.152, 70.84385, 6.25543, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+43, 25377, 571, 0, 0, '0', 1, 0, 0, 3947.802, 3804.568, 70.63902, 4.229197, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+44, 25377, 571, 0, 0, '0', 1, 0, 0, 3955.821, 3811.656, 71.62571, 2.640486, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+45, 25377, 571, 0, 0, '0', 1, 0, 0, 3942.419, 3806.433, 70.30625, 6.006355, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+46, 25377, 571, 0, 0, '0', 1, 0, 0, 3955.7, 3781.918, 64.83658, 6.117535, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+47, 25377, 571, 0, 0, '0', 1, 0, 0, 3939.559, 3803.456, 69.71299, 3.782476, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+48, 25377, 571, 0, 0, '0', 1, 0, 0, 3938.022, 3836.511, 73.84203, 5.077127, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+49, 25377, 571, 0, 0, '0', 1, 0, 0, 3956.413, 3817.224, 72.36948, 3.131958, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+50, 25377, 571, 0, 0, '0', 1, 0, 0, 4010.828, 3739.584, 66.05321, 0.8970829, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+51, 25377, 571, 0, 0, '0', 1, 0, 0, 4008.854, 3730.729, 65.51659, 5.020262, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+52, 25377, 571, 0, 0, '0', 1, 0, 0, 4013.835, 3739.858, 66.744, 3.290065, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+53, 25377, 571, 0, 0, '0', 1, 0, 0, 4013.431, 3732.159, 67.31004, 4.268528, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+54, 25377, 571, 0, 0, '0', 1, 0, 0, 4003.856, 3737.709, 64.45518, 2.910134, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+-- (@CGUID+55, 25391, 571, 0, 0, '0', 0, 0, 0, 4024.555, 3742.407, 88.99696, 3.543018, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25391 (Area: -1) (Auras: )
+(@CGUID+56, 25377, 571, 0, 0, '0', 0, 0, 0, 3985.718, 3813.569, 68.40765, 2.829013, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+57, 25377, 571, 0, 0, '0', 0, 0, 0, 4014.136, 3736.033, 67.28185, 4.049169, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+58, 25377, 571, 0, 0, '0', 0, 0, 0, 4006.304, 3819.676, 72.36139, 0.5565031, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+59, 25377, 571, 0, 0, '0', 0, 0, 0, 3983.958, 3819.676, 71.01385, 1.145607, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+60, 25377, 571, 0, 0, '0', 0, 0, 0, 4019.725, 3801.281, 66.31256, 2.917216, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+61, 25378, 571, 0, 0, '0', 0, 0, 0, 4003.135, 3791.937, 62.67893, 1.675516, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: -1)
+-- (@CGUID+62, 25391, 571, 0, 0, '0', 0, 0, 0, 4014.546, 3773.259, 88.09467, 3.176499, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25391 (Area: -1) (Auras: )
+(@CGUID+63, 25377, 571, 0, 0, '0', 0, 0, 0, 3979.844, 3820.275, 71.65765, 4.897894, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+64, 25377, 571, 0, 0, '0', 0, 0, 0, 3977.068, 3832.302, 76.76068, 5.369745, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+65, 25377, 571, 0, 0, '0', 0, 0, 0, 3975.965, 3811.767, 69.58331, 4.890862, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+66, 25377, 571, 0, 0, '0', 0, 0, 0, 3961.483, 3809.533, 71.12608, 1.679816, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+67, 25378, 571, 0, 0, '0', 0, 0, 0, 4031.613, 3765.301, 88.1413, 2.775074, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: -1)
+(@CGUID+68, 25377, 571, 0, 0, '0', 0, 0, 0, 3930.518, 3831.502, 70.80496, 4.922265, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+69, 25377, 571, 0, 0, '0', 0, 0, 0, 3943.751, 3825.671, 72.6898, 1.378705, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+70, 25377, 571, 0, 0, '0', 0, 0, 0, 3999.025, 3816.855, 70.74554, 0.3368048, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+71, 25377, 571, 0, 0, '0', 0, 0, 0, 3943.419, 3831.631, 74.16563, 3.242679, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+72, 25377, 571, 0, 0, '0', 0, 0, 0, 3980.091, 3835.34, 77.89709, 4.097147, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+73, 25377, 571, 0, 0, '0', 0, 0, 0, 3985.691, 3810.795, 67.0307, 5.729337, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+74, 25377, 571, 0, 0, '0', 0, 0, 0, 3961.77, 3812.996, 71.89756, 0.1600965, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+75, 25377, 571, 0, 0, '0', 0, 0, 0, 3953.116, 3839.654, 77.24921, 1.785299, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+76, 25377, 571, 0, 0, '0', 0, 0, 0, 3994.533, 3822.952, 73.17596, 0.7260628, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+77, 25377, 571, 0, 0, '0', 0, 0, 0, 3978.996, 3816.431, 70.33807, 0.5169653, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+78, 25377, 571, 0, 0, '0', 0, 0, 0, 3956.791, 3817.895, 72.57554, 2.857513, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+79, 25377, 571, 0, 0, '0', 0, 0, 0, 4007.341, 3814.753, 69.79547, 5.739625, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+80, 25377, 571, 0, 0, '0', 0, 0, 0, 4007.547, 3819.425, 72.16815, 1.637677, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+81, 25377, 571, 0, 0, '0', 0, 0, 0, 3949.229, 3843.808, 77.34271, 4.109823, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+82, 25377, 571, 0, 0, '0', 0, 0, 0, 4003.176, 3822.928, 73.94293, 4.416482, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+83, 25377, 571, 0, 0, '0', 0, 0, 0, 3973.253, 3840.189, 79.14282, 0.1356232, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+-- (@CGUID+84, 25471, 571, 0, 0, '0', 0, 0, 0, 4111.138, 3734.866, 91.84813, 3.996804, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25471 (Area: -1) --
+(@CGUID+85, 25377, 571, 0, 0, '0', 0, 0, 0, 3958.608, 3842.374, 77.76642, 3.547766, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+86, 25378, 571, 0, 0, '0', 0, 0, 0, 4042.49, 3745.191, 88.50867, 3.246312, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: -1)
+(@CGUID+87, 25377, 571, 0, 0, '0', 0, 0, 0, 3933.178, 3842.617, 73.65913, 0.7102271, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+88, 25377, 571, 0, 0, '0', 0, 0, 0, 3985.925, 3836.56, 78.08765, 0.3928989, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+89, 25377, 571, 0, 0, '0', 0, 0, 0, 4018.704, 3807.378, 68.41994, 3.146591, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+90, 25377, 571, 0, 0, '0', 0, 0, 0, 4024.622, 3802.451, 68.20343, 2.903348, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+-- (@CGUID+91, 25391, 571, 0, 0, '0', 0, 0, 0, 4053.731, 3790.188, 88.898, 5.358161, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25391 (Area: -1) (Auras: )
+(@CGUID+92, 25377, 571, 0, 0, '0', 0, 0, 0, 4023.776, 3809.938, 69.86577, 3.449748, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+93, 25377, 571, 0, 0, '0', 0, 0, 0, 4041.068, 3812.419, 73.50181, 2.869276, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+94, 25377, 571, 0, 0, '0', 0, 0, 0, 3977.11, 3842.004, 79.86098, 0.7784538, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+95, 25377, 571, 0, 0, '0', 0, 0, 0, 4040.451, 3802.602, 70.72752, 2.495649, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+96, 25377, 571, 0, 0, '0', 0, 0, 0, 4017.696, 3822.242, 73.9433, 5.397349, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+97, 25377, 571, 0, 0, '0', 0, 0, 0, 4044.622, 3802.832, 70.57517, 0.5576683, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+98, 25377, 571, 0, 0, '0', 0, 0, 0, 4011.047, 3839.548, 76.7318, 6.244549, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+99, 25377, 571, 0, 0, '0', 0, 0, 0, 4026.381, 3805.319, 69.17072, 5.322569, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+100, 25377, 571, 0, 0, '0', 0, 0, 0, 4043.563, 3797.688, 70.98014, 5.236726, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+101, 25377, 571, 0, 0, '0', 0, 0, 0, 3993.121, 3844.239, 79.35071, 5.135974, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+102, 25377, 571, 0, 0, '0', 0, 0, 0, 4019.319, 3811.758, 70.11395, 5.55163, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+103, 25377, 571, 0, 0, '0', 0, 0, 0, 4028.581, 3822.207, 74.36981, 5.899706, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+104, 25377, 571, 0, 0, '0', 0, 0, 0, 3947.608, 3847.873, 77.20355, 2.409402, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+105, 25377, 571, 0, 0, '0', 0, 0, 0, 4026.606, 3825.278, 75.37921, 6.166935, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+106, 25377, 571, 0, 0, '0', 0, 0, 0, 4021.991, 3829.991, 76.58698, 4.33053, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+107, 25377, 571, 0, 0, '0', 0, 0, 0, 4040.658, 3797.008, 71.00822, 3.501203, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+108, 25377, 571, 0, 0, '0', 0, 0, 0, 4004.436, 3840.204, 77.43212, 1.105561, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+109, 25377, 571, 0, 0, '0', 0, 0, 0, 3956.497, 3851.48, 78.62555, 3.324586, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+110, 25377, 571, 0, 0, '0', 0, 0, 0, 4038.561, 3815.458, 74.1273, 1.256246, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+111, 25377, 571, 0, 0, '0', 0, 0, 0, 3980.532, 3839.45, 79.25122, 5.701941, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+112, 25377, 571, 0, 0, '0', 0, 0, 0, 4037.742, 3797.284, 70.75016, 3.675025, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+113, 25377, 571, 0, 0, '0', 0, 0, 0, 4024.293, 3820.985, 73.6358, 0.74111, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+114, 25377, 571, 0, 0, '0', 0, 0, 0, 3969.766, 3851.225, 80.8999, 1.407759, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+115, 25377, 571, 0, 0, '0', 0, 0, 0, 4044.113, 3798.313, 71.03507, 1.526782, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+116, 25377, 571, 0, 0, '0', 0, 0, 0, 3988.41, 3863.551, 85.09741, 1.77021, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+117, 25377, 571, 0, 0, '0', 0, 0, 0, 3980.214, 3854.178, 82.61475, 1.526452, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+118, 25377, 571, 0, 0, '0', 0, 0, 0, 4061.403, 3806.529, 73.14072, 1.009966, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+119, 25377, 571, 0, 0, '0', 0, 0, 0, 3952.42, 3855.544, 78.36176, 5.831243, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+120, 25377, 571, 0, 0, '0', 0, 0, 0, 3978.812, 3856.061, 83.19165, 1.515909, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+121, 25377, 571, 0, 0, '0', 0, 0, 0, 4041.886, 3825.319, 76.65525, 2.360835, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+122, 25378, 571, 0, 0, '0', 0, 0, 0, 4059.954, 3772.845, 88.27218, 2.076942, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: -1)
+(@CGUID+123, 25377, 571, 0, 0, '0', 0, 0, 0, 4054.301, 3809.695, 73.50803, 1.462021, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+124, 25377, 571, 0, 0, '0', 0, 0, 0, 4001.414, 3852.939, 83.30297, 0.7778957, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+125, 25377, 571, 0, 0, '0', 0, 0, 0, 4027.71, 3835.373, 77.92162, 2.965322, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+126, 25377, 571, 0, 0, '0', 0, 0, 0, 3971.56, 3854.037, 81.95898, 3.315667, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+127, 25377, 571, 0, 0, '0', 0, 0, 0, 4043.886, 3813.275, 73.8187, 5.252536, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+128, 25377, 571, 0, 0, '0', 0, 0, 0, 3992.059, 3860.479, 85.22095, 0.3067477, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+129, 25387, 571, 0, 0, '0', 0, 0, 0, 4108.792, 3628.817, 117.1614, 1.936917, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25387 (Area: -1)
+(@CGUID+130, 25377, 571, 0, 0, '0', 0, 0, 0, 4040.829, 3821.539, 75.87366, 3.807508, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+131, 25377, 571, 0, 0, '0', 0, 0, 0, 3978.755, 3862.269, 84.41016, 6.079549, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+132, 25377, 571, 0, 0, '0', 0, 0, 0, 4011.224, 3842.406, 77.72607, 1.74512, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+133, 25377, 571, 0, 0, '0', 0, 0, 0, 3972.081, 3859.687, 83.02417, 6.191478, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+134, 25377, 571, 0, 0, '0', 0, 0, 0, 4055.908, 3812.092, 74.2761, 5.387706, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+135, 15214, 571, 0, 0, '0', 0, 0, 0, 4015.447, 3812.16, 69.756, 4.06342, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 15214 (Area: -1)
+(@CGUID+136, 25377, 571, 0, 0, '0', 0, 0, 0, 4041.674, 3819.853, 75.61887, 1.068842, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+137, 25377, 571, 0, 0, '0', 0, 0, 0, 3994.814, 3862.187, 86.10242, 2.840913, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+138, 25377, 571, 0, 0, '0', 0, 0, 0, 4007.844, 3844.194, 78.89172, 1.35082, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+139, 25377, 571, 0, 0, '0', 0, 0, 0, 4058.096, 3808.438, 73.66172, 0.9468706, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+140, 25377, 571, 0, 0, '0', 0, 0, 0, 3995.671, 3863.357, 86.48828, 1.222019, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+141, 25377, 571, 0, 0, '0', 0, 0, 0, 3994.089, 3869.741, 86.92256, 4.403831, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+142, 25377, 571, 0, 0, '0', 0, 0, 0, 4060.221, 3813.648, 74.87791, 2.561906, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+143, 25377, 571, 0, 0, '0', 0, 0, 0, 4060.921, 3810.31, 74.20188, 0.7864025, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+(@CGUID+144, 25378, 571, 0, 0, '0', 0, 0, 0, 4084.625, 3781.453, 88.1413, 1.308997, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: -1)
+(@CGUID+145, 25391, 571, 0, 0, '0', 0, 0, 0, 4087.144, 3803.259, 88.88715, 6.178465, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25391 (Area: -1) (Auras: )
+(@CGUID+146, 25377, 571, 0, 0, '0', 0, 0, 0, 3995.967, 3869.417, 87.43391, 1.641255, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: -1)
+-- (@CGUID+148, 25378, 571, 0, 0, '0', 0, 0, 0, 4104.68, 3755.165, 92.74696, 5.305801, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: -1)
+-- (@CGUID+149, 25391, 571, 0, 0, '0', 0, 0, 0, 4052.662, 3672.709, 89.06155, 4.991642, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25391 (Area: -1) (Auras: )
+-- (@CGUID+150, 25383, 571, 0, 0, '0', 0, 0, 0, 3880.311, 3627.948, 46.88836, 2.70526, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25383 (Area: -1) (Auras: 45617 - 45617)
+(@CGUID+151, 15214, 571, 0, 0, '0', 0, 0, 0, 4111.582, 3735.073, 91.764, 3.473205, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 15214 (Area: -1)
+-- (@CGUID+152, 25391, 571, 0, 0, '0', 0, 0, 0, 4045.809, 3648.79, 88.94188, 3.298672, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25391 (Area: -1) (Auras: )
+-- (@CGUID+154, 26076, 571, 0, 0, '0', 0, 0, 0, 4111.339, 3735.037, 91.84813, 3.577925, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 26076 (Area: -1)
+(@CGUID+155, 25378, 571, 0, 0, '0', 0, 0, 0, 4073.151, 3662.264, 88.30914, 2.70526, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: -1)
+(@CGUID+156, 25393, 571, 0, 0, '0', 0, 0, 0, 4111.396, 3669.310, 88.182, 1.427202, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25393 (Area: -1)
+(@CGUID+157, 25378, 571, 0, 0, '0', 0, 0, 0, 4061.825, 3641.445, 88.11076, 2.635447, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: -1)
+(@CGUID+158, 25393, 571, 0, 0, '0', 0, 0, 0, 4022.36, 3621.078, 100.6157, 4.967927, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25393 (Area: -1)
+-- (@CGUID+159, 25378, 571, 0, 0, '0', 0, 0, 0, 4120.856, 3713.722, 92.74776, 1.762783, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: -1)
+(@CGUID+160, 25393, 571, 0, 0, '0', 0, 0, 0, 4145.623, 3676.927, 88.1825, 0.2252303, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25393 (Area: 4136)
+-- (@CGUID+161, 25378, 571, 0, 0, '0', 0, 0, 0, 4127.498, 3741.052, 92.75615, 3.787364, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: 4136)
+(@CGUID+162, 25472, 571, 0, 0, '0', 0, 0, 0, 4094.381, 3493.948, 152.6763, 0.7679449, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25472 (Area: 4136)
+(@CGUID+163, 25393, 571, 0, 0, '0', 0, 0, 0, 4126.54, 3615.563, 88.83325, 4.462672, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25393 (Area: 4136)
+(@CGUID+164, 25393, 571, 0, 0, '0', 0, 0, 0, 4112.138, 3573.525, 106.1573, 2.034444, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25393 (Area: 4125) (Auras: 33963 - 33963)
+(@CGUID+165, 25393, 571, 0, 0, '0', 0, 0, 0, 3825.306, 3621.834, 46.977, 3.186528, 300, 7, 0, 1, 0, 1, 0, 0, 0, 23420),
+(@CGUID+166, 25393, 571, 0, 0, '0', 0, 0, 0, 4007.476, 3587.082, 100.544, 3.186528, 300, 7, 0, 1, 0, 1, 0, 0, 0, 23420),
+(@CGUID+167, 25393, 571, 0, 0, '0', 0, 0, 0, 4049.438, 3575.568, 106.517, 3.186528, 300, 7, 0, 1, 0, 1, 0, 0, 0, 23420),
+(@CGUID+168, 25378, 571, 0, 0, '0', 0, 0, 0, 4067.834, 3528.134, 118.3771, 1.19083, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: -1)
+(@CGUID+169, 25378, 571, 0, 0, '0', 0, 0, 0, 4101.848, 3536.834, 109.293, 2.548181, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: -1)
+(@CGUID+170, 25378, 571, 0, 0, '0', 0, 0, 0, 4062.422, 3465.097, 109.2684, 2.635447, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: -1)
+(@CGUID+171, 25378, 571, 0, 0, '0', 0, 0, 0, 4116.766, 3464.181, 108.9272, 1.073311, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: 4135)
+(@CGUID+172, 25378, 571, 0, 0, '0', 0, 0, 0, 4099.074, 3478.396, 109.105, 5.759586, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: 4135)
+(@CGUID+173, 25378, 571, 0, 0, '0', 0, 0, 0, 4094.816, 3451.6, 128.4207, 2.684189, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: 4135) (possible waypoints or random movement)
+(@CGUID+174, 25378, 571, 0, 0, '0', 0, 0, 0, 4111.819, 3499.67, 109.1208, 5.864306, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: 4135)
+(@CGUID+175, 25378, 571, 0, 0, '0', 0, 0, 0, 3900.854, 3515.069, 46.74826, 4.921828, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25378 (Area: 4125)
+(@CGUID+176, 25393, 571, 0, 0, '0', 0, 0, 0, 4079.765, 3412.597, 107.1055, 5.053613, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25393 (Area: -1) (Auras: 33963 - 33963)
+(@CGUID+177, 25393, 571, 0, 0, '0', 0, 0, 0, 3946.659, 3484.503, 99.422, 0.6282206, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25393 (Area: -1) (Auras: 33963 - 33963)
+(@CGUID+178, 25393, 571, 0, 0, '0', 0, 0, 0, 3975.619, 3492.427, 99.16926, 2.584305, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25393 (Area: -1) (Auras: 33963 - 33963)
+(@CGUID+179, 25393, 571, 0, 0, '0', 0, 0, 0, 3972.511, 3518.948, 99.9718, 2.297545, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25393 (Area: 4125) (Auras: 33963 - 33963)
+(@CGUID+180, 25386, 571, 0, 0, '0', 0, 0, 0, 3860.269, 3521.542, 46.6651, 1.074683, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25393 (Area: 4125)
+(@CGUID+181, 25377, 571, 0, 0, '0', 0, 0, 0, 3911.907, 3478.756, 58.82272, 4.34155, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+182, 25377, 571, 0, 0, '0', 0, 0, 0, 3906.862, 3476.329, 57.79526, 3.9647, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+183, 25377, 571, 0, 0, '0', 0, 0, 0, 3895.673, 3488.134, 52.07495, 0.5125694, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+184, 25377, 571, 0, 0, '0', 0, 0, 0, 3934.134, 3506.953, 51.67665, 6.170922, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+185, 25377, 571, 0, 0, '0', 0, 0, 0, 3926.452, 3498.807, 52.40866, 3.861535, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+186, 25377, 571, 0, 0, '0', 0, 0, 0, 3910.824, 3485.944, 56.78598, 3.885894, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+187, 25377, 571, 0, 0, '0', 0, 0, 0, 3903.06, 3480.468, 56.38156, 2.333228, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+188, 25377, 571, 0, 0, '0', 0, 0, 0, 3928.13, 3507.663, 50.407, 3.513032, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+189, 25377, 571, 0, 0, '0', 0, 0, 0, 3920.079, 3496.129, 52.42612, 4.809077, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+190, 25377, 571, 0, 0, '0', 0, 0, 0, 3889.21, 3490.374, 51.28994, 1.190738, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+191, 25377, 571, 0, 0, '0', 0, 0, 0, 3919.065, 3487.513, 55.48593, 0.6557075, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+192, 25377, 571, 0, 0, '0', 0, 0, 0, 3922.625, 3502.891, 50.90102, 4.851348, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+193, 25377, 571, 0, 0, '0', 0, 0, 0, 3906.744, 3481.154, 57.70981, 1.442585, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+194, 25377, 571, 0, 0, '0', 0, 0, 0, 3928.391, 3503.573, 51.66494, 4.89102, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+195, 25377, 571, 0, 0, '0', 0, 0, 0, 3882.106, 3496.834, 49.87026, 1.449227, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+196, 25377, 571, 0, 0, '0', 0, 0, 0, 3888.425, 3495.322, 50.66372, 1.623445, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+197, 25377, 571, 0, 0, '0', 0, 0, 0, 3889.816, 3492.876, 51.08229, 2.999852, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+198, 25377, 571, 0, 0, '0', 0, 0, 0, 3886.697, 3494.933, 50.59719, 1.346169, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25377 (Area: 4125)
+(@CGUID+199, 15214, 571, 0, 0, '0', 0, 0, 0, 3907.229, 3491.578, 51.694, 3.174816, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 15214 (Area: 4125) (Auras: )
+(@CGUID+200, 25383, 571, 0, 0, '0', 0, 0, 0, 3969.229, 3475.197, 99.36195, 6.161329, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25383 (Area: -1) (Auras: 45617 - 45617)
+(@CGUID+201, 25390, 571, 0, 0, '0', 0, 0, 0, 3736.273, 3590.903, 47.99994, 0.8899633, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+202, 25390, 571, 0, 0, '0', 0, 0, 0, 3741.549, 3619.058, 51.74624, 5.868149, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+203, 25390, 571, 0, 0, '0', 0, 0, 0, 3733.602, 3597.179, 49.17873, 5.992009, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+204, 25390, 571, 0, 0, '0', 0, 0, 0, 3755.551, 3614.849, 47.53596, 1.73466, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+205, 25390, 571, 0, 0, '0', 0, 0, 0, 3737.5, 3595.834, 47.55792, 3.263225, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+206, 25390, 571, 0, 0, '0', 0, 0, 0, 3745.494, 3614.806, 51.02425, 3.739824, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+207, 25390, 571, 0, 0, '0', 0, 0, 0, 3731.61, 3608.116, 50.42838, 4.519621, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+208, 25390, 571, 0, 0, '0', 0, 0, 0, 3746.177, 3610.937, 49.4919, 0.9030718, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+209, 25390, 571, 0, 0, '0', 0, 0, 0, 3740.296, 3606.416, 47.89117, 0.3061525, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+210, 25390, 571, 0, 0, '0', 0, 0, 0, 3739.774, 3586.381, 47.40804, 3.840582, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+211, 25390, 571, 0, 0, '0', 0, 0, 0, 3732.172, 3492.803, 66.06441, 4.919724, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+212, 25390, 571, 0, 0, '0', 0, 0, 0, 3722.42, 3474.34, 67.72371, 3.546465, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+213, 25390, 571, 0, 0, '0', 0, 0, 0, 3737.281, 3457.207, 68.44443, 6.275373, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+214, 25390, 571, 0, 0, '0', 0, 0, 0, 3735.691, 3481.298, 66.37328, 0.4247686, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+215, 25390, 571, 0, 0, '0', 0, 0, 0, 3762.339, 3460.782, 66.84665, 1.272987, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+216, 25390, 571, 0, 0, '0', 0, 0, 0, 3727.58, 3472.093, 67.7375, 6.149167, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+217, 25390, 571, 0, 0, '0', 0, 0, 0, 3729.184, 3463.325, 67.98989, 4.915916, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+218, 25390, 571, 0, 0, '0', 0, 0, 0, 3755.908, 3451.033, 68.73743, 1.29019, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+219, 25390, 571, 0, 0, '0', 0, 0, 0, 3752.901, 3443.411, 69.78725, 2.859401, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+220, 25390, 571, 0, 0, '0', 0, 0, 0, 3750.83, 3453.531, 68.79379, 3.341931, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: -1) (Auras: )
+(@CGUID+221, 25390, 571, 0, 0, '0', 0, 0, 0, 3929.295, 3386.144, 81.46214, 2.466242, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4137) (Auras: )
+(@CGUID+222, 25390, 571, 0, 0, '0', 0, 0, 0, 3932.021, 3374.059, 87.41148, 4.779801, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4137) (Auras: )
+(@CGUID+223, 25390, 571, 0, 0, '0', 0, 0, 0, 3944.585, 3379.264, 85.34169, 2.193203, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4137) (Auras: )
+(@CGUID+224, 25390, 571, 0, 0, '0', 0, 0, 0, 3945.311, 3386.357, 83.06496, 4.791557, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4137) (Auras: )
+(@CGUID+225, 25390, 571, 0, 0, '0', 0, 0, 0, 3936.851, 3379.988, 84.34169, 1.985053, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4137) (Auras: )
+(@CGUID+226, 25390, 571, 0, 0, '0', 0, 0, 0, 3956.039, 3386.022, 85.27751, 2.646924, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+227, 25390, 571, 0, 0, '0', 0, 0, 0, 3959.361, 3380.454, 88.27145, 3.735828, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+228, 25390, 571, 0, 0, '0', 0, 0, 0, 3995.549, 3396.604, 84.01167, 0.8137251, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+229, 25390, 571, 0, 0, '0', 0, 0, 0, 3990.87, 3410.72, 81.53675, 1.899959, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+230, 25390, 571, 0, 0, '0', 0, 0, 0, 4013.035, 3418.461, 87.39, 2.682534, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+231, 25390, 571, 0, 0, '0', 0, 0, 0, 4001.696, 3381.575, 94.27975, 0.1066663, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+232, 25390, 571, 0, 0, '0', 0, 0, 0, 4024.305, 3401.739, 88.4791, 4.252826, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+233, 25390, 571, 0, 0, '0', 0, 0, 0, 3975.886, 3386.318, 85.93647, 4.24115, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+234, 25390, 571, 0, 0, '0', 0, 0, 0, 4007.21, 3378.432, 96.99988, 5.743998, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+235, 25390, 571, 0, 0, '0', 0, 0, 0, 4026.654, 3411.017, 91.08331, 5.944759, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+236, 25390, 571, 0, 0, '0', 0, 0, 0, 4012.055, 3402.248, 88.56646, 5.85402, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+237, 25390, 571, 0, 0, '0', 0, 0, 0, 4005.33, 3387.403, 91.97034, 5.87855, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+238, 25390, 571, 0, 0, '0', 0, 0, 0, 4005.748, 3425.867, 87.4854, 1.783322, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+239, 25390, 571, 0, 0, '0', 0, 0, 0, 4007.662, 3406.613, 88.17662, 4.847075, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+240, 25390, 571, 0, 0, '0', 0, 0, 0, 4042.685, 3403.342, 93.21573, 1.982871, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+241, 25396, 571, 0, 0, '0', 0, 0, 0, 4042.685, 3403.342, 93.21573, 1.982871, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+242, 25396, 571, 0, 0, '0', 0, 0, 0, 3762.961, 3542.919, 294.694, 2.338741, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+243, 25396, 571, 0, 0, '0', 0, 0, 0, 3753.642, 3536.274, 294.782, 1.797689, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+244, 26103, 571, 0, 0, '0', 0, 0, 0, 3769.170, 3521.482, 347.866, 2.2045, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+245, 26103, 571, 0, 0, '0', 0, 0, 0, 3722.833, 3486.375, 347.87, 1.36023, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+246, 26103, 571, 0, 0, '0', 0, 0, 0, 3709.010, 3613.184, 347.866, 5.259722, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+247, 26094, 571, 0, 0, '0', 0, 0, 0, 3743.336, 3547.376, 353.033, 5.259722, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+248, 26094, 571, 0, 0, '0', 0, 0, 0, 3756.085, 3555.942, 352.890, 5.259722, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420), -- 25390 (Area: 4125) (Auras: )
+(@CGUID+249, 26094, 571, 0, 0, '0', 0, 0, 0, 3728.194, 3550.65, 353.00, 5.259722, 120, 0, 0, 0, 0, 0, 0, 0, 0, 23420); -- 25390 (Area: 4125) (Auras: )
+
+UPDATE `creature` SET `spawntimesecs` = 300 , `spawndist` = 3 , `MovementType` = 1 WHERE `id` IN (25377, 25390);
+UPDATE `creature` SET `spawntimesecs` = 300 , `spawndist` = 0 , `MovementType` = 0 WHERE `id` IN (26093, 26094, 25378, 25383);
+UPDATE `creature` SET `spawntimesecs` = 300 , `spawndist` = 7 , `MovementType` = 1 WHERE `id` = 25393;
+UPDATE `creature` SET `spawntimesecs` = 300 WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+249;
+UPDATE `creature` SET `spawndist` = 0 , `MovementType` = 0 WHERE `guid` IN (118319, 100032, 100034, 85215, 85121, 100059, 85206, 109630, 107628);
+UPDATE `creature` SET `position_x`=3876.965,`position_y`=3675.559,`position_z`=46.845 WHERE `guid` =100571;
+UPDATE `creature` SET `position_x`=3941.666,`position_y`=3574.805,`position_z`=69.950 WHERE `guid` =100505;
+UPDATE `creature` SET `position_x`=3965.341,`position_y`=3603.879,`position_z`=72.720 WHERE `guid` =100503;
+UPDATE `creature` SET `position_x`=3924.658,`position_y`=3624.454,`position_z`=70.797 WHERE `guid` =100559;
+UPDATE `creature` SET `position_x`=3825.789,`position_y`=3742.629,`position_z`=51.733 WHERE `guid` =98971;
+UPDATE `creature` SET `position_x`=3814.749,`position_y`=3731.839,`position_z`=53.006 WHERE `guid` =98953;
diff --git a/sql/updates/world/master/2020_04_29_00_world_2017_04_10_00_world.sql b/sql/updates/world/master/2020_04_29_00_world_2017_04_10_00_world.sql
new file mode 100644
index 00000000000..6ff2ec587c1
--- /dev/null
+++ b/sql/updates/world/master/2020_04_29_00_world_2017_04_10_00_world.sql
@@ -0,0 +1,83 @@
+SET @CGUID:=106933;
+SET @OGUID:=9838;
+
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+20;
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES
+(@CGUID+0, 19850, 450, 0, 0, '0', 0, 0, 0, 242.672, 88.56271, 24.85976, 4.468043, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 19850 (Area: 2917)
+(@CGUID+1, 12788, 450, 0, 0, '0', 0, 0, 0, 239.8767, 85.61234, 24.85976, 6.126106, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12788 (Area: 2917)
+(@CGUID+2, 12789, 450, 0, 0, '0', 0, 0, 0, 246.2953, 86.5842, 24.85976, 3.717551, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12789 (Area: 2917)
+(@CGUID+3, 12790, 450, 0, 0, '0', 0, 0, 0, 239.8862, 84.12804, 24.85485, 1.117011, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12790 (Area: 2917)
+(@CGUID+4, 12791, 450, 0, 0, '0', 0, 0, 0, 246.83, 82.42137, 24.84535, 2.565634, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12791 (Area: 2917)
+(@CGUID+5, 12793, 450, 0, 0, '0', 0, 0, 0, 256.4854, 99.39707, 25.8042, 3.961897, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12793 (Area: 2917)
+(@CGUID+6, 12794, 450, 0, 0, '0', 0, 0, 0, 240.6157, 103.3161, 25.80486, 4.852015, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12794 (Area: 2917)
+(@CGUID+7, 12795, 450, 0, 0, '0', 0, 0, 0, 256.5978, 70.66988, 25.80373, 2.321288, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12795 (Area: 2917)
+(@CGUID+8, 12796, 450, 0, 0, '0', 0, 0, 0, 258.9629, 73.2198, 25.80449, 2.495821, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12796 (Area: 2917)
+(@CGUID+9, 12797, 450, 0, 0, '0', 0, 0, 0, 230.8099, 86.72803, 25.80155, 6.126106, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12797 (Area: 2917)
+(@CGUID+10, 12798, 450, 0, 0, '0', 0, 0, 0, 238.2137, 73.37591, 25.79806, 1.186824, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12798 (Area: 2917)
+(@CGUID+11, 12784, 449, 0, 0, '0', 0, 0, 0, 7.163939, 4.268201, -0.1725506, 0.08726646, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12784 (Area: 2918)
+(@CGUID+12, 12785, 449, 0, 0, '0', 0, 0, 0, -9.118941, -4.266961, 5.570964, 0.1396263, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12785 (Area: 2918)
+(@CGUID+13, 12786, 449, 0, 0, '0', 0, 0, 0, -2.744659, 3.605767, -0.1725506, 0.05235988, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12786 (Area: 2918) (Auras: 5301 - 5301)
+(@CGUID+14, 12787, 449, 0, 0, '0', 0, 0, 0, 2.045413, 3.637273, -0.1725517, 3.106686, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12787 (Area: 2918) (Auras: 5301 - 5301)
+(@CGUID+15, 12778, 449, 0, 0, '0', 0, 0, 0, -2.794709, 29.68436, 1.181421, 6.056293, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12778 (Area: 2918) (Auras: 5301 - 5301)
+(@CGUID+16, 12779, 449, 0, 0, '0', 0, 0, 0, -0.993629, 31.69748, 1.181421, 5.044002, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12779 (Area: 2918)
+(@CGUID+17, 12780, 449, 0, 0, '0', 0, 0, 0, 2.650486, 29.71008, 1.181421, 3.438299, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12780 (Area: 2918) (Auras: 134735 - 134735)
+(@CGUID+18, 12781, 449, 0, 0, '0', 0, 0, 0, -3.685594, 15.15136, -0.1725487, 5.497787, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12781 (Area: 2918)
+(@CGUID+19, 12783, 449, 0, 0, '0', 0, 0, 0, 6.308641, 34.95754, 1.139165, 4.852015, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706), -- 12783 (Area: 2918)
+(@CGUID+20, 19848, 449, 0, 0, '0', 0, 0, 0, 1.562388, 32.09954, 1.181421, 4.206244, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 23706); -- 19848 (Area: 2918) (Auras: 5301 - 5301)
+
+
+DELETE FROM `creature_addon` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+20;
+INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(@CGUID+0, 0, 0, 0, 257, 0, ''), -- 19850
+(@CGUID+1, 0, 0, 0, 256, 0, ''), -- 12788
+(@CGUID+2, 0, 0, 0, 256, 0, ''), -- 12789
+(@CGUID+3, 0, 0, 0, 257, 0, ''), -- 12790
+(@CGUID+4, 0, 0, 0, 258, 0, ''), -- 12791
+(@CGUID+5, 0, 0, 0, 0, 0, ''), -- 12793
+(@CGUID+6, 0, 0, 0, 0, 0, ''), -- 12794
+(@CGUID+7, 0, 0, 0, 0, 0, ''), -- 12795
+(@CGUID+8, 0, 14334, 0, 0, 0, ''), -- 12796
+(@CGUID+9, 0, 0, 0, 257, 0, ''), -- 12797
+(@CGUID+10, 0, 0, 0, 257, 0, ''), -- 12798
+(@CGUID+11, 0, 0, 0, 1, 0, ''), -- 12784
+(@CGUID+12, 0, 0, 0, 0, 0, ''), -- 12785
+(@CGUID+13, 0, 0, 0, 257, 0, '5301'), -- 12786 - 5301 - 5301
+(@CGUID+14, 0, 0, 0, 257, 0, '5301'), -- 12787 - 5301 - 5301
+(@CGUID+15, 0, 0, 0, 256, 0, '5301'), -- 12778 - 5301 - 5301
+(@CGUID+16, 0, 0, 0, 256, 0, ''), -- 12779
+(@CGUID+17, 0, 0, 0, 258, 0, '134735'), -- 12780 - 134735 - 134735
+(@CGUID+18, 0, 0, 0, 1, 0, ''), -- 12781
+(@CGUID+19, 0, 14337, 0, 0, 0, ''), -- 12783
+(@CGUID+20, 0, 0, 0, 256, 0, '5301'); -- 19848 - 5301 - 5301
+
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+28;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `ScriptName`, `VerifiedBuild`) VALUES
+(@OGUID+0, 176564, 450, 0, 0, '0', 0, 93.97388, -102.6958, -14.8986, 3.141593, 0, 0, -1, 0, 7200, 255, 1, '', 23706), -- 176564 (Area: 2917)
+(@OGUID+1, 176565, 450, 0, 0, '0', 0, 104.1366, -94.58491, -14.8986, 3.141593, 0, 0, -1, 0, 7200, 255, 1, '', 23706), -- 176565 (Area: 2917)
+(@OGUID+2, 176567, 450, 0, 0, '0', 0, 251.4892, 94.47144, 25.82602, 0.9686573, 0, 0, 0.4656143, 0.8849878, 7200, 255, 1, '', 23706), -- 176567 (Area: 2917)
+(@OGUID+3, 176568, 450, 0, 0, '0', 0, 255.7042, 85.47333, 25.82601, 5.715955, 0, 0, -0.2798281, 0.9600501, 7200, 255, 1, '', 23706), -- 176568 (Area: 2917)
+(@OGUID+4, 176569, 450, 0, 0, '0', 0, 252.4974, 76.7461, 25.82602, 5.000368, 0, 0, -0.5983248, 0.8012537, 7200, 255, 1, '', 23706), -- 176569 (Area: 2917)
+(@OGUID+5, 176570, 450, 0, 0, '0', 0, 242.5849, 97.20764, 25.82602, 1.195549, 0, 0, 0.5628042, 0.8265902, 7200, 255, 1, '', 23706), -- 176570 (Area: 2917)
+(@OGUID+6, 176571, 450, 0, 0, '0', 0, 230.5504, 83.68984, 25.79818, 1.195549, 0, 0, 0.5628042, 0.8265902, 7200, 255, 1, '', 23706), -- 176571 (Area: 2917)
+(@OGUID+7, 176572, 450, 0, 0, '0', 0, 235.8291, 74.55625, 25.79817, 2.932139, 0, 0, 0.9945211, 0.1045355, 7200, 255, 1, '', 23706), -- 176572 (Area: 2917)
+(@OGUID+8, 179707, 450, 0, 0, '0', 0, 242.9785, 87.13777, 25.80421, 4.904376, 0, 0, -0.6360779, 0.7716249, 7200, 255, 1, '', 23706), -- 179707 (Area: 2917)
+(@OGUID+9, 176575, 449, 0, 0, '0', 0, -2.51994, -2.907281, 0, 4.71239, 0, 0, -0.7071066, 0.7071069, 7200, 255, 0, '', 23706), -- 176575 (Area: 2918)
+(@OGUID+10, 176384, 449, 0, 0, '0', 0, -9.025304, 28.0725, 1.060977, 0, 0, 0, 0, 1, 7200, 255, 1, '', 23706), -- 176384 (Area: 2918)
+(@OGUID+11, 176385, 449, 0, 0, '0', 0, -9.025304, 30.1114, 1.060977, 0, 0, 0, 0, 1, 7200, 255, 1, '', 23706), -- 176385 (Area: 2918)
+(@OGUID+12, 176386, 449, 0, 0, '0', 0, 7.123021, 12.036, -0.244337, 6.265733, 0, 0, -0.00872612, 0.9999619, 7200, 255, 1, '', 23706), -- 176386 (Area: 2918)
+(@OGUID+13, 176387, 449, 0, 0, '0', 0, 6.827271, 6.826454, -0.244337, 0.1919852, 0, 0, 0.09584522, 0.9953963, 7200, 255, 1, '', 23706), -- 176387 (Area: 2918)
+(@OGUID+14, 176388, 449, 0, 0, '0', 0, -4.759789, 14.60685, -0.244337, 1.762782, 0, 0, 0.7716246, 0.6360782, 7200, 255, 1, '', 23706), -- 176388 (Area: 2918)
+(@OGUID+15, 179706, 449, 0, 0, '0', 0, 0.097743, 29.08226, 2.431421, 4.642576, 0, 0, -0.7313538, 0.6819983, 7200, 255, 1, '', 23706), -- 179706 (Area: 2918)
+(@OGUID+16, 176371, 449, 0, 0, '0', 0, 0.9554105, -5.705855, 5.482604, 1.570796, 0, 0, 0.7071066, 0.7071069, 7200, 255, 1, '', 23706), -- 176371 (Area: 2918)
+(@OGUID+17, 176372, 449, 0, 0, '0', 0, -0.9882749, -1.428213, 5.482604, 4.71239, 0, 0, -0.7071066, 0.7071069, 7200, 255, 1, '', 23706), -- 176372 (Area: 2918)
+(@OGUID+18, 176373, 449, 0, 0, '0', 0, 3.012539, -3.597334, 5.482604, 3.089183, 0, 0, 0.9996567, 0.02620165, 7200, 255, 1, '', 23706), -- 176373 (Area: 2918)
+(@OGUID+19, 176374, 449, 0, 0, '0', 0, -2.825732, -3.589562, 5.482604, 6.248281, 0, 0, -0.01745129, 0.9998477, 7200, 255, 1, '', 23706), -- 176374 (Area: 2918)
+(@OGUID+20, 176375, 449, 0, 0, '0', 0, -1.028992, -5.617584, 5.482604, 1.570796, 0, 0, 0.7071066, 0.7071069, 7200, 255, 1, '', 23706), -- 176375 (Area: 2918)
+(@OGUID+21, 176376, 449, 0, 0, '0', 0, 0.8865891, -1.410038, 5.482604, 4.71239, 0, 0, -0.7071066, 0.7071069, 7200, 255, 1, '', 23706), -- 176376 (Area: 2918)
+(@OGUID+22, 176377, 449, 0, 0, '0', 0, 1.447738, 36.5178, 1.060977, 4.71239, 0, 0, -0.7071066, 0.7071069, 7200, 255, 1, '', 23706), -- 176377 (Area: 2918)
+(@OGUID+23, 176378, 449, 0, 0, '0', 0, -2.752622, 36.49962, 1.060977, 4.71239, 0, 0, -0.7071066, 0.7071069, 7200, 255, 1, '', 23706), -- 176378 (Area: 2918)
+(@OGUID+24, 176379, 449, 0, 0, '0', 0, -0.5911672, 36.5178, 1.060977, 4.71239, 0, 0, -0.7071066, 0.7071069, 7200, 255, 1, '', 23706), -- 176379 (Area: 2918)
+(@OGUID+25, 176380, 449, 0, 0, '0', 0, 8.186553, 30.15226, 1.060977, 3.141593, 0, 0, -1, 0, 7200, 255, 1, '', 23706), -- 176380 (Area: 2918)
+(@OGUID+26, 176381, 449, 0, 0, '0', 0, 8.204728, 27.9908, 1.060977, 3.141593, 0, 0, -1, 0, 7200, 255, 1, '', 23706), -- 176381 (Area: 2918)
+(@OGUID+27, 176382, 449, 0, 0, '0', 0, 8.204729, 25.95189, 1.060977, 3.141593, 0, 0, -1, 0, 7200, 255, 1, '', 23706), -- 176382 (Area: 2918)
+(@OGUID+28, 176383, 449, 0, 0, '0', 0, -9.007128, 25.91104, 1.060977, 0, 0, 0, 0, 1, 7200, 255, 1, '', 23706); -- 176383 (Area: 2918)
diff --git a/src/common/Collision/Maps/TileAssembler.cpp b/src/common/Collision/Maps/TileAssembler.cpp
index 1ef09e55391..0a50ef21e40 100644
--- a/src/common/Collision/Maps/TileAssembler.cpp
+++ b/src/common/Collision/Maps/TileAssembler.cpp
@@ -202,13 +202,12 @@ namespace VMAP
return false;
}
printf("Read coordinate mapping...\n");
- uint32 mapID, check=0;
+ uint32 mapID, check;
std::map<uint32, MapSpawns> data;
while (!feof(dirf))
{
- check = 0;
// read mapID, Flags, NameSet, UniqueId, Pos, Rot, Scale, Bound_lo, Bound_hi, name
- check += fread(&mapID, sizeof(uint32), 1, dirf);
+ check = fread(&mapID, sizeof(uint32), 1, dirf);
if (check == 0) // EoF...
break;
diff --git a/src/server/database/Database/Implementation/CharacterDatabase.cpp b/src/server/database/Database/Implementation/CharacterDatabase.cpp
index 13f25a9d4bd..24ae14580f9 100644
--- a/src/server/database/Database/Implementation/CharacterDatabase.cpp
+++ b/src/server/database/Database/Implementation/CharacterDatabase.cpp
@@ -429,7 +429,6 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_REP_CREATURE_RESPAWN, "REPLACE INTO creature_respawn (guid, respawnTime, mapId, instanceId) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC);
PrepareStatement(CHAR_DEL_CREATURE_RESPAWN, "DELETE FROM creature_respawn WHERE guid = ? AND mapId = ? AND instanceId = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE, "DELETE FROM creature_respawn WHERE mapId = ? AND instanceId = ?", CONNECTION_ASYNC);
- PrepareStatement(CHAR_SEL_MAX_CREATURE_RESPAWNS, "SELECT MAX(respawnTime), instanceId FROM creature_respawn WHERE instanceId > 0 GROUP BY instanceId", CONNECTION_SYNCH);
// Gameobject respawn
PrepareStatement(CHAR_SEL_GO_RESPAWNS, "SELECT guid, respawnTime FROM gameobject_respawn WHERE mapId = ? AND instanceId = ?", CONNECTION_SYNCH);
@@ -511,7 +510,9 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_DEL_GROUP_INSTANCE_BY_GUID, "DELETE FROM group_instance WHERE guid = ? AND instance = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_REP_GROUP_INSTANCE, "REPLACE INTO group_instance (guid, instance, permanent) VALUES (?, ?, ?)", CONNECTION_ASYNC);
PrepareStatement(CHAR_UPD_INSTANCE_RESETTIME, "UPDATE instance SET resettime = ? WHERE id = ?", CONNECTION_ASYNC);
- PrepareStatement(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME, "UPDATE instance_reset SET resettime = ? WHERE mapid = ? AND difficulty = ?", CONNECTION_ASYNC);
+ PrepareStatement(CHAR_INS_GLOBAL_INSTANCE_RESETTIME, "INSERT INTO instance_reset (mapid, difficulty, resettime) VALUES (?, ?, ?)", CONNECTION_SYNCH);
+ PrepareStatement(CHAR_DEL_GLOBAL_INSTANCE_RESETTIME, "DELETE FROM instance_reset WHERE mapid = ? AND difficulty = ?", CONNECTION_SYNCH);
+ PrepareStatement(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME, "UPDATE instance_reset SET resettime = ? WHERE mapid = ? AND difficulty = ?", CONNECTION_BOTH);
PrepareStatement(CHAR_UPD_CHAR_ONLINE, "UPDATE characters SET online = 1 WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_UPD_CHAR_NAME_AT_LOGIN, "UPDATE characters SET name = ?, at_login = ? WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_UPD_WORLDSTATE, "UPDATE worldstates SET value = ? WHERE entry = ?", CONNECTION_ASYNC);
@@ -689,11 +690,11 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_DEL_GUILD_FINDER_GUILD_SETTINGS, "DELETE FROM guild_finder_guild_settings WHERE guildId = ?", CONNECTION_ASYNC);
// Items that hold loot or money
- PrepareStatement(CHAR_SEL_ITEMCONTAINER_ITEMS, "SELECT item_id, item_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_bonus, context, bonus_list_ids FROM item_loot_items WHERE container_id = ?", CONNECTION_SYNCH);
+ PrepareStatement(CHAR_SEL_ITEMCONTAINER_ITEMS, "SELECT container_id, item_id, item_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_bonus, context, bonus_list_ids FROM item_loot_items", CONNECTION_SYNCH);
PrepareStatement(CHAR_DEL_ITEMCONTAINER_ITEMS, "DELETE FROM item_loot_items WHERE container_id = ?", CONNECTION_ASYNC);
- PrepareStatement(CHAR_DEL_ITEMCONTAINER_ITEM, "DELETE FROM item_loot_items WHERE container_id = ? AND item_id = ?", CONNECTION_ASYNC);
+ PrepareStatement(CHAR_DEL_ITEMCONTAINER_ITEM, "DELETE FROM item_loot_items WHERE container_id = ? AND item_id = ? AND item_count = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_INS_ITEMCONTAINER_ITEMS, "INSERT INTO item_loot_items (container_id, item_id, item_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_bonus, context, bonus_list_ids) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
- PrepareStatement(CHAR_SEL_ITEMCONTAINER_MONEY, "SELECT money FROM item_loot_money WHERE container_id = ?", CONNECTION_SYNCH);
+ PrepareStatement(CHAR_SEL_ITEMCONTAINER_MONEY, "SELECT container_id, money FROM item_loot_money", CONNECTION_SYNCH);
PrepareStatement(CHAR_DEL_ITEMCONTAINER_MONEY, "DELETE FROM item_loot_money WHERE container_id = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_INS_ITEMCONTAINER_MONEY, "INSERT INTO item_loot_money (container_id, money) VALUES (?, ?)", CONNECTION_ASYNC);
diff --git a/src/server/database/Database/Implementation/CharacterDatabase.h b/src/server/database/Database/Implementation/CharacterDatabase.h
index 8e1f12416b0..8dc1d522e47 100644
--- a/src/server/database/Database/Implementation/CharacterDatabase.h
+++ b/src/server/database/Database/Implementation/CharacterDatabase.h
@@ -340,7 +340,6 @@ enum CharacterDatabaseStatements : uint32
CHAR_REP_CREATURE_RESPAWN,
CHAR_DEL_CREATURE_RESPAWN,
CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE,
- CHAR_SEL_MAX_CREATURE_RESPAWNS,
CHAR_SEL_GO_RESPAWNS,
CHAR_REP_GO_RESPAWN,
@@ -400,6 +399,8 @@ enum CharacterDatabaseStatements : uint32
CHAR_DEL_GROUP_INSTANCE_BY_GUID,
CHAR_REP_GROUP_INSTANCE,
CHAR_UPD_INSTANCE_RESETTIME,
+ CHAR_INS_GLOBAL_INSTANCE_RESETTIME,
+ CHAR_DEL_GLOBAL_INSTANCE_RESETTIME,
CHAR_UPD_GLOBAL_INSTANCE_RESETTIME,
CHAR_UPD_CHAR_ONLINE,
CHAR_UPD_CHAR_NAME_AT_LOGIN,
diff --git a/src/server/game/AI/CoreAI/TotemAI.cpp b/src/server/game/AI/CoreAI/TotemAI.cpp
index 70ed58d853d..a2f0f8f664b 100644
--- a/src/server/game/AI/CoreAI/TotemAI.cpp
+++ b/src/server/game/AI/CoreAI/TotemAI.cpp
@@ -83,8 +83,7 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
i_victimGuid = victim->GetGUID();
// attack
- me->SetInFront(victim); // client change orientation by self
- me->CastSpell(victim, me->ToTotem()->GetSpell(), false);
+ me->CastSpell(victim, me->ToTotem()->GetSpell());
}
else
i_victimGuid.Clear();
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp
index 21d15731b11..124361f0c07 100644
--- a/src/server/game/AI/CoreAI/UnitAI.cpp
+++ b/src/server/game/AI/CoreAI/UnitAI.cpp
@@ -65,14 +65,20 @@ void UnitAI::DoMeleeAttackIfReady()
//Make sure our attack is ready and we aren't currently casting before checking distance
if (me->isAttackReady())
{
- me->AttackerStateUpdate(victim);
+ if (ShouldSparWith(victim))
+ me->FakeAttackerStateUpdate(victim);
+ else
+ me->AttackerStateUpdate(victim);
me->resetAttackTimer();
}
if (me->haveOffhandWeapon() && me->isAttackReady(OFF_ATTACK))
{
- me->AttackerStateUpdate(victim, OFF_ATTACK);
+ if (ShouldSparWith(victim))
+ me->FakeAttackerStateUpdate(victim, OFF_ATTACK);
+ else
+ me->AttackerStateUpdate(victim, OFF_ATTACK);
me->resetAttackTimer(OFF_ATTACK);
}
diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h
index 0145233e3c9..73dc7afc2ec 100644
--- a/src/server/game/AI/CoreAI/UnitAI.h
+++ b/src/server/game/AI/CoreAI/UnitAI.h
@@ -265,6 +265,8 @@ class TC_GAME_API UnitAI
void DoCastVictim(uint32 spellId, bool triggered = false);
void DoCastAOE(uint32 spellId, bool triggered = false);
+ virtual bool ShouldSparWith(Unit const* /*target*/) const { return false; }
+
void DoMeleeAttackIfReady();
bool DoSpellAttackIfReady(uint32 spellId);
@@ -277,7 +279,6 @@ class TC_GAME_API UnitAI
virtual void sQuestAccept(Player* /*player*/, Quest const* /*quest*/) { }
virtual void sQuestSelect(Player* /*player*/, Quest const* /*quest*/) { }
virtual void sQuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) { }
- virtual bool sOnDummyEffect(Unit* /*caster*/, uint32 /*spellId*/, SpellEffIndex /*effIndex*/) { return false; }
virtual void sOnGameEvent(bool /*start*/, uint16 /*eventId*/) { }
private:
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index b9d052cb528..3c65160aaf6 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -44,7 +44,7 @@ void CreatureAI::OnCharmed(bool apply)
AISpellInfoType* UnitAI::AISpellInfo;
AISpellInfoType* GetAISpellInfo(uint32 i) { return &UnitAI::AISpellInfo[i]; }
-CreatureAI::CreatureAI(Creature* creature) : UnitAI(creature), me(creature), _boundary(nullptr), m_MoveInLineOfSight_locked(false)
+CreatureAI::CreatureAI(Creature* creature) : UnitAI(creature), me(creature), _boundary(nullptr), _negateBoundary(false), m_MoveInLineOfSight_locked(false)
{
}
@@ -173,9 +173,9 @@ void CreatureAI::TriggerAlert(Unit const* who) const
me->SendAIReaction(AI_REACTION_ALERT);
// Face the unit (stealthed player) and set distracted state for 5 seconds
- me->SetFacingTo(me->GetAngle(who->GetPositionX(), who->GetPositionY()), true);
- me->StopMoving();
me->GetMotionMaster()->MoveDistract(5 * IN_MILLISECONDS);
+ me->StopMoving();
+ me->SetFacingTo(me->GetAngle(who));
}
void CreatureAI::EnterEvadeMode(EvadeReason why)
@@ -217,7 +217,7 @@ void CreatureAI::SetGazeOn(Unit* target)
{
if (me->IsValidAttackTarget(target))
{
- if (!me->IsFocusing(nullptr, true))
+ if (!me->IsFocusing(nullptr, true) && target != me->GetVictim())
AttackStart(target);
me->SetReactState(REACT_PASSIVE);
}
@@ -237,7 +237,7 @@ bool CreatureAI::UpdateVictimWithGaze()
}
if (Unit* victim = me->SelectVictim())
- if (!me->IsFocusing(nullptr, true))
+ if (!me->IsFocusing(nullptr, true) && victim != me->GetVictim())
AttackStart(victim);
return me->GetVictim() != nullptr;
@@ -251,7 +251,7 @@ bool CreatureAI::UpdateVictim()
if (!me->HasReactState(REACT_PASSIVE))
{
if (Unit* victim = me->SelectVictim())
- if (!me->IsFocusing(nullptr, true))
+ if (!me->IsFocusing(nullptr, true) && victim != me->GetVictim())
AttackStart(victim);
return me->GetVictim() != nullptr;
@@ -364,32 +364,28 @@ int32 CreatureAI::VisualizeBoundary(uint32 duration, Unit* owner, bool fill) con
bool CreatureAI::CheckBoundary(Position const* who) const
{
+ if (!_boundary)
+ return true;
+
if (!who)
who = me;
- if (_boundary)
- for (AreaBoundary const* areaBoundary : *_boundary)
- if (!areaBoundary->IsWithinBoundary(who))
- return false;
-
- return true;
+ return (CreatureAI::IsInBounds(*_boundary, who) != _negateBoundary);
}
-bool CreatureAI::IsInBounds(CreatureBoundary const* boundary, Position const* pos)
+bool CreatureAI::IsInBounds(CreatureBoundary const& boundary, Position const* pos)
{
- if (!boundary)
- return true;
-
- for (AreaBoundary const* areaBoundary : *boundary)
+ for (AreaBoundary const* areaBoundary : boundary)
if (!areaBoundary->IsWithinBoundary(pos))
return false;
return true;
}
-void CreatureAI::SetBoundary(CreatureBoundary const* boundary)
+void CreatureAI::SetBoundary(CreatureBoundary const* boundary, bool negateBoundaries /*= false*/)
{
_boundary = boundary;
+ _negateBoundary = negateBoundaries;
me->DoImmediateBoundaryCheck();
}
diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h
index 5fe93e7675a..edc09a650c7 100644
--- a/src/server/game/AI/CreatureAI.h
+++ b/src/server/game/AI/CreatureAI.h
@@ -83,7 +83,6 @@ class TC_GAME_API CreatureAI : public UnitAI
bool CheckBoundary(Position const* who = nullptr) const;
- void SetBoundary(CreatureBoundary const* boundary);
public:
enum EvadeReason
{
@@ -211,11 +210,12 @@ class TC_GAME_API CreatureAI : public UnitAI
virtual PlayerAI* GetAIForCharmedPlayer(Player* /*who*/) { return nullptr; }
// intended for encounter design/debugging. do not use for other purposes. expensive.
- int32 VisualizeBoundary(uint32 duration, Unit* owner=nullptr, bool fill=false) const;
+ int32 VisualizeBoundary(uint32 duration, Unit* owner = nullptr, bool fill = false) const;
virtual bool CheckInRoom();
CreatureBoundary const* GetBoundary() const { return _boundary; }
+ void SetBoundary(CreatureBoundary const* boundary, bool negativeBoundaries = false);
- static bool IsInBounds(CreatureBoundary const* boundary, Position const* who);
+ static bool IsInBounds(CreatureBoundary const& boundary, Position const* who);
protected:
virtual void MoveInLineOfSight(Unit* /*who*/);
@@ -223,6 +223,7 @@ class TC_GAME_API CreatureAI : public UnitAI
bool _EnterEvadeMode(EvadeReason why = EVADE_REASON_OTHER);
CreatureBoundary const* _boundary;
+ bool _negateBoundary;
private:
bool m_MoveInLineOfSight_locked;
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index 20a1c895dae..46e4159bb4c 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -176,7 +176,7 @@ void npc_escortAI::JustRespawned()
//add a small delay before going to first waypoint, normal in near all cases
m_uiWPWaitTimer = 2500;
- if (me->getFaction() != me->GetCreatureTemplate()->faction)
+ if (me->GetFaction() != me->GetCreatureTemplate()->faction)
me->RestoreFaction();
Reset();
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index 961700d43b1..6c38e34df97 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -166,8 +166,8 @@ void FollowerAI::JustRespawned()
if (!IsCombatMovementAllowed())
SetCombatMovement(true);
- if (me->getFaction() != me->GetCreatureTemplate()->faction)
- me->setFaction(me->GetCreatureTemplate()->faction);
+ if (me->GetFaction() != me->GetCreatureTemplate()->faction)
+ me->SetFaction(me->GetCreatureTemplate()->faction);
Reset();
}
@@ -303,7 +303,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu
m_uiLeaderGUID = player->GetGUID();
if (factionForFollower)
- me->setFaction(factionForFollower);
+ me->SetFaction(factionForFollower);
m_pQuestForFollow = quest;
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index a215153b550..1d4c2150585 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -580,7 +580,7 @@ void SmartAI::JustRespawned()
mDespawnState = 0;
mEscortState = SMART_ESCORT_NONE;
me->SetVisible(true);
- if (me->getFaction() != me->GetCreatureTemplate()->faction)
+ if (me->GetFaction() != me->GetCreatureTemplate()->faction)
me->RestoreFaction();
mJustReset = true;
JustReachedHome();
@@ -830,12 +830,6 @@ void SmartAI::sQuestReward(Player* player, Quest const* quest, uint32 opt)
GetScript()->ProcessEventsFor(SMART_EVENT_REWARD_QUEST, player, quest->GetQuestId(), opt);
}
-bool SmartAI::sOnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex)
-{
- GetScript()->ProcessEventsFor(SMART_EVENT_DUMMY_EFFECT, caster, spellId, (uint32)effIndex);
- return true;
-}
-
void SmartAI::SetCombatMove(bool on)
{
if (mCanCombatMove == on)
diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h
index 02cb4529a38..cce8ffd57ad 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.h
+++ b/src/server/game/AI/SmartScripts/SmartAI.h
@@ -182,7 +182,6 @@ class TC_GAME_API SmartAI : public CreatureAI
void sQuestAccept(Player* player, Quest const* quest) override;
//void sQuestSelect(Player* player, Quest const* quest) override;
void sQuestReward(Player* player, Quest const* quest, uint32 opt) override;
- bool sOnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex) override;
void sOnGameEvent(bool start, uint16 eventId) override;
uint32 mEscortQuestID;
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 6224533846e..abf80f95794 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -365,7 +365,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (e.action.faction.factionID)
{
- (*itr)->ToCreature()->setFaction(e.action.faction.factionID);
+ (*itr)->ToCreature()->SetFaction(e.action.faction.factionID);
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, %s set faction to %u",
(*itr)->GetEntry(), (*itr)->GetGUID().ToString().c_str(), e.action.faction.factionID);
}
@@ -373,9 +373,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate((*itr)->ToCreature()->GetEntry()))
{
- if ((*itr)->ToCreature()->getFaction() != ci->faction)
+ if ((*itr)->ToCreature()->GetFaction() != ci->faction)
{
- (*itr)->ToCreature()->setFaction(ci->faction);
+ (*itr)->ToCreature()->SetFaction(ci->faction);
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, %s set faction to %u",
(*itr)->GetEntry(), (*itr)->GetGUID().ToString().c_str(), ci->faction);
}
@@ -3831,13 +3831,6 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
ProcessAction(e, unit, var0, var1);
break;
}
- case SMART_EVENT_DUMMY_EFFECT:
- {
- if (e.event.dummy.spell != var0 || e.event.dummy.effIndex != var1)
- return;
- ProcessAction(e, unit, var0, var1);
- break;
- }
case SMART_EVENT_GAME_EVENT_START:
case SMART_EVENT_GAME_EVENT_END:
{
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 9faaab903e6..42f0a4b4f2c 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -857,15 +857,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
if (!IsTextValid(e, e.event.textOver.textGroupID))
return false;
break;
- case SMART_EVENT_DUMMY_EFFECT:
- {
- if (!IsSpellValid(e, e.event.dummy.spell))
- return false;
-
- if (e.event.dummy.effIndex > EFFECT_2)
- return false;
- break;
- }
case SMART_EVENT_IS_BEHIND_TARGET:
{
if (!IsMinMaxValid(e, e.event.behindTarget.cooldownMin, e.event.behindTarget.cooldownMax))
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index 1ff452f4182..392cdc7cc22 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -177,7 +177,7 @@ enum SMART_EVENT
SMART_EVENT_JUST_CREATED = 63, // none
SMART_EVENT_GOSSIP_HELLO = 64, // noReportUse (for GOs)
SMART_EVENT_FOLLOW_COMPLETED = 65, // none
- SMART_EVENT_DUMMY_EFFECT = 66, // spellId, effectIndex
+ // 66 unused
SMART_EVENT_IS_BEHIND_TARGET = 67, // cooldownMin, CooldownMax
SMART_EVENT_GAME_EVENT_START = 68, // game_event.Entry
SMART_EVENT_GAME_EVENT_END = 69, // game_event.Entry
@@ -1492,7 +1492,7 @@ const uint32 SmartAIEventMask[SMART_EVENT_END][2] =
{SMART_EVENT_JUST_CREATED, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
{SMART_EVENT_GOSSIP_HELLO, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
{SMART_EVENT_FOLLOW_COMPLETED, SMART_SCRIPT_TYPE_MASK_CREATURE },
- {SMART_EVENT_DUMMY_EFFECT, SMART_SCRIPT_TYPE_MASK_SPELL },
+ {66, 0 }, // unused
{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 },
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
index b86ec0a29f3..ca785cea3da 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
@@ -653,7 +653,7 @@ void AuctionHouseMgr::AddAItem(Item* item)
_itemsByGuid[item->GetGUID()] = item;
}
-bool AuctionHouseMgr::RemoveAItem(ObjectGuid id, bool deleteItem)
+bool AuctionHouseMgr::RemoveAItem(ObjectGuid id, bool deleteItem /*= false*/, CharacterDatabaseTransaction* trans /*= nullptr*/)
{
auto i = _itemsByGuid.find(id);
if (i == _itemsByGuid.end())
@@ -661,9 +661,9 @@ bool AuctionHouseMgr::RemoveAItem(ObjectGuid id, bool deleteItem)
if (deleteItem)
{
- CharacterDatabaseTransaction trans = CharacterDatabaseTransaction(nullptr);
+ ASSERT(trans);
i->second->FSetState(ITEM_REMOVED);
- i->second->SaveToDB(trans);
+ i->second->SaveToDB(*trans);
}
_itemsByGuid.erase(i);
@@ -1850,7 +1850,7 @@ void AuctionHouseObject::SendAuctionWon(AuctionPosting const* auction, Player* b
{
// bidder doesn't exist, delete the item
for (Item* item : auction->Items)
- sAuctionMgr->RemoveAItem(item->GetGUID(), true);
+ sAuctionMgr->RemoveAItem(item->GetGUID(), true, &trans);
}
}
@@ -1902,7 +1902,7 @@ void AuctionHouseObject::SendAuctionExpired(AuctionPosting const* auction, Chara
{
// owner doesn't exist, delete the item
for (Item* item : auction->Items)
- sAuctionMgr->RemoveAItem(item->GetGUID(), true);
+ sAuctionMgr->RemoveAItem(item->GetGUID(), true, &trans);
}
}
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h
index 308df2083a4..33a902b6d32 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.h
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h
@@ -373,7 +373,7 @@ class TC_GAME_API AuctionHouseMgr
void LoadAuctions();
void AddAItem(Item* item);
- bool RemoveAItem(ObjectGuid itemGuid, bool deleteItem = false);
+ bool RemoveAItem(ObjectGuid itemGuid, bool deleteItem = false, CharacterDatabaseTransaction* trans = nullptr);
bool PendingAuctionAdd(Player* player, uint32 auctionHouseId, uint32 auctionId, uint64 deposit);
std::size_t PendingAuctionCount(Player const* player) const;
void PendingAuctionProcess(Player* player);
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp
index f4c8aa5c320..b93a979033c 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp
@@ -179,21 +179,21 @@ void AuctionBotConfig::GetConfigFromFile()
SetConfig(CONFIG_AHBOT_ITEM_ORANGE_AMOUNT, "AuctionHouseBot.Items.Amount.Orange", 0);
SetConfig(CONFIG_AHBOT_ITEM_YELLOW_AMOUNT, "AuctionHouseBot.Items.Amount.Yellow", 0);
- SetConfigMax(CONFIG_AHBOT_CLASS_CONSUMABLE_AMOUNT, "AuctionHouseBot.Class.Consumable", 6, 10);
- SetConfigMax(CONFIG_AHBOT_CLASS_CONTAINER_AMOUNT, "AuctionHouseBot.Class.Container", 4, 10);
- SetConfigMax(CONFIG_AHBOT_CLASS_WEAPON_AMOUNT, "AuctionHouseBot.Class.Weapon", 8, 10);
- SetConfigMax(CONFIG_AHBOT_CLASS_GEM_AMOUNT, "AuctionHouseBot.Class.Gem", 3, 10);
- SetConfigMax(CONFIG_AHBOT_CLASS_ARMOR_AMOUNT, "AuctionHouseBot.Class.Armor", 8, 10);
- SetConfigMax(CONFIG_AHBOT_CLASS_REAGENT_AMOUNT, "AuctionHouseBot.Class.Reagent", 1, 10);
- SetConfigMax(CONFIG_AHBOT_CLASS_PROJECTILE_AMOUNT, "AuctionHouseBot.Class.Projectile", 2, 10);
- SetConfigMax(CONFIG_AHBOT_CLASS_TRADEGOOD_AMOUNT, "AuctionHouseBot.Class.TradeGood", 10, 10);
- SetConfigMax(CONFIG_AHBOT_CLASS_GENERIC_AMOUNT, "AuctionHouseBot.Class.Generic", 1, 10);
- SetConfigMax(CONFIG_AHBOT_CLASS_RECIPE_AMOUNT, "AuctionHouseBot.Class.Recipe", 6, 10);
- SetConfigMax(CONFIG_AHBOT_CLASS_QUIVER_AMOUNT, "AuctionHouseBot.Class.Quiver", 1, 10);
- SetConfigMax(CONFIG_AHBOT_CLASS_QUEST_AMOUNT, "AuctionHouseBot.Class.Quest", 1, 10);
- SetConfigMax(CONFIG_AHBOT_CLASS_KEY_AMOUNT, "AuctionHouseBot.Class.Key", 1, 10);
- SetConfigMax(CONFIG_AHBOT_CLASS_MISC_AMOUNT, "AuctionHouseBot.Class.Misc", 5, 10);
- SetConfigMax(CONFIG_AHBOT_CLASS_GLYPH_AMOUNT, "AuctionHouseBot.Class.Glyph", 3, 10);
+ SetConfigMax(CONFIG_AHBOT_CLASS_CONSUMABLE_PRIORITY, "AuctionHouseBot.Class.Consumable", 6, 10);
+ SetConfigMax(CONFIG_AHBOT_CLASS_CONTAINER_PRIORITY, "AuctionHouseBot.Class.Container", 4, 10);
+ SetConfigMax(CONFIG_AHBOT_CLASS_WEAPON_PRIORITY, "AuctionHouseBot.Class.Weapon", 8, 10);
+ SetConfigMax(CONFIG_AHBOT_CLASS_GEM_PRIORITY, "AuctionHouseBot.Class.Gem", 3, 10);
+ SetConfigMax(CONFIG_AHBOT_CLASS_ARMOR_PRIORITY, "AuctionHouseBot.Class.Armor", 8, 10);
+ SetConfigMax(CONFIG_AHBOT_CLASS_REAGENT_PRIORITY, "AuctionHouseBot.Class.Reagent", 1, 10);
+ SetConfigMax(CONFIG_AHBOT_CLASS_PROJECTILE_PRIORITY, "AuctionHouseBot.Class.Projectile", 2, 10);
+ SetConfigMax(CONFIG_AHBOT_CLASS_TRADEGOOD_PRIORITY, "AuctionHouseBot.Class.TradeGood", 10, 10);
+ SetConfigMax(CONFIG_AHBOT_CLASS_GENERIC_PRIORITY, "AuctionHouseBot.Class.Generic", 1, 10);
+ SetConfigMax(CONFIG_AHBOT_CLASS_RECIPE_PRIORITY, "AuctionHouseBot.Class.Recipe", 6, 10);
+ SetConfigMax(CONFIG_AHBOT_CLASS_QUIVER_PRIORITY, "AuctionHouseBot.Class.Quiver", 1, 10);
+ SetConfigMax(CONFIG_AHBOT_CLASS_QUEST_PRIORITY, "AuctionHouseBot.Class.Quest", 1, 10);
+ SetConfigMax(CONFIG_AHBOT_CLASS_KEY_PRIORITY, "AuctionHouseBot.Class.Key", 1, 10);
+ SetConfigMax(CONFIG_AHBOT_CLASS_MISC_PRIORITY, "AuctionHouseBot.Class.Misc", 5, 10);
+ SetConfigMax(CONFIG_AHBOT_CLASS_GLYPH_PRIORITY, "AuctionHouseBot.Class.Glyph", 3, 10);
SetConfig(CONFIG_AHBOT_ALLIANCE_PRICE_RATIO, "AuctionHouseBot.Alliance.Price.Ratio", 100);
SetConfig(CONFIG_AHBOT_HORDE_PRICE_RATIO, "AuctionHouseBot.Horde.Price.Ratio", 100);
@@ -351,6 +351,19 @@ uint32 AuctionBotConfig::GetConfigItemAmountRatio(AuctionHouseType houseType) co
}
}
+uint32 AuctionBotConfig::GetConfigPriceRatio(AuctionHouseType houseType) const
+{
+ switch (houseType)
+ {
+ case AUCTION_HOUSE_ALLIANCE:
+ return GetConfig(CONFIG_AHBOT_ALLIANCE_PRICE_RATIO);
+ case AUCTION_HOUSE_HORDE:
+ return GetConfig(CONFIG_AHBOT_HORDE_PRICE_RATIO);
+ default:
+ return GetConfig(CONFIG_AHBOT_NEUTRAL_PRICE_RATIO);
+ }
+}
+
bool AuctionBotConfig::GetConfigBuyerEnabled(AuctionHouseType houseType) const
{
switch (houseType)
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.h b/src/server/game/AuctionHouseBot/AuctionHouseBot.h
index 75145c498e6..3bf9caef9f8 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBot.h
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.h
@@ -71,21 +71,21 @@ enum AuctionBotConfigUInt32Values
CONFIG_AHBOT_ITEM_PURPLE_AMOUNT,
CONFIG_AHBOT_ITEM_ORANGE_AMOUNT,
CONFIG_AHBOT_ITEM_YELLOW_AMOUNT,
- CONFIG_AHBOT_CLASS_CONSUMABLE_AMOUNT,
- CONFIG_AHBOT_CLASS_CONTAINER_AMOUNT,
- CONFIG_AHBOT_CLASS_WEAPON_AMOUNT,
- CONFIG_AHBOT_CLASS_GEM_AMOUNT,
- CONFIG_AHBOT_CLASS_ARMOR_AMOUNT,
- CONFIG_AHBOT_CLASS_REAGENT_AMOUNT,
- CONFIG_AHBOT_CLASS_PROJECTILE_AMOUNT,
- CONFIG_AHBOT_CLASS_TRADEGOOD_AMOUNT,
- CONFIG_AHBOT_CLASS_GENERIC_AMOUNT,
- CONFIG_AHBOT_CLASS_RECIPE_AMOUNT,
- CONFIG_AHBOT_CLASS_QUIVER_AMOUNT,
- CONFIG_AHBOT_CLASS_QUEST_AMOUNT,
- CONFIG_AHBOT_CLASS_KEY_AMOUNT,
- CONFIG_AHBOT_CLASS_MISC_AMOUNT,
- CONFIG_AHBOT_CLASS_GLYPH_AMOUNT,
+ CONFIG_AHBOT_CLASS_CONSUMABLE_PRIORITY,
+ CONFIG_AHBOT_CLASS_CONTAINER_PRIORITY,
+ CONFIG_AHBOT_CLASS_WEAPON_PRIORITY,
+ CONFIG_AHBOT_CLASS_GEM_PRIORITY,
+ CONFIG_AHBOT_CLASS_ARMOR_PRIORITY,
+ CONFIG_AHBOT_CLASS_REAGENT_PRIORITY,
+ CONFIG_AHBOT_CLASS_PROJECTILE_PRIORITY,
+ CONFIG_AHBOT_CLASS_TRADEGOOD_PRIORITY,
+ CONFIG_AHBOT_CLASS_GENERIC_PRIORITY,
+ CONFIG_AHBOT_CLASS_RECIPE_PRIORITY,
+ CONFIG_AHBOT_CLASS_QUIVER_PRIORITY,
+ CONFIG_AHBOT_CLASS_QUEST_PRIORITY,
+ CONFIG_AHBOT_CLASS_KEY_PRIORITY,
+ CONFIG_AHBOT_CLASS_MISC_PRIORITY,
+ CONFIG_AHBOT_CLASS_GLYPH_PRIORITY,
CONFIG_AHBOT_ALLIANCE_PRICE_RATIO,
CONFIG_AHBOT_HORDE_PRICE_RATIO,
CONFIG_AHBOT_NEUTRAL_PRICE_RATIO,
@@ -205,8 +205,8 @@ enum AuctionBotConfigFloatValues
class TC_GAME_API AuctionBotConfig
{
private:
- AuctionBotConfig(): _itemsPerCycleBoost(1000), _itemsPerCycleNormal(20) { }
- ~AuctionBotConfig() { }
+ AuctionBotConfig(): _itemsPerCycleBoost(1000), _itemsPerCycleNormal(20) {}
+ ~AuctionBotConfig() {}
AuctionBotConfig(AuctionBotConfig const&) = delete;
AuctionBotConfig& operator=(AuctionBotConfig const&) = delete;
@@ -225,6 +225,7 @@ public:
void SetConfig(AuctionBotConfigFloatValues index, float value) { _configFloatValues[index] = value; }
uint32 GetConfigItemAmountRatio(AuctionHouseType houseType) const;
+ uint32 GetConfigPriceRatio(AuctionHouseType houseType) const;
bool GetConfigBuyerEnabled(AuctionHouseType houseType) const;
uint32 GetConfigItemQualityAmount(AuctionQuality quality) const;
@@ -286,8 +287,8 @@ class TC_GAME_API AuctionHouseBot
private:
AuctionHouseBot();
~AuctionHouseBot();
- AuctionHouseBot(const AuctionHouseBot&);
- AuctionHouseBot& operator=(const AuctionHouseBot&);
+ AuctionHouseBot(AuctionHouseBot const&) = delete;
+ AuctionHouseBot& operator=(AuctionHouseBot const&) = delete;
public:
static AuctionHouseBot* instance();
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
index 44ee9fcc2a4..da14231ec3c 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
@@ -22,6 +22,7 @@
#include "GameTime.h"
#include "Item.h"
#include "Log.h"
+#include "Containers.h"
#include "ObjectMgr.h"
#include "Random.h"
#include <sstream>
@@ -29,7 +30,7 @@
AuctionBotSeller::AuctionBotSeller()
{
// Define faction for our main data class.
- for (int i = 0; i < MAX_AUCTION_HOUSE_TYPE; ++i)
+ for (uint8 i = 0; i < MAX_AUCTION_HOUSE_TYPE; ++i)
_houseConfig[i].Initialize(AuctionHouseType(i));
}
@@ -117,11 +118,11 @@ bool AuctionBotSeller::Initialize()
continue;
// forced exclude filter
- if (excludeItems.find(itemId) != excludeItems.end())
+ if (excludeItems.count(itemId))
continue;
// forced include filter
- if (includeItems.find(itemId) != includeItems.end())
+ if (includeItems.count(itemId))
{
_itemPool[prototype->GetQuality()][prototype->GetClass()].push_back(itemId);
++itemsAdded;
@@ -207,19 +208,20 @@ bool AuctionBotSeller::Initialize()
// vendor filter
if (!sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEMS_VENDOR))
- if (npcItems.find(itemId) != npcItems.end())
+ if (npcItems.count(itemId))
continue;
// loot filter
if (!sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEMS_LOOT))
- if (lootItems.find(itemId) != lootItems.end())
+ if (lootItems.count(itemId))
continue;
// not vendor/loot filter
if (!sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEMS_MISC))
{
- bool isVendorItem = npcItems.find(itemId) != npcItems.end();
- bool isLootItem = lootItems.find(itemId) != lootItems.end();
+ bool const isVendorItem = npcItems.count(itemId) > 0;
+ bool const isLootItem = lootItems.count(itemId) > 0;
+
if (!isLootItem && !isVendorItem)
continue;
}
@@ -368,7 +370,7 @@ bool AuctionBotSeller::Initialize()
void AuctionBotSeller::LoadConfig()
{
- for (int i = 0; i < MAX_AUCTION_HOUSE_TYPE; ++i)
+ for (uint8 i = 0; i < MAX_AUCTION_HOUSE_TYPE; ++i)
if (sAuctionBotConfig->GetConfigItemAmountRatio(AuctionHouseType(i)))
LoadSellerValues(_houseConfig[i]);
}
@@ -377,129 +379,11 @@ void AuctionBotSeller::LoadItemsQuantity(SellerConfiguration& config)
{
uint32 ratio = sAuctionBotConfig->GetConfigItemAmountRatio(config.GetHouseType());
- config.SetItemsAmountPerQuality(AUCTION_QUALITY_GRAY, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_GRAY_AMOUNT) * ratio / 100);
- config.SetItemsAmountPerQuality(AUCTION_QUALITY_WHITE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_WHITE_AMOUNT) * ratio / 100);
- config.SetItemsAmountPerQuality(AUCTION_QUALITY_GREEN, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_GREEN_AMOUNT) * ratio / 100);
- config.SetItemsAmountPerQuality(AUCTION_QUALITY_BLUE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_BLUE_AMOUNT) * ratio / 100);
- config.SetItemsAmountPerQuality(AUCTION_QUALITY_PURPLE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_PURPLE_AMOUNT) * ratio / 100);
- config.SetItemsAmountPerQuality(AUCTION_QUALITY_ORANGE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_ORANGE_AMOUNT) * ratio / 100);
- config.SetItemsAmountPerQuality(AUCTION_QUALITY_YELLOW, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_YELLOW_AMOUNT) * ratio / 100);
-
- // Set quantity wanted but only on possible item color
- // This avoid any no-exist class-color items selection by random items create function
- // ============================================================================================
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GRAY, ITEM_CLASS_CONSUMABLE, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GRAY, ITEM_CLASS_CONTAINER, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GRAY, ITEM_CLASS_WEAPON, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_WEAPON_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GRAY, ITEM_CLASS_GEM, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GRAY, ITEM_CLASS_ARMOR, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_ARMOR_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GRAY, ITEM_CLASS_REAGENT, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GRAY, ITEM_CLASS_PROJECTILE, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GRAY, ITEM_CLASS_TRADE_GOODS, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_TRADEGOOD_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GRAY, ITEM_CLASS_ITEM_ENHANCEMENT, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GRAY, ITEM_CLASS_RECIPE, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GRAY, ITEM_CLASS_QUIVER, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GRAY, ITEM_CLASS_QUEST, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_QUEST_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GRAY, ITEM_CLASS_KEY, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GRAY, ITEM_CLASS_MISCELLANEOUS, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_MISC_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GRAY, ITEM_CLASS_GLYPH, 0);
-
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_WHITE, ITEM_CLASS_CONSUMABLE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_CONSUMABLE_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_WHITE, ITEM_CLASS_CONTAINER, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_CONTAINER_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_WHITE, ITEM_CLASS_WEAPON, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_WEAPON_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_WHITE, ITEM_CLASS_GEM, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_GEM_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_WHITE, ITEM_CLASS_ARMOR, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_ARMOR_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_WHITE, ITEM_CLASS_REAGENT, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_REAGENT_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_WHITE, ITEM_CLASS_PROJECTILE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_PROJECTILE_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_WHITE, ITEM_CLASS_TRADE_GOODS, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_TRADEGOOD_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_WHITE, ITEM_CLASS_ITEM_ENHANCEMENT, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_GENERIC_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_WHITE, ITEM_CLASS_RECIPE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_RECIPE_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_WHITE, ITEM_CLASS_QUIVER, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_QUIVER_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_WHITE, ITEM_CLASS_QUEST, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_QUEST_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_WHITE, ITEM_CLASS_KEY, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_KEY_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_WHITE, ITEM_CLASS_MISCELLANEOUS, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_MISC_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_WHITE, ITEM_CLASS_GLYPH, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_GLYPH_AMOUNT));
-
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GREEN, ITEM_CLASS_CONSUMABLE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_CONSUMABLE_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GREEN, ITEM_CLASS_CONTAINER, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_CONTAINER_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GREEN, ITEM_CLASS_WEAPON, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_WEAPON_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GREEN, ITEM_CLASS_GEM, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_GEM_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GREEN, ITEM_CLASS_ARMOR, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_ARMOR_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GREEN, ITEM_CLASS_REAGENT, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GREEN, ITEM_CLASS_PROJECTILE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_PROJECTILE_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GREEN, ITEM_CLASS_TRADE_GOODS, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_TRADEGOOD_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GREEN, ITEM_CLASS_ITEM_ENHANCEMENT, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GREEN, ITEM_CLASS_RECIPE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_RECIPE_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GREEN, ITEM_CLASS_QUIVER, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_QUIVER_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GREEN, ITEM_CLASS_QUEST, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_QUEST_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GREEN, ITEM_CLASS_KEY, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_KEY_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GREEN, ITEM_CLASS_MISCELLANEOUS, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_MISC_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_GREEN, ITEM_CLASS_GLYPH, 0);
-
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_BLUE, ITEM_CLASS_CONSUMABLE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_CONSUMABLE_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_BLUE, ITEM_CLASS_CONTAINER, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_CONTAINER_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_BLUE, ITEM_CLASS_WEAPON, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_WEAPON_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_BLUE, ITEM_CLASS_GEM, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_GEM_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_BLUE, ITEM_CLASS_ARMOR, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_ARMOR_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_BLUE, ITEM_CLASS_REAGENT, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_BLUE, ITEM_CLASS_PROJECTILE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_PROJECTILE_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_BLUE, ITEM_CLASS_TRADE_GOODS, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_TRADEGOOD_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_BLUE, ITEM_CLASS_ITEM_ENHANCEMENT, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_BLUE, ITEM_CLASS_RECIPE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_RECIPE_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_BLUE, ITEM_CLASS_QUIVER, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_QUIVER_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_BLUE, ITEM_CLASS_QUEST, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_QUEST_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_BLUE, ITEM_CLASS_KEY, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_BLUE, ITEM_CLASS_MISCELLANEOUS, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_MISC_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_BLUE, ITEM_CLASS_GLYPH, 0);
-
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_PURPLE, ITEM_CLASS_CONSUMABLE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_CONSUMABLE_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_PURPLE, ITEM_CLASS_CONTAINER, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_CONTAINER_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_PURPLE, ITEM_CLASS_WEAPON, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_WEAPON_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_PURPLE, ITEM_CLASS_GEM, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_GEM_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_PURPLE, ITEM_CLASS_ARMOR, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_ARMOR_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_PURPLE, ITEM_CLASS_REAGENT, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_PURPLE, ITEM_CLASS_PROJECTILE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_PROJECTILE_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_PURPLE, ITEM_CLASS_TRADE_GOODS, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_TRADEGOOD_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_PURPLE, ITEM_CLASS_ITEM_ENHANCEMENT, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_PURPLE, ITEM_CLASS_RECIPE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_RECIPE_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_PURPLE, ITEM_CLASS_QUIVER, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_PURPLE, ITEM_CLASS_QUEST, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_QUEST_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_PURPLE, ITEM_CLASS_KEY, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_PURPLE, ITEM_CLASS_MISCELLANEOUS, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_MISC_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_PURPLE, ITEM_CLASS_GLYPH, 0);
-
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_ORANGE, ITEM_CLASS_CONSUMABLE, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_ORANGE, ITEM_CLASS_CONTAINER, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_ORANGE, ITEM_CLASS_WEAPON, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_WEAPON_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_ORANGE, ITEM_CLASS_GEM, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_ORANGE, ITEM_CLASS_ARMOR, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_ARMOR_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_ORANGE, ITEM_CLASS_REAGENT, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_ORANGE, ITEM_CLASS_PROJECTILE, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_ORANGE, ITEM_CLASS_TRADE_GOODS, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_TRADEGOOD_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_ORANGE, ITEM_CLASS_ITEM_ENHANCEMENT, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_ORANGE, ITEM_CLASS_RECIPE, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_ORANGE, ITEM_CLASS_QUIVER, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_ORANGE, ITEM_CLASS_QUEST, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_ORANGE, ITEM_CLASS_KEY, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_ORANGE, ITEM_CLASS_MISCELLANEOUS, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_ORANGE, ITEM_CLASS_GLYPH, 0);
-
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_YELLOW, ITEM_CLASS_CONSUMABLE, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_YELLOW, ITEM_CLASS_CONTAINER, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_YELLOW, ITEM_CLASS_WEAPON, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_WEAPON_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_YELLOW, ITEM_CLASS_GEM, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_YELLOW, ITEM_CLASS_ARMOR, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_ARMOR_AMOUNT));
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_YELLOW, ITEM_CLASS_REAGENT, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_YELLOW, ITEM_CLASS_PROJECTILE, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_YELLOW, ITEM_CLASS_TRADE_GOODS, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_YELLOW, ITEM_CLASS_ITEM_ENHANCEMENT, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_YELLOW, ITEM_CLASS_RECIPE, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_YELLOW, ITEM_CLASS_QUIVER, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_YELLOW, ITEM_CLASS_QUEST, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_YELLOW, ITEM_CLASS_KEY, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_YELLOW, ITEM_CLASS_MISCELLANEOUS, 0);
- config.SetItemsQuantityPerClass(AUCTION_QUALITY_YELLOW, ITEM_CLASS_GLYPH, 0);
- // ============================================================================================
+ for (uint32 i = 0; i < MAX_AUCTION_QUALITY; ++i)
+ {
+ uint32 amount = sAuctionBotConfig->GetConfig(AuctionBotConfigUInt32Values(CONFIG_AHBOT_ITEM_GRAY_AMOUNT + i));
+ config.SetItemsAmountPerQuality(AuctionQuality(i), std::lroundf(amount * ratio / 100.f));
+ }
// Set Stack Quantities
config.SetRandomStackRatioPerClass(ITEM_CLASS_CONSUMABLE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_RANDOMSTACKRATIO_CONSUMABLE));
@@ -519,45 +403,100 @@ void AuctionBotSeller::LoadItemsQuantity(SellerConfiguration& config)
config.SetRandomStackRatioPerClass(ITEM_CLASS_GLYPH, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_RANDOMSTACKRATIO_GLYPH));
// Set the best value to get nearest amount of items wanted
+ auto getPriorityForClass = [](uint32 itemClass) -> uint32
+ {
+ AuctionBotConfigUInt32Values index;
+ switch (itemClass)
+ {
+ case ITEM_CLASS_CONSUMABLE:
+ index = CONFIG_AHBOT_CLASS_CONSUMABLE_PRIORITY; break;
+ case ITEM_CLASS_CONTAINER:
+ index = CONFIG_AHBOT_CLASS_CONTAINER_PRIORITY; break;
+ case ITEM_CLASS_WEAPON:
+ index = CONFIG_AHBOT_CLASS_WEAPON_PRIORITY; break;
+ case ITEM_CLASS_GEM:
+ index = CONFIG_AHBOT_CLASS_GEM_PRIORITY; break;
+ case ITEM_CLASS_ARMOR:
+ index = CONFIG_AHBOT_CLASS_ARMOR_PRIORITY; break;
+ case ITEM_CLASS_REAGENT:
+ index = CONFIG_AHBOT_CLASS_REAGENT_PRIORITY; break;
+ case ITEM_CLASS_PROJECTILE:
+ index = CONFIG_AHBOT_CLASS_PROJECTILE_PRIORITY; break;
+ case ITEM_CLASS_TRADE_GOODS:
+ index = CONFIG_AHBOT_CLASS_TRADEGOOD_PRIORITY; break;
+ case ITEM_CLASS_ITEM_ENHANCEMENT:
+ index = CONFIG_AHBOT_CLASS_GENERIC_PRIORITY; break;
+ case ITEM_CLASS_RECIPE:
+ index = CONFIG_AHBOT_CLASS_RECIPE_PRIORITY; break;
+ case ITEM_CLASS_QUIVER:
+ index = CONFIG_AHBOT_CLASS_QUIVER_PRIORITY; break;
+ case ITEM_CLASS_QUEST:
+ index = CONFIG_AHBOT_CLASS_QUEST_PRIORITY; break;
+ case ITEM_CLASS_KEY:
+ index = CONFIG_AHBOT_CLASS_KEY_PRIORITY; break;
+ case ITEM_CLASS_MISCELLANEOUS:
+ index = CONFIG_AHBOT_CLASS_MISC_PRIORITY; break;
+ case ITEM_CLASS_GLYPH:
+ index = CONFIG_AHBOT_CLASS_GLYPH_PRIORITY; break;
+ default:
+ return 0;
+ }
+
+ return sAuctionBotConfig->GetConfig(index);
+ };
+
+ std::vector<uint32> totalPrioPerQuality(MAX_AUCTION_QUALITY);
for (uint32 j = 0; j < MAX_AUCTION_QUALITY; ++j)
{
- uint32 index = config.GetItemsAmountPerQuality(AuctionQuality(j)) /
- (sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_CONSUMABLE_AMOUNT) + sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_CONTAINER_AMOUNT) + sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_WEAPON_AMOUNT) +
- sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_GEM_AMOUNT) + sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_ARMOR_AMOUNT) + sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_REAGENT_AMOUNT) +
- sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_PROJECTILE_AMOUNT) + sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_TRADEGOOD_AMOUNT) + sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_GENERIC_AMOUNT) +
- sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_RECIPE_AMOUNT) + sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_QUIVER_AMOUNT) + sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_QUEST_AMOUNT) +
- sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_KEY_AMOUNT) + sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_MISC_AMOUNT) + sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_GLYPH_AMOUNT));
+ for (uint32 i = 0; i < MAX_ITEM_CLASS; ++i)
+ {
+ // skip empty pools
+ if (_itemPool[j][i].empty())
+ continue;
+
+ totalPrioPerQuality[j] += getPriorityForClass(i);
+ }
+ }
+
+ for (uint32 j = 0; j < MAX_AUCTION_QUALITY; ++j)
+ {
+ uint32 qualityAmount = config.GetItemsAmountPerQuality(AuctionQuality(j));
+ if (!totalPrioPerQuality[j])
+ continue;
+
+ for (uint32 i = 0; i < MAX_ITEM_CLASS; ++i)
+ {
+ uint32 classPrio = getPriorityForClass(i);
+ if (_itemPool[j][i].empty())
+ classPrio = 0;
+
+ uint32 weightedAmount = std::lroundf(classPrio / float(totalPrioPerQuality[j]) * qualityAmount);
+ config.SetItemsAmountPerClass(AuctionQuality(j), ItemClass(i), weightedAmount);
+ }
+ }
+ // do some assert checking, GetItemAmount must always return 0 if selected _itemPool is empty
+ for (uint32 j = 0; j < MAX_AUCTION_QUALITY; ++j)
+ {
for (uint32 i = 0; i < MAX_ITEM_CLASS; ++i)
- config.SetItemsAmountPerClass(AuctionQuality(j), ItemClass(i), index);
+ {
+ if (_itemPool[j][i].empty())
+ ASSERT(config.GetItemsAmountPerClass(AuctionQuality(j), ItemClass(i)) == 0);
+ }
}
}
void AuctionBotSeller::LoadSellerValues(SellerConfiguration& config)
{
LoadItemsQuantity(config);
- uint32 PriceRatio;
- switch (config.GetHouseType())
+ uint32 ratio = sAuctionBotConfig->GetConfigPriceRatio(config.GetHouseType());
+
+ for (uint32 i = 0; i < MAX_AUCTION_QUALITY; ++i)
{
- case AUCTION_HOUSE_ALLIANCE:
- PriceRatio = sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ALLIANCE_PRICE_RATIO);
- break;
- case AUCTION_HOUSE_HORDE:
- PriceRatio = sAuctionBotConfig->GetConfig(CONFIG_AHBOT_HORDE_PRICE_RATIO);
- break;
- default:
- PriceRatio = sAuctionBotConfig->GetConfig(CONFIG_AHBOT_NEUTRAL_PRICE_RATIO);
- break;
+ uint32 amount = sAuctionBotConfig->GetConfig(AuctionBotConfigUInt32Values(CONFIG_AHBOT_ITEM_GRAY_PRICE_RATIO + i));
+ config.SetPriceRatioPerQuality(AuctionQuality(i), std::lroundf(amount * ratio / 100.f));
}
- config.SetPriceRatioPerQuality(AUCTION_QUALITY_GRAY, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_GRAY_PRICE_RATIO));
- config.SetPriceRatioPerQuality(AUCTION_QUALITY_WHITE, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_WHITE_PRICE_RATIO));
- config.SetPriceRatioPerQuality(AUCTION_QUALITY_GREEN, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_GREEN_PRICE_RATIO));
- config.SetPriceRatioPerQuality(AUCTION_QUALITY_BLUE, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_BLUE_PRICE_RATIO));
- config.SetPriceRatioPerQuality(AUCTION_QUALITY_PURPLE, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_PURPLE_PRICE_RATIO));
- config.SetPriceRatioPerQuality(AUCTION_QUALITY_ORANGE, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_ORANGE_PRICE_RATIO));
- config.SetPriceRatioPerQuality(AUCTION_QUALITY_YELLOW, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_YELLOW_PRICE_RATIO));
-
config.SetPriceRatioPerClass(ITEM_CLASS_CONSUMABLE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_CONSUMABLE_PRICE_RATIO));
config.SetPriceRatioPerClass(ITEM_CLASS_CONTAINER, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_CONTAINER_PRICE_RATIO));
config.SetPriceRatioPerClass(ITEM_CLASS_WEAPON, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_WEAPON_PRICE_RATIO));
@@ -579,18 +518,6 @@ void AuctionBotSeller::LoadSellerValues(SellerConfiguration& config)
//load min and max auction times
config.SetMinTime(sAuctionBotConfig->GetConfig(CONFIG_AHBOT_MINTIME));
config.SetMaxTime(sAuctionBotConfig->GetConfig(CONFIG_AHBOT_MAXTIME));
-
- TC_LOG_DEBUG("ahbot", "AHBot: minTime = %u", config.GetMinTime());
- TC_LOG_DEBUG("ahbot", "AHBot: maxTime = %u", config.GetMaxTime());
-
- TC_LOG_DEBUG("ahbot", "AHBot: For AH type %u", config.GetHouseType());
- TC_LOG_DEBUG("ahbot", "AHBot: GrayItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_GRAY));
- TC_LOG_DEBUG("ahbot", "AHBot: WhiteItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_WHITE));
- TC_LOG_DEBUG("ahbot", "AHBot: GreenItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_GREEN));
- TC_LOG_DEBUG("ahbot", "AHBot: BlueItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_BLUE));
- TC_LOG_DEBUG("ahbot", "AHBot: PurpleItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_PURPLE));
- TC_LOG_DEBUG("ahbot", "AHBot: OrangeItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_ORANGE));
- TC_LOG_DEBUG("ahbot", "AHBot: YellowItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_YELLOW));
}
// Set static of items on one AH faction.
@@ -644,12 +571,13 @@ bool AuctionBotSeller::GetItemsToSell(SellerConfiguration& config, ItemsToSellAr
{
for (uint32 i = 0; i < MAX_ITEM_CLASS; ++i)
{
- if (config.GetMissedItemsPerClass(AuctionQuality(j), ItemClass(i)) > addedItem[j][i] && !_itemPool[j][i].empty())
+ // if _itemPool for chosen is empty, MissedItemsPerClass will return 0 here (checked at startup)
+ if (config.GetMissedItemsPerClass(AuctionQuality(j), ItemClass(i)) > addedItem[j][i])
{
ItemToSell miss_item;
miss_item.Color = j;
miss_item.Itemclass = i;
- itemsToSellArray.push_back(miss_item);
+ itemsToSellArray.emplace_back(std::move(miss_item));
found = true;
}
}
@@ -688,7 +616,9 @@ void AuctionBotSeller::SetPricesOfItem(ItemTemplate const* itemProto, SellerConf
if (sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BUYPRICE_SELLER))
buyPrice = sellPrice;
- float basePriceFloat = (buyPrice * stackCount * priceRatio) / (itemProto->GetClass() == 6 ? 200.0f : static_cast<float>(itemProto->GetBuyCount())) / 100.0f;
+ float basePriceFloat = buyPrice * stackCount / (itemProto->GetClass() == 6 ? 200.0f : static_cast<float>(itemProto->GetBuyCount()));
+ basePriceFloat *= priceRatio;
+
float range = basePriceFloat * 0.04f;
buyout = (static_cast<uint32>(frand(basePriceFloat - range, basePriceFloat + range) + 0.5f) / SILVER) * SILVER;
@@ -908,11 +838,11 @@ void AuctionBotSeller::AddNewAuctions(SellerConfiguration& config)
--items;
// Select random position from missed items table
- uint32 pos = urand(0, itemsToSell.size() - 1);
+ ItemToSell const& sellItem = Trinity::Containers::SelectRandomContainerElement(itemsToSell);
// Set itemId with random item ID for selected categories and color, from _itemPool table
- uint32 itemId = _itemPool[itemsToSell[pos].Color][itemsToSell[pos].Itemclass][urand(0, _itemPool[itemsToSell[pos].Color][itemsToSell[pos].Itemclass].size() - 1)];
- ++allItems[itemsToSell[pos].Color][itemsToSell[pos].Itemclass]; // Helper table to avoid rescan from DB in this loop. (has we add item in random orders)
+ uint32 itemId = Trinity::Containers::SelectRandomContainerElement(_itemPool[sellItem.Color][sellItem.Itemclass]);
+ ++allItems[sellItem.Color][sellItem.Itemclass]; // Helper table to avoid rescan from DB in this loop. (has we add item in random orders)
if (!itemId)
{
@@ -951,16 +881,14 @@ void AuctionBotSeller::AddNewAuctions(SellerConfiguration& config)
switch (etime)
{
case 1:
- etime = 43200;
- break;
- case 2:
- etime = 86400;
+ etime = DAY / 2;
break;
case 3:
- etime = 172800;
+ etime = 2 *DAY;
break;
+ case 2:
default:
- etime = 86400;
+ etime = DAY;
break;
}
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h
index ea82dd991f4..29288c6fb3b 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h
@@ -32,36 +32,28 @@ struct ItemToSell
typedef std::vector<ItemToSell> ItemsToSellArray;
typedef std::array<std::array<uint32, MAX_ITEM_CLASS>, MAX_ITEM_QUALITY> AllItemsArray;
-struct SellerItemClassInfo
+struct SellerItemInfo
{
- SellerItemClassInfo(): AmountOfItems(0), MissItems(0), Quantity(0), PriceRatio(0), RandomStackRatio(100) {}
-
- uint32 AmountOfItems;
- uint32 MissItems;
- uint32 Quantity;
- uint32 PriceRatio;
- uint32 RandomStackRatio;
+ uint32 AmountOfItems = 0;
+ uint32 MissItems = 0;
};
-struct SellerItemInfo
+struct SellerItemClassSharedInfo
{
- SellerItemInfo(): AmountOfItems(0), MissItems(0), PriceRatio(0) {}
-
- uint32 AmountOfItems;
- uint32 MissItems;
- uint32 PriceRatio;
+ uint32 PriceRatio = 0;
+ uint32 RandomStackRatio = 100;
+};
- SellerItemClassInfo ItemClassInfos[MAX_ITEM_CLASS];
+struct SellerItemQualitySharedInfo
+{
+ uint32 AmountOfItems = 0;
+ uint32 PriceRatio = 0;
};
class SellerConfiguration
{
public:
- SellerConfiguration(): LastMissedItem(0), _houseType(AUCTION_HOUSE_NEUTRAL), _minTime(1), _maxTime(72)
- {
- }
-
- ~SellerConfiguration() {}
+ SellerConfiguration() : LastMissedItem(0), _houseType(AUCTION_HOUSE_NEUTRAL), _minTime(1), _maxTime(72), _itemInfo(), _itemSharedQualityInfo(), _itemSharedClassInfo() { }
void Initialize(AuctionHouseType houseType)
{
@@ -83,35 +75,43 @@ public:
void SetMaxTime(uint32 value) { _maxTime = value; }
uint32 GetMaxTime() const { return _maxTime; }
+
// Data access classified by item class and item quality
- void SetItemsAmountPerClass(AuctionQuality quality, ItemClass itemclass, uint32 amount) { _ItemInfo[quality].ItemClassInfos[itemclass].AmountOfItems = amount * _ItemInfo[quality].ItemClassInfos[itemclass].Quantity; }
- uint32 GetItemsAmountPerClass(AuctionQuality quality, ItemClass itemclass) const { return _ItemInfo[quality].ItemClassInfos[itemclass].AmountOfItems; }
- void SetItemsQuantityPerClass(AuctionQuality quality, ItemClass itemclass, uint32 qty) { _ItemInfo[quality].ItemClassInfos[itemclass].Quantity = qty; }
- uint32 GetItemsQuantityPerClass(AuctionQuality quality, ItemClass itemclass) const { return _ItemInfo[quality].ItemClassInfos[itemclass].Quantity; }
- void SetMissedItemsPerClass(AuctionQuality quality, ItemClass itemclass, uint32 found)
+ void SetItemsAmountPerClass(AuctionQuality quality, ItemClass itemClass, uint32 amount) { _itemInfo[quality][itemClass].AmountOfItems = amount; }
+ uint32 GetItemsAmountPerClass(AuctionQuality quality, ItemClass itemClass) const { return _itemInfo[quality][itemClass].AmountOfItems; }
+
+ void SetMissedItemsPerClass(AuctionQuality quality, ItemClass itemClass, uint32 found)
{
- if (_ItemInfo[quality].ItemClassInfos[itemclass].AmountOfItems > found)
- _ItemInfo[quality].ItemClassInfos[itemclass].MissItems = _ItemInfo[quality].ItemClassInfos[itemclass].AmountOfItems - found;
+ if (_itemInfo[quality][itemClass].AmountOfItems > found)
+ _itemInfo[quality][itemClass].MissItems = _itemInfo[quality][itemClass].AmountOfItems - found;
else
- _ItemInfo[quality].ItemClassInfos[itemclass].MissItems = 0;
+ _itemInfo[quality][itemClass].MissItems = 0;
}
- uint32 GetMissedItemsPerClass(AuctionQuality quality, ItemClass itemclass) const { return _ItemInfo[quality].ItemClassInfos[itemclass].MissItems; }
+ uint32 GetMissedItemsPerClass(AuctionQuality quality, ItemClass itemClass) const { return _itemInfo[quality][itemClass].MissItems; }
// Data for every quality of item
- void SetItemsAmountPerQuality(AuctionQuality quality, uint32 cnt) { _ItemInfo[quality].AmountOfItems = cnt; }
- uint32 GetItemsAmountPerQuality(AuctionQuality quality) const { return _ItemInfo[quality].AmountOfItems; }
- void SetPriceRatioPerQuality(AuctionQuality quality, uint32 value) { _ItemInfo[quality].PriceRatio = value; }
- uint32 GetPriceRatioPerQuality(AuctionQuality quality) const { return _ItemInfo[quality].PriceRatio; }
- void SetPriceRatioPerClass(ItemClass item, uint32 value) { _ItemInfo[0].ItemClassInfos[item].PriceRatio = value; }
- uint32 GetPriceRatioPerClass(ItemClass item) const { return _ItemInfo[0].ItemClassInfos[item].PriceRatio; }
- void SetRandomStackRatioPerClass(ItemClass item, uint32 value) { _ItemInfo[0].ItemClassInfos[item].RandomStackRatio = value; }
- uint32 GetRandomStackRatioPerClass(ItemClass item) const { return _ItemInfo[0].ItemClassInfos[item].RandomStackRatio; }
+ void SetItemsAmountPerQuality(AuctionQuality quality, uint32 cnt) { _itemSharedQualityInfo[quality].AmountOfItems = cnt; }
+ uint32 GetItemsAmountPerQuality(AuctionQuality quality) const { return _itemSharedQualityInfo[quality].AmountOfItems; }
+
+ void SetPriceRatioPerQuality(AuctionQuality quality, uint32 value) { _itemSharedQualityInfo[quality].PriceRatio = value; }
+ uint32 GetPriceRatioPerQuality(AuctionQuality quality) const { return _itemSharedQualityInfo[quality].PriceRatio; }
+
+ // data for every class of item
+ void SetPriceRatioPerClass(ItemClass itemClass, uint32 value) { _itemSharedClassInfo[itemClass].PriceRatio = value; }
+ uint32 GetPriceRatioPerClass(ItemClass itemClass) const { return _itemSharedClassInfo[itemClass].PriceRatio; }
+
+ void SetRandomStackRatioPerClass(ItemClass itemClass, uint32 value) { _itemSharedClassInfo[itemClass].RandomStackRatio = value; }
+ uint32 GetRandomStackRatioPerClass(ItemClass itemClass) const { return _itemSharedClassInfo[itemClass].RandomStackRatio; }
private:
AuctionHouseType _houseType;
uint32 _minTime;
uint32 _maxTime;
- SellerItemInfo _ItemInfo[MAX_AUCTION_QUALITY];
+
+ SellerItemInfo _itemInfo[MAX_AUCTION_QUALITY][MAX_ITEM_CLASS];
+
+ SellerItemQualitySharedInfo _itemSharedQualityInfo[MAX_ITEM_QUALITY];
+ SellerItemClassSharedInfo _itemSharedClassInfo[MAX_ITEM_CLASS];
};
// This class handle all Selling method
diff --git a/src/server/game/Battlefield/Zones/BattlefieldTB.cpp b/src/server/game/Battlefield/Zones/BattlefieldTB.cpp
index f2130d973db..1d610373c94 100644
--- a/src/server/game/Battlefield/Zones/BattlefieldTB.cpp
+++ b/src/server/game/Battlefield/Zones/BattlefieldTB.cpp
@@ -609,7 +609,7 @@ void BattlefieldTB::OnCreatureCreate(Creature* creature)
HideNpc(creature);
break;
case NPC_ABANDONED_SIEGE_ENGINE:
- creature->setFaction(TBFactions[GetDefenderTeam()]);
+ creature->SetFaction(TBFactions[GetDefenderTeam()]);
creature->CastSpell(creature, SPELL_THICK_LAYER_OF_RUST, true);
break;
case NPC_SIEGE_ENGINE_TURRET:
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
index 3589d7dd08c..6e1bba5f1a9 100644
--- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
+++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
@@ -580,7 +580,7 @@ void BattlefieldWG::OnBattleStart()
if (Creature* creature = GetCreature(*itr))
{
ShowNpc(creature, true);
- creature->setFaction(WintergraspFaction[GetDefenderTeam()]);
+ creature->SetFaction(WintergraspFaction[GetDefenderTeam()]);
}
}
@@ -664,7 +664,7 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer)
if (Creature* creature = GetCreature(*itr))
{
if (!endByTimer)
- creature->setFaction(WintergraspFaction[GetDefenderTeam()]);
+ creature->SetFaction(WintergraspFaction[GetDefenderTeam()]);
HideNpc(creature);
}
}
@@ -891,9 +891,9 @@ void BattlefieldWG::OnCreatureRemove(Creature* /*creature*/)
case NPC_WINTERGRASP_DEMOLISHER:
{
uint8 team;
- if (creature->getFaction() == WintergraspFaction[TEAM_ALLIANCE])
+ if (creature->GetFaction() == WintergraspFaction[TEAM_ALLIANCE])
team = TEAM_ALLIANCE;
- else if (creature->getFaction() == WintergraspFaction[TEAM_HORDE])
+ else if (creature->GetFaction() == WintergraspFaction[TEAM_HORDE])
team = TEAM_HORDE;
else
return;
@@ -1604,12 +1604,12 @@ void BfWGGameObjectBuilding::Init(GameObject* go)
case GO_WINTERGRASP_FORTRESS_TOWER_2:
case GO_WINTERGRASP_FORTRESS_TOWER_3:
case GO_WINTERGRASP_FORTRESS_TOWER_4:
- turret->setFaction(WintergraspFaction[_wg->GetDefenderTeam()]);
+ turret->SetFaction(WintergraspFaction[_wg->GetDefenderTeam()]);
break;
case GO_WINTERGRASP_SHADOWSIGHT_TOWER:
case GO_WINTERGRASP_WINTER_S_EDGE_TOWER:
case GO_WINTERGRASP_FLAMEWATCH_TOWER:
- turret->setFaction(WintergraspFaction[_wg->GetAttackerTeam()]);
+ turret->SetFaction(WintergraspFaction[_wg->GetAttackerTeam()]);
break;
}
@@ -1629,12 +1629,12 @@ void BfWGGameObjectBuilding::Init(GameObject* go)
case GO_WINTERGRASP_FORTRESS_TOWER_2:
case GO_WINTERGRASP_FORTRESS_TOWER_3:
case GO_WINTERGRASP_FORTRESS_TOWER_4:
- turret->setFaction(WintergraspFaction[_wg->GetDefenderTeam()]);
+ turret->SetFaction(WintergraspFaction[_wg->GetDefenderTeam()]);
break;
case GO_WINTERGRASP_SHADOWSIGHT_TOWER:
case GO_WINTERGRASP_WINTER_S_EDGE_TOWER:
case GO_WINTERGRASP_FLAMEWATCH_TOWER:
- turret->setFaction(WintergraspFaction[_wg->GetAttackerTeam()]);
+ turret->SetFaction(WintergraspFaction[_wg->GetAttackerTeam()]);
break;
}
_wg->HideNpc(turret);
@@ -1689,14 +1689,14 @@ void BfWGGameObjectBuilding::UpdateTurretAttack(bool disable)
case GO_WINTERGRASP_FORTRESS_TOWER_3:
case GO_WINTERGRASP_FORTRESS_TOWER_4:
{
- creature->setFaction(WintergraspFaction[_wg->GetDefenderTeam()]);
+ creature->SetFaction(WintergraspFaction[_wg->GetDefenderTeam()]);
break;
}
case GO_WINTERGRASP_SHADOWSIGHT_TOWER:
case GO_WINTERGRASP_WINTER_S_EDGE_TOWER:
case GO_WINTERGRASP_FLAMEWATCH_TOWER:
{
- creature->setFaction(WintergraspFaction[_wg->GetAttackerTeam()]);
+ creature->SetFaction(WintergraspFaction[_wg->GetAttackerTeam()]);
break;
}
}
@@ -1719,14 +1719,14 @@ void BfWGGameObjectBuilding::UpdateTurretAttack(bool disable)
case GO_WINTERGRASP_FORTRESS_TOWER_3:
case GO_WINTERGRASP_FORTRESS_TOWER_4:
{
- creature->setFaction(WintergraspFaction[_wg->GetDefenderTeam()]);
+ creature->SetFaction(WintergraspFaction[_wg->GetDefenderTeam()]);
break;
}
case GO_WINTERGRASP_SHADOWSIGHT_TOWER:
case GO_WINTERGRASP_WINTER_S_EDGE_TOWER:
case GO_WINTERGRASP_FLAMEWATCH_TOWER:
{
- creature->setFaction(WintergraspFaction[_wg->GetAttackerTeam()]);
+ creature->SetFaction(WintergraspFaction[_wg->GetAttackerTeam()]);
break;
}
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
index 6e89bc86b3f..ebe3f5462b6 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
@@ -384,7 +384,7 @@ void BattlegroundAB::_NodeOccupied(uint8 node, Team team)
//aura should only apply to players who have accupied the node, set correct faction for trigger
if (trigger)
{
- trigger->setFaction(team == ALLIANCE ? 84 : 83);
+ trigger->SetFaction(team == ALLIANCE ? 84 : 83);
trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
}
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
index fd31810e4b8..1dabe1a572d 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
@@ -342,7 +342,7 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
{
if (Creature* trigger = AddCreature(WORLD_TRIGGER, triggerSpawnID, BG_AV_CreaturePos[triggerSpawnID]))
{
- trigger->setFaction(newFaction);
+ trigger->SetFaction(newFaction);
trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
}
}
@@ -756,7 +756,7 @@ void BattlegroundAV::PopulateNode(BG_AV_Nodes node)
DelCreature(node + 302);
return;
}
- trigger->setFaction(owner == ALLIANCE ? 84 : 83);
+ trigger->SetFaction(owner == ALLIANCE ? 84 : 83);
trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
}
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
index 25400dd00b4..9cf74c56dd9 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
@@ -721,8 +721,7 @@ void BattlegroundEY::EventTeamLostPoint(Player* player, uint32 Point)
UpdatePointsCount(Team);
//remove bonus honor aura trigger creature when node is lost
- if (Point < EY_POINTS_MAX)
- DelCreature(Point + 6);//NULL checks are in DelCreature! 0-5 spirit guides
+ DelCreature(Point + 6);//NULL checks are in DelCreature! 0-5 spirit guides
}
void BattlegroundEY::EventTeamCapturedPoint(Player* player, uint32 Point)
@@ -774,9 +773,6 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* player, uint32 Point)
UpdatePointsIcons(Team, Point);
UpdatePointsCount(Team);
- if (Point >= EY_POINTS_MAX)
- return;
-
Creature* trigger = GetBGCreature(Point + 6, false);//0-5 spirit guides
if (!trigger)
trigger = AddCreature(WORLD_TRIGGER, Point+6, BG_EY_TriggerPositions[Point], GetTeamIndexByTeamId(Team));
@@ -786,7 +782,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* player, uint32 Point)
//aura should only apply to players who have accupied the node, set correct faction for trigger
if (trigger)
{
- trigger->setFaction(Team == ALLIANCE ? 84 : 83);
+ trigger->SetFaction(Team == ALLIANCE ? 84 : 83);
trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
}
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
index e93fc640d31..b8c28b586f8 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
@@ -363,9 +363,9 @@ bool BattlegroundIC::SetupBattleground()
// setting correct factions for Keep Cannons
for (uint8 i = BG_IC_NPC_KEEP_CANNON_1; i <= BG_IC_NPC_KEEP_CANNON_12; ++i)
- GetBGCreature(i)->setFaction(BG_IC_Factions[0]);
+ GetBGCreature(i)->SetFaction(BG_IC_Factions[0]);
for (uint8 i = BG_IC_NPC_KEEP_CANNON_13; i <= BG_IC_NPC_KEEP_CANNON_24; ++i)
- GetBGCreature(i)->setFaction(BG_IC_Factions[1]);
+ GetBGCreature(i)->SetFaction(BG_IC_Factions[1]);
// correcting spawn time for keeps bombs
for (uint8 i = BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_1; i < BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_4; ++i)
@@ -694,7 +694,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* node, bool recapture)
continue;
if (AddCreature(node->faction == TEAM_ALLIANCE ? NPC_GLAIVE_THROWER_A : NPC_GLAIVE_THROWER_H, type, BG_IC_DocksVehiclesGlaives[i], node->faction, RESPAWN_ONE_DAY))
- GetBGCreature(type)->setFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]);
+ GetBGCreature(type)->SetFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
// spawning catapults
@@ -706,7 +706,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* node, bool recapture)
continue;
if (AddCreature(NPC_CATAPULT, type, BG_IC_DocksVehiclesCatapults[i], node->faction, RESPAWN_ONE_DAY))
- GetBGCreature(type)->setFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]);
+ GetBGCreature(type)->SetFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
break;
case BG_IC_GO_WORKSHOP_BANNER:
@@ -738,7 +738,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* node, bool recapture)
continue;
if (AddCreature(NPC_DEMOLISHER, type, BG_IC_WorkshopVehicles[i], node->faction, RESPAWN_ONE_DAY))
- GetBGCreature(type)->setFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]);
+ GetBGCreature(type)->SetFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
// we check if the opossing siege engine is in use
@@ -763,7 +763,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* node, bool recapture)
if (Creature* siegeEngine = GetBGCreature(siegeType))
{
siegeEngine->AddUnitFlag(UnitFlags(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_CANNOT_SWIM | UNIT_FLAG_IMMUNE_TO_PC));
- siegeEngine->setFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]);
+ siegeEngine->SetFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
}
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
index 52cb90f5e0c..0abb08afd0f 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
@@ -654,13 +654,13 @@ void BattlegroundSA::OverrideGunFaction()
for (uint8 i = BG_SA_GUN_1; i <= BG_SA_GUN_10; i++)
{
if (Creature* gun = GetBGCreature(i))
- gun->setFaction(BG_SA_Factions[Attackers ? TEAM_ALLIANCE : TEAM_HORDE]);
+ gun->SetFaction(BG_SA_Factions[Attackers ? TEAM_ALLIANCE : TEAM_HORDE]);
}
for (uint8 i = BG_SA_DEMOLISHER_1; i <= BG_SA_DEMOLISHER_4; i++)
{
if (Creature* dem = GetBGCreature(i))
- dem->setFaction(BG_SA_Factions[Attackers]);
+ dem->SetFaction(BG_SA_Factions[Attackers]);
}
}
@@ -831,7 +831,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
AddCreature(BG_SA_NpcEntries[j], j, BG_SA_NpcSpawnlocs[j], (Attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE), 600);
if (Creature* dem = GetBGCreature(j))
- dem->setFaction(BG_SA_Factions[Attackers]);
+ dem->SetFaction(BG_SA_Factions[Attackers]);
}
UpdateWorldState(BG_SA_LEFT_GY_ALLIANCE, GraveyardStatus[i] == TEAM_ALLIANCE);
@@ -856,7 +856,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
AddCreature(BG_SA_NpcEntries[j], j, BG_SA_NpcSpawnlocs[j], Attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE, 600);
if (Creature* dem = GetBGCreature(j))
- dem->setFaction(BG_SA_Factions[Attackers]);
+ dem->SetFaction(BG_SA_Factions[Attackers]);
}
UpdateWorldState(BG_SA_RIGHT_GY_ALLIANCE, GraveyardStatus[i] == TEAM_ALLIANCE);
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index 88670fa59fd..2d18d2d035c 100644
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -892,7 +892,7 @@ GameTele const* ChatHandler::extractGameTeleFromLink(char* text)
return nullptr;
// id case (explicit or from shift link)
- if (cId[0] >= '0' || cId[0] >= '9')
+ if (cId[0] >= '0' && cId[0] <= '9')
if (uint32 id = atoi(cId))
return sObjectMgr->GetGameTele(id);
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 4bbb29d43c1..f9f68237d0d 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -501,7 +501,7 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/,
if (!GetCreatureAddon())
SetSheath(SHEATH_STATE_MELEE);
- setFaction(cInfo->faction);
+ SetFaction(cInfo->faction);
uint64 npcFlags;
uint32 unitFlags, unitFlags2, unitFlags3, dynamicFlags;
@@ -555,7 +555,7 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/,
{
if (Player* owner = Creature::GetCharmerOrOwnerPlayerOrPlayerItself()) // this check comes in case we don't have a player
{
- setFaction(owner->getFaction()); // vehicles should have same as owner faction
+ SetFaction(owner->GetFaction()); // vehicles should have same as owner faction
owner->VehicleSpellInitialize();
}
}
@@ -622,7 +622,18 @@ void Creature::Update(uint32 diff)
if (targetGuid == dbtableHighGuid) // if linking self, never respawn (check delayed to next day)
SetRespawnTime(DAY);
else
- m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime) + urand(5, MINUTE); // else copy time from master and add a little
+ {
+ // else copy time from master and add a little
+ time_t baseRespawnTime = std::max(linkedRespawntime, now);
+ time_t const offset = urand(5, MINUTE);
+
+ // linked guid can be a boss, uses std::numeric_limits<time_t>::max to never respawn in that instance
+ // we shall inherit it instead of adding and causing an overflow
+ if (baseRespawnTime <= std::numeric_limits<time_t>::max() - offset)
+ m_respawnTime = baseRespawnTime + offset;
+ else
+ m_respawnTime = std::numeric_limits<time_t>::max();
+ }
SaveRespawnTime(); // also save to DB immediately
}
}
@@ -670,10 +681,10 @@ void Creature::Update(uint32 diff)
if (!m_suppressedTarget.IsEmpty())
{
if (WorldObject const* objTarget = ObjectAccessor::GetWorldObject(*this, m_suppressedTarget))
- SetFacingToObject(objTarget);
+ SetFacingToObject(objTarget, false);
}
else
- SetFacingTo(m_suppressedOrientation);
+ SetFacingTo(m_suppressedOrientation, false);
m_shouldReacquireTarget = false;
}
@@ -2331,7 +2342,7 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /
// only from same creature faction
if (checkfaction)
{
- if (getFaction() != u->getFaction())
+ if (GetFaction() != u->GetFaction())
return false;
}
else
@@ -3077,10 +3088,10 @@ void Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target)
bool const canTurnDuringCast = !spellInfo->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST);
// Face the target - we need to do this before the unit state is modified for no-turn spells
if (target)
- SetFacingToObject(target);
+ SetFacingToObject(target, false);
else if (!canTurnDuringCast)
if (Unit* victim = GetVictim())
- SetFacingToObject(victim); // ensure orientation is correct at beginning of cast
+ SetFacingToObject(victim, false); // ensure orientation is correct at beginning of cast
if (!canTurnDuringCast)
AddUnitState(UNIT_STATE_CANNOT_TURN);
@@ -3126,10 +3137,10 @@ void Creature::ReleaseFocus(Spell const* focusSpell, bool withDelay)
if (!m_suppressedTarget.IsEmpty())
{
if (WorldObject const* objTarget = ObjectAccessor::GetWorldObject(*this, m_suppressedTarget))
- SetFacingToObject(objTarget);
+ SetFacingToObject(objTarget, false);
}
else
- SetFacingTo(m_suppressedOrientation);
+ SetFacingTo(m_suppressedOrientation, false);
}
else
// tell the creature that it should reacquire its actual target after the delay expires (this is handled in ::Update)
@@ -3143,6 +3154,26 @@ void Creature::ReleaseFocus(Spell const* focusSpell, bool withDelay)
m_focusDelay = (!IsPet() && withDelay) ? GameTime::GetGameTimeMS() : 0; // don't allow re-target right away to prevent visual bugs
}
+bool Creature::IsMovementPreventedByCasting() const
+{
+ // first check if currently a movement allowed channel is active and we're not casting
+ if (Spell* spell = m_currentSpells[CURRENT_CHANNELED_SPELL])
+ {
+ if (spell->getState() != SPELL_STATE_FINISHED && spell->IsChannelActive())
+ if (spell->GetSpellInfo()->IsMoveAllowedChannel())
+ if (HasUnitState(UNIT_STATE_CASTING))
+ return true;
+ }
+
+ if (const_cast<Creature*>(this)->IsFocusing(nullptr, true))
+ return true;
+
+ if (HasUnitState(UNIT_STATE_CASTING))
+ return true;
+
+ return false;
+}
+
void Creature::StartPickPocketRefillTimer()
{
_pickpocketLootRestore = time(nullptr) + sWorld->getIntConfig(CONFIG_CREATURE_PICKPOCKET_REFILL);
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index 1be3e00e39a..cc5608bfc3d 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -328,9 +328,11 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
void MustReacquireTarget() { m_shouldReacquireTarget = true; } // flags the Creature for forced (client displayed) target reacquisition in the next ::Update call
void DoNotReacquireTarget() { m_shouldReacquireTarget = false; m_suppressedTarget = ObjectGuid::Empty; m_suppressedOrientation = 0.0f; }
void FocusTarget(Spell const* focusSpell, WorldObject const* target);
- bool IsFocusing(Spell const* focusSpell = nullptr, bool withDelay = false);
+ bool IsFocusing(Spell const* focusSpell = nullptr, bool withDelay = false) override;
void ReleaseFocus(Spell const* focusSpell = nullptr, bool withDelay = true);
+ bool IsMovementPreventedByCasting() const override;
+
// Part of Evade mechanics
time_t GetLastDamagedTime() const { return _lastDamagedTime; }
void SetLastDamagedTime(time_t val) { _lastDamagedTime = val; }
diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp
index 1643a712f8e..07547ae9139 100644
--- a/src/server/game/Entities/Creature/CreatureGroups.cpp
+++ b/src/server/game/Entities/Creature/CreatureGroups.cpp
@@ -224,13 +224,15 @@ void CreatureGroup::FormationReset(bool dismiss)
m_Formed = !dismiss;
}
-void CreatureGroup::LeaderMoveTo(float x, float y, float z)
+void CreatureGroup::LeaderMoveTo(Position destination, uint32 id /*= 0*/, uint32 moveType /*= 0*/, bool orientation /*= false*/)
{
//! To do: This should probably get its own movement generator or use WaypointMovementGenerator.
//! If the leader's path is known, member's path can be plotted as well using formation offsets.
if (!m_leader)
return;
+ float x = destination.GetPositionX(), y = destination.GetPositionY(), z = destination.GetPositionZ();
+
float pathangle = std::atan2(m_leader->GetPositionY() - y, m_leader->GetPositionX() - x);
for (CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
@@ -256,12 +258,9 @@ void CreatureGroup::LeaderMoveTo(float x, float y, float z)
if (!member->IsFlying())
member->UpdateGroundPositionZ(dx, dy, dz);
- if (member->IsWithinDist(m_leader, dist + MAX_DESYNC))
- member->SetUnitMovementFlags(m_leader->GetUnitMovementFlags());
- else
- member->SetWalk(false);
+ Position point(dx, dy, dz, destination.GetOrientation());
- member->GetMotionMaster()->MovePoint(0, dx, dy, dz);
+ member->GetMotionMaster()->MoveFormation(id, point, moveType, !member->IsWithinDist(m_leader, dist + MAX_DESYNC), orientation);
member->SetHomePosition(dx, dy, dz, pathangle);
}
}
diff --git a/src/server/game/Entities/Creature/CreatureGroups.h b/src/server/game/Entities/Creature/CreatureGroups.h
index 38e86ea4c12..85eb7454432 100644
--- a/src/server/game/Entities/Creature/CreatureGroups.h
+++ b/src/server/game/Entities/Creature/CreatureGroups.h
@@ -19,6 +19,7 @@
#define _FORMATIONS_H
#include "Define.h"
+#include "Position.h"
#include "ObjectGuid.h"
#include <unordered_map>
#include <map>
@@ -87,7 +88,7 @@ class TC_GAME_API CreatureGroup
void RemoveMember(Creature* member);
void FormationReset(bool dismiss);
- void LeaderMoveTo(float x, float y, float z);
+ void LeaderMoveTo(Position destination, uint32 id = 0, uint32 moveType = 0, bool orientation = false);
void MemberAttackStart(Creature* member, Unit* target);
};
diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp
index 63578dfd872..18613f0fda2 100644
--- a/src/server/game/Entities/Creature/TemporarySummon.cpp
+++ b/src/server/game/Entities/Creature/TemporarySummon.cpp
@@ -187,7 +187,7 @@ void TempSummon::InitStats(uint32 duration)
if (owner && IsTrigger() && m_spells[0])
{
- setFaction(owner->getFaction());
+ SetFaction(owner->GetFaction());
SetLevel(owner->getLevel());
if (owner->GetTypeId() == TYPEID_PLAYER)
m_ControlledByPlayer = true;
@@ -212,9 +212,9 @@ void TempSummon::InitStats(uint32 duration)
}
if (m_Properties->Faction)
- setFaction(m_Properties->Faction);
+ SetFaction(m_Properties->Faction);
else if (IsVehicle() && owner) // properties should be vehicle
- setFaction(owner->getFaction());
+ SetFaction(owner->GetFaction());
}
void TempSummon::InitSummon()
@@ -307,7 +307,7 @@ void Minion::InitStats(uint32 duration)
SetReactState(REACT_PASSIVE);
SetCreatorGUID(GetOwner()->GetGUID());
- setFaction(GetOwner()->getFaction());
+ SetFaction(GetOwner()->GetFaction());
GetOwner()->SetMinion(this, true);
}
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 4e34c8b4785..1bc8383a51c 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -2112,7 +2112,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId, TriggerCastFlags trigge
if (Unit* owner = GetOwner())
{
- trigger->setFaction(owner->getFaction());
+ trigger->SetFaction(owner->GetFaction());
if (owner->HasUnitFlag(UNIT_FLAG_PVP_ATTACKABLE))
trigger->AddUnitFlag(UNIT_FLAG_PVP_ATTACKABLE);
// copy pvp state flags from owner
@@ -2123,7 +2123,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId, TriggerCastFlags trigge
}
else
{
- trigger->setFaction(spellInfo->IsPositive() ? 35 : 14);
+ trigger->SetFaction(spellInfo->IsPositive() ? 35 : 14);
// Set owner guid for target if no owner available - needed by trigger auras
// - trigger gets despawned and there's no caster avalible (see AuraEffect::TriggerSpell())
trigger->CastSpell(target ? target : trigger, spellInfo, triggered, nullptr, nullptr, target ? target->GetGUID() : ObjectGuid::Empty);
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 99235c38da3..56eabab98d1 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -30,6 +30,7 @@
#include "ItemEnchantmentMgr.h"
#include "ItemPackets.h"
#include "Log.h"
+#include "LootItemStorage.h"
#include "LootMgr.h"
#include "Map.h"
#include "ObjectAccessor.h"
@@ -763,7 +764,7 @@ void Item::SaveToDB(CharacterDatabaseTransaction& trans)
// Delete the items if this is a container
if (!loot.isLooted())
- ItemContainerDeleteLootMoneyAndLootItemsFromDB();
+ sLootItemStorage->RemoveStoredLootForContainer(GetGUID().GetCounter());
delete this;
return;
@@ -1058,7 +1059,7 @@ void Item::DeleteFromDB(CharacterDatabaseTransaction& trans)
// Delete the items if this is a container
if (!loot.isLooted())
- ItemContainerDeleteLootMoneyAndLootItemsFromDB();
+ sLootItemStorage->RemoveStoredLootForContainer(GetGUID().GetCounter());
}
/*static*/
@@ -2141,191 +2142,6 @@ uint32 Item::GetSellPrice(ItemTemplate const* proto, uint32 quality, uint32 item
return 0;
}
-void Item::ItemContainerSaveLootToDB()
-{
- // Saves the money and item loot associated with an openable item to the DB
- if (loot.isLooted()) // no money and no loot
- return;
-
- CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
-
- loot.containerID = GetGUID(); // Save this for when a LootItem is removed
-
- // Save money
- if (loot.gold > 0)
- {
- CharacterDatabasePreparedStatement* stmt_money = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
- stmt_money->setUInt64(0, loot.containerID.GetCounter());
- trans->Append(stmt_money);
-
- stmt_money = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEMCONTAINER_MONEY);
- stmt_money->setUInt64(0, loot.containerID.GetCounter());
- stmt_money->setUInt32(1, loot.gold);
- trans->Append(stmt_money);
- }
-
- // Save items
- if (!loot.isLooted())
- {
- CharacterDatabasePreparedStatement* stmt_items = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS);
- stmt_items->setUInt64(0, loot.containerID.GetCounter());
- trans->Append(stmt_items);
-
- // Now insert the items
- for (LootItemList::const_iterator _li = loot.items.begin(); _li != loot.items.end(); ++_li)
- {
- // When an item is looted, it doesn't get removed from the items collection
- // but we don't want to resave it.
- if (!_li->canSave)
- continue;
- // Conditions are not checked when loot is generated, it is checked when loot is sent to a player.
- // For items that are lootable, loot is saved to the DB immediately, that means that loot can be
- // saved to the DB that the player never should have gotten. This check prevents that, so that only
- // items that the player should get in loot are in the DB.
- // IE: Horde items are not saved to the DB for Ally players.
- Player* const guid = GetOwner();
- if (!_li->AllowedForPlayer(guid))
- continue;
-
- stmt_items = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEMCONTAINER_ITEMS);
-
- // container_id, item_id, item_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_prop, context, bonus_list_ids
- stmt_items->setUInt64(0, loot.containerID.GetCounter());
- stmt_items->setUInt32(1, _li->itemid);
- stmt_items->setUInt32(2, _li->count);
- stmt_items->setBool(3, _li->follow_loot_rules);
- stmt_items->setBool(4, _li->freeforall);
- stmt_items->setBool(5, _li->is_blocked);
- stmt_items->setBool(6, _li->is_counted);
- stmt_items->setBool(7, _li->is_underthreshold);
- stmt_items->setBool(8, _li->needs_quest);
- stmt_items->setUInt32(9, _li->randomBonusListId);
- stmt_items->setUInt8(10, AsUnderlyingType(_li->context));
- std::ostringstream bonusListIDs;
- for (int32 bonusListID : _li->BonusListIDs)
- bonusListIDs << bonusListID << ' ';
- stmt_items->setString(11, bonusListIDs.str());
- trans->Append(stmt_items);
- }
- }
-
- CharacterDatabase.CommitTransaction(trans);
-}
-
-bool Item::ItemContainerLoadLootFromDB()
-{
- // Loads the money and item loot associated with an openable item from the DB
- // Default. If there are no records for this item then it will be rolled for in Player::SendLoot()
- m_lootGenerated = false;
-
- // Save this for later use
- loot.containerID = GetGUID();
-
- // First, see if there was any money loot. This gets added directly to the container.
- CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEMCONTAINER_MONEY);
- stmt->setUInt64(0, loot.containerID.GetCounter());
- PreparedQueryResult money_result = CharacterDatabase.Query(stmt);
-
- if (money_result)
- {
- Field* fields = money_result->Fetch();
- loot.gold = fields[0].GetUInt32();
- }
-
- // Next, load any items that were saved
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEMCONTAINER_ITEMS);
- stmt->setUInt64(0, loot.containerID.GetCounter());
- PreparedQueryResult item_result = CharacterDatabase.Query(stmt);
-
- if (item_result)
- {
- // Get a LootTemplate for the container item. This is where
- // the saved loot was originally rolled from, we will copy conditions from it
- LootTemplate const* lt = LootTemplates_Item.GetLootFor(GetEntry());
- if (lt)
- {
- do
- {
- // Create an empty LootItem
- LootItem loot_item = LootItem();
-
- // Fill in the rest of the LootItem from the DB
- Field* fields = item_result->Fetch();
-
- // item_id, itm_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_prop, context, bonus_list_ids
- loot_item.itemid = fields[0].GetUInt32();
- loot_item.count = fields[1].GetUInt32();
- loot_item.follow_loot_rules = fields[2].GetBool();
- loot_item.freeforall = fields[3].GetBool();
- loot_item.is_blocked = fields[4].GetBool();
- loot_item.is_counted = fields[5].GetBool();
- loot_item.canSave = true;
- loot_item.is_underthreshold = fields[6].GetBool();
- loot_item.needs_quest = fields[7].GetBool();
- loot_item.randomBonusListId = fields[8].GetUInt32();
- loot_item.context = ItemContext(fields[9].GetUInt8());
- Tokenizer bonusLists(fields[10].GetString(), ' ');
- std::transform(bonusLists.begin(), bonusLists.end(), std::back_inserter(loot_item.BonusListIDs), [](char const* token)
- {
- return int32(strtol(token, NULL, 10));
- });
-
- // Copy the extra loot conditions from the item in the loot template
- lt->CopyConditions(&loot_item);
-
- // If container item is in a bag, add that player as an allowed looter
- if (GetBagSlot())
- loot_item.AddAllowedLooter(GetOwner());
-
- // Finally add the LootItem to the container
- loot.items.push_back(loot_item);
-
- // Increment unlooted count
- loot.unlootedCount++;
-
- }
- while (item_result->NextRow());
- }
- }
-
- // Mark the item if it has loot so it won't be generated again on open
- m_lootGenerated = !loot.isLooted();
-
- return m_lootGenerated;
-}
-
-void Item::ItemContainerDeleteLootItemsFromDB()
-{
- // Deletes items associated with an openable item from the DB
- CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS);
- stmt->setUInt64(0, GetGUID().GetCounter());
- CharacterDatabase.Execute(stmt);
-}
-
-void Item::ItemContainerDeleteLootItemFromDB(uint32 itemID)
-{
- // Deletes a single item associated with an openable item from the DB
- CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEM);
- stmt->setUInt64(0, GetGUID().GetCounter());
- stmt->setUInt32(1, itemID);
- CharacterDatabase.Execute(stmt);
-}
-
-void Item::ItemContainerDeleteLootMoneyFromDB()
-{
- // Deletes the money loot associated with an openable item from the DB
- CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
- stmt->setUInt64(0, GetGUID().GetCounter());
- CharacterDatabase.Execute(stmt);
-}
-
-void Item::ItemContainerDeleteLootMoneyAndLootItemsFromDB()
-{
- // Deletes money and items associated with an openable item from the DB
- ItemContainerDeleteLootMoneyFromDB();
- ItemContainerDeleteLootItemsFromDB();
-}
-
uint32 Item::GetItemLevel(Player const* owner) const
{
ItemTemplate const* itemTemplate = GetTemplate();
diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h
index c4c5ee62d5a..007b9ef46c5 100644
--- a/src/server/game/Entities/Item/Item.h
+++ b/src/server/game/Entities/Item/Item.h
@@ -231,14 +231,6 @@ class TC_GAME_API Item : public Object
virtual void DeleteFromDB(CharacterDatabaseTransaction& trans);
static void DeleteFromInventoryDB(CharacterDatabaseTransaction& trans, ObjectGuid::LowType itemGuid);
- // Lootable items and their contents
- void ItemContainerSaveLootToDB();
- bool ItemContainerLoadLootFromDB();
- void ItemContainerDeleteLootItemsFromDB();
- void ItemContainerDeleteLootItemFromDB(uint32 itemID);
- void ItemContainerDeleteLootMoneyFromDB();
- void ItemContainerDeleteLootMoneyAndLootItemsFromDB();
-
void DeleteFromInventoryDB(CharacterDatabaseTransaction& trans);
void SaveRefundDataToDB();
void DeleteRefundDataFromDB(CharacterDatabaseTransaction* trans);
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index 94fd3e932c8..5e79eb1316c 100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -1889,7 +1889,7 @@ Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint3
//summon->SetName(GetName());
if (GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT)
{
- summon->setFaction(((Unit*)this)->getFaction());
+ summon->SetFaction(((Unit*)this)->GetFaction());
summon->SetLevel(((Unit*)this)->getLevel());
}
diff --git a/src/server/game/Entities/Object/Updates/ViewerDependentValues.h b/src/server/game/Entities/Object/Updates/ViewerDependentValues.h
index 52813dd4c82..1901e5e623d 100644
--- a/src/server/game/Entities/Object/Updates/ViewerDependentValues.h
+++ b/src/server/game/Entities/Object/Updates/ViewerDependentValues.h
@@ -147,7 +147,7 @@ public:
FactionTemplateEntry const* ft2 = receiver->GetFactionTemplateEntry();
if (ft1 && ft2 && !ft1->IsFriendlyTo(ft2))
// pretend that all other HOSTILE players have own faction, to allow follow, heal, rezz (trade wont work)
- factionTemplate = receiver->getFaction();
+ factionTemplate = receiver->GetFaction();
}
return factionTemplate;
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index 9c16502dd25..8852af1be8c 100644
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -186,7 +186,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
PhasingHandler::InheritPhaseShift(this, owner);
setPetType(petType);
- setFaction(owner->getFaction());
+ SetFaction(owner->GetFaction());
SetCreatedBySpell(summonSpellId);
if (IsCritter())
@@ -1676,7 +1676,7 @@ void Pet::CastPetAuras(bool current)
if (!IsPermanentPetFor(owner))
return;
- for (PetAuraSet::const_iterator itr = owner->m_petAuras.begin(); itr != owner->m_petAuras.end();)
+ for (auto itr = owner->m_petAuras.begin(); itr != owner->m_petAuras.end();)
{
PetAura const* pa = *itr;
++itr;
@@ -1708,7 +1708,7 @@ bool Pet::IsPetAura(Aura const* aura)
Player* owner = GetOwner();
// if the owner has that pet aura, return true
- for (PetAuraSet::const_iterator itr = owner->m_petAuras.begin(); itr != owner->m_petAuras.end(); ++itr)
+ for (auto itr = owner->m_petAuras.begin(); itr != owner->m_petAuras.end(); ++itr)
{
if ((*itr)->GetAura(GetEntry()) == aura->GetId())
return true;
diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h
index 2e17b976be6..09a6e0a8afe 100644
--- a/src/server/game/Entities/Pet/Pet.h
+++ b/src/server/game/Entities/Pet/Pet.h
@@ -40,6 +40,7 @@ typedef std::unordered_map<uint32, PetSpell> PetSpellMap;
typedef std::vector<uint32> AutoSpellList;
class Player;
+class PetAura;
class TC_GAME_API Pet : public Guardian
{
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index b932d9e35c4..3dd310f4b52 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -75,6 +75,7 @@
#include "LFGMgr.h"
#include "Language.h"
#include "Log.h"
+#include "LootItemStorage.h"
#include "LootMgr.h"
#include "LootPackets.h"
#include "Mail.h"
@@ -90,6 +91,7 @@
#include "OutdoorPvPMgr.h"
#include "Pet.h"
#include "PetPackets.h"
+#include "PoolMgr.h"
#include "PhasingHandler.h"
#include "QueryCallback.h"
#include "QueryHolder.h"
@@ -2198,13 +2200,13 @@ void Player::SetGameMaster(bool on)
if (on)
{
m_ExtraFlags |= PLAYER_EXTRA_GM_ON;
- setFaction(35);
+ SetFaction(35);
AddPlayerFlag(PLAYER_FLAGS_GM);
AddUnitFlag2(UNIT_FLAG2_ALLOW_CHEAT_SPELLS);
if (Pet* pet = GetPet())
{
- pet->setFaction(35);
+ pet->SetFaction(35);
pet->getHostileRefManager().setOnlineOfflineState(false);
}
@@ -2228,7 +2230,7 @@ void Player::SetGameMaster(bool on)
if (Pet* pet = GetPet())
{
- pet->setFaction(getFaction());
+ pet->SetFaction(GetFaction());
pet->getHostileRefManager().setOnlineOfflineState(true);
}
@@ -2936,7 +2938,7 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent
if (active)
{
- if (spellInfo->IsPassive() && IsNeedCastPassiveSpellAtLearn(spellInfo))
+ if (spellInfo->IsPassive() && HandlePassiveSpellLearn(spellInfo))
CastSpell(this, spellId, true);
}
else if (IsInWorld())
@@ -3063,7 +3065,7 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent
// also cast passive spells (including all talents without SPELL_EFFECT_LEARN_SPELL) with additional checks
else if (spellInfo->IsPassive())
{
- if (IsNeedCastPassiveSpellAtLearn(spellInfo))
+ if (HandlePassiveSpellLearn(spellInfo))
CastSpell(this, spellId, true);
}
else if (spellInfo->HasEffect(SPELL_EFFECT_SKILL_STEP))
@@ -3194,7 +3196,7 @@ void Player::RemoveTemporarySpell(uint32 spellId)
m_spells.erase(itr);
}
-bool Player::IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const
+bool Player::HandlePassiveSpellLearn(SpellInfo const* spellInfo)
{
// note: form passives activated with shapeshift spells be implemented by HandleShapeshiftBoosts instead of spell_learn_spell
// talent dependent passives activated at form apply have proper stance data
@@ -3206,12 +3208,16 @@ bool Player::IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const
need_cast &= IsCurrentSpecMasterySpell(spellInfo);
// Check EquippedItemClass
- // passive spells which apply aura and have an item requirement are to be added in Player::ApplyItemDependentAuras
- if (spellInfo->IsPassive() && spellInfo->EquippedItemClass >= 0)
+ // passive spells which apply aura and have an item requirement are to be added manually, instead of casted
+ if (spellInfo->EquippedItemClass >= 0)
{
for (SpellEffectInfo const* effectInfo : spellInfo->GetEffectsForDifficulty(DIFFICULTY_NONE))
if (effectInfo && effectInfo->IsAura())
+ {
+ if (!HasAura(spellInfo->Id) && HasItemFitToSpellRequirements(spellInfo))
+ AddAura(spellInfo->Id, this);
return false;
+ }
}
//Check CasterAuraStates
@@ -6292,7 +6298,7 @@ void Player::setFactionForRace(uint8 race)
m_team = TeamForRace(race);
ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race);
- setFaction(rEntry ? rEntry->FactionID : 0);
+ SetFaction(rEntry ? rEntry->FactionID : 0);
}
ReputationRank Player::GetReputationRank(uint32 faction) const
@@ -6415,8 +6421,8 @@ void Player::RewardReputation(Unit* victim, float rate)
FactionEntry const* factionEntry1 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->RepFaction1);
uint32 current_reputation_rank1 = GetReputationMgr().GetRank(factionEntry1);
- if (factionEntry1 && current_reputation_rank1 <= Rep->ReputationMaxCap1)
- GetReputationMgr().ModifyReputation(factionEntry1, donerep1);
+ if (factionEntry1)
+ GetReputationMgr().ModifyReputation(factionEntry1, donerep1, current_reputation_rank1 > Rep->ReputationMaxCap1);
}
if (Rep->RepFaction2 && (!Rep->TeamDependent || team == HORDE))
@@ -6426,8 +6432,8 @@ void Player::RewardReputation(Unit* victim, float rate)
FactionEntry const* factionEntry2 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->RepFaction2);
uint32 current_reputation_rank2 = GetReputationMgr().GetRank(factionEntry2);
- if (factionEntry2 && current_reputation_rank2 <= Rep->ReputationMaxCap2)
- GetReputationMgr().ModifyReputation(factionEntry2, donerep2);
+ if (factionEntry2)
+ GetReputationMgr().ModifyReputation(factionEntry2, donerep2, current_reputation_rank2 > Rep->ReputationMaxCap2);
}
}
@@ -6479,7 +6485,7 @@ void Player::RewardReputation(Quest const* quest)
rep = CalculateReputationGain(REPUTATION_SOURCE_QUEST, GetQuestLevel(quest), rep, quest->RewardFactionId[i], noQuestBonus);
bool noSpillover = (quest->GetRewardReputationMask() & (1 << i)) != 0;
- GetReputationMgr().ModifyReputation(factionEntry, rep, noSpillover);
+ GetReputationMgr().ModifyReputation(factionEntry, rep, false, noSpillover);
}
}
@@ -6937,7 +6943,7 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo
{
if (currency->Flags & CURRENCY_FLAG_HIGH_PRECISION)
count /= 100;
- GetReputationMgr().ModifyReputation(factionEntry, count, true);
+ GetReputationMgr().ModifyReputation(factionEntry, count, false, true);
return;
}
@@ -8834,9 +8840,12 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type, bool aeLooting/* = fa
loot = &item->loot;
+ // Store container id
+ loot->containerID = item->GetGUID();
+
// If item doesn't already have loot, attempt to load it. If that
- // fails then this is first time opening, generate loot
- if (!item->m_lootGenerated && !item->ItemContainerLoadLootFromDB())
+ // fails then this is first time opening, generate loot
+ if (!item->m_lootGenerated && !sLootItemStorage->LoadStoredLoot(item, this))
{
item->m_lootGenerated = true;
loot->clear();
@@ -8859,7 +8868,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type, bool aeLooting/* = fa
// Force save the loot and money items that were just rolled
// Also saves the container item ID in Loot struct (not to DB)
if (loot->gold > 0 || loot->unlootedCount > 0)
- item->ItemContainerSaveLootToDB();
+ sLootItemStorage->AddNewStoredLoot(loot, this);
break;
}
@@ -12799,6 +12808,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount());
sScriptMgr->OnItemRemove(this, pItem);
+ ItemTemplate const* pProto = pItem->GetTemplate();
if (bag == INVENTORY_SLOT_BAG_0)
{
SetInvSlot(slot, ObjectGuid::Empty);
@@ -12806,10 +12816,8 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
// equipment and equipped bags can have applied bonuses
if (slot < INVENTORY_SLOT_BAG_END)
{
- ItemTemplate const* pProto = pItem->GetTemplate();
-
// item set bonuses applied only at equip and removed at unequip, and still active for broken items
- if (pProto && pProto->GetItemSet())
+ if (pProto->GetItemSet())
RemoveItemsSetItem(this, pProto);
_ApplyItemMods(pItem, slot, false);
@@ -12843,9 +12851,8 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
// Delete rolled money / loot from db.
// MUST be done before RemoveFromWorld() or GetTemplate() fails
- if (ItemTemplate const* pTmp = pItem->GetTemplate())
- if (pTmp->GetFlags() & ITEM_FLAG_HAS_LOOT)
- pItem->ItemContainerDeleteLootMoneyAndLootItemsFromDB();
+ if (pProto->GetFlags() & ITEM_FLAG_HAS_LOOT)
+ sLootItemStorage->RemoveStoredLootForContainer(pItem->GetGUID().GetCounter());
if (IsInWorld() && update)
{
@@ -13762,7 +13769,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
{
if (Item* bagItem = bag->GetItemByPos(i))
{
- if (bagItem->m_lootGenerated)
+ if (bagItem->GetGUID() == GetLootGUID())
{
m_session->DoLootRelease(GetLootGUID());
released = true; // so we don't need to look at dstBag
@@ -13779,7 +13786,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
{
if (Item* bagItem = bag->GetItemByPos(i))
{
- if (bagItem->m_lootGenerated)
+ if (bagItem->GetGUID() == GetLootGUID())
{
m_session->DoLootRelease(GetLootGUID());
break;
@@ -13868,7 +13875,13 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del)
{
pItem->RemoveFromWorld();
if (del)
+ {
+ if (ItemTemplate const* itemTemplate = pItem->GetTemplate())
+ if (itemTemplate->GetFlags() & ITEM_FLAG_HAS_LOOT)
+ sLootItemStorage->RemoveStoredLootForContainer(pItem->GetGUID().GetCounter());
+
pItem->SetState(ITEM_REMOVED, this);
+ }
}
m_items[slot] = nullptr;
@@ -15204,8 +15217,8 @@ bool Player::CanSeeStartQuest(Quest const* quest)
{
if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this) && SatisfyQuestClass(quest, false) && SatisfyQuestRace(quest, false) &&
SatisfyQuestSkill(quest, false) && SatisfyQuestExclusiveGroup(quest, false) && SatisfyQuestReputation(quest, false) &&
- SatisfyQuestDependentQuests(quest, false) && SatisfyQuestNextChain(quest, false) &&
- SatisfyQuestPrevChain(quest, false) && SatisfyQuestDay(quest, false) && SatisfyQuestWeek(quest, false) &&
+ SatisfyQuestDependentQuests(quest, false) &&
+ SatisfyQuestDay(quest, false) && SatisfyQuestWeek(quest, false) &&
SatisfyQuestMonth(quest, false) && SatisfyQuestSeasonal(quest, false))
{
return int32(getLevel() + sWorld->getIntConfig(CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF)) >= GetQuestMinLevel(quest);
@@ -15221,7 +15234,6 @@ bool Player::CanTakeQuest(Quest const* quest, bool msg)
&& SatisfyQuestClass(quest, msg) && SatisfyQuestRace(quest, msg) && SatisfyQuestLevel(quest, msg)
&& SatisfyQuestSkill(quest, msg) && SatisfyQuestReputation(quest, msg)
&& SatisfyQuestDependentQuests(quest, msg) && SatisfyQuestTimed(quest, msg)
- && SatisfyQuestNextChain(quest, msg) && SatisfyQuestPrevChain(quest, msg)
&& SatisfyQuestDay(quest, msg) && SatisfyQuestWeek(quest, msg)
&& SatisfyQuestMonth(quest, msg) && SatisfyQuestSeasonal(quest, msg)
&& SatisfyQuestConditions(quest, msg);
@@ -15259,7 +15271,7 @@ bool Player::CanCompleteQuest(uint32 quest_id)
if (!qInfo)
return false;
- if (!qInfo->IsRepeatable() && m_RewardedQuests.find(quest_id) != m_RewardedQuests.end())
+ if (!qInfo->IsRepeatable() && GetQuestRewardStatus(quest_id))
return false; // not allow re-complete quest
// auto complete quest
@@ -15652,10 +15664,10 @@ uint32 Player::GetQuestMoneyReward(Quest const* quest) const
uint32 Player::GetQuestXPReward(Quest const* quest)
{
- bool rewarded = (m_RewardedQuests.find(quest->GetQuestId()) != m_RewardedQuests.end());
+ bool rewarded = IsQuestRewarded(quest->GetQuestId()) && !quest->IsDFQuest();
// Not give XP in case already completed once repeatable quest
- if (rewarded && !quest->IsDFQuest())
+ if (rewarded)
return 0;
uint32 XP = quest->XPValue(this) * sWorld->getRate(RATE_XP_QUEST);
@@ -15807,7 +15819,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
SendNewItem(item, quest->RewardItemCount[i], true, false);
}
else if (quest->IsDFQuest())
- SendItemRetrievalMail(quest->RewardItemId[i], quest->RewardItemCount[i], ItemContext::Quest_Reward);
+ SendItemRetrievalMail(itemId, quest->RewardItemCount[i], ItemContext::Quest_Reward);
}
}
}
@@ -15886,12 +15898,6 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
if (quest->CanIncreaseRewardedQuestCounters())
SetRewardedQuest(quest_id);
- // StoreNewItem, mail reward, etc. save data directly to the database
- // to prevent exploitable data desynchronisation we save the quest status to the database too
- // (to prevent rewarding this quest another time while rewards were already given out)
- CharacterDatabaseTransaction trans = CharacterDatabaseTransaction(nullptr);
- _SaveQuestStatus(trans);
-
SendQuestReward(quest, questGiver ? questGiver->ToCreature() : nullptr, XP, !announce);
// cast spells after mark quest complete (some spells have quest completed state requirements in spell_area data)
@@ -15927,6 +15933,9 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
UpdateCriteria(CRITERIA_TYPE_COMPLETE_QUEST_COUNT);
UpdateCriteria(CRITERIA_TYPE_COMPLETE_QUEST, quest->GetQuestId());
+ // make full db save
+ SaveToDB(false);
+
if (uint32 questBit = sDB2Manager.GetQuestUniqueBitFlag(quest_id))
SetQuestCompletedBit(questBit, true);
@@ -15957,13 +15966,15 @@ void Player::FailQuest(uint32 questId)
{
if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
{
- // Already complete quests shouldn't turn failed.
- if (GetQuestStatus(questId) == QUEST_STATUS_COMPLETE && !quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED))
- return;
+ QuestStatus qStatus = GetQuestStatus(questId);
- // You can't fail a quest if you don't have it, or if it's already rewarded.
- if (GetQuestStatus(questId) == QUEST_STATUS_NONE || GetQuestStatus(questId) == QUEST_STATUS_REWARDED)
- return;
+ // we can only fail incomplete quest or...
+ if (qStatus != QUEST_STATUS_INCOMPLETE)
+ {
+ // completed timed quest with no requirements
+ if (qStatus != QUEST_STATUS_COMPLETE || !quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED) || !quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_COMPLETED_AT_START))
+ return;
+ }
SetQuestStatus(questId, QUEST_STATUS_FAILED);
@@ -16344,7 +16355,7 @@ bool Player::SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg) const
}
// 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()) && GetQuestRewardStatus(exclude_Id)))
{
if (msg)
{
@@ -16358,62 +16369,6 @@ bool Player::SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg) const
return true;
}
-bool Player::SatisfyQuestNextChain(Quest const* qInfo, bool msg) const
-{
- uint32 nextQuest = qInfo->GetNextQuestInChain();
- if (!nextQuest)
- return true;
-
- // next quest in chain already started or completed
- if (GetQuestStatus(nextQuest) != QUEST_STATUS_NONE) // GetQuestStatus returns QUEST_STATUS_COMPLETED for rewarded quests
- {
- if (msg)
- {
- SendCanTakeQuestResponse(QUEST_ERR_NONE);
- TC_LOG_DEBUG("misc", "Player::SatisfyQuestNextChain: Sent QUEST_ERR_NONE (QuestID: %u) because player '%s' (%s) already did or started next quest in chain.",
- qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
- }
- return false;
- }
-
- // check for all quests further up the chain
- // only necessary if there are quest chains with more than one quest that can be skipped
- //return SatisfyQuestNextChain(qInfo->GetNextQuestInChain(), msg);
- return true;
-}
-
-bool Player::SatisfyQuestPrevChain(Quest const* qInfo, bool msg)
-{
- // No previous quest in chain
- if (qInfo->PrevChainQuests.empty())
- return true;
-
- for (uint32 prevQuestId : qInfo->PrevChainQuests)
- {
- auto itr = m_QuestStatus.find(prevQuestId);
-
- // If any of the previous quests in chain active, return false
- if (itr != m_QuestStatus.end() && itr->second.Status != QUEST_STATUS_NONE)
- {
- if (msg)
- {
- SendCanTakeQuestResponse(QUEST_ERR_NONE);
- TC_LOG_DEBUG("misc", "Player::SatisfyQuestNextChain: Sent QUEST_ERR_NONE (QuestID: %u) because player '%s' (%s) already did or started next quest in chain.",
- qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
- }
- return false;
- }
-
- // check for all quests further down the chain
- // only necessary if there are quest chains with more than one quest that can be skipped
- //if (!SatisfyQuestPrevChain(prevId, msg))
- // return false;
- }
-
- // No previous quest in chain active
- return true;
-}
-
bool Player::SatisfyQuestDay(Quest const* qInfo, bool /*msg*/) const
{
if (!qInfo->IsDaily() && !qInfo->IsDFQuest())
@@ -16541,7 +16496,7 @@ bool Player::GetQuestRewardStatus(uint32 quest_id) const
// for repeatable quests: rewarded field is set after first reward only to prevent getting XP more than once
if (!qInfo->IsRepeatable())
- return m_RewardedQuests.find(quest_id) != m_RewardedQuests.end();
+ return IsQuestRewarded(quest_id);
return false;
}
@@ -16556,14 +16511,8 @@ QuestStatus Player::GetQuestStatus(uint32 quest_id) const
if (itr != m_QuestStatus.end())
return itr->second.Status;
- if (Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id))
- {
- if (qInfo->IsSeasonal() && !qInfo->IsRepeatable())
- return SatisfyQuestSeasonal(qInfo, false) ? QUEST_STATUS_NONE : QUEST_STATUS_REWARDED;
-
- if (!qInfo->IsRepeatable() && IsQuestRewarded(quest_id))
- return QUEST_STATUS_REWARDED;
- }
+ if (GetQuestRewardStatus(quest_id))
+ return QUEST_STATUS_REWARDED;
}
return QUEST_STATUS_NONE;
}
@@ -16571,7 +16520,22 @@ QuestStatus Player::GetQuestStatus(uint32 quest_id) const
bool Player::CanShareQuest(uint32 quest_id) const
{
Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id);
- return qInfo && qInfo->HasFlag(QUEST_FLAGS_SHARABLE) && IsActiveQuest(quest_id);
+ if (qInfo && qInfo->HasFlag(QUEST_FLAGS_SHARABLE))
+ {
+ QuestStatusMap::const_iterator itr = m_QuestStatus.find(quest_id);
+ if (itr != m_QuestStatus.end())
+ {
+ // in pool and not currently available (wintergrasp weekly, dalaran weekly) - can't share
+ if (sPoolMgr->IsPartOfAPool<Quest>(quest_id) && !sPoolMgr->IsSpawnedObject<Quest>(quest_id))
+ {
+ SendPushToPartyResponse(this, QUEST_PUSH_NOT_DAILY);
+ return false;
+ }
+
+ return true;
+ }
+ }
+ return false;
}
void Player::SetQuestStatus(uint32 questId, QuestStatus status, bool update /*= true*/)
@@ -16617,6 +16581,18 @@ void Player::RemoveRewardedQuest(uint32 questId, bool update /*= true*/)
if (uint32 questBit = sDB2Manager.GetQuestUniqueBitFlag(questId))
SetQuestCompletedBit(questBit, false);
+ // Remove seasonal quest also
+ Quest const* qInfo = sObjectMgr->GetQuestTemplate(questId);
+ if (qInfo->IsSeasonal())
+ {
+ uint16 eventId = qInfo->GetEventIdForQuest();
+ if (m_seasonalquests.find(eventId) != m_seasonalquests.end())
+ {
+ m_seasonalquests[eventId].erase(questId);
+ m_SeasonalQuestChanged = true;
+ }
+ }
+
if (update)
SendQuestUpdate(questId);
}
@@ -16875,8 +16851,10 @@ void Player::AreaExploredOrEventHappens(uint32 questId)
{
q_status.Explored = true;
m_QuestStatusSave[questId] = QUEST_DEFAULT_SAVE_TYPE;
- SetQuestSlotState(log_slot, QUEST_STATE_COMPLETE);
- SendQuestComplete(questId);
+
+ // if we cannot complete quest send exploration succeded (to mark exploration on client)
+ if (!CanCompleteQuest(questId))
+ SendQuestComplete(questId);
}**/
}
if (CanCompleteQuest(questId))
@@ -17651,7 +17629,7 @@ void Player::SendQuestConfirmAccept(Quest const* quest, Player* receiver) const
receiver->GetSession()->SendPacket(packet.Write());
}
-void Player::SendPushToPartyResponse(Player* player, QuestPushReason reason) const
+void Player::SendPushToPartyResponse(Player const* player, QuestPushReason reason) const
{
if (player)
{
@@ -19840,7 +19818,8 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
Group* group = GetGroup();
- //QueryResult* result = CharacterDatabase.PQuery("SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", GUID_LOPART(m_guid));
+ // 0 1 2 3 4 5 6
+ // SELECT id, permanent, map, difficulty, extendState, resettime, entranceId FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?
if (result)
{
do
@@ -19853,7 +19832,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
uint8 difficulty = fields[3].GetUInt8();
BindExtensionState extendState = BindExtensionState(fields[4].GetUInt8());
- time_t resetTime = time_t(fields[5].GetUInt32());
+ time_t resetTime = time_t(fields[5].GetUInt64());
// the resettime for normal instances is only saved when the InstanceSave is unloaded
// 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
@@ -20874,12 +20853,25 @@ void Player::_SaveInventory(CharacterDatabaseTransaction& trans)
for (uint8 i = BUYBACK_SLOT_START; i < BUYBACK_SLOT_END; ++i)
{
Item* item = m_items[i];
- if (!item || item->GetState() == ITEM_NEW)
+ if (!item)
+ continue;
+
+ if (item->GetState() == ITEM_NEW)
+ {
+ if (ItemTemplate const* itemTemplate = item->GetTemplate())
+ if (itemTemplate->GetFlags() & ITEM_FLAG_HAS_LOOT)
+ sLootItemStorage->RemoveStoredLootForContainer(item->GetGUID().GetCounter());
+
continue;
+ }
item->DeleteFromInventoryDB(trans);
item->DeleteFromDB(trans);
m_items[i]->FSetState(ITEM_NEW);
+
+ if (ItemTemplate const* itemTemplate = item->GetTemplate())
+ if (itemTemplate->GetFlags() & ITEM_FLAG_HAS_LOOT)
+ sLootItemStorage->RemoveStoredLootForContainer(item->GetGUID().GetCounter());
}
// Updated played time for refundable items. We don't do this in Player::Update because there's simply no need for it,
@@ -21275,7 +21267,7 @@ void Player::_SaveWeeklyQuestStatus(CharacterDatabaseTransaction& trans)
void Player::_SaveSeasonalQuestStatus(CharacterDatabaseTransaction& trans)
{
- if (!m_SeasonalQuestChanged || m_seasonalquests.empty())
+ if (!m_SeasonalQuestChanged)
return;
// we don't need transactions here.
@@ -21283,6 +21275,11 @@ void Player::_SaveSeasonalQuestStatus(CharacterDatabaseTransaction& trans)
stmt->setUInt64(0, GetGUID().GetCounter());
trans->Append(stmt);
+ m_SeasonalQuestChanged = false;
+
+ if (m_seasonalquests.empty())
+ return;
+
for (SeasonalEventQuestMap::const_iterator iter = m_seasonalquests.begin(); iter != m_seasonalquests.end(); ++iter)
{
uint16 eventId = iter->first;
@@ -21298,8 +21295,6 @@ void Player::_SaveSeasonalQuestStatus(CharacterDatabaseTransaction& trans)
trans->Append(stmt);
}
}
-
- m_SeasonalQuestChanged = false;
}
void Player::_SaveMonthlyQuestStatus(CharacterDatabaseTransaction& trans)
@@ -21401,13 +21396,14 @@ void Player::_SaveSpells(CharacterDatabaseTransaction& trans)
if (itr->second->state == PLAYERSPELL_REMOVED)
{
delete itr->second;
- m_spells.erase(itr++);
+ itr = m_spells.erase(itr);
+ continue;
}
- else
- {
+
+ if (itr->second->state != PLAYERSPELL_TEMPORARY)
itr->second->state = PLAYERSPELL_UNCHANGED;
- ++itr;
- }
+
+ ++itr;
}
}
@@ -21838,6 +21834,20 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
}
}
+void Player::AddPetAura(PetAura const* petSpell)
+{
+ m_petAuras.insert(petSpell);
+ if (Pet* pet = GetPet())
+ pet->CastPetAura(petSpell);
+}
+
+void Player::RemovePetAura(PetAura const* petSpell)
+{
+ m_petAuras.erase(petSpell);
+ if (Pet* pet = GetPet())
+ pet->RemoveAurasDueToSpell(petSpell->GetAura(pet->GetEntry()));
+}
+
void Player::StopCastingCharm()
{
Unit* charm = GetCharm();
@@ -22622,7 +22632,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
float discount = GetReputationPriceDiscount(npc);
totalcost = uint32(ceil(totalcost * discount));
firstcost = uint32(ceil(firstcost * discount));
- m_taxi.SetFlightMasterFactionTemplateId(npc->getFaction());
+ m_taxi.SetFlightMasterFactionTemplateId(npc->GetFaction());
}
else
m_taxi.SetFlightMasterFactionTemplateId(0);
@@ -26225,7 +26235,7 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot, AELootResult* aeResult/*
// LootItem is being removed (looted) from the container, delete it from the DB.
if (!loot->containerID.IsEmpty())
- loot->DeleteLootItemFromContainerItemDB(item->itemid);
+ sLootItemStorage->RemoveStoredLootItemForContainer(loot->containerID.GetCounter(), item->itemid, item->count);
}
else
SendEquipError(msg, nullptr, nullptr, item->itemid);
@@ -28217,7 +28227,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
PhasingHandler::InheritPhaseShift(pet, this);
pet->SetCreatorGUID(GetGUID());
- pet->setFaction(getFaction());
+ pet->SetFaction(GetFaction());
pet->SetNpcFlags(UNIT_NPC_FLAG_NONE);
pet->SetNpcFlags2(UNIT_NPC_FLAG_2_NONE);
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 0eacdb13fe1..dafedb22e77 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -78,6 +78,7 @@ class Item;
class LootStore;
class OutdoorPvP;
class Pet;
+class PetAura;
class PlayerAI;
class PlayerAchievementMgr;
class PlayerMenu;
@@ -1097,6 +1098,11 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
Pet* SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, uint32 despwtime);
void RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent = false);
+ // pet auras
+ std::unordered_set<PetAura const*> m_petAuras;
+ void AddPetAura(PetAura const* petSpell);
+ void RemovePetAura(PetAura const* petSpell);
+
/// Handles said message in regular chat based on declared language and in config pre-defined Range.
void Say(std::string const& text, Language language, WorldObject const* = nullptr) override;
void Say(uint32 textId, WorldObject const* target = nullptr) override;
@@ -1352,8 +1358,6 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
bool SatisfyQuestConditions(Quest const* qInfo, bool msg);
bool SatisfyQuestTimed(Quest const* qInfo, bool msg) const;
bool SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg) const;
- bool SatisfyQuestNextChain(Quest const* qInfo, bool msg) const;
- bool SatisfyQuestPrevChain(Quest const* qInfo, bool msg);
bool SatisfyQuestDay(Quest const* qInfo, bool msg) const;
bool SatisfyQuestWeek(Quest const* qInfo, bool msg) const;
bool SatisfyQuestMonth(Quest const* qInfo, bool msg) const;
@@ -1419,7 +1423,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
void SendQuestTimerFailed(uint32 questID) const;
void SendCanTakeQuestResponse(QuestFailedReason reason, bool sendErrorMessage = true, std::string reasonText = "") const;
void SendQuestConfirmAccept(Quest const* quest, Player* receiver) const;
- void SendPushToPartyResponse(Player* player, QuestPushReason reason) const;
+ void SendPushToPartyResponse(Player const* player, QuestPushReason reason) const;
void SendQuestUpdateAddCredit(Quest const* quest, ObjectGuid guid, QuestObjective const& obj, uint16 count) const;
void SendQuestUpdateAddCreditSimple(QuestObjective const& obj) const;
void SendQuestUpdateAddPlayer(Quest const* quest, uint16 newCount) const;
@@ -1556,7 +1560,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
bool HasActiveSpell(uint32 spell) const; // show in spellbook
SpellInfo const* GetCastSpellInfo(SpellInfo const* spellInfo) const override;
bool IsSpellFitByClassAndRace(uint32 spell_id) const;
- bool IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const;
+ bool HandlePassiveSpellLearn(SpellInfo const* spellInfo);
bool IsCurrentSpecMasterySpell(SpellInfo const* spellInfo) const;
void SendProficiency(ItemClass itemClass, uint32 itemSubclassMask) const;
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
index 2170ba4d7c7..88fb805a71d 100644
--- a/src/server/game/Entities/Unit/StatSystem.cpp
+++ b/src/server/game/Entities/Unit/StatSystem.cpp
@@ -577,7 +577,7 @@ void Player::UpdateHealingDonePercentMod()
SetUpdateFieldStatValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::ModHealingDonePercent), value);
}
-const float m_diminishing_k[MAX_CLASSES] =
+float const m_diminishing_k[MAX_CLASSES] =
{
0.9560f, // Warrior
0.9560f, // Paladin
@@ -593,27 +593,50 @@ const float m_diminishing_k[MAX_CLASSES] =
0.9830f // Demon Hunter
};
-void Player::UpdateParryPercentage()
+// helper function
+float CalculateDiminishingReturns(float const (&capArray)[MAX_CLASSES], uint8 playerClass, float nonDiminishValue, float diminishValue)
{
- const float parry_cap[MAX_CLASSES] =
- {
- 65.631440f, // Warrior
- 65.631440f, // Paladin
- 145.560408f, // Hunter
- 145.560408f, // Rogue
- 0.0f, // Priest
- 65.631440f, // DK
- 145.560408f, // Shaman
- 0.0f, // Mage
- 0.0f, // Warlock
- 90.6425f, // Monk
- 0.0f, // Druid
- 65.631440f // Demon Hunter
- };
+ // 1 1 k cx
+ // --- = --- + --- <=> x' = --------
+ // x' c x x + ck
+
+ // where:
+ // k is m_diminishing_k for that class
+ // c is capArray for that class
+ // x is chance before DR (diminishValue)
+ // x' is chance after DR (our result)
+
+ uint32 const classIdx = playerClass - 1;
+
+ float const k = m_diminishing_k[classIdx];
+ float const c = capArray[classIdx];
+
+ float result = c * diminishValue / (diminishValue + c * k);
+ result += nonDiminishValue;
+ return result;
+}
+
+float const parry_cap[MAX_CLASSES] =
+{
+ 65.631440f, // Warrior
+ 65.631440f, // Paladin
+ 145.560408f, // Hunter
+ 145.560408f, // Rogue
+ 0.0f, // Priest
+ 65.631440f, // DK
+ 145.560408f, // Shaman
+ 0.0f, // Mage
+ 0.0f, // Warlock
+ 90.6425f, // Monk
+ 0.0f, // Druid
+ 65.631440f // Demon Hunter
+};
+void Player::UpdateParryPercentage()
+{
// No parry
float value = 0.0f;
- uint32 pclass = getClass()-1;
+ uint32 pclass = getClass() - 1;
if (CanParry() && parry_cap[pclass] > 0.0f)
{
float nondiminishing = 5.0f;
@@ -621,8 +644,9 @@ void Player::UpdateParryPercentage()
float diminishing = GetRatingBonusValue(CR_PARRY);
// Parry from SPELL_AURA_MOD_PARRY_PERCENT aura
nondiminishing += GetTotalAuraModifier(SPELL_AURA_MOD_PARRY_PERCENT);
+
// apply diminishing formula to diminishing parry chance
- value = nondiminishing + diminishing * parry_cap[pclass] / (diminishing + parry_cap[pclass] * m_diminishing_k[pclass]);
+ value = CalculateDiminishingReturns(parry_cap, getClass(), nondiminishing, diminishing);
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_PARRY) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_PARRY) : value;
@@ -631,33 +655,33 @@ void Player::UpdateParryPercentage()
SetUpdateFieldStatValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::ParryPercentage), value);
}
-void Player::UpdateDodgePercentage()
+float const dodge_cap[MAX_CLASSES] =
{
- const float dodge_cap[MAX_CLASSES] =
- {
- 65.631440f, // Warrior
- 65.631440f, // Paladin
- 145.560408f, // Hunter
- 145.560408f, // Rogue
- 150.375940f, // Priest
- 65.631440f, // DK
- 145.560408f, // Shaman
- 150.375940f, // Mage
- 150.375940f, // Warlock
- 145.560408f, // Monk
- 116.890707f, // Druid
- 145.560408f // Demon Hunter
- };
+ 65.631440f, // Warrior
+ 65.631440f, // Paladin
+ 145.560408f, // Hunter
+ 145.560408f, // Rogue
+ 150.375940f, // Priest
+ 65.631440f, // DK
+ 145.560408f, // Shaman
+ 150.375940f, // Mage
+ 150.375940f, // Warlock
+ 145.560408f, // Monk
+ 116.890707f, // Druid
+ 145.560408f // Demon Hunter
+};
+void Player::UpdateDodgePercentage()
+{
float diminishing = 0.0f, nondiminishing = 0.0f;
GetDodgeFromAgility(diminishing, nondiminishing);
// Dodge from SPELL_AURA_MOD_DODGE_PERCENT aura
nondiminishing += GetTotalAuraModifier(SPELL_AURA_MOD_DODGE_PERCENT);
// Dodge from rating
diminishing += GetRatingBonusValue(CR_DODGE);
+
// apply diminishing formula to diminishing dodge chance
- uint32 pclass = getClass()-1;
- float value = nondiminishing + (diminishing * dodge_cap[pclass] / (diminishing + dodge_cap[pclass] * m_diminishing_k[pclass]));
+ float value = CalculateDiminishingReturns(dodge_cap, getClass(), nondiminishing, diminishing);
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) : value;
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 0f809261bc0..ad69398d494 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -285,12 +285,12 @@ SpellNonMeleeDamage::SpellNonMeleeDamage(Unit* _attacker, Unit* _target, uint32
}
Unit::Unit(bool isWorldObject) :
- WorldObject(isWorldObject), m_playerMovingMe(NULL), m_lastSanctuaryTime(0),
+ WorldObject(isWorldObject), m_playerMovingMe(nullptr), m_lastSanctuaryTime(0),
IsAIEnabled(false), NeedChangeAI(false), LastCharmerGUID(),
m_ControlledByPlayer(false), movespline(new Movement::MoveSpline()),
- i_AI(NULL), i_disabledAI(NULL), m_AutoRepeatFirstCast(false), m_procDeep(0),
+ i_AI(nullptr), i_disabledAI(nullptr), m_AutoRepeatFirstCast(false), m_procDeep(0),
m_removedAurasCount(0), i_motionMaster(new MotionMaster(this)), m_regenTimer(0), m_ThreatManager(this),
- m_vehicle(NULL), m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE),
+ m_vehicle(nullptr), m_vehicleKit(nullptr), m_unitTypeMask(UNIT_MASK_NONE),
m_HostileRefManager(this), _aiAnimKitId(0), _movementAnimKitId(0), _meleeAnimKitId(0),
_spellHistory(new SpellHistory(this))
{
@@ -389,10 +389,11 @@ Unit::Unit(bool isWorldObject) :
m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE);
- _lastLiquid = NULL;
+ _lastLiquid = nullptr;
_oldFactionId = 0;
_isWalkingBeforeCharm = false;
+ _instantCast = false;
}
////////////////////////////////////////////////////////////
@@ -1474,27 +1475,22 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
GetTypeId() != TYPEID_PLAYER && !ToCreature()->IsControlledByPlayer() && !victim->HasInArc(float(M_PI), this)
&& (victim->GetTypeId() == TYPEID_PLAYER || !victim->ToCreature()->isWorldBoss())&& !victim->IsVehicle())
{
- // -probability is between 0% and 40%
// 20% base chance
- float Probability = 20.0f;
+ float chance = 20.0f;
// there is a newbie protection, at level 10 just 7% base chance; assuming linear function
if (victim->getLevel() < 30)
- Probability = 0.65f * victim->GetLevelForTarget(this) + 0.5f;
-
- uint32 VictimDefense = victim->GetMaxSkillValueForLevel(this);
- uint32 AttackerMeleeSkill = GetMaxSkillValueForLevel();
-
- Probability *= AttackerMeleeSkill/(float)VictimDefense*0.16f;
+ chance = 0.65f * victim->GetLevelForTarget(this) + 0.5f;
- if (Probability < 0)
- Probability = 0;
+ uint32 const victimDefense = victim->GetMaxSkillValueForLevel(this);
+ uint32 const attackerMeleeSkill = GetMaxSkillValueForLevel();
- if (Probability > 40.0f)
- Probability = 40.0f;
+ chance *= attackerMeleeSkill / float(victimDefense) * 0.16f;
- if (roll_chance_f(Probability))
- CastSpell(victim, 1604, true);
+ // -probability is between 0% and 40%
+ RoundToInterval(chance, 0.0f, 40.0f);
+ if (roll_chance_f(chance))
+ CastSpell(victim, 1604 /*SPELL_DAZED*/, true);
}
if (GetTypeId() == TYPEID_PLAYER)
@@ -1676,31 +1672,30 @@ uint32 Unit::CalcSpellResistedDamage(Unit* attacker, Unit* victim, uint32 damage
return 0;
}
- float averageResist = GetEffectiveResistChance(this, schoolMask, victim, spellInfo);
-
- float discreteResistProbability[11];
- for (uint32 i = 0; i < 11; ++i)
- {
- discreteResistProbability[i] = 0.5f - 2.5f * std::fabs(0.1f * i - averageResist);
- if (discreteResistProbability[i] < 0.0f)
- discreteResistProbability[i] = 0.0f;
- }
+ float const averageResist = CalculateAverageResistReduction(schoolMask, victim, spellInfo);
+ float discreteResistProbability[11] = { };
if (averageResist <= 0.1f)
{
discreteResistProbability[0] = 1.0f - 7.5f * averageResist;
discreteResistProbability[1] = 5.0f * averageResist;
discreteResistProbability[2] = 2.5f * averageResist;
}
+ else
+ {
+ for (uint32 i = 0; i < 11; ++i)
+ discreteResistProbability[i] = std::max(0.5f - 2.5f * std::fabs(0.1f * i - averageResist), 0.0f);
+ }
- uint32 resistance = 0;
- float r = float(rand_norm());
- float probabilitySum = discreteResistProbability[0];
+ float roll = float(rand_norm());
+ float probabilitySum = 0.0f;
- while (r >= probabilitySum && resistance < 10)
- probabilitySum += discreteResistProbability[++resistance];
+ uint32 resistance = 0;
+ for (; resistance < 11; ++resistance)
+ if (roll < (probabilitySum += discreteResistProbability[resistance]))
+ break;
- float damageResisted = float(damage * resistance / 10);
+ float damageResisted = damage * resistance / 10.f;
if (damageResisted > 0.0f) // if any damage was resisted
{
int32 ignoredResistance = 0;
@@ -1714,31 +1709,31 @@ uint32 Unit::CalcSpellResistedDamage(Unit* attacker, Unit* victim, uint32 damage
if (spellInfo && spellInfo->HasAttribute(SPELL_ATTR0_CU_SCHOOLMASK_NORMAL_WITH_MAGIC))
{
uint32 damageAfterArmor = CalcArmorReducedDamage(attacker, victim, damage, spellInfo, BASE_ATTACK);
- uint32 armorReduction = damage - damageAfterArmor;
- if (armorReduction < damageResisted) // pick the lower one, the weakest resistance counts
- damageResisted = armorReduction;
+ float armorReduction = damage - damageAfterArmor;
+
+ // pick the lower one, the weakest resistance counts
+ damageResisted = std::min(damageResisted, armorReduction);
}
}
- return damageResisted;
+ damageResisted = std::max(damageResisted, 0.f);
+ return uint32(damageResisted);
}
-float Unit::GetEffectiveResistChance(Unit const* owner, SpellSchoolMask schoolMask, Unit const* victim, SpellInfo const* spellInfo)
+float Unit::CalculateAverageResistReduction(SpellSchoolMask schoolMask, Unit const* victim, SpellInfo const* spellInfo) const
{
float victimResistance = float(victim->GetResistance(schoolMask));
- if (owner)
+
+ // pets inherit 100% of masters penetration
+ // excluding traps
+ Player const* player = GetSpellModOwner();
+ if (player && GetEntry() != WORLD_TRIGGER)
{
- // pets inherit 100% of masters penetration
- // excluding traps
- Player const* player = owner->GetSpellModOwner();
- if (player && owner->GetEntry() != WORLD_TRIGGER)
- {
- victimResistance += float(player->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, schoolMask));
- victimResistance -= float(player->GetSpellPenetrationItemMod());
- }
- else
- victimResistance += float(owner->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, schoolMask));
+ victimResistance += float(player->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, schoolMask));
+ victimResistance -= float(player->GetSpellPenetrationItemMod());
}
+ else
+ victimResistance += float(GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, schoolMask));
// holy resistance exists in pve and comes from level difference, ignore template values
if (schoolMask & SPELL_SCHOOL_MASK_HOLY)
@@ -1749,8 +1744,10 @@ float Unit::GetEffectiveResistChance(Unit const* owner, SpellSchoolMask schoolMa
victimResistance = 0.0f;
victimResistance = std::max(victimResistance, 0.0f);
- if (owner)
- victimResistance += std::max((float(victim->GetLevelForTarget(owner)) - float(owner->GetLevelForTarget(victim))) * 5.0f, 0.0f);
+
+ // level-based resistance does not apply to binary spells, and cannot be overcome by spell penetration
+ if (!spellInfo || !spellInfo->HasAttribute(SPELL_ATTR0_CU_BINARY_SPELL))
+ victimResistance += std::max((float(victim->GetLevelForTarget(this)) - float(GetLevelForTarget(victim))) * 5.0f, 0.0f);
static uint32 const bossLevel = 83;
static float const bossResistanceConstant = 510.0f;
@@ -2030,7 +2027,7 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr
return; // ignore ranged case
if (GetTypeId() == TYPEID_UNIT && !HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED))
- SetFacingToObject(victim); // update client side facing to face the target (prevents visual glitches when casting untargeted spells)
+ SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells)
// melee attack spell cast at main hand attack only - no normal melee dmg dealt
if (attType == BASE_ATTACK && m_currentSpells[CURRENT_MELEE_SPELL] && !extra)
@@ -2111,7 +2108,7 @@ void Unit::FakeAttackerStateUpdate(Unit* victim, WeaponAttackType attType /*= BA
return; // ignore ranged case
if (GetTypeId() == TYPEID_UNIT && !HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED))
- SetFacingToObject(victim); // update client side facing to face the target (prevents visual glitches when casting untargeted spells)
+ SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells)
CalcDamageInfo damageInfo;
damageInfo.attacker = this;
@@ -2534,7 +2531,6 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo
return SPELL_MISS_NONE;
}
-/// @todo need use unit spell resistances in calculations
SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo) const
{
// Can`t miss on dead target (on skinning for example)
@@ -2590,23 +2586,21 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo
int32 tmp = 10000 - HitChance;
int32 rand = irand(0, 9999);
- if (rand < tmp)
+ if (tmp > 0 && rand < tmp)
return SPELL_MISS_MISS;
// Chance resist mechanic (select max value from every mechanic spell effect)
int32 resist_chance = victim->GetMechanicResistChance(spellInfo) * 100;
- tmp += resist_chance;
// Roll chance
- if (rand < tmp)
+ if (resist_chance > 0 && rand < (tmp += resist_chance))
return SPELL_MISS_RESIST;
// cast by caster in front of victim
if (!victim->HasUnitState(UNIT_STATE_CONTROLLED) && (victim->HasInArc(float(M_PI), this) || victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)))
{
int32 deflect_chance = victim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS) * 100;
- tmp += deflect_chance;
- if (rand < tmp)
+ if (deflect_chance > 0 && rand < (tmp += deflect_chance))
return SPELL_MISS_DEFLECT;
}
@@ -2623,18 +2617,6 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo
// Resist
SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, bool canReflect /*= false*/)
{
- if (spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))
- return SPELL_MISS_NONE;
-
- // Check for immune
- if (victim->IsImmunedToSpell(spellInfo, this))
- return SPELL_MISS_IMMUNE;
-
- // Damage immunity is only checked if the spell has damage effects, this immunity must not prevent aura apply
- // returns SPELL_MISS_IMMUNE in that case, for other spells, the SMSG_SPELL_GO must show hit
- if (spellInfo->HasOnlyDamageEffects() && victim->IsImmunedToDamage(spellInfo))
- return SPELL_MISS_IMMUNE;
-
// All positive spells can`t miss
/// @todo client not show miss log for this spells - so need find info for this in dbc and use it!
if (spellInfo->IsPositive() && !IsHostileTo(victim)) // prevent from affecting enemy by "positive" spell
@@ -2657,6 +2639,18 @@ SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, boo
return SPELL_MISS_REFLECT;
}
+ if (spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))
+ return SPELL_MISS_NONE;
+
+ // Check for immune
+ if (victim->IsImmunedToSpell(spellInfo, this))
+ return SPELL_MISS_IMMUNE;
+
+ // Damage immunity is only checked if the spell has damage effects, this immunity must not prevent aura apply
+ // returns SPELL_MISS_IMMUNE in that case, for other spells, the SMSG_SPELL_GO must show hit
+ if (spellInfo->HasOnlyDamageEffects() && victim->IsImmunedToDamage(spellInfo))
+ return SPELL_MISS_IMMUNE;
+
switch (spellInfo->DmgClass)
{
case SPELL_DAMAGE_CLASS_RANGED:
@@ -2748,7 +2742,7 @@ float Unit::GetUnitParryChance(WeaponAttackType attType, Unit const* victim) con
float Unit::GetUnitMissChance(WeaponAttackType attType) const
{
- float miss_chance = 5.00f;
+ float miss_chance = 5.0f;
if (attType == RANGED_ATTACK)
miss_chance -= GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE);
@@ -4671,7 +4665,7 @@ int32 Unit::GetTotalAuraModifier(AuraType auratype, std::function<bool(AuraEffec
{
// Check if the Aura Effect has a the Same Effect Stack Rule and if so, use the highest amount of that SpellGroup
// If the Aura Effect does not have this Stack Rule, it returns false so we can add to the multiplier as usual
- if (!sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), aurEff->GetAmount(), sameEffectSpellGroup))
+ if (!sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), static_cast<uint32>(auratype), aurEff->GetAmount(), sameEffectSpellGroup))
modifier += aurEff->GetAmount();
}
}
@@ -4698,7 +4692,7 @@ float Unit::GetTotalAuraMultiplier(AuraType auratype, std::function<bool(AuraEff
{
// Check if the Aura Effect has a the Same Effect Stack Rule and if so, use the highest amount of that SpellGroup
// If the Aura Effect does not have this Stack Rule, it returns false so we can add to the multiplier as usual
- if (!sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), aurEff->GetAmount(), sameEffectSpellGroup))
+ if (!sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), static_cast<uint32>(auratype), aurEff->GetAmount(), sameEffectSpellGroup))
AddPct(multiplier, aurEff->GetAmount());
}
}
@@ -5435,15 +5429,15 @@ void Unit::UpdateDisplayPower()
FactionTemplateEntry const* Unit::GetFactionTemplateEntry() const
{
- FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(getFaction());
+ FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(GetFaction());
if (!entry)
{
if (Player const* player = ToPlayer())
- TC_LOG_ERROR("entities.unit", "Player %s has invalid faction (faction template id) #%u", player->GetName().c_str(), getFaction());
+ TC_LOG_ERROR("entities.unit", "Player %s has invalid faction (faction template id) #%u", player->GetName().c_str(), GetFaction());
else if (Creature const* creature = ToCreature())
- TC_LOG_ERROR("entities.unit", "Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, getFaction());
+ TC_LOG_ERROR("entities.unit", "Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, GetFaction());
else
- TC_LOG_ERROR("entities.unit", "Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName().c_str(), uint32(GetTypeId()), getFaction());
+ TC_LOG_ERROR("entities.unit", "Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName().c_str(), uint32(GetTypeId()), GetFaction());
ABORT();
}
@@ -8658,7 +8652,7 @@ void Unit::SetSpeedRate(UnitMoveType mtype, float rate)
m_speed_rate[mtype] = rate;
- propagateSpeedChange();
+ PropagateSpeedChange();
// Spline packets are for creatures and move_update are for players
static OpcodeServer const moveTypeToOpcode[MAX_MOVE_TYPE][3] =
@@ -8845,7 +8839,8 @@ void Unit::TauntApply(Unit* taunter)
if (target && target == taunter)
return;
- SetInFront(taunter);
+ if (!IsFocusing(nullptr, true))
+ SetInFront(taunter);
if (creature->IsAIEnabled)
creature->AI()->AttackStart(taunter);
@@ -8884,7 +8879,8 @@ void Unit::TauntFadeOut(Unit* taunter)
if (target && target != taunter)
{
- SetInFront(target);
+ if (!IsFocusing(nullptr, true))
+ SetInFront(target);
if (creature->IsAIEnabled)
creature->AI()->AttackStart(target);
}
@@ -8966,7 +8962,7 @@ Unit* Creature::SelectVictim()
if (target && _IsTargetAcceptable(target) && CanCreatureAttack(target))
{
- if (!IsFocusing())
+ if (!IsFocusing(nullptr, true))
SetInFront(target);
return target;
}
@@ -9162,7 +9158,7 @@ void Unit::ModSpellCastTime(SpellInfo const* spellInfo, int32 & castTime, Spell*
if (!(spellInfo->HasAttribute(SPELL_ATTR0_ABILITY) || spellInfo->HasAttribute(SPELL_ATTR0_TRADESPELL) || spellInfo->HasAttribute(SPELL_ATTR3_NO_DONE_BONUS)) &&
((GetTypeId() == TYPEID_PLAYER && spellInfo->SpellFamilyName) || GetTypeId() == TYPEID_UNIT))
- castTime = int32(float(castTime) * m_unitData->ModCastingSpeed);
+ castTime = CanInstantCast() ? 0 : int32(float(castTime) * m_unitData->ModCastingSpeed);
else if (spellInfo->HasAttribute(SPELL_ATTR0_REQ_AMMO) && !spellInfo->HasAttribute(SPELL_ATTR2_AUTOREPEAT_FLAG))
castTime = int32(float(castTime) * m_modAttackSpeedPct[RANGED_ATTACK]);
else if (IsPartOfSkillLine(SKILL_COOKING, spellInfo->Id) && HasAura(67556)) // cooking with Chef Hat.
@@ -9215,11 +9211,11 @@ void Unit::IncrDiminishing(SpellInfo const* auraSpellInfo)
++diminish.hitCount;
}
-float Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, int32& duration, Unit* caster, DiminishingLevels previousLevel)
+bool Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, int32& duration, Unit* caster, DiminishingLevels previousLevel) const
{
DiminishingGroup const group = auraSpellInfo->GetDiminishingReturnsGroupForSpell();
if (duration == -1 || group == DIMINISHING_NONE)
- return 1.0f;
+ return true;
int32 const limitDuration = auraSpellInfo->GetDiminishingReturnsLimitDuration();
@@ -9239,7 +9235,6 @@ float Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, int32& du
}
float mod = 1.0f;
-
switch (group)
{
case DIMINISHING_TAUNT:
@@ -9296,7 +9291,7 @@ float Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, int32& du
}
duration = int32(duration * mod);
- return mod;
+ return (duration != 0);
}
void Unit::ApplyDiminishingAura(DiminishingGroup group, bool apply)
@@ -9587,7 +9582,13 @@ void Unit::UpdateDamageDoneMods(WeaponAttackType attackType)
break;
}
- float amount = GetTotalAuraModifier(SPELL_AURA_MOD_DAMAGE_DONE, std::bind(&Unit::CheckAttackFitToAuraRequirement, this, attackType, std::placeholders::_1));
+ float amount = GetTotalAuraModifier(SPELL_AURA_MOD_DAMAGE_DONE, [&](AuraEffect const* aurEff) -> bool
+ {
+ if (!(aurEff->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
+ return false;
+
+ return CheckAttackFitToAuraRequirement(attackType, aurEff);
+ });
SetStatFlatModifier(unitMod, TOTAL_VALUE, amount);
}
@@ -10661,9 +10662,9 @@ void Unit::SendPetAIReaction(ObjectGuid guid)
owner->ToPlayer()->SendDirectMessage(packet.Write());
}
-void Unit::propagateSpeedChange()
+void Unit::PropagateSpeedChange()
{
- GetMotionMaster()->propagateSpeedChange();
+ GetMotionMaster()->PropagateSpeedChange();
}
///----------End of Pet responses methods----------
@@ -11161,26 +11162,6 @@ void Unit::SetContestedPvP(Player* attackedPlayer)
}
}
-void Unit::AddPetAura(PetAura const* petSpell)
-{
- if (GetTypeId() != TYPEID_PLAYER)
- return;
-
- m_petAuras.insert(petSpell);
- if (Pet* pet = ToPlayer()->GetPet())
- pet->CastPetAura(petSpell);
-}
-
-void Unit::RemovePetAura(PetAura const* petSpell)
-{
- if (GetTypeId() != TYPEID_PLAYER)
- return;
-
- m_petAuras.erase(petSpell);
- if (Pet* pet = ToPlayer()->GetPet())
- pet->RemoveAurasDueToSpell(petSpell->GetAura(pet->GetEntry()));
-}
-
Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget, uint32 spell_id)
{
if (GetTypeId() != TYPEID_PLAYER)
@@ -11224,7 +11205,7 @@ Pet* Unit::CreateTamedPetFrom(uint32 creatureEntry, uint32 spell_id)
bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
{
pet->SetCreatorGUID(GetGUID());
- pet->setFaction(getFaction());
+ pet->SetFaction(GetFaction());
pet->SetCreatedBySpell(spell_id);
if (GetTypeId() == TYPEID_PLAYER)
@@ -11520,7 +11501,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
{
// the reset time is set but not added to the scheduler
// until the players leave the instance
- time_t resettime = creature->GetRespawnTimeEx() + 2 * HOUR;
+ time_t resettime = GameTime::GetGameTime() + 2 * HOUR;
if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(creature->GetInstanceId()))
if (save->GetResetTime() < resettime)
save->SetResetTime(resettime);
@@ -11880,8 +11861,8 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
if (aurApp && aurApp->GetRemoveMode())
return false;
- _oldFactionId = getFaction();
- setFaction(charmer->getFaction());
+ _oldFactionId = GetFaction();
+ SetFaction(charmer->GetFaction());
// Set charmed
charmer->SetCharm(this, true);
@@ -11997,7 +11978,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
if (_oldFactionId)
{
- setFaction(_oldFactionId);
+ SetFaction(_oldFactionId);
_oldFactionId = 0;
}
else
@@ -12089,13 +12070,13 @@ void Unit::RestoreFaction()
{
if (Unit* owner = GetOwner())
{
- setFaction(owner->getFaction());
+ SetFaction(owner->GetFaction());
return;
}
}
if (CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate()) // normal creature
- setFaction(cinfo->faction);
+ SetFaction(cinfo->faction);
}
}
@@ -12190,7 +12171,7 @@ bool Unit::IsInPartyWith(Unit const* unit) const
(u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT))
return true;
- return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->getFaction() == u2->getFaction();
+ return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->GetFaction() == u2->GetFaction();
}
bool Unit::IsInRaidWith(Unit const* unit) const
@@ -12209,7 +12190,7 @@ bool Unit::IsInRaidWith(Unit const* unit) const
(u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT))
return true;
- return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->getFaction() == u2->getFaction();
+ return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->GetFaction() == u2->GetFaction();
}
void Unit::GetPartyMembers(std::list<Unit*> &TagUnitMap)
@@ -12426,25 +12407,23 @@ void Unit::ApplyResilience(Unit const* victim, int32* damage) const
// Melee based spells can be miss, parry or dodge on this step
// Crit or block - determined on damage calculation phase! (and can be both in some time)
-float Unit::MeleeSpellMissChance(const Unit* victim, WeaponAttackType attType, uint32 spellId) const
+float Unit::MeleeSpellMissChance(Unit const* victim, WeaponAttackType attType, uint32 spellId) const
{
//calculate miss chance
float missChance = victim->GetUnitMissChance(attType);
+ // melee attacks while dual wielding have +19% chance to miss
if (!spellId && haveOffhandWeapon() && !IsInFeralForm())
- missChance += 19;
-
- // Calculate hit chance
- float hitChance = 100.0f;
+ missChance += 19.0f;
// Spellmod from SPELLMOD_RESIST_MISS_CHANCE
+ float resistMissChance = 100.0f;
if (spellId)
{
if (Player* modOwner = GetSpellModOwner())
- modOwner->ApplySpellMod(spellId, SPELLMOD_RESIST_MISS_CHANCE, hitChance);
+ modOwner->ApplySpellMod(spellId, SPELLMOD_RESIST_MISS_CHANCE, resistMissChance);
}
-
- missChance += hitChance - 100.0f;
+ missChance -= resistMissChance - 100.0f;
if (attType == RANGED_ATTACK)
missChance -= m_modRangedHitChance;
@@ -12452,10 +12431,7 @@ float Unit::MeleeSpellMissChance(const Unit* victim, WeaponAttackType attType, u
missChance -= m_modMeleeHitChance;
// Limit miss chance from 0 to 60%
- if (missChance < 0.0f)
- return 0.0f;
- if (missChance > 77.0f)
- return 77.0f;
+ RoundToInterval(missChance, 0.f, 60.f);
return missChance;
}
@@ -13562,7 +13538,7 @@ void Unit::SendClearTarget()
int32 Unit::GetResistance(SpellSchoolMask mask) const
{
Optional<int32> resist;
- for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
+ for (int32 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
{
int32 schoolResistance = GetResistance(SpellSchools(i)) + GetBonusResistanceMod(SpellSchools(i));
if (mask & (1 << i) && (!resist || *resist > schoolResistance))
@@ -13651,7 +13627,8 @@ void Unit::SetInFront(WorldObject const* target)
void Unit::SetFacingTo(float ori, bool force)
{
- if (!force && !IsStopped())
+ // do not face when already moving
+ if (!force && (!IsStopped() || !movespline->Finalized()))
return;
Movement::MoveSplineInit init(this);
@@ -13665,7 +13642,7 @@ void Unit::SetFacingTo(float ori, bool force)
void Unit::SetFacingToObject(WorldObject const* object, bool force)
{
// do not face when already moving
- if (!force && !IsStopped())
+ if (!force && (!IsStopped() || !movespline->Finalized()))
return;
/// @todo figure out under what conditions creature will move towards object instead of facing it where it currently is.
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 7db8583f69f..48ab77e3856 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -200,7 +200,6 @@ class Item;
class Minion;
class MotionMaster;
class Pet;
-class PetAura;
class Spell;
class SpellCastTargets;
class SpellEffectInfo;
@@ -948,7 +947,7 @@ class TC_GAME_API Unit : public WorldObject
DiminishingLevels GetDiminishing(DiminishingGroup group);
void IncrDiminishing(SpellInfo const* auraSpellInfo);
- float ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, int32& duration, Unit* caster, DiminishingLevels previousLevel);
+ bool ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, int32& duration, Unit* caster, DiminishingLevels previousLevel) const;
void ApplyDiminishingAura(DiminishingGroup group, bool apply);
void ClearDiminishings();
@@ -1042,7 +1041,7 @@ class TC_GAME_API Unit : public WorldObject
int32 GetResistance(SpellSchoolMask mask) const;
void SetResistance(SpellSchools school, int32 val) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::Resistances, school), val); }
void SetBonusResistanceMod(SpellSchools school, int32 val) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::BonusResistanceMods, school), val); }
- float GetEffectiveResistChance(Unit const* owner, SpellSchoolMask schoolMask, Unit const* victim, SpellInfo const* spellInfo = nullptr);
+ float CalculateAverageResistReduction(SpellSchoolMask schoolMask, Unit const* victim, SpellInfo const* spellInfo = nullptr) const;
uint64 GetHealth() const { return m_unitData->Health; }
uint64 GetMaxHealth() const { return m_unitData->MaxHealth; }
@@ -1119,8 +1118,8 @@ class TC_GAME_API Unit : public WorldObject
void SetSheath(SheathState sheathed) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::SheatheState), sheathed); }
// faction template id
- uint32 getFaction() const { return m_unitData->FactionTemplate; }
- void setFaction(uint32 faction) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::FactionTemplate), faction); }
+ uint32 GetFaction() const { return m_unitData->FactionTemplate; }
+ void SetFaction(uint32 faction) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::FactionTemplate), faction); }
FactionTemplateEntry const* GetFactionTemplateEntry() const;
ReputationRank GetReactionTo(Unit const* target) const;
@@ -1383,8 +1382,8 @@ class TC_GAME_API Unit : public WorldObject
void UpdateMovementForcesModMagnitude();
void SetInFront(WorldObject const* target);
- void SetFacingTo(float ori, bool force = false);
- void SetFacingToObject(WorldObject const* object, bool force = false);
+ void SetFacingTo(float const ori, bool force = true);
+ void SetFacingToObject(WorldObject const* object, bool force = true);
void SendChangeCurrentVictimOpcode(HostileReference* pHostileReference);
void SendClearThreatListOpcode();
@@ -1659,8 +1658,8 @@ class TC_GAME_API Unit : public WorldObject
virtual SpellInfo const* GetCastSpellInfo(SpellInfo const* spellInfo) const;
uint32 GetCastSpellXSpellVisualId(SpellInfo const* spellInfo) const;
- // Check if our current channel spell has attribute SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING
- bool IsMovementPreventedByCasting() const;
+ virtual bool IsFocusing(Spell const* /*focusSpell*/ = nullptr, bool /*withDelay*/ = false) { return false; }
+ virtual bool IsMovementPreventedByCasting() const;
SpellHistory* GetSpellHistory() { return _spellHistory; }
SpellHistory const* GetSpellHistory() const { return _spellHistory; }
@@ -1915,7 +1914,7 @@ class TC_GAME_API Unit : public WorldObject
void SendPetAIReaction(ObjectGuid guid);
///----------End of Pet responses methods----------
- void propagateSpeedChange();
+ void PropagateSpeedChange();
// reactive attacks
void ClearAllReactives();
@@ -1929,12 +1928,6 @@ class TC_GAME_API Unit : public WorldObject
bool CanProc() const { return !m_procDeep; }
void SetCantProc(bool apply);
- // pet auras
- typedef std::set<PetAura const*> PetAuraSet;
- PetAuraSet m_petAuras;
- void AddPetAura(PetAura const* petSpell);
- void RemovePetAura(PetAura const* petSpell);
-
uint32 GetModelForForm(ShapeshiftForm form, uint32 spellId) const;
// Redirect Threat
@@ -1997,6 +1990,9 @@ class TC_GAME_API Unit : public WorldObject
ObjectGuid GetTarget() const { return m_unitData->Target; }
virtual void SetTarget(ObjectGuid const& /*guid*/) = 0;
+ void SetInstantCast(bool set) { _instantCast = set; }
+ bool CanInstantCast() const { return _instantCast; }
+
// Movement info
Movement::MoveSpline * movespline;
@@ -2149,6 +2145,7 @@ class TC_GAME_API Unit : public WorldObject
bool m_cleanupDone; // lock made to not add stuff after cleanup before delete
bool m_duringRemoveFromWorld; // lock made to not add stuff after begining removing from world
+ bool _instantCast;
uint32 _oldFactionId; ///< faction before charm
bool _isWalkingBeforeCharm; ///< Are we walking before we were charmed?
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 4ab04447914..f519c69948f 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -4529,8 +4529,6 @@ void ObjectMgr::LoadQuests()
qinfo->GetQuestId(), qinfo->_nextQuestInChain, qinfo->_nextQuestInChain);
qinfo->_nextQuestInChain = 0;
}
- else
- qNextItr->second->PrevChainQuests.push_back(qinfo->GetQuestId());
}
for (uint8 j = 0; j < QUEST_REWARD_CURRENCY_COUNT; ++j)
@@ -4617,9 +4615,9 @@ void ObjectMgr::LoadQuests()
if (qinfo->_nextQuestID)
{
- auto qNextItr = _questTemplates.find(qinfo->GetNextQuestId());
+ auto qNextItr = _questTemplates.find(qinfo->_nextQuestID);
if (qNextItr == _questTemplates.end())
- TC_LOG_ERROR("sql.sql", "Quest %d has NextQuestId %u, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId());
+ TC_LOG_ERROR("sql.sql", "Quest %d has NextQuestId %u, but no such quest", qinfo->GetQuestId(), qinfo->_nextQuestID);
else
qNextItr->second->DependentPreviousQuests.push_back(qinfo->GetQuestId());
}
@@ -4628,6 +4626,27 @@ void ObjectMgr::LoadQuests()
_exclusiveQuestGroups.insert(std::pair<int32, uint32>(qinfo->_exclusiveGroup, qinfo->GetQuestId()));
if (qinfo->_limitTime)
qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED);
+
+ // Special flag to determine if quest is completed from the start, used to determine if we can fail timed quest if it is completed
+ if (!qinfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL | QUEST_SPECIAL_FLAGS_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO | QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT))
+ {
+ bool addFlag = true;
+ if (qinfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER))
+ {
+ for (QuestObjective const& obj : qinfo->GetObjectives())
+ {
+ if (obj.Type == QUEST_OBJECTIVE_ITEM)
+ if (static_cast<uint32>(obj.ObjectID) != qinfo->GetSrcItemId() || static_cast<uint32>(obj.Amount) > qinfo->GetSrcItemCount())
+ {
+ addFlag = false;
+ break;
+ }
+ }
+ }
+
+ if (addFlag)
+ qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_COMPLETED_AT_START);
+ }
}
// check QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE
diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp
index e4ccc62f5dc..95454d49f90 100644
--- a/src/server/game/Handlers/AuctionHouseHandler.cpp
+++ b/src/server/game/Handlers/AuctionHouseHandler.cpp
@@ -52,7 +52,7 @@ void WorldSession::HandleAuctionBrowseQuery(WorldPackets::AuctionHouse::AuctionB
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+ AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
TC_LOG_DEBUG("auctionHouse", "Auctionhouse search (%s), searchedname: %s, levelmin: %u, levelmax: %u, filters: %u",
browseQuery.Auctioneer.ToString().c_str(), browseQuery.Name.c_str(), browseQuery.MinLevel, browseQuery.MaxLevel, AsUnderlyingType(browseQuery.Filters));
@@ -115,7 +115,7 @@ void WorldSession::HandleAuctionCancelCommoditiesPurchase(WorldPackets::AuctionH
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+ AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
auctionHouse->CancelCommodityQuote(_player->GetGUID());
}
@@ -136,7 +136,7 @@ void WorldSession::HandleAuctionConfirmCommoditiesPurchase(WorldPackets::Auction
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+ AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
if (auctionHouse->BuyCommodity(trans, _player, confirmCommoditiesPurchase.ItemID, confirmCommoditiesPurchase.Quantity, throttle.DelayUntilNext))
@@ -190,7 +190,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPackets::AuctionHouse::Auct
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+ AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
WorldPackets::AuctionHouse::AuctionListBidderItemsResult result;
@@ -218,7 +218,7 @@ void WorldSession::HandleAuctionListBucketsByBucketKeys(WorldPackets::AuctionHou
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+ AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
WorldPackets::AuctionHouse::AuctionListBucketsResult listBucketsResult;
@@ -248,7 +248,7 @@ void WorldSession::HandleAuctionListItemsByBucketKey(WorldPackets::AuctionHouse:
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+ AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
WorldPackets::AuctionHouse::AuctionListItemsResult listItemsResult;
listItemsResult.DesiredDelay = uint32(throttle.DelayUntilNext.count());
@@ -279,7 +279,7 @@ void WorldSession::HandleAuctionListItemsByItemID(WorldPackets::AuctionHouse::Au
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+ AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
WorldPackets::AuctionHouse::AuctionListItemsResult listItemsResult;
listItemsResult.DesiredDelay = uint32(throttle.DelayUntilNext.count());
@@ -311,7 +311,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPackets::AuctionHouse::Aucti
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+ AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
WorldPackets::AuctionHouse::AuctionListOwnerItemsResult result;
@@ -345,7 +345,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPackets::AuctionHouse::AuctionPlac
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+ AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
AuctionPosting* auction = auctionHouse->GetAuction(placeBid.AuctionID);
if (!auction || auction->IsCommodity())
@@ -467,7 +467,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPackets::AuctionHouse::AuctionRe
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+ AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
AuctionPosting* auction = auctionHouse->GetAuction(removeItem.AuctionID);
Player* player = GetPlayer();
@@ -529,7 +529,7 @@ void WorldSession::HandleAuctionReplicateItems(WorldPackets::AuctionHouse::Aucti
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+ AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
WorldPackets::AuctionHouse::AuctionReplicateResponse response;
@@ -569,7 +569,7 @@ void WorldSession::HandleAuctionSellCommodity(WorldPackets::AuctionHouse::Auctio
}
uint32 houseId = 0;
- AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->getFaction(), &houseId);
+ AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->GetFaction(), &houseId);
if (!auctionHouseEntry)
{
TC_LOG_DEBUG("network", "WORLD: HandleAuctionSellItem - Unit (%s) has wrong faction.", sellCommodity.Auctioneer.ToString().c_str());
@@ -645,7 +645,7 @@ void WorldSession::HandleAuctionSellCommodity(WorldPackets::AuctionHouse::Auctio
}
Seconds auctionTime = Seconds(int64(std::chrono::duration_cast<Seconds>(Minutes(sellCommodity.RunTime)).count() * double(sWorld->getRate(RATE_AUCTION_TIME))));
- AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+ AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
uint64 deposit = AuctionHouseMgr::GetCommodityAuctionDeposit(items2.begin()->second.first->GetTemplate(), Minutes(sellCommodity.RunTime), totalCount);
if (!_player->HasEnoughMoney(deposit))
@@ -793,7 +793,7 @@ void WorldSession::HandleAuctionSellItem(WorldPackets::AuctionHouse::AuctionSell
}
uint32 houseId = 0;
- AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->getFaction(), &houseId);
+ AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->GetFaction(), &houseId);
if (!auctionHouseEntry)
{
TC_LOG_DEBUG("network", "WORLD: HandleAuctionSellItem - Unit (%s) has wrong faction.", sellItem.Auctioneer.ToString().c_str());
@@ -837,7 +837,7 @@ void WorldSession::HandleAuctionSellItem(WorldPackets::AuctionHouse::AuctionSell
}
Seconds auctionTime = Seconds(int64(std::chrono::duration_cast<Seconds>(Minutes(sellItem.RunTime)).count() * double(sWorld->getRate(RATE_AUCTION_TIME))));
- AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+ AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
uint64 deposit = AuctionHouseMgr::GetItemAuctionDeposit(_player, item, Minutes(sellItem.RunTime));
if (!_player->HasEnoughMoney(deposit))
@@ -947,7 +947,7 @@ void WorldSession::HandleAuctionStartCommoditiesPurchase(WorldPackets::AuctionHo
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+ AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
WorldPackets::AuctionHouse::AuctionCommodityQuote auctionCommodityQuote;
@@ -972,7 +972,7 @@ void WorldSession::SendAuctionHello(ObjectGuid guid, Creature* unit)
return;
}
- AuctionHouseEntry const* ahEntry = AuctionHouseMgr::GetAuctionHouseEntry(unit->getFaction(), nullptr);
+ AuctionHouseEntry const* ahEntry = AuctionHouseMgr::GetAuctionHouseEntry(unit->GetFaction(), nullptr);
if (!ahEntry)
return;
diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp
index 7335b5f3676..68911435766 100644
--- a/src/server/game/Handlers/LootHandler.cpp
+++ b/src/server/game/Handlers/LootHandler.cpp
@@ -28,6 +28,7 @@
#include "GuildMgr.h"
#include "Item.h"
#include "Log.h"
+#include "LootItemStorage.h"
#include "LootMgr.h"
#include "LootPackets.h"
#include "Object.h"
@@ -255,7 +256,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPackets::Loot::LootMoney& /*packet
// Delete the money loot record from the DB
if (!loot->containerID.IsEmpty())
- loot->DeleteLootMoneyFromContainerItemDB();
+ sLootItemStorage->RemoveStoredMoneyForContainer(loot->containerID.GetCounter());
// Delete container if empty
if (loot->isLooted() && guid.IsItem())
diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp
index 08981180970..1cda9ba2f1c 100644
--- a/src/server/game/Handlers/NPCHandler.cpp
+++ b/src/server/game/Handlers/NPCHandler.cpp
@@ -159,7 +159,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPackets::NPC::Hello& packet)
}
// set faction visible if needed
- if (FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(unit->getFaction()))
+ if (FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(unit->GetFaction()))
_player->GetReputationMgr().SetVisible(factionTemplateEntry);
GetPlayer()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp
index 8dc2523afcc..73bc95f2caf 100644
--- a/src/server/game/Handlers/PetHandler.cpp
+++ b/src/server/game/Handlers/PetHandler.cpp
@@ -331,13 +331,15 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
{
if (unit_target)
{
- pet->SetInFront(unit_target);
+ if (!pet->IsFocusing())
+ pet->SetInFront(unit_target);
if (Player* player = unit_target->ToPlayer())
pet->SendUpdateToPlayer(player);
}
else if (Unit* unit_target2 = spell->m_targets.GetUnitTarget())
{
- pet->SetInFront(unit_target2);
+ if (!pet->IsFocusing())
+ pet->SetInFront(unit_target2);
if (Player* player = unit_target2->ToPlayer())
pet->SendUpdateToPlayer(player);
}
diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp
index b56e0ec130c..aeafff6d1cc 100644
--- a/src/server/game/Handlers/QuestHandler.cpp
+++ b/src/server/game/Handlers/QuestHandler.cpp
@@ -350,46 +350,41 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPackets::Quest::Quest
{
//For AutoSubmition was added plr case there as it almost same exclute AI script cases.
Creature* creatureQGiver = object->ToCreature();
- if (!creatureQGiver || !sScriptMgr->OnQuestReward(_player, creatureQGiver, quest, packet.ItemChoiceID))
+ // Send next quest
+ if (Quest const* nextQuest = _player->GetNextQuest(packet.QuestGiverGUID, quest))
{
- // Send next quest
- if (Quest const* nextQuest = _player->GetNextQuest(packet.QuestGiverGUID, quest))
+ // Only send the quest to the player if the conditions are met
+ if (_player->CanTakeQuest(nextQuest, false))
{
- // Only send the quest to the player if the conditions are met
- if (_player->CanTakeQuest(nextQuest, false))
- {
- if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true))
- _player->AddQuestAndCheckCompletion(nextQuest, object);
+ if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true))
+ _player->AddQuestAndCheckCompletion(nextQuest, object);
- _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, packet.QuestGiverGUID, true, false);
- }
+ _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, packet.QuestGiverGUID, true, false);
}
-
- if (creatureQGiver)
- creatureQGiver->GetAI()->sQuestReward(_player, quest, packet.ItemChoiceID);
}
+
+ if (creatureQGiver && !sScriptMgr->OnQuestReward(_player, creatureQGiver, quest, packet.ItemChoiceID))
+ creatureQGiver->GetAI()->sQuestReward(_player, quest, packet.ItemChoiceID);
break;
}
case TYPEID_GAMEOBJECT:
{
GameObject* questGiver = object->ToGameObject();
- if (!sScriptMgr->OnQuestReward(_player, questGiver, quest, packet.ItemChoiceID))
+ // Send next quest
+ if (Quest const* nextQuest = _player->GetNextQuest(packet.QuestGiverGUID, quest))
{
- // Send next quest
- if (Quest const* nextQuest = _player->GetNextQuest(packet.QuestGiverGUID, quest))
+ // Only send the quest to the player if the conditions are met
+ if (_player->CanTakeQuest(nextQuest, false))
{
- // Only send the quest to the player if the conditions are met
- if (_player->CanTakeQuest(nextQuest, false))
- {
- if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true))
- _player->AddQuestAndCheckCompletion(nextQuest, object);
+ if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true))
+ _player->AddQuestAndCheckCompletion(nextQuest, object);
- _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, packet.QuestGiverGUID, true, false);
- }
+ _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, packet.QuestGiverGUID, true, false);
}
+ }
+ if (!sScriptMgr->OnQuestReward(_player, questGiver, quest, packet.ItemChoiceID))
questGiver->AI()->QuestReward(_player, quest, packet.ItemChoiceID);
- }
break;
}
default:
@@ -590,7 +585,10 @@ void WorldSession::HandlePushQuestToParty(WorldPackets::Quest::PushQuestToParty&
Group* group = sender->GetGroup();
if (!group)
+ {
+ sender->SendPushToPartyResponse(sender, QUEST_PUSH_NOT_IN_PARTY);
return;
+ }
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
@@ -611,6 +609,12 @@ void WorldSession::HandlePushQuestToParty(WorldPackets::Quest::PushQuestToParty&
continue;
}
+ if (!receiver->SatisfyQuestDay(quest, false))
+ {
+ sender->SendPushToPartyResponse(receiver, QUEST_PUSH_DIFFERENT_SERVER_DAILY);
+ continue;
+ }
+
if (!receiver->CanTakeQuest(quest, false))
{
sender->SendPushToPartyResponse(receiver, QUEST_PUSH_INVALID);
diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp
index 903e4f084d6..fdeee7535a1 100644
--- a/src/server/game/Instances/InstanceSaveMgr.cpp
+++ b/src/server/game/Instances/InstanceSaveMgr.cpp
@@ -168,7 +168,7 @@ void InstanceSaveManager::RemoveInstanceSave(uint32 InstanceId)
{
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_INSTANCE_RESETTIME);
- stmt->setUInt32(0, uint32(resettime));
+ stmt->setUInt64(0, uint64(resettime));
stmt->setUInt32(1, InstanceId);
CharacterDatabase.Execute(stmt);
@@ -222,7 +222,7 @@ void InstanceSave::SaveToDB()
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_INSTANCE_SAVE);
stmt->setUInt32(0, m_instanceid);
stmt->setUInt16(1, GetMapId());
- stmt->setUInt32(2, uint32(GetResetTimeForDB()));
+ stmt->setUInt64(2, uint64(GetResetTimeForDB()));
stmt->setUInt8(3, uint8(GetDifficultyID()));
stmt->setUInt32(4, completedEncounters);
stmt->setString(5, data);
@@ -329,8 +329,7 @@ void InstanceSaveManager::LoadResetTimes()
typedef std::pair<ResetTimeMapDiffInstances::const_iterator, ResetTimeMapDiffInstances::const_iterator> ResetTimeMapDiffInstancesBounds;
ResetTimeMapDiffInstances mapDiffResetInstances;
- QueryResult result = CharacterDatabase.Query("SELECT id, map, difficulty, resettime FROM instance ORDER BY id ASC");
- if (result)
+ if (QueryResult result = CharacterDatabase.Query("SELECT id, map, difficulty, resettime FROM instance ORDER BY id ASC"))
{
do
{
@@ -346,7 +345,7 @@ void InstanceSaveManager::LoadResetTimes()
// Mark instance id as being used
sMapMgr->RegisterInstanceId(instanceId);
- if (time_t resettime = time_t(fields[3].GetUInt32()))
+ if (time_t resettime = time_t(fields[3].GetUInt64()))
{
uint32 mapid = fields[1].GetUInt16();
uint32 difficulty = fields[2].GetUInt8();
@@ -357,24 +356,6 @@ 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_SEL_MAX_CREATURE_RESPAWNS)))
- {
- do
- {
- Field* fields = result2->Fetch();
- uint32 instance = fields[1].GetUInt32();
- time_t resettime = time_t(fields[0].GetUInt32() + 2 * HOUR);
- InstResetTimeMapDiffType::iterator itr = instResetTime.find(instance);
- if (itr != instResetTime.end() && itr->second.second != resettime)
- {
- CharacterDatabase.DirectPExecute("UPDATE instance SET resettime = '" UI64FMTD "' WHERE id = '%u'", uint64(resettime), instance);
- itr->second.second = resettime;
- }
- }
- while (result2->NextRow());
- }
-
// schedule the reset times
for (InstResetTimeMapDiffType::iterator itr = instResetTime.begin(); itr != instResetTime.end(); ++itr)
if (itr->second.second > now)
@@ -383,28 +364,37 @@ void InstanceSaveManager::LoadResetTimes()
// load the global respawn times for raid/heroic instances
uint32 diff = sWorld->getIntConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR;
- result = CharacterDatabase.Query("SELECT mapid, difficulty, resettime FROM instance_reset");
- if (result)
+ if (QueryResult result = CharacterDatabase.Query("SELECT mapid, difficulty, resettime FROM instance_reset"))
{
do
{
Field* fields = result->Fetch();
uint32 mapid = fields[0].GetUInt16();
Difficulty difficulty = Difficulty(fields[1].GetUInt8());
- uint64 oldresettime = fields[2].GetUInt32();
+ uint64 oldresettime = fields[2].GetUInt64();
MapDifficultyEntry const* mapDiff = sDB2Manager.GetMapDifficultyData(mapid, difficulty);
if (!mapDiff)
{
TC_LOG_ERROR("misc", "InstanceSaveManager::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, uint32(difficulty));
- CharacterDatabase.DirectPExecute("DELETE FROM instance_reset WHERE mapid = '%u' AND difficulty = '%u'", mapid, uint32(difficulty));
+
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GLOBAL_INSTANCE_RESETTIME);
+ stmt->setUInt16(0, uint16(mapid));
+ stmt->setUInt8(1, uint8(difficulty));
+ CharacterDatabase.DirectExecute(stmt);
continue;
}
// update the reset time if the hour in the configs changes
uint64 newresettime = (oldresettime / DAY) * DAY + diff;
if (oldresettime != newresettime)
- CharacterDatabase.DirectPExecute("UPDATE instance_reset SET resettime = '%u' WHERE mapid = '%u' AND difficulty = '%u'", uint32(newresettime), mapid, uint32(difficulty));
+ {
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME);
+ stmt->setUInt64(0, uint64(newresettime));
+ stmt->setUInt16(1, uint16(mapid));
+ stmt->setUInt8(2, uint8(difficulty));
+ CharacterDatabase.DirectExecute(stmt);
+ }
InitializeResetTimeFor(mapid, difficulty, newresettime);
} while (result->NextRow());
@@ -433,7 +423,12 @@ void InstanceSaveManager::LoadResetTimes()
{
// initialize the reset time
t = today + period + diff;
- CharacterDatabase.DirectPExecute("INSERT INTO instance_reset VALUES ('%u', '%u', '%u')", mapid, uint32(difficulty), (uint32)t);
+
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GLOBAL_INSTANCE_RESETTIME);
+ stmt->setUInt16(0, uint16(mapid));
+ stmt->setUInt8(1, uint8(difficulty));
+ stmt->setUInt64(2, uint64(t));
+ CharacterDatabase.DirectExecute(stmt);
}
if (t < now)
@@ -442,7 +437,12 @@ void InstanceSaveManager::LoadResetTimes()
// calculate the next reset time
t = (t / DAY) * DAY;
t += ((today - t) / period + 1) * period + diff;
- CharacterDatabase.DirectPExecute("UPDATE instance_reset SET resettime = '" UI64FMTD "' WHERE mapid = '%u' AND difficulty= '%u'", (uint64)t, mapid, uint32(difficulty));
+
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME);
+ stmt->setUInt64(0, uint64(t));
+ stmt->setUInt16(1, uint16(mapid));
+ stmt->setUInt8(2, uint8(difficulty));
+ CharacterDatabase.DirectExecute(stmt);
}
InitializeResetTimeFor(mapid, difficulty, t);
@@ -702,7 +702,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
// Update it in the DB
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME);
- stmt->setUInt32(0, next_reset);
+ stmt->setUInt64(0, uint64(next_reset));
stmt->setUInt16(1, uint16(mapid));
stmt->setUInt8(2, uint8(difficulty));
diff --git a/src/server/game/Loot/Loot.cpp b/src/server/game/Loot/Loot.cpp
index 88365d6641f..9e4dc90cab9 100644
--- a/src/server/game/Loot/Loot.cpp
+++ b/src/server/game/Loot/Loot.cpp
@@ -54,7 +54,6 @@ LootItem::LootItem(LootStoreItem const& li)
is_underthreshold = 0;
is_counted = 0;
rollWinnerGUID = ObjectGuid::Empty;
- canSave = true;
}
// Basic checks for player/item compatibility - if false no chance to see the item in the loot
@@ -104,33 +103,6 @@ Loot::~Loot()
clear();
}
-void Loot::DeleteLootItemFromContainerItemDB(uint32 itemID)
-{
- // Deletes a single item associated with an openable item from the DB
- CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEM);
- stmt->setUInt64(0, containerID.GetCounter());
- stmt->setUInt32(1, itemID);
- CharacterDatabase.Execute(stmt);
-
- // Mark the item looted to prevent resaving
- for (LootItemList::iterator _itr = items.begin(); _itr != items.end(); ++_itr)
- {
- if (_itr->itemid != itemID)
- continue;
-
- _itr->canSave = false;
- break;
- }
-}
-
-void Loot::DeleteLootMoneyFromContainerItemDB()
-{
- // Deletes money loot associated with an openable item from the DB
- CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
- stmt->setUInt64(0, containerID.GetCounter());
- CharacterDatabase.Execute(stmt);
-}
-
void Loot::clear()
{
for (NotNormalLootItemMap::const_iterator itr = PlayerQuestItems.begin(); itr != PlayerQuestItems.end(); ++itr)
diff --git a/src/server/game/Loot/Loot.h b/src/server/game/Loot/Loot.h
index 27f9c89f040..1aaed3f3cf7 100644
--- a/src/server/game/Loot/Loot.h
+++ b/src/server/game/Loot/Loot.h
@@ -148,7 +148,6 @@ struct TC_GAME_API LootItem
bool is_counted : 1;
bool needs_quest : 1; // quest drop
bool follow_loot_rules : 1;
- bool canSave;
// Constructor, copies most fields from LootStoreItem, generates random count and random suffixes/properties
// Should be called for non-reference LootStoreItem entries only (reference = 0)
@@ -156,8 +155,7 @@ struct TC_GAME_API LootItem
// Empty constructor for creating an empty LootItem to be filled in with DB data
LootItem() : itemid(0), randomBonusListId(0), context(ItemContext::NONE), count(0), is_looted(false), is_blocked(false),
- freeforall(false), is_underthreshold(false), is_counted(false), needs_quest(false), follow_loot_rules(false),
- canSave(true){ };
+ freeforall(false), is_underthreshold(false), is_counted(false), needs_quest(false), follow_loot_rules(false) { };
// Basic checks for player/item compatibility - if false no chance to see the item in the loot
bool AllowedForPlayer(Player const* player) const;
@@ -230,10 +228,6 @@ struct TC_GAME_API Loot
ObjectGuid const& GetGUID() const { return _GUID; }
void SetGUID(ObjectGuid const& guid) { _GUID = guid; }
- // For deleting items at loot removal since there is no backward interface to the Item()
- void DeleteLootItemFromContainerItemDB(uint32 itemID);
- void DeleteLootMoneyFromContainerItemDB();
-
// if loot becomes invalid this reference is used to inform the listener
void addLootValidatorRef(LootValidatorRef* pLootValidatorRef)
{
diff --git a/src/server/game/Loot/LootItemStorage.cpp b/src/server/game/Loot/LootItemStorage.cpp
new file mode 100644
index 00000000000..4e3464eb31c
--- /dev/null
+++ b/src/server/game/Loot/LootItemStorage.cpp
@@ -0,0 +1,365 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "DatabaseEnv.h"
+#include "Item.h"
+#include "ItemTemplate.h"
+#include "Log.h"
+#include "LootItemStorage.h"
+#include "LootMgr.h"
+#include "ObjectMgr.h"
+#include "Player.h"
+
+#include <boost/thread/shared_mutex.hpp>
+#include <boost/thread/locks.hpp>
+
+#include <unordered_map>
+
+namespace
+{
+ std::unordered_map<uint64, StoredLootContainer> _lootItemStore;
+}
+
+StoredLootItem::StoredLootItem(LootItem const& lootItem) : ItemId(lootItem.itemid), Count(lootItem.count), FollowRules(lootItem.follow_loot_rules),
+FFA(lootItem.freeforall), Blocked(lootItem.is_blocked), Counted(lootItem.is_counted), UnderThreshold(lootItem.is_underthreshold),
+NeedsQuest(lootItem.needs_quest), RandomBonusListId(lootItem.randomBonusListId), Context(lootItem.context), BonusListIDs(lootItem.BonusListIDs)
+{
+}
+
+LootItemStorage* LootItemStorage::instance()
+{
+ static LootItemStorage instance;
+ return &instance;
+}
+
+boost::shared_mutex* LootItemStorage::GetLock()
+{
+ static boost::shared_mutex _lock;
+ return &_lock;
+}
+
+void LootItemStorage::LoadStorageFromDB()
+{
+ uint32 oldMSTime = getMSTime();
+ _lootItemStore.clear();
+ uint32 count = 0;
+
+ CharacterDatabaseTransaction trans = CharacterDatabaseTransaction(nullptr);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEMCONTAINER_ITEMS);
+ PreparedQueryResult result = CharacterDatabase.Query(stmt);
+ if (result)
+ {
+ do
+ {
+ Field* fields = result->Fetch();
+
+ uint64 key = fields[0].GetUInt64();
+ auto itr = _lootItemStore.find(key);
+ if (itr == _lootItemStore.end())
+ {
+ bool added;
+ std::tie(itr, added) = _lootItemStore.emplace(std::piecewise_construct, std::forward_as_tuple(key), std::forward_as_tuple(key));
+
+ ASSERT(added);
+ }
+
+ StoredLootContainer& storedContainer = itr->second;
+
+ LootItem lootItem;
+ lootItem.itemid = fields[1].GetUInt32();
+ lootItem.count = fields[2].GetUInt32();
+ lootItem.follow_loot_rules = fields[3].GetBool();
+ lootItem.freeforall = fields[4].GetBool();
+ lootItem.is_blocked = fields[5].GetBool();
+ lootItem.is_counted = fields[6].GetBool();
+ lootItem.is_underthreshold = fields[7].GetBool();
+ lootItem.needs_quest = fields[8].GetBool();
+ lootItem.randomBonusListId = fields[9].GetUInt32();
+ lootItem.context = ItemContext(fields[10].GetUInt8());
+ Tokenizer bonusLists(fields[11].GetString(), ' ');
+ std::transform(bonusLists.begin(), bonusLists.end(), std::back_inserter(lootItem.BonusListIDs), [](char const* token)
+ {
+ return int32(strtol(token, NULL, 10));
+ });
+
+ storedContainer.AddLootItem(lootItem, trans);
+
+ ++count;
+ } while (result->NextRow());
+
+ TC_LOG_INFO("server.loading", ">> Loaded %u stored item loots in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ }
+ else
+ TC_LOG_INFO("server.loading", ">> Loaded 0 stored item loots");
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEMCONTAINER_MONEY);
+ result = CharacterDatabase.Query(stmt);
+ if (result)
+ {
+ count = 0;
+ do
+ {
+ Field* fields = result->Fetch();
+
+ uint64 key = fields[0].GetUInt64();
+ auto itr = _lootItemStore.find(key);
+ if (itr == _lootItemStore.end())
+ {
+ bool added;
+ std::tie(itr, added) = _lootItemStore.emplace(std::piecewise_construct, std::forward_as_tuple(key), std::forward_as_tuple(key));
+
+ ASSERT(added);
+ }
+
+ StoredLootContainer& storedContainer = itr->second;
+ storedContainer.AddMoney(fields[1].GetUInt32(), trans);
+
+ ++count;
+ } while (result->NextRow());
+
+ TC_LOG_INFO("server.loading", ">> Loaded %u stored item money in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ }
+ else
+ TC_LOG_INFO("server.loading", ">> Loaded 0 stored item money");
+}
+
+bool LootItemStorage::LoadStoredLoot(Item* item, Player* player)
+{
+ Loot* loot = &item->loot;
+ StoredLootContainer const* container = nullptr;
+
+ // read
+ {
+ boost::shared_lock<boost::shared_mutex> lock(*GetLock());
+
+ auto itr = _lootItemStore.find(loot->containerID.GetCounter());
+ if (itr == _lootItemStore.end())
+ return false;
+
+ container = &itr->second;
+ }
+
+ // container is never null at this point
+ loot->gold = container->GetMoney();
+
+ if (LootTemplate const* lt = LootTemplates_Item.GetLootFor(item->GetEntry()))
+ {
+ for (auto const& storedItemPair : container->GetLootItems())
+ {
+ LootItem li;
+ li.itemid = storedItemPair.first;
+ li.count = storedItemPair.second.Count;
+ li.follow_loot_rules = storedItemPair.second.FollowRules;
+ li.freeforall = storedItemPair.second.FFA;
+ li.is_blocked = storedItemPair.second.Blocked;
+ li.is_counted = storedItemPair.second.Counted;
+ li.is_underthreshold = storedItemPair.second.UnderThreshold;
+ li.needs_quest = storedItemPair.second.NeedsQuest;
+ li.randomBonusListId = storedItemPair.second.RandomBonusListId;
+ li.context = storedItemPair.second.Context;
+ li.BonusListIDs = storedItemPair.second.BonusListIDs;
+
+ // Copy the extra loot conditions from the item in the loot template
+ lt->CopyConditions(&li);
+
+ // If container item is in a bag, add that player as an allowed looter
+ if (item->GetBagSlot())
+ li.AddAllowedLooter(player);
+
+ // Finally add the LootItem to the container
+ loot->items.push_back(li);
+
+ // Increment unlooted count
+ ++loot->unlootedCount;
+ }
+ }
+
+ // Mark the item if it has loot so it won't be generated again on open
+ item->m_lootGenerated = true;
+ return true;
+}
+
+void LootItemStorage::RemoveStoredMoneyForContainer(uint64 containerId)
+{
+ // write
+ boost::unique_lock<boost::shared_mutex> lock(*GetLock());
+
+ auto itr = _lootItemStore.find(containerId);
+ if (itr == _lootItemStore.end())
+ return;
+
+ itr->second.RemoveMoney();
+}
+
+void LootItemStorage::RemoveStoredLootForContainer(uint64 containerId)
+{
+ // write
+ {
+ boost::unique_lock<boost::shared_mutex> lock(*GetLock());
+ _lootItemStore.erase(containerId);
+ }
+
+ CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS);
+ stmt->setUInt64(0, containerId);
+ trans->Append(stmt);
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
+ stmt->setUInt64(0, containerId);
+ trans->Append(stmt);
+
+ CharacterDatabase.CommitTransaction(trans);
+}
+
+void LootItemStorage::RemoveStoredLootItemForContainer(uint64 containerId, uint32 itemId, uint32 count)
+{
+ // write
+ boost::unique_lock<boost::shared_mutex> lock(*GetLock());
+
+ auto itr = _lootItemStore.find(containerId);
+ if (itr == _lootItemStore.end())
+ return;
+
+ itr->second.RemoveItem(itemId, count);
+}
+
+void LootItemStorage::AddNewStoredLoot(Loot* loot, Player* player)
+{
+ // Saves the money and item loot associated with an openable item to the DB
+ if (loot->isLooted()) // no money and no loot
+ return;
+
+ // read
+ {
+ boost::shared_lock<boost::shared_mutex> lock(*GetLock());
+
+ auto itr = _lootItemStore.find(loot->containerID.GetCounter());
+ if (itr != _lootItemStore.end())
+ {
+ TC_LOG_ERROR("misc", "Trying to store item loot by player: %s for container id: %lu that is already in storage!", player->GetGUID().ToString().c_str(), loot->containerID.GetCounter());
+ return;
+ }
+ }
+
+ StoredLootContainer container(loot->containerID.GetCounter());
+
+ CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
+ if (loot->gold)
+ container.AddMoney(loot->gold, trans);
+
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS);
+ stmt->setUInt64(0, loot->containerID.GetCounter());
+ trans->Append(stmt);
+
+ for (LootItem const& li : loot->items)
+ {
+ // Conditions are not checked when loot is generated, it is checked when loot is sent to a player.
+ // For items that are lootable, loot is saved to the DB immediately, that means that loot can be
+ // saved to the DB that the player never should have gotten. This check prevents that, so that only
+ // items that the player should get in loot are in the DB.
+ // IE: Horde items are not saved to the DB for Ally players.
+ if (!li.AllowedForPlayer(player))
+ continue;
+
+ // Don't save currency tokens
+ ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(li.itemid);
+ if (!itemTemplate || itemTemplate->IsCurrencyToken())
+ continue;
+
+ container.AddLootItem(li, trans);
+ }
+
+ CharacterDatabase.CommitTransaction(trans);
+
+ // write
+ {
+ boost::unique_lock<boost::shared_mutex> lock(*GetLock());
+ _lootItemStore.emplace(loot->containerID.GetCounter(), std::move(container));
+ }
+}
+
+void StoredLootContainer::AddLootItem(LootItem const& lootItem, CharacterDatabaseTransaction& trans)
+{
+ _lootItems.emplace(std::piecewise_construct, std::forward_as_tuple(lootItem.itemid), std::forward_as_tuple(lootItem));
+ if (!trans)
+ return;
+
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEMCONTAINER_ITEMS);
+
+ // container_id, item_id, item_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_prop, rnd_suffix
+ stmt->setUInt64(0, _containerId);
+ stmt->setUInt32(1, lootItem.itemid);
+ stmt->setUInt32(2, lootItem.count);
+ stmt->setBool(3, lootItem.follow_loot_rules);
+ stmt->setBool(4, lootItem.freeforall);
+ stmt->setBool(5, lootItem.is_blocked);
+ stmt->setBool(6, lootItem.is_counted);
+ stmt->setBool(7, lootItem.is_underthreshold);
+ stmt->setBool(8, lootItem.needs_quest);
+ stmt->setInt32(9, lootItem.randomBonusListId);
+ stmt->setUInt8(10, AsUnderlyingType(lootItem.context));
+ std::ostringstream bonusListIDs;
+ for (int32 bonusListID : lootItem.BonusListIDs)
+ bonusListIDs << bonusListID << ' ';
+ stmt->setString(11, bonusListIDs.str());
+ trans->Append(stmt);
+}
+
+void StoredLootContainer::AddMoney(uint32 money, CharacterDatabaseTransaction& trans)
+{
+ _money = money;
+ if (!trans)
+ return;
+
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
+ stmt->setUInt64(0, _containerId);
+ trans->Append(stmt);
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEMCONTAINER_MONEY);
+ stmt->setUInt64(0, _containerId);
+ stmt->setUInt32(1, _money);
+ trans->Append(stmt);
+}
+
+void StoredLootContainer::RemoveMoney()
+{
+ _money = 0;
+
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY);
+ stmt->setUInt64(0, _containerId);
+ CharacterDatabase.Execute(stmt);
+}
+
+void StoredLootContainer::RemoveItem(uint32 itemId, uint32 count)
+{
+ auto bounds = _lootItems.equal_range(itemId);
+ for (auto itr = bounds.first; itr != bounds.second; ++itr)
+ {
+ if (itr->second.Count == count)
+ {
+ _lootItems.erase(itr);
+ break;
+ }
+ }
+
+ // Deletes a single item associated with an openable item from the DB
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEM);
+ stmt->setUInt64(0, _containerId);
+ stmt->setUInt32(1, itemId);
+ stmt->setUInt32(2, count);
+ CharacterDatabase.Execute(stmt);
+}
diff --git a/src/server/game/Loot/LootItemStorage.h b/src/server/game/Loot/LootItemStorage.h
new file mode 100644
index 00000000000..7855559ce1e
--- /dev/null
+++ b/src/server/game/Loot/LootItemStorage.h
@@ -0,0 +1,99 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __LOOTITEMSTORAGE_H
+#define __LOOTITEMSTORAGE_H
+
+#include "DatabaseEnvFwd.h"
+#include "Define.h"
+#include "DBCEnums.h"
+#include "ItemEnchantmentMgr.h"
+
+#include <unordered_map>
+#include <vector>
+
+class Item;
+class Player;
+struct Loot;
+struct LootItem;
+
+namespace boost
+{
+ class shared_mutex;
+}
+
+struct StoredLootItem
+{
+ explicit StoredLootItem(LootItem const& lootItem);
+
+ uint32 ItemId;
+ uint32 Count;
+ bool FollowRules;
+ bool FFA;
+ bool Blocked;
+ bool Counted;
+ bool UnderThreshold;
+ bool NeedsQuest;
+ ItemRandomBonusListId RandomBonusListId;
+ ItemContext Context;
+ std::vector<int32> BonusListIDs;
+};
+
+class StoredLootContainer
+{
+ public:
+ typedef std::unordered_multimap<uint32 /*itemId*/, StoredLootItem> StoredLootItemContainer;
+
+ explicit StoredLootContainer(uint64 containerId) : _containerId(containerId), _money(0) { }
+
+ void AddLootItem(LootItem const& lootItem, CharacterDatabaseTransaction& trans);
+ void AddMoney(uint32 money, CharacterDatabaseTransaction& trans);
+
+ void RemoveMoney();
+ void RemoveItem(uint32 itemId, uint32 count);
+
+ uint32 GetContainer() const { return _containerId; }
+ uint32 GetMoney() const { return _money; }
+ StoredLootItemContainer const& GetLootItems() const { return _lootItems; }
+
+ private:
+ StoredLootItemContainer _lootItems;
+ uint64 const _containerId;
+ uint32 _money;
+};
+
+class LootItemStorage
+{
+ public:
+ static LootItemStorage* instance();
+ static boost::shared_mutex* GetLock();
+
+ void LoadStorageFromDB();
+ bool LoadStoredLoot(Item* item, Player* player);
+ void RemoveStoredMoneyForContainer(uint64 containerId);
+ void RemoveStoredLootForContainer(uint64 containerId);
+ void RemoveStoredLootItemForContainer(uint64 containerId, uint32 itemId, uint32 count);
+ void AddNewStoredLoot(Loot* loot, Player* player);
+
+ private:
+ LootItemStorage() { }
+ ~LootItemStorage() { }
+};
+
+#define sLootItemStorage LootItemStorage::instance()
+
+#endif
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 7b83e3412d5..24392412710 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -3982,7 +3982,7 @@ void Map::SaveCreatureRespawnTime(ObjectGuid::LowType dbGuid, time_t respawnTime
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN);
stmt->setUInt64(0, dbGuid);
- stmt->setUInt32(1, uint32(respawnTime));
+ stmt->setUInt64(1, uint64(respawnTime));
stmt->setUInt16(2, GetId());
stmt->setUInt32(3, GetInstanceId());
CharacterDatabase.Execute(stmt);
@@ -4012,7 +4012,7 @@ void Map::SaveGORespawnTime(ObjectGuid::LowType dbGuid, time_t respawnTime)
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GO_RESPAWN);
stmt->setUInt64(0, dbGuid);
- stmt->setUInt32(1, uint32(respawnTime));
+ stmt->setUInt64(1, uint64(respawnTime));
stmt->setUInt16(2, GetId());
stmt->setUInt32(3, GetInstanceId());
CharacterDatabase.Execute(stmt);
@@ -4040,7 +4040,7 @@ void Map::LoadRespawnTimes()
{
Field* fields = result->Fetch();
ObjectGuid::LowType loguid = fields[0].GetUInt64();
- uint32 respawnTime = fields[1].GetUInt32();
+ uint64 respawnTime = fields[1].GetUInt64();
_creatureRespawnTimes[loguid] = time_t(respawnTime);
} while (result->NextRow());
@@ -4055,7 +4055,7 @@ void Map::LoadRespawnTimes()
{
Field* fields = result->Fetch();
ObjectGuid::LowType loguid = fields[0].GetUInt64();
- uint32 respawnTime = fields[1].GetUInt32();
+ uint64 respawnTime = fields[1].GetUInt64();
_goRespawnTimes[loguid] = time_t(respawnTime);
} while (result->NextRow());
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp
index 3e775d238a4..3b446733bbb 100644
--- a/src/server/game/Movement/MotionMaster.cpp
+++ b/src/server/game/Movement/MotionMaster.cpp
@@ -30,8 +30,10 @@
#include "WaypointMovementGenerator.h"
#include "RandomMovementGenerator.h"
#include "SplineChainMovementGenerator.h"
+#include "FormationMovementGenerator.h"
#include "MoveSpline.h"
#include "MoveSplineInit.h"
+#include "PathGenerator.h"
inline bool IsStatic(MovementGenerator* movement)
{
@@ -76,7 +78,7 @@ void MotionMaster::InitDefault()
if (_owner->GetTypeId() == TYPEID_UNIT)
{
MovementGenerator* movement = FactorySelector::selectMovementGenerator(_owner->ToCreature());
- Mutate(movement == NULL ? &si_idleMovement : movement, MOTION_SLOT_IDLE);
+ Mutate(movement == nullptr ? &si_idleMovement : movement, MOTION_SLOT_IDLE);
}
else
{
@@ -89,9 +91,6 @@ void MotionMaster::UpdateMotion(uint32 diff)
if (!_owner)
return;
- if (_owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) // what about UNIT_STATE_DISTRACTED? Why is this not included?
- return;
-
ASSERT(!empty());
_cleanFlag |= MMCF_UPDATE;
@@ -174,12 +173,12 @@ MovementGenerator* MotionMaster::GetMotionSlot(int slot) const
return _slot[slot];
}
-void MotionMaster::propagateSpeedChange()
+void MotionMaster::PropagateSpeedChange()
{
for (int i = 0; i <= _top; ++i)
{
if (_slot[i])
- _slot[i]->unitSpeedChanged();
+ _slot[i]->UnitSpeedChanged();
}
}
@@ -713,6 +712,15 @@ void MotionMaster::MoveRotate(uint32 time, RotateDirection direction)
Mutate(new RotateMovementGenerator(time, direction), MOTION_SLOT_ACTIVE);
}
+void MotionMaster::MoveFormation(uint32 id, Position destination, uint32 moveType, bool forceRun /*= false*/, bool forceOrientation /*= false*/)
+{
+ if (_owner->GetTypeId() == TYPEID_UNIT)
+ {
+ TC_LOG_DEBUG("misc", "MotionMaster::MoveFormation: Creature (Entry: %u %s) targeted point (Id: %u X: %f Y: %f Z: %f).", _owner->GetEntry(), _owner->GetGUID().ToString().c_str(), id, destination.GetPositionX(), destination.GetPositionY(), destination.GetPositionZ());
+ Mutate(new FormationMovementGenerator(id, destination, moveType, forceRun, forceOrientation), MOTION_SLOT_ACTIVE);
+ }
+}
+
/******************** Private methods ********************/
void MotionMaster::pop()
diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h
index c496a0ec4ec..7cb72c353f7 100644
--- a/src/server/game/Movement/MotionMaster.h
+++ b/src/server/game/Movement/MotionMaster.h
@@ -66,6 +66,7 @@ enum MovementGeneratorType : uint8
ROTATE_MOTION_TYPE = 15,
EFFECT_MOTION_TYPE = 16,
SPLINE_CHAIN_MOTION_TYPE = 17, // SplineChainMovementGenerator.h
+ FORMATION_MOTION_TYPE = 18, // FormationMovementGenerator.h
MAX_MOTION_TYPE // limit
};
@@ -125,7 +126,7 @@ class TC_GAME_API MotionMaster
MovementGeneratorType GetMotionSlotType(int slot) const;
MovementGenerator* GetMotionSlot(int slot) const;
- void propagateSpeedChange();
+ void PropagateSpeedChange();
bool GetDestination(float &x, float &y, float &z);
@@ -176,6 +177,8 @@ class TC_GAME_API MotionMaster
void MovePath(uint32 path_id, bool repeatable);
void MoveRotate(uint32 time, RotateDirection direction);
+ void MoveFormation(uint32 id, Position destination, uint32 moveType, bool forceRun = false, bool forceOrientation = false);
+
private:
typedef std::vector<MovementGenerator*> MovementList;
diff --git a/src/server/game/Movement/MovementGenerator.h b/src/server/game/Movement/MovementGenerator.h
index a28ffca0172..fdf5506dd15 100755
--- a/src/server/game/Movement/MovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerator.h
@@ -33,14 +33,12 @@ class TC_GAME_API MovementGenerator
virtual void Initialize(Unit*) = 0;
virtual void Finalize(Unit*) = 0;
-
virtual void Reset(Unit*) = 0;
-
- virtual bool Update(Unit*, uint32 time_diff) = 0;
+ virtual bool Update(Unit*, uint32 diff) = 0;
virtual MovementGeneratorType GetMovementGeneratorType() const = 0;
- virtual void unitSpeedChanged() { }
+ virtual void UnitSpeedChanged() { }
// used by Evade code for select point to evade with expected restart default movement
virtual bool GetResetPosition(Unit*, float& /*x*/, float& /*y*/, float& /*z*/) { return false; }
@@ -52,42 +50,39 @@ class MovementGeneratorMedium : public MovementGenerator
public:
void Initialize(Unit* u) override
{
- //u->AssertIsType<T>();
(static_cast<D*>(this))->DoInitialize(static_cast<T*>(u));
}
void Finalize(Unit* u) override
{
- //u->AssertIsType<T>();
(static_cast<D*>(this))->DoFinalize(static_cast<T*>(u));
}
void Reset(Unit* u) override
{
- //u->AssertIsType<T>();
(static_cast<D*>(this))->DoReset(static_cast<T*>(u));
}
bool Update(Unit* u, uint32 time_diff) override
{
- //u->AssertIsType<T>();
return (static_cast<D*>(this))->DoUpdate(static_cast<T*>(u), time_diff);
}
};
struct SelectableMovement : public FactoryHolder<MovementGenerator, MovementGeneratorType>
{
- SelectableMovement(MovementGeneratorType mgt) : FactoryHolder<MovementGenerator, MovementGeneratorType>(mgt) { }
+ SelectableMovement(MovementGeneratorType movementGeneratorType) : FactoryHolder<MovementGenerator, MovementGeneratorType>(movementGeneratorType) { }
};
-template<class REAL_MOVEMENT>
+template<class Movement>
struct MovementGeneratorFactory : public SelectableMovement
{
- MovementGeneratorFactory(MovementGeneratorType mgt) : SelectableMovement(mgt) { }
+ MovementGeneratorFactory(MovementGeneratorType movementGeneratorType) : SelectableMovement(movementGeneratorType) { }
MovementGenerator* Create(void *) const override;
};
typedef FactoryHolder<MovementGenerator, MovementGeneratorType> MovementGeneratorCreator;
typedef FactoryHolder<MovementGenerator, MovementGeneratorType>::FactoryHolderRegistry MovementGeneratorRegistry;
+
#endif
diff --git a/src/server/game/Movement/MovementGeneratorImpl.h b/src/server/game/Movement/MovementGeneratorImpl.h
index 346fae28d1f..0b5474b22b3 100644
--- a/src/server/game/Movement/MovementGeneratorImpl.h
+++ b/src/server/game/Movement/MovementGeneratorImpl.h
@@ -20,10 +20,10 @@
#include "MovementGenerator.h"
-template<class MOVEMENT_GEN>
-inline MovementGenerator*
-MovementGeneratorFactory<MOVEMENT_GEN>::Create(void * /*data*/) const
+template<class Movement>
+inline MovementGenerator* MovementGeneratorFactory<Movement>::Create(void * /*data*/) const
{
- return (new MOVEMENT_GEN());
+ return (new Movement());
}
+
#endif
diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
index 37b0cf912ad..0432241432d 100755
--- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
@@ -16,92 +16,95 @@
*/
#include "Creature.h"
-#include "ConfusedMovementGenerator.h"
+#include "Player.h"
#include "PathGenerator.h"
#include "MoveSplineInit.h"
#include "MoveSpline.h"
-#include "Player.h"
#include "Random.h"
+#include "ConfusedMovementGenerator.h"
template<class T>
-void ConfusedMovementGenerator<T>::DoInitialize(T* unit)
+ConfusedMovementGenerator<T>::~ConfusedMovementGenerator()
{
- unit->AddUnitState(UNIT_STATE_CONFUSED);
- unit->AddUnitFlag(UNIT_FLAG_CONFUSED);
- unit->GetPosition(i_x, i_y, i_z);
+ delete _path;
+}
- if (!unit->IsAlive() || unit->IsStopped())
+template<class T>
+void ConfusedMovementGenerator<T>::DoInitialize(T* owner)
+{
+ if (!owner || !owner->IsAlive())
return;
- unit->StopMoving();
- unit->AddUnitState(UNIT_STATE_CONFUSED_MOVE);
+ owner->AddUnitState(UNIT_STATE_CONFUSED);
+ owner->AddUnitFlag(UNIT_FLAG_CONFUSED);
+ owner->StopMoving();
+
+ _timer.Reset(0);
+ owner->GetPosition(_reference.m_positionX, _reference.m_positionY, _reference.m_positionZ);
}
template<class T>
-void ConfusedMovementGenerator<T>::DoReset(T* unit)
+void ConfusedMovementGenerator<T>::DoReset(T* owner)
{
- i_nextMoveTime.Reset(0);
-
- if (!unit->IsAlive() || unit->IsStopped())
- return;
-
- unit->StopMoving();
- unit->AddUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE);
+ DoInitialize(owner);
}
template<class T>
-bool ConfusedMovementGenerator<T>::DoUpdate(T* unit, uint32 diff)
+bool ConfusedMovementGenerator<T>::DoUpdate(T* owner, uint32 diff)
{
- if (unit->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
- return true;
+ if (!owner || !owner->IsAlive())
+ return false;
- if (i_nextMoveTime.Passed())
+ if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || owner->IsMovementPreventedByCasting())
{
- // currently moving, update location
- unit->AddUnitState(UNIT_STATE_CONFUSED_MOVE);
-
- if (unit->movespline->Finalized())
- i_nextMoveTime.Reset(urand(800, 1500));
+ _interrupt = true;
+ owner->StopMoving();
+ return true;
}
else
+ _interrupt = false;
+
+ // waiting for next move
+ _timer.Update(diff);
+ if (!_interrupt && _timer.Passed() && owner->movespline->Finalized())
{
- // waiting for next move
- i_nextMoveTime.Update(diff);
- if (i_nextMoveTime.Passed())
+ // start moving
+ owner->AddUnitState(UNIT_STATE_CONFUSED_MOVE);
+
+ Position destination(_reference);
+ float distance = 4.0f * frand(0.0f, 1.0f) - 2.0f;
+ float angle = frand(0.0f, 1.0f) * float(M_PI) * 2.0f;
+ owner->MovePositionToFirstCollision(destination, distance, angle);
+
+ if (!_path)
+ _path = new PathGenerator(owner);
+
+ _path->SetPathLengthLimit(30.0f);
+ bool result = _path->CalculatePath(destination.GetPositionX(), destination.GetPositionY(), destination.GetPositionZ());
+ if (!result || (_path->GetPathType() & PATHFIND_NOPATH))
{
- // start moving
- unit->AddUnitState(UNIT_STATE_CONFUSED_MOVE);
-
- float dest = 4.0f * (float)rand_norm() - 2.0f;
-
- Position pos;
- pos.Relocate(i_x, i_y, i_z);
- unit->MovePositionToFirstCollision(pos, dest, 0.0f);
-
- PathGenerator path(unit);
- path.SetPathLengthLimit(30.0f);
- bool result = path.CalculatePath(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
- if (!result || (path.GetPathType() & PATHFIND_NOPATH))
- {
- i_nextMoveTime.Reset(100);
- return true;
- }
-
- Movement::MoveSplineInit init(unit);
- init.MovebyPath(path.GetPath());
- init.SetWalk(true);
- init.Launch();
+ _timer.Reset(100);
+ return true;
}
+
+ Movement::MoveSplineInit init(owner);
+ init.MovebyPath(_path->GetPath());
+ init.SetWalk(true);
+ int32 traveltime = init.Launch();
+ _timer.Reset(traveltime + urand(800, 1500));
}
return true;
}
+template<class T>
+void ConfusedMovementGenerator<T>::DoFinalize(T*) { }
+
template<>
void ConfusedMovementGenerator<Player>::DoFinalize(Player* unit)
{
unit->RemoveUnitFlag(UNIT_FLAG_CONFUSED);
- unit->ClearUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE);
+ unit->ClearUnitState(UNIT_STATE_CONFUSED);
unit->StopMoving();
}
@@ -114,6 +117,8 @@ void ConfusedMovementGenerator<Creature>::DoFinalize(Creature* unit)
unit->SetTarget(unit->EnsureVictim()->GetGUID());
}
+template ConfusedMovementGenerator<Player>::~ConfusedMovementGenerator();
+template ConfusedMovementGenerator<Creature>::~ConfusedMovementGenerator();
template void ConfusedMovementGenerator<Player>::DoInitialize(Player*);
template void ConfusedMovementGenerator<Creature>::DoInitialize(Creature*);
template void ConfusedMovementGenerator<Player>::DoReset(Player*);
diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h
index a67afb72024..7d4cd073457 100755
--- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h
@@ -25,16 +25,21 @@ template<class T>
class ConfusedMovementGenerator : public MovementGeneratorMedium< T, ConfusedMovementGenerator<T> >
{
public:
- explicit ConfusedMovementGenerator() : i_nextMoveTime(0), i_x(0), i_y(0), i_z(0) { }
+ explicit ConfusedMovementGenerator() : _path(nullptr), _timer(0), _reference(0.f, 0.f, 0.f), _interrupt(false) { }
+ ~ConfusedMovementGenerator();
+
+ MovementGeneratorType GetMovementGeneratorType() const override { return CONFUSED_MOTION_TYPE; }
void DoInitialize(T*);
void DoFinalize(T*);
void DoReset(T*);
bool DoUpdate(T*, uint32);
- MovementGeneratorType GetMovementGeneratorType() const override { return CONFUSED_MOTION_TYPE; }
private:
- TimeTracker i_nextMoveTime;
- float i_x, i_y, i_z;
+ PathGenerator* _path;
+ TimeTracker _timer;
+ Position _reference;
+ bool _interrupt;
};
+
#endif
diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
index bfe3f4399d0..a1d179c23ce 100644
--- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
@@ -15,176 +15,203 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "Creature.h"
+#include "VMapFactory.h"
#include "CreatureAI.h"
-#include "FleeingMovementGenerator.h"
-#include "PathGenerator.h"
#include "ObjectAccessor.h"
+#include "Creature.h"
+#include "Player.h"
+#include "PathGenerator.h"
#include "MoveSplineInit.h"
#include "MoveSpline.h"
#include "PhasingHandler.h"
-#include "Player.h"
-#include "VMapFactory.h"
+#include "FleeingMovementGenerator.h"
#define MIN_QUIET_DISTANCE 28.0f
#define MAX_QUIET_DISTANCE 43.0f
template<class T>
-void FleeingMovementGenerator<T>::_setTargetLocation(T* owner)
+FleeingMovementGenerator<T>::~FleeingMovementGenerator()
+{
+ delete _path;
+}
+
+template<class T>
+void FleeingMovementGenerator<T>::DoInitialize(T* owner)
{
if (!owner)
return;
- if (owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
+ owner->AddUnitFlag(UNIT_FLAG_FLEEING);
+ owner->AddUnitState(UNIT_STATE_FLEEING);
+ SetTargetLocation(owner);
+}
+
+template<class T>
+void FleeingMovementGenerator<T>::DoFinalize(T *)
+{
+}
+
+template<>
+void FleeingMovementGenerator<Player>::DoFinalize(Player* owner)
+{
+ owner->RemoveUnitFlag(UNIT_FLAG_FLEEING);
+ owner->ClearUnitState(UNIT_STATE_FLEEING);
+ owner->StopMoving();
+}
+
+template<>
+void FleeingMovementGenerator<Creature>::DoFinalize(Creature* owner)
+{
+ owner->RemoveUnitFlag(UNIT_FLAG_FLEEING);
+ owner->ClearUnitState(UNIT_STATE_FLEEING | UNIT_STATE_FLEEING_MOVE);
+ if (owner->GetVictim())
+ owner->SetTarget(owner->EnsureVictim()->GetGUID());
+}
+
+template<class T>
+void FleeingMovementGenerator<T>::DoReset(T* owner)
+{
+ DoInitialize(owner);
+}
+
+template<class T>
+bool FleeingMovementGenerator<T>::DoUpdate(T* owner, uint32 diff)
+{
+ if (!owner || !owner->IsAlive())
+ return false;
+
+ if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || owner->IsMovementPreventedByCasting())
+ {
+ _interrupt = true;
+ owner->StopMoving();
+ return true;
+ }
+ else
+ _interrupt = false;
+
+ _timer.Update(diff);
+ if (!_interrupt && _timer.Passed() && owner->movespline->Finalized())
+ SetTargetLocation(owner);
+
+ return true;
+}
+
+template<class T>
+void FleeingMovementGenerator<T>::SetTargetLocation(T* owner)
+{
+ if (!owner)
return;
- if (owner->IsMovementPreventedByCasting())
+ if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || owner->IsMovementPreventedByCasting())
{
- owner->CastStop();
+ _interrupt = true;
+ owner->StopMoving();
return;
}
owner->AddUnitState(UNIT_STATE_FLEEING_MOVE);
- float x, y, z;
- _getPoint(owner, x, y, z);
+ Position destination = owner->GetPosition();
+ GetPoint(owner, destination);
// Add LOS check for target point
- Position mypos = owner->GetPosition();
- bool isInLOS = VMAP::VMapFactory::createOrGetVMapManager()->isInLineOfSight(
- PhasingHandler::GetTerrainMapId(owner->GetPhaseShift(), owner->GetMap(), mypos.m_positionX, mypos.m_positionY),
- mypos.m_positionX, mypos.m_positionY, mypos.m_positionZ + 2.0f, x, y, z + 2.0f, VMAP::ModelIgnoreFlags::Nothing);
- if (!isInLOS)
+ Position currentPosition = owner->GetPosition();
+ if (!VMAP::VMapFactory::createOrGetVMapManager()->isInLineOfSight(PhasingHandler::GetTerrainMapId(owner->GetPhaseShift(), owner->GetMap(), currentPosition.m_positionX, currentPosition.m_positionY), currentPosition.m_positionX, currentPosition.m_positionY, currentPosition.m_positionZ + 2.0f, destination.GetPositionX(), destination.GetPositionY(), destination.GetPositionZ() + 2.0f, VMAP::ModelIgnoreFlags::Nothing))
{
- i_nextCheckTime.Reset(200);
+ _timer.Reset(200);
return;
}
- PathGenerator path(owner);
- path.SetPathLengthLimit(30.0f);
- bool result = path.CalculatePath(x, y, z);
- if (!result || (path.GetPathType() & PATHFIND_NOPATH))
+ if (!_path)
+ _path = new PathGenerator(owner);
+
+ _path->SetPathLengthLimit(30.0f);
+ bool result = _path->CalculatePath(destination.GetPositionX(), destination.GetPositionY(), destination.GetPositionZ());
+ if (!result || (_path->GetPathType() & PATHFIND_NOPATH))
{
- i_nextCheckTime.Reset(100);
+ _timer.Reset(100);
return;
}
Movement::MoveSplineInit init(owner);
- init.MovebyPath(path.GetPath());
+ init.MovebyPath(_path->GetPath());
init.SetWalk(false);
int32 traveltime = init.Launch();
- i_nextCheckTime.Reset(traveltime + urand(800, 1500));
+ _timer.Reset(traveltime + urand(800, 1500));
}
template<class T>
-void FleeingMovementGenerator<T>::_getPoint(T* owner, float &x, float &y, float &z)
+void FleeingMovementGenerator<T>::GetPoint(T* owner, Position &position)
{
- float dist_from_caster, angle_to_caster;
- if (Unit* fright = ObjectAccessor::GetUnit(*owner, i_frightGUID))
+ float casterDistance, casterAngle;
+ if (Unit* fleeTarget = ObjectAccessor::GetUnit(*owner, _fleeTargetGUID))
{
- dist_from_caster = fright->GetDistance(owner);
- if (dist_from_caster > 0.2f)
- angle_to_caster = fright->GetAngle(owner);
+ casterDistance = fleeTarget->GetDistance(owner);
+ if (casterDistance > 0.2f)
+ casterAngle = fleeTarget->GetAngle(owner);
else
- angle_to_caster = frand(0, 2 * static_cast<float>(M_PI));
+ casterAngle = frand(0.0f, 2.0f * float(M_PI));
}
else
{
- dist_from_caster = 0.0f;
- angle_to_caster = frand(0, 2 * static_cast<float>(M_PI));
+ casterDistance = 0.0f;
+ casterAngle = frand(0.0f, 2.0f * float(M_PI));
}
- float dist, angle;
- if (dist_from_caster < MIN_QUIET_DISTANCE)
+ float distance, angle;
+ if (casterDistance < MIN_QUIET_DISTANCE)
{
- dist = frand(0.4f, 1.3f)*(MIN_QUIET_DISTANCE - dist_from_caster);
- angle = angle_to_caster + frand(-static_cast<float>(M_PI)/8, static_cast<float>(M_PI)/8);
+ distance = frand(0.4f, 1.3f) * (MIN_QUIET_DISTANCE - casterDistance);
+ angle = casterAngle + frand(-float(M_PI) / 8.0f, float(M_PI) / 8.0f);
}
- else if (dist_from_caster > MAX_QUIET_DISTANCE)
+ else if (casterDistance > MAX_QUIET_DISTANCE)
{
- dist = frand(0.4f, 1.0f)*(MAX_QUIET_DISTANCE - MIN_QUIET_DISTANCE);
- angle = -angle_to_caster + frand(-static_cast<float>(M_PI)/4, static_cast<float>(M_PI)/4);
+ distance = frand(0.4f, 1.0f) * (MAX_QUIET_DISTANCE - MIN_QUIET_DISTANCE);
+ angle = -casterAngle + frand(-float(M_PI) / 4.0f, float(M_PI) / 4.0f);
}
else // we are inside quiet range
{
- dist = frand(0.6f, 1.2f)*(MAX_QUIET_DISTANCE - MIN_QUIET_DISTANCE);
- angle = frand(0, 2*static_cast<float>(M_PI));
+ distance = frand(0.6f, 1.2f) * (MAX_QUIET_DISTANCE - MIN_QUIET_DISTANCE);
+ angle = frand(0.0f, 2.0f * float(M_PI));
}
- Position pos = owner->GetFirstCollisionPosition(dist, angle);
- x = pos.m_positionX;
- y = pos.m_positionY;
- z = pos.m_positionZ;
-}
-
-template<class T>
-void FleeingMovementGenerator<T>::DoInitialize(T* owner)
-{
- if (!owner)
- return;
-
- owner->AddUnitFlag(UNIT_FLAG_FLEEING);
- owner->AddUnitState(UNIT_STATE_FLEEING | UNIT_STATE_FLEEING_MOVE);
- _setTargetLocation(owner);
+ owner->MovePositionToFirstCollision(position, distance, angle);
}
-template<>
-void FleeingMovementGenerator<Player>::DoFinalize(Player* owner)
-{
- owner->RemoveUnitFlag(UNIT_FLAG_FLEEING);
- owner->ClearUnitState(UNIT_STATE_FLEEING | UNIT_STATE_FLEEING_MOVE);
- owner->StopMoving();
-}
-
-template<>
-void FleeingMovementGenerator<Creature>::DoFinalize(Creature* owner)
-{
- owner->RemoveUnitFlag(UNIT_FLAG_FLEEING);
- owner->ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
- if (owner->GetVictim())
- owner->SetTarget(owner->EnsureVictim()->GetGUID());
-}
+template FleeingMovementGenerator<Player>::~FleeingMovementGenerator();
+template FleeingMovementGenerator<Creature>::~FleeingMovementGenerator();
+template void FleeingMovementGenerator<Player>::DoInitialize(Player*);
+template void FleeingMovementGenerator<Creature>::DoInitialize(Creature*);
+template void FleeingMovementGenerator<Player>::DoReset(Player*);
+template void FleeingMovementGenerator<Creature>::DoReset(Creature*);
+template bool FleeingMovementGenerator<Player>::DoUpdate(Player*, uint32);
+template bool FleeingMovementGenerator<Creature>::DoUpdate(Creature*, uint32);
+template void FleeingMovementGenerator<Player>::SetTargetLocation(Player*);
+template void FleeingMovementGenerator<Creature>::SetTargetLocation(Creature*);
+template void FleeingMovementGenerator<Player>::GetPoint(Player*, Position &);
+template void FleeingMovementGenerator<Creature>::GetPoint(Creature*, Position &);
-template<class T>
-void FleeingMovementGenerator<T>::DoReset(T* owner)
-{
- DoInitialize(owner);
-}
+//---- TimedFleeingMovementGenerator
-template<class T>
-bool FleeingMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
+bool TimedFleeingMovementGenerator::Update(Unit* owner, uint32 time_diff)
{
- if (!owner || !owner->IsAlive())
+ if (!owner->IsAlive())
return false;
- if (owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
- {
- owner->ClearUnitState(UNIT_STATE_FLEEING_MOVE);
- return true;
- }
-
- i_nextCheckTime.Update(time_diff);
- if (i_nextCheckTime.Passed() && owner->movespline->Finalized())
- _setTargetLocation(owner);
+ _totalFleeTime.Update(time_diff);
+ if (_totalFleeTime.Passed())
+ return false;
- return true;
+ // This calls grant-parent Update method hiden by FleeingMovementGenerator::Update(Creature &, 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);
}
-template void FleeingMovementGenerator<Player>::DoInitialize(Player*);
-template void FleeingMovementGenerator<Creature>::DoInitialize(Creature*);
-template void FleeingMovementGenerator<Player>::_getPoint(Player*, float&, float&, float&);
-template void FleeingMovementGenerator<Creature>::_getPoint(Creature*, float&, float&, float&);
-template void FleeingMovementGenerator<Player>::_setTargetLocation(Player*);
-template void FleeingMovementGenerator<Creature>::_setTargetLocation(Creature*);
-template void FleeingMovementGenerator<Player>::DoReset(Player*);
-template void FleeingMovementGenerator<Creature>::DoReset(Creature*);
-template bool FleeingMovementGenerator<Player>::DoUpdate(Player*, uint32);
-template bool FleeingMovementGenerator<Creature>::DoUpdate(Creature*, uint32);
-
void TimedFleeingMovementGenerator::Finalize(Unit* owner)
{
owner->RemoveUnitFlag(UNIT_FLAG_FLEEING);
- owner->ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
+ owner->ClearUnitState(UNIT_STATE_FLEEING);
+ owner->StopMoving();
if (Unit* victim = owner->GetVictim())
{
if (owner->IsAlive())
@@ -194,23 +221,3 @@ void TimedFleeingMovementGenerator::Finalize(Unit* owner)
}
}
}
-
-bool TimedFleeingMovementGenerator::Update(Unit* owner, uint32 time_diff)
-{
- if (!owner->IsAlive())
- return false;
-
- 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;
-
- // This calls grant-parent Update method hiden by FleeingMovementGenerator::Update(Creature &, 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 025e783be5b..7481e340154 100755
--- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h
@@ -19,41 +19,43 @@
#define TRINITY_FLEEINGMOVEMENTGENERATOR_H
#include "MovementGenerator.h"
+#include "Timer.h"
template<class T>
class FleeingMovementGenerator : public MovementGeneratorMedium< T, FleeingMovementGenerator<T> >
{
public:
- FleeingMovementGenerator(ObjectGuid fright) : i_frightGUID(fright), i_nextCheckTime(0) { }
+ explicit FleeingMovementGenerator(ObjectGuid fleeTargetGUID) : _path(nullptr), _fleeTargetGUID(fleeTargetGUID), _timer(0), _interrupt(false) { }
+ ~FleeingMovementGenerator();
+
+ MovementGeneratorType GetMovementGeneratorType() const override { return FLEEING_MOTION_TYPE; }
void DoInitialize(T*);
void DoFinalize(T*);
void DoReset(T*);
bool DoUpdate(T*, uint32);
- MovementGeneratorType GetMovementGeneratorType() const override { return FLEEING_MOTION_TYPE; }
-
private:
- void _setTargetLocation(T*);
- void _getPoint(T*, float &x, float &y, float &z);
+ void SetTargetLocation(T*);
+ void GetPoint(T*, Position &position);
- ObjectGuid i_frightGUID;
- TimeTracker i_nextCheckTime;
+ PathGenerator* _path;
+ ObjectGuid _fleeTargetGUID;
+ TimeTracker _timer;
+ bool _interrupt;
};
class TimedFleeingMovementGenerator : public FleeingMovementGenerator<Creature>
{
public:
- TimedFleeingMovementGenerator(ObjectGuid fright, uint32 time) :
- FleeingMovementGenerator<Creature>(fright),
- i_totalFleeTime(time) { }
+ explicit TimedFleeingMovementGenerator(ObjectGuid fleeTargetGUID, uint32 time) : FleeingMovementGenerator<Creature>(fleeTargetGUID), _totalFleeTime(time) { }
MovementGeneratorType GetMovementGeneratorType() const override { return TIMED_FLEEING_MOTION_TYPE; }
bool Update(Unit*, uint32) override;
void Finalize(Unit*) override;
private:
- TimeTracker i_totalFleeTime;
+ TimeTracker _totalFleeTime;
};
#endif
diff --git a/src/server/game/Movement/MovementGenerators/FormationMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FormationMovementGenerator.cpp
new file mode 100644
index 00000000000..a1382ec673e
--- /dev/null
+++ b/src/server/game/Movement/MovementGenerators/FormationMovementGenerator.cpp
@@ -0,0 +1,130 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Creature.h"
+#include "CreatureAI.h"
+#include "MoveSplineInit.h"
+#include "MoveSpline.h"
+#include "FormationMovementGenerator.h"
+
+void FormationMovementGenerator::DoInitialize(Creature* owner)
+{
+ owner->AddUnitState(UNIT_STATE_ROAMING);
+
+ if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || owner->IsMovementPreventedByCasting())
+ {
+ _interrupt = true;
+ owner->StopMoving();
+ return;
+ }
+
+ owner->AddUnitState(UNIT_STATE_ROAMING_MOVE);
+
+ Movement::MoveSplineInit init(owner);
+ init.MoveTo(_destination.GetPositionX(), _destination.GetPositionY(), _destination.GetPositionZ());
+ if (_orientation)
+ init.SetFacing(_destination.GetOrientation());
+
+ switch (_moveType)
+ {
+ case 2: // WAYPOINT_MOVE_TYPE_LAND
+ init.SetAnimation(Movement::ToGround);
+ break;
+ case 3: // WAYPOINT_MOVE_TYPE_TAKEOFF
+ init.SetAnimation(Movement::ToFly);
+ break;
+ case 1: // WAYPOINT_MOVE_TYPE_RUN
+ init.SetWalk(false);
+ break;
+ case 0: // WAYPOINT_MOVE_TYPE_WALK
+ init.SetWalk(true);
+ break;
+ }
+
+ if (_run)
+ init.SetWalk(false);
+
+ init.Launch();
+}
+
+bool FormationMovementGenerator::DoUpdate(Creature* owner, uint32 /*diff*/)
+{
+ if (!owner)
+ return false;
+
+ if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || owner->IsMovementPreventedByCasting())
+ {
+ _interrupt = true;
+ owner->StopMoving();
+ return true;
+ }
+
+ if ((_interrupt && owner->movespline->Finalized()) || (_recalculateSpeed && !owner->movespline->Finalized()))
+ {
+ _recalculateSpeed = false;
+ _interrupt = false;
+
+ owner->AddUnitState(UNIT_STATE_ROAMING_MOVE);
+
+ Movement::MoveSplineInit init(owner);
+ init.MoveTo(_destination.GetPositionX(), _destination.GetPositionY(), _destination.GetPositionZ());
+ if (_orientation)
+ init.SetFacing(_destination.GetOrientation());
+
+ switch (_moveType)
+ {
+ case 2: // WAYPOINT_MOVE_TYPE_LAND
+ init.SetAnimation(Movement::ToGround);
+ break;
+ case 3: // WAYPOINT_MOVE_TYPE_TAKEOFF
+ init.SetAnimation(Movement::ToFly);
+ break;
+ case 1: // WAYPOINT_MOVE_TYPE_RUN
+ init.SetWalk(false);
+ break;
+ case 0: // WAYPOINT_MOVE_TYPE_WALK
+ init.SetWalk(true);
+ break;
+ }
+
+ if (_run)
+ init.SetWalk(false);
+ init.Launch();
+ }
+
+ return !owner->movespline->Finalized();
+}
+
+void FormationMovementGenerator::DoFinalize(Creature* owner)
+{
+ owner->ClearUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE);
+
+ if (owner->movespline->Finalized())
+ MovementInform(owner);
+}
+
+void FormationMovementGenerator::DoReset(Creature* owner)
+{
+ owner->StopMoving();
+ DoInitialize(owner);
+}
+
+void FormationMovementGenerator::MovementInform(Creature* owner)
+{
+ if (owner->AI())
+ owner->AI()->MovementInform(FORMATION_MOTION_TYPE, _movementId);
+}
diff --git a/src/server/game/Movement/MovementGenerators/FormationMovementGenerator.h b/src/server/game/Movement/MovementGenerators/FormationMovementGenerator.h
new file mode 100644
index 00000000000..27ab7d50da5
--- /dev/null
+++ b/src/server/game/Movement/MovementGenerators/FormationMovementGenerator.h
@@ -0,0 +1,49 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef TRINITY_FORMATIONMOVEMENTGENERATOR_H
+#define TRINITY_FORMATIONMOVEMENTGENERATOR_H
+
+#include "MovementGenerator.h"
+
+class FormationMovementGenerator : public MovementGeneratorMedium< Creature, FormationMovementGenerator >
+{
+ public:
+ explicit FormationMovementGenerator(uint32 id, Position destination, uint32 moveType, bool run, bool orientation) : _movementId(id), _destination(destination), _moveType(moveType), _run(run), _orientation(orientation), _recalculateSpeed(false), _interrupt(false) { }
+
+ MovementGeneratorType GetMovementGeneratorType() const override { return FORMATION_MOTION_TYPE; }
+
+ void DoInitialize(Creature*);
+ void DoFinalize(Creature*);
+ void DoReset(Creature*);
+ bool DoUpdate(Creature*, uint32);
+
+ void UnitSpeedChanged() override { _recalculateSpeed = true; }
+
+ private:
+ void MovementInform(Creature*);
+
+ uint32 _movementId;
+ Position _destination;
+ uint32 _moveType;
+ bool _run;
+ bool _orientation;
+ bool _recalculateSpeed;
+ bool _interrupt;
+};
+
+#endif // TRINITY_FORMATIONMOVEMENTGENERATOR_H
diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
index e8fa2ba6c53..041961ce91c 100644
--- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
@@ -15,36 +15,31 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "HomeMovementGenerator.h"
#include "Creature.h"
#include "CreatureAI.h"
#include "MoveSplineInit.h"
#include "MoveSpline.h"
+#include "PathGenerator.h"
+#include "HomeMovementGenerator.h"
-void HomeMovementGenerator<Creature>::DoInitialize(Creature* owner)
-{
- _setTargetLocation(owner);
-}
+template<class T>
+HomeMovementGenerator<T>::~HomeMovementGenerator() { }
-void HomeMovementGenerator<Creature>::DoFinalize(Creature* owner)
+template<>
+HomeMovementGenerator<Creature>::~HomeMovementGenerator()
{
- if (arrived)
- {
- owner->ClearUnitState(UNIT_STATE_EVADE);
- owner->SetWalk(true);
- owner->LoadCreaturesAddon();
- owner->AI()->JustReachedHome();
- owner->SetSpawnHealth();
- }
+ delete _path;
}
-void HomeMovementGenerator<Creature>::DoReset(Creature*) { }
+template<class T>
+void HomeMovementGenerator<T>::SetTargetLocation(T*) { }
-void HomeMovementGenerator<Creature>::_setTargetLocation(Creature* owner)
+template<>
+void HomeMovementGenerator<Creature>::SetTargetLocation(Creature* owner)
{
if (owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
{ // if we are ROOT/STUNNED/DISTRACTED even after aura clear, finalize on next update - otherwise we would get stuck in evade
- skipToHome = true;
+ _skipToHome = true;
return;
}
@@ -60,14 +55,55 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature* owner)
init.SetWalk(false);
init.Launch();
- skipToHome = false;
- arrived = false;
+ _skipToHome = false;
+ _arrived = false;
owner->ClearUnitState(UNIT_STATE_ALL_ERASABLE & ~UNIT_STATE_EVADE);
}
-bool HomeMovementGenerator<Creature>::DoUpdate(Creature* owner, const uint32 /*time_diff*/)
+template<class T>
+void HomeMovementGenerator<T>::DoInitialize(T*) { }
+
+template<>
+void HomeMovementGenerator<Creature>::DoInitialize(Creature* owner)
+{
+ SetTargetLocation(owner);
+}
+
+template<class T>
+void HomeMovementGenerator<T>::DoFinalize(T*) { }
+
+template<>
+void HomeMovementGenerator<Creature>::DoFinalize(Creature* owner)
+{
+ if (_arrived)
+ {
+ owner->ClearUnitState(UNIT_STATE_EVADE);
+ owner->SetWalk(true);
+ owner->LoadCreaturesAddon();
+ owner->AI()->JustReachedHome();
+ owner->SetSpawnHealth();
+ }
+}
+
+template<class T>
+void HomeMovementGenerator<T>::DoReset(T*) { }
+
+template<>
+void HomeMovementGenerator<Creature>::DoReset(Creature* owner)
+{
+ DoInitialize(owner);
+}
+
+template<class T>
+bool HomeMovementGenerator<T>::DoUpdate(T*, uint32)
+{
+ return false;
+}
+
+template<>
+bool HomeMovementGenerator<Creature>::DoUpdate(Creature* owner, uint32 /*diff*/)
{
- arrived = skipToHome || owner->movespline->Finalized();
- return !arrived;
+ _arrived = _skipToHome || owner->movespline->Finalized();
+ return !_arrived;
}
diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h
index d3489a249f3..5e1c25d9361 100644
--- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h
@@ -20,28 +20,26 @@
#include "MovementGenerator.h"
-class Creature;
-
-template < class T >
-class HomeMovementGenerator;
-
-template <>
-class HomeMovementGenerator<Creature> : public MovementGeneratorMedium< Creature, HomeMovementGenerator<Creature> >
+template <class T>
+class HomeMovementGenerator : public MovementGeneratorMedium< T, HomeMovementGenerator<T> >
{
public:
+ explicit HomeMovementGenerator() : _path(nullptr), _arrived(false), _skipToHome(false) { }
+ ~HomeMovementGenerator();
- HomeMovementGenerator() : arrived(false), skipToHome(false) { }
- ~HomeMovementGenerator() { }
-
- void DoInitialize(Creature*);
- void DoFinalize(Creature*);
- void DoReset(Creature*);
- bool DoUpdate(Creature*, const uint32);
MovementGeneratorType GetMovementGeneratorType() const override { return HOME_MOTION_TYPE; }
+ void DoInitialize(T*);
+ void DoFinalize(T*);
+ void DoReset(T*);
+ bool DoUpdate(T*, uint32);
+
private:
- void _setTargetLocation(Creature*);
- bool arrived;
- bool skipToHome;
+ void SetTargetLocation(T*);
+
+ PathGenerator* _path;
+ bool _arrived;
+ bool _skipToHome;
};
+
#endif
diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp
index 811dc54fa79..76b1aca3cc2 100644
--- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp
@@ -35,6 +35,8 @@ void IdleMovementGenerator::Reset(Unit* owner)
owner->StopMoving();
}
+//----------------------------------------------------//
+
void RotateMovementGenerator::Initialize(Unit* owner)
{
if (!owner->IsStopped())
@@ -50,27 +52,29 @@ void RotateMovementGenerator::Initialize(Unit* owner)
bool RotateMovementGenerator::Update(Unit* owner, uint32 diff)
{
float angle = owner->GetOrientation();
- angle += (float(diff) * static_cast<float>(M_PI * 2) / m_maxDuration) * (m_direction == ROTATE_DIRECTION_LEFT ? 1.0f : -1.0f);
+ angle += (float(diff) * static_cast<float>(M_PI * 2) / _maxDuration) * (_direction == ROTATE_DIRECTION_LEFT ? 1.0f : -1.0f);
angle = G3D::wrap(angle, 0.0f, float(G3D::twoPi()));
owner->SetOrientation(angle); // UpdateSplinePosition does not set orientation with UNIT_STATE_ROTATING
owner->SetFacingTo(angle); // Send spline movement to clients
- if (m_duration > diff)
- m_duration -= diff;
+ if (_duration > diff)
+ _duration -= diff;
else
return false;
return true;
}
-void RotateMovementGenerator::Finalize(Unit* unit)
+void RotateMovementGenerator::Finalize(Unit* owner)
{
- unit->ClearUnitState(UNIT_STATE_ROTATING);
- if (unit->GetTypeId() == TYPEID_UNIT)
- unit->ToCreature()->AI()->MovementInform(ROTATE_MOTION_TYPE, 0);
+ owner->ClearUnitState(UNIT_STATE_ROTATING);
+ if (owner->GetTypeId() == TYPEID_UNIT)
+ owner->ToCreature()->AI()->MovementInform(ROTATE_MOTION_TYPE, 0);
}
+//----------------------------------------------------//
+
void DistractMovementGenerator::Initialize(Unit* owner)
{
// Distracted creatures stand up if not standing
@@ -92,17 +96,19 @@ void DistractMovementGenerator::Finalize(Unit* owner)
}
}
-bool DistractMovementGenerator::Update(Unit* /*owner*/, uint32 time_diff)
+bool DistractMovementGenerator::Update(Unit* /*owner*/, uint32 diff)
{
- if (time_diff > m_timer)
+ if (diff > _timer)
return false;
- m_timer -= time_diff;
+ _timer -= diff;
return true;
}
-void AssistanceDistractMovementGenerator::Finalize(Unit* unit)
+//----------------------------------------------------//
+
+void AssistanceDistractMovementGenerator::Finalize(Unit* owner)
{
- unit->ClearUnitState(UNIT_STATE_DISTRACTED);
- unit->ToCreature()->SetReactState(REACT_AGGRESSIVE);
+ owner->ClearUnitState(UNIT_STATE_DISTRACTED);
+ owner->ToCreature()->SetReactState(REACT_AGGRESSIVE);
}
diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h
index 022bda5a394..9bb58419433 100755
--- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h
@@ -19,11 +19,11 @@
#define TRINITY_IDLEMOVEMENTGENERATOR_H
#include "MovementGenerator.h"
+#include "Timer.h"
class IdleMovementGenerator : public MovementGenerator
{
public:
-
void Initialize(Unit*) override;
void Finalize(Unit*) override { }
void Reset(Unit*) override;
@@ -36,7 +36,7 @@ TC_GAME_API extern IdleMovementGenerator si_idleMovement;
class RotateMovementGenerator : public MovementGenerator
{
public:
- explicit RotateMovementGenerator(uint32 time, RotateDirection direction) : m_duration(time), m_maxDuration(time), m_direction(direction) { }
+ explicit RotateMovementGenerator(uint32 time, RotateDirection direction) : _duration(time), _maxDuration(time), _direction(direction) { }
void Initialize(Unit*) override;
void Finalize(Unit*) override;
@@ -45,14 +45,14 @@ class RotateMovementGenerator : public MovementGenerator
MovementGeneratorType GetMovementGeneratorType() const override { return ROTATE_MOTION_TYPE; }
private:
- uint32 m_duration, m_maxDuration;
- RotateDirection m_direction;
+ uint32 _duration, _maxDuration;
+ RotateDirection _direction;
};
class DistractMovementGenerator : public MovementGenerator
{
public:
- explicit DistractMovementGenerator(uint32 timer) : m_timer(timer) { }
+ explicit DistractMovementGenerator(uint32 timer) : _timer(timer) { }
void Initialize(Unit*) override;
void Finalize(Unit*) override;
@@ -61,14 +61,13 @@ class DistractMovementGenerator : public MovementGenerator
MovementGeneratorType GetMovementGeneratorType() const override { return DISTRACT_MOTION_TYPE; }
private:
- uint32 m_timer;
+ uint32 _timer;
};
class AssistanceDistractMovementGenerator : public DistractMovementGenerator
{
public:
- AssistanceDistractMovementGenerator(uint32 timer) :
- DistractMovementGenerator(timer) { }
+ explicit AssistanceDistractMovementGenerator(uint32 timer) : DistractMovementGenerator(timer) { }
MovementGeneratorType GetMovementGeneratorType() const override { return ASSISTANCE_DISTRACT_MOTION_TYPE; }
void Finalize(Unit*) override;
diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
index 3cf0711dc41..ff3a2699128 100755
--- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
@@ -15,33 +15,42 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "PointMovementGenerator.h"
-#include "Errors.h"
-#include "Creature.h"
#include "CreatureAI.h"
-#include "World.h"
+#include "Creature.h"
+#include "CreatureGroups.h"
+#include "Player.h"
#include "MoveSplineInit.h"
#include "MoveSpline.h"
-#include "Player.h"
-#include "CreatureGroups.h"
#include "ObjectAccessor.h"
+#include "World.h"
+#include "PointMovementGenerator.h"
//----- Point Movement Generator
+
template<class T>
-void PointMovementGenerator<T>::DoInitialize(T* unit)
+void PointMovementGenerator<T>::DoInitialize(T* owner)
{
- if (!unit->IsStopped())
- unit->StopMoving();
+ if (_movementId == EVENT_CHARGE_PREPATH)
+ {
+ owner->AddUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE);
+ return;
+ }
- unit->AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
+ owner->AddUnitState(UNIT_STATE_ROAMING);
- if (id == EVENT_CHARGE_PREPATH)
+ if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || owner->IsMovementPreventedByCasting())
+ {
+ _interrupt = true;
+ owner->StopMoving();
return;
+ }
- Movement::MoveSplineInit init(unit);
- init.MoveTo(i_x, i_y, i_z, m_generatePath);
- if (speed > 0.0f)
- init.SetVelocity(speed);
+ owner->AddUnitState(UNIT_STATE_ROAMING_MOVE);
+
+ Movement::MoveSplineInit init(owner);
+ init.MoveTo(_destination.GetPositionX(), _destination.GetPositionY(), _destination.GetPositionZ(), _generatePath);
+ if (_speed > 0.0f)
+ init.SetVelocity(_speed);
if (i_faceTarget)
init.SetFacing(i_faceTarget);
if (i_spellEffectExtra)
@@ -49,69 +58,73 @@ void PointMovementGenerator<T>::DoInitialize(T* unit)
init.Launch();
// Call for creature group update
- if (Creature* creature = unit->ToCreature())
+ if (Creature* creature = owner->ToCreature())
if (creature->GetFormation() && creature->GetFormation()->getLeader() == creature)
- creature->GetFormation()->LeaderMoveTo(i_x, i_y, i_z);
+ creature->GetFormation()->LeaderMoveTo(_destination, _movementId);
}
template<class T>
-bool PointMovementGenerator<T>::DoUpdate(T* unit, uint32 /*diff*/)
+bool PointMovementGenerator<T>::DoUpdate(T* owner, uint32 /*diff*/)
{
- if (!unit)
+ if (!owner)
return false;
- if (unit->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
+ if (_movementId == EVENT_CHARGE_PREPATH)
+ return !owner->movespline->Finalized();
+
+ if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || owner->IsMovementPreventedByCasting())
{
- unit->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
+ _interrupt = true;
+ owner->StopMoving();
return true;
}
- unit->AddUnitState(UNIT_STATE_ROAMING_MOVE);
-
- if (id != EVENT_CHARGE_PREPATH && i_recalculateSpeed && !unit->movespline->Finalized())
+ if ((_interrupt && owner->movespline->Finalized()) || (_recalculateSpeed && !owner->movespline->Finalized()))
{
- i_recalculateSpeed = false;
- Movement::MoveSplineInit init(unit);
- init.MoveTo(i_x, i_y, i_z, m_generatePath);
- if (speed > 0.0f) // Default value for point motion type is 0.0, if 0.0 spline will use GetSpeed on unit
- init.SetVelocity(speed);
+ _recalculateSpeed = false;
+ _interrupt = false;
+
+ owner->AddUnitState(UNIT_STATE_ROAMING_MOVE);
+
+ Movement::MoveSplineInit init(owner);
+ init.MoveTo(_destination.GetPositionX(), _destination.GetPositionY(), _destination.GetPositionZ(), _generatePath);
+ if (_speed > 0.0f) // Default value for point motion type is 0.0, if 0.0 spline will use GetSpeed on unit
+ init.SetVelocity(_speed);
init.Launch();
// Call for creature group update
- if (Creature* creature = unit->ToCreature())
+ if (Creature* creature = owner->ToCreature())
if (creature->GetFormation() && creature->GetFormation()->getLeader() == creature)
- creature->GetFormation()->LeaderMoveTo(i_x, i_y, i_z);
+ creature->GetFormation()->LeaderMoveTo(_destination, _movementId);
}
- return !unit->movespline->Finalized();
+ return !owner->movespline->Finalized();
}
template<class T>
-void PointMovementGenerator<T>::DoFinalize(T* unit)
+void PointMovementGenerator<T>::DoFinalize(T* owner)
{
- if (unit->HasUnitState(UNIT_STATE_CHARGING))
- unit->ClearUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE);
+ owner->ClearUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE);
- if (unit->movespline->Finalized())
- MovementInform(unit);
+ if (owner->movespline->Finalized())
+ MovementInform(owner);
}
template<class T>
-void PointMovementGenerator<T>::DoReset(T* unit)
+void PointMovementGenerator<T>::DoReset(T* owner)
{
- if (!unit->IsStopped())
- unit->StopMoving();
-
- unit->AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
+ owner->StopMoving();
+ DoInitialize(owner);
}
template<class T>
-void PointMovementGenerator<T>::MovementInform(T* /*unit*/) { }
+void PointMovementGenerator<T>::MovementInform(T*) { }
-template <> void PointMovementGenerator<Creature>::MovementInform(Creature* unit)
+template <>
+void PointMovementGenerator<Creature>::MovementInform(Creature* owner)
{
- if (unit->AI())
- unit->AI()->MovementInform(POINT_MOTION_TYPE, id);
+ if (owner->AI())
+ owner->AI()->MovementInform(POINT_MOTION_TYPE, _movementId);
}
template void PointMovementGenerator<Player>::DoInitialize(Player*);
@@ -123,34 +136,36 @@ template void PointMovementGenerator<Creature>::DoReset(Creature*);
template bool PointMovementGenerator<Player>::DoUpdate(Player*, uint32);
template bool PointMovementGenerator<Creature>::DoUpdate(Creature*, uint32);
-void AssistanceMovementGenerator::Finalize(Unit* unit)
+//---- AssistanceMovementGenerator
+
+void AssistanceMovementGenerator::Finalize(Unit* owner)
+{
+ owner->ClearUnitState(UNIT_STATE_ROAMING);
+ owner->StopMoving();
+ owner->ToCreature()->SetNoCallAssistance(false);
+ owner->ToCreature()->CallAssistance();
+ if (owner->IsAlive())
+ owner->GetMotionMaster()->MoveSeekAssistanceDistract(sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY));
+}
+
+//---- EffectMovementGenerator
+
+bool EffectMovementGenerator::Update(Unit* owner, uint32 /*diff*/)
{
- unit->ToCreature()->SetNoCallAssistance(false);
- unit->ToCreature()->CallAssistance();
- if (unit->IsAlive())
- unit->GetMotionMaster()->MoveSeekAssistanceDistract(sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY));
+ return !owner->movespline->Finalized();
}
-bool EffectMovementGenerator::Update(Unit* unit, uint32)
+void EffectMovementGenerator::Finalize(Unit* owner)
{
- return !unit->movespline->Finalized();
+ MovementInform(owner);
}
-void EffectMovementGenerator::Finalize(Unit* unit)
+void EffectMovementGenerator::MovementInform(Unit* owner)
{
if (_arrivalSpellId)
- unit->CastSpell(ObjectAccessor::GetUnit(*unit, _arrivalSpellTargetGuid), _arrivalSpellId, true);
-
- if (unit->GetTypeId() != TYPEID_UNIT)
- return;
-
- // 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);
- }
+ owner->CastSpell(ObjectAccessor::GetUnit(*owner, _arrivalSpellTargetGuid), _arrivalSpellId, true);
- if (unit->ToCreature()->AI())
- unit->ToCreature()->AI()->MovementInform(EFFECT_MOTION_TYPE, _id);
+ if (Creature* creature = owner->ToCreature())
+ if (creature->AI())
+ creature->AI()->MovementInform(EFFECT_MOTION_TYPE, _pointId);
}
diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
index 7b5451daa9e..18f552cc1cd 100644
--- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
@@ -19,7 +19,6 @@
#define TRINITY_POINTMOVEMENTGENERATOR_H
#include "MovementGenerator.h"
-#include "FollowerReference.h"
class Creature;
namespace Movement
@@ -31,56 +30,54 @@ template<class T>
class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementGenerator<T> >
{
public:
- PointMovementGenerator(uint32 _id, float _x, float _y, float _z, bool _generatePath, float _speed = 0.0f, Unit const* faceTarget = nullptr,
- Movement::SpellEffectExtraData const* spellEffectExtraData = nullptr) : id(_id),
- i_x(_x), i_y(_y), i_z(_z), speed(_speed), i_faceTarget(faceTarget), i_spellEffectExtra(spellEffectExtraData),
- m_generatePath(_generatePath), i_recalculateSpeed(false) { }
+explicit PointMovementGenerator(uint32 id, float x, float y, float z, bool generatePath, float speed = 0.0f, Unit const* faceTarget = nullptr, Movement::SpellEffectExtraData const* spellEffectExtraData = nullptr) : _movementId(id), _destination(x, y, z), _speed(speed), i_faceTarget(faceTarget), i_spellEffectExtra(spellEffectExtraData), _generatePath(generatePath), _recalculateSpeed(false), _interrupt(false) { }
+
+ MovementGeneratorType GetMovementGeneratorType() const override { return POINT_MOTION_TYPE; }
void DoInitialize(T*);
void DoFinalize(T*);
void DoReset(T*);
bool DoUpdate(T*, uint32);
- void MovementInform(T*);
-
- void unitSpeedChanged() override { i_recalculateSpeed = true; }
-
- MovementGeneratorType GetMovementGeneratorType() const override { return POINT_MOTION_TYPE; }
+ void UnitSpeedChanged() override { _recalculateSpeed = true; }
- void GetDestination(float& x, float& y, float& z) const { x = i_x; y = i_y; z = i_z; }
private:
- uint32 id;
- float i_x, i_y, i_z;
- float speed;
+ void MovementInform(T*);
+
+ uint32 _movementId;
+ Position _destination;
+ float _speed;
Unit const* i_faceTarget;
Movement::SpellEffectExtraData const* i_spellEffectExtra;
- bool m_generatePath;
- bool i_recalculateSpeed;
+ bool _generatePath;
+ bool _recalculateSpeed;
+ bool _interrupt;
};
class AssistanceMovementGenerator : public PointMovementGenerator<Creature>
{
public:
- AssistanceMovementGenerator(float _x, float _y, float _z) :
- PointMovementGenerator<Creature>(0, _x, _y, _z, true) { }
+ explicit AssistanceMovementGenerator(float _x, float _y, float _z) : PointMovementGenerator<Creature>(0, _x, _y, _z, true) { }
MovementGeneratorType GetMovementGeneratorType() const override { return ASSISTANCE_MOTION_TYPE; }
void Finalize(Unit*) override;
};
-// Does almost nothing - just doesn't allows previous movegen interrupt current effect.
class EffectMovementGenerator : public MovementGenerator
{
public:
- EffectMovementGenerator(uint32 id, uint32 arrivalSpellId = 0, ObjectGuid const& arrivalSpellTargetGuid = ObjectGuid::Empty)
- : _id(id), _arrivalSpellId(arrivalSpellId), _arrivalSpellTargetGuid(arrivalSpellTargetGuid) { }
+ explicit EffectMovementGenerator(uint32 id, uint32 arrivalSpellId = 0, ObjectGuid const& arrivalSpellTargetGuid = ObjectGuid::Empty) : _pointId(id), _arrivalSpellId(arrivalSpellId), _arrivalSpellTargetGuid(arrivalSpellTargetGuid) { }
+
void Initialize(Unit*) override { }
void Finalize(Unit*) override;
void Reset(Unit*) override { }
bool Update(Unit*, uint32) override;
MovementGeneratorType GetMovementGeneratorType() const override { return EFFECT_MOTION_TYPE; }
+
private:
- uint32 _id;
+ void MovementInform(Unit*);
+
+ uint32 _pointId;
uint32 _arrivalSpellId;
ObjectGuid _arrivalSpellTargetGuid;
};
diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
index 473e63447ed..7b0025d644f 100644
--- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
@@ -16,165 +16,133 @@
*/
#include "Creature.h"
-#include "RandomMovementGenerator.h"
-#include "Map.h"
-#include "Util.h"
#include "CreatureGroups.h"
+#include "Map.h"
#include "MoveSplineInit.h"
#include "MoveSpline.h"
+#include "PathGenerator.h"
#include "Random.h"
+#include "RandomMovementGenerator.h"
-#define RUNNING_CHANCE_RANDOMMV 20 //will be "1 / RUNNING_CHANCE_RANDOMMV"
+template<class T>
+RandomMovementGenerator<T>::~RandomMovementGenerator() { }
template<>
-void RandomMovementGenerator<Creature>::_setRandomLocation(Creature* creature)
+RandomMovementGenerator<Creature>::~RandomMovementGenerator()
{
- if (creature->IsMovementPreventedByCasting())
- {
- creature->CastStop();
+ delete _path;
+}
+
+template<class T>
+void RandomMovementGenerator<T>::DoInitialize(T*) { }
+
+template<>
+void RandomMovementGenerator<Creature>::DoInitialize(Creature* owner)
+{
+ if (!owner || !owner->IsAlive())
return;
- }
- float respX, respY, respZ, respO, destX, destY, destZ, travelDistZ;
- creature->GetHomePosition(respX, respY, respZ, respO);
- Map const* map = creature->GetMap();
+ owner->AddUnitState(UNIT_STATE_ROAMING);
+ owner->GetPosition(_reference.m_positionX, _reference.m_positionY, _reference.m_positionZ);
+ owner->StopMoving();
+
+ if (!_wanderDistance)
+ _wanderDistance = owner->GetRespawnRadius();
- // For 2D/3D system selection
- //bool is_land_ok = creature.CanWalk(); // not used?
- //bool is_water_ok = creature.CanSwim(); // not used?
- bool is_air_ok = creature->CanFly();
+ _timer.Reset(0);
+}
- 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 * std::cos(angle);
- const float distanceY = range * std::sin(angle);
+template<class T>
+void RandomMovementGenerator<T>::DoFinalize(T*) { }
- destX = respX + distanceX;
- destY = respY + distanceY;
+template<>
+void RandomMovementGenerator<Creature>::DoFinalize(Creature* owner)
+{
+ owner->ClearUnitState(UNIT_STATE_ROAMING);
+ owner->StopMoving();
+ owner->SetWalk(false);
+}
- // prevent invalid coordinates generation
- Trinity::NormalizeMapCoord(destX);
- Trinity::NormalizeMapCoord(destY);
+template<class T>
+void RandomMovementGenerator<T>::DoReset(T*) { }
- travelDistZ = range; // sin^2+cos^2=1, so travelDistZ=range^2; no need for sqrt below
+template<>
+void RandomMovementGenerator<Creature>::DoReset(Creature* owner)
+{
+ DoInitialize(owner);
+}
- if (is_air_ok) // 3D system above ground and above water (flying mode)
- {
- // Limit height change
- const float distanceZ = float(rand_norm()) * travelDistZ/2.0f;
- destZ = respZ + distanceZ;
- float levelZ = map->GetWaterOrGroundLevel(creature->GetPhaseShift(), destX, destY, destZ-2.5f);
-
- // 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 >= 10.0f ? 10.0f : travelDistZ;
-
- // 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(creature->GetPhaseShift(), destX, destY, respZ+travelDistZ-2.0f, false);
-
- if (std::fabs(destZ - respZ) > travelDistZ) // Map check
- {
- // Vmap Horizontal or above
- destZ = map->GetHeight(creature->GetPhaseShift(), destX, destY, respZ - 2.0f, true);
-
- if (std::fabs(destZ - respZ) > travelDistZ)
- {
- // Vmap Higher
- destZ = map->GetHeight(creature->GetPhaseShift(), 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 (std::fabs(destZ - respZ) > travelDistZ)
- return;
- }
- }
- }
+template<class T>
+void RandomMovementGenerator<T>::SetRandomLocation(T*) { }
- if (is_air_ok)
- i_nextMoveTime.Reset(0);
- else
+template<>
+void RandomMovementGenerator<Creature>::SetRandomLocation(Creature* owner)
+{
+ if (!owner)
+ return;
+
+ if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || owner->IsMovementPreventedByCasting())
{
- if (roll_chance_i(50))
- i_nextMoveTime.Reset(urand(5000, 10000));
- else
- i_nextMoveTime.Reset(urand(50, 400));
+ _interrupt = true;
+ owner->StopMoving();
+ return;
}
- creature->AddUnitState(UNIT_STATE_ROAMING_MOVE);
+ owner->AddUnitState(UNIT_STATE_ROAMING_MOVE);
- Movement::MoveSplineInit init(creature);
- init.MoveTo(destX, destY, destZ);
- init.SetWalk(true);
- init.Launch();
+ Position position(_reference);
+ float distance = frand(0.f, 1.f) * _wanderDistance;
+ float angle = frand(0.f, 1.f) * float(M_PI) * 2.f;
+ owner->MovePositionToFirstCollision(position, distance, angle);
- //Call for creature group update
- if (creature->GetFormation() && creature->GetFormation()->getLeader() == creature)
- creature->GetFormation()->LeaderMoveTo(destX, destY, destZ);
-}
+ uint32 resetTimer = roll_chance_i(50) ? urand(5000, 10000) : urand(1000, 2000);
-template<>
-void RandomMovementGenerator<Creature>::DoInitialize(Creature* creature)
-{
- if (!creature->IsAlive())
+ if (!_path)
+ _path = new PathGenerator(owner);
+
+ _path->SetPathLengthLimit(30.0f);
+ bool result = _path->CalculatePath(position.GetPositionX(), position.GetPositionY(), position.GetPositionZ());
+ if (!result || (_path->GetPathType() & PATHFIND_NOPATH))
+ {
+ _timer.Reset(100);
return;
+ }
- if (!wander_distance)
- wander_distance = creature->GetRespawnRadius();
+ Movement::MoveSplineInit init(owner);
+ init.MovebyPath(_path->GetPath());
+ init.SetWalk(true);
+ int32 traveltime = init.Launch();
+ _timer.Reset(traveltime + resetTimer);
- creature->AddUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE);
- _setRandomLocation(creature);
+ // Call for creature group update
+ if (owner->GetFormation() && owner->GetFormation()->getLeader() == owner)
+ owner->GetFormation()->LeaderMoveTo(position);
}
-template<>
-void RandomMovementGenerator<Creature>::DoReset(Creature* creature)
+template<class T>
+bool RandomMovementGenerator<T>::DoUpdate(T*, uint32)
{
- DoInitialize(creature);
+ return false;
}
template<>
-void RandomMovementGenerator<Creature>::DoFinalize(Creature* creature)
+bool RandomMovementGenerator<Creature>::DoUpdate(Creature* owner, uint32 diff)
{
- creature->ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE);
- creature->SetWalk(false);
-}
-
-template<>
-bool RandomMovementGenerator<Creature>::DoUpdate(Creature* creature, const uint32 diff)
-{
- if (!creature || !creature->IsAlive())
+ if (!owner || !owner->IsAlive())
return false;
- if (creature->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
+ if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || owner->IsMovementPreventedByCasting())
{
- i_nextMoveTime.Reset(0); // Expire the timer
- creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
+ _interrupt = true;
+ owner->StopMoving();
return true;
}
+ else
+ _interrupt = false;
- if (creature->movespline->Finalized())
- {
- i_nextMoveTime.Update(diff);
- if (i_nextMoveTime.Passed())
- _setRandomLocation(creature);
- }
- return true;
-}
-
-template<>
-bool RandomMovementGenerator<Creature>::GetResetPos(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);
+ _timer.Update(diff);
+ if (!_interrupt && _timer.Passed() && owner->movespline->Finalized())
+ SetRandomLocation(owner);
return true;
}
diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
index 080c594ea01..a615bec49bc 100644
--- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
@@ -19,23 +19,30 @@
#define TRINITY_RANDOMMOTIONGENERATOR_H
#include "MovementGenerator.h"
+#include "Timer.h"
template<class T>
class RandomMovementGenerator : public MovementGeneratorMedium< T, RandomMovementGenerator<T> >
{
public:
- RandomMovementGenerator(float spawn_dist = 0.0f) : i_nextMoveTime(0), wander_distance(spawn_dist) { }
+ explicit RandomMovementGenerator(float distance = 0.0f) : _path(nullptr), _timer(0), _reference(0.f, 0.f, 0.f), _wanderDistance(distance), _interrupt(false) { }
+ ~RandomMovementGenerator();
+
+ MovementGeneratorType GetMovementGeneratorType() const override { return RANDOM_MOTION_TYPE; }
- void _setRandomLocation(T*);
void DoInitialize(T*);
void DoFinalize(T*);
void DoReset(T*);
- bool DoUpdate(T*, const uint32);
- bool GetResetPos(T*, float& x, float& y, float& z);
- MovementGeneratorType GetMovementGeneratorType() const override { return RANDOM_MOTION_TYPE; }
+ bool DoUpdate(T*, uint32);
+
private:
- TimeTrackerSmall i_nextMoveTime;
+ void SetRandomLocation(T*);
- float wander_distance;
+ PathGenerator* _path;
+ TimeTracker _timer;
+ Position _reference;
+ float _wanderDistance;
+ bool _interrupt;
};
+
#endif
diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
index 54cc97ab418..5c8eb721e18 100755
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
@@ -15,226 +15,210 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ByteBuffer.h"
-#include "TargetedMovementGenerator.h"
-#include "Errors.h"
-#include "Creature.h"
#include "CreatureAI.h"
-#include "World.h"
-#include "MoveSplineInit.h"
-#include "MoveSpline.h"
+#include "Creature.h"
#include "Player.h"
#include "VehicleDefines.h"
+#include "MoveSplineInit.h"
+#include "MoveSpline.h"
+#include "PathGenerator.h"
+#include "World.h"
+#include "TargetedMovementGenerator.h"
template<class T, typename D>
-void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T* owner, bool updateDestination)
+TargetedMovementGenerator<T, D>::~TargetedMovementGenerator()
{
- if (!i_target.isValid() || !i_target->IsInWorld())
- return;
+ delete _path;
+}
+
+template<class T, typename D>
+bool TargetedMovementGenerator<T, D>::DoUpdate(T* owner, uint32 diff)
+{
+ if (!IsTargetValid() || !GetTarget()->IsInWorld())
+ return false;
+
+ if (!owner || !owner->IsAlive())
+ return false;
+
+ if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || owner->IsMovementPreventedByCasting() || HasLostTarget(owner))
+ {
+ _interrupt = true;
+ owner->StopMoving();
+ return true;
+ }
+
+ if (_interrupt || _recalculateTravel)
+ {
+ _interrupt = false;
+ SetTargetLocation(owner, true);
+ return true;
+ }
+
+ bool targetMoved = false;
+ _timer.Update(diff);
+ if (!_interrupt && _timer.Passed())
+ {
+ _timer.Reset(100);
+
+ float distance = owner->GetCombatReach() + sWorld->getRate(RATE_TARGET_POS_RECALCULATION_RANGE);
+ if (owner->IsPet() && (owner->GetCharmerOrOwnerGUID() == GetTarget()->GetGUID()))
+ distance = 1.f; // pet following owner
+
+ G3D::Vector3 destination = owner->movespline->FinalDestination();
+ if (owner->movespline->onTransport)
+ if (TransportBase* transport = owner->GetDirectTransport())
+ transport->CalculatePassengerPosition(destination.x, destination.y, destination.z);
+
+ // First check distance
+ if (owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->CanFly())
+ targetMoved = !GetTarget()->IsWithinDist3d(destination.x, destination.y, destination.z, distance);
+ else
+ targetMoved = !GetTarget()->IsWithinDist2d(destination.x, destination.y, distance);
+
+ // then, if the target is in range, check also Line of Sight.
+ if (!targetMoved)
+ targetMoved = !GetTarget()->IsWithinLOSInMap(owner);
+ }
+
+ if (targetMoved)
+ SetTargetLocation(owner, true);
+ else if (_speedChanged)
+ SetTargetLocation(owner, false);
+
+ if (!_targetReached && owner->movespline->Finalized())
+ {
+ MovementInform(owner);
+ if (_angle == 0.f && !owner->HasInArc(0.01f, GetTarget()))
+ owner->SetInFront(GetTarget());
+
+ if (!_targetReached)
+ {
+ _targetReached = true;
+ ReachTarget(owner);
+ }
+ }
- if (owner->HasUnitState(UNIT_STATE_NOT_MOVE))
+ return true;
+}
+
+template<class T, typename D>
+void TargetedMovementGenerator<T, D>::SetTargetLocation(T* owner, bool updateDestination)
+{
+ if (!IsTargetValid() || !GetTarget()->IsInWorld())
return;
- if (owner->IsMovementPreventedByCasting())
+ if (!owner || !owner->IsAlive())
return;
- if (owner->GetTypeId() == TYPEID_UNIT && !i_target->isInAccessiblePlaceFor(owner->ToCreature()))
+ if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || owner->IsMovementPreventedByCasting() || HasLostTarget(owner))
{
- owner->ToCreature()->SetCannotReachTarget(true);
+ _interrupt = true;
+ owner->StopMoving();
return;
}
- if (owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsFocusing(nullptr, true))
+ if (owner->GetTypeId() == TYPEID_UNIT && !GetTarget()->isInAccessiblePlaceFor(owner->ToCreature()))
+ {
+ owner->ToCreature()->SetCannotReachTarget(true);
return;
+ }
float x, y, z;
-
- if (updateDestination || !i_path)
+ if (updateDestination || !_path)
{
- if (!i_offset)
+ if (!_offset)
{
- if (i_target->IsWithinDistInMap(owner, CONTACT_DISTANCE))
+ if (GetTarget()->IsWithinDistInMap(owner, CONTACT_DISTANCE))
return;
- // to nearest contact position
- i_target->GetContactPoint(owner, x, y, z);
+ GetTarget()->GetContactPoint(owner, x, y, z);
}
else
{
- float dist;
- float size;
-
- // Pets need special handling.
- // We need to subtract GetCombatReach() because it gets added back further down the chain
- // and that makes pets too far away. Subtracting it allows pets to properly
- // be (GetCombatReach() + i_offset) away.
- // Only applies when i_target is pet's owner otherwise pets and mobs end up
- // doing a "dance" while fighting
- if (owner->IsPet() && i_target->GetTypeId() == TYPEID_PLAYER)
- {
- dist = 1.0f; //i_target->GetCombatReach();
- size = 1.0f; //i_target->GetCombatReach() - i_target->GetCombatReach();
- }
- else
+ float distance = _offset + 1.0f;
+ float size = owner->GetCombatReach();
+
+ if (owner->IsPet() && GetTarget()->GetTypeId() == TYPEID_PLAYER)
{
- dist = i_offset + 1.0f;
- size = owner->GetCombatReach();
+ distance = 1.0f;
+ size = 1.0f;
}
- if (i_target->IsWithinDistInMap(owner, dist))
+ if (GetTarget()->IsWithinDistInMap(owner, distance))
return;
- // to at i_offset distance from target and i_angle from target facing
- i_target->GetClosePoint(x, y, z, size, i_offset, i_angle);
+ GetTarget()->GetClosePoint(x, y, z, size, _offset, _angle);
}
}
else
{
// the destination has not changed, we just need to refresh the path (usually speed change)
- G3D::Vector3 end = i_path->GetEndPosition();
+ G3D::Vector3 end = _path->GetEndPosition();
x = end.x;
y = end.y;
z = end.z;
}
- if (!i_path)
- i_path = new PathGenerator(owner);
+ if (!_path)
+ _path = new PathGenerator(owner);
// allow pets to use shortcut if no path found when following their master
- bool forceDest = (owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsPet()
- && owner->HasUnitState(UNIT_STATE_FOLLOW));
+ bool forceDest = (owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsPet() && owner->HasUnitState(UNIT_STATE_FOLLOW));
- bool result = i_path->CalculatePath(x, y, z, forceDest);
- if (!result || (i_path->GetPathType() & PATHFIND_NOPATH))
+ bool result = _path->CalculatePath(x, y, z, forceDest);
+ if (!result || (_path->GetPathType() & PATHFIND_NOPATH))
{
// can't reach target
- i_recalculateTravel = true;
+ _recalculateTravel = true;
if (owner->GetTypeId() == TYPEID_UNIT)
owner->ToCreature()->SetCannotReachTarget(true);
return;
}
- D::_addUnitStateMove(owner);
- i_targetReached = false;
- i_recalculateTravel = false;
- owner->AddUnitState(UNIT_STATE_CHASE);
+ _targetReached = false;
+ _recalculateTravel = false;
+ _speedChanged = false;
+
+ AddUnitStateMove(owner);
+
if (owner->GetTypeId() == TYPEID_UNIT)
owner->ToCreature()->SetCannotReachTarget(false);
Movement::MoveSplineInit init(owner);
- init.MovebyPath(i_path->GetPath());
- init.SetWalk(((D*)this)->EnableWalking());
+ init.MovebyPath(_path->GetPath());
+ init.SetWalk(EnableWalking());
// Using the same condition for facing target as the one that is used for SetInFront on movement end
// - applies to ChaseMovementGenerator mostly
- if (i_angle == 0.f)
- init.SetFacing(i_target.getTarget());
+ if (_angle == 0.f)
+ init.SetFacing(GetTarget());
init.Launch();
}
template<class T, typename D>
-bool TargetedMovementGeneratorMedium<T, D>::DoUpdate(T* owner, uint32 time_diff)
+bool TargetedMovementGenerator<T, D>::IsReachable() const
{
- if (!i_target.isValid() || !i_target->IsInWorld())
- return false;
-
- if (!owner || !owner->IsAlive())
- return false;
-
- 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->IsMovementPreventedByCasting())
- {
- if (!owner->IsStopped())
- owner->StopMoving();
- return true;
- }
-
- // prevent crash after creature killed pet
- if (static_cast<D*>(this)->_lostTarget(owner))
- {
- D::_clearUnitStateMove(owner);
- return true;
- }
-
- bool targetMoved = false;
- i_recheckDistance.Update(time_diff);
- if (i_recheckDistance.Passed())
- {
- i_recheckDistance.Reset(100);
-
- //More distance let have better performance, less distance let have more sensitive reaction at target move.
- float allowed_dist = 0.0f;
-
- if (owner->IsPet() && (owner->GetCharmerOrOwnerGUID() == i_target->GetGUID()))
- allowed_dist = 1.0f; // pet following owner
- else
- allowed_dist = owner->GetCombatReach() + sWorld->getRate(RATE_TARGET_POS_RECALCULATION_RANGE);
-
- G3D::Vector3 dest = owner->movespline->FinalDestination();
- if (owner->movespline->onTransport)
- if (TransportBase* transport = owner->GetDirectTransport())
- transport->CalculatePassengerPosition(dest.x, dest.y, dest.z);
-
- // First check distance
- if (owner->GetTypeId() == TYPEID_UNIT && (owner->ToCreature()->CanFly() || owner->ToCreature()->CanSwim()))
- targetMoved = !i_target->IsWithinDist3d(dest.x, dest.y, dest.z, allowed_dist);
- else
- targetMoved = !i_target->IsWithinDist2d(dest.x, dest.y, allowed_dist);
-
- // then, if the target is in range, check also Line of Sight.
- if (!targetMoved)
- targetMoved = !i_target->IsWithinLOSInMap(owner);
- }
-
- if (i_recalculateTravel || targetMoved)
- _setTargetLocation(owner, targetMoved);
-
- if (owner->movespline->Finalized())
- {
- static_cast<D*>(this)->MovementInform(owner);
- if (i_angle == 0.f && !owner->HasInArc(0.01f, i_target.getTarget()))
- owner->SetInFront(i_target.getTarget());
-
- if (!i_targetReached)
- {
- i_targetReached = true;
- static_cast<D*>(this)->_reachTarget(owner);
- }
- }
-
- return true;
+ return (_path) ? (_path->GetPathType() & PATHFIND_NORMAL) : true;
}
-//-----------------------------------------------//
+//---- ChaseMovementGenerator
+
template<class T>
-void ChaseMovementGenerator<T>::_reachTarget(T* owner)
-{
- _clearUnitStateMove(owner);
- if (owner->IsWithinMeleeRange(this->i_target.getTarget()))
- owner->Attack(this->i_target.getTarget(), true);
- if (owner->GetTypeId() == TYPEID_UNIT)
- owner->ToCreature()->SetCannotReachTarget(false);
-}
+void ChaseMovementGenerator<T>::DoInitialize(T*) { }
template<>
void ChaseMovementGenerator<Player>::DoInitialize(Player* owner)
{
- owner->AddUnitState(UNIT_STATE_CHASE | UNIT_STATE_CHASE_MOVE);
- _setTargetLocation(owner, true);
+ owner->AddUnitState(UNIT_STATE_CHASE);
+ SetTargetLocation(owner, true);
}
template<>
void ChaseMovementGenerator<Creature>::DoInitialize(Creature* owner)
{
owner->SetWalk(false);
- owner->AddUnitState(UNIT_STATE_CHASE | UNIT_STATE_CHASE_MOVE);
- _setTargetLocation(owner, true);
+ owner->AddUnitState(UNIT_STATE_CHASE);
+ SetTargetLocation(owner, true);
}
template<class T>
@@ -250,41 +234,60 @@ void ChaseMovementGenerator<T>::DoReset(T* owner)
}
template<class T>
-void ChaseMovementGenerator<T>::MovementInform(T* /*unit*/) { }
+void ChaseMovementGenerator<T>::ClearUnitStateMove(T* owner)
+{
+ owner->ClearUnitState(UNIT_STATE_CHASE_MOVE);
+}
-template<>
-void ChaseMovementGenerator<Creature>::MovementInform(Creature* unit)
+template<class T>
+void ChaseMovementGenerator<T>::AddUnitStateMove(T* owner)
{
- // Pass back the GUIDLow of the target. If it is pet's owner then PetAI will handle
- if (unit->AI())
- unit->AI()->MovementInform(CHASE_MOTION_TYPE, i_target.getTarget()->GetGUID().GetCounter());
+ owner->AddUnitState(UNIT_STATE_CHASE_MOVE);
}
-//-----------------------------------------------//
-template<>
-bool FollowMovementGenerator<Creature>::EnableWalking() const
+template<class T>
+bool ChaseMovementGenerator<T>::HasLostTarget(T* owner) const
{
- return i_target.isValid() && i_target->IsWalking();
+ return owner->GetVictim() != TargetedMovementGeneratorBase::GetTarget();
}
-template<>
-bool FollowMovementGenerator<Player>::EnableWalking() const
+template<class T>
+void ChaseMovementGenerator<T>::ReachTarget(T* owner)
{
- return false;
+ ClearUnitStateMove(owner);
+
+ if (owner->IsWithinMeleeRange(TargetedMovementGeneratorBase::GetTarget()))
+ owner->Attack(TargetedMovementGeneratorBase::GetTarget(), true);
+
+ if (owner->GetTypeId() == TYPEID_UNIT)
+ owner->ToCreature()->SetCannotReachTarget(false);
}
+template<class T>
+void ChaseMovementGenerator<T>::MovementInform(T*) { }
+
template<>
-void FollowMovementGenerator<Player>::_updateSpeed(Player* /*owner*/)
+void ChaseMovementGenerator<Creature>::MovementInform(Creature* owner)
{
- // nothing to do for Player
+ // Pass back the GUIDLow of the target. If it is pet's owner then PetAI will handle
+ if (owner->AI())
+ owner->AI()->MovementInform(CHASE_MOTION_TYPE, GetTarget()->GetGUID().GetCounter());
}
+//---- FollowMovementGenerator
+
+template<class T>
+void FollowMovementGenerator<T>::UpdateSpeed(T*) { }
+
+template<>
+void FollowMovementGenerator<Player>::UpdateSpeed(Player* /*owner*/) { }
+
template<>
-void FollowMovementGenerator<Creature>::_updateSpeed(Creature* owner)
+void FollowMovementGenerator<Creature>::UpdateSpeed(Creature* owner)
{
- // pet only sync speed with owner
- /// Make sure we are not in the process of a map change (IsInWorld)
- if (!owner->IsPet() || !owner->IsInWorld() || !i_target.isValid() || i_target->GetGUID() != owner->GetOwnerGUID())
+ // Pet only sync speed with owner
+ // Make sure we are not in the process of a map change (IsInWorld)
+ if (!owner->IsPet() || !owner->IsInWorld() || !IsTargetValid() || GetTarget()->GetGUID() != owner->GetOwnerGUID())
return;
owner->UpdateSpeed(MOVE_RUN);
@@ -292,27 +295,19 @@ void FollowMovementGenerator<Creature>::_updateSpeed(Creature* owner)
owner->UpdateSpeed(MOVE_SWIM);
}
-template<>
-void FollowMovementGenerator<Player>::DoInitialize(Player* owner)
-{
- owner->AddUnitState(UNIT_STATE_FOLLOW | UNIT_STATE_FOLLOW_MOVE);
- _updateSpeed(owner);
- _setTargetLocation(owner, true);
-}
-
-template<>
-void FollowMovementGenerator<Creature>::DoInitialize(Creature* owner)
+template<class T>
+void FollowMovementGenerator<T>::DoInitialize(T* owner)
{
- owner->AddUnitState(UNIT_STATE_FOLLOW | UNIT_STATE_FOLLOW_MOVE);
- _updateSpeed(owner);
- _setTargetLocation(owner, true);
+ owner->AddUnitState(UNIT_STATE_FOLLOW);
+ UpdateSpeed(owner);
+ TargetedMovementGenerator<T, FollowMovementGenerator<T>>::SetTargetLocation(owner, true);
}
template<class T>
void FollowMovementGenerator<T>::DoFinalize(T* owner)
{
owner->ClearUnitState(UNIT_STATE_FOLLOW | UNIT_STATE_FOLLOW_MOVE);
- _updateSpeed(owner);
+ UpdateSpeed(owner);
}
template<class T>
@@ -322,36 +317,85 @@ void FollowMovementGenerator<T>::DoReset(T* owner)
}
template<class T>
-void FollowMovementGenerator<T>::MovementInform(T* /*unit*/) { }
+void FollowMovementGenerator<T>::ClearUnitStateMove(T* owner)
+{
+ owner->ClearUnitState(UNIT_STATE_FOLLOW_MOVE);
+}
+
+template<class T>
+void FollowMovementGenerator<T>::AddUnitStateMove(T* owner)
+{
+ owner->AddUnitState(UNIT_STATE_FOLLOW_MOVE);
+}
+
+template<class T>
+void FollowMovementGenerator<T>::ReachTarget(T* owner)
+{
+ ClearUnitStateMove(owner);
+}
+
+template<>
+bool FollowMovementGenerator<Creature>::EnableWalking() const
+{
+ return IsTargetValid() && GetTarget()->IsWalking();
+}
+
+template<>
+bool FollowMovementGenerator<Player>::EnableWalking() const
+{
+ return false;
+}
+
+template<class T>
+void FollowMovementGenerator<T>::MovementInform(T*) { }
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()->GetGUID().GetCounter());
+ unit->AI()->MovementInform(FOLLOW_MOTION_TYPE, GetTarget()->GetGUID().GetCounter());
}
//-----------------------------------------------//
-template void TargetedMovementGeneratorMedium<Player, ChaseMovementGenerator<Player> >::_setTargetLocation(Player*, bool);
-template void TargetedMovementGeneratorMedium<Player, FollowMovementGenerator<Player> >::_setTargetLocation(Player*, bool);
-template void TargetedMovementGeneratorMedium<Creature, ChaseMovementGenerator<Creature> >::_setTargetLocation(Creature*, bool);
-template void TargetedMovementGeneratorMedium<Creature, FollowMovementGenerator<Creature> >::_setTargetLocation(Creature*, bool);
-template bool TargetedMovementGeneratorMedium<Player, ChaseMovementGenerator<Player> >::DoUpdate(Player*, uint32);
-template bool TargetedMovementGeneratorMedium<Player, FollowMovementGenerator<Player> >::DoUpdate(Player*, uint32);
-template bool TargetedMovementGeneratorMedium<Creature, ChaseMovementGenerator<Creature> >::DoUpdate(Creature*, uint32);
-template bool TargetedMovementGeneratorMedium<Creature, FollowMovementGenerator<Creature> >::DoUpdate(Creature*, uint32);
-
-template void ChaseMovementGenerator<Player>::_reachTarget(Player*);
-template void ChaseMovementGenerator<Creature>::_reachTarget(Creature*);
+
+template TargetedMovementGenerator<Player, ChaseMovementGenerator<Player> >::~TargetedMovementGenerator();
+template TargetedMovementGenerator<Player, FollowMovementGenerator<Player> >::~TargetedMovementGenerator();
+template TargetedMovementGenerator<Creature, ChaseMovementGenerator<Creature> >::~TargetedMovementGenerator();
+template TargetedMovementGenerator<Creature, FollowMovementGenerator<Creature> >::~TargetedMovementGenerator();
+template bool TargetedMovementGenerator<Player, ChaseMovementGenerator<Player> >::DoUpdate(Player*, uint32);
+template bool TargetedMovementGenerator<Player, FollowMovementGenerator<Player> >::DoUpdate(Player*, uint32);
+template bool TargetedMovementGenerator<Creature, ChaseMovementGenerator<Creature> >::DoUpdate(Creature*, uint32);
+template bool TargetedMovementGenerator<Creature, FollowMovementGenerator<Creature> >::DoUpdate(Creature*, uint32);
+template void TargetedMovementGenerator<Player, ChaseMovementGenerator<Player> >::SetTargetLocation(Player*, bool);
+template void TargetedMovementGenerator<Player, FollowMovementGenerator<Player> >::SetTargetLocation(Player*, bool);
+template void TargetedMovementGenerator<Creature, ChaseMovementGenerator<Creature> >::SetTargetLocation(Creature*, bool);
+template void TargetedMovementGenerator<Creature, FollowMovementGenerator<Creature> >::SetTargetLocation(Creature*, bool);
+
template void ChaseMovementGenerator<Player>::DoFinalize(Player*);
template void ChaseMovementGenerator<Creature>::DoFinalize(Creature*);
template void ChaseMovementGenerator<Player>::DoReset(Player*);
template void ChaseMovementGenerator<Creature>::DoReset(Creature*);
+template void ChaseMovementGenerator<Player>::ClearUnitStateMove(Player*);
+template void ChaseMovementGenerator<Creature>::ClearUnitStateMove(Creature*);
+template void ChaseMovementGenerator<Player>::AddUnitStateMove(Player*);
+template void ChaseMovementGenerator<Creature>::AddUnitStateMove(Creature*);
+template bool ChaseMovementGenerator<Player>::HasLostTarget(Player*) const;
+template bool ChaseMovementGenerator<Creature>::HasLostTarget(Creature*) const;
+template void ChaseMovementGenerator<Player>::ReachTarget(Player*);
+template void ChaseMovementGenerator<Creature>::ReachTarget(Creature*);
template void ChaseMovementGenerator<Player>::MovementInform(Player*);
+template void FollowMovementGenerator<Player>::DoInitialize(Player*);
+template void FollowMovementGenerator<Creature>::DoInitialize(Creature*);
template void FollowMovementGenerator<Player>::DoFinalize(Player*);
template void FollowMovementGenerator<Creature>::DoFinalize(Creature*);
template void FollowMovementGenerator<Player>::DoReset(Player*);
template void FollowMovementGenerator<Creature>::DoReset(Creature*);
+template void FollowMovementGenerator<Player>::ClearUnitStateMove(Player*);
+template void FollowMovementGenerator<Creature>::ClearUnitStateMove(Creature*);
+template void FollowMovementGenerator<Player>::AddUnitStateMove(Player*);
+template void FollowMovementGenerator<Creature>::AddUnitStateMove(Creature*);
+template void FollowMovementGenerator<Player>::ReachTarget(Player*);
+template void FollowMovementGenerator<Creature>::ReachTarget(Creature*);
template void FollowMovementGenerator<Player>::MovementInform(Player*);
diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
index 79a1c7952db..9f4e3712b5c 100755
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
@@ -21,95 +21,94 @@
#include "MovementGenerator.h"
#include "FollowerReference.h"
#include "Timer.h"
-#include "Unit.h"
-#include "PathGenerator.h"
class TargetedMovementGeneratorBase
{
public:
- TargetedMovementGeneratorBase(Unit* target) { i_target.link(target, this); }
+ TargetedMovementGeneratorBase(Unit* target)
+ {
+ _target.link(target, this);
+ }
+
+ bool IsTargetValid() const { return _target.isValid(); }
+ Unit* GetTarget() const { return _target.getTarget(); }
void stopFollowing() { }
- protected:
- FollowerReference i_target;
+
+ private:
+ FollowerReference _target;
};
template<class T, typename D>
-class TargetedMovementGeneratorMedium : public MovementGeneratorMedium< T, D >, public TargetedMovementGeneratorBase
+class TargetedMovementGenerator : public MovementGeneratorMedium< T, D >, public TargetedMovementGeneratorBase
{
- protected:
- TargetedMovementGeneratorMedium(Unit* target, float offset, float angle) :
- TargetedMovementGeneratorBase(target), i_path(NULL),
- i_recheckDistance(0), i_offset(offset), i_angle(angle),
- i_recalculateTravel(false), i_targetReached(false)
- {
- }
- ~TargetedMovementGeneratorMedium() { delete i_path; }
-
public:
+ explicit TargetedMovementGenerator(Unit* target, float offset, float angle) : TargetedMovementGeneratorBase(target), _path(nullptr), _timer(0), _offset(offset), _angle(angle), _recalculateTravel(false), _speedChanged(false), _targetReached(false), _interrupt(false) { }
+ ~TargetedMovementGenerator();
+
bool DoUpdate(T*, uint32);
- Unit* GetTarget() const { return i_target.getTarget(); }
-
- void unitSpeedChanged() override { i_recalculateTravel = true; }
- bool IsReachable() const { return (i_path) ? (i_path->GetPathType() & PATHFIND_NORMAL) : true; }
- protected:
- void _setTargetLocation(T* owner, bool updateDestination);
-
- PathGenerator* i_path;
- TimeTrackerSmall i_recheckDistance;
- float i_offset;
- float i_angle;
- bool i_recalculateTravel : 1;
- bool i_targetReached : 1;
+
+ void UnitSpeedChanged() override { _speedChanged = true; }
+
+ virtual void ClearUnitStateMove(T*) { }
+ virtual void AddUnitStateMove(T*) { }
+ virtual bool HasLostTarget(T*) const { return false; }
+ virtual void ReachTarget(T*) { }
+ virtual bool EnableWalking() const { return false; }
+ virtual void MovementInform(T*) { }
+
+ bool IsReachable() const;
+ void SetTargetLocation(T* owner, bool updateDestination);
+
+ private:
+ PathGenerator* _path;
+ TimeTrackerSmall _timer;
+ float _offset;
+ float _angle;
+ bool _recalculateTravel;
+ bool _speedChanged;
+ bool _targetReached;
+ bool _interrupt;
};
template<class T>
-class ChaseMovementGenerator : public TargetedMovementGeneratorMedium<T, ChaseMovementGenerator<T> >
+class ChaseMovementGenerator : public TargetedMovementGenerator<T, ChaseMovementGenerator<T> >
{
public:
- ChaseMovementGenerator(Unit* target)
- : TargetedMovementGeneratorMedium<T, ChaseMovementGenerator<T> >(target) { }
- ChaseMovementGenerator(Unit* target, float offset, float angle)
- : TargetedMovementGeneratorMedium<T, ChaseMovementGenerator<T> >(target, offset, angle) { }
- ~ChaseMovementGenerator() { }
+ explicit ChaseMovementGenerator(Unit* target, float offset, float angle) : TargetedMovementGenerator<T, ChaseMovementGenerator<T> >(target, offset, angle) { }
MovementGeneratorType GetMovementGeneratorType() const override { return CHASE_MOTION_TYPE; }
void DoInitialize(T*);
void DoFinalize(T*);
void DoReset(T*);
- void MovementInform(T*);
- 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*);
+ void ClearUnitStateMove(T*) override;
+ void AddUnitStateMove(T*) override;
+ bool HasLostTarget(T*) const override;
+ void ReachTarget(T*) override;
+ void MovementInform(T*) override;
};
template<class T>
-class FollowMovementGenerator : public TargetedMovementGeneratorMedium<T, FollowMovementGenerator<T> >
+class FollowMovementGenerator : public TargetedMovementGenerator<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() { }
+ explicit FollowMovementGenerator(Unit* target, float offset, float angle) : TargetedMovementGenerator<T, FollowMovementGenerator<T> >(target, offset, angle) { }
MovementGeneratorType GetMovementGeneratorType() const override { return FOLLOW_MOTION_TYPE; }
void DoInitialize(T*);
void DoFinalize(T*);
void DoReset(T*);
- void MovementInform(T*);
- 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*) { }
+ void ClearUnitStateMove(T*) override;
+ void AddUnitStateMove(T*) override;
+ bool HasLostTarget(T*) const override { return false; }
+ void ReachTarget(T*) override;
+ bool EnableWalking() const override;
+ void MovementInform(T*) override;
private:
- void _updateSpeed(T* owner);
+ void UpdateSpeed(T* owner);
};
#endif
diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
index 9f07641d74d..0a01d7f3a96 100644
--- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
@@ -139,7 +139,7 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature* creature)
creature->AddUnitState(UNIT_STATE_ROAMING_MOVE);
- Movement::Location formationDest(node->x, node->y, node->z, 0.0f);
+ Position formationDest(node->x, node->y, node->z, (node->orientation && node->delay) ? node->orientation : 0.0f);
Movement::MoveSplineInit init(creature);
//! If creature is on transport, we assume waypoints set in DB are already transport offsets
@@ -147,7 +147,11 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature* creature)
{
init.DisableTransportPathTransformations();
if (TransportBase* trans = creature->GetDirectTransport())
- trans->CalculatePassengerPosition(formationDest.x, formationDest.y, formationDest.z, &formationDest.orientation);
+ {
+ float orientation = formationDest.GetOrientation();
+ trans->CalculatePassengerPosition(formationDest.m_positionX, formationDest.m_positionY, formationDest.m_positionZ, &orientation);
+ formationDest.SetOrientation(orientation);
+ }
}
//! Do not use formationDest here, MoveTo requires transport offsets due to DisableTransportPathTransformations() call
@@ -176,12 +180,9 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature* creature)
init.Launch();
- //Call for creature group update
+ // Call for creature group update
if (creature->GetFormation() && creature->GetFormation()->getLeader() == creature)
- {
- creature->SetWalk(node->move_type != WAYPOINT_MOVE_TYPE_RUN);
- creature->GetFormation()->LeaderMoveTo(formationDest.x, formationDest.y, formationDest.z);
- }
+ creature->GetFormation()->LeaderMoveTo(formationDest, node->id, node->move_type, (node->orientation && node->delay) ? true : false);
return true;
}
diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h
index 2023a4de8e8..da9d80dad63 100644
--- a/src/server/game/Quests/QuestDef.h
+++ b/src/server/game/Quests/QuestDef.h
@@ -224,7 +224,8 @@ enum QuestSpecialFlags
QUEST_SPECIAL_FLAGS_SPEAKTO = 0x100, // Internal flag computed only
QUEST_SPECIAL_FLAGS_KILL = 0x200, // Internal flag computed only
QUEST_SPECIAL_FLAGS_TIMED = 0x400, // Internal flag computed only
- QUEST_SPECIAL_FLAGS_PLAYER_KILL = 0x800 // Internal flag computed only
+ QUEST_SPECIAL_FLAGS_PLAYER_KILL = 0x800, // Internal flag computed only
+ QUEST_SPECIAL_FLAGS_COMPLETED_AT_START = 0x1000 // Internal flag computed only
};
enum QuestObjectiveType
@@ -497,7 +498,6 @@ class TC_GAME_API Quest
void BuildQuestRewards(WorldPackets::Quest::QuestRewards& rewards, Player* player) const;
std::vector<uint32> DependentPreviousQuests;
- std::vector<uint32> PrevChainQuests;
WorldPacket QueryData[TOTAL_LOCALES];
private:
diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp
index 1c362984ecc..b017947d56c 100644
--- a/src/server/game/Reputation/ReputationMgr.cpp
+++ b/src/server/game/Reputation/ReputationMgr.cpp
@@ -267,7 +267,7 @@ void ReputationMgr::Initialize()
}
}
-bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standing, bool incremental, bool noSpillover)
+bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standing, bool incremental, bool spillOverOnly, bool noSpillover)
{
sScriptMgr->OnPlayerReputationChange(_player, factionEntry->ID, standing, incremental);
bool res = false;
@@ -334,7 +334,10 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
FactionStateList::iterator faction = _factions.find(factionEntry->ReputationIndex);
if (faction != _factions.end())
{
- res = SetOneFactionReputation(factionEntry, standing, incremental);
+ // if we update spillover only, do not update main reputation (rank exceeds creature reward rate)
+ if (!spillOverOnly)
+ res = SetOneFactionReputation(factionEntry, standing, incremental);
+
// only this faction gets reported to client, even if it has no own visible standing
SendState(&faction->second);
}
diff --git a/src/server/game/Reputation/ReputationMgr.h b/src/server/game/Reputation/ReputationMgr.h
index 3ad0958107c..ffc9ad826b5 100644
--- a/src/server/game/Reputation/ReputationMgr.h
+++ b/src/server/game/Reputation/ReputationMgr.h
@@ -118,11 +118,11 @@ class TC_GAME_API ReputationMgr
public: // modifiers
bool SetReputation(FactionEntry const* factionEntry, int32 standing)
{
- return SetReputation(factionEntry, standing, false, false);
+ return SetReputation(factionEntry, standing, false, false, false);
}
- bool ModifyReputation(FactionEntry const* factionEntry, int32 standing, bool noSpillover = false)
+ bool ModifyReputation(FactionEntry const* factionEntry, int32 standing, bool spillOverOnly = false, bool noSpillover = false)
{
- return SetReputation(factionEntry, standing, true, noSpillover);
+ return SetReputation(factionEntry, standing, true, spillOverOnly, noSpillover);
}
void SetVisible(FactionTemplateEntry const* factionTemplateEntry);
@@ -144,7 +144,7 @@ class TC_GAME_API ReputationMgr
private: // internal helper functions
void Initialize();
uint32 GetDefaultStateFlags(FactionEntry const* factionEntry) const;
- bool SetReputation(FactionEntry const* factionEntry, int32 standing, bool incremental, bool noSpillover);
+ bool SetReputation(FactionEntry const* factionEntry, int32 standing, bool incremental, bool spillOverOnly, bool noSpillover);
void SetVisible(FactionState* faction);
void SetAtWar(FactionState* faction, bool atWar) const;
void SetInactive(FactionState* faction, bool inactive) const;
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index e9596c4fdd3..fea767fa9a5 100644
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -1637,15 +1637,6 @@ InstanceScript* ScriptMgr::CreateInstanceData(InstanceMap* map)
return tmpscript->GetInstanceScript(map);
}
-bool ScriptMgr::OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex, Item* target)
-{
- ASSERT(caster);
- ASSERT(target);
-
- GET_SCRIPT_RET(ItemScript, target->GetScriptId(), tmpscript, false);
- return tmpscript->OnDummyEffect(caster, spellId, effIndex, target);
-}
-
bool ScriptMgr::OnQuestAccept(Player* player, Item* item, Quest const* quest)
{
ASSERT(player);
@@ -1695,15 +1686,6 @@ bool ScriptMgr::OnCastItemCombatSpell(Player* player, Unit* victim, SpellInfo co
return tmpscript->OnCastItemCombatSpell(player, victim, spellInfo, item);
}
-bool ScriptMgr::OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex, Creature* target)
-{
- ASSERT(caster);
- ASSERT(target);
-
- GET_SCRIPT_RET(CreatureScript, target->GetScriptId(), tmpscript, false);
- return tmpscript->OnDummyEffect(caster, spellId, effIndex, target);
-}
-
bool ScriptMgr::OnGossipHello(Player* player, Creature* creature)
{
ASSERT(player);
@@ -1920,15 +1902,6 @@ void ScriptMgr::OnGameObjectUpdate(GameObject* go, uint32 diff)
tmpscript->OnUpdate(go, diff);
}
-bool ScriptMgr::OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex, GameObject* target)
-{
- ASSERT(caster);
- ASSERT(target);
-
- GET_SCRIPT_RET(GameObjectScript, target->GetScriptId(), tmpscript, false);
- return tmpscript->OnDummyEffect(caster, spellId, effIndex, target);
-}
-
bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger, bool entered)
{
ASSERT(player);
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index 53465b1dca2..518cc5f4a70 100644
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -374,9 +374,6 @@ class TC_GAME_API ItemScript : public ScriptObject
public:
- // Called when a dummy spell effect is triggered on the item.
- virtual bool OnDummyEffect(Unit* /*caster*/, uint32 /*spellId*/, SpellEffIndex /*effIndex*/, Item* /*target*/) { return false; }
-
// Called when a player accepts a quest from the item.
virtual bool OnQuestAccept(Player* /*player*/, Item* /*item*/, Quest const* /*quest*/) { return false; }
@@ -424,9 +421,6 @@ class TC_GAME_API CreatureScript : public UnitScript, public UpdatableScript<Cre
public:
- // Called when a dummy spell effect is triggered on the creature.
- virtual bool OnDummyEffect(Unit* /*caster*/, uint32 /*spellId*/, SpellEffIndex /*effIndex*/, Creature* /*target*/) { return false; }
-
// Called when a player opens a gossip dialog with the creature.
virtual bool OnGossipHello(Player* /*player*/, Creature* /*creature*/) { return false; }
@@ -463,9 +457,6 @@ class TC_GAME_API GameObjectScript : public ScriptObject, public UpdatableScript
public:
- // Called when a dummy spell effect is triggered on the gameobject.
- virtual bool OnDummyEffect(Unit* /*caster*/, uint32 /*spellId*/, SpellEffIndex /*effIndex*/, GameObject* /*target*/) { return false; }
-
// Called when a player opens a gossip dialog with the gameobject.
virtual bool OnGossipHello(Player* /*player*/, GameObject* /*go*/) { return false; }
@@ -1026,7 +1017,6 @@ class TC_GAME_API ScriptMgr
public: /* ItemScript */
- bool OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex, Item* target);
bool OnQuestAccept(Player* player, Item* item, Quest const* quest);
bool OnItemUse(Player* player, Item* item, SpellCastTargets const& targets, ObjectGuid castId);
bool OnItemExpire(Player* player, ItemTemplate const* proto);
@@ -1035,7 +1025,6 @@ class TC_GAME_API ScriptMgr
public: /* CreatureScript */
- bool OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex, Creature* target);
bool OnGossipHello(Player* player, Creature* creature);
bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action);
bool OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, const char* code);
@@ -1049,7 +1038,6 @@ class TC_GAME_API ScriptMgr
public: /* GameObjectScript */
- bool OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex, GameObject* target);
bool OnGossipHello(Player* player, GameObject* go);
bool OnGossipSelect(Player* player, GameObject* go, uint32 sender, uint32 action);
bool OnGossipSelectCode(Player* player, GameObject* go, uint32 sender, uint32 action, const char* code);
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 566ecfd9df8..9281d012f55 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -4072,6 +4072,34 @@ void AuraEffect::HandleModCastingSpeed(AuraApplication const* aurApp, uint8 mode
Unit* target = aurApp->GetTarget();
+ // Do not apply such auras in normal way
+ if (GetAmount() >= 1000)
+ {
+ if (apply)
+ target->SetInstantCast(true);
+ else
+ {
+ // only SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK can have this high amount
+ // it's some rare case that you have 2 auras like that, but just in case ;)
+
+ bool remove = true;
+ Unit::AuraEffectList const& castingSpeedNotStack = target->GetAuraEffectsByType(SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK);
+ for (AuraEffect const* aurEff : castingSpeedNotStack)
+ {
+ if (aurEff != this && aurEff->GetAmount() >= 1000)
+ {
+ remove = false;
+ break;
+ }
+ }
+
+ if (remove)
+ target->SetInstantCast(false);
+ }
+
+ return;
+ }
+
target->ApplyCastTimePercentMod((float)GetAmount(), apply);
}
@@ -4457,15 +4485,15 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
Unit* caster = GetCaster();
- if (mode & AURA_EFFECT_HANDLE_REAL)
+ // pet auras
+ if (target->GetTypeId() == TYPEID_PLAYER && (mode & AURA_EFFECT_HANDLE_REAL))
{
- // pet auras
if (PetAura const* petSpell = sSpellMgr->GetPetAura(GetId(), m_effIndex))
{
if (apply)
- target->AddPetAura(petSpell);
+ target->ToPlayer()->AddPetAura(petSpell);
else
- target->RemovePetAura(petSpell);
+ target->ToPlayer()->RemovePetAura(petSpell);
}
}
@@ -4900,7 +4928,7 @@ void AuraEffect::HandleAuraModFaction(AuraApplication const* aurApp, uint8 mode,
if (apply)
{
- target->setFaction(GetMiscValue());
+ target->SetFaction(GetMiscValue());
if (target->GetTypeId() == TYPEID_PLAYER)
target->RemoveUnitFlag(UNIT_FLAG_PVP_ATTACKABLE);
}
@@ -5501,12 +5529,7 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
}
}
else
- {
- Creature* c = target->ToCreature();
- if (!c || !caster || !sScriptMgr->OnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()), target->ToCreature()) ||
- !c->AI()->sOnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex())))
- TC_LOG_DEBUG("spells", "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell %u has non-existent spell %u in EffectTriggered[%d] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex());
- }
+ TC_LOG_DEBUG("spells", "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell %u has non-existent spell %u in EffectTriggered[%d] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex());
}
void AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* caster) const
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index a03788cdda5..85388dc5821 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2626,11 +2626,24 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask)
}
// Now Reduce spell duration using data received at spell hit
+ // check whatever effects we're going to apply, diminishing returns only apply to negative aura effects
+ bool positive = true;
+ if (m_originalCaster == unit || !m_originalCaster->IsFriendlyTo(unit))
+ {
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ {
+ if ((effectMask & (1 << i)) && !m_spellInfo->IsPositiveEffect(i))
+ {
+ positive = false;
+ break;
+ }
+ }
+ }
+
int32 duration = m_spellAura->GetMaxDuration();
- float diminishMod = unit->ApplyDiminishingToDuration(m_spellInfo, duration, m_originalCaster, diminishLevel);
// unit is immune to aura if it was diminished to 0 duration
- if (diminishMod == 0.0f)
+ if (!positive && !unit->ApplyDiminishingToDuration(m_spellInfo, duration, m_originalCaster, diminishLevel))
{
m_spellAura->Remove();
bool found = false;
@@ -2642,11 +2655,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask)
}
else
{
- ((UnitAura*)m_spellAura)->SetDiminishGroup(diminishGroup);
-
- bool positive = m_spellAura->GetSpellInfo()->IsPositive();
- if (AuraApplication* aurApp = m_spellAura->GetApplicationOfTarget(m_originalCaster->GetGUID()))
- positive = aurApp->IsPositive();
+ static_cast<UnitAura*>(m_spellAura)->SetDiminishGroup(diminishGroup);
duration = m_originalCaster->ModSpellDuration(m_spellInfo, unit, duration, positive, effectMask);
@@ -2944,15 +2953,6 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
else
m_casttime = m_spellInfo->CalcCastTime(m_caster->getLevel(), this);
- if (m_caster->GetTypeId() == TYPEID_UNIT && !m_caster->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED)) // _UNIT actually means creature. for some reason.
- if (!(m_spellInfo->IsNextMeleeSwingSpell() || IsAutoRepeat() || (_triggeredCastFlags & TRIGGERED_IGNORE_SET_FACING)))
- {
- if (m_targets.GetObjectTarget() && m_caster != m_targets.GetObjectTarget())
- m_caster->ToCreature()->FocusTarget(this, m_targets.GetObjectTarget());
- else if (m_spellInfo->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST))
- m_caster->ToCreature()->FocusTarget(this, nullptr);
- }
-
// don't allow channeled spells / spells with cast time to be cast while moving
// exception are only channeled spells that have no casttime and SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING
// (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in)
@@ -2969,6 +2969,18 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
}
}
+ // focus if not controlled creature
+ if (m_caster->GetTypeId() == TYPEID_UNIT && !m_caster->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED))
+ {
+ if (!(m_spellInfo->IsNextMeleeSwingSpell() || IsAutoRepeat() || (_triggeredCastFlags & TRIGGERED_IGNORE_SET_FACING)))
+ {
+ if (m_targets.GetObjectTarget() && m_caster != m_targets.GetObjectTarget())
+ m_caster->ToCreature()->FocusTarget(this, m_targets.GetObjectTarget());
+ else if (m_spellInfo->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST))
+ m_caster->ToCreature()->FocusTarget(this, nullptr);
+ }
+ }
+
// set timer base at cast time
ReSetTimer();
@@ -3116,11 +3128,12 @@ void Spell::_cast(bool skipCheck)
m_caster->SetInFront(m_targets.GetObjectTarget());
// Should this be done for original caster?
- if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ Player* modOwner = m_caster->GetSpellModOwner();
+ if (modOwner)
{
// Set spell which will drop charges for triggered cast spells
// if not successfully cast, will be remove in finish(false)
- m_caster->ToPlayer()->SetSpellModTakingSpell(this, true);
+ modOwner->SetSpellModTakingSpell(this, true);
}
CallScriptBeforeCastHandlers();
@@ -3135,8 +3148,8 @@ void Spell::_cast(bool skipCheck)
SendCastResult(castResult, &param1, &param2);
SendInterrupted(0);
- if (m_caster->GetTypeId() == TYPEID_PLAYER)
- m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
+ if (modOwner)
+ modOwner->SetSpellModTakingSpell(this, false);
finish(false);
SetExecutedCurrently(false);
@@ -3147,9 +3160,9 @@ void Spell::_cast(bool skipCheck)
// if trade not complete then remember it in trade data
if (m_targets.GetTargetMask() & TARGET_FLAG_TRADE_ITEM)
{
- if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ if (modOwner)
{
- if (TradeData* my_trade = m_caster->ToPlayer()->GetTradeData())
+ if (TradeData* my_trade = modOwner->GetTradeData())
{
if (!my_trade->IsInAcceptProcess())
{
@@ -3158,7 +3171,7 @@ void Spell::_cast(bool skipCheck)
SendCastResult(SPELL_FAILED_DONT_REPORT);
SendInterrupted(0);
- m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
+ modOwner->SetSpellModTakingSpell(this, false);
finish(false);
SetExecutedCurrently(false);
@@ -3275,12 +3288,12 @@ void Spell::_cast(bool skipCheck)
m_caster->CastSpell(m_targets.GetUnitTarget() ? m_targets.GetUnitTarget() : m_caster, *i, true);
}
- if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ if (modOwner)
{
- m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
+ modOwner->SetSpellModTakingSpell(this, false);
//Clear spell cooldowns after every spell is cast if .cheat cooldown is enabled.
- if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_COOLDOWN))
+ if (modOwner->GetCommandStatus(CHEAT_COOLDOWN))
{
m_caster->GetSpellHistory()->ResetCooldown(m_spellInfo->Id, true);
m_caster->GetSpellHistory()->RestoreCharge(m_spellInfo->ChargeCategoryId);
@@ -3289,9 +3302,6 @@ void Spell::_cast(bool skipCheck)
SetExecutedCurrently(false);
- if (Creature* creatureCaster = m_caster->ToCreature())
- creatureCaster->ReleaseFocus(this);
-
if (!m_originalCaster)
return;
@@ -3411,8 +3421,9 @@ uint64 Spell::handle_delayed(uint64 t_offset)
if (single_missile && !t_offset)
return m_delayMoment;
- if (m_caster->GetTypeId() == TYPEID_PLAYER)
- m_caster->ToPlayer()->SetSpellModTakingSpell(this, true);
+ Player* modOwner = m_caster->GetSpellModOwner();
+ if (modOwner)
+ modOwner->SetSpellModTakingSpell(this, true);
PrepareTargetProcessing();
@@ -3451,8 +3462,8 @@ uint64 Spell::handle_delayed(uint64 t_offset)
FinishTargetProcessing();
- if (m_caster->GetTypeId() == TYPEID_PLAYER)
- m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
+ if (modOwner)
+ modOwner->SetSpellModTakingSpell(this, false);
// All targets passed - need finish phase
if (next_time == 0)
@@ -4449,8 +4460,16 @@ void Spell::SendChannelStart(uint32 duration)
m_timer = duration;
for (TargetInfo const& target : m_UniqueTargetInfo)
+ {
m_caster->AddChannelObject(target.targetGUID);
+ if (m_UniqueTargetInfo.size() == 1 && m_UniqueGOTargetInfo.empty())
+ if(target.targetGUID != m_caster->GetGUID())
+ if (Creature* creatureCaster = m_caster->ToCreature())
+ if (!creatureCaster->IsFocusing(this))
+ creatureCaster->FocusTarget(this, ObjectAccessor::GetWorldObject(*creatureCaster, target.targetGUID));
+ }
+
for (GOTargetInfo const& target : m_UniqueGOTargetInfo)
m_caster->AddChannelObject(target.targetGUID);
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 56a050eea65..53e9c98b0db 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -607,24 +607,18 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
}
// pet auras
- if (PetAura const* petSpell = sSpellMgr->GetPetAura(m_spellInfo->Id, effIndex))
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
- m_caster->AddPetAura(petSpell);
- return;
+ if (PetAura const* petSpell = sSpellMgr->GetPetAura(m_spellInfo->Id, effIndex))
+ {
+ m_caster->ToPlayer()->AddPetAura(petSpell);
+ return;
+ }
}
// normal DB scripted effect
TC_LOG_DEBUG("spells", "Spell ScriptStart spellid %u in EffectDummy(%u)", m_spellInfo->Id, effIndex);
m_caster->GetMap()->ScriptsStart(sSpellScripts, uint32(m_spellInfo->Id | (effIndex << 24)), m_caster, unitTarget);
-
- // Script based implementation. Must be used only for not good for implementation in core spell effects
- // So called only for not proccessed cases
- if (gameObjTarget)
- sScriptMgr->OnDummyEffect(m_caster, m_spellInfo->Id, effIndex, gameObjTarget);
- else if (unitTarget && unitTarget->GetTypeId() == TYPEID_UNIT)
- sScriptMgr->OnDummyEffect(m_caster, m_spellInfo->Id, effIndex, unitTarget->ToCreature());
- else if (itemTarget)
- sScriptMgr->OnDummyEffect(m_caster, m_spellInfo->Id, effIndex, itemTarget);
}
void Spell::EffectTriggerSpell(SpellEffIndex /*effIndex*/)
@@ -2031,7 +2025,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
if (properties->Control == SUMMON_CATEGORY_ALLY)
{
summon->SetOwnerGUID(m_originalCaster->GetGUID());
- summon->setFaction(m_originalCaster->getFaction());
+ summon->SetFaction(m_originalCaster->GetFaction());
summon->SetCreatedBySpell(m_spellInfo->Id);
}
@@ -2072,9 +2066,9 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
uint32 faction = properties->Faction;
if (!faction)
- faction = m_originalCaster->getFaction();
+ faction = m_originalCaster->GetFaction();
- summon->setFaction(faction);
+ summon->SetFaction(faction);
break;
}
@@ -2232,11 +2226,11 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/)
if (unitTarget->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING))
return;
- unitTarget->SetFacingTo(unitTarget->GetAngle(destTarget));
- unitTarget->ClearUnitState(UNIT_STATE_MOVING);
-
if (unitTarget->GetTypeId() == TYPEID_UNIT)
unitTarget->GetMotionMaster()->MoveDistract(damage * IN_MILLISECONDS);
+
+ unitTarget->StopMoving();
+ unitTarget->SetFacingTo(unitTarget->GetAngle(destTarget));
}
void Spell::EffectPickPocket(SpellEffIndex /*effIndex*/)
@@ -3604,7 +3598,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
PhasingHandler::InheritPhaseShift(go, m_caster);
- go->SetFaction(m_caster->getFaction());
+ go->SetFaction(m_caster->GetFaction());
go->SetLevel(m_caster->getLevel()+1);
int32 duration = m_spellInfo->CalcDuration(m_caster);
go->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
@@ -4688,7 +4682,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
{
case GAMEOBJECT_TYPE_FISHINGNODE:
{
- go->SetFaction(m_caster->getFaction());
+ go->SetFaction(m_caster->GetFaction());
ObjectGuid bobberGuid = go->GetGUID();
// client requires fishing bobber guid in channel object slot 0 to be usable
m_caster->SetChannelObject(0, bobberGuid);
@@ -5206,7 +5200,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const*
((Guardian*)summon)->InitStatsForLevel(level);
if (properties && properties->Control == SUMMON_CATEGORY_ALLY)
- summon->setFaction(caster->getFaction());
+ summon->SetFaction(caster->GetFaction());
if (summon->HasUnitTypeMask(UNIT_MASK_MINION) && m_targets.HasDst())
((Minion*)summon)->SetFollowAngle(m_caster->GetAngle(summon));
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 12eb37b6861..b9f26ed4e08 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -510,14 +510,16 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster /*= nullptr*/, int32 const*
if (Scaling.ResourceCoefficient)
comboDamage = Scaling.ResourceCoefficient * value;
}
- else
+ else if (GetScalingExpectedStat() == ExpectedStatType::None)
{
- if (GetScalingExpectedStat() == ExpectedStatType::None)
+ if (caster && basePointsPerLevel != 0.0f)
{
- int32 level = caster ? int32(caster->getLevel()) : 0;
+ int32 level = int32(caster->getLevel());
if (level > int32(_spellInfo->MaxLevel) && _spellInfo->MaxLevel > 0)
level = int32(_spellInfo->MaxLevel);
- level -= int32(_spellInfo->BaseLevel);
+
+ // if base level is greater than spell level, reduce by base level (eg. pilgrims foods)
+ level -= int32(std::max(_spellInfo->BaseLevel, _spellInfo->SpellLevel));
if (level < 0)
level = 0;
value += level * basePointsPerLevel;
@@ -1673,7 +1675,7 @@ bool SpellInfo::IsChanneled() const
bool SpellInfo::IsMoveAllowedChannel() const
{
- return IsChanneled() && HasAttribute(SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING);
+ return IsChanneled() && (HasAttribute(SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING) || (!(ChannelInterruptFlags[0] & (AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_TURNING))));
}
bool SpellInfo::NeedsComboPoints() const
@@ -3382,11 +3384,14 @@ void SpellInfo::_LoadImmunityInfo()
{
switch (Id)
{
+ case 42292: // PvP trinket
+ case 59752: // Every Man for Himself
+ mechanicImmunityMask |= IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED);
+ break;
case 34471: // The Beast Within
case 19574: // Bestial Wrath
- case 42292: // PvP trinket
case 46227: // Medallion of Immunity
- case 59752: // Every Man for Himself
case 53490: // Bullheaded
case 65547: // PvP Trinket
case 134946: // Supremacy of the Alliance
@@ -4507,6 +4512,7 @@ bool SpellInfo::_IsPositiveEffect(uint32 effIndex, bool deep) const
case SPELL_AURA_MOD_STALKED:
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
case SPELL_AURA_PREVENT_RESURRECTION:
+ case SPELL_AURA_EMPATHY:
return false;
case SPELL_AURA_PERIODIC_DAMAGE: // used in positive spells also.
// part of negative spell if cast at self (prevent cancel)
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 1dcc18773e1..eb2621954cf 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -335,32 +335,34 @@ void SpellMgr::GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set<uint32>&
}
}
-bool SpellMgr::AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, int32 amount, std::map<SpellGroup, int32>& groups) const
+bool SpellMgr::AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, uint32 auraType, int32 amount, std::map<SpellGroup, int32>& groups) const
{
uint32 spellId = spellInfo->GetFirstRankSpell()->Id;
- SpellSpellGroupMapBounds spellGroup = GetSpellSpellGroupMapBounds(spellId);
+ auto spellGroupBounds = GetSpellSpellGroupMapBounds(spellId);
// Find group with SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT if it belongs to one
- for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second; ++itr)
+ for (auto itr = spellGroupBounds.first; itr != spellGroupBounds.second; ++itr)
{
SpellGroup group = itr->second;
- SpellGroupStackMap::const_iterator found = mSpellGroupStack.find(group);
- if (found != mSpellGroupStack.end())
+ auto found = mSpellSameEffectStack.find(group);
+ if (found != mSpellSameEffectStack.end())
{
- if (found->second == SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT)
+ // check auraTypes
+ if (!found->second.count(auraType))
+ continue;
+
+ // Put the highest amount in the map
+ auto groupItr = groups.find(group);
+ if (groupItr == groups.end())
+ groups.emplace(group, amount);
+ else
{
- // Put the highest amount in the map
- if (groups.find(group) == groups.end())
- groups[group] = amount;
- else
- {
- int32 curr_amount = groups[group];
- // Take absolute value because this also counts for the highest negative aura
- if (abs(curr_amount) < abs(amount))
- groups[group] = amount;
- }
- // return because a spell should be in only one SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT group
- return true;
+ int32 curr_amount = groups[group];
+ // Take absolute value because this also counts for the highest negative aura
+ if (std::abs(curr_amount) < std::abs(amount))
+ groupItr->second = amount;
}
+ // return because a spell should be in only one SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT group per auraType
+ return true;
}
}
// Not in a SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT group, so return false
@@ -374,8 +376,6 @@ SpellGroupStackRule SpellMgr::CheckSpellGroupStackRules(SpellInfo const* spellIn
uint32 spellid_1 = spellInfo1->GetFirstRankSpell()->Id;
uint32 spellid_2 = spellInfo2->GetFirstRankSpell()->Id;
- if (spellid_1 == spellid_2)
- return SPELL_GROUP_STACK_RULE_DEFAULT;
// find SpellGroups which are common for both spells
SpellSpellGroupMapBounds spellGroup1 = GetSpellSpellGroupMapBounds(spellid_1);
@@ -1181,19 +1181,19 @@ void SpellMgr::LoadSpellGroups()
}
int32 spell_id = fields[1].GetInt32();
- groups.insert(std::set<uint32>::value_type(group_id));
- mSpellGroupSpell.insert(SpellGroupSpellMap::value_type((SpellGroup)group_id, spell_id));
+ groups.insert(group_id);
+ mSpellGroupSpell.emplace(SpellGroup(group_id), spell_id);
} while (result->NextRow());
- for (SpellGroupSpellMap::iterator itr = mSpellGroupSpell.begin(); itr!= mSpellGroupSpell.end();)
+ for (auto itr = mSpellGroupSpell.begin(); itr!= mSpellGroupSpell.end();)
{
if (itr->second < 0)
{
if (groups.find(abs(itr->second)) == groups.end())
{
TC_LOG_ERROR("sql.sql", "SpellGroup id %u listed in `spell_group` does not exist", abs(itr->second));
- mSpellGroupSpell.erase(itr++);
+ itr = mSpellGroupSpell.erase(itr);
}
else
++itr;
@@ -1201,31 +1201,30 @@ void SpellMgr::LoadSpellGroups()
else
{
SpellInfo const* spellInfo = GetSpellInfo(itr->second);
-
if (!spellInfo)
{
TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_group` does not exist", itr->second);
- mSpellGroupSpell.erase(itr++);
+ itr = mSpellGroupSpell.erase(itr);
}
else if (spellInfo->GetRank() > 1)
{
TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_group` is not the first rank of the spell.", itr->second);
- mSpellGroupSpell.erase(itr++);
+ itr = mSpellGroupSpell.erase(itr);
}
else
++itr;
}
}
- for (std::set<uint32>::iterator groupItr = groups.begin(); groupItr != groups.end(); ++groupItr)
+ for (auto groupItr = groups.begin(); groupItr != groups.end(); ++groupItr)
{
std::set<uint32> spells;
GetSetOfSpellsInSpellGroup(SpellGroup(*groupItr), spells);
- for (std::set<uint32>::iterator spellItr = spells.begin(); spellItr != spells.end(); ++spellItr)
+ for (auto spellItr = spells.begin(); spellItr != spells.end(); ++spellItr)
{
++count;
- mSpellSpellGroup.insert(SpellSpellGroupMap::value_type(*spellItr, SpellGroup(*groupItr)));
+ mSpellSpellGroup.emplace(*spellItr, SpellGroup(*groupItr));
}
}
@@ -1237,6 +1236,9 @@ void SpellMgr::LoadSpellGroupStackRules()
uint32 oldMSTime = getMSTime();
mSpellGroupStack.clear(); // need for reload case
+ mSpellSameEffectStack.clear();
+
+ std::vector<uint32> sameEffectGroups;
// 0 1
QueryResult result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules");
@@ -1259,20 +1261,126 @@ void SpellMgr::LoadSpellGroupStackRules()
continue;
}
- SpellGroupSpellMapBounds spellGroup = GetSpellGroupSpellMapBounds((SpellGroup)group_id);
-
- if (spellGroup.first == spellGroup.second)
+ auto bounds = GetSpellGroupSpellMapBounds((SpellGroup)group_id);
+ if (bounds.first == bounds.second)
{
TC_LOG_ERROR("sql.sql", "SpellGroup id %u listed in `spell_group_stack_rules` does not exist.", group_id);
continue;
}
- mSpellGroupStack[(SpellGroup)group_id] = (SpellGroupStackRule)stack_rule;
+ mSpellGroupStack.emplace(SpellGroup(group_id), SpellGroupStackRule(stack_rule));
+
+ // different container for same effect stack rules, need to check effect types
+ if (stack_rule == SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT)
+ sameEffectGroups.push_back(group_id);
++count;
} while (result->NextRow());
TC_LOG_INFO("server.loading", ">> Loaded %u spell group stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
+ count = 0;
+ oldMSTime = getMSTime();
+ TC_LOG_INFO("server.loading", ">> Parsing SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT stack rules...");
+
+ for (uint32 group_id : sameEffectGroups)
+ {
+ std::set<uint32> spellIds;
+ GetSetOfSpellsInSpellGroup(SpellGroup(group_id), spellIds);
+
+ std::unordered_set<uint32> auraTypes;
+
+ // we have to 'guess' what effect this group corresponds to
+ {
+ std::unordered_multiset<uint32 /*auraName*/> frequencyContainer;
+
+ // only waylay for the moment (shared group)
+ std::vector<std::vector<uint32 /*auraName*/>> const SubGroups =
+ {
+ { SPELL_AURA_MOD_MELEE_HASTE, SPELL_AURA_MOD_MELEE_RANGED_HASTE, SPELL_AURA_MOD_RANGED_HASTE }
+ };
+
+ for (uint32 spellId : spellIds)
+ {
+ SpellInfo const* spellInfo = AssertSpellInfo(spellId);
+ for (SpellEffectInfo const* effectInfo : spellInfo->GetEffectsForDifficulty(DIFFICULTY_NONE))
+ {
+ if (!effectInfo->IsAura())
+ continue;
+
+ int32 auraName = static_cast<int32>(effectInfo->ApplyAuraName);
+ for (std::vector<uint32> const& subGroup : SubGroups)
+ {
+ if (std::find(subGroup.begin(), subGroup.end(), auraName) != subGroup.end())
+ {
+ // count as first aura
+ auraName = subGroup.front();
+ break;
+ }
+ }
+
+ frequencyContainer.insert(auraName);
+ }
+ }
+
+ uint32 auraType = 0;
+ size_t auraTypeCount = 0;
+ for (uint32 auraName : frequencyContainer)
+ {
+ size_t currentCount = frequencyContainer.count(auraName);
+ if (currentCount > auraTypeCount)
+ {
+ auraType = auraName;
+ auraTypeCount = currentCount;
+ }
+ }
+
+ for (std::vector<uint32> const& subGroup : SubGroups)
+ {
+ if (auraType == subGroup.front())
+ {
+ auraTypes.insert(subGroup.begin(), subGroup.end());
+ break;
+ }
+ }
+
+ if (auraTypes.empty())
+ auraTypes.insert(auraType);
+ }
+
+ // re-check spells against guessed group
+ for (uint32 spellId : spellIds)
+ {
+ SpellInfo const* spellInfo = AssertSpellInfo(spellId);
+
+ bool found = false;
+ while (spellInfo)
+ {
+ for (uint32 auraType : auraTypes)
+ {
+ if (spellInfo->HasAura(DIFFICULTY_NONE, AuraType(auraType)))
+ {
+ found = true;
+ break;
+ }
+ }
+
+ if (found)
+ break;
+
+ spellInfo = spellInfo->GetNextRankSpell();
+ }
+
+ // not found either, log error
+ if (!found)
+ TC_LOG_ERROR("sql.sql", "SpellId %u listed in `spell_group` with stack rule 3 does not share aura assigned for group %u", spellId, group_id);
+ }
+
+ mSpellSameEffectStack[SpellGroup(group_id)] = auraTypes;
+ ++count;
+ }
+
+ TC_LOG_INFO("server.loading", ">> Parsed %u SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void SpellMgr::LoadSpellProcs()
@@ -3342,6 +3450,13 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->Speed = 0.0f; // This spell's summon happens instantly
});
+ // Chilled to the Bone
+ ApplySpellFix({ 70106 }, [](SpellInfo* spellInfo)
+ {
+ spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_DONE_BONUS;
+ spellInfo->AttributesEx6 |= SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS;
+ });
+
// Ice Lock
ApplySpellFix({ 71614 }, [](SpellInfo* spellInfo)
{
diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h
index 6bf843cfff1..c121f1ec8f1 100644
--- a/src/server/game/Spells/SpellMgr.h
+++ b/src/server/game/Spells/SpellMgr.h
@@ -31,6 +31,7 @@
#include <set>
#include <vector>
#include <unordered_map>
+#include <unordered_set>
class SpellInfo;
class Player;
@@ -309,14 +310,26 @@ enum SpellGroup
SPELL_GROUP_CORE_RANGE_MAX = 5
};
+namespace std
+{
+ template<>
+ struct hash<SpellGroup>
+ {
+ size_t operator()(SpellGroup const& group) const
+ {
+ return hash<uint32>()(uint32(group));
+ }
+ };
+}
+
#define SPELL_GROUP_DB_RANGE_MIN 1000
// spell_id, group_id
-typedef std::multimap<uint32, SpellGroup > SpellSpellGroupMap;
+typedef std::unordered_multimap<uint32, SpellGroup> SpellSpellGroupMap;
typedef std::pair<SpellSpellGroupMap::const_iterator, SpellSpellGroupMap::const_iterator> SpellSpellGroupMapBounds;
// group_id, spell_id
-typedef std::multimap<SpellGroup, int32> SpellGroupSpellMap;
+typedef std::unordered_multimap<SpellGroup, int32> SpellGroupSpellMap;
typedef std::pair<SpellGroupSpellMap::const_iterator, SpellGroupSpellMap::const_iterator> SpellGroupSpellMapBounds;
enum SpellGroupStackRule
@@ -329,7 +342,9 @@ enum SpellGroupStackRule
SPELL_GROUP_STACK_RULE_MAX
};
-typedef std::map<SpellGroup, SpellGroupStackRule> SpellGroupStackMap;
+typedef std::unordered_map<SpellGroup, SpellGroupStackRule> SpellGroupStackMap;
+
+typedef std::unordered_map<SpellGroup, std::unordered_set<uint32 /*auraName*/>> SameEffectStackMap;
struct SpellThreatEntry
{
@@ -655,7 +670,7 @@ class TC_GAME_API SpellMgr
void GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set<uint32>& foundSpells, std::set<SpellGroup>& usedGroups) const;
// Spell Group Stack Rules table
- bool AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, int32 amount, std::map<SpellGroup, int32>& groups) const;
+ bool AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, uint32 auraType, int32 amount, std::map<SpellGroup, int32>& groups) const;
SpellGroupStackRule CheckSpellGroupStackRules(SpellInfo const* spellInfo1, SpellInfo const* spellInfo2) const;
SpellGroupStackRule GetSpellGroupStackRule(SpellGroup groupid) const;
@@ -750,6 +765,7 @@ class TC_GAME_API SpellMgr
SpellSpellGroupMap mSpellSpellGroup;
SpellGroupSpellMap mSpellGroupSpell;
SpellGroupStackMap mSpellGroupStack;
+ SameEffectStackMap mSpellSameEffectStack;
SpellProcMap mSpellProcMap;
SpellThreatMap mSpellThreatMap;
SpellPetAuraMap mSpellPetAuraMap;
diff --git a/src/server/game/Time/UpdateTime.cpp b/src/server/game/Time/UpdateTime.cpp
index ffd985c2caf..6f3f5d6ff83 100644
--- a/src/server/game/Time/UpdateTime.cpp
+++ b/src/server/game/Time/UpdateTime.cpp
@@ -31,6 +31,7 @@ UpdateTime::UpdateTime()
_maxUpdateTime = 0;
_maxUpdateTimeOfLastTable = 0;
_maxUpdateTimeOfCurrentTable = 0;
+ _recordedTime = 0;
_updateTimeDataTable = { };
}
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index e1e71ce01e2..a94e06034ba 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -60,6 +60,7 @@
#include "IPLocation.h"
#include "Language.h"
#include "LFGMgr.h"
+#include "LootItemStorage.h"
#include "LootMgr.h"
#include "M2Stores.h"
#include "MapManager.h"
@@ -2073,6 +2074,9 @@ void World::SetInitialWorldSettings()
TC_LOG_INFO("server.loading", "Loading Calendar data...");
sCalendarMgr->LoadFromDB();
+ TC_LOG_INFO("server.loading", "Loading Item loot...");
+ sLootItemStorage->LoadStorageFromDB();
+
TC_LOG_INFO("server.loading", "Initialize query data...");
sObjectMgr->InitializeQueriesData(QUERY_DATA_ALL);
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index a9d9ddf2008..83ac3e43b4f 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -218,7 +218,7 @@ public:
if (!pfactionid)
{
- uint32 factionid = target->getFaction();
+ uint32 factionid = target->GetFaction();
uint32 flag = target->m_unitData->Flags;
uint64 npcflag;
memcpy(&npcflag, target->m_unitData->NpcFlags.begin(), sizeof(uint64));
@@ -261,7 +261,7 @@ public:
handler->PSendSysMessage(LANG_YOU_CHANGE_FACTION, target->GetGUID().ToString().c_str(), factionid, flag, std::to_string(npcflag).c_str(), dyflag);
- target->setFaction(factionid);
+ target->SetFaction(factionid);
target->SetUnitFlags(UnitFlags(flag));
target->SetNpcFlags(NPCFlags(npcflag & 0xFFFFFFFF));
target->SetNpcFlags2(NPCFlags2(npcflag >> 32));
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index 7a2e6cff30e..595af9223bc 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -606,7 +606,7 @@ public:
return false;
}
- creature->setFaction(factionId);
+ creature->SetFaction(factionId);
// Faction is set in creature_template - not inside creature
@@ -725,7 +725,7 @@ public:
CreatureTemplate const* cInfo = target->GetCreatureTemplate();
- uint32 faction = target->getFaction();
+ uint32 faction = target->GetFaction();
uint64 npcflags;
memcpy(&npcflags, target->m_unitData->NpcFlags.begin(), sizeof(npcflags));
uint32 mechanicImmuneMask = cInfo->MechanicImmuneMask;
diff --git a/src/server/scripts/Commands/cs_pet.cpp b/src/server/scripts/Commands/cs_pet.cpp
index 5a373419634..1e0cd4ab835 100644
--- a/src/server/scripts/Commands/cs_pet.cpp
+++ b/src/server/scripts/Commands/cs_pet.cpp
@@ -102,7 +102,7 @@ public:
creatureTarget->SetHealth(0); // just for nice GM-mode view
pet->SetCreatorGUID(player->GetGUID());
- pet->setFaction(player->getFaction());
+ pet->SetFaction(player->GetFaction());
if (!pet->InitStatsForLevel(creatureTarget->getLevel()))
{
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp
index 6d87e944368..853b03245d0 100644
--- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp
+++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp
@@ -91,7 +91,7 @@ public:
void JustSummoned(Creature* summoned) override
{
summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true));
- summoned->setFaction(me->getFaction());
+ summoned->SetFaction(me->GetFaction());
WaterElementalGUID = summoned->GetGUID();
summons.Summon(summoned);
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
index e9bcdeeba0f..b0c7e149bd3 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
@@ -600,7 +600,7 @@ public:
//spell by trap has effect61, this indicate the bar go hostile
if (Unit* tmp = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_PHALANX)))
- tmp->setFaction(14);
+ tmp->SetFaction(14);
//for later, this event(s) has alot more to it.
//optionally, DONE can trigger bar to go hostile.
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp
index 8eb276ed5fa..af91790fb12 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp
@@ -143,7 +143,7 @@ public:
{
_Reset();
me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
- me->setFaction(COREN_DIREBREW_FACTION_FRIEND);
+ me->SetFaction(COREN_DIREBREW_FACTION_FRIEND);
events.SetPhase(PHASE_ALL);
for (uint8 i = 0; i < MAX_ANTAGONISTS; ++i)
@@ -166,7 +166,7 @@ public:
{
events.SetPhase(PHASE_ONE);
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
- me->setFaction(COREN_DIREBREW_FACTION_HOSTILE);
+ me->SetFaction(COREN_DIREBREW_FACTION_HOSTILE);
me->SetInCombatWithZone();
EntryCheckPredicate pred(NPC_ANTAGONIST);
@@ -357,7 +357,7 @@ public:
void Reset() override
{
- me->setFaction(COREN_DIREBREW_FACTION_HOSTILE);
+ me->SetFaction(COREN_DIREBREW_FACTION_HOSTILE);
DoCastAOE(SPELL_MOLE_MACHINE_EMERGE, true);
me->SetInCombatWithZone();
}
@@ -399,7 +399,7 @@ public:
break;
case ACTION_ANTAGONIST_HOSTILE:
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
- me->setFaction(COREN_DIREBREW_FACTION_HOSTILE);
+ me->SetFaction(COREN_DIREBREW_FACTION_HOSTILE);
me->SetInCombatWithZone();
break;
default:
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp
index 4ae113289f6..9015420d079 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp
@@ -75,7 +75,7 @@ class boss_emperor_dagran_thaurissan : public CreatureScript
if (Creature* moira = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_MOIRA)))
{
moira->AI()->EnterEvadeMode();
- moira->setFaction(35);
+ moira->SetFaction(35);
}
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp
index 39f9869cc22..afb97ec93d1 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp
@@ -134,7 +134,7 @@ class boss_doomrel : public CreatureScript
case GOSSIP_ACTION_INFO_DEF+2:
CloseGossipMenuFor(player);
//start event here
- creature->setFaction(FACTION_HOSTILE);
+ creature->SetFaction(FACTION_HOSTILE);
creature->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
creature->AI()->AttackStart(player);
InstanceScript* instance = creature->GetInstanceScript();
@@ -170,7 +170,7 @@ class boss_doomrel : public CreatureScript
{
Initialize();
- me->setFaction(FACTION_FRIEND);
+ me->SetFaction(FACTION_FRIEND);
// was set before event start, so set again
me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
index 589a4757ec7..219414e29a7 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
@@ -354,7 +354,7 @@ public:
{
if (Creature* boss = instance->GetCreature(TombBossGUIDs[TombEventCounter]))
{
- boss->setFaction(FACTION_HOSTILE);
+ boss->SetFaction(FACTION_HOSTILE);
boss->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
if (Unit* target = boss->SelectNearestTarget(500))
boss->AI()->AttackStart(target);
@@ -380,7 +380,7 @@ public:
boss->GetMotionMaster()->MoveTargetedHome();
boss->SetLootRecipient(NULL);
}
- boss->setFaction(FACTION_FRIEND);
+ boss->SetFaction(FACTION_FRIEND);
}
}
GhostKillCount = 0;
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
index 10b4ed5c91e..5af9bf91aaa 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
@@ -190,7 +190,7 @@ public:
me->SetVisible(true);
me->SetNpcFlags(UNIT_NPC_FLAG_GOSSIP);
- me->setFaction(35);
+ me->SetFaction(35);
me->SetStandState(UNIT_STAND_STATE_SIT_HIGH_CHAIR);
me->RemoveAura(SPELL_NEFARIANS_BARRIER);
}
@@ -207,7 +207,7 @@ public:
Talk(SAY_GAMESBEGIN_2);
- me->setFaction(103);
+ me->SetFaction(103);
me->SetNpcFlags(UNIT_NPC_FLAG_NONE);
DoCast(me, SPELL_NEFARIANS_BARRIER);
me->SetStandState(UNIT_STAND_STATE_STAND);
@@ -342,7 +342,7 @@ public:
CreatureID = Entry[urand(0, 4)];
if (Creature* dragon = me->SummonCreature(CreatureID, DrakeSpawnLoc[i]))
{
- dragon->setFaction(103);
+ dragon->SetFaction(103);
dragon->AI()->AttackStart(me->GetVictim());
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp
index 41dbc2f2a8b..43c0d05805b 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp
@@ -75,7 +75,7 @@ public:
{
Initialize();
creature->AddNpcFlag(UNIT_NPC_FLAG_GOSSIP);
- creature->setFaction(35);
+ creature->SetFaction(35);
creature->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
}
@@ -153,7 +153,7 @@ public:
events.ScheduleEvent(EVENT_SPEECH_4, 16000);
break;
case EVENT_SPEECH_4:
- me->setFaction(103);
+ me->SetFaction(103);
if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID))
AttackStart(player);
break;
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
index 147396ab2a2..6d03826d7b6 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
@@ -110,7 +110,7 @@ class boss_majordomo : public CreatureScript
if (!me->FindNearestCreature(NPC_FLAMEWAKER_HEALER, 100.0f) && !me->FindNearestCreature(NPC_FLAMEWAKER_ELITE, 100.0f))
{
instance->UpdateEncounterStateForKilledCreature(me->GetEntry(), me);
- me->setFaction(FACTION_FRIENDLY);
+ me->SetFaction(FACTION_FRIENDLY);
EnterEvadeMode();
Talk(SAY_DEFEAT);
_JustDied();
@@ -191,7 +191,7 @@ class boss_majordomo : public CreatureScript
}
else if (action == ACTION_START_RAGNAROS_ALT)
{
- me->setFaction(FACTION_FRIENDLY);
+ me->SetFaction(FACTION_FRIENDLY);
me->AddNpcFlag(UNIT_NPC_FLAG_GOSSIP);
}
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp
index 361d84c137d..4e245db8aad 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp
@@ -175,7 +175,7 @@ class boss_ragnaros : public CreatureScript
{
//Become unbanished again
me->SetReactState(REACT_AGGRESSIVE);
- me->setFaction(14);
+ me->SetFaction(14);
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetEmoteState(EMOTE_ONESHOT_NONE);
me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
@@ -253,7 +253,7 @@ class boss_ragnaros : public CreatureScript
me->InterruptNonMeleeSpells(false);
//Root self
//DoCast(me, 23973);
- me->setFaction(35);
+ me->SetFaction(35);
me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetEmoteState(EMOTE_STATE_SUBMERGED);
me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
index d3667627db7..a7998726e1e 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
@@ -130,7 +130,7 @@ public:
{
Start(true, false, player->GetGUID());
- me->setFaction(player->getFaction());
+ me->SetFaction(player->GetFaction());
SetData(1, 0);
player->PlayerTalkClass->SendCloseGossip();
@@ -225,8 +225,8 @@ public:
{
//just in case
if (GetPlayerForEscort())
- if (me->getFaction() != GetPlayerForEscort()->getFaction())
- me->setFaction(GetPlayerForEscort()->getFaction());
+ if (me->GetFaction() != GetPlayerForEscort()->GetFaction())
+ me->SetFaction(GetPlayerForEscort()->GetFaction());
switch (waypointId)
{
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
index da6aebea818..c5366285de7 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
@@ -328,7 +328,7 @@ public:
DoResetThreat();
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
{
- me->SetFacingToObject(target, true);
+ me->SetFacingToObject(target);
DoCast(target, SPELL_RAIN_OF_BONES);
}
break;
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
index 911912168e6..1c4f1c112eb 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
@@ -374,7 +374,7 @@ public:
if (infernal)
{
infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE);
- infernal->setFaction(me->getFaction());
+ infernal->SetFaction(me->GetFaction());
if (point)
ENSURE_AI(netherspite_infernal::netherspite_infernalAI, infernal->AI())->point = point;
ENSURE_AI(netherspite_infernal::netherspite_infernalAI, infernal->AI())->malchezaar = me->GetGUID();
@@ -449,7 +449,7 @@ public:
if (axe)
{
axe->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
- axe->setFaction(me->getFaction());
+ axe->SetFaction(me->GetFaction());
axes[i] = axe->GetGUID();
if (target)
{
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 990788b7c9d..8172ec257d0 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
@@ -428,7 +428,7 @@ public:
if (Creature* pSpawn = me->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000))
{
- pSpawn->setFaction(me->getFaction());
+ pSpawn->SetFaction(me->GetFaction());
pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false);
}
break;
@@ -446,7 +446,7 @@ public:
if (Creature* unit = me->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000))
{
unit->Attack(me->GetVictim(), true);
- unit->setFaction(me->getFaction());
+ unit->SetFaction(me->GetFaction());
}
}
@@ -460,7 +460,7 @@ public:
if (Creature* unit = me->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
{
unit->Attack(me->GetVictim(), true);
- unit->setFaction(me->getFaction());
+ unit->SetFaction(me->GetFaction());
}
}
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
index fafc756dc07..bfc74a71127 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
@@ -1382,7 +1382,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
{
Talk(SAY_JULIANNE_AGGRO);
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
- me->setFaction(16);
+ me->SetFaction(16);
AggroYellTimer = 0;
} else AggroYellTimer -= diff;
}
@@ -1410,7 +1410,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
ENSURE_AI(boss_romulo::boss_romuloAI, pRomulo->AI())->Phase = PHASE_ROMULO;
DoZoneInCombat(pRomulo);
- pRomulo->setFaction(16);
+ pRomulo->SetFaction(16);
}
SummonedRomulo = true;
} else SummonRomuloTimer -= diff;
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
index 7d31ee88873..9fa6e43ae5d 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
@@ -454,7 +454,7 @@ public:
Initialize();
me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
- me->setFaction(14);
+ me->SetFaction(14);
DoCast(me, SPELL_FLAMESTRIKE2, true);
}
@@ -659,7 +659,7 @@ public:
me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetDisableGravity(true);
- me->setFaction(14);
+ me->SetFaction(14);
DoCast(me, SPELL_ARCANE_SPHERE_PASSIVE, true);
}
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
index 257bc278235..89d8c159194 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
@@ -128,7 +128,7 @@ public:
{
Initialize();
events.Reset();
- me->setFaction(7);
+ me->SetFaction(7);
me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
me->LoadEquipment(0, true);
@@ -234,7 +234,7 @@ public:
wait_timer -= diff;
else
{
- me->setFaction(14);
+ me->SetFaction(14);
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
phase = PHASE_ATTACKING;
@@ -594,7 +594,7 @@ public:
{
if (m_uiDuelTimer <= uiDiff)
{
- me->setFaction(FACTION_HOSTILE);
+ me->SetFaction(FACTION_HOSTILE);
if (Unit* unit = ObjectAccessor::GetUnit(*me, m_uiDuelerGUID))
AttackStart(unit);
@@ -780,7 +780,7 @@ public:
{
charmer->RemoveAurasDueToSpell(SPELL_EFFECT_STOLEN_HORSE);
caster->RemoveNpcFlag(UNIT_NPC_FLAG_SPELLCLICK);
- caster->setFaction(35);
+ caster->SetFaction(35);
DoCast(caster, SPELL_CALL_DARK_RIDER, true);
if (Creature* Dark_Rider = me->FindNearestCreature(NPC_DARK_RIDER_OF_ACHERUS, 15))
ENSURE_AI(npc_dark_rider_of_acherus::npc_dark_rider_of_acherusAI, Dark_Rider->AI())->InitDespawnHorse(caster);
@@ -872,7 +872,7 @@ public:
{
deathcharger->AddNpcFlag(UNIT_NPC_FLAG_SPELLCLICK);
deathcharger->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
- deathcharger->setFaction(2096);
+ deathcharger->SetFaction(2096);
}
}
};
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
index 30457fb0de8..2733669aa9d 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
@@ -87,7 +87,7 @@ public:
playerGUID = player->GetGUID();
speechTimer = 1000;
speechCounter = 1;
- me->setFaction(player->getFaction());
+ me->SetFaction(player->GetFaction());
me->CombatStop(true);
me->GetMotionMaster()->MoveIdle();
me->SetReactState(REACT_PASSIVE);
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
index 3cc188d9bc0..97c0296df30 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
@@ -653,7 +653,7 @@ public:
{
Unit* temp = me->SummonCreature(NPC_ACHERUS_GHOUL, (me->GetPositionX() - 20) + rand32() % 40, (me->GetPositionY() - 20) + rand32() % 40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
temp->SetWalk(false);
- temp->setFaction(2084);
+ temp->SetFaction(2084);
uiGhoulGUID[uiSummon_counter] = temp->GetGUID();
++uiSummon_counter;
}
@@ -671,7 +671,7 @@ public:
{
Unit* temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, (me->GetPositionX() - 20) + rand32() % 40, (me->GetPositionY() - 20) + rand32() % 40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
temp->SetWalk(false);
- temp->setFaction(2084);
+ temp->SetFaction(2084);
uiAbominationGUID[uiSummon_counter] = temp->GetGUID();
++uiSummon_counter;
}
@@ -689,7 +689,7 @@ public:
{
Unit* temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, (me->GetPositionX() - 20) + rand32() % 40, (me->GetPositionY() - 20) + rand32() % 40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
temp->SetWalk(false);
- temp->setFaction(2084);
+ temp->SetFaction(2084);
uiWarriorGUID[uiSummon_counter] = temp->GetGUID();
++uiSummon_counter;
}
@@ -707,7 +707,7 @@ public:
{
Unit* temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, (me->GetPositionX() - 20) + rand32() % 40, (me->GetPositionY() - 20) + rand32() % 40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
temp->SetWalk(false);
- temp->setFaction(2084);
+ temp->SetFaction(2084);
uiBehemothGUID[uiSummon_counter] = temp->GetGUID();
++uiSummon_counter;
}
@@ -1002,7 +1002,7 @@ public:
temp->SetEmoteState(EMOTE_STATE_ATTACK_UNARMED);
temp->SetWalk(false);
temp->SetSpeedRate(MOVE_RUN, 2.0f);
- temp->setFaction(me->getFaction());
+ temp->SetFaction(me->GetFaction());
temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
uiDefenderGUID[0] = temp->GetGUID();
@@ -1010,7 +1010,7 @@ public:
temp->SetEmoteState(EMOTE_STATE_ATTACK_UNARMED);
temp->SetWalk(false);
temp->SetSpeedRate(MOVE_RUN, 2.0f);
- temp->setFaction(me->getFaction());
+ temp->SetFaction(me->GetFaction());
temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
uiEarthshatterGUID[0] = temp->GetGUID();
}
@@ -1402,7 +1402,7 @@ public:
if (!uiTirionGUID)
if (Creature* temp = me->SummonCreature(NPC_HIGHLORD_TIRION_FORDRING, LightofDawnLoc[0].GetPositionWithOffset({ 0.0f, 0.0f, 0.0f, 1.528f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000))
{
- temp->setFaction(me->getFaction());
+ temp->SetFaction(me->GetFaction());
temp->SetVirtualItem(0, uint32(EQUIP_UNEQUIP));
temp->AI()->Talk(SAY_LIGHT_OF_DAWN25);
uiTirionGUID = temp->GetGUID();
@@ -1440,7 +1440,7 @@ public:
temp->DeleteThreatList();
temp->CombatStop(true);
temp->AttackStop();
- temp->setFaction(me->getFaction());
+ temp->SetFaction(me->GetFaction());
temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[9]);
}
@@ -1451,7 +1451,7 @@ public:
temp->DeleteThreatList();
temp->CombatStop(true);
temp->AttackStop();
- temp->setFaction(me->getFaction());
+ temp->SetFaction(me->GetFaction());
temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[12]);
}
@@ -1462,7 +1462,7 @@ public:
temp->DeleteThreatList();
temp->CombatStop(true);
temp->AttackStop();
- temp->setFaction(me->getFaction());
+ temp->SetFaction(me->GetFaction());
temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[15]);
}
@@ -1474,7 +1474,7 @@ public:
temp->DeleteThreatList();
temp->CombatStop(true);
temp->AttackStop();
- temp->setFaction(me->getFaction());
+ temp->SetFaction(me->GetFaction());
temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[18]);
temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false);
@@ -1489,7 +1489,7 @@ public:
temp->DeleteThreatList();
temp->CombatStop(true);
temp->AttackStop();
- temp->setFaction(me->getFaction());
+ temp->SetFaction(me->GetFaction());
temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[20]);
temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false);
@@ -1539,7 +1539,7 @@ public:
if (!temp)
{
temp = me->SummonCreature(NPC_ACHERUS_GHOUL, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
- temp->setFaction(2084);
+ temp->SetFaction(2084);
uiGhoulGUID[i] = temp->GetGUID();
}
}
@@ -1549,7 +1549,7 @@ public:
if (!temp)
{
temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
- temp->setFaction(2084);
+ temp->SetFaction(2084);
uiAbominationGUID[i] = temp->GetGUID();
}
}
@@ -1559,7 +1559,7 @@ public:
if (!temp)
{
temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
- temp->setFaction(2084);
+ temp->SetFaction(2084);
uiWarriorGUID[i] = temp->GetGUID();
}
}
@@ -1569,7 +1569,7 @@ public:
if (!temp)
{
temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
- temp->setFaction(2084);
+ temp->SetFaction(2084);
uiBehemothGUID[i] = temp->GetGUID();
}
}
@@ -1581,7 +1581,7 @@ public:
if (!temp)
{
temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
- temp->setFaction(2089);
+ temp->SetFaction(2089);
me->AddThreat(temp, 0.0f);
uiDefenderGUID[i] = temp->GetGUID();
}
@@ -1592,7 +1592,7 @@ public:
if (!temp)
{
temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
- temp->setFaction(2089);
+ temp->SetFaction(2089);
me->AddThreat(temp, 0.0f);
uiEarthshatterGUID[i] = temp->GetGUID();
}
@@ -1601,7 +1601,7 @@ public:
if (!temp)
{
temp = me->SummonCreature(NPC_KORFAX_CHAMPION_OF_THE_LIGHT, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
- temp->setFaction(2089);
+ temp->SetFaction(2089);
me->AddThreat(temp, 0.0f);
uiKorfaxGUID = temp->GetGUID();
}
@@ -1609,7 +1609,7 @@ public:
if (!temp)
{
temp = me->SummonCreature(NPC_LORD_MAXWELL_TYROSUS, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
- temp->setFaction(2089);
+ temp->SetFaction(2089);
me->AddThreat(temp, 0.0f);
uiMaxwellGUID = temp->GetGUID();
}
@@ -1617,7 +1617,7 @@ public:
if (!temp)
{
temp = me->SummonCreature(NPC_COMMANDER_ELIGOR_DAWNBRINGER, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
- temp->setFaction(2089);
+ temp->SetFaction(2089);
me->AddThreat(temp, 0.0f);
uiEligorGUID = temp->GetGUID();
}
@@ -1625,7 +1625,7 @@ public:
if (!temp)
{
temp = me->SummonCreature(NPC_RAYNE, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
- temp->setFaction(2089);
+ temp->SetFaction(2089);
me->AddThreat(temp, 0.0f);
uiRayneGUID = temp->GetGUID();
}
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp
index 18238ba3883..6edda7824be 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp
@@ -118,7 +118,7 @@ class boss_apothecary_hummel : public CreatureScript
_deadCount = 0;
_isDead = false;
events.SetPhase(PHASE_ALL);
- me->setFaction(FACTION_APOTHECARY_FRIENDLY);
+ me->SetFaction(FACTION_APOTHECARY_FRIENDLY);
me->SummonCreatureGroup(1);
}
@@ -137,7 +137,7 @@ class boss_apothecary_hummel : public CreatureScript
events.ScheduleEvent(EVENT_HUMMEL_SAY_0, Milliseconds(1));
me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
- me->setFaction(FACTION_APOTHECARY_HOSTILE);
+ me->SetFaction(FACTION_APOTHECARY_HOSTILE);
DummyEntryCheckPredicate pred;
summons.DoAction(ACTION_START_EVENT, pred);
}
@@ -290,7 +290,7 @@ struct npc_apothecary_genericAI : public ScriptedAI
if (action == ACTION_START_EVENT)
{
me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
- me->setFaction(FACTION_APOTHECARY_HOSTILE);
+ me->SetFaction(FACTION_APOTHECARY_HOSTILE);
me->GetMotionMaster()->MovePoint(1, _movePos);
}
else if (action == ACTION_START_FIGHT)
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
index 5d760eecbbc..23f9d315457 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
@@ -196,8 +196,8 @@ public:
++IntroPhase;
break;
case 1:
- me->SetInFront(Madrigosa);
- Madrigosa->SetInFront(me);
+ me->SetFacingToObject(Madrigosa);
+ Madrigosa->SetFacingToObject(me);
Madrigosa->AI()->Talk(YELL_MADR_INTRO, me);
IntroPhaseTimer = 9000;
++IntroPhase;
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
index 986c3af28a5..d68a463a5ee 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
@@ -159,7 +159,7 @@ public:
if (Creature* Sath = ObjectAccessor::GetCreature(*me, SathGUID))
Sath->AI()->EnterEvadeMode();
- me->setFaction(14);
+ me->SetFaction(14);
if (!bJustReset) //first reset at create
{
me->RemoveUnitFlag(UnitFlags(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE));
@@ -386,7 +386,7 @@ public:
switch (TalkSequence)
{
case 1:
- me->setFaction(35);
+ me->SetFaction(35);
TalkTimer = 1000;
break;
case 2:
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
index f95ddb5ce62..1a4999d450f 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
@@ -610,7 +610,7 @@ public:
else
summoned->SetLevel(me->getLevel());
- summoned->setFaction(me->getFaction());
+ summoned->SetFaction(me->GetFaction());
summons.Summon(summoned);
}
@@ -936,7 +936,7 @@ public:
void JustSummoned(Creature* summoned) override
{
- summoned->setFaction(me->getFaction());
+ summoned->SetFaction(me->GetFaction());
summoned->SetLevel(me->getLevel());
}
@@ -1036,7 +1036,7 @@ public:
void JustSummoned(Creature* summoned) override
{
- summoned->setFaction(me->getFaction());
+ summoned->SetFaction(me->GetFaction());
summoned->SetLevel(me->getLevel());
}
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
index 335e50a9223..38ab7cd851f 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
@@ -98,7 +98,7 @@ class boss_archaedas : public CreatureScript
Initialize();
instance->SetData(0, 5); // respawn any dead minions
- me->setFaction(35);
+ me->SetFaction(35);
me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetControlled(true, UNIT_STATE_ROOT);
me->AddAura(SPELL_FREEZE_ANIM, me);
@@ -114,14 +114,14 @@ class boss_archaedas : public CreatureScript
minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN, true);
minion->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
minion->SetControlled(false, UNIT_STATE_ROOT);
- minion->setFaction(14);
+ minion->SetFaction(14);
minion->RemoveAura(SPELL_MINION_FREEZE_ANIM);
}
}
void EnterCombat(Unit* /*who*/) override
{
- me->setFaction(14);
+ me->SetFaction(14);
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetControlled(false, UNIT_STATE_ROOT);
}
@@ -261,7 +261,7 @@ class npc_archaedas_minions : public CreatureScript
{
Initialize();
- me->setFaction(35);
+ me->SetFaction(35);
me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetControlled(true, UNIT_STATE_ROOT);
me->RemoveAllAuras();
@@ -270,7 +270,7 @@ class npc_archaedas_minions : public CreatureScript
void EnterCombat(Unit* /*who*/) override
{
- me->setFaction (14);
+ me->SetFaction(14);
me->RemoveAllAuras();
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetControlled(false, UNIT_STATE_ROOT);
@@ -350,7 +350,7 @@ class npc_stonekeepers : public CreatureScript
void Reset() override
{
- me->setFaction(35);
+ me->SetFaction(35);
me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetControlled(true, UNIT_STATE_ROOT);
me->RemoveAllAuras();
@@ -359,7 +359,7 @@ class npc_stonekeepers : public CreatureScript
void EnterCombat(Unit* /*who*/) override
{
- me->setFaction(14);
+ me->SetFaction(14);
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetControlled(false, UNIT_STATE_ROOT);
}
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
index 01613bf5a5f..ac3d2aa110f 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
@@ -149,7 +149,7 @@ class instance_uldaman : public InstanceMapScript
void SetFrozenState(Creature* creature)
{
- creature->setFaction(35);
+ creature->SetFaction(35);
creature->RemoveAllAuras();
creature->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
creature->SetControlled(true, UNIT_STATE_ROOT);
@@ -184,7 +184,7 @@ class instance_uldaman : public InstanceMapScript
if (!target || !target->IsAlive())
continue;
target->SetControlled(false, UNIT_STATE_ROOT);
- target->setFaction(14);
+ target->SetFaction(14);
target->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
target->RemoveAura(SPELL_MINION_FREEZE_ANIM);
@@ -205,11 +205,11 @@ class instance_uldaman : public InstanceMapScript
for (GuidVector::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
{
Creature* target = instance->GetCreature(*i);
- if (!target || !target->IsAlive() || target->getFaction() == 14)
+ if (!target || !target->IsAlive() || target->GetFaction() == 14)
continue;
target->SetControlled(false, UNIT_STATE_ROOT);
target->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
- target->setFaction(14);
+ target->SetFaction(14);
target->RemoveAura(SPELL_MINION_FREEZE_ANIM);
archaedas->CastSpell(target, SPELL_AWAKEN_VAULT_WALKER, true);
target->CastSpell(target, SPELL_ARCHAEDAS_AWAKEN, true);
@@ -225,7 +225,7 @@ class instance_uldaman : public InstanceMapScript
for (GuidVector::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
{
Creature* target = instance->GetCreature(*i);
- if (!target || target->isDead() || target->getFaction() != 14)
+ if (!target || target->isDead() || target->GetFaction() != 14)
continue;
target->DespawnOrUnsummon();
}
@@ -234,7 +234,7 @@ class instance_uldaman : public InstanceMapScript
for (GuidVector::const_iterator i = vaultWalkers.begin(); i != vaultWalkers.end(); ++i)
{
Creature* target = instance->GetCreature(*i);
- if (!target || target->isDead() || target->getFaction() != 14)
+ if (!target || target->isDead() || target->GetFaction() != 14)
continue;
target->DespawnOrUnsummon();
}
@@ -243,7 +243,7 @@ class instance_uldaman : public InstanceMapScript
for (GuidVector::const_iterator i = earthenGuardians.begin(); i != earthenGuardians.end(); ++i)
{
Creature* target = instance->GetCreature(*i);
- if (!target || target->isDead() || target->getFaction() != 14)
+ if (!target || target->isDead() || target->GetFaction() != 14)
continue;
target->DespawnOrUnsummon();
}
@@ -269,7 +269,7 @@ class instance_uldaman : public InstanceMapScript
if (!ironaya)
return;
- ironaya->setFaction(415);
+ ironaya->SetFaction(415);
ironaya->SetControlled(false, UNIT_STATE_ROOT);
ironaya->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
index bfa3983e8e4..3ad749d537d 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
@@ -144,7 +144,7 @@ class boss_mandokir : public CreatureScript
{
if (Creature* chainedSpirit = ObjectAccessor::GetCreature(*me, *itr))
if (chainedSpirit->GetEntry() == NPC_CHAINED_SPIRIT && chainedSpirit->AI())
- chainedSpirit->setFaction(FACTION_NONE);
+ chainedSpirit->SetFaction(FACTION_NONE);
}
}
diff --git a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp
index 4d858c29c29..f07c55b2752 100644
--- a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp
@@ -113,7 +113,7 @@ class npc_professor_phizzlethorpe : public CreatureScript
{
Talk(SAY_PROGRESS_1, player);
npc_escortAI::Start(false, false, player->GetGUID(), quest);
- me->setFaction(FACTION_SUNKEN_TREASURE);
+ me->SetFaction(FACTION_SUNKEN_TREASURE);
}
}
diff --git a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp
index 00acb433a61..1e4d75852a2 100644
--- a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp
@@ -133,7 +133,7 @@ public:
{
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
{
- creature->setFaction(FACTION_QUEST_ESCAPE);
+ creature->SetFaction(FACTION_QUEST_ESCAPE);
if (npc_escortAI* pEscortAI = CAST_AI(npc_ranger_lilatha::npc_ranger_lilathaAI, creature->AI()))
pEscortAI->Start(true, false, player->GetGUID());
diff --git a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
index 7466162b472..821f99ffc9a 100644
--- a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
@@ -79,7 +79,7 @@ public:
if (quest->GetQuestId() == QUEST_RESQUE_OOX_09)
{
me->SetStandState(UNIT_STAND_STATE_STAND);
- me->setFaction(player->GetTeam() == ALLIANCE ? FACTION_ESCORTEE_A : FACTION_ESCORTEE_H);
+ me->SetFaction(player->GetTeam() == ALLIANCE ? FACTION_ESCORTEE_A : FACTION_ESCORTEE_H);
Talk(SAY_OOX_START, player);
npc_escortAI::Start(false, false, player->GetGUID(), quest);
}
diff --git a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp
index 1b328c3127b..16306014b1d 100644
--- a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp
@@ -87,7 +87,7 @@ public:
me->SetEmoteState(EMOTE_STATE_STUN);
me->CombatStop(); // stop combat
me->DeleteThreatList(); // unsure of this
- me->setFaction(FACTION_HORDE_GENERIC); // horde generic
+ me->SetFaction(FACTION_HORDE_GENERIC); // horde generic
bReset = true;
Reset_Timer = 60000;
@@ -105,7 +105,7 @@ public:
{
EnterEvadeMode();
bReset = false;
- me->setFaction(FACTION_TROLL_BLOODSCALP); // troll, bloodscalp
+ me->SetFaction(FACTION_TROLL_BLOODSCALP); // troll, bloodscalp
return;
}
diff --git a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp
index 1b1f2e0b9d0..f561db22727 100644
--- a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp
@@ -84,7 +84,7 @@ public:
if (me->HasStealthAura())
me->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
SetRun();
- me->setFaction(FACTION_ENEMY);
+ me->SetFaction(FACTION_ENEMY);
break;
}
}
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
index 607a89fabb7..334e3ebb26c 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
@@ -199,7 +199,7 @@ public:
{
case 4:
SetEscortPaused(true);
- me->SetFacingTo(1.775791f, true);
+ me->SetFacingTo(1.775791f);
me->AddNpcFlag(UNIT_NPC_FLAG_GOSSIP);
Talk(SAY_MORRIDUNE_2);
break;
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
index 5ca36e99e0d..823ddd33aa9 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
@@ -917,7 +917,7 @@ void hyjalAI::HideNearPos(float x, float y)
for (std::list<Creature*>::const_iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
{
(*itr)->SetVisible(false);
- (*itr)->setFaction(35);//make them friendly so mobs won't attack them
+ (*itr)->SetFaction(35);//make them friendly so mobs won't attack them
}
}
}
@@ -995,7 +995,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
if ((*itr) && (*itr)->IsAlive())
{
(*itr)->CastSpell(*itr, SPELL_TELEPORT_VISUAL, true);
- (*itr)->setFaction(35);//make them friendly so mobs won't attack them
+ (*itr)->SetFaction(35);//make them friendly so mobs won't attack them
(*itr)->AddUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
}
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
index ede1d589535..00ff25951df 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
@@ -470,7 +470,7 @@ public:
if (Creature* trigger = me->SummonCreature(NPC_WORLD_TRIGGER_TINY, me->GetPositionWithOffset({ 8.0f, 8.0f, frand(25.0f, 35.0f), 0.0f }), TEMPSUMMON_TIMED_DESPAWN, 1000))
{
trigger->SetVisible(false);
- trigger->setFaction(me->getFaction());
+ trigger->SetFaction(me->GetFaction());
trigger->SetDisableGravity(true);
trigger->CastSpell(me, SPELL_METEOR, true);
}
diff --git a/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp b/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp
index 98f22411a5e..1bb7bae6842 100644
--- a/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp
+++ b/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp
@@ -297,7 +297,7 @@ class npc_blazing_monstrosity : public CreatureScript
// Our passenger is another vehicle (boardable by players)
DoCast(passenger, SPELL_SHARE_HEALTH, true);
- passenger->setFaction(35);
+ passenger->SetFaction(35);
passenger->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
// Hack to relocate vehicle on vehicle so exiting players are not moved under map
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp
index 1e9bca04fb8..cb715b6f1e2 100644
--- a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp
+++ b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp
@@ -82,7 +82,7 @@ public:
if (Invisible && InvisibleTimer <= diff)
{
//Become visible again
- me->setFaction(14);
+ me->SetFaction(14);
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
//Noxxion model
me->SetDisplayId(11172);
@@ -122,7 +122,7 @@ public:
//Interrupt any spell casting
//me->m_canMove = true;
me->InterruptNonMeleeSpells(false);
- me->setFaction(35);
+ me->SetFaction(35);
me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
// Invisible Model
me->SetDisplayId(11686);
diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
index a7daac95144..2deec5fa15e 100644
--- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
+++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
@@ -249,7 +249,7 @@ public:
me->SetCanFly(true);
me->SetDisableGravity(true);
me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), false);
- me->SetFacingTo(me->GetOrientation() + float(M_PI), true);
+ me->SetFacingTo(me->GetOrientation() + float(M_PI));
if (Creature * trigger = me->SummonCreature(NPC_TRIGGER, MiddleRoomLocation, TEMPSUMMON_CORPSE_DESPAWN))
triggerGUID = trigger->GetGUID();
me->GetMotionMaster()->MoveTakeoff(11, Phase2Floating);
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
index d3167d2272c..adfca4e9a7e 100644
--- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
@@ -136,7 +136,7 @@ public:
eventInProgress = true;
Talk(SAY_QUEST_ACCEPTED);
me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
- me->setFaction(FACTION_ESCORT);
+ me->SetFaction(FACTION_ESCORT);
me->GetMotionMaster()->MovePath(PATH_ESCORT, false);
}
}
diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp
index d7bb4c2b6fa..7fa68b2771a 100644
--- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp
@@ -58,7 +58,7 @@ public:
{
Start(true, false, player->GetGUID());
Talk(SAY_READY, player);
- me->setFaction(113);
+ me->SetFaction(113);
}
}
@@ -114,9 +114,9 @@ public:
void Reset() override { }
- void EnterCombat(Unit* /*who*/) override
+ void EnterCombat(Unit* who) override
{
- Talk(SAY_AGGRO1);
+ Talk(SAY_AGGRO1, who);
}
void JustSummoned(Creature* summoned) override
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp
index 4068f1491b6..3495a1a6d2b 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp
@@ -111,7 +111,7 @@ public:
//Cast
me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
- me->setFaction(35);
+ me->SetFaction(35);
DoCast(me, SPELL_DIRTMOUND_PASSIVE);
Submerged = true;
@@ -134,7 +134,7 @@ public:
if (Submerged && Back_Timer <= diff)
{
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
- me->setFaction(14);
+ me->SetFaction(14);
DoCastVictim(SPELL_GROUND_RUPTURE);
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp
index e9bd5488027..4dd49bb1c66 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp
@@ -332,7 +332,7 @@ struct boss_twinemperorsAI : public ScriptedAI
if (c->isDead())
{
c->Respawn();
- c->setFaction(7);
+ c->SetFaction(7);
c->RemoveAllAuras();
}
if (c->IsWithinDistInMap(me, ABUSE_BUG_RANGE))
@@ -427,7 +427,7 @@ public:
void CastSpellOnBug(Creature* target) override
{
- target->setFaction(14);
+ target->SetFaction(14);
target->AI()->AttackStart(me->getThreatManager().getHostilTarget());
target->AddAura(SPELL_MUTATE_BUG, target);
target->SetFullHealth();
@@ -518,7 +518,7 @@ public:
void CastSpellOnBug(Creature* target) override
{
- target->setFaction(14);
+ target->SetFaction(14);
target->AddAura(SPELL_EXPLODEBUG, target);
target->SetFullHealth();
}
diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
index bdd909b5fff..d8fee227711 100644
--- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
+++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
@@ -97,7 +97,7 @@ public:
creature->AI()->Talk(SAY_MAKE_PREPARATIONS);
- creature->setFaction(250);
+ creature->SetFaction(250);
creature->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
ENSURE_AI(npc_escortAI, (creature->AI()))->Start(false, false, player->GetGUID());
diff --git a/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp b/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp
index 3105164490a..f8b39df3d93 100644
--- a/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp
+++ b/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp
@@ -74,7 +74,7 @@ public:
void Reset() override
{
- me->setFaction(ZUMRAH_FRIENDLY_FACTION); // areatrigger sets faction to enemy
+ me->SetFaction(ZUMRAH_FRIENDLY_FACTION); // areatrigger sets faction to enemy
Initialize();
}
diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
index 0eb55441232..af4e5f4ec69 100644
--- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
+++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp
@@ -131,7 +131,7 @@ public:
{
Initialize();
- me->setFaction(FACTION_FRIENDLY);
+ me->SetFaction(FACTION_FRIENDLY);
}
void UpdateAI(uint32 diff) override
@@ -154,7 +154,7 @@ public:
Text_Timer = 5000;
break;
case 3:
- me->setFaction(FACTION_HOSTILE);
+ me->SetFaction(FACTION_HOSTILE);
if (Player* target = ObjectAccessor::GetPlayer(*me, PlayerGUID))
AttackStart(target);
@@ -199,7 +199,7 @@ public:
{
if (Creature* crew = ObjectAccessor::GetCreature(*me, instance->GetGuidData(entry)))
if (crew->IsAlive())
- crew->setFaction(FACTION_HOSTILE);
+ crew->SetFaction(FACTION_HOSTILE);
}
};
@@ -238,7 +238,7 @@ private:
crew->SetWalk(true);
crew->SetHomePosition(x, y, z, 0);
crew->GetMotionMaster()->MovePoint(1, x, y, z);
- crew->setFaction(FACTION_FREED);
+ crew->SetFaction(FACTION_FREED);
}
}
};
@@ -387,7 +387,7 @@ public:
{
if (me->IsAlive())
{
- me->setFaction(FACTION_FRIENDLY);
+ me->SetFaction(FACTION_FRIENDLY);
me->GetMotionMaster()->MovePoint(0, 1858.57f, 1146.35f, 14.745f);
me->SetHomePosition(1858.57f, 1146.35f, 14.745f, 3.85f); // in case he gets interrupted
Talk(SAY_WEEGLI_OK_I_GO);
@@ -454,7 +454,7 @@ public:
if (!pZumrah)
return false;
- pZumrah->setFaction(ZUMRAH_HOSTILE_FACTION);
+ pZumrah->SetFaction(ZUMRAH_HOSTILE_FACTION);
return true;
}
diff --git a/src/server/scripts/Kalimdor/zone_ashenvale.cpp b/src/server/scripts/Kalimdor/zone_ashenvale.cpp
index 6bf389dc180..af7ca599b3f 100644
--- a/src/server/scripts/Kalimdor/zone_ashenvale.cpp
+++ b/src/server/scripts/Kalimdor/zone_ashenvale.cpp
@@ -83,7 +83,7 @@ public:
{
if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL)
{
- me->setFaction(FACTION_QUEST);
+ me->SetFaction(FACTION_QUEST);
npc_escortAI::Start(true, false, player->GetGUID());
}
}
@@ -226,7 +226,7 @@ public:
if (quest->GetQuestId() == QUEST_VORSHA)
{
Talk(SAY_MUG_START1);
- me->setFaction(FACTION_QUEST);
+ me->SetFaction(FACTION_QUEST);
npc_escortAI::Start(true, false, player->GetGUID());
}
}
diff --git a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp
index 029ea6ad9ce..2e15e2d2118 100644
--- a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp
+++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp
@@ -201,7 +201,7 @@ public:
npc_engineer_spark_overgrindAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
- NormFaction = creature->getFaction();
+ NormFaction = creature->GetFaction();
NpcFlags = NPCFlags(creature->m_unitData->NpcFlags[0]);
}
@@ -220,7 +220,7 @@ public:
{
Initialize();
- me->setFaction(NormFaction);
+ me->SetFaction(NormFaction);
me->SetNpcFlags(NpcFlags);
}
@@ -232,7 +232,7 @@ public:
void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
{
CloseGossipMenuFor(player);
- me->setFaction(FACTION_HOSTILE);
+ me->SetFaction(FACTION_HOSTILE);
me->Attack(player, true);
}
@@ -403,7 +403,7 @@ public:
case EVENT_ACCEPT_QUEST:
if (Player* player = ObjectAccessor::GetPlayer(*me, _player))
Talk(SAY_START, player);
- me->setFaction(FACTION_QUEST);
+ me->SetFaction(FACTION_QUEST);
_events.ScheduleEvent(EVENT_START_ESCORT, Seconds(1));
break;
case EVENT_START_ESCORT:
@@ -532,8 +532,8 @@ public:
return 1000;
case 2:
Talk(GEEZLE_SAY_1, Spark);
- Spark->SetInFront(me);
- me->SetInFront(Spark);
+ Spark->SetFacingToObject(me);
+ me->SetFacingToObject(Spark);
return 5000;
case 3:
Spark->AI()->Talk(SPARK_SAY_2);
diff --git a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
index bf6b78ea005..5c2f4299068 100644
--- a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
+++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
@@ -105,7 +105,7 @@ public:
bool OnQuestAccept(Player* /*player*/, Creature* creature, const Quest* quest) override
{
if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT16)
- creature->setFaction(FACTION_HOSTILE);
+ creature->SetFaction(FACTION_HOSTILE);
return true;
}
diff --git a/src/server/scripts/Kalimdor/zone_felwood.cpp b/src/server/scripts/Kalimdor/zone_felwood.cpp
index adc4d92a01c..f3aff8909f7 100644
--- a/src/server/scripts/Kalimdor/zone_felwood.cpp
+++ b/src/server/scripts/Kalimdor/zone_felwood.cpp
@@ -59,7 +59,7 @@ public:
{
me->CastSpell(me, SPELL_INFECTED_WOULD);
me->SetEntry(NPC_CORRUPTED_LASHER);
- me->setFaction(FACTION_HOSTILE);
+ me->SetFaction(FACTION_HOSTILE);
}
else
{
diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp
index 9e4de29c00d..2df4806adac 100644
--- a/src/server/scripts/Kalimdor/zone_silithus.cpp
+++ b/src/server/scripts/Kalimdor/zone_silithus.cpp
@@ -980,7 +980,7 @@ public:
Merithra->SetNpcFlags(UNIT_NPC_FLAG_NONE);
Merithra->SetStandState(UNIT_STAND_STATE_STAND);
Merithra->SetDisplayId(MERITHRA_NIGHT_ELF_FORM);
- Merithra->setFaction(35);
+ Merithra->SetFaction(35);
}
if (Caelestrasz)
@@ -988,7 +988,7 @@ public:
Caelestrasz->SetNpcFlags(UNIT_NPC_FLAG_NONE);
Caelestrasz->SetStandState(UNIT_STAND_STATE_STAND);
Caelestrasz->SetDisplayId(CAELESTRASZ_NIGHT_ELF_FORM);
- Caelestrasz->setFaction(35);
+ Caelestrasz->SetFaction(35);
}
if (Arygos)
@@ -996,7 +996,7 @@ public:
Arygos->SetNpcFlags(UNIT_NPC_FLAG_NONE);
Arygos->SetStandState(UNIT_STAND_STATE_STAND);
Arygos->SetDisplayId(ARYGOS_GNOME_FORM);
- Arygos->setFaction(35);
+ Arygos->SetFaction(35);
}
if (Anachronos)
diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp
index 393ee9fcff6..2d5ad0bc50b 100644
--- a/src/server/scripts/Kalimdor/zone_tanaris.cpp
+++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp
@@ -90,7 +90,7 @@ public:
void Reset() override
{
Initialize();
- me->setFaction(35);
+ me->SetFaction(35);
}
void SendItem(Unit* receiver)
@@ -120,7 +120,7 @@ public:
{
if (SwitchFactionTimer <= diff)
{
- me->setFaction(91);
+ me->SetFaction(91);
isFriendly = false;
} else SwitchFactionTimer -= diff;
}
@@ -318,7 +318,7 @@ public:
{
if (quest->GetQuestId() == Q_OOX17)
{
- creature->setFaction(113);
+ creature->SetFaction(113);
creature->SetFullHealth();
creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp
index 7c36c9a1af5..2ac0c1dc8dd 100644
--- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp
+++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp
@@ -101,7 +101,7 @@ public:
{
if (quest->GetQuestId() == QUEST_FREE_FROM_HOLD)
{
- creature->setFaction(FACTION_ESCORTEE);
+ creature->SetFaction(FACTION_ESCORTEE);
creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->AI()->Talk(SAY_GIL_START, player);
@@ -196,7 +196,7 @@ public:
npc_taskmaster_fizzuleAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
- factionNorm = creature->getFaction();
+ factionNorm = creature->GetFaction();
}
void Initialize()
@@ -214,7 +214,7 @@ public:
void Reset() override
{
Initialize();
- me->setFaction(factionNorm);
+ me->SetFaction(factionNorm);
}
void DoFriend()
@@ -226,7 +226,7 @@ public:
me->StopMoving();
me->GetMotionMaster()->MoveIdle();
- me->setFaction(FACTION_FRIENDLY_F);
+ me->SetFaction(FACTION_FRIENDLY_F);
me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
}
@@ -266,7 +266,7 @@ public:
{
if (FlareCount >= 2)
{
- if (me->getFaction() == FACTION_FRIENDLY_F)
+ if (me->GetFaction() == FACTION_FRIENDLY_F)
return;
DoFriend();
@@ -419,7 +419,7 @@ public:
Creature* creature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
if (!creature)
continue;
- creature->setFaction(35);
+ creature->SetFaction(35);
creature->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
creature->AddUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
@@ -460,7 +460,7 @@ public:
creature->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
- creature->setFaction(14);
+ creature->SetFaction(14);
creature->AI()->AttackStart(warrior);
++Wave;
WaveTimer = 20000;
@@ -492,7 +492,7 @@ public:
creature->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
- creature->setFaction(14);
+ creature->SetFaction(14);
creature->AI()->AttackStart(warrior);
}
}
@@ -653,7 +653,7 @@ public:
{
if (quest->GetQuestId() == QUEST_ESCAPE)
{
- creature->setFaction(FACTION_RATCHET);
+ creature->SetFaction(FACTION_RATCHET);
creature->AI()->Talk(SAY_START);
if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI, creature->AI()))
pEscortAI->Start(true, false, player->GetGUID());
diff --git a/src/server/scripts/Kalimdor/zone_winterspring.cpp b/src/server/scripts/Kalimdor/zone_winterspring.cpp
index 97084ad9d28..c0d5b422cb9 100644
--- a/src/server/scripts/Kalimdor/zone_winterspring.cpp
+++ b/src/server/scripts/Kalimdor/zone_winterspring.cpp
@@ -299,7 +299,7 @@ public:
if (quest->GetQuestId() == QUEST_GUARDIANS_ALTAR)
{
creature->AI()->Talk(SAY_QUEST_START);
- creature->setFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE);
+ creature->SetFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE);
if (npc_ranshallaAI* escortAI = dynamic_cast<npc_ranshallaAI*>(creature->AI()))
escortAI->Start(false, false, player->GetGUID(), quest);
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
index 9112fd9ccd2..37aa313b662 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
@@ -499,7 +499,7 @@ class npc_anubarak_anub_ar_assassin : public CreatureScript
Position jumpTo;
do
jumpTo = GetRandomPositionAround(anubarak);
- while (!CreatureAI::IsInBounds(boundary, &jumpTo));
+ while (!CreatureAI::IsInBounds(*boundary, &jumpTo));
me->GetMotionMaster()->MoveJump(jumpTo, 40.0f, 40.0f);
DoCastSelf(SPELL_ASSASSIN_VISUAL, true);
}
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 e39a01547f1..1440f800260 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
@@ -51,7 +51,8 @@ enum Events
EVENT_CLEAVE,
EVENT_ENERVATING_BRAND,
EVENT_INTRO_TALK,
- EVENT_SUMMONS_ATTACK
+ EVENT_SUMMONS_ATTACK,
+ EVENT_CLONE
};
enum Actions
@@ -73,10 +74,8 @@ class boss_baltharus_the_warborn : public CreatureScript
struct boss_baltharus_the_warbornAI : public BossAI
{
- boss_baltharus_the_warbornAI(Creature* creature) : BossAI(creature, DATA_BALTHARUS_THE_WARBORN), _introDone(false)
- {
- _cloneCount = RAID_MODE<uint8>(1, 2, 2, 2);
- }
+ boss_baltharus_the_warbornAI(Creature* creature) : BossAI(creature, DATA_BALTHARUS_THE_WARBORN),
+ _cloneCount(0), _introDone(false) { }
void Reset() override
{
@@ -85,6 +84,7 @@ class boss_baltharus_the_warborn : public CreatureScript
instance->SetData(DATA_BALTHARUS_SHARED_HEALTH, me->GetMaxHealth());
if (Creature* channelTarget = instance->GetCreature(DATA_CRYSTAL_CHANNEL_TARGET))
DoCast(channelTarget, SPELL_BARRIER_CHANNEL);
+ _cloneCount = 0;
}
void DoAction(int32 action) override
@@ -100,11 +100,10 @@ class boss_baltharus_the_warborn : public CreatureScript
break;
case ACTION_CLONE:
{
- DoCastSelf(SPELL_CLEAR_DEBUFFS);
- DoCastSelf(SPELL_CLONE);
+ DoCastSelf(SPELL_CLEAR_DEBUFFS, true);
+ DoCastSelf(SPELL_CLONE, true);
DoCastSelf(SPELL_REPELLING_WAVE);
Talk(SAY_CLONE);
- --_cloneCount;
break;
}
default:
@@ -149,15 +148,24 @@ class boss_baltharus_the_warborn : public CreatureScript
{
if (GetDifficulty() == DIFFICULTY_10_N)
{
- if (me->HealthBelowPctDamaged(50, damage) && _cloneCount == 1)
- DoAction(ACTION_CLONE);
+ if (me->HealthBelowPctDamaged(50, damage) && _cloneCount == 0)
+ {
+ ++_cloneCount;
+ events.ScheduleEvent(EVENT_CLONE, Milliseconds(1));
+ }
}
else
{
- if (me->HealthBelowPctDamaged(66, damage) && _cloneCount == 2)
- DoAction(ACTION_CLONE);
+ if (me->HealthBelowPctDamaged(66, damage) && _cloneCount == 0)
+ {
+ ++_cloneCount;
+ events.ScheduleEvent(EVENT_CLONE, Milliseconds(1));
+ }
else if (me->HealthBelowPctDamaged(33, damage) && _cloneCount == 1)
- DoAction(ACTION_CLONE);
+ {
+ ++_cloneCount;
+ events.ScheduleEvent(EVENT_CLONE, Milliseconds(1));
+ }
}
if (me->GetHealth() > damage)
@@ -173,19 +181,18 @@ class boss_baltharus_the_warborn : public CreatureScript
void UpdateAI(uint32 diff) override
{
- bool introPhase = events.IsInPhase(PHASE_INTRO);
- if (!introPhase && !UpdateVictim())
+ if (!events.IsInPhase(PHASE_INTRO) && !UpdateVictim())
return;
- if (!introPhase)
+ if (!events.IsInPhase(PHASE_INTRO))
me->SetHealth(instance->GetData(DATA_BALTHARUS_SHARED_HEALTH));
- events.Update(diff);
-
- if (!introPhase && me->HasUnitState(UNIT_STATE_CASTING))
+ if (!events.IsInPhase(PHASE_INTRO) && me->HasUnitState(UNIT_STATE_CASTING))
return;
+ events.Update(diff);
+
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
@@ -210,6 +217,9 @@ class boss_baltharus_the_warborn : public CreatureScript
case EVENT_SUMMONS_ATTACK:
summons.DoZoneInCombat(NPC_BALTHARUS_THE_WARBORN_CLONE);
break;
+ case EVENT_CLONE:
+ DoAction(ACTION_CLONE);
+ break;
default:
break;
}
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 ff34eb5851a..81dcf1846a6 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
@@ -195,7 +195,7 @@ public:
{
damage = 0;
EnterEvadeMode();
- me->setFaction(35);
+ me->SetFaction(35);
bDone = true;
}
}
@@ -323,7 +323,7 @@ public:
{
damage = 0;
EnterEvadeMode();
- me->setFaction(35);
+ me->SetFaction(35);
bDone = true;
}
}
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 4d41e3b4c14..868bb4e07c8 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
@@ -226,7 +226,7 @@ class boss_anubarak_trial : public CreatureScript
for (int i = 0; i < 10; i++)
if (Creature* scarab = me->SummonCreature(NPC_SCARAB, AnubarakLoc[1].GetPositionX()+urand(0, 50)-25, AnubarakLoc[1].GetPositionY()+urand(0, 50)-25, AnubarakLoc[1].GetPositionZ()))
{
- scarab->setFaction(31);
+ scarab->SetFaction(31);
scarab->GetMotionMaster()->MoveRandom(10);
}
}
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 a40b30d6128..871214b8c21 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
@@ -922,7 +922,7 @@ class npc_toc_shaman : public CreatureScript
events.ScheduleEvent(EVENT_SPIRIT_CLEANSE, urand(15*IN_MILLISECONDS, 35*IN_MILLISECONDS));
return;
case EVENT_HEAL_BLOODLUST_HEROISM:
- if (me->getFaction()) // alliance = 1
+ if (me->GetFaction()) // alliance = 1
{
if (!me->HasAura(AURA_EXHAUSTION))
DoCastAOE(SPELL_HEROISM);
@@ -2030,7 +2030,7 @@ class npc_toc_enh_shaman : public CreatureScript
events.ScheduleEvent(EVENT_STORMSTRIKE, urand(8*IN_MILLISECONDS, 10*IN_MILLISECONDS));
return;
case EVENT_DPS_BLOODLUST_HEROISM:
- if (me->getFaction()) //Am i alliance?
+ if (me->GetFaction()) //Am i alliance?
{
if (!me->HasAura(AURA_EXHAUSTION))
DoCastAOE(SPELL_HEROISM);
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 5a4532be849..265db80d353 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
@@ -309,7 +309,7 @@ class boss_devourer_of_souls : public CreatureScript
case EVENT_WAILING_SOULS_TICK:
beamAngle += beamAngleDiff;
- me->SetFacingTo(beamAngle, true);
+ me->SetFacingTo(beamAngle);
me->StopMoving();
DoCast(me, SPELL_WAILING_SOULS);
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 18788ac23f7..6983e745e5e 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
@@ -1342,7 +1342,8 @@ class npc_the_lich_king_escape_hor : public CreatureScript
if (!me->HasReactState(REACT_PASSIVE))
{
if (Unit* victim = me->SelectVictim())
- AttackStart(victim);
+ if (!me->IsFocusing(nullptr, true) && victim != me->GetVictim())
+ AttackStart(victim);
return me->GetVictim() != nullptr;
}
else if (me->getThreatManager().getThreatList().size() < 2 && me->HasAura(SPELL_REMORSELESS_WINTER))
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 50dcb98bcab..3f5bf56faf9 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
@@ -788,7 +788,7 @@ class boss_prince_valanar_icc : public CreatureScript
struct boss_prince_valanarAI : public BloodPrincesBossAI
{
- boss_prince_valanarAI(Creature* creature) : BloodPrincesBossAI(creature, DATA_PRINCE_TALDARAM) { }
+ boss_prince_valanarAI(Creature* creature) : BloodPrincesBossAI(creature, DATA_PRINCE_VALANAR) { }
void ScheduleEvents() override
{
@@ -1129,10 +1129,7 @@ class npc_dark_nucleus : public CreatureScript
if (Unit* victim = me->GetVictim())
{
if (me->GetDistance(victim) < 15.0f && !victim->HasAura(SPELL_SHADOW_RESONANCE_RESIST, me->GetGUID()))
- {
DoCast(victim, SPELL_SHADOW_RESONANCE_RESIST);
- me->ClearUnitState(UNIT_STATE_CASTING);
- }
else
MoveInLineOfSight(me->GetVictim());
}
@@ -1146,7 +1143,6 @@ class npc_dark_nucleus : public CreatureScript
}
DoCast(who, SPELL_SHADOW_RESONANCE_RESIST);
- me->ClearUnitState(UNIT_STATE_CASTING);
}
void DamageTaken(Unit* attacker, uint32& /*damage*/) override
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
index 80ab44fe32a..fbe2655cf84 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
@@ -463,7 +463,7 @@ class boss_deathbringer_saurfang : public CreatureScript
{
case EVENT_INTRO_ALLIANCE_2:
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
- me->setFaction(FACTION_SCOURGE);
+ me->SetFaction(FACTION_SCOURGE);
Talk(SAY_INTRO_ALLIANCE_2);
break;
case EVENT_INTRO_ALLIANCE_3:
@@ -476,7 +476,7 @@ class boss_deathbringer_saurfang : public CreatureScript
break;
case EVENT_INTRO_HORDE_2:
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
- me->setFaction(FACTION_SCOURGE);
+ me->SetFaction(FACTION_SCOURGE);
Talk(SAY_INTRO_HORDE_2);
break;
case EVENT_INTRO_HORDE_4:
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
index 18aaf715bf3..a9ffaeb5871 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
@@ -635,7 +635,8 @@ protected:
if (!me->HasReactState(REACT_PASSIVE))
{
if (Unit* victim = me->SelectVictim())
- AttackStart(victim);
+ if (!me->IsFocusing(nullptr, true) && victim != me->GetVictim())
+ AttackStart(victim);
return me->GetVictim() != nullptr;
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
index 217dc86e342..f4e8d4e10b1 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
@@ -359,7 +359,7 @@ class boss_lady_deathwhisper : public CreatureScript
{
if (darnavan->IsAlive())
{
- darnavan->setFaction(35);
+ darnavan->SetFaction(35);
darnavan->CombatStop(true);
darnavan->GetMotionMaster()->MoveIdle();
darnavan->SetReactState(REACT_PASSIVE);
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
index d34819efbef..116843c2398 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
@@ -278,7 +278,7 @@ class boss_professor_putricide : public CreatureScript
Talk(SAY_AGGRO);
DoCast(me, SPELL_OOZE_TANK_PROTECTION, true);
DoZoneInCombat(me);
-
+ me->SetCombatPulseDelay(5);
instance->SetBossState(DATA_PROFESSOR_PUTRICIDE, IN_PROGRESS);
}
@@ -730,7 +730,7 @@ class npc_putricide_oozeAI : public ScriptedAI
{
public:
npc_putricide_oozeAI(Creature* creature, uint32 auraSpellId, uint32 hitTargetSpellId) : ScriptedAI(creature),
- _auraSpellId(auraSpellId), _hitTargetSpellId(hitTargetSpellId), _newTargetSelectTimer(0) { }
+ _auraSpellId(auraSpellId), _hitTargetSpellId(hitTargetSpellId), _newTargetSelectTimer(0), _instance(creature->GetInstanceScript()) { }
void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override
{
@@ -740,6 +740,10 @@ class npc_putricide_oozeAI : public ScriptedAI
void Reset() override
{
+ if (_instance->GetBossState(DATA_PROFESSOR_PUTRICIDE) != IN_PROGRESS)
+ me->DespawnOrUnsummon();
+
+ me->SetInCombatWithZone();
DoCastAOE(_auraSpellId, true);
}
@@ -780,6 +784,7 @@ class npc_putricide_oozeAI : public ScriptedAI
uint32 _auraSpellId;
uint32 _hitTargetSpellId;
uint32 _newTargetSelectTimer;
+ InstanceScript* _instance;
};
class npc_volatile_ooze : public CreatureScript
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
index 590291c6e30..e1cc3c12f54 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
@@ -735,7 +735,7 @@ class npc_spinestalker : public CreatureScript
me->SetDisableGravity(false);
me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false);
me->SetHomePosition(SpinestalkerLandPos);
- me->SetFacingTo(SpinestalkerLandPos.GetOrientation(), true);
+ me->SetFacingTo(SpinestalkerLandPos.GetOrientation());
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_AGGRESSIVE);
}
@@ -872,7 +872,7 @@ class npc_rimefang : public CreatureScript
me->SetDisableGravity(false);
me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false);
me->SetHomePosition(RimefangLandPos);
- me->SetFacingTo(RimefangLandPos.GetOrientation(), true);
+ me->SetFacingTo(RimefangLandPos.GetOrientation());
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE);
}
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 94bf769b771..7f6b970e42e 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
@@ -725,7 +725,6 @@ 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_STATE_CASTING);
summon->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f);
}
else
@@ -820,7 +819,7 @@ class boss_the_lich_king : public CreatureScript
events.ScheduleEvent(EVENT_INTRO_TALK_1, 9000, 0, PHASE_INTRO);
break;
case POINT_CENTER_1:
- me->SetFacingTo(0.0f, true);
+ me->SetFacingTo(0.0f);
Talk(SAY_LK_REMORSELESS_WINTER);
me->GetMap()->SetZoneMusic(AREA_ICECROWN_CITADEL, MUSIC_SPECIAL);
DoCast(me, SPELL_REMORSELESS_WINTER_1);
@@ -836,7 +835,7 @@ class boss_the_lich_king : public CreatureScript
events.ScheduleEvent(EVENT_SOUL_REAPER, 94000, 0, PHASE_TWO);
break;
case POINT_CENTER_2:
- me->SetFacingTo(0.0f, true);
+ me->SetFacingTo(0.0f);
Talk(SAY_LK_REMORSELESS_WINTER);
me->GetMap()->SetZoneMusic(AREA_ICECROWN_CITADEL, MUSIC_SPECIAL);
DoCast(me, SPELL_REMORSELESS_WINTER_2);
diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
index 997ab3c0180..0aa77ef0eb2 100644
--- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
+++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
@@ -1214,7 +1214,7 @@ public:
me->SetCanFly(false);
}
- me->setFaction(FACTION_FRIENDLY);
+ me->SetFaction(FACTION_FRIENDLY);
me->RemoveAllAuras();
}
}
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp
index 8fa9aabb59e..857ce9c32b4 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp
@@ -61,31 +61,31 @@ class instance_nexus : public InstanceMapScript
// Alliance npcs are spawned by default, if you are alliance, you will fight against horde npcs.
case NPC_ALLIANCE_BERSERKER:
if (ServerAllowsTwoSideGroups())
- creature->setFaction(FACTION_HOSTILE_FOR_ALL);
+ creature->SetFaction(FACTION_HOSTILE_FOR_ALL);
if (_teamInInstance == ALLIANCE)
creature->UpdateEntry(NPC_HORDE_BERSERKER);
break;
case NPC_ALLIANCE_RANGER:
if (ServerAllowsTwoSideGroups())
- creature->setFaction(FACTION_HOSTILE_FOR_ALL);
+ creature->SetFaction(FACTION_HOSTILE_FOR_ALL);
if (_teamInInstance == ALLIANCE)
creature->UpdateEntry(NPC_HORDE_RANGER);
break;
case NPC_ALLIANCE_CLERIC:
if (ServerAllowsTwoSideGroups())
- creature->setFaction(FACTION_HOSTILE_FOR_ALL);
+ creature->SetFaction(FACTION_HOSTILE_FOR_ALL);
if (_teamInInstance == ALLIANCE)
creature->UpdateEntry(NPC_HORDE_CLERIC);
break;
case NPC_ALLIANCE_COMMANDER:
if (ServerAllowsTwoSideGroups())
- creature->setFaction(FACTION_HOSTILE_FOR_ALL);
+ creature->SetFaction(FACTION_HOSTILE_FOR_ALL);
if (_teamInInstance == ALLIANCE)
creature->UpdateEntry(NPC_HORDE_COMMANDER);
break;
case NPC_COMMANDER_STOUTBEARD:
if (ServerAllowsTwoSideGroups())
- creature->setFaction(FACTION_HOSTILE_FOR_ALL);
+ creature->SetFaction(FACTION_HOSTILE_FOR_ALL);
if (_teamInInstance == ALLIANCE)
creature->UpdateEntry(NPC_COMMANDER_KOLURG);
break;
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
index d5859e27f3a..9ac7fc0931b 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
@@ -161,7 +161,7 @@ public:
break;
case EVENT_RESUME_PULSING_SHOCKWAVE:
DoCast(me, SPELL_PULSING_SHOCKWAVE_AURA, true);
- me->ClearUnitState(UNIT_STATE_CASTING); // This flag breaks movement.
+ me->ClearUnitState(UNIT_STATE_CASTING); // Workaround to allow DoMeleeAttackIfReady work
DoCast(me, SPELL_PULSING_SHOCKWAVE, true);
break;
case EVENT_INTRO_DIALOGUE:
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
index 1884efd8916..6ebe372fe25 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
@@ -444,7 +444,7 @@ class boss_algalon_the_observer : public CreatureScript
me->SetDisableGravity(false);
else if (pointId == POINT_ALGALON_OUTRO)
{
- me->SetFacingTo(1.605703f, true);
+ me->SetFacingTo(1.605703f);
events.ScheduleEvent(EVENT_OUTRO_3, 1200);
events.ScheduleEvent(EVENT_OUTRO_4, 2400);
events.ScheduleEvent(EVENT_OUTRO_5, 8500);
@@ -538,7 +538,7 @@ class boss_algalon_the_observer : public CreatureScript
damage = 0;
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
- me->setFaction(35);
+ me->SetFaction(35);
me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
DoCast(me, SPELL_SELF_STUN);
events.Reset();
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 8e734e6d3e7..c301d287a97 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
@@ -607,7 +607,7 @@ class boss_flame_leviathan_seat : public CreatureScript
if (Unit* turretPassenger = me->GetVehicleKit()->GetPassenger(SEAT_TURRET))
if (Creature* turret = turretPassenger->ToCreature())
{
- turret->setFaction(me->GetVehicleBase()->getFaction());
+ turret->SetFaction(me->GetVehicleBase()->GetFaction());
turret->SetUnitFlags(UnitFlags(0)); // unselectable
turret->AI()->AttackStart(who);
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
index 5cfc0d75481..33e346e0c94 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
@@ -226,7 +226,7 @@ class npc_iron_roots : public CreatureScript
SetCombatMovement(false);
me->ApplySpellImmune(0, IMMUNITY_ID, 49560, true); // Death Grip
- me->setFaction(14);
+ me->SetFaction(14);
me->SetReactState(REACT_PASSIVE);
}
@@ -610,7 +610,7 @@ class boss_freya : public CreatureScript
_JustDied();
me->RemoveAllAuras();
me->AttackStop();
- me->setFaction(35);
+ me->SetFaction(35);
me->DeleteThreatList();
me->CombatStop(true);
me->DespawnOrUnsummon(7500);
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
index 4d8a49160bc..a320994dc07 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
@@ -408,7 +408,7 @@ class boss_hodir : public CreatureScript
DoCastAOE(SPELL_KILL_CREDIT, true); /// need to be cast before changing boss faction
/// spell will target enemies only
- me->setFaction(35);
+ me->SetFaction(35);
me->DespawnOrUnsummon(10000);
_JustDied();
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
index 37141085731..cfe2d3879d1 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
@@ -180,7 +180,7 @@ class boss_ignis : public CreatureScript
{
if (summon->GetEntry() == NPC_IRON_CONSTRUCT)
{
- summon->setFaction(16);
+ summon->SetFaction(16);
summon->SetReactState(REACT_AGGRESSIVE);
summon->RemoveUnitFlag(UnitFlags(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_STUNNED | UNIT_FLAG_IMMUNE_TO_PC));
summon->SetControlled(false, UNIT_STATE_ROOT);
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
index 5a6c4aeeef6..ec3c449f0ca 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
@@ -230,8 +230,6 @@ class boss_kologarn : public CreatureScript
summon->CastSpell(summon, SPELL_FOCUSED_EYEBEAM_PERIODIC, true);
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_STATE_CASTING);
// Victim gets 67351
if (!eyebeamTarget.IsEmpty())
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
index fd4d7b02229..940c5b4f52f 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
@@ -637,7 +637,7 @@ class boss_mimiron : public CreatureScript
case EVENT_OUTTRO_1:
me->RemoveAurasDueToSpell(SPELL_SLEEP_VISUAL_1);
DoCast(me, SPELL_SLEEP_VISUAL_2);
- me->setFaction(35);
+ me->SetFaction(35);
events.ScheduleEvent(EVENT_OUTTRO_2, 3000);
break;
case EVENT_OUTTRO_2:
@@ -1304,7 +1304,6 @@ class npc_mimiron_assault_bot : public CreatureScript
{
case EVENT_MAGNETIC_FIELD:
DoCastVictim(SPELL_MAGNETIC_FIELD);
- me->ClearUnitState(UNIT_STATE_CASTING);
events.RescheduleEvent(EVENT_MAGNETIC_FIELD, 30000);
break;
default:
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
index 79214b5b0e1..e36e32fd882 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
@@ -774,7 +774,7 @@ class boss_sara : public CreatureScript
{
me->RemoveAllAuras();
me->SetReactState(REACT_PASSIVE);
- me->setFaction(35);
+ me->SetFaction(35);
_events.Reset();
_events.SetPhase(PHASE_ONE);
}
@@ -817,7 +817,7 @@ class boss_sara : public CreatureScript
case EVENT_TRANSFORM_3:
Talk(SAY_SARA_TRANSFORM_4);
DoCast(me, SPELL_FULL_HEAL);
- me->setFaction(16);
+ me->SetFaction(16);
if (Creature* voice = _instance->GetCreature(DATA_VOICE_OF_YOGG_SARON))
voice->AI()->DoAction(ACTION_PHASE_TWO);
if (Creature* mimiron = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_MIMIRON_YS)))
diff --git a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
index 5a4c90451f4..5b7eabe4f00 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
@@ -78,7 +78,7 @@ class boss_erekem : public CreatureScript
void MovementInform(uint32 type, uint32 pointId) override
{
if (type == EFFECT_MOTION_TYPE && pointId == POINT_INTRO)
- me->SetFacingTo(4.921828f, true);
+ me->SetFacingTo(4.921828f);
}
void JustReachedHome() override
diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp
index 61c5a52c24e..1dcc2de11c2 100644
--- a/src/server/scripts/Northrend/zone_borean_tundra.cpp
+++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp
@@ -668,11 +668,11 @@ public:
switch (player->GetTeam())
{
case ALLIANCE:
- creature->setFaction(FACTION_ESCORTEE_A);
+ creature->SetFaction(FACTION_ESCORTEE_A);
break;
default:
case HORDE:
- creature->setFaction(FACTION_ESCORTEE_H);
+ creature->SetFaction(FACTION_ESCORTEE_H);
break;
}
@@ -710,7 +710,7 @@ public:
owner->GetMotionMaster()->MoveFollow(GetCaster(), 4.0f, 0.0f);
owner->CastSpell(owner, SPELL_SUBDUED, true);
GetCaster()->CastSpell(GetCaster(), SPELL_DRAKE_HATCHLING_SUBDUED, true);
- owner->setFaction(35);
+ owner->SetFaction(35);
owner->AddUnitFlag(UnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC));
owner->DespawnOrUnsummon(3 * MINUTE*IN_MILLISECONDS);
}
@@ -891,7 +891,7 @@ public:
if (talbot)
{
talbot->UpdateEntry(NPC_PRINCE_VALANAR);
- talbot->setFaction(14);
+ talbot->SetFaction(14);
talbot->AddUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
talbot->SetReactState(REACT_PASSIVE);
}
@@ -1629,10 +1629,10 @@ public:
switch (player->GetTeam())
{
case ALLIANCE:
- creature->setFaction(FACTION_ESCORTEE_A);
+ creature->SetFaction(FACTION_ESCORTEE_A);
break;
case HORDE:
- creature->setFaction(FACTION_ESCORTEE_H);
+ creature->SetFaction(FACTION_ESCORTEE_H);
break;
}
creature->SetStandState(UNIT_STAND_STATE_STAND);
@@ -2217,7 +2217,7 @@ public:
void AttackPlayer()
{
- me->setFaction(14);
+ me->SetFaction(14);
if (Player* player = ObjectAccessor::GetPlayer(*me, uiPlayerGUID))
AttackStart(player);
}
diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp
index 74d5af9f484..05cb11fc414 100644
--- a/src/server/scripts/Northrend/zone_dragonblight.cpp
+++ b/src/server/scripts/Northrend/zone_dragonblight.cpp
@@ -174,7 +174,7 @@ class npc_commander_eligor_dawnbringer : public CreatureScript
{
if (id == 1)
{
- me->SetFacingTo(PosTalkLocations[talkWing].GetOrientation(), true);
+ me->SetFacingTo(PosTalkLocations[talkWing].GetOrientation());
TurnAudience();
switch (talkWing)
@@ -414,7 +414,7 @@ public:
else if (roll == 0) // enemy version
{
tree->AI()->Talk(SAY_WALKER_ENEMY, player);
- tree->setFaction(FACTION_WALKER_ENEMY);
+ tree->SetFaction(FACTION_WALKER_ENEMY);
tree->Attack(player, true);
}
}
diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
index 5519d70d21c..a9495310e89 100644
--- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp
+++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
@@ -103,7 +103,7 @@ public:
Talk(SAY_WORGRAGGRO3);
if (Creature* RWORG = me->SummonCreature(NPC_RAVENOUS_WORG, me->GetPositionX()+10, me->GetPositionY()+8, me->GetPositionZ()+2, 3.229f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000))
{
- RWORG->setFaction(35);
+ RWORG->SetFaction(35);
_RavenousworgGUID = RWORG->GetGUID();
}
break;
@@ -136,7 +136,7 @@ public:
{
RWORG->Kill(Mrfloppy);
Mrfloppy->ExitVehicle();
- RWORG->setFaction(14);
+ RWORG->SetFaction(14);
RWORG->GetMotionMaster()->MovePoint(0, RWORG->GetPositionX()+10, RWORG->GetPositionY()+80, RWORG->GetPositionZ());
Talk(SAY_VICTORY2);
}
diff --git a/src/server/scripts/Northrend/zone_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp
index ed389a87d4a..9f49df63596 100644
--- a/src/server/scripts/Northrend/zone_howling_fjord.cpp
+++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp
@@ -164,7 +164,7 @@ public:
break;
case EVENT_START_ESCORT:
events.Reset();
- me->setFaction(FACTION_ESCORTEE_H);
+ me->SetFaction(FACTION_ESCORTEE_H);
me->SetReactState(REACT_AGGRESSIVE);
ENSURE_AI(npc_escortAI, (me->AI()))->Start(true, true, _player);
break;
diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp
index 181d24d7761..8adbd37d884 100644
--- a/src/server/scripts/Northrend/zone_icecrown.cpp
+++ b/src/server/scripts/Northrend/zone_icecrown.cpp
@@ -47,7 +47,7 @@ public:
{
Initialize();
creature->GetMotionMaster()->MovePoint(0, 8599.258f, 963.951f, 547.553f);
- creature->setFaction(35); //wrong faction in db?
+ creature->SetFaction(35); //wrong faction in db?
}
void Initialize()
@@ -69,7 +69,7 @@ public:
if (uiType != POINT_MOTION_TYPE)
return;
- me->setFaction(14);
+ me->SetFaction(14);
}
void DamageTaken(Unit* pDoneBy, uint32& uiDamage) override
@@ -78,7 +78,7 @@ public:
{
uiDamage = 0;
pDoneBy->CastSpell(pDoneBy, SPELL_KILL_CREDIT, true);
- me->setFaction(35);
+ me->SetFaction(35);
me->DespawnOrUnsummon(5000);
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
EnterEvadeMode();
diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp
index c6489dcb6c8..1c226c23528 100644
--- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp
+++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp
@@ -326,7 +326,7 @@ public:
if (npc_engineer_heliceAI* pEscortAI = CAST_AI(npc_engineer_helice::npc_engineer_heliceAI, creature->AI()))
{
creature->GetMotionMaster()->MoveJumpTo(0, 0.4f, 0.4f);
- creature->setFaction(113);
+ creature->SetFaction(113);
pEscortAI->Start(false, false, player->GetGUID());
creature->AI()->Talk(SAY_WP_1);
diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp
index 700b64c0417..6b3cc445c9d 100644
--- a/src/server/scripts/Northrend/zone_storm_peaks.cpp
+++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp
@@ -93,7 +93,7 @@ public:
if (menuId == GOSSIP_ID && gossipListId == GOSSIP_OPTION_ID)
{
CloseGossipMenuFor(player);
- me->setFaction(113);
+ me->SetFaction(113);
Start(true, true, player->GetGUID());
}
}
diff --git a/src/server/scripts/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp
index 1ead42b9a39..7233bf3db61 100644
--- a/src/server/scripts/Northrend/zone_wintergrasp.cpp
+++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp
@@ -345,8 +345,8 @@ class go_wg_vehicle_teleporter : public GameObjectScript
bool IsFriendly(Unit* passenger)
{
- return ((go->GetFaction() == WintergraspFaction[TEAM_HORDE] && passenger->getFaction() == HORDE) ||
- (go->GetFaction() == WintergraspFaction[TEAM_ALLIANCE] && passenger->getFaction() == ALLIANCE));
+ return ((go->GetFaction() == WintergraspFaction[TEAM_HORDE] && passenger->GetFaction() == HORDE) ||
+ (go->GetFaction() == WintergraspFaction[TEAM_ALLIANCE] && passenger->GetFaction() == ALLIANCE));
}
Creature* GetValidVehicle(Creature* cVeh)
diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp
index 0e42a431d93..e9e94189bf7 100644
--- a/src/server/scripts/Northrend/zone_zuldrak.cpp
+++ b/src/server/scripts/Northrend/zone_zuldrak.cpp
@@ -70,8 +70,8 @@ public:
void LockRageclaw(Creature* rageclaw)
{
// pointer check not needed
- me->SetInFront(rageclaw);
- rageclaw->SetInFront(me);
+ me->SetFacingToObject(rageclaw);
+ rageclaw->SetFacingToObject(me);
DoCast(rageclaw, SPELL_LEFT_CHAIN, true);
DoCast(rageclaw, SPELL_RIGHT_CHAIN, true);
@@ -138,7 +138,7 @@ public:
void Reset() override
{
- me->setFaction(35);
+ me->SetFaction(35);
DoCast(me, SPELL_KNEEL, true); // Little Hack for kneel - Thanks Illy :P
}
@@ -151,7 +151,7 @@ public:
me->RemoveAurasDueToSpell(SPELL_LEFT_CHAIN);
me->RemoveAurasDueToSpell(SPELL_RIGHT_CHAIN);
me->RemoveAurasDueToSpell(SPELL_KNEEL);
- me->setFaction(me->GetCreatureTemplate()->faction);
+ me->SetFaction(me->GetCreatureTemplate()->faction);
DoCast(me, SPELL_UNSHACKLED, true);
Talk(SAY_RAGECLAW);
me->GetMotionMaster()->MoveRandom(10);
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 8b2e7d01220..e02d3f206d5 100644
--- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp
+++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp
@@ -228,7 +228,7 @@ public:
//SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell.
summoned->CastSpell(summoned, SPELL_STOLEN_SOUL_VISUAL, false);
summoned->SetDisplayId(soulmodel);
- summoned->setFaction(me->getFaction());
+ summoned->SetFaction(me->GetFaction());
if (Unit* target = ObjectAccessor::GetUnit(*me, soulholder))
{
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 d0ba63b17f9..c07ddb0cb23 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
@@ -96,7 +96,7 @@ public:
if (summoned && summoned->GetEntry() == NPC_FOCUS_FIRE)
{
summoned->CastSpell(summoned, SPELL_FOCUS_FIRE_VISUAL, false);
- summoned->setFaction(me->getFaction());
+ summoned->SetFaction(me->GetFaction());
summoned->SetLevel(me->getLevel());
summoned->AddUnitState(UNIT_STATE_ROOT);
diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
index b41199670a9..c92e304152c 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
@@ -524,6 +524,7 @@ public:
events.ScheduleEvent(EVENT_SHADOW_BLAST, Seconds(1), group);
events.ScheduleEvent(EVENT_FLAME_BURST, Seconds(6), group);
events.ScheduleEvent(EVENT_SHADOW_DEMON, Seconds(18), Seconds(30), group);
+ break;
case GROUP_PHASE_4:
ScheduleEvents(GROUP_PHASE_3, group);
events.ScheduleEvent(EVENT_FRENZY, Seconds(40), group);
@@ -864,7 +865,7 @@ public:
events.ScheduleEvent(EVENT_FLY_TO_RANDOM_PILLAR, Seconds(2), GROUP_PHASE_ALL);
break;
case EVENT_CHANGE_ORIENTATION:
- me->SetFacingTo(_orientation, true);
+ me->SetFacingTo(_orientation);
break;
case EVENT_FLY:
ChangeOrientation(3.137039f);
@@ -881,7 +882,7 @@ public:
case EVENT_FACE_MIDDLE:
{
float angle = me->GetAngle(IllidanMiddlePoint);
- me->SetFacingTo(angle, true);
+ me->SetFacingTo(angle);
break;
}
case EVENT_EYE_BLAST:
@@ -1298,7 +1299,7 @@ public:
me->SetEmoteState(EMOTE_STATE_READY1H);
break;
case EVENT_CHANGE_ORIENTATION:
- me->SetFacingTo(_orientation, true);
+ me->SetFacingTo(_orientation);
break;
case EVENT_HEALING_POTION:
if (me->HealthBelowPct(20))
@@ -2305,7 +2306,6 @@ class spell_illidan_find_target : public SpellScriptLoader
if (Creature* caster = GetCaster()->ToCreature())
{
caster->CastSpell(target, SPELL_PARALYZE, true);
- caster->ClearUnitState(UNIT_STATE_CASTING);
caster->AI()->SetGUID(target->GetGUID(), 0);
}
}
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 4a868084e41..dc5d479bf58 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
@@ -384,7 +384,7 @@ public:
void Reset() override
{
Initialize();
- me->setFaction(ASHTONGUE_FACTION_FRIEND);
+ me->SetFaction(ASHTONGUE_FACTION_FRIEND);
DoCastSelf(SPELL_STEALTH);
if (_instance->GetBossState(DATA_SHADE_OF_AKAMA) != DONE)
@@ -430,7 +430,7 @@ public:
{
_isInCombat = false;
me->CombatStop(true);
- me->setFaction(ASHTONGUE_FACTION_FRIEND);
+ me->SetFaction(ASHTONGUE_FACTION_FRIEND);
me->SetWalk(true);
_events.Reset();
me->GetMotionMaster()->MovePoint(AKAMA_INTRO_WAYPOINT, AkamaWP[1]);
@@ -484,7 +484,7 @@ public:
case EVENT_SHADE_CHANNEL:
me->SetFacingTo(FACE_THE_PLATFORM);
DoCastSelf(SPELL_AKAMA_SOUL_CHANNEL);
- me->setFaction(AKAMA_FACTION_COMBAT);
+ me->SetFaction(AKAMA_FACTION_COMBAT);
_events.ScheduleEvent(EVENT_FIXATE, Seconds(5));
break;
case EVENT_FIXATE:
@@ -499,7 +499,7 @@ public:
_events.Repeat(Seconds(3), Seconds(7));
break;
case EVENT_START_SOUL_RETRIEVE:
- me->SetFacingTo(FACE_THE_DOOR, true);
+ me->SetFacingTo(FACE_THE_DOOR);
DoCast(SPELL_AKAMA_SOUL_RETRIEVE);
_events.ScheduleEvent(EVENT_START_BROKEN_FREE, Seconds(15));
break;
@@ -532,7 +532,7 @@ public:
}
}
- if (me->getFaction() == AKAMA_FACTION_COMBAT)
+ if (me->GetFaction() == AKAMA_FACTION_COMBAT)
{
if (!UpdateVictim())
return;
@@ -1170,7 +1170,7 @@ public:
Talk(SAY_BROKEN_SPECIAL);
break;
case ACTION_BROKEN_HAIL:
- me->setFaction(ASHTONGUE_FACTION_FRIEND);
+ me->SetFaction(ASHTONGUE_FACTION_FRIEND);
Talk(SAY_BROKEN_HAIL);
break;
case ACTION_BROKEN_EMOTE:
diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
index 8684879ac42..66600ccb4d0 100644
--- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
+++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
@@ -128,7 +128,7 @@ class instance_black_temple : public InstanceMapScript
case NPC_STORM_FURY:
AshtongueGUIDs.emplace_back(creature->GetGUID());
if (GetBossState(DATA_SHADE_OF_AKAMA) == DONE)
- creature->setFaction(ASHTONGUE_FACTION_FRIEND);
+ creature->SetFaction(ASHTONGUE_FACTION_FRIEND);
break;
default:
break;
@@ -175,7 +175,7 @@ class instance_black_temple : public InstanceMapScript
if (state == DONE)
for (ObjectGuid ashtongueGuid : AshtongueGUIDs)
if (Creature* ashtongue = instance->GetCreature(ashtongueGuid))
- ashtongue->setFaction(ASHTONGUE_FACTION_FRIEND);
+ ashtongue->SetFaction(ASHTONGUE_FACTION_FRIEND);
// no break
case DATA_TERON_GOREFIEND:
case DATA_GURTOGG_BLOODBOIL:
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 0187d263a5e..a8485ecbdf3 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
@@ -668,7 +668,7 @@ public:
{
Cyclone->SetObjectScale(3.0f);
Cyclone->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
- Cyclone->setFaction(me->getFaction());
+ Cyclone->SetFaction(me->GetFaction());
Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
Cyclone->AI()->AttackStart(target);
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 520ee2c9e9b..a454599bbf7 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
@@ -753,7 +753,7 @@ public:
void Reset() override
{
me->SetDisableGravity(true);
- me->setFaction(14);
+ me->SetFaction(14);
Initialize();
}
@@ -788,7 +788,7 @@ public:
{
if (Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000))
{
- trig->setFaction(14);
+ trig->SetFaction(14);
trig->CastSpell(trig, SPELL_TOXIC_SPORES, true);
}
}
@@ -804,7 +804,7 @@ public:
if (!Vashj || !Vashj->IsAlive() || ENSURE_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->ToCreature()->AI())->Phase != 3)
{
// remove
- me->setFaction(35);
+ me->SetFaction(35);
me->DespawnOrUnsummon();
return;
}
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 265787589e4..eca80aec5e6 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp
@@ -321,7 +321,7 @@ public:
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
- me->setFaction(14);
+ me->SetFaction(14);
}
void EnterCombat(Unit* /*who*/) override { }
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 009c5b261df..858705111b0 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
@@ -104,7 +104,7 @@ class boss_nazan : public CreatureScript
if (summoned && summoned->GetEntry() == NPC_LIQUID_FIRE)
{
summoned->SetLevel(me->getLevel());
- summoned->setFaction(me->getFaction());
+ summoned->SetFaction(me->GetFaction());
summoned->CastSpell(summoned, DUNGEON_MODE(SPELL_SUMMON_LIQUID_FIRE, SPELL_SUMMON_LIQUID_FIRE_H), true);
summoned->CastSpell(summoned, SPELL_FIRE_NOVA_VISUAL, true);
}
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
index a128e0349fb..765a7d5a7de 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
@@ -207,7 +207,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript
void JustSummoned(Creature* summoned) override
{
- summoned->setFaction(16);
+ summoned->SetFaction(16);
summoned->AddUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
summoned->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
index d30cb2e08f0..6fba85f3580 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
@@ -410,7 +410,7 @@ class boss_alar : public CreatureScript
Summoned->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
Summoned->SetObjectScale(Summoned->GetObjectScale() * 2.5f);
Summoned->SetDisplayId(11686);
- Summoned->setFaction(me->getFaction());
+ Summoned->SetFaction(me->GetFaction());
Summoned->SetLevel(me->getLevel());
Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false);
}
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
index 9ba6a1cefc9..ee44f0c0f46 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
@@ -597,7 +597,7 @@ class boss_kaelthas : public CreatureScript
events.ScheduleEvent(EVENT_TRANSITION_1, 1000);
break;
case POINT_TRANSITION_CENTER_ASCENDING:
- me->SetFacingTo(float(M_PI), true);
+ me->SetFacingTo(float(M_PI));
Talk(SAY_PHASE5_NUTS);
me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetDisableGravity(true);
@@ -1278,7 +1278,7 @@ class npc_kael_flamestrike : public CreatureScript
Initialize();
me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
- me->setFaction(14);
+ me->SetFaction(14);
}
void MoveInLineOfSight(Unit* /*who*/) override { }
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
index fc45410e932..70b1da72d93 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
@@ -539,7 +539,7 @@ class npc_zerekethvoidzone : public CreatureScript
void Reset() override
{
me->SetNpcFlags(UNIT_NPC_FLAG_NONE);
- me->setFaction(16);
+ me->SetFaction(16);
me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
DoCast(me, SPELL_VOID_ZONE_DAMAGE);
diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
index b69d42244b0..7e3afcbc225 100644
--- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
+++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
@@ -76,7 +76,7 @@ public:
Initialize();
me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
- me->setFaction(FACTION_FRIENDLY);
+ me->SetFaction(FACTION_FRIENDLY);
Talk(SAY_SUMMON);
}
@@ -87,7 +87,7 @@ public:
{
if (faction_Timer <= diff)
{
- me->setFaction(FACTION_HOSTILE);
+ me->SetFaction(FACTION_HOSTILE);
faction_Timer = 0;
} else faction_Timer -= diff;
}
@@ -97,7 +97,7 @@ public:
if (HealthBelowPct(30))
{
- me->setFaction(FACTION_FRIENDLY);
+ me->SetFaction(FACTION_FRIENDLY);
me->AddNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
me->RemoveAllAuras();
me->DeleteThreatList();
@@ -281,7 +281,7 @@ public:
{
if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH)
{
- me->setFaction(FACTION_FALCON_WATCH_QUEST);
+ me->SetFaction(FACTION_FALCON_WATCH_QUEST);
npc_escortAI::Start(true, false, player->GetGUID());
}
}
@@ -957,7 +957,7 @@ public:
void StartFight(Player* player)
{
me->Dismount();
- me->SetFacingToObject(player, true);
+ me->SetFacingToObject(player);
me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
_playerGUID = player->GetGUID();
_events.ScheduleEvent(EVENT_TALK, Seconds(2));
@@ -1004,7 +1004,7 @@ public:
break;
case EVENT_ATTACK:
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
- me->setFaction(FACTION_HOSTILE);
+ me->SetFaction(FACTION_HOSTILE);
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
me->CombatStart(player);
_events.ScheduleEvent(EVENT_FIREBALL, 1);
diff --git a/src/server/scripts/Outland/zone_nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp
index ae5e1a60708..2f662558c93 100644
--- a/src/server/scripts/Outland/zone_nagrand.cpp
+++ b/src/server/scripts/Outland/zone_nagrand.cpp
@@ -79,7 +79,7 @@ public:
if (npc_maghar_captiveAI* EscortAI = dynamic_cast<npc_maghar_captiveAI*>(creature->AI()))
{
creature->SetStandState(UNIT_STAND_STATE_STAND);
- creature->setFaction(232);
+ creature->SetFaction(232);
EscortAI->Start(true, false, player->GetGUID(), quest);
creature->AI()->Talk(SAY_MAG_START);
@@ -433,7 +433,7 @@ public:
if (npc_kurenai_captiveAI* EscortAI = dynamic_cast<npc_kurenai_captiveAI*>(creature->AI()))
{
creature->SetStandState(UNIT_STAND_STATE_STAND);
- creature->setFaction(231);
+ creature->SetFaction(231);
EscortAI->Start(true, false, player->GetGUID(), quest);
creature->AI()->Talk(SAY_KUR_START);
diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp
index f11a2f2df65..cc10c1d619c 100644
--- a/src/server/scripts/Outland/zone_netherstorm.cpp
+++ b/src/server/scripts/Outland/zone_netherstorm.cpp
@@ -498,7 +498,7 @@ public:
{
if (quest->GetQuestId() == Q_ALMABTRIEB)
{
- creature->setFaction(113);
+ creature->SetFaction(113);
creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
ENSURE_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
}
@@ -664,7 +664,7 @@ public:
{
if (npc_maxx_a_million_escortAI* pEscortAI = CAST_AI(npc_maxx_a_million_escort::npc_maxx_a_million_escortAI, creature->AI()))
{
- creature->setFaction(113);
+ creature->SetFaction(113);
pEscortAI->Start(false, false, player->GetGUID());
}
}
diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
index a8bd85023a2..af98238d5b5 100644
--- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
+++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
@@ -379,7 +379,7 @@ public:
void Reset() override
{
if (!Tapped)
- me->setFaction(FACTION_DEFAULT);
+ me->SetFaction(FACTION_DEFAULT);
FlyTimer = 10000;
me->SetDisableGravity(false);
@@ -395,7 +395,7 @@ public:
Tapped = true;
PlayerGUID = caster->GetGUID();
- me->setFaction(FACTION_FRIENDLY);
+ me->SetFaction(FACTION_FRIENDLY);
DoCast(caster, SPELL_FORCE_OF_NELTHARAKU, true);
Unit* Dragonmaw = me->FindNearestCreature(NPC_DRAGONMAW_SUBJUGATOR, 50);
@@ -602,7 +602,7 @@ public:
if (quest->GetQuestId() == QUEST_ESCAPE_COILSCAR)
{
creature->AI()->Talk(SAY_WIL_START, player);
- creature->setFaction(FACTION_EARTHEN);
+ creature->SetFaction(FACTION_EARTHEN);
if (npc_earthmender_wildaAI* pEscortAI = CAST_AI(npc_earthmender_wilda::npc_earthmender_wildaAI, creature->AI()))
pEscortAI->Start(false, false, player->GetGUID(), quest);
@@ -1479,7 +1479,7 @@ public:
totemOspirits = me->FindNearestCreature(ENTRY_TOTEM_OF_SPIRITS, RADIUS_TOTEM_OF_SPIRITS);
if (totemOspirits)
{
- Summoned->setFaction(FACTION_ENRAGED_SOUL_FRIENDLY);
+ Summoned->SetFaction(FACTION_ENRAGED_SOUL_FRIENDLY);
Summoned->GetMotionMaster()->MovePoint(0, totemOspirits->GetPositionX(), totemOspirits->GetPositionY(), Summoned->GetPositionZ());
if (Unit* owner = totemOspirits->GetOwner())
diff --git a/src/server/scripts/Outland/zone_shattrath_city.cpp b/src/server/scripts/Outland/zone_shattrath_city.cpp
index 948a47fca33..c76e803c168 100644
--- a/src/server/scripts/Outland/zone_shattrath_city.cpp
+++ b/src/server/scripts/Outland/zone_shattrath_city.cpp
@@ -62,7 +62,7 @@ public:
if (action == GOSSIP_ACTION_INFO_DEF+1)
{
CloseGossipMenuFor(player);
- creature->setFaction(FACTION_OGRE_HOSTILE);
+ creature->SetFaction(FACTION_OGRE_HOSTILE);
creature->AI()->Talk(SAY_RALIQ_ATTACK, player);
creature->AI()->AttackStart(player);
}
@@ -152,7 +152,7 @@ public:
if (action == GOSSIP_ACTION_INFO_DEF+1)
{
CloseGossipMenuFor(player);
- creature->setFaction(FACTION_DEMON_HOSTILE);
+ creature->SetFaction(FACTION_DEMON_HOSTILE);
creature->AI()->Talk(SAY_DEMONIC_AGGRO, player);
creature->AI()->AttackStart(player);
}
diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp
index 2e604b4291f..d5521265fe4 100644
--- a/src/server/scripts/Outland/zone_terokkar_forest.cpp
+++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp
@@ -86,7 +86,7 @@ public:
{
Initialize();
me->SetStandState(UNIT_STAND_STATE_STAND);
- me->setFaction(FACTION_HOSTILE);
+ me->SetFaction(FACTION_HOSTILE);
}
void EnterCombat(Unit* /*who*/) override { }
@@ -94,7 +94,7 @@ public:
void DoNice()
{
Talk(SAY_SUBMIT);
- me->setFaction(FACTION_FRIENDLY);
+ me->SetFaction(FACTION_FRIENDLY);
me->SetStandState(UNIT_STAND_STATE_SIT);
me->RemoveAllAuras();
me->DeleteThreatList();
@@ -338,7 +338,7 @@ public:
if (action == GOSSIP_ACTION_INFO_DEF+1)
{
CloseGossipMenuFor(player);
- creature->setFaction(FACTION_HOSTILE_FLOON);
+ creature->SetFaction(FACTION_HOSTILE_FLOON);
creature->AI()->Talk(SAY_FLOON_ATTACK, player);
creature->AI()->AttackStart(player);
}
@@ -364,7 +364,7 @@ public:
npc_floonAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
- m_uiNormFaction = creature->getFaction();
+ m_uiNormFaction = creature->GetFaction();
}
void Initialize()
@@ -382,8 +382,8 @@ public:
void Reset() override
{
Initialize();
- if (me->getFaction() != m_uiNormFaction)
- me->setFaction(m_uiNormFaction);
+ if (me->GetFaction() != m_uiNormFaction)
+ me->SetFaction(m_uiNormFaction);
}
void EnterCombat(Unit* /*who*/) override { }
@@ -469,7 +469,7 @@ public:
player->GroupEventHappens(ESCAPE_FROM_FIREWING_POINT_A, me);
else if (player->GetTeam() == HORDE)
player->GroupEventHappens(ESCAPE_FROM_FIREWING_POINT_H, me);
- me->SetInFront(player);
+ me->SetFacingToObject(player);
break;
case 30:
me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
@@ -503,7 +503,7 @@ public:
if (quest->GetQuestId() == ESCAPE_FROM_FIREWING_POINT_H || quest->GetQuestId() == ESCAPE_FROM_FIREWING_POINT_A)
{
ENSURE_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
- creature->setFaction(FACTION_ESCORTEE);
+ creature->SetFaction(FACTION_ESCORTEE);
}
return true;
}
@@ -643,9 +643,9 @@ public:
pEscortAI->Start(false, false, player->GetGUID());
if (player->GetTeamId() == TEAM_ALLIANCE)
- creature->setFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE);
+ creature->SetFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE);
else
- creature->setFaction(FACTION_ESCORT_H_NEUTRAL_PASSIVE);
+ creature->SetFaction(FACTION_ESCORT_H_NEUTRAL_PASSIVE);
}
return true;
}
diff --git a/src/server/scripts/Outland/zone_zangarmarsh.cpp b/src/server/scripts/Outland/zone_zangarmarsh.cpp
index a31d8e4fe33..d73acd789f9 100644
--- a/src/server/scripts/Outland/zone_zangarmarsh.cpp
+++ b/src/server/scripts/Outland/zone_zangarmarsh.cpp
@@ -168,7 +168,7 @@ public:
{
npc_cooshcooshAI(Creature* creature) : ScriptedAI(creature)
{
- m_uiNormFaction = creature->getFaction();
+ m_uiNormFaction = creature->GetFaction();
Initialize();
}
@@ -183,8 +183,8 @@ public:
void Reset() override
{
Initialize();
- if (me->getFaction() != m_uiNormFaction)
- me->setFaction(m_uiNormFaction);
+ if (me->GetFaction() != m_uiNormFaction)
+ me->SetFaction(m_uiNormFaction);
}
void EnterCombat(Unit* /*who*/) override { }
@@ -224,7 +224,7 @@ public:
if (action == GOSSIP_ACTION_INFO_DEF)
{
CloseGossipMenuFor(player);
- creature->setFaction(FACTION_HOSTILE_CO);
+ creature->SetFaction(FACTION_HOSTILE_CO);
creature->AI()->AttackStart(player);
}
return true;
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index eb800765b7c..85fb71cccec 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -3704,7 +3704,7 @@ class spell_gen_gm_freeze : public SpellScriptLoader
if (Player* player = GetTarget()->ToPlayer())
{
// stop combat + make player unattackable + duel stop + stop some spells
- player->setFaction(35);
+ player->SetFaction(35);
player->CombatStop();
if (player->IsNonMeleeSpellCast(true))
player->InterruptNonMeleeSpells(true);
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp
index c0e1fdaae33..8e63c84fe2a 100644
--- a/src/server/scripts/World/go_scripts.cpp
+++ b/src/server/scripts/World/go_scripts.cpp
@@ -256,7 +256,7 @@ public:
if (Spell)
creature->CastSpell(player, Spell, false);
else
- TC_LOG_ERROR("scripts", "go_ethereum_prison summoned Creature (entry %u) but faction (%u) are not expected by script.", creature->GetEntry(), creature->getFaction());
+ TC_LOG_ERROR("scripts", "go_ethereum_prison summoned Creature (entry %u) but faction (%u) are not expected by script.", creature->GetEntry(), creature->GetFaction());
}
}
}
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 671a03918ca..7c367705d36 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -285,7 +285,7 @@ public:
void Reset() override
{
Initialize();
- me->setFaction(FACTION_CHICKEN);
+ me->SetFaction(FACTION_CHICKEN);
me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
}
@@ -317,7 +317,7 @@ public:
if (player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE && rand32() % 30 == 1)
{
me->AddNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
- me->setFaction(FACTION_FRIENDLY);
+ me->SetFaction(FACTION_FRIENDLY);
Talk(player->GetTeam() == HORDE ? EMOTE_HELLO_H : EMOTE_HELLO_A);
}
break;
@@ -325,7 +325,7 @@ public:
if (player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE)
{
me->AddNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
- me->setFaction(FACTION_FRIENDLY);
+ me->SetFaction(FACTION_FRIENDLY);
Talk(EMOTE_CLUCK_TEXT);
}
break;
@@ -420,7 +420,7 @@ public:
{
if (me->IsWithinLOS(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()) && me->IsWithinDistInMap(player, 30.0f))
{
- me->SetInFront(player);
+ me->SetFacingToObject(player);
Active = false;
switch (emote)