aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
index 6b6343e9830..c5a7b89293d 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "CreatureAIImpl.h"
#include "ScriptMgr.h"
#include "CombatAI.h"
#include "CreatureTextMgr.h"
@@ -1072,6 +1073,40 @@ public:
};
+enum GiftOfTheHarvester
+{
+ SPELL_GHOUL_TRANFORM = 52490,
+ SPELL_GHOST_TRANSFORM = 52505
+};
+
+class spell_gift_of_the_harvester : public SpellScript
+{
+ PrepareSpellScript(spell_gift_of_the_harvester);
+
+ bool Validate(SpellInfo const* /*spell*/) override
+ {
+ return ValidateSpellInfo(
+ {
+ SPELL_GHOUL_TRANFORM,
+ SPELL_GHOST_TRANSFORM
+ });
+ }
+
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ {
+ Unit* originalCaster = GetOriginalCaster();
+ Unit* target = GetHitUnit();
+
+ if (originalCaster && target)
+ originalCaster->CastSpell(target, RAND(SPELL_GHOUL_TRANFORM, SPELL_GHOST_TRANSFORM), true);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gift_of_the_harvester::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
/*####
## npc_scarlet_miner_cart
####*/
@@ -1314,6 +1349,7 @@ void AddSC_the_scarlet_enclave_c1()
new npc_ros_dark_rider();
new npc_dkc1_gothik();
new npc_scarlet_ghoul();
+ RegisterSpellScript(spell_gift_of_the_harvester);
new npc_scarlet_miner();
new npc_scarlet_miner_cart();
}