Core/Scripts: Convert spells to new proc system

- Converted Unit::HandleDummyAuraProc function to AuraScripts
  * Extra: DMC: Madness now uses DB texts. yay!
  * Extra: improvements on Imp. Spell Reflection (range and max targets, filter caster with conditions)

- Fixed Glyph of Succubus. (Closes #6599)

- Changed old (not-blizz) behavior of Vampiric Embrace:
  * Before: party heal affected the priest too and self heal was reduced by that amount to not over-heal
  * Now: self heal amount not affected, rather filter the priest out of the party heal using conditions :)

- Solve bug in AQ 3p set bonus, it should only trigger when healing others, not self heals.
- Priest T10 2p bonus (heal) now rolls its effect properly

- Use brand new GetEffectiveHeal to fix #17142
- While we're at it, also close #17034 for good
- Converted Unit::HandleAuraProc function to AuraScripts (#17941)
- Converted Unit::HandleAuraProc function to AuraScripts (cont'd) (#17955)
- Corrected Flametongue weapon damage formula
- Actually check offhand weapon for flametongue in Lava Lash script
- Implemented halved proc chance for Missile Barrage on Arcane Barrage, Fireball, Frostbolt and Frostfire Bolt cast
- Converted Unit::HandleProcTriggerSpell function to AuraScripts (#17956)
- De-hack Earth shield. Fixes #13808
- Updated Honor among Thieves
- Implemented mana proc for Mark of Conquest in case of ranged attack
- Fixed Scent of Blood giving more stacks than the talent rank currently learnt.
- Ported old proc table. Proc system is dead. Long live the proc system!
- Recklessness should get charges removed per cast. Closes #15529
- Use proc system to remove Molten Core charges on Incinerate/Soul Fire cast. Closes #15942

Closes #3463
Closes #5401
Closes #15595
Closes #15974
Closes #16679
Closes #17925
This commit is contained in:
ariel-
2016-09-25 20:48:31 -03:00
parent e641d0c7d7
commit 2ff855054f
28 changed files with 9190 additions and 323 deletions

View File

@@ -35,6 +35,17 @@ enum HunterCreatures
NPC_HUNTER_VIPER = 19921
};
enum PetSpellsMisc
{
SPELL_PET_GUARD_DOG_HAPPINESS = 54445,
SPELL_PET_SILVERBACK_RANK_1 = 62800,
SPELL_PET_SILVERBACK_RANK_2 = 62801,
PET_ICON_ID_GROWL = 201,
PET_ICON_ID_CLAW = 262,
PET_ICON_ID_BITE = 1680,
PET_ICON_ID_SMACK = 473
};
class npc_pet_hunter_snake_trap : public CreatureScript
{
public:
@@ -139,7 +150,156 @@ class npc_pet_hunter_snake_trap : public CreatureScript
}
};
// -53178 - Guard Dog
class spell_pet_guard_dog : public SpellScriptLoader
{
public:
spell_pet_guard_dog() : SpellScriptLoader("spell_pet_guard_dog") { }
class spell_pet_guard_dog_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pet_guard_dog_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_PET_GUARD_DOG_HAPPINESS))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
// Growl shares family flags with other spells
// filter by spellIcon instead
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
if (!spellInfo || spellInfo->SpellIconID != PET_ICON_ID_GROWL)
return false;
return true;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
caster->CastSpell((Unit*)nullptr, SPELL_PET_GUARD_DOG_HAPPINESS, true);
float addThreat = CalculatePct(eventInfo.GetSpellInfo()->Effects[EFFECT_0].CalcValue(caster), aurEff->GetAmount());
eventInfo.GetProcTarget()->AddThreat(caster, addThreat);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_pet_guard_dog_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_pet_guard_dog_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_pet_guard_dog_AuraScript();
}
};
// -62764 - Silverback
class spell_pet_silverback : public SpellScriptLoader
{
public:
spell_pet_silverback() : SpellScriptLoader("spell_pet_silverback") { }
class spell_pet_silverback_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pet_silverback_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_PET_GUARD_DOG_HAPPINESS))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
// Growl shares family flags with other spells
// filter by spellIcon instead
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
if (!spellInfo || spellInfo->SpellIconID != PET_ICON_ID_GROWL)
return false;
return true;
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
static uint32 const triggerSpell[2] = { SPELL_PET_SILVERBACK_RANK_1, SPELL_PET_SILVERBACK_RANK_2 };
PreventDefaultAction();
uint32 spellId = triggerSpell[GetSpellInfo()->GetRank() - 1];
eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_pet_silverback_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_pet_silverback_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_pet_silverback_AuraScript();
}
};
// -61680 - Culling the Herd
class spell_pet_culling_the_herd : public SpellScriptLoader
{
public:
spell_pet_culling_the_herd() : SpellScriptLoader("spell_pet_culling_the_herd") { }
class spell_pet_culling_the_herd_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pet_culling_the_herd_AuraScript);
bool CheckProc(ProcEventInfo& eventInfo)
{
// Claw, Bite and Smack share FamilyFlags with other spells
// filter by spellIcon instead
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
if (!spellInfo)
return false;
switch (spellInfo->SpellIconID)
{
case PET_ICON_ID_CLAW:
case PET_ICON_ID_BITE:
case PET_ICON_ID_SMACK:
break;
default:
return false;
}
return true;
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_pet_culling_the_herd_AuraScript::CheckProc);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_pet_culling_the_herd_AuraScript();
}
};
void AddSC_hunter_pet_scripts()
{
new npc_pet_hunter_snake_trap();
new spell_pet_guard_dog();
new spell_pet_silverback();
new spell_pet_culling_the_herd();
}

View File

@@ -28,7 +28,7 @@
enum PriestSpells
{
SPELL_PRIEST_GLYPH_OF_SHADOWFIEND = 58228,
SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA = 58227,
SPELL_PRIEST_SHADOWFIEND_DEATH = 57989,
SPELL_PRIEST_LIGHTWELL_CHARGES = 59907
};
@@ -70,12 +70,10 @@ class npc_pet_pri_shadowfiend : public CreatureScript
{
npc_pet_pri_shadowfiendAI(Creature* creature) : PetAI(creature) { }
void JustDied(Unit* /*killer*/) override
void IsSummonedBy(Unit* summoner) override
{
if (me->IsSummon())
if (Unit* owner = me->ToTempSummon()->GetSummoner())
if (owner->HasAura(SPELL_PRIEST_GLYPH_OF_SHADOWFIEND))
owner->CastSpell(owner, SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA, true);
if (summoner->HasAura(SPELL_PRIEST_GLYPH_OF_SHADOWFIEND))
DoCastAOE(SPELL_PRIEST_SHADOWFIEND_DEATH);
}
};