Cleanup some warnings.
This commit is contained in:
@@ -268,7 +268,7 @@ namespace Scripts.Spells.DeathKnight
|
||||
return;
|
||||
|
||||
int amount = (int)damageInfo.GetDamage() / 2;
|
||||
SpellNonMeleeDamage log = new SpellNonMeleeDamage(drw, drw.GetVictim(), spellInfo, new SpellCastVisual(spellInfo.GetSpellXSpellVisualId(drw), 0), spellInfo.GetSchoolMask());
|
||||
SpellNonMeleeDamage log = new(drw, drw.GetVictim(), spellInfo, new SpellCastVisual(spellInfo.GetSpellXSpellVisualId(drw), 0), spellInfo.GetSchoolMask());
|
||||
log.damage = (uint)amount;
|
||||
Unit.DealDamage(drw, drw.GetVictim(), (uint)amount, null, DamageEffectType.SpellDirect, spellInfo.GetSchoolMask(), spellInfo, true);
|
||||
drw.SendSpellNonMeleeDamageLog(log);
|
||||
|
||||
@@ -2270,7 +2270,7 @@ namespace Scripts.Spells.Generic
|
||||
if (player.GetLastPetNumber() != 0)
|
||||
{
|
||||
PetType newPetType = (player.GetClass() == Class.Hunter) ? PetType.Hunter : PetType.Summon;
|
||||
Pet newPet = new Pet(player, newPetType);
|
||||
Pet newPet = new(player, newPetType);
|
||||
if (newPet.LoadPetFromDB(player, 0, player.GetLastPetNumber(), true))
|
||||
{
|
||||
// revive the pet if it is dead
|
||||
@@ -2723,7 +2723,7 @@ namespace Scripts.Spells.Generic
|
||||
Unit target = GetHitUnit();
|
||||
if (target)
|
||||
{
|
||||
SpiritHealerConfirm spiritHealerConfirm = new SpiritHealerConfirm();
|
||||
SpiritHealerConfirm spiritHealerConfirm = new();
|
||||
spiritHealerConfirm.Unit = target.GetGUID();
|
||||
originalCaster.SendPacket(spiritHealerConfirm);
|
||||
}
|
||||
@@ -2972,7 +2972,7 @@ namespace Scripts.Spells.Generic
|
||||
[Script]
|
||||
class spell_gen_turkey_marker : AuraScript
|
||||
{
|
||||
readonly List<uint> _applyTimes = new List<uint>();
|
||||
readonly List<uint> _applyTimes = new();
|
||||
|
||||
void OnApply(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
|
||||
@@ -189,8 +189,8 @@ namespace Scripts.Spells.Holiday
|
||||
bool foundSomeone = false;
|
||||
// For nearby players, check if they have the same aura. If so, cast Romantic Picnic (45123)
|
||||
// required by achievement and "hearts" visual
|
||||
List<Unit> playerList = new List<Unit>();
|
||||
AnyPlayerInObjectRangeCheck checker = new AnyPlayerInObjectRangeCheck(target, SharedConst.InteractionDistance * 2);
|
||||
List<Unit> playerList = new();
|
||||
AnyPlayerInObjectRangeCheck checker = new(target, SharedConst.InteractionDistance * 2);
|
||||
var searcher = new PlayerListSearcher(target, playerList, checker);
|
||||
Cell.VisitWorldObjects(target, searcher, SharedConst.InteractionDistance * 2);
|
||||
foreach (Player player in playerList)
|
||||
|
||||
@@ -1139,7 +1139,7 @@ namespace Scripts.Spells.Items
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
List<uint> possibleSpells = new List<uint>();
|
||||
List<uint> possibleSpells = new();
|
||||
switch (caster.GetClass())
|
||||
{
|
||||
case Class.Warlock:
|
||||
@@ -2165,7 +2165,7 @@ namespace Scripts.Spells.Items
|
||||
{
|
||||
SpellCastResult CheckRequirement()
|
||||
{
|
||||
List<TempSummon> ghouls = new List<TempSummon>();
|
||||
List<TempSummon> ghouls = new();
|
||||
GetCaster().GetAllMinionsByEntry(ghouls, CreatureIds.Ghoul);
|
||||
if (ghouls.Count >= CreatureIds.MaxGhouls)
|
||||
{
|
||||
@@ -3530,7 +3530,7 @@ namespace Scripts.Spells.Items
|
||||
{
|
||||
void SecondaryEffect()
|
||||
{
|
||||
List<uint> availableElixirs = new List<uint>()
|
||||
List<uint> availableElixirs = new()
|
||||
{
|
||||
// Battle Elixirs
|
||||
33720, // Onslaught Elixir (28102)
|
||||
@@ -3599,7 +3599,7 @@ namespace Scripts.Spells.Items
|
||||
{
|
||||
void SecondaryEffect()
|
||||
{
|
||||
List<uint> availableElixirs = new List<uint>()
|
||||
List<uint> availableElixirs = new()
|
||||
{
|
||||
43185, // Runic Healing Potion (33447)
|
||||
53750, // Crazy Alchemist's Potion (40077)
|
||||
|
||||
@@ -524,7 +524,7 @@ namespace Scripts.Spells.Mage
|
||||
[Script] // Ice Lance - 30455
|
||||
class spell_mage_ice_lance : SpellScript
|
||||
{
|
||||
List<ObjectGuid> _orderedTargets = new List<ObjectGuid>();
|
||||
List<ObjectGuid> _orderedTargets = new();
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
@@ -788,7 +788,7 @@ namespace Scripts.Spells.Mage
|
||||
|
||||
void Apply(AuraEffect aurEff, AuraEffectHandleModes mode)
|
||||
{
|
||||
List<TempSummon> minions = new List<TempSummon>();
|
||||
List<TempSummon> minions = new();
|
||||
GetTarget().GetAllMinionsByEntry(minions, (uint)Global.SpellMgr.GetSpellInfo(SpellIds.RingOfFrostSummon, GetCastDifficulty()).GetEffect(0).MiscValue);
|
||||
|
||||
// Get the last summoned RoF, save it and despawn older ones
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace Scripts.Spells.Priest
|
||||
[Script] // 81749 - Atonement
|
||||
public class spell_pri_atonement : AuraScript
|
||||
{
|
||||
List<ObjectGuid> _appliedAtonements = new List<ObjectGuid>();
|
||||
List<ObjectGuid> _appliedAtonements = new();
|
||||
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
@@ -372,7 +372,7 @@ namespace Scripts.Spells.Priest
|
||||
{
|
||||
Position destPos = GetHitDest().GetPosition();
|
||||
|
||||
SpellCastTargets targets = new SpellCastTargets();
|
||||
SpellCastTargets targets = new();
|
||||
targets.SetDst(destPos);
|
||||
targets.SetUnitTarget(GetCaster());
|
||||
GetHitUnit().CastSpell(targets, (uint)GetEffectValue(), new CastSpellExtraArgs(GetCastDifficulty()));
|
||||
@@ -1002,7 +1002,7 @@ namespace Scripts.Spells.Priest
|
||||
}
|
||||
else
|
||||
{
|
||||
CastSpellExtraArgs args = new CastSpellExtraArgs(TriggerCastFlags.FullMask);
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.CastDifficulty = GetCastDifficulty();
|
||||
GetCaster().CastSpell(destPos, SpellIds.AngelicFeatherAreatrigger, args);
|
||||
}
|
||||
|
||||
@@ -1295,9 +1295,9 @@ namespace Scripts.Spells.Quest
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
// Check for player that is in 65 y range
|
||||
List<Unit> playerList = new List<Unit>();
|
||||
AnyPlayerInObjectRangeCheck checker = new AnyPlayerInObjectRangeCheck(caster, 65.0f);
|
||||
PlayerListSearcher searcher = new PlayerListSearcher(caster, playerList, checker);
|
||||
List<Unit> playerList = new();
|
||||
AnyPlayerInObjectRangeCheck checker = new(caster, 65.0f);
|
||||
PlayerListSearcher searcher = new(caster, playerList, checker);
|
||||
Cell.VisitWorldObjects(caster, searcher, 65.0f);
|
||||
foreach (Player player in playerList)
|
||||
{
|
||||
@@ -1366,7 +1366,7 @@ namespace Scripts.Spells.Quest
|
||||
void SetDest(ref SpellDestination dest)
|
||||
{
|
||||
// Adjust effect summon position
|
||||
Position offset = new Position(0.0f, 0.0f, 20.0f, 0.0f);
|
||||
Position offset = new(0.0f, 0.0f, 20.0f, 0.0f);
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
@@ -1426,7 +1426,7 @@ namespace Scripts.Spells.Quest
|
||||
void SetDest(ref SpellDestination dest)
|
||||
{
|
||||
// Adjust effect summon position
|
||||
Position offset = new Position(0.0f, 0.0f, 20.0f, 0.0f);
|
||||
Position offset = new(0.0f, 0.0f, 20.0f, 0.0f);
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
@@ -1443,7 +1443,7 @@ namespace Scripts.Spells.Quest
|
||||
void SetDest(ref SpellDestination dest)
|
||||
{
|
||||
// Adjust effect summon position
|
||||
Position offset = new Position(0.0f, 0.0f, 2.5f, 0.0f);
|
||||
Position offset = new(0.0f, 0.0f, 2.5f, 0.0f);
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace Scripts.Spells.Rogue
|
||||
_targets.Add(target.GetGUID());
|
||||
}
|
||||
|
||||
List<ObjectGuid> _targets = new List<ObjectGuid>();
|
||||
List<ObjectGuid> _targets = new();
|
||||
}
|
||||
|
||||
[Script] // 2098 - Eviscerate
|
||||
|
||||
@@ -278,7 +278,7 @@ namespace Scripts.Spells.Warlock
|
||||
if (modOwner)
|
||||
modOwner.ApplySpellMod(GetSpellInfo(), SpellModOp.PowerCost0, ref damage);
|
||||
|
||||
SpellNonMeleeDamage damageInfo = new SpellNonMeleeDamage(caster, caster, GetSpellInfo(), GetAura().GetSpellVisual(), GetSpellInfo().SchoolMask, GetAura().GetCastId());
|
||||
SpellNonMeleeDamage damageInfo = new(caster, caster, GetSpellInfo(), GetAura().GetSpellVisual(), GetSpellInfo().SchoolMask, GetAura().GetCastId());
|
||||
damageInfo.periodicLog = true;
|
||||
damageInfo.damage = damage;
|
||||
caster.DealSpellDamage(damageInfo, false);
|
||||
@@ -473,7 +473,7 @@ namespace Scripts.Spells.Warlock
|
||||
public List<uint> GetDotList() { return _dotList; }
|
||||
public Unit GetOriginalSwapSource() { return _swapCaster; }
|
||||
public void SetOriginalSwapSource(Unit victim) { _swapCaster = victim; }
|
||||
List<uint> _dotList = new List<uint>();
|
||||
List<uint> _dotList = new();
|
||||
Unit _swapCaster;
|
||||
}
|
||||
|
||||
@@ -547,7 +547,7 @@ namespace Scripts.Spells.Warlock
|
||||
GetCaster().CastSpell(GetCaster(), SpellIds.SoulSwapModCost, true);
|
||||
bool hasGlyph = GetCaster().HasAura(SpellIds.GlyphOfSoulSwap);
|
||||
|
||||
List<uint> dotList = new List<uint>();
|
||||
List<uint> dotList = new();
|
||||
Unit swapSource = null;
|
||||
Aura swapOverride = GetCaster().GetAura(SpellIds.SoulSwapOverride);
|
||||
if (swapOverride != null)
|
||||
@@ -671,7 +671,7 @@ namespace Scripts.Spells.Warlock
|
||||
void HandleDummyTick(AuraEffect aurEff)
|
||||
{
|
||||
List<AreaTrigger> rainOfFireAreaTriggers = GetTarget().GetAreaTriggers(SpellIds.RainOfFire);
|
||||
List<ObjectGuid> targetsInRainOfFire = new List<ObjectGuid>();
|
||||
List<ObjectGuid> targetsInRainOfFire = new();
|
||||
|
||||
foreach (AreaTrigger rainOfFireAreaTrigger in rainOfFireAreaTriggers)
|
||||
{
|
||||
|
||||
@@ -196,7 +196,7 @@ namespace Scripts.Spells.Warrior
|
||||
{
|
||||
float range = GetSpellInfo().GetMaxRange(true, GetCaster()) * 1.5f;
|
||||
|
||||
PathGenerator generatedPath = new PathGenerator(GetCaster());
|
||||
PathGenerator generatedPath = new(GetCaster());
|
||||
generatedPath.SetPathLengthLimit(range);
|
||||
|
||||
bool result = generatedPath.CalculatePath(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(), false, true);
|
||||
|
||||
Reference in New Issue
Block a user