Cleanup some warnings.
This commit is contained in:
@@ -49,7 +49,7 @@ namespace Scripts.Pets
|
||||
return;
|
||||
|
||||
// Find victim of Summon Gargoyle spell
|
||||
List<Unit> targets = new List<Unit>();
|
||||
List<Unit> targets = new();
|
||||
var u_check = new AnyUnfriendlyUnitInObjectRangeCheck(me, me, 30.0f);
|
||||
var searcher = new UnitListSearcher(me, targets, u_check);
|
||||
Cell.VisitAllObjects(me, searcher, 30.0f);
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Scripts.Smart
|
||||
return false;
|
||||
|
||||
Log.outDebug(LogFilter.ScriptsAi, "AreaTrigger {0} is using SmartTrigger script", trigger.Id);
|
||||
SmartScript script = new SmartScript();
|
||||
SmartScript script = new();
|
||||
script.OnInitialize(trigger);
|
||||
script.ProcessEventsFor(SmartEvents.AreatriggerOntrigger, player, trigger.Id);
|
||||
return true;
|
||||
@@ -60,28 +60,28 @@ namespace Scripts.Smart
|
||||
|
||||
public override void OnSceneStart(Player player, uint sceneInstanceID, SceneTemplate sceneTemplate)
|
||||
{
|
||||
SmartScript smartScript = new SmartScript();
|
||||
SmartScript smartScript = new();
|
||||
smartScript.OnInitialize(sceneTemplate);
|
||||
smartScript.ProcessEventsFor(SmartEvents.SceneStart, player);
|
||||
}
|
||||
|
||||
public override void OnSceneTriggerEvent(Player player, uint sceneInstanceID, SceneTemplate sceneTemplate, string triggerName)
|
||||
{
|
||||
SmartScript smartScript = new SmartScript();
|
||||
SmartScript smartScript = new();
|
||||
smartScript.OnInitialize(sceneTemplate);
|
||||
smartScript.ProcessEventsFor(SmartEvents.SceneTrigger, player, 0, 0, false, null, null, triggerName);
|
||||
}
|
||||
|
||||
public override void OnSceneCancel(Player player, uint sceneInstanceID, SceneTemplate sceneTemplate)
|
||||
{
|
||||
SmartScript smartScript = new SmartScript();
|
||||
SmartScript smartScript = new();
|
||||
smartScript.OnInitialize(sceneTemplate);
|
||||
smartScript.ProcessEventsFor(SmartEvents.SceneCancel, player);
|
||||
}
|
||||
|
||||
public override void OnSceneComplete(Player player, uint sceneInstanceID, SceneTemplate sceneTemplate)
|
||||
{
|
||||
SmartScript smartScript = new SmartScript();
|
||||
SmartScript smartScript = new();
|
||||
smartScript.OnInitialize(sceneTemplate);
|
||||
smartScript.ProcessEventsFor(SmartEvents.SceneComplete, player);
|
||||
}
|
||||
@@ -95,7 +95,7 @@ namespace Scripts.Smart
|
||||
// Called when a quest status change
|
||||
public override void OnQuestStatusChange(Player player, Quest quest, QuestStatus oldStatus, QuestStatus newStatus)
|
||||
{
|
||||
SmartScript smartScript = new SmartScript();
|
||||
SmartScript smartScript = new();
|
||||
smartScript.OnInitialize(quest);
|
||||
switch (newStatus)
|
||||
{
|
||||
@@ -123,7 +123,7 @@ namespace Scripts.Smart
|
||||
ushort slot = player.FindQuestSlot(quest.Id);
|
||||
if (slot < SharedConst.MaxQuestLogSize && player.IsQuestObjectiveComplete(slot, quest, objective))
|
||||
{
|
||||
SmartScript smartScript = new SmartScript();
|
||||
SmartScript smartScript = new();
|
||||
smartScript.OnInitialize(quest);
|
||||
smartScript.ProcessEventsFor(SmartEvents.QuestObjCompletion, player, objective.Id);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -139,8 +139,8 @@ namespace Scripts.World.Areatriggers
|
||||
public const uint TypeWaypoint = 0;
|
||||
public const uint DataStart = 0;
|
||||
|
||||
public static Position StormforgedMonitorPosition = new Position(6963.95f, 45.65f, 818.71f, 4.948f);
|
||||
public static Position StormforgedEradictorPosition = new Position(6983.18f, 7.15f, 806.33f, 2.228f);
|
||||
public static Position StormforgedMonitorPosition = new(6963.95f, 45.65f, 818.71f, 4.948f);
|
||||
public static Position StormforgedEradictorPosition = new(6983.18f, 7.15f, 806.33f, 2.228f);
|
||||
}
|
||||
|
||||
[Script]
|
||||
|
||||
@@ -981,7 +981,7 @@ namespace Scripts.World.GameObjects
|
||||
me.UseDoorOrButton();
|
||||
if (player.GetQuestStatus(QuestIds.MissingFriends) == QuestStatus.Incomplete)
|
||||
{
|
||||
List<Creature> childrenList = new List<Creature>();
|
||||
List<Creature> childrenList = new();
|
||||
me.GetCreatureListWithEntryInGrid(childrenList, CreatureIds.CaptiveChild, SharedConst.InteractionDistance);
|
||||
foreach (Creature creature in childrenList)
|
||||
{
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace Scripts.World.ItemScripts
|
||||
|
||||
public override bool OnExpire(Player player, ItemTemplate pItemProto)
|
||||
{
|
||||
List<ItemPosCount> dest = new List<ItemPosCount>();
|
||||
List<ItemPosCount> dest = new();
|
||||
InventoryResult msg = player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, 39883, 1); // Cracked Egg
|
||||
if (msg == InventoryResult.Ok)
|
||||
player.StoreNewItem(dest, 39883, true, ItemEnchantmentManager.GenerateItemRandomBonusListId(39883));
|
||||
@@ -204,7 +204,7 @@ namespace Scripts.World.ItemScripts
|
||||
|
||||
public override bool OnExpire(Player player, ItemTemplate pItemProto)
|
||||
{
|
||||
List<ItemPosCount> dest = new List<ItemPosCount>();
|
||||
List<ItemPosCount> dest = new();
|
||||
InventoryResult msg = player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, 44718, 1); // Ripe Disgusting Jar
|
||||
if (msg == InventoryResult.Ok)
|
||||
player.StoreNewItem(dest, 44718, true, ItemEnchantmentManager.GenerateItemRandomBonusListId(44718));
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace Scripts.World.NpcSpecial
|
||||
public const uint StuffingServer = 61795;
|
||||
public const uint TurkeyServer = 61796;
|
||||
public const uint SweetPotatoesServer = 61797;
|
||||
public static Dictionary<uint, uint> ChairSpells = new Dictionary<uint, uint>()
|
||||
public static Dictionary<uint, uint> ChairSpells = new()
|
||||
{
|
||||
{ CreatureIds.TheCranberryChair, CranberryServer },
|
||||
{ CreatureIds.ThePieChair, PieServer },
|
||||
@@ -409,7 +409,7 @@ namespace Scripts.World.NpcSpecial
|
||||
};
|
||||
|
||||
//alliance run to where
|
||||
public static Position DoctorAllianceRunTo = new Position(-3742.96f, -4531.52f, 11.91f);
|
||||
public static Position DoctorAllianceRunTo = new(-3742.96f, -4531.52f, 11.91f);
|
||||
|
||||
public static Position[] DoctorHordeCoords =
|
||||
{
|
||||
@@ -422,7 +422,7 @@ namespace Scripts.World.NpcSpecial
|
||||
};
|
||||
|
||||
//horde run to where
|
||||
public static Position DoctorHordeRunTo = new Position(-1016.44f, -3508.48f, 62.96f);
|
||||
public static Position DoctorHordeRunTo = new(-1016.44f, -3508.48f, 62.96f);
|
||||
|
||||
public static uint[] AllianceSoldierId =
|
||||
{
|
||||
@@ -445,7 +445,7 @@ namespace Scripts.World.NpcSpecial
|
||||
public const uint AnimGoLaunchFirework = 3;
|
||||
public const uint ZoneMoonglade = 493;
|
||||
|
||||
public static Position omenSummonPos = new Position(7558.993f, -2839.999f, 450.0214f, 4.46f);
|
||||
public static Position omenSummonPos = new(7558.993f, -2839.999f, 450.0214f, 4.46f);
|
||||
|
||||
public const uint AuraDurationTimeLeft = 5000;
|
||||
|
||||
@@ -761,7 +761,7 @@ namespace Scripts.World.NpcSpecial
|
||||
|
||||
ObjectGuid DoSearchForTargets(ObjectGuid lastTargetGUID)
|
||||
{
|
||||
List<Creature> targets = new List<Creature>();
|
||||
List<Creature> targets = new();
|
||||
me.GetCreatureListWithEntryInGrid(targets, CreatureIds.TorchTossingTargetBunny, 60.0f);
|
||||
targets.RemoveAll(creature => creature.GetGUID() == lastTargetGUID);
|
||||
|
||||
@@ -854,7 +854,7 @@ namespace Scripts.World.NpcSpecial
|
||||
bool checkNearbyPlayers()
|
||||
{
|
||||
// Returns true if no nearby player has aura "Test Ribbon Pole Channel".
|
||||
List<Unit> players = new List<Unit>();
|
||||
List<Unit> players = new();
|
||||
var check = new UnitAuraCheck<Player>(true, SpellIds.RibbonDanceCosmetic);
|
||||
var searcher = new PlayerListSearcher(me, players, check);
|
||||
Cell.VisitWorldObjects(me, searcher, 10.0f);
|
||||
@@ -1055,8 +1055,8 @@ namespace Scripts.World.NpcSpecial
|
||||
|
||||
bool Event;
|
||||
|
||||
List<ObjectGuid> Patients = new List<ObjectGuid>();
|
||||
List<Position> Coordinates = new List<Position>();
|
||||
List<ObjectGuid> Patients = new();
|
||||
List<Position> Coordinates = new();
|
||||
}
|
||||
|
||||
[Script]
|
||||
@@ -2319,7 +2319,7 @@ namespace Scripts.World.NpcSpecial
|
||||
break;
|
||||
}
|
||||
|
||||
MoveSplineInit init = new MoveSplineInit(who);
|
||||
MoveSplineInit init = new(who);
|
||||
init.DisableTransportPathTransformations();
|
||||
init.MoveTo(x, y, z, false);
|
||||
init.SetFacing(o);
|
||||
|
||||
Reference in New Issue
Block a user