fix(Scripts/DTK): Fix Oh Novos! achievement (#23539) (#23718)

This commit is contained in:
Traesh
2025-11-15 21:35:07 +01:00
committed by GitHub
parent 68694d145b
commit 8c963a11ce
4 changed files with 242 additions and 229 deletions

View File

@@ -0,0 +1,2 @@
DELETE FROM `smart_scripts` WHERE `entryorguid` = 27598 AND `source_type` = 0;
UPDATE `creature_template` SET `AIName` = '' WHERE `entry` = 27598;

View File

@@ -77,14 +77,10 @@ std::unordered_map<uint32, std::tuple <uint32, Position>> const npcSummon =
{ ROOM_STAIRS, { NPC_CRYSTAL_CHANNEL_TARGET, { -378.40f, -813.13f, 59.74f, 0.0f } } },
};
class boss_novos : public CreatureScript
// 26631
struct boss_novos : public BossAI
{
public:
boss_novos() : CreatureScript("boss_novos") { }
struct boss_novosAI : public BossAI
{
boss_novosAI(Creature* creature) : BossAI(creature, DATA_NOVOS)
boss_novos(Creature* creature) : BossAI(creature, DATA_NOVOS)
{
}
@@ -177,12 +173,39 @@ public:
void JustSummoned(Creature* summon) override
{
summons.Summon(summon);
if (me->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE) && summon->GetEntry() != NPC_CRYSTAL_CHANNEL_TARGET && summon->GetEntry() != NPC_CRYSTAL_HANDLER)
// Phase 1
if (me->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE))
{
if (summon->GetEntry() != NPC_CRYSTAL_CHANNEL_TARGET && summon->GetEntry() != NPC_CRYSTAL_HANDLER)
summon->SetReactState(REACT_DEFENSIVE);
if (summon->GetEntry() == NPC_FETID_TROLL_CORPSE)
summon->GetMotionMaster()->MovePoint(1, -373.56f, -770.86f, 28.59f);
}
// Phase 2
else if (summon->GetEntry() != NPC_CRYSTAL_CHANNEL_TARGET)
summon->SetInCombatWithZone();
}
void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) override
{
if (summon->GetEntry() == NPC_FETID_TROLL_CORPSE)
summon->DespawnOrUnsummon(10s);
}
void SummonMovementInform(Creature* summon, uint32 movementType, uint32 pathId) override
{
if (movementType == POINT_MOTION_TYPE && pathId == 1)
{
if (summon->GetEntry() == NPC_FETID_TROLL_CORPSE)
{
DoZoneInCombat(summon);
_achievement = false;
}
}
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
@@ -263,12 +286,7 @@ public:
bool _achievement;
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetDraktharonKeepAI<boss_novosAI>(creature);
}
};
// 51403
class spell_novos_despawn_crystal_handler : public SpellScript
{
PrepareSpellScript(spell_novos_despawn_crystal_handler);
@@ -290,6 +308,7 @@ class spell_novos_despawn_crystal_handler : public SpellScript
}
};
// 47336
class spell_novos_crystal_handler_death_aura : public AuraScript
{
PrepareAuraScript(spell_novos_crystal_handler_death_aura);
@@ -307,6 +326,7 @@ class spell_novos_crystal_handler_death_aura : public AuraScript
}
};
// 59910
class spell_novos_summon_minions : public SpellScript
{
PrepareSpellScript(spell_novos_summon_minions);
@@ -328,6 +348,7 @@ class spell_novos_summon_minions : public SpellScript
}
};
// 2057
class achievement_oh_novos : public AchievementCriteriaScript
{
public:
@@ -341,7 +362,7 @@ public:
void AddSC_boss_novos()
{
new boss_novos();
RegisterCreatureAIWithFactory(boss_novos, GetDraktharonKeepAI);
RegisterSpellScript(spell_novos_despawn_crystal_handler);
RegisterSpellScript(spell_novos_crystal_handler_death_aura);
RegisterSpellScript(spell_novos_summon_minions);

View File

@@ -39,6 +39,7 @@ enum Creatures
NPC_KURZEL = 26664,
NPC_DRAKKARI_GUARDIAN = 26620,
NPC_RISEN_DRAKKARI_WARRIOR = 26635,
NPC_FETID_TROLL_CORPSE = 27598,
};
enum GameObjects

View File

@@ -31,14 +31,9 @@ DoorData const doorData[] =
{ 0, 0, DOOR_TYPE_ROOM }
};
class instance_drak_tharon_keep : public InstanceMapScript
struct instance_drak_tharon_keep : public InstanceScript
{
public:
instance_drak_tharon_keep() : InstanceMapScript("instance_drak_tharon_keep", MAP_DRAK_THARON_KEEP) { }
struct instance_drak_tharon_keep_InstanceScript : public InstanceScript
{
instance_drak_tharon_keep_InstanceScript(Map* map) : InstanceScript(map)
instance_drak_tharon_keep(Map* map) : InstanceScript(map)
{
SetHeaders(DataHeader);
SetBossNumber(MAX_ENCOUNTERS);
@@ -72,12 +67,6 @@ public:
}
};
InstanceScript* GetInstanceScript(InstanceMap* map) const override
{
return new instance_drak_tharon_keep_InstanceScript(map);
}
};
class spell_dtk_raise_dead_aura : public AuraScript
{
PrepareAuraScript(spell_dtk_raise_dead_aura);
@@ -121,7 +110,7 @@ class spell_dtk_summon_random_drakkari : public SpellScript
void AddSC_instance_drak_tharon_keep()
{
new instance_drak_tharon_keep();
RegisterInstanceScript(instance_drak_tharon_keep, MAP_DRAK_THARON_KEEP);
RegisterSpellScript(spell_dtk_raise_dead_aura);
RegisterSpellScript(spell_dtk_summon_random_drakkari);
}