Skip to content

Commit

Permalink
fix(Scripts/MagisterTerrace): Rescript Kael's intro (#21278)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyeriah authored Jan 27, 2025
1 parent 777f7ed commit ed99f05
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 24 deletions.
26 changes: 26 additions & 0 deletions data/sql/updates/pending_db_world/rev_1737933911029419400.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--
UPDATE `creature_template` SET `flags_extra` = `flags_extra` |134217728 WHERE `entry` IN (24698, 24684, 24697, 24696, 24683, 24686);

DELETE FROM `smart_scripts` WHERE (`entryorguid` = -96841) AND (`source_type` = 0) AND (`id` IN (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`, `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
(-96841, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 223, 0, 0, 0, 0, 0, 0, 205, 3, 1, 0, 0, 0, 0, 0, 0, 'Coilskar Witch - On Just Died - Felblood Kaeltas Do Action ID 0');

DELETE FROM `smart_scripts` WHERE (`entryorguid` = -96781) AND (`source_type` = 0) AND (`id` IN (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`, `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
(-96781, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 223, 0, 0, 0, 0, 0, 0, 205, 3, 1, 0, 0, 0, 0, 0, 0, 'Sunblade Blood Knight - On Just Died - Felblood Kaeltas Do Action ID 0');

DELETE FROM `smart_scripts` WHERE (`entryorguid` = -96809) AND (`source_type` = 0) AND (`id` IN (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`, `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
(-96809, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 223, 0, 0, 0, 0, 0, 0, 205, 3, 1, 0, 0, 0, 0, 0, 0, 'Sunblade Warlock - On Just Died - Felblood Kaeltas Do Action ID 0');

DELETE FROM `smart_scripts` WHERE (`entryorguid` = -96770) AND (`source_type` = 0) AND (`id` IN (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`, `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
(-96770, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 223, 0, 0, 0, 0, 0, 0, 205, 3, 1, 0, 0, 0, 0, 0, 0, 'Sunblade Mage Guard - On Just Died - Felblood Kaeltas Do Action ID 0');

DELETE FROM `smart_scripts` WHERE (`entryorguid` = -96850) AND (`source_type` = 0) AND (`id` IN (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`, `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
(-96850, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 223, 0, 0, 0, 0, 0, 0, 205, 3, 1, 0, 0, 0, 0, 0, 0, 'Ethereum Smuggler - On Just Died - Felblood Kaeltas Do Action ID 0');

DELETE FROM `smart_scripts` WHERE (`entryorguid` = -96847) AND (`source_type` = 0) AND (`id` IN (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`, `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
(-96847, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 223, 0, 0, 0, 0, 0, 0, 205, 3, 1, 0, 0, 0, 0, 0, 0, 'Sister of Torment - On Just Died - Felblood Kaeltas Do Action ID 0');
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,14 @@ enum Misc

struct boss_felblood_kaelthas : public BossAI
{
boss_felblood_kaelthas(Creature* creature) : BossAI(creature, DATA_KAELTHAS)
{
_hasDoneIntro = false;
}
boss_felblood_kaelthas(Creature* creature) : BossAI(creature, DATA_KAELTHAS) { }

void Reset() override
{
BossAI::Reset();
_OOCScheduler.CancelAll();
_gravityLapseCounter = 0;
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false);
me->SetImmuneToAll(false);

ScheduleHealthCheckEvent(50, [&]{
me->CastStop();
Expand Down Expand Up @@ -125,12 +121,6 @@ struct boss_felblood_kaelthas : public BossAI
});
}

void InitializeAI() override
{
BossAI::InitializeAI();
me->SetImmuneToAll(true);
}

void JustDied(Unit* killer) override
{
BossAI::JustDied(killer);
Expand Down Expand Up @@ -161,20 +151,31 @@ struct boss_felblood_kaelthas : public BossAI
}, 50s);
}

void MoveInLineOfSight(Unit* who) override
void DoAction(int32 actionId) override
{
if (!_hasDoneIntro && me->IsWithinDistInMap(who, 40.0f) && who->IsPlayer())
if (actionId == DATA_KAEL_INTRO)
{
Talk(SAY_AGGRO);
Talk(SAY_AGGRO_2, 20s);
_hasDoneIntro = true;
_OOCScheduler.Schedule(35s, [this](TaskContext){
me->SetReactState(REACT_AGGRESSIVE);
me->SetImmuneToAll(false);
me->SetInCombatWithZone();
});
uint32 counter = instance->GetPersistentData(DATA_KAEL_INTRO);
instance->StorePersistentData(DATA_KAEL_INTRO, ++counter);

if (counter == 6 && !me->IsInCombat())
{
me->SetEmoteState(EMOTE_STATE_TALK);
Talk(SAY_AGGRO);

me->m_Events.AddEventAtOffset([&] {
me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH_NO_SHEATHE);
}, 15s);

Talk(SAY_AGGRO_2, 20s);
me->SetImmuneToAll(true);
_OOCScheduler.Schedule(35s, [this](TaskContext) {
me->ClearEmoteState();
me->SetReactState(REACT_AGGRESSIVE);
me->SetImmuneToAll(false);
});
}
}
BossAI::MoveInLineOfSight(who);
}

void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
Expand Down Expand Up @@ -229,7 +230,6 @@ struct boss_felblood_kaelthas : public BossAI
}
private:
TaskScheduler _OOCScheduler;
bool _hasDoneIntro;
uint8 _gravityLapseCounter;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class instance_magisters_terrace : public InstanceMapScript
{
SetHeaders(DataHeader);
SetBossNumber(MAX_ENCOUNTER);
SetPersistentDataCount(MAX_PERSISTENT_DATA);
LoadObjectData(creatureData, gameobjectData);
LoadDoorData(doorData);
LoadSummonData(summonerData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ enum MTData
MAX_ENCOUNTER = 4,

DATA_KALECGOS = 5,
DATA_ESCAPE_ORB = 6
DATA_ESCAPE_ORB = 6,

// Persistent data
DATA_KAEL_INTRO = 0,
MAX_PERSISTENT_DATA = 1
};

enum MTCreatures
Expand Down

0 comments on commit ed99f05

Please sign in to comment.