Some Cleanups

This commit is contained in:
hondacrx
2021-06-07 18:06:16 -04:00
parent cb7640e3c6
commit 302a1f293c
53 changed files with 382 additions and 477 deletions
+2 -2
View File
@@ -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:
+1 -1
View File
@@ -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);
+4 -6
View File
@@ -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())
{
+1 -1
View File
@@ -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)
{
+1 -2
View File
@@ -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)