Misc stuff

This commit is contained in:
hondacrx
2022-05-30 14:19:00 -04:00
parent c3b1daca3f
commit 69ebe041cf
4 changed files with 57 additions and 93 deletions
+25 -76
View File
@@ -586,27 +586,6 @@ namespace Scripts.Spells.Generic
}
}
[Script]
class spell_gen_arcane_charge : SpellScript
{
SpellCastResult CheckRequirement()
{
Unit target = GetExplTargetUnit();
if (target != null)
{
if ((target.GetCreatureTypeMask() & (uint)CreatureType.MaskDemonOrUndead) == 0)
return SpellCastResult.DontReport;
}
return SpellCastResult.SpellCastOk;
}
public override void Register()
{
OnCheckCast.Add(new CheckCastHandler(CheckRequirement));
}
}
// 430 Drink
// 431 Drink
// 432 Drink
@@ -707,23 +686,6 @@ namespace Scripts.Spells.Generic
}
}
[Script] // 41337 Aura of Anger
class spell_gen_aura_of_anger : AuraScript
{
void HandleEffectPeriodicUpdate(AuraEffect aurEff)
{
AuraEffect aurEff1 = aurEff.GetBase().GetEffect(1);
if (aurEff1 != null)
aurEff1.ChangeAmount(aurEff1.GetAmount() + 5);
aurEff.SetAmount(100 * (int)aurEff.GetTickNumber());
}
public override void Register()
{
OnEffectUpdatePeriodic.Add(new EffectUpdatePeriodicHandler(HandleEffectPeriodicUpdate, 0, AuraType.PeriodicDamage));
}
}
[Script] // 28313 - Aura of Fear
class spell_gen_aura_of_fear : AuraScript
{
@@ -976,21 +938,6 @@ namespace Scripts.Spells.Generic
}
}
[Script] // 46394 Brutallus Burn
class spell_gen_burn_brutallus : AuraScript
{
void HandleEffectPeriodicUpdate(AuraEffect aurEff)
{
if (aurEff.GetTickNumber() % 11 == 0)
aurEff.SetAmount(aurEff.GetAmount() * 2);
}
public override void Register()
{
OnEffectUpdatePeriodic.Add(new EffectUpdatePeriodicHandler(HandleEffectPeriodicUpdate, 0, AuraType.PeriodicDamage));
}
}
[Script] // 48750 - Burning Depths Necrolyte Image
class spell_gen_burning_depths_necrolyte_image : AuraScript
{
@@ -1287,6 +1234,31 @@ namespace Scripts.Spells.Generic
}
}
// 28865 - Consumption
[Script] // 64208 - Consumption
class spell_gen_consumption : SpellScript
{
void HandleDamageCalc(uint effIndex)
{
Unit caster = GetCaster();
if (caster == null || !caster.IsCreature())
return;
int damage = 0;
SpellInfo createdBySpell = Global.SpellMgr.GetSpellInfo(caster.m_unitData.CreatedBySpell, GetCastDifficulty());
if (createdBySpell != null)
damage = createdBySpell.GetEffect(2).CalcValue();
if (damage != 0)
SetEffectValue(damage);
}
public override void Register()
{
OnEffectLaunchTarget.Add(new EffectHandler(HandleDamageCalc, 0, SpellEffectName.SchoolDamage));
}
}
[Script] // 63845 - Create Lance
class spell_gen_create_lance : SpellScript
{
@@ -2160,29 +2132,6 @@ namespace Scripts.Spells.Generic
}
}
[Script] // 46284 - Negative Energy Periodic
class spell_gen_negative_energy_periodic : AuraScript
{
public override bool Validate(SpellInfo spellInfo)
{
return !spellInfo.GetEffects().Empty() && ValidateSpellInfo(spellInfo.GetEffect(0).TriggerSpell);
}
void PeriodicTick(AuraEffect aurEff)
{
PreventDefaultAction();
CastSpellExtraArgs args = new(aurEff);
args.AddSpellMod(SpellValueMod.MaxTargets, (int)aurEff.GetTickNumber() / 10 + 1);
GetTarget().CastSpell((Unit)null, aurEff.GetSpellEffectInfo().TriggerSpell, args);
}
public override void Register()
{
OnEffectPeriodic.Add(new EffectPeriodicHandler(PeriodicTick, 0, AuraType.PeriodicTriggerSpell));
}
}
[Script] // 28702 - Netherbloom
class spell_gen_netherbloom : SpellScript
{