diff options
| -rw-r--r-- | data/sql/updates/db_world/2025_11_20_01.sql (renamed from data/sql/updates/pending_db_world/rev_1763652642814547600.sql) | 1 | ||||
| -rw-r--r-- | data/sql/updates/db_world/2025_11_20_02.sql (renamed from data/sql/updates/pending_db_world/rev_1763658928173617200.sql) | 1 | ||||
| -rw-r--r-- | data/sql/updates/db_world/2025_11_20_03.sql (renamed from data/sql/updates/pending_db_world/rev_1763670536248228000.sql) | 1 | ||||
| -rw-r--r-- | data/sql/updates/db_world/2025_11_20_04.sql (renamed from data/sql/updates/pending_db_world/rev_1763674761152772300.sql) | 1 | ||||
| -rw-r--r-- | data/sql/updates/db_world/2025_11_21_00.sql | 15 | ||||
| -rw-r--r-- | data/sql/updates/db_world/2025_11_21_01.sql | 3 | ||||
| -rw-r--r-- | data/sql/updates/db_world/2025_11_21_02.sql | 10 | ||||
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 21 | ||||
| -rw-r--r-- | src/server/game/Spells/Spell.h | 3 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 19 | ||||
| -rw-r--r-- | src/server/scripts/Northrend/zone_dragonblight.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/Northrend/zone_storm_peaks.cpp | 38 |
12 files changed, 117 insertions, 2 deletions
diff --git a/data/sql/updates/pending_db_world/rev_1763652642814547600.sql b/data/sql/updates/db_world/2025_11_20_01.sql index d507d3c1b0..ad17c2b25f 100644 --- a/data/sql/updates/pending_db_world/rev_1763652642814547600.sql +++ b/data/sql/updates/db_world/2025_11_20_01.sql @@ -1,3 +1,4 @@ +-- DB update 2025_11_20_00 -> 2025_11_20_01 -- UPDATE `creature_addon` SET `bytes2` = 1, `auras` = '31261' WHERE `guid` IN (114372, 114373, 114381); UPDATE `creature` SET `unit_flags` = `unit_flags`|256|512|536870912, `VerifiedBuild` = 64502 WHERE `guid` IN (114372, 114373, 114381) AND `id1` = 30148; diff --git a/data/sql/updates/pending_db_world/rev_1763658928173617200.sql b/data/sql/updates/db_world/2025_11_20_02.sql index 00ab08f031..b8b12eb919 100644 --- a/data/sql/updates/pending_db_world/rev_1763658928173617200.sql +++ b/data/sql/updates/db_world/2025_11_20_02.sql @@ -1,3 +1,4 @@ +-- DB update 2025_11_20_01 -> 2025_11_20_02 -- UPDATE `creature_template` SET `speed_run` = 1.142857 WHERE `entry` = 31356; UPDATE `creature_template` SET `speed_run` = 0.428571 WHERE `entry` = 31873; diff --git a/data/sql/updates/pending_db_world/rev_1763670536248228000.sql b/data/sql/updates/db_world/2025_11_20_03.sql index 3617d5c2ba..5d252067d8 100644 --- a/data/sql/updates/pending_db_world/rev_1763670536248228000.sql +++ b/data/sql/updates/db_world/2025_11_20_03.sql @@ -1,3 +1,4 @@ +-- DB update 2025_11_20_02 -> 2025_11_20_03 -- UPDATE `creature_template` SET `AIName` = '', `npcflag` = 16777216 WHERE `entry` = 26809; DELETE FROM `smart_scripts` WHERE (`entryorguid` = 26809) AND (`source_type` = 0); diff --git a/data/sql/updates/pending_db_world/rev_1763674761152772300.sql b/data/sql/updates/db_world/2025_11_20_04.sql index 050ab1078b..3eafbca145 100644 --- a/data/sql/updates/pending_db_world/rev_1763674761152772300.sql +++ b/data/sql/updates/db_world/2025_11_20_04.sql @@ -1,3 +1,4 @@ +-- DB update 2025_11_20_03 -> 2025_11_20_04 -- DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 17) AND (`SourceGroup` = 0) AND (`SourceEntry` = 47431) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` = 29) AND (`ConditionTarget` = 1) AND (`ConditionValue1` = 26359) AND (`ConditionValue2` = 0) AND (`ConditionValue3` = 0); INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES diff --git a/data/sql/updates/db_world/2025_11_21_00.sql b/data/sql/updates/db_world/2025_11_21_00.sql new file mode 100644 index 0000000000..df1eaf216a --- /dev/null +++ b/data/sql/updates/db_world/2025_11_21_00.sql @@ -0,0 +1,15 @@ +-- DB update 2025_11_20_04 -> 2025_11_21_00 +-- +SET @GUID := 1161; +DELETE FROM `gameobject` WHERE `id` = 193997 AND `guid` BETWEEN @GUID AND @GUID+9; +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 +(@GUID+0, 193997, 571, 0, 0, 1, 1, 7330.44, -2212.68, 800.483, 4.25861, 0, 0, 0.848046, -0.529922, 120, 255, 1, '', 0), +(@GUID+1, 193997, 571, 0, 0, 1, 1, 7211.5, -2373.86, 781.449, 4.38078, 0, 0, 0.814114, -0.580705, 120, 255, 1, '', 0), +(@GUID+2, 193997, 571, 0, 0, 1, 1, 6973.8, -2096.83, 777.638, 3.26377, 0, 0, 0.998135, -0.0610507, 120, 255, 1, '', 0), +(@GUID+3, 193997, 571, 0, 0, 1, 1, 7310.71, -2812.07, 798.081, 1.5708, 0, 0, 0.707108, 0.707106, 120, 255, 1, '', 0), +(@GUID+4, 193997, 571, 0, 0, 1, 1, 7301.01, -2746.12, 749.508, 0.157079, 0, 0, 0.0784588, 0.996917, 120, 255, 1, '', 0), +(@GUID+5, 193997, 571, 0, 0, 1, 1, 7550.37, -3154.98, 840.146, 4.41568, 0, 0, 0.803858, -0.594822, 120, 255, 1, '', 0), +(@GUID+6, 193997, 571, 0, 0, 1, 1, 7177.29, -3071.11, 862.298, 0.680677, 0, 0, 0.333806, 0.942642, 120, 255, 1, '', 0), +(@GUID+7, 193997, 571, 0, 0, 1, 1, 7694.28, -3154.72, 869.769, 3.76991, 0, 0, 0.951057, -0.309016, 120, 255, 1, '', 0), +(@GUID+8, 193997, 571, 0, 0, 1, 1, 7155.12, -2096.03, 764.428, 2.53072, 0, 0, 0.953716, 0.300709, 300, 100, 1, '', 0), +(@GUID+9, 193997, 571, 0, 0, 1, 1, 7218.2, -2139.83, 863.085, -1.09956, 0, 0, -0.5225, 0.852639, 300, 100, 1, '', 0); diff --git a/data/sql/updates/db_world/2025_11_21_01.sql b/data/sql/updates/db_world/2025_11_21_01.sql new file mode 100644 index 0000000000..b779b81005 --- /dev/null +++ b/data/sql/updates/db_world/2025_11_21_01.sql @@ -0,0 +1,3 @@ +-- DB update 2025_11_21_00 -> 2025_11_21_01 +-- +UPDATE `gameobject_loot_template` SET `QuestRequired` = 0 WHERE `Item` = 44724; diff --git a/data/sql/updates/db_world/2025_11_21_02.sql b/data/sql/updates/db_world/2025_11_21_02.sql new file mode 100644 index 0000000000..355d90f53b --- /dev/null +++ b/data/sql/updates/db_world/2025_11_21_02.sql @@ -0,0 +1,10 @@ +-- DB update 2025_11_21_01 -> 2025_11_21_02 +-- +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 54581; +DELETE FROM `spell_script_names` WHERE `spell_id` = 54581; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(54581, 'spell_mammoth_explosion'); + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 29402) AND (`source_type` = 0) AND (`id` IN (2)); +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 +(29402, 0, 2, 0, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 41, 3000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Ironwool Mammoth - On Spellhit \'Throw U.D.E.D.\' - Despawn In 3000 ms'); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index aad6a4f2d6..24f1c1ad68 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -643,6 +643,8 @@ Spell::Spell(Unit* caster, SpellInfo const* info, TriggerCastFlags triggerFlags, gameObjTarget = nullptr; destTarget = nullptr; damage = 0; + m_reflectionTarget = nullptr; + m_reflectionTargetGuid.Clear(); effectHandleMode = SPELL_EFFECT_HANDLE_LAUNCH; m_diminishLevel = DIMINISHING_LEVEL_1; m_diminishGroup = DIMINISHING_NONE; @@ -2591,6 +2593,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) //Spells with this flag cannot trigger if effect is casted on self bool canEffectTrigger = !m_spellInfo->HasAttribute(SPELL_ATTR3_SUPPRESS_CASTER_PROCS) && unitTarget->CanProc() && (CanExecuteTriggersOnHit(mask) || missInfo == SPELL_MISS_IMMUNE2); bool reflectedSpell = missInfo == SPELL_MISS_REFLECT; + Unit* reflectionSource = nullptr; Unit* spellHitTarget = nullptr; if (missInfo == SPELL_MISS_NONE) // In case spell hit target, do all effect on that target @@ -2602,6 +2605,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) { spellHitTarget = m_caster; unitTarget = m_caster; + reflectionSource = effectUnit; if (m_caster->IsCreature()) m_caster->ToCreature()->LowerPlayerDamageReq(target->damage); } @@ -2609,7 +2613,24 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) if (spellHitTarget) { + if (reflectionSource) + { + m_reflectionTarget = reflectionSource; + m_reflectionTargetGuid = reflectionSource->GetGUID(); + m_reflectionTargetPosition.Relocate(reflectionSource); + } + else + { + m_reflectionTarget = nullptr; + m_reflectionTargetGuid.Clear(); + m_reflectionTargetPosition = Position(); + } + SpellMissInfo missInfo2 = DoSpellHitOnUnit(spellHitTarget, mask, target->scaleAura); + + m_reflectionTarget = nullptr; + m_reflectionTargetGuid.Clear(); + m_reflectionTargetPosition = Position(); if (missInfo2 != SPELL_MISS_NONE) { if (missInfo2 != SPELL_MISS_MISS) diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 331d48997a..0f8cde5d37 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -666,6 +666,9 @@ public: WorldLocation* destTarget; int32 damage; SpellEffectHandleMode effectHandleMode; + Unit* m_reflectionTarget; + ObjectGuid m_reflectionTargetGuid; + Position m_reflectionTargetPosition; // used in effects handlers Aura* m_spellAura; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 8bb4c793ef..3343c70595 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5013,7 +5013,24 @@ void Spell::EffectKnockBack(SpellEffIndex effIndex) return; float x, y; - if (m_spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_KNOCK_BACK_DEST) + Unit* reflectionSource = m_reflectionTarget; + + if (!reflectionSource && !m_reflectionTargetGuid.IsEmpty()) + { + if (Unit* resolvedSource = ObjectAccessor::GetUnit(*m_caster, m_reflectionTargetGuid)) + reflectionSource = resolvedSource; + } + + if (reflectionSource) + { + reflectionSource->GetPosition(x, y); + } + else if (!m_reflectionTargetGuid.IsEmpty()) + { + x = m_reflectionTargetPosition.GetPositionX(); + y = m_reflectionTargetPosition.GetPositionY(); + } + else if (m_spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_KNOCK_BACK_DEST) { if (m_targets.HasDst()) destTarget->GetPosition(x, y); diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index ade76cf5fd..4b0238f3d7 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -789,7 +789,11 @@ class spell_q12237_rescue_villager : public SpellScript result = SPELL_FAILED_CUSTOM_ERROR; } - if (!GetCaster()->FindNearestCreature(NPC_HELPLESS_VILLAGER_A, 5.0f) && !GetCaster()->FindNearestCreature(NPC_HELPLESS_VILLAGER_B, 5.0f)) + std::list<Creature*> villagers; + GetCaster()->GetCreatureListWithEntryInGrid(villagers, { NPC_HELPLESS_VILLAGER_A, NPC_HELPLESS_VILLAGER_B }, 5.0f); + villagers.remove_if([](Creature* c) { return !c->IsAlive() || c->HasAura(SPELL_RIDE_VEHICLE); }); + + if (villagers.empty()) { extension = SPELL_CUSTOM_ERROR_MUST_BE_NEAR_HELPLESS_VILLAGER; result = SPELL_FAILED_CUSTOM_ERROR; diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index e940f83539..5c208f1187 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -1166,6 +1166,43 @@ class spell_feed_stormcrest_eagle : public SpellScript } }; +enum MammothExplosion +{ + SPELL_MAMMOTH_EXPL_1 = 54627, + SPELL_MAMMOTH_EXPL_2 = 54628, + SPELL_MAMMOTH_EXPL_3 = 54623, + SPELL_MAIN_MAMMOTH_MEAT = 57444 +}; + +// 54581 - Mammoth Explosion Spell Spawner +class spell_mammoth_explosion : public SpellScript +{ + PrepareSpellScript(spell_mammoth_explosion); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_MAMMOTH_EXPL_1, SPELL_MAMMOTH_EXPL_2, SPELL_MAMMOTH_EXPL_3, SPELL_MAIN_MAMMOTH_MEAT }); + } + + void HandleOnEffectHit(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + { + for (uint32 spellId : { SPELL_MAMMOTH_EXPL_1, SPELL_MAMMOTH_EXPL_2, SPELL_MAMMOTH_EXPL_3 }) + target->CastSpell(GetHitUnit(), spellId, true); + + target->CastSpell(GetHitUnit(), SPELL_MAIN_MAMMOTH_MEAT, true); + + target->SetVisible(false); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_mammoth_explosion::HandleOnEffectHit, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_storm_peaks() { RegisterCreatureAI(npc_frosthound); @@ -1183,4 +1220,5 @@ void AddSC_storm_peaks() new npc_vehicle_d16_propelled_delivery(); RegisterSpellScript(spell_q12823_remove_collapsing_cave_aura); RegisterSpellScript(spell_feed_stormcrest_eagle); + RegisterSpellScript(spell_mammoth_explosion); } |
