aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/master/2021_12_20_44_world_2020_02_01_03_world.sql6
-rw-r--r--src/server/game/Spells/SpellEffects.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp36
3 files changed, 42 insertions, 5 deletions
diff --git a/sql/updates/world/master/2021_12_20_44_world_2020_02_01_03_world.sql b/sql/updates/world/master/2021_12_20_44_world_2020_02_01_03_world.sql
new file mode 100644
index 00000000000..2c7fd74145a
--- /dev/null
+++ b/sql/updates/world/master/2021_12_20_44_world_2020_02_01_03_world.sql
@@ -0,0 +1,6 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gift_of_the_harvester';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (52479,'spell_gift_of_the_harvester');
+
+DELETE FROM `disables` WHERE `sourceType`=0 AND `entry`=52479;
+INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES
+(0,52479,64,'','','Gift of the Harvester (LOS)');
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 1c1a56c2bb4..e3297b1407d 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -3067,11 +3067,6 @@ void Spell::EffectScriptEffect()
if (unitTarget->GetTypeId() == TYPEID_UNIT && unitTarget->IsSummon())
unitTarget->ToTempSummon()->UnSummon();
return;
- case 52479: // Gift of the Harvester
- if (unitTarget && unitCaster)
- unitCaster->CastSpell(unitTarget, urand(0, 1) ? damage : 52505, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
- .SetOriginalCastId(m_castId));
- return;
case 57347: // Retrieving (Wintergrasp RP-GG pickup spell)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT || m_caster->GetTypeId() != TYPEID_PLAYER)
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();
}