diff options
author | Sorikoff <46191832+Sorikoff@users.noreply.github.com> | 2020-02-01 15:55:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-01 14:55:16 +0100 |
commit | e10239311c95866f9316521b570f8600c08a2ff5 (patch) | |
tree | 25f562ea67257381dba26e55d1d82cd4f8816943 /src | |
parent | 6c85964065dc2b2d397904d79755eacc43a8ab0d (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>
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 4 | ||||
-rw-r--r-- | src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp | 36 |
2 files changed, 36 insertions, 4 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 9c5b9cd4567..943a197e6da 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3519,10 +3519,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) 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, true); - 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 3a3650d45f9..46b7fb0d844 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" @@ -1075,6 +1076,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 ####*/ @@ -1315,6 +1350,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(); } |