From 7cf25c94ab41ff35d74be40a825877fc8fcf3b6c Mon Sep 17 00:00:00 2001 From: avarishd <46330494+avarishd@users.noreply.github.com> Date: Thu, 4 Jul 2024 21:50:11 +0300 Subject: [PATCH 1/5] fix(Scripts/Shattrath): Daily Dungeon quests holograms (#19233) * fix(Scripts/Shattrath): Daily Dungeon quests holographs * Move to single script + doaction SAI * ocd * use NEAR_PLAYER * use only Wind Trader as SAI * use creature_guid target * rename action * cleanup * zzz * Update zone_shattrath_city.cpp --- .../rev_1719691851180437100.sql | 10 ++ .../scripts/Outland/zone_shattrath_city.cpp | 158 ++++++++++++++++++ 2 files changed, 168 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1719691851180437100.sql diff --git a/data/sql/updates/pending_db_world/rev_1719691851180437100.sql b/data/sql/updates/pending_db_world/rev_1719691851180437100.sql new file mode 100644 index 0000000000..b30a4e119e --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1719691851180437100.sql @@ -0,0 +1,10 @@ +-- Shattrath Daily Normal/Heroic holograms +UPDATE `creature_template` SET `ScriptName` = 'npc_shattrath_daily_quest' WHERE `entry` IN (24410,24854); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 24369; +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 24369); +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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(24369, 0, 0, 1, 1, 0, 100, 1, 0, 0, 0, 0, 0, 0, 223, 1, 0, 0, 0, 0, 0, 10, 79464, 24854, 0, 0, 0, 0, 0, 0, 'Wind Trader Zhareem - Out of Combat - Do Action ID 1 (No Repeat)'), +(24369, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 223, 1, 0, 0, 0, 0, 0, 10, 79462, 24410, 0, 0, 0, 0, 0, 0, 'Wind Trader Zhareem - Out of Combat - Do Action ID 1 (No Repeat)'), +(24369, 0, 2, 3, 101, 0, 100, 0, 1, 30, 60000, 60000, 60000, 0, 223, 1, 0, 0, 0, 0, 0, 10, 79464, 24854, 0, 0, 0, 0, 0, 0, 'Wind Trader Zhareem - On 1 or More Players in Range - Do Action ID 1'), +(24369, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 223, 1, 0, 0, 0, 0, 0, 10, 79462, 24410, 0, 0, 0, 0, 0, 0, 'Wind Trader Zhareem - On 1 or More Players in Range - Do Action ID 1'); diff --git a/src/server/scripts/Outland/zone_shattrath_city.cpp b/src/server/scripts/Outland/zone_shattrath_city.cpp index 34ca2c9e00..bccd14d262 100644 --- a/src/server/scripts/Outland/zone_shattrath_city.cpp +++ b/src/server/scripts/Outland/zone_shattrath_city.cpp @@ -16,6 +16,7 @@ */ #include "CreatureScript.h" +#include "PassiveAI.h" #include "Player.h" #include "ScriptedCreature.h" #include "ScriptedEscortAI.h" @@ -253,9 +254,166 @@ public: }; }; +enum ShattrathQuests +{ + // QuestID : Creature Template ID + // Heroic Daily Quests + QUEST_H_NAZZAN = 11354, // 24410 + QUEST_H_KELIDAN = 11362, // 24413 + QUEST_H_BLADEFIST = 11363, // 24414 + QUEST_H_QUAG = 11368, // 24419 + QUEST_H_BLACKSTALKER = 11369, // 24420 + QUEST_H_WARLORD = 11370, // 24421 + QUEST_H_IKISS = 11372, // 24422 + QUEST_H_SHAFFAR = 11373, // 24423 + QUEST_H_EXARCH = 11374, // 24424 + QUEST_H_MURMUR = 11375, // 24425 + QUEST_H_EPOCH = 11378, // 24427 + QUEST_H_AEONUS = 11382, // 24428 + QUEST_H_WARP = 11384, // 24431 + QUEST_H_CALCULATOR = 11386, // 21504 + QUEST_H_SKYRISS = 11388, // 24435 + QUEST_H_KAEL = 11499, // 24855 + // Normal Daily Quests + QUEST_N_CENTURIONS = 11364, // 24411 + QUEST_N_MYRMIDONS = 11371, // 24415 + QUEST_N_INSTRUCTORS = 11376, // 24426 + QUEST_N_LORDS = 11383, // 24429 + QUEST_N_CHANNELERS = 11385, // 24430 + QUEST_N_DESTROYERS = 11387, // 24432 + QUEST_N_SENTINELS = 11389, // 24434 + QUEST_N_SISTERS = 11500, // 24854 + + ACTION_UPDATE_QUEST_STATUS = 1, + + POOL_SHATTRATH_DAILY_H = 356, + POOL_SHATTRATH_DAILY_N = 357, + + // Image NPCs + NPC_SHATTRATH_DAILY_H = 24854, + NPC_SHATTRATH_DAILY_N = 24410 +}; + +struct npc_shattrath_daily_quest : public NullCreatureAI +{ + npc_shattrath_daily_quest(Creature* c) : NullCreatureAI(c) {} + + void DoAction(int32 action) override + { + if (action == ACTION_UPDATE_QUEST_STATUS) + { + uint32 creature = me->GetEntry(); + QueryResult result = CharacterDatabase.Query("SELECT `quest_id` FROM `pool_quest_save` WHERE `pool_id` = '{}'", creature == NPC_SHATTRATH_DAILY_H ? POOL_SHATTRATH_DAILY_H : POOL_SHATTRATH_DAILY_N); + if (result) + { + Field *fields = result->Fetch(); + int quest_id = fields[0].Get(); + uint32 templateID; + + if (creature == NPC_SHATTRATH_DAILY_H) + { + switch (quest_id) + { + case QUEST_H_NAZZAN: + templateID = 24410; + break; + case QUEST_H_KELIDAN: + templateID = 24413; + break; + case QUEST_H_BLADEFIST: + templateID = 24414; + break; + case QUEST_H_QUAG: + templateID = 24419; + break; + case QUEST_H_BLACKSTALKER: + templateID = 24420; + break; + case QUEST_H_WARLORD: + templateID = 24421; + break; + case QUEST_H_IKISS: + templateID = 24422; + break; + case QUEST_H_SHAFFAR: + templateID = 24423; + break; + case QUEST_H_EXARCH: + templateID = 24424; + break; + case QUEST_H_MURMUR: + templateID = 24425; + break; + case QUEST_H_EPOCH: + templateID = 24427; + break; + case QUEST_H_AEONUS: + templateID = 24428; + break; + case QUEST_H_WARP: + templateID = 24431; + break; + case QUEST_H_CALCULATOR: + templateID = 21504; + break; + case QUEST_H_SKYRISS: + templateID = 24435; + break; + case QUEST_H_KAEL: + templateID = 24855; + break; + default: + break; + } + } + + if (creature == NPC_SHATTRATH_DAILY_N) + { + switch (quest_id) + { + case QUEST_N_CENTURIONS: + templateID = 24411; + break; + case QUEST_N_MYRMIDONS: + templateID = 24415; + break; + case QUEST_N_INSTRUCTORS: + templateID = 24426; + break; + case QUEST_N_LORDS: + templateID = 24429; + break; + case QUEST_N_CHANNELERS: + templateID = 24430; + break; + case QUEST_N_DESTROYERS: + templateID = 24432; + break; + case QUEST_N_SENTINELS: + templateID = 24434; + break; + case QUEST_N_SISTERS: + templateID = 24854; + break; + default: + break; + } + } + + if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(templateID)) + { + CreatureModel const* model = ObjectMgr::ChooseDisplayId(ci); + me->SetDisplayId(model->CreatureDisplayID, model->DisplayScale); + } + } + } + } +}; + void AddSC_shattrath_city() { new npc_shattrathflaskvendors(); new npc_zephyr(); new npc_kservant(); + RegisterCreatureAI(npc_shattrath_daily_quest); } From 2cfe665a530176c6a0a596f28e8aa95039bbefd4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 4 Jul 2024 18:51:11 +0000 Subject: [PATCH 2/5] chore(DB): import pending files Referenced commit(s): 7cf25c94ab41ff35d74be40a825877fc8fcf3b6c --- .../rev_1719691851180437100.sql => db_world/2024_07_04_05.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1719691851180437100.sql => db_world/2024_07_04_05.sql} (97%) diff --git a/data/sql/updates/pending_db_world/rev_1719691851180437100.sql b/data/sql/updates/db_world/2024_07_04_05.sql similarity index 97% rename from data/sql/updates/pending_db_world/rev_1719691851180437100.sql rename to data/sql/updates/db_world/2024_07_04_05.sql index b30a4e119e..f34250d85d 100644 --- a/data/sql/updates/pending_db_world/rev_1719691851180437100.sql +++ b/data/sql/updates/db_world/2024_07_04_05.sql @@ -1,3 +1,4 @@ +-- DB update 2024_07_04_04 -> 2024_07_04_05 -- Shattrath Daily Normal/Heroic holograms UPDATE `creature_template` SET `ScriptName` = 'npc_shattrath_daily_quest' WHERE `entry` IN (24410,24854); From 37431cd7a6a2fb54fada2f637651c06ec32a44e3 Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Thu, 4 Jul 2024 21:34:14 +0200 Subject: [PATCH 3/5] fix(Core/Pets): Correct Pet size for bigger pets 2 (#18867) * scale displayInfo, cap scale to maxScale * prevent scaling with displayInfo if scale is already increasing the size --- src/server/game/Entities/Pet/Pet.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index de53dfa7b9..0f77f0c975 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -2499,11 +2499,6 @@ float Pet::GetNativeObjectScale() const { uint8 ctFamily = GetCreatureTemplate()->family; - // hackfix: Edge case where DBC scale values for DEVILSAUR pets make them too small. - // Therefore we take data from spirit beast instead. - if (ctFamily && ctFamily == CREATURE_FAMILY_DEVILSAUR) - ctFamily = CREATURE_FAMILY_SPIRIT_BEAST; - CreatureFamilyEntry const* creatureFamily = sCreatureFamilyStore.LookupEntry(ctFamily); if (creatureFamily && creatureFamily->minScale > 0.0f && getPetType() & HUNTER_PET) { @@ -2520,6 +2515,13 @@ float Pet::GetNativeObjectScale() const float scale = (creatureFamily->maxScale - creatureFamily->minScale) * scaleMod + creatureFamily->minScale; + scale = std::min(scale, creatureFamily->maxScale); + + if (CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(GetNativeDisplayId())) + { + if (scale < 1.f && displayInfo->scale > 1.f) + scale *= displayInfo->scale; + } return scale; } From 48e35501a8fc6abed4adfc80125f6b35fa5eb1eb Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Thu, 4 Jul 2024 19:23:01 -0300 Subject: [PATCH 4/5] =?UTF-8?q?fix(DB/Spells):=20Allow=20Sablemane's=20Sle?= =?UTF-8?q?eping=20Powder=20to=20bypass=20stun=20immu=E2=80=A6=20(#19280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(DB/Spells): Allow Sablemane's Sleeping Powder to bypass stun immunity --- data/sql/updates/pending_db_world/rev_1720131063062734900.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1720131063062734900.sql diff --git a/data/sql/updates/pending_db_world/rev_1720131063062734900.sql b/data/sql/updates/pending_db_world/rev_1720131063062734900.sql new file mode 100644 index 0000000000..21d620d154 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1720131063062734900.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spell_custom_attr` WHERE `spell_id` = 38510; +INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES +(38510, 2147483648); From a40387cd4c06d6bf7fc3ff3945d420cb2e9b14fd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 4 Jul 2024 22:23:57 +0000 Subject: [PATCH 5/5] chore(DB): import pending files Referenced commit(s): 48e35501a8fc6abed4adfc80125f6b35fa5eb1eb --- .../rev_1720131063062734900.sql => db_world/2024_07_04_06.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1720131063062734900.sql => db_world/2024_07_04_06.sql} (77%) diff --git a/data/sql/updates/pending_db_world/rev_1720131063062734900.sql b/data/sql/updates/db_world/2024_07_04_06.sql similarity index 77% rename from data/sql/updates/pending_db_world/rev_1720131063062734900.sql rename to data/sql/updates/db_world/2024_07_04_06.sql index 21d620d154..c67e8bc1e0 100644 --- a/data/sql/updates/pending_db_world/rev_1720131063062734900.sql +++ b/data/sql/updates/db_world/2024_07_04_06.sql @@ -1,3 +1,4 @@ +-- DB update 2024_07_04_05 -> 2024_07_04_06 -- DELETE FROM `spell_custom_attr` WHERE `spell_id` = 38510; INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES