From 35ef27123aea5aa5b199d33ce76c62a06af4d109 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Tue, 19 Dec 2017 02:55:39 +0100 Subject: [PATCH 01/37] DB/Player: allow Rogues to carry axes By Ovahlord --- sql/updates/world/4.3.4/2017_12_19_00_world.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/4.3.4/2017_12_19_00_world.sql diff --git a/sql/updates/world/4.3.4/2017_12_19_00_world.sql b/sql/updates/world/4.3.4/2017_12_19_00_world.sql new file mode 100644 index 00000000000..0788aa230a2 --- /dev/null +++ b/sql/updates/world/4.3.4/2017_12_19_00_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `playercreateinfo_skills` SET `classMask`= `classMask`| 8 WHERE `skill`= 44; From ceaa17603ec454cc1661f841fe7f73f5caa9af34 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Tue, 19 Dec 2017 22:09:43 +0100 Subject: [PATCH 02/37] DB/Player: Fix 2 player spells --- sql/updates/world/4.3.4/2017_12_19_01_world.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/4.3.4/2017_12_19_01_world.sql diff --git a/sql/updates/world/4.3.4/2017_12_19_01_world.sql b/sql/updates/world/4.3.4/2017_12_19_01_world.sql new file mode 100644 index 00000000000..1f995823f77 --- /dev/null +++ b/sql/updates/world/4.3.4/2017_12_19_01_world.sql @@ -0,0 +1,5 @@ +-- +DELETE FROM `spell_learn_spell` WHERE `entry`= 87840; +INSERT INTO `spell_learn_spell` (`entry`, `SpellID`, `Active`) VALUES +(87840, 33388, 1); +UPDATE `spell_bonus_data` SET `direct_bonus`= 0.654 WHERE `entry`= 133; From 2dea9429446613fad68b00059aceb4e384d86e98 Mon Sep 17 00:00:00 2001 From: Treeston Date: Fri, 21 Jul 2017 17:56:55 +0200 Subject: [PATCH 03/37] Core/Unit: For convenience, explicitly redirect CastSpell with nullptr as first argument to the Unit* overloads. No more ->CastSpell((Unit*)nullptr, ...) all over the place! (cherry picked from commits c7896f31026d6bdee189226680705dd7965b2039 and 40c78cac4c430a97386b44b994ec85fbaeda8821) --- src/server/game/Entities/Unit/Unit.h | 2 ++ .../EasternKingdoms/SunwellPlateau/boss_muru.cpp | 10 +++++----- .../FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp | 2 +- .../scripts/Northrend/Gundrak/instance_gundrak.cpp | 2 +- .../UtgardeKeep/UtgardePinnacle/boss_skadi.cpp | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 5ea863a88db..a94d451befc 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1598,7 +1598,9 @@ class TC_GAME_API Unit : public WorldObject void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); + void CastSpell(std::nullptr_t, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty) { CastSpell((Unit*)nullptr, spellId, triggered, castItem, triggeredByAura, originalCaster); } void CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); + void CastSpell(std::nullptr_t, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty) { CastSpell((Unit*)nullptr, spellId, triggerFlags, castItem, triggeredByAura, originalCaster); } void CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); void CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index ebe7fb2d8ab..6a9b4b122c7 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -122,7 +122,7 @@ class VoidSpawnSummon : public BasicEvent bool Execute(uint64 /*time*/, uint32 /*diff*/) { - _owner->CastSpell((Unit*)nullptr, SPELL_SUMMON_VOID_SENTINEL, true); + _owner->CastSpell(nullptr, SPELL_SUMMON_VOID_SENTINEL, true); return true; } @@ -590,7 +590,7 @@ class spell_summon_blood_elves_script : SpellScriptLoader void HandleScript(SpellEffIndex /*effIndex*/) { for (uint8 i = 0; i < MAX_SUMMON_BLOOD_ELVES; ++i) - GetCaster()->CastSpell((Unit*)nullptr, SummonBloodElvesSpells[urand(0,3)], true); + GetCaster()->CastSpell(nullptr, SummonBloodElvesSpells[urand(0,3)], true); } void Register() override @@ -625,7 +625,7 @@ class spell_muru_darkness : SpellScriptLoader void HandleAfterCast() { for (uint8 i = 0; i < MAX_SUMMON_DARK_FIEND; ++i) - GetCaster()->CastSpell((Unit*)nullptr, SummonDarkFiendSpells[i], true); + GetCaster()->CastSpell(nullptr, SummonDarkFiendSpells[i], true); } void Register() override @@ -687,7 +687,7 @@ class spell_transform_visual_missile_periodic : public SpellScriptLoader void OnPeriodic(AuraEffect const* /*aurEff*/) { - GetTarget()->CastSpell((Unit*)nullptr, RAND(TRANSFORM_VISUAL_MISSILE_1, TRANSFORM_VISUAL_MISSILE_2), true); + GetTarget()->CastSpell(nullptr, RAND(TRANSFORM_VISUAL_MISSILE_1, TRANSFORM_VISUAL_MISSILE_2), true); } void Register() override @@ -713,7 +713,7 @@ class spell_summon_blood_elves_periodic : public SpellScriptLoader void OnPeriodic(AuraEffect const* /*aurEff*/) { - GetTarget()->CastSpell((Unit*)nullptr, SPELL_SUMMON_BLOOD_ELVES_SCRIPT, true); + GetTarget()->CastSpell(nullptr, SPELL_SUMMON_BLOOD_ELVES_SCRIPT, true); } void Register() override diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp index a71214b7974..d3c57b45f76 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp @@ -242,7 +242,7 @@ class npc_corrupted_soul_fragment : public CreatureScript if (instance->GetGuidData(DATA_BRONJAHM).GetCounter() != id) return; - me->CastSpell((Unit*)nullptr, SPELL_CONSUME_SOUL, true); + me->CastSpell(nullptr, SPELL_CONSUME_SOUL, true); me->DespawnOrUnsummon(); } diff --git a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp index 244d5aa9181..c462827310f 100644 --- a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp +++ b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp @@ -319,7 +319,7 @@ class instance_gundrak : public InstanceMapScript if (GameObject* altar = GetGameObject(altarId)) if (Creature* trigger = altar->FindNearestCreature(NPC_ALTAR_TRIGGER, 10.0f)) - trigger->CastSpell((Unit*)nullptr, spellId, true); + trigger->CastSpell(nullptr, spellId, true); // eventId equals statueId ToggleGameObject(eventId, GO_STATE_READY); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index 1e2da34120e..9ed7f76d9ac 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -857,7 +857,7 @@ class spell_summon_gauntlet_mobs_periodic : public SpellScriptLoader for (uint8 i = 0; i < 2; ++i) { uint32 spellId = SummonSpellsList.front(); - GetTarget()->CastSpell((Unit*)nullptr, spellId, true); + GetTarget()->CastSpell(nullptr, spellId, true); SummonSpellsList.push_back(spellId); SummonSpellsList.pop_front(); } From f477e71971902d468a18c01319801067c3100f1e Mon Sep 17 00:00:00 2001 From: Aokromes Date: Tue, 26 Dec 2017 01:47:31 +0100 Subject: [PATCH 04/37] build fix --- .../IcecrownCitadel/boss_icecrown_gunship_battle.cpp | 4 ++-- src/server/scripts/Northrend/zone_borean_tundra.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 f2fcf44fd8c..16a3189ed32 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -1845,8 +1845,8 @@ class spell_igb_rocket_pack : public SpellScriptLoader void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { SpellInfo const* damageInfo = sSpellMgr->AssertSpellInfo(SPELL_ROCKET_PACK_DAMAGE); - GetTarget()->CastCustomSpell(SPELL_ROCKET_PACK_DAMAGE, SPELLVALUE_BASE_POINT0, 2 * (damageInfo->Effects[EFFECT_0].CalcValue() + aurEff->GetTickNumber() * aurEff->GetAmplitude()), NULL, TRIGGERED_FULL_MASK); - GetTarget()->CastSpell(NULL, SPELL_ROCKET_BURST, TRIGGERED_FULL_MASK); + GetTarget()->CastCustomSpell(SPELL_ROCKET_PACK_DAMAGE, SPELLVALUE_BASE_POINT0, 2 * (damageInfo->Effects[EFFECT_0].CalcValue() + aurEff->GetTickNumber() * aurEff->GetAmplitude()), nullptr, TRIGGERED_FULL_MASK); + GetTarget()->CastSpell(nullptr, SPELL_ROCKET_BURST, TRIGGERED_FULL_MASK); } void Register() override diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index 003f660a8a7..a98a76ea356 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -2369,7 +2369,7 @@ public: { if (GetTarget()->isDead()) if (Unit* caster = GetCaster()) - caster->CastSpell(NULL, SPELL_WINDSOUL_CREDT); + caster->CastSpell(nullptr, SPELL_WINDSOUL_CREDT); } void Register() override From 2f16844bd3f35ed24821e5cc2efac578144f268c Mon Sep 17 00:00:00 2001 From: Killyana Date: Tue, 19 Dec 2017 15:10:33 +0100 Subject: [PATCH 05/37] DB/GameObject: The Shadow Labyrinth door Lever Closes #21086 --- sql/updates/world/3.3.5/2017_12_19_00_world.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_19_00_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_19_00_world.sql b/sql/updates/world/3.3.5/2017_12_19_00_world.sql new file mode 100644 index 00000000000..021d1e25d83 --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_19_00_world.sql @@ -0,0 +1,2 @@ +-- The Shadow Labyrinth door Lever +UPDATE `gameobject_template_addon` SET `flags`=0 WHERE `entry` IN (183518); From 9877c63aa028674fe5fe801e8ff2f515af26ab5f Mon Sep 17 00:00:00 2001 From: Aokromes Date: Tue, 19 Dec 2017 19:14:11 +0100 Subject: [PATCH 06/37] DB/Spawn: Add heroic mode spawns of a lot of gameobjects Part by offl Closes #21082 --- sql/updates/world/3.3.5/2017_12_19_01_world.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_19_01_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_19_01_world.sql b/sql/updates/world/3.3.5/2017_12_19_01_world.sql new file mode 100644 index 00000000000..79a25debf9f --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_19_01_world.sql @@ -0,0 +1,5 @@ +-- +UPDATE `creature` SET `spawnMask`=3 WHERE `id` IN (18956,19511); +UPDATE `smart_scripts` SET `event_flags`=7 WHERE `entryorguid` IN (18956) AND `source_type`=0; +UPDATE `smart_scripts` SET `event_flags`=7 WHERE `entryorguid` IN (1895600) AND `source_type`=9; +UPDATE `gameobject` SET `spawnMask` = 3 WHERE `spawnMask` = 1 AND `id` IN (181278,181556,181557,181569,183051,182940,186633,185434,181275,184931,181276,181270,184956,184940,183296,183516,182942,182943,183036,183295,184941,183441) AND `map` NOT IN (530,548,568,571); From c4d135fc03b7fe7e7dc7210292df1776912ce06a Mon Sep 17 00:00:00 2001 From: ariel- Date: Tue, 19 Dec 2017 19:59:36 -0300 Subject: [PATCH 07/37] Core/Globals: validate creature_template mingold and maxgold fields --- src/server/game/Events/GameEventMgr.cpp | 2 +- src/server/game/Globals/ObjectMgr.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index b0711c9caf3..9fe5f21671b 100644 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -1719,7 +1719,7 @@ void GameEventMgr::SetHolidayEventTime(GameEventData& event) if (!event.holidayStage) // Ignore holiday return; - const HolidaysEntry* holiday = sHolidaysStore.LookupEntry(event.holiday_id); + HolidaysEntry const* holiday = sHolidaysStore.LookupEntry(event.holiday_id); if (!holiday->Date[0] || !holiday->Duration[0]) // Invalid definitions { diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 5a5192107b4..92b63ec46d4 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -847,6 +847,13 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) ok = true; } + if (cInfo->mingold > cInfo->maxgold) + { + TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has `mingold` %u which is greater than `maxgold` %u, setting `maxgold` to %u.", + cInfo->Entry, cInfo->mingold, cInfo->maxgold, cInfo->mingold); + const_cast(cInfo)->maxgold = cInfo->mingold; + } + if (cInfo->AIName == "TotemAI") { TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has not-allowed `AIName` '%s' set, removing", cInfo->Entry, cInfo->AIName.c_str()); From 2d566e35ba866ce8fa4fcadc6b6761051f3b1150 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Wed, 20 Dec 2017 10:31:51 +0100 Subject: [PATCH 08/37] DB/Creature: Correct money for Lady Deathwhisper --- sql/updates/world/3.3.5/2017_12_20_01_world.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_20_01_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_20_01_world.sql b/sql/updates/world/3.3.5/2017_12_20_01_world.sql new file mode 100644 index 00000000000..301a3af1afe --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_20_01_world.sql @@ -0,0 +1,5 @@ +-- +UPDATE `creature_template` SET `maxgold` = 1093073 WHERE `entry` = 36855; +UPDATE `creature_template` SET `mingold` = 1674308, `maxgold` = 2186146 WHERE `entry` = 38106; +UPDATE `creature_template` SET `mingold` = 1925454, `maxgold` = 2514068 WHERE `entry` = 38296; +UPDATE `creature_template` SET `mingold` = 2092885, `maxgold` = 2732683 WHERE `entry` = 38297; From bc48366f000a4c8db799469972e16898af9fcd30 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Wed, 20 Dec 2017 10:42:06 +0100 Subject: [PATCH 09/37] DB/Creature: Fix loot for various icc trashmobs --- sql/updates/world/3.3.5/2017_12_20_02_world.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_20_02_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_20_02_world.sql b/sql/updates/world/3.3.5/2017_12_20_02_world.sql new file mode 100644 index 00000000000..2bcbe4c26ac --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_20_02_world.sql @@ -0,0 +1,13 @@ +-- +UPDATE `creature_template` SET `maxgold` = 22960 WHERE `entry` = 36829; +UPDATE `creature_template` SET `mingold` = 36640, `maxgold` = 45920 WHERE `entry` = 38074; +UPDATE `creature_template` SET `maxgold` = 7536 WHERE `entry` = 37028; +UPDATE `creature_template` SET `mingold` = 9214, `maxgold` = 15072 WHERE `entry` = 38094; +UPDATE `creature_template` SET `maxgold` = 07510 WHERE `entry` = 37031; +UPDATE `creature_template` SET `mingold` = 10912, `maxgold` = 15020 WHERE `entry` = 38090; +UPDATE `creature_template` SET `maxgold` = 07665 WHERE `entry` = 37029; +UPDATE `creature_template` SET `mingold` = 9494, `maxgold` = 15330 WHERE `entry` = 38092; +UPDATE `creature_template` SET `maxgold` = 7599 WHERE `entry` = 37662; +UPDATE `creature_template` SET `mingold` = 6720, `maxgold` = 15198 WHERE `entry` = 38102; +UPDATE `creature_template` SET `maxgold` = 7617 WHERE `entry` = 36805; +UPDATE `creature_template` SET `mingold` = 5346, `maxgold` = 15234 WHERE `entry` = 38075; From 020beb096a257674411096e7a5481909688780ed Mon Sep 17 00:00:00 2001 From: Aokromes Date: Wed, 20 Dec 2017 10:43:40 +0100 Subject: [PATCH 10/37] They must be 3.3.5a only --- .../{2017_12_20_01_world.sql => 2017_12_20_01_world_335.sql} | 0 .../{2017_12_20_02_world.sql => 2017_12_20_02_world_335.sql} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename sql/updates/world/3.3.5/{2017_12_20_01_world.sql => 2017_12_20_01_world_335.sql} (100%) rename sql/updates/world/3.3.5/{2017_12_20_02_world.sql => 2017_12_20_02_world_335.sql} (100%) diff --git a/sql/updates/world/3.3.5/2017_12_20_01_world.sql b/sql/updates/world/3.3.5/2017_12_20_01_world_335.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_12_20_01_world.sql rename to sql/updates/world/3.3.5/2017_12_20_01_world_335.sql diff --git a/sql/updates/world/3.3.5/2017_12_20_02_world.sql b/sql/updates/world/3.3.5/2017_12_20_02_world_335.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_12_20_02_world.sql rename to sql/updates/world/3.3.5/2017_12_20_02_world_335.sql From 45930bc2b5d41f7959f1e6315c6e1c6d0672f74a Mon Sep 17 00:00:00 2001 From: Aokromes Date: Wed, 20 Dec 2017 17:40:19 +0100 Subject: [PATCH 11/37] DB/Creature: Add gold to few creatures --- .../world/3.3.5/2017_12_20_03_world_335.sql | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_20_03_world_335.sql diff --git a/sql/updates/world/3.3.5/2017_12_20_03_world_335.sql b/sql/updates/world/3.3.5/2017_12_20_03_world_335.sql new file mode 100644 index 00000000000..ffd1d87a4e7 --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_20_03_world_335.sql @@ -0,0 +1,26 @@ +-- +UPDATE `creature_template` SET `mingold` = 15123, `maxgold` = 19760 WHERE `entry` = 37328; +UPDATE `creature_template` SET `mingold` = 15123, `maxgold` = 19760 WHERE `entry` = 37408; +UPDATE `creature_template` SET `mingold` = 13913, `maxgold` = 18179 WHERE `entry` = 32009; +UPDATE `creature_template` SET `mingold` = 13913, `maxgold` = 18179 WHERE `entry` = 32087; +UPDATE `creature_template` SET `mingold` = 17046, `maxgold` = 17046 WHERE `entry` = 29356; +UPDATE `creature_template` SET `mingold` = 9262, `maxgold` = 17664 WHERE `entry` = 29574; +UPDATE `creature_template` SET `mingold` = 3988, `maxgold` = 23564 WHERE `entry` = 38110; +UPDATE `creature_template` SET `mingold` = 1278, `maxgold` = 25596 WHERE `entry` = 30818; +UPDATE `creature_template` SET `mingold` = 1278, `maxgold` = 25592 WHERE `entry` = 30817; +UPDATE `creature_template` SET `mingold` = 1282, `maxgold` = 25644 WHERE `entry` = 30816; +UPDATE `creature_template` SET `mingold` = 43710, `maxgold` = 47060 WHERE `entry` = 31001; +UPDATE `creature_template` SET `mingold` = 45162, `maxgold` = 49068 WHERE `entry` = 31000; +UPDATE `creature_template` SET `mingold` = 5460, `maxgold` = 5460 WHERE `entry` = 32368; +UPDATE `creature_template` SET `mingold` = 6968, `maxgold` = 15324 WHERE `entry` = 34016; +UPDATE `creature_template` SET `mingold` = 4132, `maxgold` = 25116 WHERE `entry` = 38076; +UPDATE `creature_template` SET `mingold` = 141844, `maxgold` = 141844 WHERE `entry` = 38031; +UPDATE `creature_template` SET `mingold` = 4890, `maxgold` = 24368 WHERE `entry` = 38061; +UPDATE `creature_template` SET `mingold` = 9090, `maxgold` = 18374 WHERE `entry` = 38059; +UPDATE `creature_template` SET `mingold` = 542268, `maxgold` = 542268 WHERE `entry` = 38444; +UPDATE `creature_template` SET `mingold` = 6532, `maxgold` = 23044 WHERE `entry` = 38108; +UPDATE `creature_template` SET `mingold` = 4804, `maxgold` = 24334 WHERE `entry` = 38062; +UPDATE `creature_template` SET `mingold` = 4380, `maxgold` = 26180 WHERE `entry` = 38063; +UPDATE `creature_template` SET `mingold` = 570506, `maxgold` = 570506 WHERE `entry` = 38103; +UPDATE `creature_template` SET `mingold` = 13390, `maxgold` = 24210 WHERE `entry` = 38197; +UPDATE `creature_template` SET `mingold` = 650000, `maxgold` = 700000 WHERE `entry` = 35349; From 5a97814b6a59477b35428f8afa0126d0b1d814de Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Wed, 20 Dec 2017 21:04:34 +0200 Subject: [PATCH 12/37] Core/Pools: fix pool memory usage (#21075) Change vector to unordered map to save memory and startup time --- src/server/game/Pools/PoolMgr.cpp | 142 ++++++++++++++++++------------ src/server/game/Pools/PoolMgr.h | 11 ++- 2 files changed, 89 insertions(+), 64 deletions(-) diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index c5ad8e283cb..4f28e34a734 100644 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -556,23 +556,10 @@ void PoolGroup::ReSpawn1Object(PoolObject* /*obj*/) { } //////////////////////////////////////////////////////////// // Methods of class PoolMgr -PoolMgr::PoolMgr() : max_pool_id(0) { } +PoolMgr::PoolMgr() { } void PoolMgr::Initialize() { - QueryResult result = WorldDatabase.Query("SELECT MAX(entry) FROM pool_template"); - if (result) - { - Field* fields = result->Fetch(); - max_pool_id = fields[0].GetUInt32(); - } - - mPoolTemplate.resize(max_pool_id + 1); - mPoolCreatureGroups.resize(max_pool_id + 1); - mPoolGameobjectGroups.resize(max_pool_id + 1); - mPoolPoolGroups.resize(max_pool_id + 1); - mPoolQuestGroups.resize(max_pool_id + 1); - mQuestSearchMap.clear(); mGameobjectSearchMap.clear(); mCreatureSearchMap.clear(); @@ -645,9 +632,10 @@ void PoolMgr::LoadFromDB() TC_LOG_ERROR("sql.sql", "`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id); continue; } - if (pool_id > max_pool_id) + auto it = mPoolTemplate.find(pool_id); + if (it == mPoolTemplate.end()) { - TC_LOG_ERROR("sql.sql", "`pool_creature` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id); + TC_LOG_ERROR("sql.sql", "`pool_creature` pool id (%u) is not in `pool_template`, skipped.", pool_id); continue; } if (chance < 0 || chance > 100) @@ -711,9 +699,10 @@ void PoolMgr::LoadFromDB() continue; } - if (pool_id > max_pool_id) + auto it = mPoolTemplate.find(pool_id); + if (it == mPoolTemplate.end()) { - TC_LOG_ERROR("sql.sql", "`pool_gameobject` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id); + TC_LOG_ERROR("sql.sql", "`pool_gameobject` pool id (%u) is not in `pool_template`, skipped.", pool_id); continue; } @@ -763,15 +752,21 @@ void PoolMgr::LoadFromDB() uint32 mother_pool_id = fields[1].GetUInt32(); float chance = fields[2].GetFloat(); - if (mother_pool_id > max_pool_id) { - TC_LOG_ERROR("sql.sql", "`pool_pool` mother_pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", mother_pool_id); - continue; + auto it = mPoolTemplate.find(mother_pool_id); + if (it == mPoolTemplate.end()) + { + TC_LOG_ERROR("sql.sql", "`pool_pool` mother_pool id (%u) is not in `pool_template`, skipped.", mother_pool_id); + continue; + } } - if (child_pool_id > max_pool_id) { - TC_LOG_ERROR("sql.sql", "`pool_pool` included pool_id (%u) is out of range compared to max pool id in `pool_template`, skipped.", child_pool_id); - continue; + auto it = mPoolTemplate.find(child_pool_id); + if (it == mPoolTemplate.end()) + { + TC_LOG_ERROR("sql.sql", "`pool_pool` included pool_id (%u) is not in `pool_template`, skipped.", child_pool_id); + continue; + } } if (mother_pool_id == child_pool_id) { @@ -796,10 +791,11 @@ void PoolMgr::LoadFromDB() while (result->NextRow()); // Now check for circular reference - for (uint32 i=0; i < max_pool_id; ++i) + // All pool_ids are in pool_template + for (auto const it : mPoolTemplate) { std::set checkedPools; - for (SearchMap::iterator poolItr = mPoolSearchMap.find(i); poolItr != mPoolSearchMap.end(); poolItr = mPoolSearchMap.find(poolItr->second)) + for (SearchMap::iterator poolItr = mPoolSearchMap.find(it.first); poolItr != mPoolSearchMap.end(); poolItr = mPoolSearchMap.find(poolItr->second)) { checkedPools.insert(poolItr->first); if (checkedPools.find(poolItr->second) != checkedPools.end()) @@ -862,9 +858,10 @@ void PoolMgr::LoadFromDB() continue; } - if (pool_id > max_pool_id) + auto it = mPoolTemplate.find(pool_id); + if (it == mPoolTemplate.end()) { - TC_LOG_ERROR("sql.sql", "`pool_quest` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id); + TC_LOG_ERROR("sql.sql", "`pool_quest` pool id (%u) is not in `pool_template`, skipped.", pool_id); continue; } @@ -969,10 +966,10 @@ void PoolMgr::SaveQuestsToDB() for (PoolGroupQuestMap::iterator itr = mPoolQuestGroups.begin(); itr != mPoolQuestGroups.end(); ++itr) { - if (itr->isEmpty()) + if (itr->second.isEmpty()) continue; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_POOL_SAVE); - stmt->setUInt32(0, itr->GetPoolId()); + stmt->setUInt32(0, itr->second.GetPoolId()); trans->Append(stmt); } @@ -994,12 +991,12 @@ void PoolMgr::ChangeDailyQuests() { for (PoolGroupQuestMap::iterator itr = mPoolQuestGroups.begin(); itr != mPoolQuestGroups.end(); ++itr) { - if (Quest const* quest = sObjectMgr->GetQuestTemplate(itr->GetFirstEqualChancedObjectId())) + if (Quest const* quest = sObjectMgr->GetQuestTemplate(itr->second.GetFirstEqualChancedObjectId())) { if (quest->IsWeekly()) continue; - UpdatePool(itr->GetPoolId(), 1); // anything non-zero means don't load from db + UpdatePool(itr->second.GetPoolId(), 1); // anything non-zero means don't load from db } } @@ -1010,12 +1007,12 @@ void PoolMgr::ChangeWeeklyQuests() { for (PoolGroupQuestMap::iterator itr = mPoolQuestGroups.begin(); itr != mPoolQuestGroups.end(); ++itr) { - if (Quest const* quest = sObjectMgr->GetQuestTemplate(itr->GetFirstEqualChancedObjectId())) + if (Quest const* quest = sObjectMgr->GetQuestTemplate(itr->second.GetFirstEqualChancedObjectId())) { if (quest->IsDaily()) continue; - UpdatePool(itr->GetPoolId(), 1); + UpdatePool(itr->second.GetPoolId(), 1); } } @@ -1027,8 +1024,9 @@ void PoolMgr::ChangeWeeklyQuests() template<> void PoolMgr::SpawnPool(uint32 pool_id, uint32 db_guid) { - if (!mPoolCreatureGroups[pool_id].isEmpty()) - mPoolCreatureGroups[pool_id].SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, db_guid); + auto it = mPoolCreatureGroups.find(pool_id); + if (it != mPoolCreatureGroups.end() && !it->second.isEmpty()) + it->second.SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, db_guid); } // Call to spawn a pool, if cache if true the method will spawn only if cached entry is different @@ -1036,8 +1034,9 @@ void PoolMgr::SpawnPool(uint32 pool_id, uint32 db_guid) template<> void PoolMgr::SpawnPool(uint32 pool_id, uint32 db_guid) { - if (!mPoolGameobjectGroups[pool_id].isEmpty()) - mPoolGameobjectGroups[pool_id].SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, db_guid); + auto it = mPoolGameobjectGroups.find(pool_id); + if (it != mPoolGameobjectGroups.end() && !it->second.isEmpty()) + it->second.SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, db_guid); } // Call to spawn a pool, if cache if true the method will spawn only if cached entry is different @@ -1045,16 +1044,18 @@ void PoolMgr::SpawnPool(uint32 pool_id, uint32 db_guid) template<> void PoolMgr::SpawnPool(uint32 pool_id, uint32 sub_pool_id) { - if (!mPoolPoolGroups[pool_id].isEmpty()) - mPoolPoolGroups[pool_id].SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, sub_pool_id); + auto it = mPoolPoolGroups.find(pool_id); + if (it != mPoolPoolGroups.end() && !it->second.isEmpty()) + it->second.SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, sub_pool_id); } // Call to spawn a pool template<> void PoolMgr::SpawnPool(uint32 pool_id, uint32 quest_id) { - if (!mPoolQuestGroups[pool_id].isEmpty()) - mPoolQuestGroups[pool_id].SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, quest_id); + auto it = mPoolQuestGroups.find(pool_id); + if (it != mPoolQuestGroups.end() && !it->second.isEmpty()) + it->second.SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, quest_id); } void PoolMgr::SpawnPool(uint32 pool_id) @@ -1068,27 +1069,52 @@ void PoolMgr::SpawnPool(uint32 pool_id) // Call to despawn a pool, all gameobjects/creatures in this pool are removed void PoolMgr::DespawnPool(uint32 pool_id) { - if (!mPoolCreatureGroups[pool_id].isEmpty()) - mPoolCreatureGroups[pool_id].DespawnObject(mSpawnedData); - - if (!mPoolGameobjectGroups[pool_id].isEmpty()) - mPoolGameobjectGroups[pool_id].DespawnObject(mSpawnedData); - - if (!mPoolPoolGroups[pool_id].isEmpty()) - mPoolPoolGroups[pool_id].DespawnObject(mSpawnedData); - - if (!mPoolQuestGroups[pool_id].isEmpty()) - mPoolQuestGroups[pool_id].DespawnObject(mSpawnedData); + { + auto it = mPoolCreatureGroups.find(pool_id); + if (it != mPoolCreatureGroups.end() && !it->second.isEmpty()) + it->second.DespawnObject(mSpawnedData); + } + { + auto it = mPoolGameobjectGroups.find(pool_id); + if (it != mPoolGameobjectGroups.end() && !it->second.isEmpty()) + it->second.DespawnObject(mSpawnedData); + } + { + auto it = mPoolPoolGroups.find(pool_id); + if (it != mPoolPoolGroups.end() && !it->second.isEmpty()) + it->second.DespawnObject(mSpawnedData); + } + { + auto it = mPoolQuestGroups.find(pool_id); + if (it != mPoolQuestGroups.end() && !it->second.isEmpty()) + it->second.DespawnObject(mSpawnedData); + } } // Method that check chance integrity of the creatures and gameobjects in this pool bool PoolMgr::CheckPool(uint32 pool_id) const { - return pool_id <= max_pool_id && - mPoolGameobjectGroups[pool_id].CheckPool() && - mPoolCreatureGroups[pool_id].CheckPool() && - mPoolPoolGroups[pool_id].CheckPool() && - mPoolQuestGroups[pool_id].CheckPool(); + { + auto it = mPoolGameobjectGroups.find(pool_id); + if (it != mPoolGameobjectGroups.end() && !it->second.CheckPool()) + return false; + } + { + auto it = mPoolCreatureGroups.find(pool_id); + if (it != mPoolCreatureGroups.end() && !it->second.CheckPool()) + return false; + } + { + auto it = mPoolPoolGroups.find(pool_id); + if (it != mPoolPoolGroups.end() && !it->second.CheckPool()) + return false; + } + { + auto it = mPoolQuestGroups.find(pool_id); + if (it != mPoolQuestGroups.end() && !it->second.CheckPool()) + return false; + } + return true; } // Call to update the pool when a gameobject/creature part of pool [pool_id] is ready to respawn diff --git a/src/server/game/Pools/PoolMgr.h b/src/server/game/Pools/PoolMgr.h index 077fcd7dfa0..4382a285d4e 100644 --- a/src/server/game/Pools/PoolMgr.h +++ b/src/server/game/Pools/PoolMgr.h @@ -139,12 +139,11 @@ class TC_GAME_API PoolMgr template void SpawnPool(uint32 pool_id, uint32 db_guid_or_pool_id); - uint32 max_pool_id; - typedef std::vector PoolTemplateDataMap; - typedef std::vector > PoolGroupCreatureMap; - typedef std::vector > PoolGroupGameObjectMap; - typedef std::vector > PoolGroupPoolMap; - typedef std::vector > PoolGroupQuestMap; + typedef std::unordered_map PoolTemplateDataMap; + typedef std::unordered_map> PoolGroupCreatureMap; + typedef std::unordered_map> PoolGroupGameObjectMap; + typedef std::unordered_map> PoolGroupPoolMap; + typedef std::unordered_map> PoolGroupQuestMap; typedef std::pair SearchPair; typedef std::map SearchMap; From e76e2baf4688a033eecf0fcf580950d08e72697a Mon Sep 17 00:00:00 2001 From: Killyana Date: Wed, 20 Dec 2017 22:01:55 +0100 Subject: [PATCH 13/37] DB: Fix Some DB errors related to pooling --- sql/updates/world/3.3.5/2017_12_20_04_world.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_20_04_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_20_04_world.sql b/sql/updates/world/3.3.5/2017_12_20_04_world.sql new file mode 100644 index 00000000000..fa60855d586 --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_20_04_world.sql @@ -0,0 +1,11 @@ +-- +DELETE FROM `gameobject` WHERE `id`=64922 AND `guid`=189980; +DELETE FROM `gameobject_addon` WHERE `guid`=189980; +DELETE FROM `pool_gameobject` WHERE `pool_entry`=5217 ; +DELETE FROM `pool_creature` WHERE `guid`=134515 AND `pool_entry`=1047; +DELETE FROM `pool_template` WHERE `entry` IN (5217,5450,5506,5517,5608); +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(5450,1,"Icecrown node 3"), +(5506,1,"Icecrown node 59"), +(5517,1,"Icecrown node 70"), +(5608,1,"Icecrown node 161"); From bd17c710b6d12ebddcb5dc1be6c93edcc9f04aaa Mon Sep 17 00:00:00 2001 From: Serpaa Date: Wed, 20 Dec 2017 22:15:32 +0100 Subject: [PATCH 14/37] DB/Creature: Add script to Draenei Artificer Closes #21093 --- .../world/3.3.5/2017_12_20_05_world.sql | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_20_05_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_20_05_world.sql b/sql/updates/world/3.3.5/2017_12_20_05_world.sql new file mode 100644 index 00000000000..96c3a51b727 --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_20_05_world.sql @@ -0,0 +1,41 @@ +-- +-- Add script and waypoints to Draenei Artificer +SET @ENTRY := 17228; +SET @GUID := -82823; +SET @ACTIONLIST_0 := 8282300; +SET @ACTIONLIST_1 := 8282301; + +-- Remove emote from Draenei Artificer +DELETE FROM `creature_addon` WHERE `guid`=82823; +INSERT INTO `creature_addon` (`guid`, `emote`, `bytes2`) VALUES +(82823, 0, 4097); + +-- Add weapon to Draenei Artificer +DELETE FROM `creature_equip_template` WHERE `CreatureID`=@ENTRY AND `ID`=2; +INSERT INTO `creature_equip_template` (`CreatureID`, `ID`, `ItemID1`, `ItemID2`, `ItemID3`, `VerifiedBuild`) VALUES (@ENTRY, 2, 2530, 0, 0, 18019); + +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(@ENTRY, 1, -4189.97, -12460.97, 45.227, 'Draenei Artificer'), +(@ENTRY, 2, -4191.24, -12456.74, 45.444, 'Draenei Artificer'), +(@ENTRY, 3, -4192.75, -12453.75, 45.635, 'Draenei Artificer'), +(@ENTRY, 4, -4191.24, -12456.74, 45.444, 'Draenei Artificer'), +(@ENTRY, 5, -4189.97, -12460.97, 45.227, 'Draenei Artificer'), +(@ENTRY, 6, -4191.44, -12464.07, 45.340, 'Draenei Artificer'); + +-- Add SAI to Draenei Artificer + Actionlist 00/01 +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@GUID, @ACTIONLIST_0, @ACTIONLIST_1) AND `source_type` IN (0, 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 +(@GUID,0,0,0,40,0,100,0,3,@ENTRY,0,0,80,@ACTIONLIST_0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Draenei Artificer - On Waypoint 3 Reached - Run Script"), +(@GUID,0,1,0,40,0,100,0,6,@ENTRY,0,0,80,@ACTIONLIST_1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Draenei Artificer - On Waypoint 6 Reached - Run Script"), +(@GUID,0,2,0,1,0,100,0,0,0,130000,130000,53,0,@ENTRY,1,0,0,2,1,0,0,0,0,0,0,0,"Draenei Artificer - Out of Combat - Start Waypoint"), +(@ACTIONLIST_0,9,0,0,0,0,100,0,0,0,0,0,54,60000,0,0,0,0,0,0,0,0,0,0,0,0,0,"Draenei Artificer - On Script - Pause Waypoint"), +(@ACTIONLIST_0,9,1,0,0,0,100,0,1000,1000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,0.8356,"Draenei Artificer - On Script - Set Orientation 0,8356"), +(@ACTIONLIST_0,9,2,0,0,0,100,0,1500,1500,0,0,71,2,1,0,0,0,0,1,0,0,0,0,0,0,0,"Draenei Artificer - On Script - Change Equipment"), +(@ACTIONLIST_0,9,3,0,0,0,100,0,2000,2000,0,0,17,234,0,0,0,0,0,1,0,0,0,0,0,0,0,"Draenei Artificer - On Script - Set Emote State 234"), +(@ACTIONLIST_0,9,4,0,0,0,100,0,55000,55000,0,0,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Draenei Artificer - On Script - Set Emote State 0"), +(@ACTIONLIST_1,9,0,0,0,0,100,0,0,0,0,0,54,60000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Draenei Artificer - On Script - Pause Waypoint"), +(@ACTIONLIST_1,9,1,0,0,0,100,0,1000,1000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,3.8398,"Draenei Artificer - On Script - Set Orientation 3,8398"), +(@ACTIONLIST_1,9,3,0,0,0,100,0,1500,1500,0,0,71,1,1,0,0,0,0,1,0,0,0,0,0,0,0,"Draenei Artificer - On Script - Change Equipment"), +(@ACTIONLIST_1,9,4,0,0,0,100,0,2000,2000,0,0,17,234,0,0,0,0,0,1,0,0,0,0,0,0,0,"Draenei Artificer - On Script - Set Emote State 234"), +(@ACTIONLIST_1,9,5,0,0,0,100,0,55000,55000,0,0,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Draenei Artificer - On Script - Set Emote State 0"); From 72b14ea028d4b5f3090e653809f58d660decf542 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 21 Dec 2017 02:25:04 -0300 Subject: [PATCH 15/37] Core/Spell: implement SPELL_FAILED_AURA_BOUNCED on DR spells --- .../game/Entities/Creature/Creature.cpp | 6 -- src/server/game/Entities/Creature/Creature.h | 4 +- src/server/game/Entities/Unit/Unit.cpp | 61 ++++++++++--------- src/server/game/Entities/Unit/Unit.h | 5 +- src/server/game/Spells/Spell.cpp | 52 +++++++++++----- 5 files changed, 75 insertions(+), 53 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 52d77a57c06..ff68dda6179 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2610,12 +2610,6 @@ void Creature::SetPosition(float x, float y, float z, float o) GetVehicleKit()->RelocatePassengers(); } -bool Creature::IsDungeonBoss() const -{ - CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(GetEntry()); - return cinfo && (cinfo->flags_extra & CREATURE_FLAG_EXTRA_DUNGEON_BOSS); -} - float Creature::GetAggroRange(Unit const* target) const { // Determines the aggro range for creatures (usually pets), used mainly for aggressive pet target selection. diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 03df8a160e3..9b05f110b97 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -487,6 +487,8 @@ class TC_GAME_API Creature : public Unit, public GridObject, public Ma bool CanWalk() const { return (GetCreatureTemplate()->InhabitType & INHABIT_GROUND) != 0; } bool CanSwim() const { return (GetCreatureTemplate()->InhabitType & INHABIT_WATER) != 0 || IsPet(); } bool CanFly() const override { return (GetCreatureTemplate()->InhabitType & INHABIT_AIR) != 0; } + bool IsDungeonBoss() const { return (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_DUNGEON_BOSS) != 0; } + bool IsAffectedByDiminishingReturns() const override { return Unit::IsAffectedByDiminishingReturns() || (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH) != 0; } void SetReactState(ReactStates st) { m_reactState = st; } ReactStates GetReactState() const { return m_reactState; } @@ -503,8 +505,6 @@ class TC_GAME_API Creature : public Unit, public GridObject, public Ma bool isElite() const; bool isWorldBoss() const; - bool IsDungeonBoss() const; - uint8 getLevelForTarget(WorldObject const* target) const override; // overwrite Unit::getLevelForTarget for boss level support bool IsInEvadeMode() const { return HasUnitState(UNIT_STATE_EVADE); } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3163b8c037f..68bbadd9142 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4458,17 +4458,6 @@ bool Unit::HasNegativeAuraWithInterruptFlag(uint32 flag, ObjectGuid guid) const return false; } -bool Unit::HasNegativeAuraWithAttribute(uint32 flag, ObjectGuid guid) const -{ - for (AuraApplicationMap::const_iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end(); ++iter) - { - Aura const* aura = iter->second->GetBase(); - if (!iter->second->IsPositive() && aura->GetSpellInfo()->Attributes & flag && (!guid || aura->GetCasterGUID() == guid)) - return true; - } - return false; -} - bool Unit::HasAuraWithMechanic(uint32 mechanicMask) const { for (AuraApplicationMap::const_iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end(); ++iter) @@ -4486,6 +4475,26 @@ bool Unit::HasAuraWithMechanic(uint32 mechanicMask) const return false; } +bool Unit::HasStrongerAuraWithDR(SpellInfo const* auraSpellInfo, Unit* caster, bool triggered) const +{ + DiminishingGroup diminishGroup = auraSpellInfo->GetDiminishingReturnsGroupForSpell(triggered); + DiminishingLevels level = GetDiminishing(diminishGroup); + for (auto itr = m_appliedAuras.begin(); itr != m_appliedAuras.end(); ++itr) + { + SpellInfo const* spellInfo = itr->second->GetBase()->GetSpellInfo(); + if (spellInfo->GetDiminishingReturnsGroupForSpell(triggered) != diminishGroup) + continue; + + int32 existingDuration = itr->second->GetBase()->GetMaxDuration(); + int32 newDuration = auraSpellInfo->GetMaxDuration(); + ApplyDiminishingToDuration(auraSpellInfo, triggered, newDuration, caster, level); + if (newDuration > 0 && newDuration < existingDuration) + return true; + } + + return false; +} + AuraEffect* Unit::IsScriptOverriden(SpellInfo const* spell, int32 script) const { AuraEffectList const& auras = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); @@ -9411,31 +9420,28 @@ void Unit::ModSpellDurationTime(SpellInfo const* spellInfo, int32 & duration, Sp duration = int32(float(duration) * m_modAttackSpeedPct[RANGED_ATTACK]); } -DiminishingLevels Unit::GetDiminishing(DiminishingGroup group) +DiminishingLevels Unit::GetDiminishing(DiminishingGroup group) const { - DiminishingReturn& diminish = m_Diminishing[group]; + DiminishingReturn const& diminish = m_Diminishing[group]; if (!diminish.hitCount) return DIMINISHING_LEVEL_1; - // If last spell was cast more than 15 seconds ago - reset the count. + // If last spell was cast more than 15 seconds ago - reset level if (!diminish.stack && GetMSTimeDiffToNow(diminish.hitTime) > 15000) - { - diminish.hitCount = DIMINISHING_LEVEL_1; return DIMINISHING_LEVEL_1; - } return DiminishingLevels(diminish.hitCount); } void Unit::IncrDiminishing(SpellInfo const* auraSpellInfo, bool triggered) { - DiminishingGroup const group = auraSpellInfo->GetDiminishingReturnsGroupForSpell(triggered); - DiminishingLevels const maxLevel = auraSpellInfo->GetDiminishingReturnsMaxLevel(triggered); + DiminishingGroup group = auraSpellInfo->GetDiminishingReturnsGroupForSpell(triggered); + uint32 currentLevel = GetDiminishing(group); + uint32 const maxLevel = auraSpellInfo->GetDiminishingReturnsMaxLevel(triggered); - // Checking for existing in the table DiminishingReturn& diminish = m_Diminishing[group]; - if (static_cast(diminish.hitCount) < maxLevel) - ++diminish.hitCount; + if (currentLevel < maxLevel) + diminish.hitCount = currentLevel + 1; } bool Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool triggered, int32& duration, Unit* caster, DiminishingLevels previousLevel) const @@ -9456,9 +9462,7 @@ bool Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool trigg Unit const* target = targetOwner ? targetOwner : this; Unit const* source = casterOwner ? casterOwner : caster; - if ((target->GetTypeId() == TYPEID_PLAYER - || target->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH) - && source->GetTypeId() == TYPEID_PLAYER) + if (target->IsAffectedByDiminishingReturns() && source->GetTypeId() == TYPEID_PLAYER) duration = limitDuration; } @@ -9480,10 +9484,9 @@ bool Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool trigg } } // Some diminishings applies to mobs too (for example, Stun) - else if ((auraSpellInfo->GetDiminishingReturnsGroupType(triggered) == DRTYPE_PLAYER - && ((targetOwner ? (targetOwner->GetTypeId() == TYPEID_PLAYER) : (GetTypeId() == TYPEID_PLAYER)) - || (GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH))) - || auraSpellInfo->GetDiminishingReturnsGroupType(triggered) == DRTYPE_ALL) + else if (auraSpellInfo->GetDiminishingReturnsGroupType(triggered) == DRTYPE_ALL || + (auraSpellInfo->GetDiminishingReturnsGroupType(triggered) == DRTYPE_PLAYER && + (targetOwner ? targetOwner->IsAffectedByDiminishingReturns() : IsAffectedByDiminishingReturns()))) { DiminishingLevels diminish = previousLevel; switch (diminish) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index a94d451befc..be9a8412869 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1315,7 +1315,8 @@ class TC_GAME_API Unit : public WorldObject void CleanupBeforeRemoveFromMap(bool finalCleanup); void CleanupsBeforeDelete(bool finalCleanup = true) override; // used in ~Creature/~Player (or before mass creature delete to remove cross-references to already deleted units) - DiminishingLevels GetDiminishing(DiminishingGroup group); + virtual bool IsAffectedByDiminishingReturns() const { return (GetCharmerOrOwnerPlayerOrPlayerItself() != nullptr); } + DiminishingLevels GetDiminishing(DiminishingGroup group) const; void IncrDiminishing(SpellInfo const* auraSpellInfo, bool triggered); bool ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool triggered, int32& duration, Unit* caster, DiminishingLevels previousLevel) const; void ApplyDiminishingAura(DiminishingGroup group, bool apply); @@ -1842,8 +1843,8 @@ class TC_GAME_API Unit : public WorldObject bool HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const; bool HasAuraTypeWithValue(AuraType auratype, int32 value) const; bool HasNegativeAuraWithInterruptFlag(uint32 flag, ObjectGuid guid = ObjectGuid::Empty) const; - bool HasNegativeAuraWithAttribute(uint32 flag, ObjectGuid guid = ObjectGuid::Empty) const; bool HasAuraWithMechanic(uint32 mechanicMask) const; + bool HasStrongerAuraWithDR(SpellInfo const* auraSpellInfo, Unit* caster, bool triggered) const; AuraEffect* IsScriptOverriden(SpellInfo const* spell, int32 script) const; uint32 GetDiseasesByCaster(ObjectGuid casterGUID, bool remove = false); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 34c90f27346..493ee775553 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2655,9 +2655,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA diminishLevel = unit->GetDiminishing(diminishGroup); DiminishingReturnsType type = m_spellInfo->GetDiminishingReturnsGroupType(triggered); // Increase Diminishing on unit, current informations for actually casts will use values above - if ((type == DRTYPE_PLAYER && - (unit->GetCharmerOrOwnerPlayerOrPlayerItself() || (unit->GetTypeId() == TYPEID_UNIT && unit->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH))) || - type == DRTYPE_ALL) + if (type == DRTYPE_ALL || (type == DRTYPE_PLAYER && unit->IsAffectedByDiminishingReturns())) unit->IncrDiminishing(m_spellInfo, triggered); } @@ -3252,11 +3250,9 @@ void Spell::_cast(bool skipCheck) // skip check if done already (for instant cast spells for example) if (!skipCheck) { - uint32 param1 = 0, param2 = 0; - SpellCastResult castResult = CheckCast(false, ¶m1, ¶m2); - if (castResult != SPELL_CAST_OK) + auto cleanupSpell = [this, modOwner](SpellCastResult res, uint32* p1 = nullptr, uint32* p2 = nullptr) { - SendCastResult(castResult, ¶m1, ¶m2); + SendCastResult(res, p1, p2); SendInterrupted(0); if (modOwner) @@ -3264,6 +3260,13 @@ void Spell::_cast(bool skipCheck) finish(false); SetExecutedCurrently(false); + }; + + uint32 param1 = 0, param2 = 0; + SpellCastResult castResult = CheckCast(false, ¶m1, ¶m2); + if (castResult != SPELL_CAST_OK) + { + cleanupSpell(castResult, ¶m1, ¶m2); return; } @@ -3279,18 +3282,39 @@ void Spell::_cast(bool skipCheck) { // Spell will be cast after completing the trade. Silently ignore at this place my_trade->SetSpell(m_spellInfo->Id, m_CastItem); - SendCastResult(SPELL_FAILED_DONT_REPORT); - SendInterrupted(0); - - modOwner->SetSpellModTakingSpell(this, false); - - finish(false); - SetExecutedCurrently(false); + cleanupSpell(SPELL_FAILED_DONT_REPORT); return; } } } } + + // check diminishing returns (again, only after finish cast bar, tested on retail) + if (Unit* target = m_targets.GetUnitTarget()) + { + uint8 aura_effmask = 0; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (m_spellInfo->Effects[i].IsUnitOwnedAuraEffect()) + aura_effmask |= 1 << i; + + if (aura_effmask) + { + bool const triggered = m_triggeredByAuraSpell != nullptr; + if (DiminishingGroup diminishGroup = m_spellInfo->GetDiminishingReturnsGroupForSpell(triggered)) + { + DiminishingReturnsType type = m_spellInfo->GetDiminishingReturnsGroupType(triggered); + if (type == DRTYPE_ALL || (type == DRTYPE_PLAYER && target->IsAffectedByDiminishingReturns())) + { + Unit* caster = m_originalCaster ? m_originalCaster : m_caster; + if (target->HasStrongerAuraWithDR(m_spellInfo, caster, triggered)) + { + cleanupSpell(SPELL_FAILED_AURA_BOUNCED); + return; + } + } + } + } + } } // if the spell allows the creature to turn while casting, then adjust server-side orientation to face the target now From 649be219fcb97a3911c936c216c6bfdfe8b3cb90 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 21 Dec 2017 02:46:47 -0300 Subject: [PATCH 16/37] Build/Misc: added Boost 1.66 to FindBoost.cmake --- cmake/macros/FindBoost.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/FindBoost.cmake b/cmake/macros/FindBoost.cmake index 836b1b1c389..ef09c311754 100644 --- a/cmake/macros/FindBoost.cmake +++ b/cmake/macros/FindBoost.cmake @@ -482,7 +482,7 @@ else() # The user has not requested an exact version. Among known # versions, find those that are acceptable to the user request. set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} - "1.65.1" "1.65.0" "1.65" + "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65" "1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60" "1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55" "1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51" From bbeb109135a09d7b8f2e06d2ffd46087ccb6b6e3 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 21 Dec 2017 03:05:23 -0300 Subject: [PATCH 17/37] Build: fix typo in FindBoost --- cmake/macros/FindBoost.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/FindBoost.cmake b/cmake/macros/FindBoost.cmake index ef09c311754..91e74ea1dbd 100644 --- a/cmake/macros/FindBoost.cmake +++ b/cmake/macros/FindBoost.cmake @@ -1036,7 +1036,7 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} ) endforeach() - list(APPEND + list(APPEND _boost_DEBUG_NAMES ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED} From 99044aaa3aa1191f57c05d50c7344c17aff83963 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 21 Dec 2017 03:24:08 -0300 Subject: [PATCH 18/37] Build: fixed finding Boost 1.66 named libraries... somewhat --- cmake/macros/FindBoost.cmake | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/cmake/macros/FindBoost.cmake b/cmake/macros/FindBoost.cmake index 91e74ea1dbd..6d892da2112 100644 --- a/cmake/macros/FindBoost.cmake +++ b/cmake/macros/FindBoost.cmake @@ -851,6 +851,25 @@ if(Boost_DEBUG) "_boost_DEBUG_ABI_TAG = ${_boost_DEBUG_ABI_TAG}") endif() +#TODO: fix this when CMake is updated +#====================== +# Systematically build up the Boost architecture and address model tag +# http://www.boost.org/doc/libs/1_66_0/more/getting_started/windows.html#library-naming +set( _boost_AAM_TAG "-x") +# Key Use this library when: +# 32 32-bit address model +# 64 64-bit address model +if(PLATFORM EQUAL 64) + set( _boost_AAM_TAG "${_boost_AAM_TAG}64") +else() + set( _boost_AAM_TAG "${_boost_AAM_TAG}32") +endif() + +if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_AAM_TAG = ${_boost_AAM_TAG}") +endif() + # ------------------------------------------------------------------------ # Begin finding boost libraries # ------------------------------------------------------------------------ @@ -991,10 +1010,12 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) unset(_boost_RELEASE_NAMES) foreach(compiler IN LISTS _boost_COMPILER) list(APPEND _boost_RELEASE_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_AAM_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} ) endforeach() list(APPEND _boost_RELEASE_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_AAM_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} ) @@ -1002,10 +1023,12 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}") foreach(compiler IN LISTS _boost_COMPILER) list(APPEND _boost_RELEASE_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_AAM_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} ) endforeach() list( APPEND _boost_RELEASE_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_AAM_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} ) endif() @@ -1033,10 +1056,12 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) unset(_boost_DEBUG_NAMES) foreach(compiler IN LISTS _boost_COMPILER) list(APPEND _boost_DEBUG_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_AAM_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} ) endforeach() list(APPEND _boost_DEBUG_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_AAM_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED} @@ -1045,10 +1070,12 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}") foreach(compiler IN LISTS _boost_COMPILER) list(APPEND _boost_DEBUG_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_AAM_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} ) endforeach() list(APPEND _boost_DEBUG_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_AAM_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} ) endif() From e69a640b521b9a4473c680ccae3fedb72770ad72 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 21 Dec 2017 03:55:21 -0300 Subject: [PATCH 19/37] DB/Creature: added interrupt immunities to some bosses Closes #12020 --- sql/updates/world/3.3.5/2017_12_21_00_world.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_21_00_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_21_00_world.sql b/sql/updates/world/3.3.5/2017_12_21_00_world.sql new file mode 100644 index 00000000000..f1763e34575 --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_21_00_world.sql @@ -0,0 +1,5 @@ +UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask`|33554432 WHERE `entry` IN +(36626,37504,37505,37506, -- Festergut +39863,39864,39944,39945, -- Halion (normal) +40142,40143,40144,40145, -- Halion (twilight) +34797,35447,35448,35449); -- Icehowl From 11491e8533804a374edeacadef6c0720c1c71724 Mon Sep 17 00:00:00 2001 From: Riztazz Date: Thu, 21 Dec 2017 20:57:29 +0100 Subject: [PATCH 20/37] Scripts/Stratholme: Few changes to how Ysida behaves during the Baron run (#20749) --- .../world/3.3.5/2017_12_21_01_world.sql | 18 ++++++ .../Stratholme/instance_stratholme.cpp | 62 ++++++++++++++----- .../EasternKingdoms/Stratholme/stratholme.cpp | 34 ++++++++++ .../EasternKingdoms/Stratholme/stratholme.h | 8 ++- 4 files changed, 105 insertions(+), 17 deletions(-) create mode 100644 sql/updates/world/3.3.5/2017_12_21_01_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_21_01_world.sql b/sql/updates/world/3.3.5/2017_12_21_01_world.sql new file mode 100644 index 00000000000..f11c3d35d86 --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_21_01_world.sql @@ -0,0 +1,18 @@ +SET @CGUID:= 16806; -- 1 guid +SET @GGUID:= 1577; -- 2 guids + +DELETE FROM `creature` WHERE `guid` = @CGUID; +INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES +(@CGUID, 16031, 329, 0, 0, 1, 1, 0, 0, 4044.78, -3333.68, 117.26, 4.153883, 7200, 0, 0, 4120, 0, 0, 0, 0, 0, '', 0); + +DELETE FROM `gameobject` WHERE `guid` IN (@GGUID + 0, @GGUID + 1); +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `ScriptName`, `VerifiedBuild`) VALUES +(@GGUID + 0, 181071, 329, 2017, 2017, 1, 1, 4044.34, -3334.217, 115.0604, 2.740162, -0, -0, 0.9799242, 0.1993704, 300, 255, 1, '', 0), +(@GGUID + 1, 181072, 329, 2017, 2017, 1, 1, 4039.52, -3331.85, 115.061, 1.169369, -0, -0, 0.5519361, 0.8338864, 300, 255, 1, '', 0); + +DELETE FROM `spell_script_names` WHERE `ScriptName` = "spell_ysida_saved_credit"; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(31912, "spell_ysida_saved_credit"); + +UPDATE `creature_template` SET `npcflag` = `npcflag` & ~2, `AIName` = "" WHERE `entry` = 16031; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 16031; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index 91594c7b1c0..de3388b5df5 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -36,6 +36,11 @@ enum InstanceEvents EVENT_SLAUGHTER_SQUARE = 2 }; +enum StratholmeMisc +{ + SAY_YSIDA_SAVED = 0 +}; + Position const timmyTheCruelSpawnPosition = { 3625.358f, -3188.108f, 130.3985f, 4.834562f }; EllipseBoundary const beforeScarletGate(Position(3671.158f, -3181.79f), 60.0f, 40.0f); @@ -76,8 +81,10 @@ class instance_stratholme : public InstanceMapScript ObjectGuid portGauntletGUID; ObjectGuid portSlaugtherGUID; ObjectGuid portElderGUID; + ObjectGuid ysidaCageGUID; ObjectGuid baronGUID; + ObjectGuid ysidaGUID; ObjectGuid ysidaTriggerGUID; GuidSet crystalsGUID; GuidSet abomnationGUID; @@ -156,6 +163,9 @@ class instance_stratholme : public InstanceMapScript case NPC_ABOM_VENOM: abomnationGUID.insert(creature->GetGUID()); break; + case NPC_YSIDA: + ysidaGUID = creature->GetGUID(); + break; } } @@ -223,6 +233,9 @@ class instance_stratholme : public InstanceMapScript case GO_PORT_ELDERS: portElderGUID = go->GetGUID(); break; + case GO_YSIDA_CAGE: + ysidaCageGUID = go->GetGUID(); + break; } } @@ -242,14 +255,41 @@ class instance_stratholme : public InstanceMapScript break; case FAIL: DoRemoveAurasDueToSpellOnPlayers(SPELL_BARON_ULTIMATUM); + if (Creature* ysida = instance->GetCreature(ysidaGUID)) + ysida->CastSpell(ysida, SPELL_PERM_FEIGN_DEATH, true); EncounterState[0] = data; break; case DONE: EncounterState[0] = data; - if (Creature* ysidaTrigger = instance->GetCreature(ysidaTriggerGUID)) + + if (Creature* ysida = instance->GetCreature(ysidaGUID)) { - Position ysidaPos = ysidaTrigger->GetPosition(); - ysidaTrigger->SummonCreature(NPC_YSIDA, ysidaPos, TEMPSUMMON_TIMED_DESPAWN, 1800000); + if (GameObject* cage = instance->GetGameObject(ysidaCageGUID)) + cage->UseDoorOrButton(); + + float x, y, z; + //! This spell handles the Dead man's plea quest completion + ysida->CastSpell(nullptr, SPELL_YSIDA_SAVED, true); + ysida->SetWalk(true); + ysida->AI()->Talk(SAY_YSIDA_SAVED); + ysida->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + ysida->GetClosePoint(x, y, z, ysida->GetObjectScale() / 3, 4.0f); + ysida->GetMotionMaster()->MovePoint(1, x, y, z); + + Map::PlayerList const& players = instance->GetPlayers(); + + for (auto const& i : players) + { + if (Player* player = i.GetSource()) + { + if (player->IsGameMaster()) + continue; + + //! im not quite sure what this one is supposed to do + //! this is server-side spell + player->CastSpell(ysida, SPELL_YSIDA_CREDIT_EFFECT, true); + } + } } events.CancelEvent(EVENT_BARON_RUN); break; @@ -332,19 +372,9 @@ class instance_stratholme : public InstanceMapScript { HandleGameObject(portGauntletGUID, true); if (GetData(TYPE_BARON_RUN) == IN_PROGRESS) - { DoRemoveAurasDueToSpellOnPlayers(SPELL_BARON_ULTIMATUM); - Map::PlayerList const& players = instance->GetPlayers(); - if (!players.isEmpty()) - for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - if (Player* player = itr->GetSource()) - if (player->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE) - { - player->AreaExploredOrEventHappens(QUEST_DEAD_MAN_PLEA); - player->KilledMonsterCredit(NPC_YSIDA); - } - SetData(TYPE_BARON_RUN, DONE); - } + + SetData(TYPE_BARON_RUN, DONE); } EncounterState[5] = data; break; @@ -438,6 +468,8 @@ class instance_stratholme : public InstanceMapScript return baronGUID; case DATA_YSIDA_TRIGGER: return ysidaTriggerGUID; + case NPC_YSIDA: + return ysidaGUID; } return ObjectGuid::Empty; } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp index 2275956daa0..56bd7458198 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -297,9 +297,43 @@ public: }; +class spell_ysida_saved_credit : public SpellScript +{ + PrepareSpellScript(spell_ysida_saved_credit); + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo({ SPELL_YSIDA_SAVED }); + } + + void FilterTargets(std::list& targets) + { + targets.remove_if([](WorldObject* obj) + { + return obj->GetTypeId() != TYPEID_PLAYER; + }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Player* player = GetHitUnit()->ToPlayer()) + { + player->AreaExploredOrEventHappens(QUEST_DEAD_MAN_PLEA); + player->KilledMonsterCredit(NPC_YSIDA); + } + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ysida_saved_credit::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnEffectHitTarget += SpellEffectFn(spell_ysida_saved_credit::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_stratholme() { new go_gauntlet_gate(); new npc_restless_soul(); new npc_spectral_ghostly_citizen(); + RegisterSpellScript(spell_ysida_saved_credit); } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h index ff4d330748e..dc16dc2e0f7 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h @@ -76,7 +76,8 @@ enum STRGameobjectIds GO_ZIGGURAT5 = 175796, // baron GO_PORT_GAUNTLET = 175374, // port from gauntlet to slaugther GO_PORT_SLAUGTHER = 175373, // port at slaugther - GO_PORT_ELDERS = 175377 // port at elders square + GO_PORT_ELDERS = 175377, // port at elders square + GO_YSIDA_CAGE = 181071 }; enum STRQuestIds @@ -86,7 +87,10 @@ enum STRQuestIds enum STRSpellIds { - SPELL_BARON_ULTIMATUM = 27861 + SPELL_BARON_ULTIMATUM = 27861, + SPELL_PERM_FEIGN_DEATH = 29266, + SPELL_YSIDA_SAVED = 31912, + SPELL_YSIDA_CREDIT_EFFECT = 31913 }; enum STRMisc From f21a2fda58799a1c84efffa5777208bd130afad4 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Tue, 26 Dec 2017 17:05:53 +0100 Subject: [PATCH 21/37] Build fix --- .../Stratholme/instance_stratholme.cpp | 10 ++++++++-- .../EasternKingdoms/Stratholme/stratholme.cpp | 15 ++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index de3388b5df5..6fbed5d3f52 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -25,10 +25,16 @@ EndScriptData */ #include "ScriptMgr.h" #include "AreaBoundary.h" -#include "ScriptedCreature.h" +#include "Creature.h" +#include "CreatureAI.h" +#include "EventMap.h" +#include "GameObject.h" #include "InstanceScript.h" -#include "stratholme.h" +#include "Log.h" +#include "Map.h" +#include "MotionMaster.h" #include "Player.h" +#include "stratholme.h" enum InstanceEvents { diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp index 56bd7458198..bcd673b8c12 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -31,12 +31,17 @@ npc_spectral_ghostly_citizen EndContentData */ #include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "stratholme.h" -#include "Group.h" -#include "Player.h" -#include "SpellInfo.h" +#include "GameObject.h" #include "GameObjectAI.h" +#include "Group.h" +#include "InstanceScript.h" +#include "MotionMaster.h" +#include "ObjectAccessor.h" +#include "Player.h" +#include "ScriptedCreature.h" +#include "SpellInfo.h" +#include "SpellScript.h" +#include "stratholme.h" /*###### ## go_gauntlet_gate (this is the _first_ of the gauntlet gates, two exist) From 0d4810ad936bcde59038c2293edc1ea698fd01a2 Mon Sep 17 00:00:00 2001 From: Killyana Date: Fri, 22 Dec 2017 20:20:14 +0100 Subject: [PATCH 22/37] Scripts/Stratholme: Fix a DB error Ref #20749 --- sql/updates/world/3.3.5/2017_12_21_02_world.sql | 2 ++ .../scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp | 1 + 2 files changed, 3 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_21_02_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_21_02_world.sql b/sql/updates/world/3.3.5/2017_12_21_02_world.sql new file mode 100644 index 00000000000..b7fece8a3cb --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_21_02_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_template` SET `npcflag` = `npcflag` | 2 WHERE `entry` = 16031; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index 6fbed5d3f52..155d87823f7 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -171,6 +171,7 @@ class instance_stratholme : public InstanceMapScript break; case NPC_YSIDA: ysidaGUID = creature->GetGUID(); + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); break; } } From 0f081299cbb6d727153c0f37f43730a366b2456c Mon Sep 17 00:00:00 2001 From: ZenoX92 Date: Fri, 22 Dec 2017 20:40:31 +0100 Subject: [PATCH 23/37] DB/Quest: The Emitter Outro event Closes #12538 --- .../world/3.3.5/2017_12_22_00_world.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_22_00_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_22_00_world.sql b/sql/updates/world/3.3.5/2017_12_22_00_world.sql new file mode 100644 index 00000000000..9f671922aeb --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_22_00_world.sql @@ -0,0 +1,18 @@ +-- Quest "The Emitter" +DELETE FROM `smart_scripts` WHERE `entryorguid`=1707100 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 +(1707100,9,0,0,0,0,100,0,0,0,0,0,9,0,0,0,0,0,0,20,181286,0,0,0,0,0,0,"Technician Zhanaa - On Script - Activate Gameobject"), +(1707100,9,1,0,0,0,100,0,0,0,0,0,12,16550,1,39000,0,0,0,8,0,0,0,-4187.71,-13738.7,75.6549,1.85005,"Technician Zhanaa - On Script - Summon Creature 'Image of Technician Dyvuun'"), +(1707100,9,2,0,0,0,100,0,0,0,0,0,64,2,0,0,0,0,0,7,0,0,0,0,0,0,0,"Technician Zhanaa - On Script - Store Targetlist"), +(1707100,9,3,0,0,0,100,0,1000,1000,0,0,100,2,0,0,0,0,0,19,16550,10,0,0,0,0,0,"Technician Zhanaa - On Script - Send Target 2"), +(1707100,9,4,0,0,0,100,0,1000,1000,0,0,45,0,1,0,0,0,0,19,16550,10,0,0,0,0,0,"Technician Zhanaa - On Script - Set Data 0 1"), +(1707100,9,5,0,0,0,100,0,1000,1000,0,0,66,0,0,0,0,0,0,19,16550,10,0,0,0,0,0,"Technician Zhanaa - On Script - Set Orientation Closest Creature 'Image of Technician Dyvuun'"), +(1707100,9,6,0,0,0,100,0,2000,2000,0,0,5,70,0,0,0,0,0,1,0,0,0,0,0,0,0,"Technician Zhanaa - On Script - Play Emote 70"), +(1707100,9,7,0,0,0,100,0,19000,19000,0,0,59,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Technician Zhanaa - On Script - Set Run Off"), +(1707100,9,8,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-4186.67,-13736.3,74.4813,0,"Technician Zhanaa - On Script - Move to Position"), +(1707100,9,9,0,0,0,100,0,3000,3000,0,0,17,133,0,0,0,0,0,1,0,0,0,0,0,0,0,"Technician Zhanaa - On Script - Set Emote State 133"), +(1707100,9,11,0,0,0,100,0,16000,16000,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Technician Zhanaa - On Script - Set Orientation Invoker"), +(1707100,9,12,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Technician Zhanaa - On Script - Say Line 0"), +(1707100,9,13,0,0,0,100,0,29000,29000,0,0,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Technician Zhanaa - On Script - Set Emote State 0"), +(1707100,9,14,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-4184.55,-13733.1,74.1389,0,"Technician Zhanaa - On Script - Move to Position"), +(1707100,9,15,0,0,0,100,0,3000,3000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,1.91986,"Technician Zhanaa - On Script - Set Orientation"); From afae531ca92566c57ff7ee0a4af29f5060d2a24a Mon Sep 17 00:00:00 2001 From: ZenoX92 Date: Fri, 22 Dec 2017 20:45:21 +0100 Subject: [PATCH 24/37] DB/Quest: An Injured Colleague Outro event Closes #10522 --- .../world/3.3.5/2017_12_22_01_world.sql | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_22_01_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_22_01_world.sql b/sql/updates/world/3.3.5/2017_12_22_01_world.sql new file mode 100644 index 00000000000..f8837525ede --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_22_01_world.sql @@ -0,0 +1,93 @@ +-- Aponi Brightmane & Tahu Sagewind +DELETE FROM `creature_text` WHERE `CreatureID` IN (34526,34528); +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(34526,0,0,"Talk to me, Tahu. Something. Anything! I'm going stir-crazy.",12,0,100,0,0,0,34762,0,"Aponi Brightmane"), +(34526,1,0,"Not much.",12,0,100,0,0,0,34763,0,"Aponi Brightmane"), +(34526,2,0,"Like Mu'sha.",12,0,100,0,0,0,34764,0,"Aponi Brightmane"), +(34526,3,0,"Where are you going with this?",12,0,100,6,0,0,34765,0,"Aponi Brightmane"), +(34526,4,0,"I hear the \"but\" in your voice...",12,0,100,0,0,0,34766,0,"Aponi Brightmane"), +(34526,5,0,"Do you think his teachings are wrong?",12,0,100,6,0,0,34767,0,"Aponi Brightmane"), +(34526,6,0,"So are you going to bring this up to the elder?",12,0,100,0,0,0,34768,0,"Aponi Brightmane"), +(34526,7,0,"I suppose so. It's not silly, though, what you said.",12,0,100,1,0,0,34769,0,"Aponi Brightmane"), +(34526,8,0,"I see that thoughtful frown, Tahu.",12,0,100,0,0,0,34770,0,"Aponi Brightmane"), +(34526,9,0,"But something is on your mind, right?",12,0,100,6,0,0,34771,0,"Aponi Brightmane"), +(34526,10,0,"What about it?",12,0,100,0,0,0,34772,0,"Aponi Brightmane"), +(34526,11,0,"There's a phrase... \"It's always darkest before the dawn.\" The dawn will come, though, Tahu. The sun will rise. The balance will shift back to where it should be.",12,0,100,1,0,0,34773,0,"Aponi Brightmane"), +(34526,12,0,"%s smiles and gestures to the north.",16,0,100,25,0,0,34774,0,"Aponi Brightmane"), +(34526,13,0,"Even on the glacier itself, the sun manages to peek through the gloom. I have hope, Tahu. I think we'll make it through this, no matter how dire it looks.",12,0,100,1,0,0,34775,0,"Aponi Brightmane"), +(34526,14,0,"But I'd still rather be there on the front lines helping it happen rather than trying to placate myself with belief. We can't just sit around and hope it happens.",12,0,100,0,0,0,34776,0,"Aponi Brightmane"), +(34526,15,0,"And through that hope, strengthen our side in the fight?",12,0,100,0,0,0,34777,0,"Aponi Brightmane"), +(34528,0,0,"%s laughs softly.",16,0,100,0,0,0,34745,0,"Tahu Sagewind"), +(34528,1,0,"All right, Aponi. I've enough on my mind to share. Have you ever spoken to the elves of Moonglade?",12,0,100,1,0,0,34746,0,"Tahu Sagewind"), +(34528,2,0,"The elves speak of a moon goddess, did you know? They put great stock in the light given by the moon.",12,0,100,0,0,0,34747,0,"Tahu Sagewind"), +(34528,3,0,"Just like her. The parallels I've heard are interesting. And it's no secret all druids, Shu'halo and elf alike, can call upon Mu'sha's light.",12,0,100,273,0,0,34748,0,"Tahu Sagewind"), +(34528,4,0,"I wonder. Hamuul has guided us well, and I've learned so much from him. The legends say that our people were druids when time began...",12,0,100,1,0,0,34749,0,"Tahu Sagewind"), +(34528,5,0,"...but what Hamuul teaches is what the elves know. The night elves. They put such stock in their moon goddess, as creatures of the night.",12,0,100,0,0,0,34750,0,"Tahu Sagewind"), +(34528,6,0,"No! No, nothing like that. He is an elder for good reason, sister. Mu'sha is one of the Earthmother's eyes, and she watches over us. That isn't sinister.",12,0,100,274,0,0,34751,0,"Tahu Sagewind"), +(34528,7,0,"But we're nothing if not people who strive for balance. Our warriors fight only when there is need. Our hunters take only what the tribes require to live, and use all they can when they do. The shaman stand as guide and mediator to the elemental spirits.",12,0,100,0,0,0,34753,0,"Tahu Sagewind"), +(34528,8,0,"And while we, as druids, are guardians of nature, I wonder if we've overlooked a key aspect of balance in all things.",12,0,100,1,0,0,34754,0,"Tahu Sagewind"), +(34528,9,0,"No, no. No need for him to trouble about a student's idle philosophizing while he entertains a friend.",12,0,100,274,0,0,34755,0,"Tahu Sagewind"), +(34528,10,0,"Well, it isn't exactly a new thought, sister.",12,0,100,6,0,0,34756,0,"Tahu Sagewind"), +(34528,11,0,"Sorry, sister. It's nothing to worry about.",12,0,100,0,0,0,34778,0,"Tahu Sagewind"), +(34528,12,0,"I'm thinking about the front to the north. The one you're so eager to return to.",12,0,100,1,0,0,34779,0,"Tahu Sagewind"), +(34528,13,0,"I know I'm counseling patience, Aponi, but I don't like remaining here any more than you do. Times are bleak, and failing to act only makes me worry that my idle hand may have been the one to turn the tide.",12,0,100,0,0,0,34780,0,"Tahu Sagewind"), +(34528,14,0,"Still... there is balance in all things, even death. I simply hate the concept that such destruction and darkness might be necessary.",12,0,100,1,0,0,34781,0,"Tahu Sagewind"), +(34528,15,0,"I know, sister. I know. We'll return to fighting one day. For now, though, maybe it's best to spread the word to others... give them the hope you have.",12,0,100,1,0,0,34783,0,"Tahu Sagewind"), +(34528,16,0,"That's the idea.",12,0,100,273,0,0,34784,0,"Tahu Sagewind"); + +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=34526; +DELETE FROM `smart_scripts` WHERE `entryorguid`=34526 AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (3452600,3452601) 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 +(34526,0,0,0,20,1,100,0,13986,0,0,0,87,3452600,3452601,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Quest 'An Injured Colleague' Finished - Run Random Script"), +(34526,0,1,0,11,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Respawn - Set Event Phase 1"), +(3452600,9,0,0,0,0,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Set Event Phase 0"), +(3452600,9,1,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 0"), +(3452600,9,2,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 0 (Tahu Sagewind)"), +(3452600,9,3,0,0,0,100,0,2000,2000,0,0,1,1,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 1 (Tahu Sagewind)"), +(3452600,9,4,0,0,0,100,0,5500,5500,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 1"), +(3452600,9,5,0,0,0,100,0,2000,2000,0,0,1,2,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 2 (Tahu Sagewind)"), +(3452600,9,6,0,0,0,100,0,3000,3000,0,0,86,65630,0,19,34548,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Cross Cast 'Starfall State Visual'"), +(3452600,9,7,0,0,0,100,0,3000,3000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 2"), +(3452600,9,8,0,0,0,100,0,2000,2000,0,0,1,3,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 3 (Tahu Sagewind)"), +(3452600,9,9,0,0,0,100,0,7000,7000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 3"), +(3452600,9,10,0,0,0,100,0,3000,3000,0,0,1,4,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 4 (Tahu Sagewind)"), +(3452600,9,11,0,0,0,100,0,7000,7000,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 4"), +(3452600,9,12,0,0,0,100,0,3000,3000,0,0,1,5,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 5 (Tahu Sagewind)"), +(3452600,9,13,0,0,0,100,0,7000,7000,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 5"), +(3452600,9,14,0,0,0,100,0,4000,4000,0,0,1,6,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 6 (Tahu Sagewind)"), +(3452600,9,15,0,0,0,100,0,8000,8000,0,0,1,7,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 7 (Tahu Sagewind)"), +(3452600,9,16,0,0,0,100,0,13000,13000,0,0,1,8,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 8 (Tahu Sagewind)"), +(3452600,9,17,0,0,0,100,0,2500,2500,0,0,28,0,0,0,0,0,0,19,34548,0,0,0,0,0,0,"Aponi Brightmane - On Script - Remove All Auras"), +(3452600,9,18,0,0,0,100,0,500,500,0,0,86,65632,0,19,34548,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Cross Cast 'Eclipse Visual'"), +(3452600,9,19,0,0,0,100,0,3000,3000,0,0,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 6"), +(3452600,9,20,0,0,0,100,0,4000,4000,0,0,1,9,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 9 (Tahu Sagewind)"), +(3452600,9,21,0,0,0,100,0,5500,5500,0,0,1,7,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 7"), +(3452600,9,22,0,0,0,100,0,4000,4000,0,0,1,10,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 10 (Tahu Sagewind)"), +(3452600,9,23,0,0,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Set Event Phase 1"), +(3452601,9,0,0,0,0,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Set Event Phase 0"), +(3452601,9,1,0,0,0,100,0,3000,3000,0,0,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 8"), +(3452601,9,2,0,0,0,100,0,3000,3000,0,0,1,11,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 11 (Tahu Sagewind)"), +(3452601,9,3,0,0,0,100,0,3500,3500,0,0,1,9,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 9"), +(3452601,9,4,0,0,0,100,0,3500,3500,0,0,1,12,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 12 (Tahu Sagewind)"), +(3452601,9,5,0,0,0,100,0,5000,5000,0,0,1,10,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 10"), +(3452601,9,6,0,0,0,100,0,2000,2000,0,0,1,13,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 13 (Tahu Sagewind)"), +(3452601,9,7,0,0,0,100,0,11000,11000,0,0,1,14,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 14 (Tahu Sagewind)"), +(3452601,9,8,0,0,0,100,0,7000,7000,0,0,1,11,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 11"), +(3452601,9,9,0,0,0,100,0,4000,4000,0,0,86,65631,0,19,34548,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Cross Cast 'Sunny'"), +(3452601,9,10,0,0,0,100,0,5000,5000,0,0,1,12,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 12"), +(3452601,9,11,0,0,0,100,0,2000,2000,0,0,1,13,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 13"), +(3452601,9,12,0,0,0,100,0,8000,8000,0,0,1,14,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 14"), +(3452601,9,13,0,0,0,100,0,8500,8500,0,0,1,15,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 15 (Tahu Sagewind)"), +(3452601,9,14,0,0,0,100,0,8000,8000,0,0,1,15,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 15"), +(3452601,9,15,0,0,0,100,0,4000,4000,0,0,1,16,0,0,0,0,0,19,34528,0,0,0,0,0,0,"Aponi Brightmane - On Script - Say Line 16 (Tahu Sagewind)"), +(3452601,9,16,0,0,0,100,0,0,0,0,0,28,0,0,0,0,0,0,19,34548,0,0,0,0,0,0,"Aponi Brightmane - On Script - Remove All Auras"), +(3452601,9,17,0,0,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Aponi Brightmane - On Script - Set Event Phase 1"); + +-- Add missing spawns +SET @GUID1 := 16806; +SET @GUID2 := 17553; +DELETE FROM `creature` WHERE `guid` IN (@GUID1, @GUID2); +INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES +(@GUID1,34548,1,0,0,1,1,0,0,-1047.73,-287.61,159.03,5.93684,300,0,0,42,0,0,0,33554432,0,"",0), -- Invisible Spell Target - Tahu +(@GUID2,34528,1,0,0,1,1,0,1,-1045.84,-288.282,159.03,2.8312,300,0,0,3137,2117,0,0,0,0,"",0); -- Tahu Sagewind From c06829b609105542991ae9b3f9f28f8b33964164 Mon Sep 17 00:00:00 2001 From: Killyana Date: Fri, 22 Dec 2017 20:52:32 +0100 Subject: [PATCH 25/37] DB: Restore a deleted spawn --- sql/updates/world/3.3.5/2017_12_22_02_world.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_22_02_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_22_02_world.sql b/sql/updates/world/3.3.5/2017_12_22_02_world.sql new file mode 100644 index 00000000000..c6e249907bd --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_22_02_world.sql @@ -0,0 +1,6 @@ +-- +SET @CGUID:= 42637; -- 1 guid + +DELETE FROM `creature` WHERE `guid` = @CGUID; +INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES +(@CGUID, 16031, 329, 0, 0, 1, 1, 0, 0, 4044.78, -3333.68, 117.26, 4.153883, 7200, 0, 0, 4120, 0, 0, 0, 0, 0, '', 0); From 434cbf3d3b408c00e125c9dad5f89720b06a3ccb Mon Sep 17 00:00:00 2001 From: Killyana Date: Fri, 22 Dec 2017 21:06:36 +0100 Subject: [PATCH 26/37] Typo --- .../scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index 155d87823f7..426b1d0ec49 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -171,7 +171,7 @@ class instance_stratholme : public InstanceMapScript break; case NPC_YSIDA: ysidaGUID = creature->GetGUID(); - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); break; } } From 040748d3fed4ef788cca9fadf63e24bc3ea18b96 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 24 Dec 2017 02:43:19 +0100 Subject: [PATCH 27/37] DB/Gameobject: Fix few instances spawns Closes #21101 Closes #21099 --- sql/updates/world/3.3.5/2017_12_24_00_world.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_24_00_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_24_00_world.sql b/sql/updates/world/3.3.5/2017_12_24_00_world.sql new file mode 100644 index 00000000000..54fa4fffdf4 --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_24_00_world.sql @@ -0,0 +1,3 @@ +-- +UPDATE `gameobject` SET `spawnMask` = 3 WHERE `id` = 182947; +UPDATE `gameobject` SET `spawnMask` = 2 WHERE `id` = 184222 AND `map` IN (553,554); From ff26ce4f9792250630fab0305cdf289810bb3fb9 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Mon, 25 Dec 2017 11:27:02 +0100 Subject: [PATCH 28/37] Core/CreatureAI: Disable PetAI from database --- src/server/game/AI/CoreAI/PetAI.cpp | 2 ++ src/server/game/Globals/ObjectMgr.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index b4cd98f1f38..2f06926d447 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -551,6 +551,8 @@ bool PetAI::CanAttack(Unit* target) return false; } + ASSERT(me->GetCharmInfo()); + // Passive - passive pets can attack if told to if (me->HasReactState(REACT_PASSIVE)) return me->GetCharmInfo()->IsCommandAttack(); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 92b63ec46d4..2059d4d29c8 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -854,7 +854,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) const_cast(cInfo)->maxgold = cInfo->mingold; } - if (cInfo->AIName == "TotemAI") + if (cInfo->AIName == "TotemAI" || cInfo->AIName == "PetAI") { TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has not-allowed `AIName` '%s' set, removing", cInfo->Entry, cInfo->AIName.c_str()); const_cast(cInfo)->AIName.clear(); From e4bff93b4c018488e9d82585a19042d91a85a905 Mon Sep 17 00:00:00 2001 From: Killyana Date: Mon, 25 Dec 2017 21:16:37 +0100 Subject: [PATCH 29/37] DB/CreatureAI: Disable PetAI from database Ref https://github.com/TrinityCore/TrinityCore/commit/2c7e921cdc14527bd99d6976793e69999f262f9d Closes #20200 --- sql/updates/world/3.3.5/2017_12_25_00_world.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_25_00_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_25_00_world.sql b/sql/updates/world/3.3.5/2017_12_25_00_world.sql new file mode 100644 index 00000000000..ac78bfdc15d --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_25_00_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE creature_template SET AIName='' WHERE entry=21909; From 2db0b980f4c369c959efe2a28ef9e0e67a657ef8 Mon Sep 17 00:00:00 2001 From: Serpaa Date: Mon, 25 Dec 2017 21:24:36 +0100 Subject: [PATCH 30/37] DB/Misc: Shadowfang Keep Closes #21114 --- .../world/3.3.5/2017_12_25_01_world_335.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_25_01_world_335.sql diff --git a/sql/updates/world/3.3.5/2017_12_25_01_world_335.sql b/sql/updates/world/3.3.5/2017_12_25_01_world_335.sql new file mode 100644 index 00000000000..629c5830be8 --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_25_01_world_335.sql @@ -0,0 +1,17 @@ +-- +-- Change weapons of Commander Springvale to the correct pre-cataclysm ones +UPDATE `creature_equip_template` SET `ItemID1`=5191, `ItemID2`=1201 WHERE `CreatureID`=4278 AND `ID`=1; + +-- Update Lupine Horror and Slavering Worg MovementType to stand still +UPDATE `creature` SET `spawndist`=0, `MovementType`=0 WHERE `guid` IN (16240, 16238); + +-- Add chain aggro to Worgs infront of Wolf Master Nandos +DELETE FROM `creature_formations` WHERE `leaderGUID`=16241; +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`) VALUES +(16241, 16241, 0, 0, 3), +(16241, 16240, 0, 0, 3), +(16241, 16238, 0, 0, 3), +(16241, 16239, 0, 0, 3); + +-- Add random movement to Razorclaw the Butcher +UPDATE `creature` SET `spawndist`=5, `MovementType`=1 WHERE `guid`=16253; From 115c6c56c09e3c799aa70ee1030d63396e3593f5 Mon Sep 17 00:00:00 2001 From: Keader Date: Tue, 26 Dec 2017 11:59:20 -0300 Subject: [PATCH 31/37] Core/AI: Changing uint64 to ObjectGuid in GameObjectAI --- src/server/game/AI/CoreAI/GameObjectAI.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h index 84ead51cc91..35daca943aa 100644 --- a/src/server/game/AI/CoreAI/GameObjectAI.h +++ b/src/server/game/AI/CoreAI/GameObjectAI.h @@ -42,8 +42,8 @@ class TC_GAME_API GameObjectAI // Pass parameters between AI virtual void DoAction(int32 /*param = 0 */) { } - virtual void SetGUID(uint64 /*guid*/, int32 /*id = 0 */) { } - virtual uint64 GetGUID(int32 /*id = 0 */) const { return 0; } + virtual void SetGUID(ObjectGuid /*guid*/, int32 /*id = 0 */) { } + virtual ObjectGuid GetGUID(int32 /*id = 0 */) const { return ObjectGuid::Empty; } static int32 Permissible(GameObject const* /*go*/) { return PERMIT_BASE_NO; } From ac8f4365419a336c4207374b5a3a9c4b651cff4a Mon Sep 17 00:00:00 2001 From: Aokromes Date: Tue, 26 Dec 2017 17:44:08 +0100 Subject: [PATCH 32/37] Build Fix --- src/server/game/AI/CoreAI/GameObjectAI.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h index 35daca943aa..e72157ccd7a 100644 --- a/src/server/game/AI/CoreAI/GameObjectAI.h +++ b/src/server/game/AI/CoreAI/GameObjectAI.h @@ -25,6 +25,7 @@ #include "QuestDef.h" #include "GameObject.h" #include "CreatureAI.h" +#include "ObjectGuid.h" class TC_GAME_API GameObjectAI { From f04a54ca68b27135bb558e102c910c458406b32a Mon Sep 17 00:00:00 2001 From: Aokromes Date: Tue, 26 Dec 2017 17:50:40 +0100 Subject: [PATCH 33/37] rename files --- .../2017_12_26_00_world_from_335_was_2017_12_19_00_world.sql} | 0 .../2017_12_26_01_world_from_335_was_2017_12_19_01_world.sql} | 0 ...017_12_26_02_world_from_335_was_2017_12_20_01_world_335.sql} | 2 ++ ...017_12_26_03_world_from_335_was_2017_12_20_02_world_335.sql} | 2 ++ ...017_12_26_04_world_from_335_was_2017_12_20_03_world_335.sql} | 2 ++ .../2017_12_26_05_world_from_335_was_2017_12_20_04_world.sql} | 0 .../2017_12_26_06_world_from_335_was_2017_12_20_05_world.sql} | 0 .../2017_12_26_07_world_from_335_was_2017_12_21_00_world.sql} | 0 .../2017_12_26_08_world_from_335_was_2017_12_21_01_world.sql} | 0 .../2017_12_26_09_world_from_335_was_2017_12_21_02_world.sql} | 0 .../2017_12_26_10_world_from_335_was_2017_12_22_00_world.sql} | 0 .../2017_12_26_11_world_from_335_was_2017_12_22_01_world.sql} | 0 .../2017_12_26_12_world_from_335_was_2017_12_22_02_world.sql} | 0 .../2017_12_26_13_world_from_335_was_2017_12_24_00_world.sql} | 0 .../2017_12_26_14_world_from_335_was_2017_12_25_00_world.sql} | 0 ...017_12_26_15_world_from_335_was_2017_12_25_01_world_335.sql} | 2 ++ 16 files changed, 8 insertions(+) rename sql/updates/world/{3.3.5/2017_12_19_00_world.sql => 4.3.4/2017_12_26_00_world_from_335_was_2017_12_19_00_world.sql} (100%) rename sql/updates/world/{3.3.5/2017_12_19_01_world.sql => 4.3.4/2017_12_26_01_world_from_335_was_2017_12_19_01_world.sql} (100%) rename sql/updates/world/{3.3.5/2017_12_20_01_world_335.sql => 4.3.4/2017_12_26_02_world_from_335_was_2017_12_20_01_world_335.sql} (98%) rename sql/updates/world/{3.3.5/2017_12_20_02_world_335.sql => 4.3.4/2017_12_26_03_world_from_335_was_2017_12_20_02_world_335.sql} (99%) rename sql/updates/world/{3.3.5/2017_12_20_03_world_335.sql => 4.3.4/2017_12_26_04_world_from_335_was_2017_12_20_03_world_335.sql} (99%) rename sql/updates/world/{3.3.5/2017_12_20_04_world.sql => 4.3.4/2017_12_26_05_world_from_335_was_2017_12_20_04_world.sql} (100%) rename sql/updates/world/{3.3.5/2017_12_20_05_world.sql => 4.3.4/2017_12_26_06_world_from_335_was_2017_12_20_05_world.sql} (100%) rename sql/updates/world/{3.3.5/2017_12_21_00_world.sql => 4.3.4/2017_12_26_07_world_from_335_was_2017_12_21_00_world.sql} (100%) rename sql/updates/world/{3.3.5/2017_12_21_01_world.sql => 4.3.4/2017_12_26_08_world_from_335_was_2017_12_21_01_world.sql} (100%) rename sql/updates/world/{3.3.5/2017_12_21_02_world.sql => 4.3.4/2017_12_26_09_world_from_335_was_2017_12_21_02_world.sql} (100%) rename sql/updates/world/{3.3.5/2017_12_22_00_world.sql => 4.3.4/2017_12_26_10_world_from_335_was_2017_12_22_00_world.sql} (100%) rename sql/updates/world/{3.3.5/2017_12_22_01_world.sql => 4.3.4/2017_12_26_11_world_from_335_was_2017_12_22_01_world.sql} (100%) rename sql/updates/world/{3.3.5/2017_12_22_02_world.sql => 4.3.4/2017_12_26_12_world_from_335_was_2017_12_22_02_world.sql} (100%) rename sql/updates/world/{3.3.5/2017_12_24_00_world.sql => 4.3.4/2017_12_26_13_world_from_335_was_2017_12_24_00_world.sql} (100%) rename sql/updates/world/{3.3.5/2017_12_25_00_world.sql => 4.3.4/2017_12_26_14_world_from_335_was_2017_12_25_00_world.sql} (100%) rename sql/updates/world/{3.3.5/2017_12_25_01_world_335.sql => 4.3.4/2017_12_26_15_world_from_335_was_2017_12_25_01_world_335.sql} (99%) diff --git a/sql/updates/world/3.3.5/2017_12_19_00_world.sql b/sql/updates/world/4.3.4/2017_12_26_00_world_from_335_was_2017_12_19_00_world.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_12_19_00_world.sql rename to sql/updates/world/4.3.4/2017_12_26_00_world_from_335_was_2017_12_19_00_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_19_01_world.sql b/sql/updates/world/4.3.4/2017_12_26_01_world_from_335_was_2017_12_19_01_world.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_12_19_01_world.sql rename to sql/updates/world/4.3.4/2017_12_26_01_world_from_335_was_2017_12_19_01_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_20_01_world_335.sql b/sql/updates/world/4.3.4/2017_12_26_02_world_from_335_was_2017_12_20_01_world_335.sql similarity index 98% rename from sql/updates/world/3.3.5/2017_12_20_01_world_335.sql rename to sql/updates/world/4.3.4/2017_12_26_02_world_from_335_was_2017_12_20_01_world_335.sql index 301a3af1afe..d24faaa61d4 100644 --- a/sql/updates/world/3.3.5/2017_12_20_01_world_335.sql +++ b/sql/updates/world/4.3.4/2017_12_26_02_world_from_335_was_2017_12_20_01_world_335.sql @@ -1,5 +1,7 @@ +/* -- UPDATE `creature_template` SET `maxgold` = 1093073 WHERE `entry` = 36855; UPDATE `creature_template` SET `mingold` = 1674308, `maxgold` = 2186146 WHERE `entry` = 38106; UPDATE `creature_template` SET `mingold` = 1925454, `maxgold` = 2514068 WHERE `entry` = 38296; UPDATE `creature_template` SET `mingold` = 2092885, `maxgold` = 2732683 WHERE `entry` = 38297; +*/ diff --git a/sql/updates/world/3.3.5/2017_12_20_02_world_335.sql b/sql/updates/world/4.3.4/2017_12_26_03_world_from_335_was_2017_12_20_02_world_335.sql similarity index 99% rename from sql/updates/world/3.3.5/2017_12_20_02_world_335.sql rename to sql/updates/world/4.3.4/2017_12_26_03_world_from_335_was_2017_12_20_02_world_335.sql index 2bcbe4c26ac..77633df193b 100644 --- a/sql/updates/world/3.3.5/2017_12_20_02_world_335.sql +++ b/sql/updates/world/4.3.4/2017_12_26_03_world_from_335_was_2017_12_20_02_world_335.sql @@ -1,3 +1,4 @@ +/* -- UPDATE `creature_template` SET `maxgold` = 22960 WHERE `entry` = 36829; UPDATE `creature_template` SET `mingold` = 36640, `maxgold` = 45920 WHERE `entry` = 38074; @@ -11,3 +12,4 @@ UPDATE `creature_template` SET `maxgold` = 7599 WHERE `entry` = 37662; UPDATE `creature_template` SET `mingold` = 6720, `maxgold` = 15198 WHERE `entry` = 38102; UPDATE `creature_template` SET `maxgold` = 7617 WHERE `entry` = 36805; UPDATE `creature_template` SET `mingold` = 5346, `maxgold` = 15234 WHERE `entry` = 38075; +*/ diff --git a/sql/updates/world/3.3.5/2017_12_20_03_world_335.sql b/sql/updates/world/4.3.4/2017_12_26_04_world_from_335_was_2017_12_20_03_world_335.sql similarity index 99% rename from sql/updates/world/3.3.5/2017_12_20_03_world_335.sql rename to sql/updates/world/4.3.4/2017_12_26_04_world_from_335_was_2017_12_20_03_world_335.sql index ffd1d87a4e7..405f73eebdf 100644 --- a/sql/updates/world/3.3.5/2017_12_20_03_world_335.sql +++ b/sql/updates/world/4.3.4/2017_12_26_04_world_from_335_was_2017_12_20_03_world_335.sql @@ -1,3 +1,4 @@ +/* -- UPDATE `creature_template` SET `mingold` = 15123, `maxgold` = 19760 WHERE `entry` = 37328; UPDATE `creature_template` SET `mingold` = 15123, `maxgold` = 19760 WHERE `entry` = 37408; @@ -24,3 +25,4 @@ UPDATE `creature_template` SET `mingold` = 4380, `maxgold` = 26180 WHERE `entry` UPDATE `creature_template` SET `mingold` = 570506, `maxgold` = 570506 WHERE `entry` = 38103; UPDATE `creature_template` SET `mingold` = 13390, `maxgold` = 24210 WHERE `entry` = 38197; UPDATE `creature_template` SET `mingold` = 650000, `maxgold` = 700000 WHERE `entry` = 35349; +*/ diff --git a/sql/updates/world/3.3.5/2017_12_20_04_world.sql b/sql/updates/world/4.3.4/2017_12_26_05_world_from_335_was_2017_12_20_04_world.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_12_20_04_world.sql rename to sql/updates/world/4.3.4/2017_12_26_05_world_from_335_was_2017_12_20_04_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_20_05_world.sql b/sql/updates/world/4.3.4/2017_12_26_06_world_from_335_was_2017_12_20_05_world.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_12_20_05_world.sql rename to sql/updates/world/4.3.4/2017_12_26_06_world_from_335_was_2017_12_20_05_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_21_00_world.sql b/sql/updates/world/4.3.4/2017_12_26_07_world_from_335_was_2017_12_21_00_world.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_12_21_00_world.sql rename to sql/updates/world/4.3.4/2017_12_26_07_world_from_335_was_2017_12_21_00_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_21_01_world.sql b/sql/updates/world/4.3.4/2017_12_26_08_world_from_335_was_2017_12_21_01_world.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_12_21_01_world.sql rename to sql/updates/world/4.3.4/2017_12_26_08_world_from_335_was_2017_12_21_01_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_21_02_world.sql b/sql/updates/world/4.3.4/2017_12_26_09_world_from_335_was_2017_12_21_02_world.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_12_21_02_world.sql rename to sql/updates/world/4.3.4/2017_12_26_09_world_from_335_was_2017_12_21_02_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_22_00_world.sql b/sql/updates/world/4.3.4/2017_12_26_10_world_from_335_was_2017_12_22_00_world.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_12_22_00_world.sql rename to sql/updates/world/4.3.4/2017_12_26_10_world_from_335_was_2017_12_22_00_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_22_01_world.sql b/sql/updates/world/4.3.4/2017_12_26_11_world_from_335_was_2017_12_22_01_world.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_12_22_01_world.sql rename to sql/updates/world/4.3.4/2017_12_26_11_world_from_335_was_2017_12_22_01_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_22_02_world.sql b/sql/updates/world/4.3.4/2017_12_26_12_world_from_335_was_2017_12_22_02_world.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_12_22_02_world.sql rename to sql/updates/world/4.3.4/2017_12_26_12_world_from_335_was_2017_12_22_02_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_24_00_world.sql b/sql/updates/world/4.3.4/2017_12_26_13_world_from_335_was_2017_12_24_00_world.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_12_24_00_world.sql rename to sql/updates/world/4.3.4/2017_12_26_13_world_from_335_was_2017_12_24_00_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_25_00_world.sql b/sql/updates/world/4.3.4/2017_12_26_14_world_from_335_was_2017_12_25_00_world.sql similarity index 100% rename from sql/updates/world/3.3.5/2017_12_25_00_world.sql rename to sql/updates/world/4.3.4/2017_12_26_14_world_from_335_was_2017_12_25_00_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_25_01_world_335.sql b/sql/updates/world/4.3.4/2017_12_26_15_world_from_335_was_2017_12_25_01_world_335.sql similarity index 99% rename from sql/updates/world/3.3.5/2017_12_25_01_world_335.sql rename to sql/updates/world/4.3.4/2017_12_26_15_world_from_335_was_2017_12_25_01_world_335.sql index 629c5830be8..ae558e0e232 100644 --- a/sql/updates/world/3.3.5/2017_12_25_01_world_335.sql +++ b/sql/updates/world/4.3.4/2017_12_26_15_world_from_335_was_2017_12_25_01_world_335.sql @@ -1,3 +1,4 @@ +/* -- -- Change weapons of Commander Springvale to the correct pre-cataclysm ones UPDATE `creature_equip_template` SET `ItemID1`=5191, `ItemID2`=1201 WHERE `CreatureID`=4278 AND `ID`=1; @@ -15,3 +16,4 @@ INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, -- Add random movement to Razorclaw the Butcher UPDATE `creature` SET `spawndist`=5, `MovementType`=1 WHERE `guid`=16253; +*/ From 2d1aafe7493a200b8b7399bb09caf99b46b7a366 Mon Sep 17 00:00:00 2001 From: Ovah Date: Wed, 27 Dec 2017 12:17:18 +0000 Subject: [PATCH 34/37] Scripts/LCT: implement Lockmaw and Augh encounter --- .../world/4.3.4/2017_12_27_00_world.sql | 41 ++ .../boss_lockmaw_and_augh.cpp | 619 ++++++++++++++++++ .../instance_lost_city_of_the_tolvir.cpp | 186 +++++- .../lost_city_of_the_tolvir.h | 40 +- 4 files changed, 856 insertions(+), 30 deletions(-) create mode 100644 sql/updates/world/4.3.4/2017_12_27_00_world.sql create mode 100644 src/server/scripts/Kalimdor/LostCityOfTheTolvir/boss_lockmaw_and_augh.cpp diff --git a/sql/updates/world/4.3.4/2017_12_27_00_world.sql b/sql/updates/world/4.3.4/2017_12_27_00_world.sql new file mode 100644 index 00000000000..d3c5399ac37 --- /dev/null +++ b/sql/updates/world/4.3.4/2017_12_27_00_world.sql @@ -0,0 +1,41 @@ +-- Lockmaw +UPDATE `creature_template` SET `difficulty_entry_1`= 49043, `mechanic_immune_mask`= 667893759, `scriptname`= 'boss_lockmaw' WHERE `entry`= 43614; +UPDATE `creature_template` SET `minlevel`= 87, `maxlevel`= 87, `faction`= 16, `exp`= 3, `mechanic_immune_mask`= 667893759 WHERE `entry`= 49043; +-- Dust Flail Front +UPDATE `creature_template` SET `minlevel`= 80, `maxlevel`= 80, `faction`= 14, `unit_flags`= 33554944, `flags_extra`= 128 WHERE `entry`= 43655; +-- Dust Flail Back +UPDATE `creature_template` SET `minlevel`= 85, `maxlevel`= 85, `faction`= 14, `unit_flags`= 33554944, `flags_extra`= 128 WHERE `entry`= 43650; +-- Frenzied Crocolisk +UPDATE `creature_template` SET `minlevel`= 84, `maxlevel`= 84, `difficulty_entry_1`= 49311, `flags_extra`= 256, `scriptname`= 'npc_lockmaw_frenzied_crocolisk' WHERE `entry`= 43658; +UPDATE `creature_template` SET `minlevel`= 85, `maxlevel`= 85, `faction`= 16, `exp`= 3, `flags_extra`= 256 WHERE `entry`= 49311; +-- Augh 1 and 2 +UPDATE `creature_template` SET `unit_flags`= 32832, `mechanic_immune_mask`= 667893759, `scriptname`= 'npc_lockmaw_augh' WHERE `entry` IN (45379, 45378); +-- Augh +UPDATE `creature_template` SET `mechanic_immune_mask`= 667893759, `scriptname`= 'boss_augh' WHERE `entry`= 49045; +-- Add Stalker +UPDATE `creature_template` SET `unit_flags`= 33554432, `flags_extra`= 131 WHERE `entry`= 45124; + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN +('spell_lockmaw_paralytic_blow_dart', +'spell_lockmaw_scent_of_blood', +'spell_lockmaw_random_aggro_taunt'); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(84799, 'spell_lockmaw_paralytic_blow_dart'), +(89989, 'spell_lockmaw_paralytic_blow_dart'), +(81690, 'spell_lockmaw_scent_of_blood'), +(89998, 'spell_lockmaw_scent_of_blood'), +(50230, 'spell_lockmaw_random_aggro_taunt'); + +DELETE FROM `creature_template_addon` WHERE `entry`= 43650; +INSERT INTO `creature_template_addon` (`entry`, `Auras`) VALUES +(43650, '81646'); + +DELETE FROM `creature_text` WHERE `CreatureID`= 49045; +INSERT INTO `creature_text` (`CreatureID`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES +(49045, 0, 0, 'Augh appears from the distance!', 41, 0, 0, 0, 0, 0, 50638, 'Augh - Intro 1'), +(49045, 1, 0, 'GAAAH! How you kill croc?!', 12, 0, 0, 53, 0, 0, 49169, 'Augh - Intro 2'), +(49045, 2, 0, 'Augh smart! Augh already steal treasure while you no looking!', 12, 0, 0, 1, 0, 0, 49170, 'Augh - Intro 3'), +(49045, 3, 0, 'Augh da boss! Oh yeah!', 12, 0, 0, 0, 0, 0, 49171, 'Augh Taunt'), +(49045, 4, 0, 'Augh steal your treasure. Uhn uhn uhnnn!', 12, 0, 0, 0, 0, 0, 49173, 'Augh Taunt'), +(49045, 5, 0, 'Who bad?! Augh bad!! Ugn!', 12, 0, 0, 0, 0, 0, 49172, 'Augh Taunt'); diff --git a/src/server/scripts/Kalimdor/LostCityOfTheTolvir/boss_lockmaw_and_augh.cpp b/src/server/scripts/Kalimdor/LostCityOfTheTolvir/boss_lockmaw_and_augh.cpp new file mode 100644 index 00000000000..937b30df057 --- /dev/null +++ b/src/server/scripts/Kalimdor/LostCityOfTheTolvir/boss_lockmaw_and_augh.cpp @@ -0,0 +1,619 @@ +/* +* Copyright (C) 2008-2017 TrinityCore +* +* This program 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 . +*/ + +#include "ScriptMgr.h" +#include "lost_city_of_the_tolvir.h" +#include "ObjectMgr.h" +#include "Player.h" +#include "ScriptedCreature.h" +#include "SpellAuraEffects.h" +#include "SpellScript.h" + +enum Texts +{ + // Augh Boss + SAY_ANNOUNCE_AUGH_APPEAR = 0, + SAY_AUGH_INTRO_1 = 1, + SAY_AUGH_INTRO_2 = 2, + SAY_AUGH_TAUNT_1 = 3, + SAY_AUGH_TAUNT_2 = 4, + SAY_AUGH_TAUNT_3 = 5 +}; + +enum Spells +{ + // Lockmaw + SPELL_VISCOUS_POISON = 81630, + SPELL_SCENT_OF_BLOOD = 81690, + SPELL_SCENT_OF_BLOOD_HC = 89998, + SPELL_DUST_FLAIL_DUMMY = 81652, + SPELL_DUST_FLAIL = 81642, + SPELL_VENOMOUS_RAGE = 81706, + + // Frenzied Crocolisk + SPELL_STEALTHED = 84244, + + // Augh (Combat Assistance) + SPELL_PARALYTIC_BLOW_DART = 84799, + SPELL_SMOKE_BOMB = 84768, + SPELL_RANDOM_AGGRO_TAUNT = 50230, + SPELL_WHIRLWIND = 84784, + + // Augh (Heroic Boss) + SPELL_DRAGONS_BREATH = 83776, + SPELL_FRENZY = 91415, + SPELL_WHIRLWIND_BOSS = 91408 +}; + +enum Events +{ + // Lockmaw + EVENT_VISCOUS_POISON = 1, + EVENT_SCENT_OF_BLOOD, + EVENT_DUST_FLAIL, + EVENT_MAKE_AGGRESSIVE, + EVENT_SUMMON_CROCOLISK, + EVENT_SUMMON_AUGH, + + // Frenzied Crocolisk + EVENT_FIND_PLAYER_TARGET, + + // Augh (Assistance) + EVENT_ROAR_EMOTE, + EVENT_PARALYTIC_BLOW_DART, + EVENT_SMOKE_BOMB, + EVENT_WHIRLWIND, + EVENT_RANDOM_AGGRO, + EVENT_ATTACK_STOP, + + // Augh Boss + EVENT_MOVE_HOME_POS, + EVENT_TALK_INTRO_1, + EVENT_TALK_INTRO_2, + EVENT_PLAY_EMOTE, + EVENT_MAKE_ATTACKABLE, + EVENT_TALK_TAUNT_1, + EVENT_TALK_TAUNT_2, + EVENT_TALK_TAUNT_3, + EVENT_DRAGONS_BREATH + +}; + +enum Phases +{ + PHASE_INTRO = 1, + PHASE_COMBAT +}; + +enum Actions +{ + ACTION_AUGH_INTRO = 1, + ACTION_AUGH_ATTACKABLE = 2 +}; + +Position const AughMovePoint = { -11062.5f, -1662.39f, 0.7606202f, 0.8028514f }; + +class ScentOfBloodTargetSelector : public std::unary_function +{ +public: + ScentOfBloodTargetSelector() { } + + bool operator()(Unit* unit) const + { + return (!unit->HasAura(SPELL_SCENT_OF_BLOOD) || !unit->HasAura(SPELL_SCENT_OF_BLOOD_HC)); + } +}; + +class boss_lockmaw : public CreatureScript +{ + public: + boss_lockmaw() : CreatureScript("boss_lockmaw") { } + + struct boss_lockmawAI : public BossAI + { + boss_lockmawAI(Creature* creature) : BossAI(creature, DATA_LOCKMAW) + { + Initialize(); + } + + void Initialize() + { + _enraged = false; + _lastSpellID = 0; + } + + void Reset() override + { + instance->SetBossState(DATA_LOCKMAW_AND_AUGH, NOT_STARTED); + instance->SetData(DATA_LOCKMAW_COMBAT_ASSISTANCE, ASSISTANCE_NONE); + _Reset(); + Initialize(); + } + + void EnterCombat(Unit* /*victim*/) override + { + _EnterCombat(); + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me); + events.ScheduleEvent(EVENT_VISCOUS_POISON, Seconds(6)); + events.ScheduleEvent(EVENT_SCENT_OF_BLOOD, Seconds(6)); + events.ScheduleEvent(EVENT_DUST_FLAIL, Seconds(8)); + events.ScheduleEvent(EVENT_SUMMON_AUGH, Seconds(6)); + } + + void JustDied(Unit* /*killer*/) override + { + _JustDied(); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + } + + void EnterEvadeMode(EvadeReason /*why*/) override + { + _EnterEvadeMode(); + summons.DespawnAll(); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + _DespawnAtEvade(); + } + + void JustSummoned(Creature* summon) override + { + summons.Summon(summon); + + if (summon->GetEntry() == NPC_DUST_FLAIL_FRONT_STALKER) + { + me->SetReactState(REACT_PASSIVE); + me->StopMoving(); + me->AttackStop(); + me->SetFacingToObject(summon); + DoCastSelf(SPELL_DUST_FLAIL); + events.ScheduleEvent(EVENT_MAKE_AGGRESSIVE, Seconds(5)); + } + } + + void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) override + { + if (me->HealthBelowPct(30) && !_enraged) + { + DoCastSelf(SPELL_VENOMOUS_RAGE, true); + _enraged = true; + } + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_VISCOUS_POISON: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true, 0)) + DoCast(target, SPELL_VISCOUS_POISON); + events.Repeat(Seconds(26)); + break; + case EVENT_SCENT_OF_BLOOD: + DoCastAOE(SPELL_SCENT_OF_BLOOD, true); + events.ScheduleEvent(EVENT_SCENT_OF_BLOOD, Seconds(30)); + events.ScheduleEvent(EVENT_SUMMON_CROCOLISK, Milliseconds(100)); + break; + case EVENT_SUMMON_CROCOLISK: + instance->SetData(DATA_LOCKMAW_COMBAT_ASSISTANCE, ASSISTANCE_SUMMON_CROCOLISKS); + break; + case EVENT_DUST_FLAIL: + DoCastAOE(SPELL_DUST_FLAIL_DUMMY, true); + events.Repeat(Seconds(39)); + break; + case EVENT_MAKE_AGGRESSIVE: + me->SetReactState(REACT_AGGRESSIVE); + break; + case EVENT_SUMMON_AUGH: + if (_lastSpellID != SPELL_SUMMON_AUGH_DART) + { + _lastSpellID = SPELL_SUMMON_AUGH_DART; + instance->SetData(DATA_LOCKMAW_COMBAT_ASSISTANCE, ASSISTANCE_SUMMON_AUGH_DART); + events.Repeat(Seconds(20)); + } + else + { + _lastSpellID = SPELL_SUMMON_AUGH_WHIRLWIND; + instance->SetData(DATA_LOCKMAW_COMBAT_ASSISTANCE, ASSISTANCE_SUMMON_AUGH_WHIRLWIND); + events.Repeat(Seconds(40)); + } + break; + default: + break; + } + } + DoMeleeAttackIfReady(); + } + private: + bool _enraged; + uint32 _lastSpellID; + }; + CreatureAI* GetAI(Creature* creature) const + { + return GetLostCityOfTheTolvirAI(creature); + } +}; + +class boss_augh : public CreatureScript +{ + public: + boss_augh() : CreatureScript("boss_augh") { } + + struct boss_aughAI : public BossAI + { + boss_aughAI(Creature* creature) : BossAI(creature, DATA_AUGH) { } + + void EnterCombat(Unit* /*victim*/) override + { + _EnterCombat(); + me->HandleEmoteCommand(EMOTE_ONESHOT_NONE); + events.SetPhase(PHASE_COMBAT); + DoCastSelf(SPELL_FRENZY); + events.ScheduleEvent(EVENT_PARALYTIC_BLOW_DART, Seconds(8)); + events.ScheduleEvent(EVENT_WHIRLWIND, Seconds(9)); + events.ScheduleEvent(EVENT_DRAGONS_BREATH, Seconds(6)); + } + + void EnterEvadeMode(EvadeReason /*why*/) override + { + _EnterEvadeMode(); + instance->SetBossState(DATA_AUGH, FAIL); + _DespawnAtEvade(); + } + + void DoAction(int32 action) override + { + switch (action) + { + case ACTION_AUGH_INTRO: + me->SetReactState(REACT_PASSIVE); + Talk(SAY_ANNOUNCE_AUGH_APPEAR); + events.SetPhase(PHASE_INTRO); + events.ScheduleEvent(EVENT_MOVE_HOME_POS, Seconds(1)); + break; + case ACTION_AUGH_ATTACKABLE: + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + break; + default: + break; + } + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim() && !events.IsInPhase(PHASE_INTRO)) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_MOVE_HOME_POS: + me->SetWalk(true); + me->GetMotionMaster()->MovePoint(0, AughMovePoint, true); + events.ScheduleEvent(EVENT_TALK_INTRO_1, Seconds(10) + Milliseconds(500), 0, PHASE_INTRO); + break; + case EVENT_TALK_INTRO_1: + me->SetFacingTo(AughMovePoint.GetOrientation()); + Talk(SAY_AUGH_INTRO_1); + events.ScheduleEvent(EVENT_TALK_INTRO_2, Seconds(4), 0, PHASE_INTRO); + break; + case EVENT_TALK_INTRO_2: + Talk(SAY_AUGH_INTRO_2); + events.ScheduleEvent(EVENT_PLAY_EMOTE, Seconds(3), 0, PHASE_INTRO); + break; + case EVENT_PLAY_EMOTE: + me->HandleEmoteCommand(EMOTE_STATE_SPELL_CHANNEL_OMNI); + events.ScheduleEvent(EVENT_MAKE_ATTACKABLE, Seconds(4), 0, PHASE_INTRO); + events.ScheduleEvent(EVENT_TALK_TAUNT_1, Seconds(5), PHASE_INTRO); + break; + case EVENT_MAKE_ATTACKABLE: + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + break; + case EVENT_TALK_TAUNT_1: + Talk(SAY_AUGH_TAUNT_1); + events.ScheduleEvent(EVENT_TALK_TAUNT_2, Seconds(5), 0, PHASE_INTRO); + break; + case EVENT_TALK_TAUNT_2: + Talk(SAY_AUGH_TAUNT_2); + events.ScheduleEvent(EVENT_TALK_TAUNT_3, Seconds(5), 0, PHASE_INTRO); + break; + case EVENT_TALK_TAUNT_3: + Talk(SAY_AUGH_TAUNT_3); + break; + case EVENT_PARALYTIC_BLOW_DART: + DoCastAOE(SPELL_PARALYTIC_BLOW_DART); + events.Repeat(Seconds(10), Seconds(15)); + break; + case EVENT_WHIRLWIND: + DoCastAOE(SPELL_RANDOM_AGGRO_TAUNT, true); + DoCastSelf(SPELL_WHIRLWIND_BOSS); + events.Repeat(Seconds(29)); + break; + case EVENT_DRAGONS_BREATH: + DoCastAOE(SPELL_DRAGONS_BREATH); + events.Repeat(Seconds(28)); + break; + default: + break; + } + } + DoMeleeAttackIfReady(); + } + }; + CreatureAI* GetAI(Creature* creature) const + { + return GetLostCityOfTheTolvirAI(creature); + } +}; + +class npc_lockmaw_frenzied_crocolisk : public CreatureScript +{ + public: + npc_lockmaw_frenzied_crocolisk() : CreatureScript("npc_lockmaw_frenzied_crocolisk") { } + + struct npc_lockmaw_frenzied_crocoliskAI : public ScriptedAI + { + npc_lockmaw_frenzied_crocoliskAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { } + + void JustDied(Unit* /*killer*/) override + { + me->DespawnOrUnsummon(Seconds(5)); + } + + void IsSummonedBy(Unit* summoner) override + { + if (Creature* lockmaw = _instance->GetCreature(DATA_LOCKMAW)) + lockmaw->AI()->JustSummoned(me); + me->SetReactState(REACT_PASSIVE); + DoZoneInCombat(); + _events.ScheduleEvent(EVENT_FIND_PLAYER_TARGET, Seconds(1)); + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_FIND_PLAYER_TARGET: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, ScentOfBloodTargetSelector())) + { + DoCastSelf(SPELL_STEALTHED); + me->AI()->AttackStart(target); + me->AddThreat(target, 50000000.0f); + } + break; + default: + break; + } + } + DoMeleeAttackIfReady(); + } + + private: + EventMap _events; + InstanceScript* _instance; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetLostCityOfTheTolvirAI(creature); + } +}; + +class npc_lockmaw_augh : public CreatureScript +{ + public: + npc_lockmaw_augh() : CreatureScript("npc_lockmaw_augh") { } + + struct npc_lockmaw_aughAI : public ScriptedAI + { + npc_lockmaw_aughAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { } + + void IsSummonedBy(Unit* /*summoner*/) override + { + if (Creature* lockmaw = _instance->GetCreature(DATA_LOCKMAW)) + lockmaw->AI()->JustSummoned(me); + + DoCastSelf(SPELL_STEALTHED, true); + + if (me->GetEntry() == NPC_AUGH_DART) + { + me->SetReactState(REACT_PASSIVE); + _events.ScheduleEvent(EVENT_ROAR_EMOTE, Seconds(7)); + _events.ScheduleEvent(EVENT_PARALYTIC_BLOW_DART, Seconds(8)); + _events.ScheduleEvent(EVENT_SMOKE_BOMB, Seconds(12)); + } + else + _events.ScheduleEvent(EVENT_WHIRLWIND, Seconds(4)); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage) override + { + // There is indeed now immunity aura... + damage = 0; + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_ROAR_EMOTE: + me->HandleEmoteCommand(EMOTE_ONESHOT_BATTLE_ROAR); + break; + case EVENT_PARALYTIC_BLOW_DART: + DoCastAOE(SPELL_PARALYTIC_BLOW_DART); + break; + case EVENT_SMOKE_BOMB: + DoCastSelf(SPELL_SMOKE_BOMB); + me->DespawnOrUnsummon(Seconds(3)); + break; + case EVENT_WHIRLWIND: + DoCastAOE(SPELL_RANDOM_AGGRO_TAUNT, true); + DoCastSelf(SPELL_WHIRLWIND); + _events.ScheduleEvent(EVENT_RANDOM_AGGRO, Seconds(10)); + break; + case EVENT_RANDOM_AGGRO: + DoCastAOE(SPELL_RANDOM_AGGRO_TAUNT, true); + _events.ScheduleEvent(EVENT_ATTACK_STOP, Seconds(10)); + break; + case EVENT_ATTACK_STOP: + me->AttackStop(); + me->SetReactState(REACT_PASSIVE); + me->DespawnOrUnsummon(Seconds(6)); + break; + default: + break; + } + } + } + private: + EventMap _events; + InstanceScript* _instance; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetLostCityOfTheTolvirAI(creature); + } +}; + +class spell_lockmaw_scent_of_blood : public SpellScriptLoader +{ + public: + spell_lockmaw_scent_of_blood() : SpellScriptLoader("spell_lockmaw_scent_of_blood") { } + + class spell_lockmaw_scent_of_blood_SpellScript : public SpellScript + { + PrepareSpellScript(spell_lockmaw_scent_of_blood_SpellScript); + + void FilterTargets(std::list& targets) + { + if (targets.empty()) + return; + + Trinity::Containers::RandomResize(targets, 1); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_lockmaw_scent_of_blood_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_lockmaw_scent_of_blood_SpellScript(); + } +}; + +class spell_lockmaw_paralytic_blow_dart : public SpellScriptLoader +{ + public: + spell_lockmaw_paralytic_blow_dart() : SpellScriptLoader("spell_lockmaw_paralytic_blow_dart") { } + + class spell_lockmaw_paralytic_blow_dart_SpellScript : public SpellScript + { + PrepareSpellScript(spell_lockmaw_paralytic_blow_dart_SpellScript); + + void FilterTargets(std::list& targets) + { + if (targets.empty()) + return; + + Trinity::Containers::RandomResize(targets, 1); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_lockmaw_paralytic_blow_dart_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_lockmaw_paralytic_blow_dart_SpellScript(); + } +}; + +class spell_lockmaw_random_aggro_taunt : public SpellScriptLoader +{ + public: + spell_lockmaw_random_aggro_taunt() : SpellScriptLoader("spell_lockmaw_random_aggro_taunt") { } + + class spell_lockmaw_random_aggro_taunt_SpellScript : public SpellScript + { + PrepareSpellScript(spell_lockmaw_random_aggro_taunt_SpellScript); + + void FilterTargets(std::list& targets) + { + if (targets.empty()) + return; + + Trinity::Containers::RandomResize(targets, 1); + } + + void EffectScriptEffect(SpellEffIndex /*effIndex*/) + { + GetHitPlayer()->CastSpell(GetCaster(), GetSpellInfo()->Effects[EFFECT_0].BasePoints, true); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_lockmaw_random_aggro_taunt_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_lockmaw_random_aggro_taunt_SpellScript::EffectScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_lockmaw_random_aggro_taunt_SpellScript(); + } +}; + +void AddSC_boss_lockmaw_and_augh() +{ + new boss_lockmaw(); + new boss_augh(); + new npc_lockmaw_frenzied_crocolisk(); + new npc_lockmaw_augh(); + new spell_lockmaw_scent_of_blood(); + new spell_lockmaw_paralytic_blow_dart(); + new spell_lockmaw_random_aggro_taunt(); +} diff --git a/src/server/scripts/Kalimdor/LostCityOfTheTolvir/instance_lost_city_of_the_tolvir.cpp b/src/server/scripts/Kalimdor/LostCityOfTheTolvir/instance_lost_city_of_the_tolvir.cpp index ea3be9c72c2..992b482dca6 100644 --- a/src/server/scripts/Kalimdor/LostCityOfTheTolvir/instance_lost_city_of_the_tolvir.cpp +++ b/src/server/scripts/Kalimdor/LostCityOfTheTolvir/instance_lost_city_of_the_tolvir.cpp @@ -19,6 +19,26 @@ #include "InstanceScript.h" #include "lost_city_of_the_tolvir.h" +enum TimedEvents +{ + EVENT_SPAWN_AUGH = 1 +}; + +enum SummonGroups +{ + SUMMON_GROUP_WIND_TUNNEL = 0 +}; + +enum Actions +{ + // Lockmaw and Augh + ACTION_AUGH_INTRO = 1, + ACTION_AUGH_ATTACKABLE = 2 +}; + +Position const AughSpawnPos = { -11058.91f, -1625.342f, -0.1304993f, 4.782202f }; +Position const AughHomePos = { -11062.5f, -1662.39f, 0.7606202f, 0.8028514f }; + ObjectData const creatureData[] = { { BOSS_GENERAL_HUSAM, DATA_GENERAL_HUSAM }, @@ -28,7 +48,7 @@ ObjectData const creatureData[] = { BOSS_SIAMAT, DATA_SIAMAT }, { NPC_BLAZE_OF_THE_HEAVENS, DATA_BLAZE_OF_THE_HEAVENS }, { NPC_HARBINGER_OF_DARKNESS, DATA_HARBINGER_OF_DARKNESS }, - { 0, 0 } // End + { 0, 0 } // End }; ObjectData const gameObjectData[] = @@ -39,31 +59,155 @@ ObjectData const gameObjectData[] = class instance_lost_city_of_the_tolvir : public InstanceMapScript { -public: - instance_lost_city_of_the_tolvir() : InstanceMapScript(LCTScriptName, 755) { } + public: + instance_lost_city_of_the_tolvir() : InstanceMapScript(LCTScriptName, 755) { } - struct instance_lost_city_of_the_tolvir_InstanceMapScript : public InstanceScript - { - instance_lost_city_of_the_tolvir_InstanceMapScript(Map* map) : InstanceScript(map) + struct instance_lost_city_of_the_tolvir_InstanceMapScript : public InstanceScript { - SetHeaders(DataHeader); - SetBossNumber(EncounterCount); - LoadObjectData(creatureData, gameObjectData); - } + instance_lost_city_of_the_tolvir_InstanceMapScript(Map* map) : InstanceScript(map) + { + SetHeaders(DataHeader); + SetBossNumber(EncounterCount); + LoadObjectData(creatureData, gameObjectData); + Initialize(); + } - bool SetBossState(uint32 type, EncounterState state) override + void Initialize() + { + _heroicAughSpawned = false; + } + + void OnCreatureCreate(Creature* creature) override + { + InstanceScript::OnCreatureCreate(creature); + + if (creature->GetEntry() == NPC_ADD_STALKER) + addStalkerGUIDs.push_back(creature->GetGUID()); + } + + bool SetBossState(uint32 type, EncounterState state) override + { + if (!InstanceScript::SetBossState(type, state)) + return false; + + switch (type) + { + case DATA_LOCKMAW: + if (!instance->IsHeroic() && state == DONE) + SetBossState(DATA_LOCKMAW_AND_AUGH, DONE); + else if (instance->IsHeroic() && state == DONE && !_heroicAughSpawned) + _events.ScheduleEvent(EVENT_SPAWN_AUGH, Seconds(4)); + break; + case DATA_AUGH: // Since Augh is summoned, we need to handle his respawn here + if (state == DONE) + SetBossState(DATA_LOCKMAW_AND_AUGH, DONE); + else if (state == FAIL) + _events.ScheduleEvent(EVENT_SPAWN_AUGH, Seconds(30)); + break; + case DATA_GENERAL_HUSAM: + case DATA_LOCKMAW_AND_AUGH: + case DATA_HIGH_PROPHET_BARIM: + if (state == DONE && CheckSiamatsPlatform()) + { + if (GameObject* platform = GetGameObject(DATA_SIAMAT_PLATFORM)) + { + platform->setActive(true); + platform->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); + platform->EnableCollision(true); + } + + instance->SetZoneWeather(ZONE_ID_LOST_CITY, WEATHER_STATE_HEAVY_RAIN, 1.0f); + instance->SummonCreatureGroup(SUMMON_GROUP_WIND_TUNNEL); + } + break; + default: + break; + } + return true; + } + + void SetData(uint32 data, uint32 value) override + { + switch (data) + { + case DATA_LOCKMAW_COMBAT_ASSISTANCE: + switch (value) + { + case ASSISTANCE_SUMMON_AUGH_DART: + if (Unit* stalker = instance->GetCreature(Trinity::Containers::SelectRandomContainerElement(addStalkerGUIDs))) + stalker->CastSpell(stalker, SPELL_SUMMON_AUGH_DART); + SetData(DATA_LOCKMAW_COMBAT_ASSISTANCE, ASSISTANCE_NONE); + break; + case ASSISTANCE_SUMMON_AUGH_WHIRLWIND: + if (Unit* stalker = instance->GetCreature(Trinity::Containers::SelectRandomContainerElement(addStalkerGUIDs))) + stalker->CastSpell(stalker, SPELL_SUMMON_AUGH_WHIRLWIND); + SetData(DATA_LOCKMAW_COMBAT_ASSISTANCE, ASSISTANCE_NONE); + break; + case ASSISTANCE_SUMMON_CROCOLISKS: + { + GuidVector tempList = addStalkerGUIDs; + if (!tempList.empty()) + { + Trinity::Containers::RandomResize(tempList, 4); + for (auto itr = tempList.begin(); itr != tempList.end(); itr++) + if (Unit* stalker = instance->GetCreature(*itr)) + stalker->CastSpell(stalker, SPELL_SUMMON_CROCOLISK); + } + SetData(DATA_LOCKMAW_COMBAT_ASSISTANCE, ASSISTANCE_NONE); + break; + } + default: + break; + } + break; + default: + break; + } + } + + bool CheckSiamatsPlatform() + { + for (LCTDataTypes boss : { DATA_GENERAL_HUSAM, DATA_LOCKMAW_AND_AUGH, DATA_HIGH_PROPHET_BARIM }) + if (GetBossState(boss) != DONE) + return false; + return true; + } + + void Update(uint32 diff) override + { + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_SPAWN_AUGH: + if (!_heroicAughSpawned) + { + if (Creature* augh = instance->SummonCreature(BOSS_AUGH, AughSpawnPos)) + augh->AI()->DoAction(ACTION_AUGH_INTRO); + _heroicAughSpawned = true; + } + else if (_heroicAughSpawned) + if (Creature* augh = instance->SummonCreature(BOSS_AUGH, AughHomePos)) + augh->AI()->DoAction(ACTION_AUGH_ATTACKABLE); + break; + default: + break; + } + } + } + + protected: + EventMap events; + bool heroicAughSpawned; + GuidVector addStalkerGUIDs; + }; + + InstanceScript* GetInstanceScript(InstanceMap* map) const override { - if (!InstanceScript::SetBossState(type, state)) - return false; - - return true; + return new instance_lost_city_of_the_tolvir_InstanceMapScript(map); } - }; - - InstanceScript* GetInstanceScript(InstanceMap* map) const override - { - return new instance_lost_city_of_the_tolvir_InstanceMapScript(map); - } }; void AddSC_instance_lost_city_of_the_tolvir() diff --git a/src/server/scripts/Kalimdor/LostCityOfTheTolvir/lost_city_of_the_tolvir.h b/src/server/scripts/Kalimdor/LostCityOfTheTolvir/lost_city_of_the_tolvir.h index 1107ed69346..db66b5c2038 100644 --- a/src/server/scripts/Kalimdor/LostCityOfTheTolvir/lost_city_of_the_tolvir.h +++ b/src/server/scripts/Kalimdor/LostCityOfTheTolvir/lost_city_of_the_tolvir.h @@ -21,21 +21,23 @@ #define LCTScriptName "instance_lost_city_of_the_tolvir" #define DataHeader "LCT" -uint32 const EncounterCount = 4; +uint32 const EncounterCount = 6; enum LCTDataTypes { // Encounter States - DATA_GENERAL_HUSAM = 1, - DATA_LOCKMAW = 2, - DATA_AUGH = 3, - DATA_HIGH_PROPHET_BARIM = 4, - DATA_SIAMAT = 5, + DATA_GENERAL_HUSAM = 0, + DATA_LOCKMAW_AND_AUGH = 1, + DATA_HIGH_PROPHET_BARIM = 2, + DATA_SIAMAT = 3, + DATA_LOCKMAW = 4, + DATA_AUGH = 5, // Additional Data - DATA_SIAMAT_PLATFORM = 6, - DATA_BLAZE_OF_THE_HEAVENS = 7, - DATA_HARBINGER_OF_DARKNESS = 8, + DATA_SIAMAT_PLATFORM = 6, + DATA_BLAZE_OF_THE_HEAVENS = 7, + DATA_HARBINGER_OF_DARKNESS = 8, + DATA_LOCKMAW_COMBAT_ASSISTANCE = 9 }; enum LCTCreatureIds @@ -56,6 +58,9 @@ enum LCTCreatureIds NPC_BLAZE_OF_THE_HEAVENS = 48906, NPC_SOUL_FRAGMENT = 43934, NPC_HARBINGER_OF_DARKNESS = 43927, + NPC_DUST_FLAIL_FRONT_STALKER = 43655, + NPC_ADD_STALKER = 45124, + NPC_AUGH_DART = 45379 }; enum LCTGameObjectIds @@ -63,6 +68,23 @@ enum LCTGameObjectIds GO_SIAMAT_PLATFORM = 205365 }; +enum LCTSpells +{ + SPELL_SUMMON_CROCOLISK = 84242, + SPELL_SUMMON_AUGH_DART = 84809, + SPELL_SUMMON_AUGH_WHIRLWIND = 84808 +}; + +enum LCTMisc +{ + ZONE_ID_LOST_CITY = 5396, + + ASSISTANCE_NONE = 0, + ASSISTANCE_SUMMON_AUGH_DART = 1, + ASSISTANCE_SUMMON_AUGH_WHIRLWIND = 2, + ASSISTANCE_SUMMON_CROCOLISKS = 3 +}; + template AI* GetLostCityOfTheTolvirAI(Creature* creature) { From 4e9b65f5731179e1bb2c20f9f9d50cacb9a12085 Mon Sep 17 00:00:00 2001 From: Ovah Date: Wed, 27 Dec 2017 12:43:15 +0000 Subject: [PATCH 35/37] Scripts/Gilneas: --- .../world/4.3.4/2017_12_27_01_world.sql | 77 ++++++++++ .../EasternKingdoms/Gilneas/chapter1.cpp | 143 ++++++++++++++++++ .../eastern_kingdoms_script_loader.cpp | 2 + src/server/scripts/Spells/spell_quest.cpp | 37 +++++ 4 files changed, 259 insertions(+) create mode 100644 sql/updates/world/4.3.4/2017_12_27_01_world.sql create mode 100644 src/server/scripts/EasternKingdoms/Gilneas/chapter1.cpp diff --git a/sql/updates/world/4.3.4/2017_12_27_01_world.sql b/sql/updates/world/4.3.4/2017_12_27_01_world.sql new file mode 100644 index 00000000000..fa1c7a8761f --- /dev/null +++ b/sql/updates/world/4.3.4/2017_12_27_01_world.sql @@ -0,0 +1,77 @@ +DELETE FROM `spell_area` WHERE `spell`= 59073 AND `area` IN (4756, 4755, 4757, 4714); +INSERT INTO `spell_area` (`spell`, `area`, `gender`, `quest_start`, `quest_start_status`, `autocast`, `quest_end`, `quest_end_status`) VALUES +(59073, 4756, 2, 14078, 64, 1, 14159, 1|2|8|32), +(59073, 4755, 2, 14099, 2|64, 1, 14159, 1|2|8|32), +(59073, 4757, 2, 14099, 2|64, 1, 14159, 1|2|8|32), +(59073, 4714, 2, 14099, 2|64, 1, 14159, 1|2|8|32); + +DELETE FROM `spell_area` WHERE `spell`= 49416 AND `area`= 4756; +INSERT INTO `spell_area` (`spell`, `area`, `gender`, `quest_start`, `quest_start_status`, `autocast`, `quest_end`, `quest_end_status`) VALUES +(49416, 4756, 2, 14078, 64, 1, 14099, 1|8|32); + +-- Generic NPC phasing fixups +UPDATE `creature` SET `phaseId`= 0, `phaseGroup`= 371 WHERE `id` IN (39095, 34863); + +-- Generic trigger bunny (multiphase) +UPDATE `creature` SET `phaseId`= 0, `phaseGroup`= 372 WHERE `id` IN (35374, 35830, 35010, 35011) AND `map`= 654 AND `areaId`= 4756; + +-- Conditions +DELETE FROM `conditions` WHERE `SourceEntry` IN (68087, 68070, 80281) AND `SourceTypeOrReferenceId`= 13; +INSERT INTO conditions (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ScriptName`, `Comment`) VALUES +(13, 1, 68087, 0, 0, 31, 0, 3, 35374, 0, 0, 0, '', 'Just Citizen'), +(13, 1, 80281, 0, 0, 31, 0, 3, 35374, 0, 0, 0, '', 'Summon Citizen and Worgen'), +(13, 3, 68070, 0, 0, 31, 0, 3, 35374, 0, 0, 0, '', 'Summon Citizen and Worgen'); + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ( +'spell_q14098_knocking_67869'); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(67869, 'spell_q14098_knocking_67869'); + +DELETE FROM `smart_scripts` WHERE `entryorguid`= 34981; +UPDATE `creature_template` SET `AIName`= '', `ScriptName`= 'npc_frightened_citizen' WHERE `entry` IN (34981, 35836); + +-- Rampaging Worgen fixups +UPDATE `creature_template` SET `flags_extra` = `flags_extra` | 2 WHERE `entry`= 34884; + +-- Merchant Square Quest Chain +DELETE FROM `quest_template_addon` WHERE `ID` IN (14093, 14098, 14099, 14094); +INSERT INTO `quest_template_addon` (`ID`, `PrevQuestID`, `NextQuestID`, `ExclusiveGroup`) VALUES +(14093, 14091, 0, -14093), +(14098, 14091, 0, -14093), +(14094, 14091, 0, -14093), +(14099, 14093, 0, 0); -- Royal Orders + +-- Remove questgiver entry from rampaging worgens +DELETE FROM `creature_queststarter` WHERE `id`= 34884; + +DELETE FROM `creature_text` WHERE `CreatureID` IN (34981, 35836, 34913); +INSERT INTO `creature_text` (`CreatureID`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES +-- Frightened Citizen +(34981, 0, 0, 'What in the world? Let''s get out of here!', 12, 0, 100, 1, 0, 0, 35235, 'Frightened Citizen to Player'), +(34981, 0, 1, 'Let''s go!', 12, 0, 100, 1, 0, 0, 35236, 'Frightened Citizen to Player'), +(34981, 0, 2, 'No time to waste!', 12, 0, 100, 1, 0, 0, 35237, 'Frightened Citizen to Player'), +(34981, 0, 3, 'Worgen! Worgen everywhere!', 12, 0, 100, 1, 0, 0, 35238, 'Frightened Citizen to Player'), +(34981, 0, 4, 'Flee! They''re everywhere!', 12, 0, 100, 1, 0, 0, 35240, 'Frightened Citizen to Player'), +(34981, 0, 5, 'This place isn''t safe. Let''s leave!', 12, 0, 100, 1, 0, 0, 35239, 'Frightened Citizen to Player'), +(34981, 0, 6, 'Protect me, please!', 12, 0, 100, 1, 0, 0, 35234, 'Frightened Citizen to Player'), +(35836, 0, 0, 'It''s coming right for me!!', 12, 0, 100, 1, 0, 0, 36037, 'Frightened Citizen to Player'), +(35836, 0, 1, 'Help me, please!', 12, 0, 100, 1, 0, 0, 36038, 'Frightened Citizen to Player'), +(35836, 0, 2, 'There''s one after me!', 12, 0, 100, 1, 0, 0, 36039, 'Frightened Citizen to Player'), +(35836, 0, 3, 'Help!', 12, 0, 100, 1, 0, 0, 36040, 'Frightened Citizen to Player'), +(35836, 0, 4, 'I don''t want to die!', 12, 0, 100, 1, 0, 0, 36041, 'Frightened Citizen to Player'), +-- Liam Greyman Phase 170 +(34913, 0, 0, 'Stand your ground, men!', 14, 0, 100, 0, 0, 19617, 35166, 'Prince Liam Greymane'), +(34913, 0, 1, 'Defeat these foul beasts!', 14, 0, 100, 0, 0, 19618, 35167, 'Prince Liam Greymane'), +(34913, 0, 2, 'Protect the civilians!', 14, 0, 100, 0, 0, 19619, 35168, 'Prince Liam Greymane'), +(34913, 0, 3, 'Push them back!', 14, 0, 100, 0, 0, 19620, 35169, 'Prince Liam Greymane'), +(34913, 0, 4, 'Take heart, men! We must protect our city!', 14, 0, 100, 0, 0, 19621, 35170, 'Prince Liam Greymane'); + +-- Creature Prince Liam Greymane 34913 SAI +SET @ENTRY := 34913; +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, 4, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "On aggro - None: Talk 0 // "); + +UPDATE `gameobject_template_addon` SET `flags`= 4 WHERE `entry`= 195306; diff --git a/src/server/scripts/EasternKingdoms/Gilneas/chapter1.cpp b/src/server/scripts/EasternKingdoms/Gilneas/chapter1.cpp new file mode 100644 index 00000000000..64dff86ab65 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Gilneas/chapter1.cpp @@ -0,0 +1,143 @@ +/* +* Copyright (C) 2008-2017 TrinityCore +* +* This program 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 . +*/ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Vehicle.h" +#include "ObjectMgr.h" +#include "ScriptedEscortAI.h" +#include "CombatAI.h" +#include "PassiveAI.h" +#include "Player.h" +#include "SpellInfo.h" +#include "CreatureTextMgr.h" +#include "MoveSplineInit.h" +#include "GameObjectAI.h" + +/*###### +##Quest 14098 - Evacuate the Merchant Place +######*/ + +enum FrightenedCitizen +{ + SAY_FRIGHTENED_CITIZEN_RESCUE = 0, + + NPC_EVACUATION_STALKER_FIRST = 35830, + NPC_EVACUATION_STALKER_NEAR = 35010, + NPC_EVACUATION_STALKER_FAR = 35011, + NPC_RAMPAGING_WORGEN = 35660, + + CREDIT_35830 = 35830, + + POINT_STALKER_FIRST = 1, + POINT_STALKER_NEAR = 2, + POINT_STALKER_FAR = 3, + + EVENT_TALK_FRIGHTENED = 1, + EVENT_MOVE_TO_NEAR_STALKER = 2, + EVENT_MOVE_TO_FAR_STALKER = 3, + EVENT_DESPAWN = 4 +}; + +class npc_frightened_citizen : public CreatureScript +{ +public: + npc_frightened_citizen() : CreatureScript("npc_frightened_citizen") { } + + struct npc_frightened_citizenAI : public PassiveAI + { + npc_frightened_citizenAI(Creature* creature) : PassiveAI(creature) { } + + void IsSummonedBy(Unit* /*summoner*/) override + { + if (Creature* stalkerNear = me->FindNearestCreature(NPC_EVACUATION_STALKER_FIRST, 25.0f)) + me->GetMotionMaster()->MovePoint(POINT_STALKER_FIRST, stalkerNear->GetPosition(), true); + } + + void MovementInform(uint32 type, uint32 id) override + { + if (type != POINT_MOTION_TYPE) + return; + + switch (id) + { + case POINT_STALKER_FIRST: + _events.ScheduleEvent(EVENT_TALK_FRIGHTENED, Seconds(1)); + break; + case POINT_STALKER_NEAR: + _events.ScheduleEvent(EVENT_MOVE_TO_FAR_STALKER, Milliseconds(1)); + break; + case POINT_STALKER_FAR: + _events.ScheduleEvent(EVENT_DESPAWN, Milliseconds(1)); + break; + default: + break; + } + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_TALK_FRIGHTENED: + if (Unit* summoner = me->ToTempSummon()->GetSummoner()) + { + if (Player* player = summoner->ToPlayer()) + { + player->KilledMonsterCredit(CREDIT_35830); + Talk(SAY_FRIGHTENED_CITIZEN_RESCUE, summoner); + } + } + _events.ScheduleEvent(EVENT_MOVE_TO_NEAR_STALKER, Seconds(2)); + break; + case EVENT_MOVE_TO_NEAR_STALKER: + if (Creature* stalker = me->FindNearestCreature(NPC_EVACUATION_STALKER_FAR, 50.0f)) + me->GetMotionMaster()->MovePoint(POINT_STALKER_FAR, stalker->GetPosition(), true); + else if (Creature* stalker = me->FindNearestCreature(NPC_EVACUATION_STALKER_NEAR, 100.0f)) + me->GetMotionMaster()->MovePoint(POINT_STALKER_NEAR, stalker->GetPosition(), true); + break; + case EVENT_MOVE_TO_FAR_STALKER: + if (Creature* stalker = me->FindNearestCreature(NPC_EVACUATION_STALKER_FAR, 500.0f)) + me->GetMotionMaster()->MovePoint(POINT_STALKER_FAR, stalker->GetPosition(), true); + break; + case EVENT_DESPAWN: + me->DespawnOrUnsummon(); + break; + default: + break; + } + } + } + private: + EventMap _events; + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_frightened_citizenAI(creature); + } +}; + +void AddSC_gilneas_c1() +{ + new npc_frightened_citizen(); +} diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp index bdef2ad9f51..509c75ccb91 100644 --- a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp @@ -70,6 +70,7 @@ void AddSC_instance_blackwing_lair(); void AddSC_deadmines(); //Deadmines void AddSC_instance_deadmines(); void AddSC_boss_mr_smite(); +void AddSC_gilneas_c1(); //Gilneas void AddSC_gnomeregan(); //Gnomeregan void AddSC_instance_gnomeregan(); void AddSC_boss_attumen(); //Karazhan @@ -260,6 +261,7 @@ void AddEasternKingdomsScripts() AddSC_deadmines(); //Deadmines AddSC_boss_mr_smite(); AddSC_instance_deadmines(); + AddSC_gilneas_c1(); //Gilneas AddSC_gnomeregan(); //Gnomeregan AddSC_instance_gnomeregan(); AddSC_boss_attumen(); //Karazhan diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 3cef4f91828..7188a69e4f9 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2752,6 +2752,42 @@ public: } }; +class spell_q14098_knocking_67869 : public SpellScriptLoader +{ +public: + spell_q14098_knocking_67869() : SpellScriptLoader("spell_q14098_knocking_67869") { } + + class spell_q14098_knocking_67869_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q14098_knocking_67869_SpellScript); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo( + { + uint32(spellInfo->Effects[EFFECT_1].BasePoints), + uint32(spellInfo->Effects[EFFECT_2].BasePoints) + }); + } + + void HandleEffect(SpellEffIndex /*effIndex*/) + { + if (SpellInfo const* spellInfo = GetSpellInfo()) + GetCaster()->CastSpell(GetCaster(), spellInfo->Effects[RAND(0, 1) == 0 ? EFFECT_1 : EFFECT_2].BasePoints, true); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_q14098_knocking_67869_SpellScript::HandleEffect, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_q14098_knocking_67869_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -2820,4 +2856,5 @@ void AddSC_quest_spell_scripts() new spell_q11306_mixing_vrykul_blood(); new spell_q11306_failed_mix_43376(); new spell_q11306_failed_mix_43378(); + new spell_q14098_knocking_67869(); } From 38aacc896746bddc9ee89aa6b0da2c1c1f1ea6bc Mon Sep 17 00:00:00 2001 From: Aokromes Date: Wed, 27 Dec 2017 14:07:18 +0100 Subject: [PATCH 36/37] Build Fix --- .../instance_lost_city_of_the_tolvir.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/server/scripts/Kalimdor/LostCityOfTheTolvir/instance_lost_city_of_the_tolvir.cpp b/src/server/scripts/Kalimdor/LostCityOfTheTolvir/instance_lost_city_of_the_tolvir.cpp index 992b482dca6..6619b708f2f 100644 --- a/src/server/scripts/Kalimdor/LostCityOfTheTolvir/instance_lost_city_of_the_tolvir.cpp +++ b/src/server/scripts/Kalimdor/LostCityOfTheTolvir/instance_lost_city_of_the_tolvir.cpp @@ -72,9 +72,9 @@ class instance_lost_city_of_the_tolvir : public InstanceMapScript Initialize(); } - void Initialize() + void Initialize() override { - _heroicAughSpawned = false; + heroicAughSpawned = false; } void OnCreatureCreate(Creature* creature) override @@ -95,14 +95,14 @@ class instance_lost_city_of_the_tolvir : public InstanceMapScript case DATA_LOCKMAW: if (!instance->IsHeroic() && state == DONE) SetBossState(DATA_LOCKMAW_AND_AUGH, DONE); - else if (instance->IsHeroic() && state == DONE && !_heroicAughSpawned) - _events.ScheduleEvent(EVENT_SPAWN_AUGH, Seconds(4)); + else if (instance->IsHeroic() && state == DONE && !heroicAughSpawned) + events.ScheduleEvent(EVENT_SPAWN_AUGH, Seconds(4)); break; case DATA_AUGH: // Since Augh is summoned, we need to handle his respawn here if (state == DONE) SetBossState(DATA_LOCKMAW_AND_AUGH, DONE); else if (state == FAIL) - _events.ScheduleEvent(EVENT_SPAWN_AUGH, Seconds(30)); + events.ScheduleEvent(EVENT_SPAWN_AUGH, Seconds(30)); break; case DATA_GENERAL_HUSAM: case DATA_LOCKMAW_AND_AUGH: @@ -175,20 +175,20 @@ class instance_lost_city_of_the_tolvir : public InstanceMapScript void Update(uint32 diff) override { - _events.Update(diff); + events.Update(diff); - while (uint32 eventId = _events.ExecuteEvent()) + while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_SPAWN_AUGH: - if (!_heroicAughSpawned) + if (!heroicAughSpawned) { if (Creature* augh = instance->SummonCreature(BOSS_AUGH, AughSpawnPos)) augh->AI()->DoAction(ACTION_AUGH_INTRO); - _heroicAughSpawned = true; + heroicAughSpawned = true; } - else if (_heroicAughSpawned) + else if (heroicAughSpawned) if (Creature* augh = instance->SummonCreature(BOSS_AUGH, AughHomePos)) augh->AI()->DoAction(ACTION_AUGH_ATTACKABLE); break; From e7152e828a514fb73be55ded21fcf86eb5f6ee94 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Wed, 27 Dec 2017 15:41:28 +0100 Subject: [PATCH 37/37] DB/LCT: added loot to General Husam and Siamat By Ovahlord --- .../world/4.3.4/2017_12_27_02_world.sql | 53 +++++++++++++++++++ .../boss_lockmaw_and_augh.cpp | 2 +- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/4.3.4/2017_12_27_02_world.sql diff --git a/sql/updates/world/4.3.4/2017_12_27_02_world.sql b/sql/updates/world/4.3.4/2017_12_27_02_world.sql new file mode 100644 index 00000000000..3a4df6c287e --- /dev/null +++ b/sql/updates/world/4.3.4/2017_12_27_02_world.sql @@ -0,0 +1,53 @@ +-- General Husam +UPDATE creature_template SET `difficulty_entry_1` = 48932, `lootid` = 44577 WHERE `entry` = 44577; +DELETE FROM `creature_loot_template` WHERE entry IN (44577, 48932); +INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Chance`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`) VALUES +(44577, 55858, 0, 1, 1, 1, 1), +(44577, 55857, 0, 1, 1, 1, 1), +(44577, 55856, 0, 1, 1, 1, 1), +(44577, 55859, 0, 1, 1, 1, 1), +(44577, 55860, 0, 1, 1, 1, 1); + +UPDATE `creature_template` SET `lootid` = 48932 WHERE `entry` = 48932; +INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Chance`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`) VALUES +(48932, 56379, 0, 1, 1, 1, 1), +(48932, 56383, 0, 1, 1, 1, 1), +(48932, 56381, 0, 1, 1, 1, 1), +(48932, 56380, 0, 1, 1, 1, 1), +(48932, 56382, 0, 1, 1, 1, 1); + +-- Siamat +DELETE FROM `creature_loot_template` WHERE `Entry` IN (44819, 51088); +DELETE FROM `reference_loot_template` WHERE `Entry` IN (44819, 51088); +INSERT INTO `creature_loot_template` (`Entry`, `Chance`, `LootMode`, `Reference`, `MinCount`, `MaxCount`) VALUES +(44819, 100, 1, 448190, 2, 2); +INSERT INTO `reference_loot_template` (`Entry`, `Item`, `Chance`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`) VALUES +(448190, 55872, 0, 1, 1, 1, 1), +(448190, 55876, 0, 1, 1, 1, 1), +(448190, 55878, 0, 1, 1, 1, 1), +(448190, 55877, 0, 1, 1, 1, 1), +(448190, 55871, 0, 1, 1, 1, 1), +(448190, 55873, 0, 1, 1, 1, 1), +(448190, 55874, 0, 1, 1, 1, 1), +(448190, 55879, 0, 1, 1, 1, 1), +(448190, 55875, 0, 1, 1, 1, 1), +(448190, 55880, 0, 1, 1, 1, 1); + +UPDATE `creature_template` SET `lootid`= 51088 WHERE `entry`= 51088; +INSERT INTO `creature_loot_template` (`Entry`, `Chance`, `LootMode`, `Reference`, `MinCount`, `MaxCount`) VALUES +(51088, 100, 1, 510880, 2, 2); +INSERT INTO `reference_loot_template` (`Entry`, `Item`, `Chance`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`) VALUES +(510880, 56397, 0, 1, 1, 1, 1), +(510880, 56399, 0, 1, 1, 1, 1), +(510880, 56403, 0, 1, 1, 1, 1), +(510880, 56401, 0, 1, 1, 1, 1), +(510880, 56395, 0, 1, 1, 1, 1), +(510880, 56398, 0, 1, 1, 1, 1), +(510880, 56394, 0, 1, 1, 1, 1), +(510880, 56400, 0, 1, 1, 1, 1), +(510880, 56396, 0, 1, 1, 1, 1), +(510880, 56402, 0, 1, 1, 1, 1), +(510880, 52078, 100, 1, 2, 1, 1); -- Chaos Orb + +-- Gold Loot +UPDATE `creature_template` SET `mingold`= 19800, `maxgold`= 19900 WHERE entry IN (44577, 48932, 43614, 49045, 43612, 48951, 44819, 51088); diff --git a/src/server/scripts/Kalimdor/LostCityOfTheTolvir/boss_lockmaw_and_augh.cpp b/src/server/scripts/Kalimdor/LostCityOfTheTolvir/boss_lockmaw_and_augh.cpp index 937b30df057..9dbf44074f2 100644 --- a/src/server/scripts/Kalimdor/LostCityOfTheTolvir/boss_lockmaw_and_augh.cpp +++ b/src/server/scripts/Kalimdor/LostCityOfTheTolvir/boss_lockmaw_and_augh.cpp @@ -390,7 +390,7 @@ class npc_lockmaw_frenzied_crocolisk : public CreatureScript me->DespawnOrUnsummon(Seconds(5)); } - void IsSummonedBy(Unit* summoner) override + void IsSummonedBy(Unit* /*summoner*/) override { if (Creature* lockmaw = _instance->GetCreature(DATA_LOCKMAW)) lockmaw->AI()->JustSummoned(me);