fix(Scripts/Hyjal): Shadowy Necromancers now use Unholy Frenzy + Skeleton mage abilities (#18640)

init
This commit is contained in:
Dan
2024-03-31 18:59:27 +02:00
committed by GitHub
parent e79507fe66
commit 102bf7c9c5
3 changed files with 45 additions and 0 deletions

View File

@@ -55,6 +55,7 @@ enum Spells
SPELL_RAISE_DEAD_1 = 31617,
SPELL_RAISE_DEAD_2 = 31624,
SPELL_RAISE_DEAD_3 = 31625,
SPELL_UNHOLY_FRENZY = 31626,
SPELL_SHADOW_BOLT = 31627,
// Banshee (Ranged)
@@ -84,6 +85,8 @@ enum Talk
SAY_TELEPORT = 7
};
const float UNHOLY_FRENZY_RANGE = 30.0f;
class npc_hyjal_jaina : public CreatureScript
{
public:
@@ -411,6 +414,13 @@ struct npc_hyjal_ground_trash : public ScriptedAI
break;
}
context.Repeat(10s, 20s);
}).Schedule(15s, 20s, [this](TaskContext context)
{
if (Creature* target = GetNearbyFriendlyTrashCreature(UNHOLY_FRENZY_RANGE))
{
DoCast(target, SPELL_UNHOLY_FRENZY);
}
context.Repeat(15s, 20s);
});
break;
}
@@ -501,6 +511,27 @@ struct npc_hyjal_ground_trash : public ScriptedAI
}
}
Creature* GetNearbyFriendlyTrashCreature(float radius)
{
//need accurate timer
Creature* creatureToReturn = nullptr;
std::list<Creature*> creatureList;
GetCreatureListWithEntryInGrid(creatureList, me, NPC_ABOMI, radius);
GetCreatureListWithEntryInGrid(creatureList, me, NPC_BANSH, radius);
GetCreatureListWithEntryInGrid(creatureList, me, NPC_STALK, radius);
GetCreatureListWithEntryInGrid(creatureList, me, NPC_NECRO, radius);
GetCreatureListWithEntryInGrid(creatureList, me, NPC_CRYPT, radius);
GetCreatureListWithEntryInGrid(creatureList, me, NPC_GHOUL, radius);
GetCreatureListWithEntryInGrid(creatureList, me, NPC_SKELETON_INVADER, radius);
Acore::Containers::RandomResize(creatureList, 1);
if (creatureList.size() > 0)
{
creatureToReturn = creatureList.front();
}
creatureList.clear();
return creatureToReturn;
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())

View File

@@ -78,6 +78,10 @@ enum HyjalCreaturesIds
NPC_STALK = 17916,
NPC_BUILD = 18304, // Serverside creature? Not found in CreateObject packets, but seen as targets
// Summoned necromancer mobs
NPC_SKELETON_INVADER = 17902,
NPC_SKELETON_MAGE = 17903,
// Alliance Base
NPC_JAINA = 17772,
NPC_ALLIANCE_PEASANT = 17931,