mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
fix(Scripts/Hyjal): Shadowy Necromancers now use Unholy Frenzy + Skeleton mage abilities (#18640)
init
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user