mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts: Fixed missing boss count initialization in The Slave Pens and The Botanica as well as incorrect map id assignment to Auchenai Crypts spawn groups
Closes #28278
(cherry picked from commit 01f0f83139)
This commit is contained in:
@@ -0,0 +1 @@
|
||||
UPDATE `instance_spawn_groups` SET `instanceMapId`=558 WHERE `spawnGroupId` BETWEEN 204 AND 205;
|
||||
@@ -51,183 +51,154 @@ enum Creatures
|
||||
NPC_FOCUS_FIRE = 18374
|
||||
};
|
||||
|
||||
class boss_shirrak_the_dead_watcher : public CreatureScript
|
||||
struct boss_shirrak_the_dead_watcher : public BossAI
|
||||
{
|
||||
public:
|
||||
boss_shirrak_the_dead_watcher() : CreatureScript("boss_shirrak_the_dead_watcher") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
boss_shirrak_the_dead_watcher(Creature* creature) : BossAI(creature, DATA_SHIRRAK_THE_DEAD_WATCHER)
|
||||
{
|
||||
return GetAuchenaiCryptsAI<boss_shirrak_the_dead_watcherAI>(creature);
|
||||
Initialize();
|
||||
}
|
||||
|
||||
struct boss_shirrak_the_dead_watcherAI : public ScriptedAI
|
||||
void Initialize()
|
||||
{
|
||||
boss_shirrak_the_dead_watcherAI(Creature* creature) : ScriptedAI(creature)
|
||||
Inhibitmagic_Timer = 0;
|
||||
Attractmagic_Timer = 28000;
|
||||
Carnivorousbite_Timer = 10000;
|
||||
FocusFire_Timer = 17000;
|
||||
FocusedTargetGUID.Clear();
|
||||
}
|
||||
|
||||
uint32 Inhibitmagic_Timer;
|
||||
uint32 Attractmagic_Timer;
|
||||
uint32 Carnivorousbite_Timer;
|
||||
uint32 FocusFire_Timer;
|
||||
|
||||
ObjectGuid FocusedTargetGUID;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
_Reset();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned) override
|
||||
{
|
||||
if (summoned && summoned->GetEntry() == NPC_FOCUS_FIRE)
|
||||
{
|
||||
Initialize();
|
||||
summoned->CastSpell(summoned, SPELL_FOCUS_FIRE_VISUAL, false);
|
||||
summoned->SetFaction(me->GetFaction());
|
||||
summoned->SetLevel(me->GetLevel());
|
||||
summoned->AddUnitState(UNIT_STATE_ROOT);
|
||||
|
||||
if (Unit* pFocusedTarget = ObjectAccessor::GetUnit(*me, FocusedTargetGUID))
|
||||
summoned->AI()->AttackStart(pFocusedTarget);
|
||||
}
|
||||
BossAI::JustSummoned(summoned);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
//Inhibitmagic_Timer
|
||||
if (Inhibitmagic_Timer <= diff)
|
||||
{
|
||||
Inhibitmagic_Timer = 0;
|
||||
Attractmagic_Timer = 28000;
|
||||
Carnivorousbite_Timer = 10000;
|
||||
FocusFire_Timer = 17000;
|
||||
FocusedTargetGUID.Clear();
|
||||
}
|
||||
|
||||
uint32 Inhibitmagic_Timer;
|
||||
uint32 Attractmagic_Timer;
|
||||
uint32 Carnivorousbite_Timer;
|
||||
uint32 FocusFire_Timer;
|
||||
|
||||
ObjectGuid FocusedTargetGUID;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{ }
|
||||
|
||||
void JustSummoned(Creature* summoned) override
|
||||
{
|
||||
if (summoned && summoned->GetEntry() == NPC_FOCUS_FIRE)
|
||||
instance->instance->DoOnPlayers([this](Player* i_pl)
|
||||
{
|
||||
summoned->CastSpell(summoned, SPELL_FOCUS_FIRE_VISUAL, false);
|
||||
summoned->SetFaction(me->GetFaction());
|
||||
summoned->SetLevel(me->GetLevel());
|
||||
summoned->AddUnitState(UNIT_STATE_ROOT);
|
||||
|
||||
if (Unit* pFocusedTarget = ObjectAccessor::GetUnit(*me, FocusedTargetGUID))
|
||||
summoned->AI()->AttackStart(pFocusedTarget);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
//Inhibitmagic_Timer
|
||||
if (Inhibitmagic_Timer <= diff)
|
||||
{
|
||||
me->GetMap()->DoOnPlayers([this](Player* player)
|
||||
float dist = i_pl->GetDistance(me);
|
||||
if (i_pl->IsAlive() && i_pl->GetDistance(me) < 45.0f)
|
||||
{
|
||||
float dist = player->GetDistance(me);
|
||||
|
||||
if (player->IsAlive() && dist < 45.f)
|
||||
{
|
||||
player->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC);
|
||||
me->AddAura(SPELL_INHIBITMAGIC, player);
|
||||
if (dist < 35)
|
||||
me->AddAura(SPELL_INHIBITMAGIC, player);
|
||||
if (dist < 25)
|
||||
me->AddAura(SPELL_INHIBITMAGIC, player);
|
||||
if (dist < 15)
|
||||
me->AddAura(SPELL_INHIBITMAGIC, player);
|
||||
}
|
||||
});
|
||||
Inhibitmagic_Timer = 3000 + (rand32() % 1000);
|
||||
} else Inhibitmagic_Timer -= diff;
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Attractmagic_Timer
|
||||
if (Attractmagic_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_ATTRACTMAGIC);
|
||||
Attractmagic_Timer = 30000;
|
||||
Carnivorousbite_Timer = 1500;
|
||||
} else Attractmagic_Timer -= diff;
|
||||
|
||||
//Carnivorousbite_Timer
|
||||
if (Carnivorousbite_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_CARNIVOROUSBITE);
|
||||
Carnivorousbite_Timer = 10000;
|
||||
} else Carnivorousbite_Timer -= diff;
|
||||
|
||||
//FocusFire_Timer
|
||||
if (FocusFire_Timer <= diff)
|
||||
{
|
||||
// Summon Focus Fire & Emote
|
||||
Unit* target = SelectTarget(SelectTargetMethod::Random, 1);
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER && target->IsAlive())
|
||||
{
|
||||
FocusedTargetGUID = target->GetGUID();
|
||||
me->SummonCreature(NPC_FOCUS_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 5500ms);
|
||||
Talk(EMOTE_FOCUSED, target);
|
||||
i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC);
|
||||
me->AddAura(SPELL_INHIBITMAGIC, i_pl);
|
||||
if (dist < 35)
|
||||
me->AddAura(SPELL_INHIBITMAGIC, i_pl);
|
||||
if (dist < 25)
|
||||
me->AddAura(SPELL_INHIBITMAGIC, i_pl);
|
||||
if (dist < 15)
|
||||
me->AddAura(SPELL_INHIBITMAGIC, i_pl);
|
||||
}
|
||||
FocusFire_Timer = 15000 + (rand32() % 5000);
|
||||
} else FocusFire_Timer -= diff;
|
||||
});
|
||||
Inhibitmagic_Timer = 3000 + (rand32() % 1000);
|
||||
} else Inhibitmagic_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Attractmagic_Timer
|
||||
if (Attractmagic_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_ATTRACTMAGIC);
|
||||
Attractmagic_Timer = 30000;
|
||||
Carnivorousbite_Timer = 1500;
|
||||
} else Attractmagic_Timer -= diff;
|
||||
|
||||
//Carnivorousbite_Timer
|
||||
if (Carnivorousbite_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_CARNIVOROUSBITE);
|
||||
Carnivorousbite_Timer = 10000;
|
||||
} else Carnivorousbite_Timer -= diff;
|
||||
|
||||
//FocusFire_Timer
|
||||
if (FocusFire_Timer <= diff)
|
||||
{
|
||||
// Summon Focus Fire & Emote
|
||||
Unit* target = SelectTarget(SelectTargetMethod::Random, 1);
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER && target->IsAlive())
|
||||
{
|
||||
FocusedTargetGUID = target->GetGUID();
|
||||
me->SummonCreature(NPC_FOCUS_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 5500ms);
|
||||
Talk(EMOTE_FOCUSED, target);
|
||||
}
|
||||
FocusFire_Timer = 15000 + (rand32() % 5000);
|
||||
} else FocusFire_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
class npc_focus_fire : public CreatureScript
|
||||
struct npc_focus_fire : public ScriptedAI
|
||||
{
|
||||
public:
|
||||
npc_focus_fire() : CreatureScript("npc_focus_fire") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
npc_focus_fire(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
return GetAuchenaiCryptsAI<npc_focus_fireAI>(creature);
|
||||
Initialize();
|
||||
}
|
||||
|
||||
struct npc_focus_fireAI : public ScriptedAI
|
||||
void Initialize()
|
||||
{
|
||||
npc_focus_fireAI(Creature* creature) : ScriptedAI(creature)
|
||||
FieryBlast_Timer = 3000 + (rand32() % 1000);
|
||||
fiery1 = fiery2 = true;
|
||||
}
|
||||
|
||||
uint32 FieryBlast_Timer;
|
||||
bool fiery1, fiery2;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//FieryBlast_Timer
|
||||
if (fiery2 && FieryBlast_Timer <= diff)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
DoCast(me, SPELL_FIERY_BLAST);
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
FieryBlast_Timer = 3000 + (rand32() % 1000);
|
||||
fiery1 = fiery2 = true;
|
||||
}
|
||||
if (fiery1) fiery1 = false;
|
||||
else if (fiery2) fiery2 = false;
|
||||
|
||||
uint32 FieryBlast_Timer;
|
||||
bool fiery1, fiery2;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{ }
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//FieryBlast_Timer
|
||||
if (fiery2 && FieryBlast_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_FIERY_BLAST);
|
||||
|
||||
if (fiery1) fiery1 = false;
|
||||
else if (fiery2) fiery2 = false;
|
||||
|
||||
FieryBlast_Timer = 1000;
|
||||
} else FieryBlast_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
FieryBlast_Timer = 1000;
|
||||
} else FieryBlast_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_shirrak_the_dead_watcher()
|
||||
{
|
||||
new boss_shirrak_the_dead_watcher();
|
||||
new npc_focus_fire();
|
||||
RegisterAuchenaiCryptsCreatureAI(boss_shirrak_the_dead_watcher);
|
||||
RegisterAuchenaiCryptsCreatureAI(npc_focus_fire);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
{
|
||||
counter = DATA_FLAMECALLER_000;
|
||||
LoadObjectData(creatureData, nullptr);
|
||||
SetBossNumber(EncounterCount);
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
|
||||
@@ -30,6 +30,7 @@ class instance_the_botanica : public InstanceMapScript
|
||||
instance_the_botanica_InstanceMapScript(InstanceMap* map) : InstanceScript(map)
|
||||
{
|
||||
SetHeaders(DataHeader);
|
||||
SetBossNumber(EncounterCount);
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
|
||||
Reference in New Issue
Block a user