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
+2 -1
View File
@@ -3233,7 +3233,8 @@ namespace Game.Entities
21855, // Challenge Flag
38762, // Force of Neltharaku
51122, // Fierce Lightning Stike
71848 // Toxic Wasteling Find Target
71848, // Toxic Wasteling Find Target
36146 // Chains of Naberius
}, spellInfo =>
{
spellInfo.MaxAffectedTargets = 1;
+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
{
-16
View File
@@ -2608,22 +2608,6 @@ namespace Scripts.Spells.Items
}
}
[Script]
class spell_item_shimmering_vessel : SpellScript
{
void HandleDummy(uint effIndex)
{
Creature target = GetHitCreature();
if (target)
target.SetDeathState(DeathState.JustRespawned);
}
public override void Register()
{
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
}
}
[Script]
class spell_item_purify_helboar_meat : SpellScript
{
+30
View File
@@ -1775,6 +1775,36 @@ namespace Scripts.Spells.Quest
AfterEffectRemove.Add(new EffectApplyHandler(OnRemove, 1, AuraType.Dummy, AuraEffectHandleModes.Real));
}
}
[Script] // 53099, 57896, 58418, 58420, 59064, 59065, 59439, 60900, 60940
class spell_quest_portal_with_condition : SpellScript
{
public override bool Validate(SpellInfo spellInfo)
{
return spellInfo.GetEffects().Count > 1
&& ValidateSpellInfo((uint)spellInfo.GetEffect(0).CalcValue())
&& Global.ObjectMgr.GetQuestTemplate((uint)spellInfo.GetEffect(1).CalcValue()) != null;
}
void HandleScriptEffect(uint effIndex)
{
Player target = GetHitPlayer();
if (target == null)
return;
uint spellId = (uint)GetEffectInfo().CalcValue();
uint questId = (uint)GetEffectInfo(1).CalcValue();
// This probably should be a way to throw error in SpellCastResult
if (target.IsActiveQuest(questId))
target.CastSpell(target, spellId, true);
}
public override void Register()
{
OnEffectHitTarget.Add(new EffectHandler(HandleScriptEffect, 0, SpellEffectName.ScriptEffect));
}
}
[Script] // 48682 - Escape from Silverbrook - Periodic Dummy
class spell_q12308_escape_from_silverbrook : SpellScript