aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms
diff options
context:
space:
mode:
authorSorikoff <46191832+Sorikoff@users.noreply.github.com>2020-02-01 15:55:16 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-21 00:48:30 +0100
commit6433ed6014d199ffe381f5fbc5ee5ec5b85da962 (patch)
tree8ee1539b8d30597d721d886118a125645cfb59dd /src/server/scripts/EasternKingdoms
parentf1f1bc01ba418056bdfd311fc9df218213e83009 (diff)
Scripts/Spells: Gift of the Harvester (#24111)
* Scripts/Spells: Gift of the Harvester * Scripts/Spells: nopch * Scripts/Spells: nopch * Scripts/Spells: validate * Rename 9999_99_99_99_world.sql to 2020_02_01_03_world.sql Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com> (cherry picked from commit e10239311c95866f9316521b570f8600c08a2ff5)
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();
}