mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Core/Spells: fixed several conditional procs of 4.0.3a content trinkets
This commit is contained in:
46
sql/updates/world/custom/custom_2019_08_19_00_world.sql
Normal file
46
sql/updates/world/custom/custom_2019_08_19_00_world.sql
Normal file
@@ -0,0 +1,46 @@
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN
|
||||
('spell_item_egg_shell',
|
||||
'spell_item_song_of_sorrow',
|
||||
'spell_item_crescendo_of_suffering',
|
||||
'spell_item_proc_armor',
|
||||
'spell_item_proc_mastery_below_35',
|
||||
'spell_item_hearts_judgement',
|
||||
'spell_item_hearts_judgement_heroic',
|
||||
'spell_item_forged_fury');
|
||||
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(91296, 'spell_item_egg_shell'),
|
||||
(91308, 'spell_item_egg_shell'),
|
||||
(90998, 'spell_item_song_of_sorrow'),
|
||||
(91003, 'spell_item_song_of_sorrow'),
|
||||
(90996, 'spell_item_crescendo_of_suffering'),
|
||||
(91002, 'spell_item_crescendo_of_suffering'),
|
||||
(92180, 'spell_item_proc_armor'),
|
||||
(92185, 'spell_item_proc_armor'),
|
||||
(92236, 'spell_item_proc_mastery_below_35'),
|
||||
(92356, 'spell_item_proc_mastery_below_35'),
|
||||
(91041, 'spell_item_hearts_judgement'),
|
||||
(92328, 'spell_item_hearts_judgement_heroic'),
|
||||
(92328, 'spell_item_forged_fury');
|
||||
|
||||
DELETE FROM `spell_proc` WHERE `SpellId` IN (90998, 91003);
|
||||
SET @PROC_FLAG := 0 | 0x00010000;
|
||||
SET @TYPE_MASK := 0 | 0x1;
|
||||
SET @PHASE_MASK := 0 | 0x2;
|
||||
SET @HIT_MASK := 0;
|
||||
|
||||
INSERT INTO `spell_proc` (`SpellId`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `Cooldown`) VALUES
|
||||
(90998, @PROC_FLAG, @TYPE_MASK, @PHASE_MASK, @HIT_MASK, 0),
|
||||
(91003, @PROC_FLAG, @TYPE_MASK, @PHASE_MASK, @HIT_MASK, 0);
|
||||
|
||||
DELETE FROM `spell_proc` WHERE `SpellId` IN (92180, 92185, 92236, 92356);
|
||||
SET @PROC_FLAG := 0 | 0x00000028;
|
||||
SET @TYPE_MASK := 0 | 0x1;
|
||||
SET @PHASE_MASK := 0;
|
||||
SET @HIT_MASK := 0;
|
||||
|
||||
INSERT INTO `spell_proc` (`SpellId`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `Cooldown`) VALUES
|
||||
(92180, @PROC_FLAG, @TYPE_MASK, @PHASE_MASK, @HIT_MASK, 30000),
|
||||
(92185, @PROC_FLAG, @TYPE_MASK, @PHASE_MASK, @HIT_MASK, 30000),
|
||||
(92236, @PROC_FLAG, @TYPE_MASK, @PHASE_MASK, @HIT_MASK, 30000),
|
||||
(92356, @PROC_FLAG, @TYPE_MASK, @PHASE_MASK, @HIT_MASK, 30000);
|
||||
@@ -5095,6 +5095,8 @@ void AddSC_generic_spell_scripts()
|
||||
new spell_gen_proc_below_pct_damaged("spell_item_corpse_tongue_coin_heroic");
|
||||
new spell_gen_proc_below_pct_damaged("spell_item_petrified_twilight_scale");
|
||||
new spell_gen_proc_below_pct_damaged("spell_item_petrified_twilight_scale_heroic");
|
||||
new spell_gen_proc_below_pct_damaged("spell_item_proc_armor");
|
||||
new spell_gen_proc_below_pct_damaged("spell_item_proc_mastery_below_35");
|
||||
new spell_gen_proc_charge_drop_only();
|
||||
new spell_gen_parachute();
|
||||
new spell_gen_pet_summoned();
|
||||
|
||||
@@ -4678,6 +4678,147 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
enum EggShell
|
||||
{
|
||||
SPELL_EGG_SHELL_NORMAL = 91296,
|
||||
SPELL_EGG_SHELL_PERIODIC_NORMAL = 91306,
|
||||
SPELL_EGG_SHELL_CANCEL_NORMAL = 91305,
|
||||
SPELL_EGG_SHELL_PERIODIC_HEROIC = 91311,
|
||||
SPELL_EGG_SHELL_CANCEL_HEROIC = 91310
|
||||
};
|
||||
|
||||
// 91296, 91308 - Egg Shell
|
||||
class spell_item_egg_shell : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_item_egg_shell);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_EGG_SHELL_NORMAL,
|
||||
SPELL_EGG_SHELL_PERIODIC_NORMAL,
|
||||
SPELL_EGG_SHELL_CANCEL_NORMAL,
|
||||
SPELL_EGG_SHELL_PERIODIC_HEROIC,
|
||||
SPELL_EGG_SHELL_CANCEL_HEROIC
|
||||
});
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
GetTarget()->CastSpell(GetTarget(), GetSpellInfo()->Id == SPELL_EGG_SHELL_NORMAL ? SPELL_EGG_SHELL_PERIODIC_NORMAL : SPELL_EGG_SHELL_PERIODIC_HEROIC, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_CANCEL)
|
||||
GetTarget()->CastSpell(GetTarget(), GetSpellInfo()->Id == SPELL_EGG_SHELL_NORMAL ? SPELL_EGG_SHELL_PERIODIC_NORMAL : SPELL_EGG_SHELL_PERIODIC_HEROIC, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_item_egg_shell::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_item_egg_shell::HandleEffectRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_item_song_of_sorrow : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_item_song_of_sorrow);
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
return false;
|
||||
|
||||
int32 pct = GetSpellInfo()->Effects[EFFECT_0].BasePoints;
|
||||
|
||||
if (!damageInfo->GetVictim()->HealthBelowPctDamaged(pct, damageInfo->GetDamage()))
|
||||
return false;
|
||||
|
||||
uint32 spellId = GetSpellInfo()->Effects[EFFECT_0].TriggerSpell;
|
||||
return !GetTarget()->GetSpellHistory()->HasCooldown(spellId) && !GetTarget()->HasAura(spellId);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_item_song_of_sorrow::CheckProc);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_item_crescendo_of_suffering : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_item_crescendo_of_suffering);
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->GetSpellHistory()->AddCooldown(GetSpellInfo()->Id, 0, 10s);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_item_crescendo_of_suffering::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_DAMAGE_DONE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
enum ConsumeCharges
|
||||
{
|
||||
SPELL_HEARTS_REVELATION = 91027,
|
||||
SPELL_HEARTS_REVELATION_HEROIC = 92325,
|
||||
SPELL_RAW_FURY = 91832
|
||||
};
|
||||
|
||||
class spell_item_consume_charges : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_item_consume_charges(char const* ScriptName, uint32 SpellId) : SpellScriptLoader(ScriptName), _spellId(SpellId) { }
|
||||
|
||||
class spell_item_consume_charges_SpellScript : public SpellScript
|
||||
{
|
||||
friend class spell_item_consume_charges;
|
||||
spell_item_consume_charges_SpellScript(uint32 SpellId) : SpellScript(), _spellId(SpellId) { }
|
||||
|
||||
PrepareSpellScript(spell_item_consume_charges_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ _spellId });
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
if (Aura* aura = GetCaster()->GetAura(_spellId, GetCaster()->GetGUID()))
|
||||
if (aura->GetStackAmount() == aura->GetSpellInfo()->StackAmount)
|
||||
return SPELL_CAST_OK;
|
||||
|
||||
return SPELL_FAILED_CASTER_AURASTATE;
|
||||
}
|
||||
|
||||
void HandleStackConsumption()
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->RemoveAurasDueToSpell(_spellId, caster->GetGUID());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_item_consume_charges_SpellScript::CheckCast);
|
||||
AfterCast += SpellCastFn(spell_item_consume_charges_SpellScript::HandleStackConsumption);
|
||||
}
|
||||
|
||||
uint32 _spellId;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_item_consume_charges_SpellScript(_spellId);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _spellId;
|
||||
};
|
||||
|
||||
void AddSC_item_spell_scripts()
|
||||
{
|
||||
// 23074 Arcanite Dragonling
|
||||
@@ -4797,4 +4938,10 @@ void AddSC_item_spell_scripts()
|
||||
|
||||
new spell_item_mad_alchemists_potion();
|
||||
new spell_item_crazy_alchemists_potion();
|
||||
RegisterAuraScript(spell_item_egg_shell);
|
||||
RegisterAuraScript(spell_item_song_of_sorrow);
|
||||
RegisterAuraScript(spell_item_crescendo_of_suffering);
|
||||
new spell_item_consume_charges("spell_item_hearts_judgement", SPELL_HEARTS_REVELATION);
|
||||
new spell_item_consume_charges("spell_item_hearts_judgement_heroic", SPELL_HEARTS_REVELATION_HEROIC);
|
||||
new spell_item_consume_charges("spell_item_forged_fury", SPELL_RAW_FURY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user