mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(Scripts/TheBlackTemple): resetting behaviour in p1 for Shade of Akama (#20076)
* init * Update boss_shade_of_akama.cpp * Update boss_shade_of_akama.cpp * Update boss_shade_of_akama.cpp * update factions bench with the faction sniffs Co-Authored-By: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> * set spawned creatures in combat again Co-Authored-By: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> * wip change faction to defender * Update boss_shade_of_akama.cpp * Update boss_shade_of_akama.cpp * set hostiles in combat * Akama shade reset test (#12) compilation of commits with fixes and debugging * Update boss_shade_of_akama.cpp * Update factions_shade.sql * Update factions_shade.sql * Update factions_shade.sql * Update factions_shade.sql * 5s instead of 5ms * change faction enum names * revert faction change on player death * unused import * Update boss_shade_of_akama.cpp * unsummon all non-defenders * clear summons on all players dead * blank space * make creatures not stop spawning on player wipe * oops --------- Co-authored-by: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com>
This commit is contained in:
24
data/sql/updates/pending_db_world/factions_shade.sql
Normal file
24
data/sql/updates/pending_db_world/factions_shade.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
-- Rogue, elementalist, spiritbinder
|
||||
UPDATE `creature_template` SET `faction` = 16, `VerifiedBuild` = 53788 WHERE `entry` IN (23318, 23523, 23524);
|
||||
|
||||
-- Shade of Akama
|
||||
UPDATE `creature_template` SET `faction` = 1692, `VerifiedBuild` = 53788 WHERE `entry` = 22841;
|
||||
|
||||
-- Ashtongue Defender
|
||||
UPDATE `creature_template` SET `faction` = 1847, `VerifiedBuild` = 53788 WHERE `entry` = 23216;
|
||||
|
||||
-- Sorcerer, channeler
|
||||
UPDATE `creature_template` SET `faction` = 1849, `VerifiedBuild` = 53788 WHERE `entry` IN (23215, 23421);
|
||||
|
||||
-- SAI
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23318) AND (`source_type` = 0) AND (`id` IN (2));
|
||||
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
|
||||
(23318, 0, 2, 0, 7, 0, 100, 0, 0, 0, 0, 0, 0, 0, 223, 4, 0, 0, 0, 0, 0, 9, 23210, 0, 100, 0, 0, 0, 0, 0, 'Ashtongue Rogue - On Evade - Do Action');
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23523) AND (`source_type` = 0) AND (`id` IN (2));
|
||||
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
|
||||
(23523, 0, 2, 0, 7, 0, 100, 0, 0, 0, 0, 0, 0, 0, 223, 4, 0, 0, 0, 0, 0, 9, 23210, 0, 100, 0, 0, 0, 0, 0, 'Ashtongue Elementalist - On Evade - Do Action');
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23524) AND (`source_type` = 0) AND (`id` IN (2));
|
||||
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
|
||||
(23524, 0, 2, 0, 7, 0, 100, 0, 0, 0, 0, 0, 0, 0, 223, 4, 0, 0, 0, 0, 0, 9, 23210, 0, 100, 0, 0, 0, 0, 0, 'Ashtongue Spiritbinder - On Evade - Do Action');
|
||||
@@ -27,67 +27,67 @@
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_BROKEN_FREE_0 = 0,
|
||||
SAY_BROKEN_FREE_1 = 1,
|
||||
SAY_BROKEN_FREE_2 = 2,
|
||||
SAY_LOW_HEALTH = 3,
|
||||
SAY_DEATH = 4,
|
||||
SAY_BROKEN_FREE_0 = 0,
|
||||
SAY_BROKEN_FREE_1 = 1,
|
||||
SAY_BROKEN_FREE_2 = 2,
|
||||
SAY_LOW_HEALTH = 3,
|
||||
SAY_DEATH = 4,
|
||||
|
||||
SAY_BROKEN_S1 = 0,
|
||||
SAY_BROKEN_S2 = 1
|
||||
SAY_BROKEN_S1 = 0,
|
||||
SAY_BROKEN_S2 = 1
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
// Akama
|
||||
SPELL_STEALTH = 34189,
|
||||
SPELL_DESTRUCTIVE_POISON = 40874,
|
||||
SPELL_CHAIN_LIGHTNING = 39945,
|
||||
SPELL_AKAMA_SOUL_CHANNEL = 40447,
|
||||
SPELL_FIXATE = 40607,
|
||||
SPELL_AKAMA_SOUL_RETRIEVE = 40902, // epilogue
|
||||
SPELL_AKAMA_SOUL_EXPEL_CHANNEL = 40927, // epilogue
|
||||
SPELL_STEALTH = 34189,
|
||||
SPELL_DESTRUCTIVE_POISON = 40874,
|
||||
SPELL_CHAIN_LIGHTNING = 39945,
|
||||
SPELL_AKAMA_SOUL_CHANNEL = 40447,
|
||||
SPELL_FIXATE = 40607,
|
||||
SPELL_AKAMA_SOUL_RETRIEVE = 40902, // epilogue
|
||||
SPELL_AKAMA_SOUL_EXPEL_CHANNEL = 40927, // epilogue
|
||||
|
||||
// Shade & Channelers
|
||||
SPELL_SHADE_SOUL_CHANNEL = 40401,
|
||||
SPELL_THREAT = 41602,
|
||||
SPELL_SHADE_OF_AKAMA_TRIGGER = 40955,
|
||||
SPELL_SHADE_SOUL_CHANNEL = 40401,
|
||||
SPELL_THREAT = 41602,
|
||||
SPELL_SHADE_OF_AKAMA_TRIGGER = 40955,
|
||||
|
||||
// Summons
|
||||
SPELL_ASHTONGUE_WAVE_A = 42073, // unused
|
||||
SPELL_ASHTONGUE_WAVE_B = 42035,
|
||||
SPELL_SUMMON_ASHTONGUE_SORCERER = 40476,
|
||||
SPELL_SUMMON_ASHTONGUE_DEFENDER = 40474
|
||||
SPELL_ASHTONGUE_WAVE_A = 42073, // unused
|
||||
SPELL_ASHTONGUE_WAVE_B = 42035,
|
||||
SPELL_SUMMON_ASHTONGUE_SORCERER = 40476,
|
||||
SPELL_SUMMON_ASHTONGUE_DEFENDER = 40474
|
||||
};
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
NPC_ASHTONGUE_SORCERER = 23215,
|
||||
NPC_ASHTONGUE_DEFENDER = 23216,
|
||||
NPC_ASHTONGUE_ELEMENTAL = 23523,
|
||||
NPC_ASHTONGUE_ROGUE = 23318,
|
||||
NPC_ASHTONGUE_SPIRITBIND = 23524,
|
||||
NPC_ASHTONGUE_BROKEN = 23319
|
||||
NPC_ASHTONGUE_SORCERER = 23215,
|
||||
NPC_ASHTONGUE_DEFENDER = 23216,
|
||||
NPC_ASHTONGUE_ELEMENTAL = 23523,
|
||||
NPC_ASHTONGUE_ROGUE = 23318,
|
||||
NPC_ASHTONGUE_SPIRITBIND = 23524,
|
||||
NPC_ASHTONGUE_BROKEN = 23319
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
SUMMON_GROUP_BROKENS = 1,
|
||||
SUMMON_GROUP_BROKENS = 1,
|
||||
|
||||
POINT_ENGAGE = 0,
|
||||
POINT_OUTRO = 1,
|
||||
POINT_ENGAGE = 0,
|
||||
POINT_OUTRO = 1,
|
||||
|
||||
ACTION_GENERATOR_START = 1,
|
||||
ACTION_GENERATOR_STOP = 2,
|
||||
ACTION_GENERATOR_DESPAWN_ALL = 3,
|
||||
ACTION_GENERATOR_START = 1,
|
||||
ACTION_GENERATOR_STOP = 2,
|
||||
ACTION_GENERATOR_DESPAWN_ALL = 3,
|
||||
ACTION_GENERATOR_DESPAWN_NON_DEFENDERS = 4,
|
||||
|
||||
COUNTER_SPAWNS_MAX = 20, // Max number of spawns for each generator, number chosen at random
|
||||
COUNTER_SPAWNS_MAX = 20, // Max number of spawns for each generator, number chosen at random
|
||||
|
||||
ACTION_AKAMA_START_OUTRO = 1,
|
||||
ACTION_AKAMA_START_OUTRO = 1,
|
||||
|
||||
FACTION_DEFAULT = 1820,
|
||||
FACTION_ENGAGE = 1868,
|
||||
FACTION_DEFENDER = 1847
|
||||
FACTION_DEFAULT = 1820,
|
||||
FACTION_MONSTER_SPAR = 1847
|
||||
};
|
||||
|
||||
Position AkamaEngage = { 517.4877f, 400.79926f, 112.77704f };
|
||||
@@ -222,6 +222,7 @@ struct npc_akama_shade : public ScriptedAI
|
||||
_sayLowHealth = false;
|
||||
_died = false;
|
||||
scheduler.CancelAll();
|
||||
_generators.clear();
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 point) override
|
||||
@@ -232,7 +233,7 @@ struct npc_akama_shade : public ScriptedAI
|
||||
{
|
||||
case POINT_ENGAGE:
|
||||
me->SetHomePosition(me->GetPosition());
|
||||
me->SetFaction(FACTION_ENGAGE);
|
||||
me->SetFaction(FACTION_MONSTER_SPAR_BUDDY);
|
||||
DoCastSelf(SPELL_AKAMA_SOUL_CHANNEL, true);
|
||||
break;
|
||||
case POINT_OUTRO:
|
||||
@@ -279,6 +280,10 @@ struct npc_akama_shade : public ScriptedAI
|
||||
else if (damage >= me->GetHealth() && !_died)
|
||||
{
|
||||
_died = true;
|
||||
me->GetCreatureListWithEntryInGrid(_generators, NPC_CREATURE_GENERATOR_AKAMA, 100.0f);
|
||||
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))
|
||||
@@ -342,6 +347,7 @@ struct npc_akama_shade : public ScriptedAI
|
||||
private:
|
||||
bool _sayLowHealth;
|
||||
bool _died;
|
||||
std::list<Creature *> _generators;
|
||||
};
|
||||
|
||||
struct npc_creature_generator_akama : public ScriptedAI
|
||||
@@ -355,7 +361,6 @@ struct npc_creature_generator_akama : public ScriptedAI
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
summons.DespawnAll();
|
||||
scheduler.CancelAll();
|
||||
}
|
||||
|
||||
@@ -363,6 +368,7 @@ struct npc_creature_generator_akama : public ScriptedAI
|
||||
{
|
||||
spawnCounter++;
|
||||
ScriptedAI::JustSummoned(summon);
|
||||
summons.Summon(summon);
|
||||
|
||||
switch (summon->GetEntry())
|
||||
{
|
||||
@@ -374,13 +380,10 @@ struct npc_creature_generator_akama : public ScriptedAI
|
||||
summon->GetMotionMaster()->MovePoint(POINT_ENGAGE, x, y, z);
|
||||
}
|
||||
break;
|
||||
case NPC_ASHTONGUE_DEFENDER:
|
||||
summon->SetFaction(FACTION_DEFENDER);
|
||||
if (Creature* akama = instance->GetCreature(DATA_AKAMA_SHADE))
|
||||
summon->AI()->AttackStart(akama);
|
||||
break;
|
||||
default:
|
||||
summon->SetInCombatWithZone();
|
||||
if (Creature* akama = instance->GetCreature(DATA_AKAMA_SHADE))
|
||||
summon->AI()->AttackStart(akama);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -434,6 +437,14 @@ struct npc_creature_generator_akama : public ScriptedAI
|
||||
summons.DespawnAll();
|
||||
scheduler.CancelAll();
|
||||
break;
|
||||
case ACTION_GENERATOR_DESPAWN_NON_DEFENDERS:
|
||||
summons.DoForAllSummons([&](WorldObject* summon)
|
||||
{
|
||||
if (Creature* c = summon->ToCreature())
|
||||
if (c->GetEntry() != NPC_ASHTONGUE_DEFENDER && c->GetEntry() != NPC_ASHTONGUE_SORCERER)
|
||||
c->DespawnOrUnsummon();
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user