Skip to content

Commit

Permalink
Merge pull request #10 from elthehablo/akama-reset
Browse files Browse the repository at this point in the history
Akama reset
  • Loading branch information
elthehablo authored Sep 28, 2024
2 parents 8bf3595 + 0a78475 commit 7314458
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
3 changes: 3 additions & 0 deletions data/sql/updates/db_world/2024_09_28_01.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- DB update 2024_09_28_00 -> 2024_09_28_01
--
UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask` & ~2048 WHERE (`entry` = 22056);
2 changes: 2 additions & 0 deletions data/sql/updates/pending_db_world/super-healing-extra.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DELETE FROM `skill_extra_item_template` WHERE `spellId` = 28551;
INSERT INTO `skill_extra_item_template` (`spellId`, `requiredSpecialization`, `additionalCreateChance`, `additionalMaxNum`) VALUES (28551, 28675, 14, 4);
34 changes: 28 additions & 6 deletions src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ struct boss_shade_of_akama : public BossAI
{
channelers.clear();
generators.clear();

allPlayersInactive = false;
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetWalk(true);
me->SetReactState(REACT_DEFENSIVE);
CreaturesAttackAkama();
_shadeMinionList.clear();
BossAI::Reset();
}

Expand Down Expand Up @@ -196,8 +198,24 @@ struct boss_shade_of_akama : public BossAI

DoMeleeAttackIfReady();
}

void CreaturesAttackAkama()
{
// populate list of creatures to keep attacking Akama
me->GetCreaturesWithEntryInRange(_shadeMinionList, 100.0f, NPC_ASHTONGUE_SPIRITBIND);
me->GetCreaturesWithEntryInRange(_shadeMinionList, 100.0f, NPC_ASHTONGUE_DEFENDER);
me->GetCreaturesWithEntryInRange(_shadeMinionList, 100.0f, NPC_ASHTONGUE_ELEMENTAL);
me->GetCreaturesWithEntryInRange(_shadeMinionList, 100.0f, NPC_ASHTONGUE_ROGUE);
for (Creature* minion : _shadeMinionList)
if (minion->IsAlive())
minion->SetInCombatWith(instance->GetCreature(DATA_AKAMA_SHADE));
}
private:
std::list<Creature* > _shadeMinionList;
bool allPlayersInactive;
};


struct npc_akama_shade : public ScriptedAI
{
npc_akama_shade(Creature* creature) : ScriptedAI(creature)
Expand All @@ -222,6 +240,7 @@ struct npc_akama_shade : public ScriptedAI
_sayLowHealth = false;
_died = false;
scheduler.CancelAll();
_generators.clear();
}

void MovementInform(uint32 type, uint32 point) override
Expand Down Expand Up @@ -279,6 +298,11 @@ struct npc_akama_shade : public ScriptedAI
else if (damage >= me->GetHealth() && !_died)
{
_died = true;
me->GetCreatureListWithEntryInGrid(_generators, NPC_CREATURE_GENERATOR_AKAMA, 150.0f);
me->Yell(std::to_string(_generators.size()), LANG_UNIVERSAL);
for (Creature* generator : _generators)
generator->AI()->DoAction(ACTION_GENERATOR_DESPAWN_ALL);

damage = me->GetHealth() - 1;
Talk(SAY_DEATH);
if (Creature* shade = instance->GetCreature(DATA_SHADE_OF_AKAMA))
Expand Down Expand Up @@ -342,6 +366,7 @@ struct npc_akama_shade : public ScriptedAI
private:
bool _sayLowHealth;
bool _died;
std::list<Creature *> _generators;
};

struct npc_creature_generator_akama : public ScriptedAI
Expand All @@ -355,14 +380,14 @@ struct npc_creature_generator_akama : public ScriptedAI

void Reset() override
{
summons.DespawnAll();
scheduler.CancelAll();
}

void JustSummoned(Creature* summon) override
{
spawnCounter++;
ScriptedAI::JustSummoned(summon);
summons.Summon(summon);

switch (summon->GetEntry())
{
Expand All @@ -374,14 +399,11 @@ struct npc_creature_generator_akama : public ScriptedAI
summon->GetMotionMaster()->MovePoint(POINT_ENGAGE, x, y, z);
}
break;
case NPC_ASHTONGUE_DEFENDER:
default:
summon->SetFaction(FACTION_DEFENDER);
if (Creature* akama = instance->GetCreature(DATA_AKAMA_SHADE))
summon->AI()->AttackStart(akama);
break;
default:
summon->SetInCombatWithZone();
break;
}
}

Expand Down

0 comments on commit 7314458

Please sign in to comment.