Some Cleanups
This commit is contained in:
@@ -1313,7 +1313,7 @@ namespace Game.Spells
|
||||
if (aurEff != null)
|
||||
{
|
||||
float multiplier = aurEff.GetAmount();
|
||||
CastSpellExtraArgs args = new CastSpellExtraArgs(TriggerCastFlags.FullMask);
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, MathFunctions.CalculatePct(caster.GetMaxPower(PowerType.Mana), multiplier));
|
||||
caster.CastSpell(caster, 47755, args);
|
||||
}
|
||||
@@ -2487,7 +2487,7 @@ namespace Game.Spells
|
||||
if (casterGUID != owner.GetGUID() && spellproto.IsSingleTarget())
|
||||
return null;
|
||||
|
||||
Aura aura = null;
|
||||
Aura aura;
|
||||
switch (owner.GetTypeId())
|
||||
{
|
||||
case TypeId.Unit:
|
||||
|
||||
@@ -5625,7 +5625,7 @@ namespace Game.Spells
|
||||
// on apply cast summon spell
|
||||
if (apply)
|
||||
{
|
||||
CastSpellExtraArgs args = new CastSpellExtraArgs(TriggerCastFlags.FullMask);
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.TriggeringAura = this;
|
||||
args.CastDifficulty = triggerSpellInfo.Difficulty;
|
||||
target.CastSpell(target, triggerSpellInfo.Id, args);
|
||||
|
||||
@@ -255,8 +255,8 @@ namespace Game.Spells
|
||||
if (Convert.ToBoolean(implicitTargetMask & (SpellCastTargetFlags.Gameobject | SpellCastTargetFlags.GameobjectItem)))
|
||||
m_targets.SetTargetFlag(SpellCastTargetFlags.Gameobject);
|
||||
|
||||
SelectEffectImplicitTargets(effect.EffectIndex, effect.TargetA, processedAreaEffectsMask);
|
||||
SelectEffectImplicitTargets(effect.EffectIndex, effect.TargetB, processedAreaEffectsMask);
|
||||
SelectEffectImplicitTargets(effect.EffectIndex, effect.TargetA, ref processedAreaEffectsMask);
|
||||
SelectEffectImplicitTargets(effect.EffectIndex, effect.TargetB, ref processedAreaEffectsMask);
|
||||
|
||||
// Select targets of effect based on effect type
|
||||
// those are used when no valid target could be added for spell effect based on spell target type
|
||||
@@ -325,7 +325,7 @@ namespace Game.Spells
|
||||
m_caster.m_Events.ModifyEventTime(_spellEvent, GetDelayStart() + m_delayMoment);
|
||||
}
|
||||
|
||||
void SelectEffectImplicitTargets(uint effIndex, SpellImplicitTargetInfo targetType, uint processedEffectMask)
|
||||
void SelectEffectImplicitTargets(uint effIndex, SpellImplicitTargetInfo targetType, ref uint processedEffectMask)
|
||||
{
|
||||
if (targetType.GetTarget() == 0)
|
||||
return;
|
||||
@@ -2168,7 +2168,7 @@ namespace Game.Spells
|
||||
basePoints[auraSpellEffect.EffectIndex] = (m_spellValue.CustomBasePointsMask & (1 << (int)auraSpellEffect.EffectIndex)) != 0 ?
|
||||
m_spellValue.EffectBasePoints[auraSpellEffect.EffectIndex] : auraSpellEffect.CalcBaseValue(m_originalCaster, unit, m_castItemEntry, m_castItemLevel);
|
||||
|
||||
bool refresh = false;
|
||||
bool refresh;
|
||||
bool resetPeriodicTimer = !_triggeredCastFlags.HasAnyFlag(TriggerCastFlags.DontResetPeriodicTimer);
|
||||
m_spellAura = Aura.TryRefreshStackOrCreate(m_spellInfo, m_castId, effectMask, unit,
|
||||
m_originalCaster, GetCastDifficulty(), out refresh, basePoints, m_CastItem, ObjectGuid.Empty, resetPeriodicTimer, ObjectGuid.Empty, m_castItemEntry, m_castItemLevel);
|
||||
@@ -4822,8 +4822,6 @@ namespace Game.Spells
|
||||
}
|
||||
}
|
||||
|
||||
castResult = SpellCastResult.SpellCastOk;
|
||||
|
||||
// always (except passive spells) check items (focus object can be required for any type casts)
|
||||
if (!m_spellInfo.IsPassive())
|
||||
{
|
||||
|
||||
@@ -1044,7 +1044,7 @@ namespace Game.Spells
|
||||
|
||||
// can the player store the new item?
|
||||
List<ItemPosCount> dest = new();
|
||||
uint no_space = 0;
|
||||
uint no_space;
|
||||
InventoryResult msg = player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, newitemid, num_to_add, out no_space);
|
||||
if (msg != InventoryResult.Ok)
|
||||
{
|
||||
|
||||
@@ -1854,7 +1854,7 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
public void LoadPetDefaultSpells()
|
||||
{
|
||||
{
|
||||
uint oldMSTime = Time.GetMSTime();
|
||||
|
||||
mPetDefaultSpellsMap.Clear();
|
||||
@@ -1862,7 +1862,6 @@ namespace Game.Entities
|
||||
uint countCreature = 0;
|
||||
|
||||
Log.outInfo(LogFilter.ServerLoading, "Loading summonable creature templates...");
|
||||
oldMSTime = Time.GetMSTime();
|
||||
|
||||
// different summon spells
|
||||
foreach (var spellEntry in mSpellInfoMap.Values)
|
||||
|
||||
Reference in New Issue
Block a user