mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-06 20:37:45 +00:00
fix(Core/Spell): handle 5,000 Gold with SpellScript (#6996)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1626472277718613700');
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id` = 46642 AND `ScriptName` = 'spell_gen_5000_gold';
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(46642, 'spell_gen_5000_gold');
|
||||
@@ -3919,17 +3919,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
}
|
||||
break;
|
||||
}*/
|
||||
/* disabled for now, was being abused
|
||||
// 5,000 Gold
|
||||
case 46642:
|
||||
{
|
||||
if( !m_originalCaster || !unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
unitTarget->ToPlayer()->ModifyMoney(5000 * GOLD);
|
||||
|
||||
break;
|
||||
}*/
|
||||
// Roll Dice - Decahedral Dwarven Dice
|
||||
case 47770:
|
||||
{
|
||||
|
||||
@@ -35,7 +35,36 @@
|
||||
// there is probably some underlying problem with imports which should properly addressed
|
||||
#include "GridNotifiersImpl.h"
|
||||
|
||||
// Ours
|
||||
// 46642 - 5,000 Gold
|
||||
class spell_gen_5000_gold : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_5000_gold() : SpellScriptLoader("spell_gen_5000_gold") {}
|
||||
|
||||
class spell_gen_5000_gold_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_5000_gold_SpellScript);
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Player* target = GetHitPlayer())
|
||||
{
|
||||
target->ModifyMoney(5000 * GOLD);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_5000_gold_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_gen_5000_gold_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gen_model_visible : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -5149,7 +5178,7 @@ public:
|
||||
|
||||
void AddSC_generic_spell_scripts()
|
||||
{
|
||||
// ours:
|
||||
new spell_gen_5000_gold();
|
||||
new spell_gen_model_visible();
|
||||
new spell_the_flag_of_ownership();
|
||||
new spell_gen_have_item_auras();
|
||||
@@ -5196,8 +5225,6 @@ void AddSC_generic_spell_scripts()
|
||||
new spell_gen_flurry_of_claws();
|
||||
new spell_gen_throw_back();
|
||||
new spell_gen_haunted();
|
||||
|
||||
// theirs:
|
||||
new spell_gen_absorb0_hitlimit1();
|
||||
new spell_gen_adaptive_warding();
|
||||
new spell_gen_av_drekthar_presence();
|
||||
|
||||
Reference in New Issue
Block a user