diff --git a/data/sql/updates/pending_db_world/rev_1786271765121376500.sql b/data/sql/updates/pending_db_world/rev_1786271765121376500.sql new file mode 100644 index 0000000000..b8b7b7ba95 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1786271765121376500.sql @@ -0,0 +1,30 @@ +-- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 13 AND `SourceEntry` IN (62584, 64185, 63947); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 3, 62584, 0, 0, 31, 0, 3, 32906, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Force cast and heal only Freya'), +(13, 3, 64185, 0, 0, 31, 0, 3, 32906, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Force cast and heal only Freya'), +(13, 4, 62584, 0, 0, 31, 0, 3, 32916, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Snaplasher'), +(13, 4, 62584, 0, 1, 31, 0, 3, 32918, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Detonating Lasher'), +(13, 4, 62584, 0, 2, 31, 0, 3, 32919, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Storm Lasher'), +(13, 4, 62584, 0, 3, 31, 0, 3, 33050, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Unstable Sun Beam'), +(13, 4, 62584, 0, 4, 31, 0, 3, 33088, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Iron Roots'), +(13, 4, 62584, 0, 5, 31, 0, 3, 33168, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Strengthened Iron Roots'), +(13, 4, 62584, 0, 6, 31, 0, 3, 33170, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Sun Beam'), +(13, 4, 62584, 0, 7, 31, 0, 3, 33202, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Ancient Water Spirit'), +(13, 4, 62584, 0, 8, 31, 0, 3, 33203, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Ancient Conservator'), +(13, 4, 62584, 0, 9, 31, 0, 3, 33215, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Healthy Spore'), +(13, 4, 62584, 0, 10, 31, 0, 3, 33228, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Eonar''s Gift'), +(13, 4, 62584, 0, 11, 31, 0, 3, 34129, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Nature Bomb'), +(13, 4, 64185, 0, 0, 31, 0, 3, 32916, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Snaplasher'), +(13, 4, 64185, 0, 1, 31, 0, 3, 32918, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Detonating Lasher'), +(13, 4, 64185, 0, 2, 31, 0, 3, 32919, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Storm Lasher'), +(13, 4, 64185, 0, 3, 31, 0, 3, 33050, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Unstable Sun Beam'), +(13, 4, 64185, 0, 4, 31, 0, 3, 33088, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Iron Roots'), +(13, 4, 64185, 0, 5, 31, 0, 3, 33168, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Strengthened Iron Roots'), +(13, 4, 64185, 0, 6, 31, 0, 3, 33170, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Sun Beam'), +(13, 4, 64185, 0, 7, 31, 0, 3, 33202, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Ancient Water Spirit'), +(13, 4, 64185, 0, 8, 31, 0, 3, 33203, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Ancient Conservator'), +(13, 4, 64185, 0, 9, 31, 0, 3, 33215, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Healthy Spore'), +(13, 4, 64185, 0, 10, 31, 0, 3, 33228, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Eonar''s Gift'), +(13, 4, 64185, 0, 11, 31, 0, 3, 34129, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift - Heal Nature Bomb'), +(13, 1, 63947, 0, 0, 31, 0, 3, 33228, 0, 0, 0, 0, '', 'Freya - Lifebinder''s Gift Heal - Target Eonar''s Gift'); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index 8123fa2d85..5624d96a13 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -36,7 +36,7 @@ enum FreyaSpells // FREYA SPELL_TOUCH_OF_EONAR = 62528, SPELL_ATTUNED_TO_NATURE = 62519, - SPELL_SUMMON_LIFEBINDER = 62870, + SPELL_LIFEBINDER_TRIGGER_MISSILE = 62572, // summons Eonar's Gift at the missile impact point SPELL_SUMMON_WAVE_1 = 62685, // Summon Ancient Conservator SPELL_SUMMON_WAVE_3 = 62686, // Summon Trio (Water Spirit, Storm Lasher, Snaplasher) SPELL_SUMMON_WAVE_10 = 62687, // Summon Detonating Lashers @@ -545,25 +545,10 @@ struct boss_freya : public BossAI events.Repeat(1min); break; case EVENT_FREYA_LIFEBINDER: - { - Talk(EMOTE_LIFEBINDERS_GIFT); - events.Repeat(45s); - float x, y, z; - for (uint8 i = 0; i < 10; ++i) - { - x = me->GetPositionX() + urand(7, 25); - y = me->GetPositionY() + urand(7, 25); - z = me->GetMapHeight(x, y, me->GetPositionZ()); - if (me->IsWithinLOS(x, y, z)) - { - me->CastSpell(x, y, z, SPELL_SUMMON_LIFEBINDER, true); - return; - } - } - - me->CastSpell(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), SPELL_SUMMON_LIFEBINDER, true); - break; - } + Talk(EMOTE_LIFEBINDERS_GIFT); + DoCastSelf(SPELL_LIFEBINDER_TRIGGER_MISSILE); + events.Repeat(45s); + break; case EVENT_FREYA_SUNBEAM: if (Unit* target = SelectTarget(SelectTargetMethod::Random)) me->CastSpell(target, SPELL_SUNBEAM, false); @@ -935,27 +920,28 @@ struct boss_freya_lifebinder : public NullCreatureAI { } - uint32 _healTimer; - void Reset() override { - me->CastSpell(me, SPELL_LIFEBINDER_VISUAL, true); - me->CastSpell(me, SPELL_LIFEBINDER_PHERONOMES, true); - me->CastSpell(me, SPELL_AUTO_GROW, true); - _healTimer = 0; + me->CastSpell(me, SPELL_LIFEBINDER_VISUAL, false); + me->CastSpell(me, SPELL_AUTO_GROW, false); + me->CastSpell(me, SPELL_LIFEBINDER_PHERONOMES, false); + + _scheduler.CancelAll(); + _scheduler.Schedule(12s, [this](TaskContext /*context*/) + { + me->RemoveAurasDueToSpell(SPELL_AUTO_GROW); + me->CastSpell(me, SPELL_LIFEBINDER_HEAL, false); + me->DespawnOrUnsummon(2500ms); + }); } void UpdateAI(uint32 diff) override { - _healTimer += diff; - if (_healTimer >= 12000) - { - me->RemoveAurasDueToSpell(SPELL_AUTO_GROW); - me->CastSpell(me, SPELL_LIFEBINDER_HEAL, true); - me->DespawnOrUnsummon(2s); - _healTimer = 0; - } + _scheduler.Update(diff); } + +private: + TaskScheduler _scheduler; }; struct boss_freya_healthy_spore : public NullCreatureAI