Skip to content
Permalink
Browse files

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>
  • Loading branch information
Sorikoff and jackpoz committed Feb 1, 2020
1 parent 6c85964 commit e10239311c95866f9316521b570f8600c08a2ff5
@@ -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)');
@@ -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)
@@ -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 @@ class npc_scarlet_ghoul : public CreatureScript

};

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();
}

0 comments on commit e102393

Please sign in to comment.
You can’t perform that action at this time.