diff --git a/sql/updates/world/master/2026_07_18_01_world.sql b/sql/updates/world/master/2026_07_18_01_world.sql new file mode 100644 index 0000000000..65c41c2d3c --- /dev/null +++ b/sql/updates/world/master/2026_07_18_01_world.sql @@ -0,0 +1,10 @@ +-- +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_nalorakk_shape'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(42377, 'spell_nalorakk_shape'); + +DELETE FROM `creature_text` WHERE `CreatureID` = 23576 AND `GroupID` > 11; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(23576,12,0,"What could be better than servin' da bear spirit for eternity? Come closer now. Bring your souls to me!",14,0,100,0,0,12078,23305,1,"Nalorakk - SAY_EVENT_1"), +(23576,12,1,"I smell you, strangers. Don't be delayin' your fate. Come to me now. I make your sacrifice quick.",14,0,100,0,0,12079,23306,1,"Nalorakk - SAY_EVENT_2"), +(23576,13,0,"%s transforms into a bear!",41,0,100,0,0,0,24263,0,"Nalorakk - EMOTE_TRANSFORM"); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp index 4561f20687..3fc7e19198 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -17,8 +17,8 @@ /* * Creatures in waves should load waypoints, not engage immediately - * Surge implementation requires additional research * Combat timers requires to be revisited + * SAY_EVENT is NYI */ #include "ScriptMgr.h" @@ -26,6 +26,7 @@ #include "Map.h" #include "MotionMaster.h" #include "ScriptedCreature.h" +#include "SpellAuraEffects.h" #include "SpellInfo.h" #include "SpellScript.h" #include "zulaman.h" @@ -44,9 +45,8 @@ enum NalorakkTexts SAY_BERSERK = 9, SAY_SLAY = 10, SAY_DEATH = 11, - SAY_EVENT_1 = 12, // NYI - SAY_EVENT_2 = 13, // NYI - EMOTE_TRANSFORM = 14 + SAY_EVENT = 12, + EMOTE_TRANSFORM = 13 }; enum NalorakkSpells @@ -91,6 +91,12 @@ enum NalorakkEvents EVENT_BERSERK }; +enum NalorakkActions +{ + ACTION_SHAPE_APPLIED = 0, + ACTION_SHAPE_REMOVED = 1 +}; + enum NalorakkSpawnGroups { SPAWN_GROUP_NALORAKK_WAVE_1 = 329, @@ -126,13 +132,12 @@ static constexpr std::array NalorakkWave = struct boss_nalorakk : public BossAI { boss_nalorakk(Creature* creature) : BossAI(creature, BOSS_NALORAKK), - _waveEventInProgress(true), _isMovingToLocation(false), _isWaiting(false), _isInBearForm(false), _currentWaveCount(0) { } + _waveEventInProgress(true), _isMovingToLocation(false), _isWaiting(false), _currentWaveCount(0) { } void Reset() override { _Reset(); SetEquipmentSlots(true); - _isInBearForm = false; if (_waveEventInProgress) { @@ -157,11 +162,6 @@ struct boss_nalorakk : public BossAI { switch (spellInfo->Id) { - case SPELL_SHAPE_OF_THE_BEAR: - Talk(SAY_TO_BEAR); - Talk(EMOTE_TRANSFORM); - SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - break; case SPELL_SURGE: Talk(SAY_SURGE); break; @@ -234,6 +234,25 @@ struct boss_nalorakk : public BossAI { switch (action) { + case ACTION_SHAPE_APPLIED: + Talk(SAY_TO_BEAR); + Talk(EMOTE_TRANSFORM); + SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + events.CancelEvent(EVENT_BRUTAL_SWIPE); + events.CancelEvent(EVENT_SURGE); + events.ScheduleEvent(EVENT_LACERATING_SLASH, 5s, 10s); + events.ScheduleEvent(EVENT_REND_FLESH, 10s, 20s); + events.ScheduleEvent(EVENT_DEAFENING_ROAR, 15s, 20s); + break; + case ACTION_SHAPE_REMOVED: + Talk(SAY_TO_TROLL); + SetEquipmentSlots(true); + events.CancelEvent(EVENT_LACERATING_SLASH); + events.CancelEvent(EVENT_REND_FLESH); + events.CancelEvent(EVENT_DEAFENING_ROAR); + events.ScheduleEvent(EVENT_BRUTAL_SWIPE, 10s, 20s); + events.ScheduleEvent(EVENT_SURGE, 20s, 25s); + break; case ACTION_WAVE_DONE_1: Talk(SAY_WAVE_DONE); _isMovingToLocation = true; @@ -346,32 +365,9 @@ struct boss_nalorakk : public BossAI break; case EVENT_SHAPESHIFT: - { - if (_isInBearForm) - { - Talk(SAY_TO_TROLL); - SetEquipmentSlots(true); - events.CancelEvent(EVENT_LACERATING_SLASH); - events.CancelEvent(EVENT_REND_FLESH); - events.CancelEvent(EVENT_DEAFENING_ROAR); - events.ScheduleEvent(EVENT_BRUTAL_SWIPE, 10s, 20s); - events.ScheduleEvent(EVENT_SURGE, 20s, 25s); - events.Repeat(45s); - _isInBearForm = false; - } - else - { - DoCastSelf(SPELL_SHAPE_OF_THE_BEAR); - events.CancelEvent(EVENT_BRUTAL_SWIPE); - events.CancelEvent(EVENT_SURGE); - events.ScheduleEvent(EVENT_LACERATING_SLASH, 5s, 10s); - events.ScheduleEvent(EVENT_REND_FLESH, 10s, 20s); - events.ScheduleEvent(EVENT_DEAFENING_ROAR, 15s, 20s); - events.Repeat(30s); - _isInBearForm = true; - } + DoCastSelf(SPELL_SHAPE_OF_THE_BEAR); + events.Repeat(75s); break; - } case EVENT_BERSERK: DoCastSelf(SPELL_BERSERK); @@ -389,7 +385,6 @@ private: bool _waveEventInProgress; bool _isMovingToLocation; bool _isWaiting; - bool _isInBearForm; uint32 _currentWaveCount; }; @@ -403,12 +398,7 @@ class spell_nalorakk_surge : public SpellScript void FilterTargets(std::list& targets) { - if (targets.empty()) - return; - - WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); - targets.clear(); - targets.push_back(target); + Trinity::Containers::RandomResize(targets, 1); } void HandleDummy(SpellEffIndex /*effIndex*/) @@ -427,8 +417,34 @@ class spell_nalorakk_surge : public SpellScript } }; +// 42377 - Shape of the Bear +class spell_nalorakk_shape : public AuraScript +{ + void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Creature* target = GetTarget()->ToCreature()) + target->AI()->DoAction(ACTION_SHAPE_APPLIED); + } + + void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + return; + + if (Creature* target = GetTarget()->ToCreature()) + target->AI()->DoAction(ACTION_SHAPE_REMOVED); + } + + void Register() override + { + AfterEffectApply += AuraEffectApplyFn(spell_nalorakk_shape::AfterApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_nalorakk_shape::AfterRemove, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL); + } +}; + void AddSC_boss_nalorakk() { RegisterZulAmanCreatureAI(boss_nalorakk); RegisterSpellScript(spell_nalorakk_surge); + RegisterSpellScript(spell_nalorakk_shape); } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h index 16f677d907..9f1d16d648 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h @@ -99,10 +99,10 @@ enum ZAWorldStates enum ZAActionIds { - ACTION_WAVE_DONE_1 = 0, - ACTION_WAVE_DONE_2 = 1, - ACTION_WAVE_DONE_3 = 2, - ACTION_WAVE_DONE_4 = 3 + ACTION_WAVE_DONE_1 = 2357600, + ACTION_WAVE_DONE_2 = 2357601, + ACTION_WAVE_DONE_3 = 2357602, + ACTION_WAVE_DONE_4 = 2357603 }; template