diff --git a/data/sql/updates/pending_db_world/skeletonmages.sql b/data/sql/updates/pending_db_world/skeletonmages.sql new file mode 100644 index 000000000..a16c945f7 --- /dev/null +++ b/data/sql/updates/pending_db_world/skeletonmages.sql @@ -0,0 +1,10 @@ +-- +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 17903; + +DELETE FROM `smart_scripts` WHERE `entryorguid` = 17903 AND `source_type` = 0; +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 +(17903, 0, 0, 0, 4, 0, 100, 512, 0, 0, 0, 0, 0, 0, 30, 1, 2, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Skeleton Mage - On Aggro - Set Event Phase Random'), +(17903, 0, 1, 0, 0, 1, 100, 0, 0, 0, 3000, 3500, 0, 0, 11, 31622, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Skeleton Mage - In Combat - Cast Frostbolt'), +(17903, 0, 2, 0, 0, 2, 100, 0, 0, 0, 3000, 3500, 0, 0, 11, 31618, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Skeleton Mage - In Combat - Cast Shadow Bolt'), +(17903, 0, 3, 0, 0, 4, 100, 0, 0, 0, 3000, 3500, 0, 0, 11, 31620, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Skeleton Mage - In Combat - Cast Fireball'); + diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp index d46a0fb33..9768ba034 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp @@ -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 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()) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h index 954d2a838..b0c127f49 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h @@ -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,